// Light
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.65 on Sun Sep 24 10:57:12 2017
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                10   xyzw        0     NONE   float       
// TEXCOORD                11   xyzw        1     NONE   float       
// SV_Position              0   xyzw        2      POS   float   xyzw
// SV_IsFrontFace           0   x           3    FFACE    uint       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[170], immediateIndexed
dcl_constantbuffer cb1[11], immediateIndexed
dcl_constantbuffer cb2[4], immediateIndexed
dcl_constantbuffer cb3[9], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_input_ps_siv linear noperspective v2.xyzw, position
dcl_output o0.xyzw
//dcl_temps 7

dcl_temps 25

// 3DMigoto StereoParams:
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r25.xyzw, l(0, 0, 0, 0), t125.xyzw

add r0.xy, v2.xyxx, -cb0[116].xyxx
mad r0.xy, r0.xyxx, cb0[117].zwzz, l(-0.500000, -0.500000, 0.000000, 0.000000)
mul r0.xy, r0.xyxx, v2.wwww
mov r0.z, v2.w
mul r0.xyz, r0.xyzx, l(2.000000, -2.000000, 1.000000, 0.000000)
div r0.xy, r0.xyxx, r0.zzzz
mul r0.zw, r0.xxxy, cb0[54].xxxy
mad r0.xy, r0.xyxx, cb0[54].xyxx, cb0[54].wzww
sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r0.xyxx, t0.xyzw, s0, l(0.000000)
mad r1.xyzw, r1.zxyz, l(2.000000, 2.000000, 2.000000, 2.000000), l(-1.000000, -1.000000, -1.000000, -1.000000)
mov_sat r2.x, r1.x
add r2.y, -cb3[6].y, cb3[6].x
mad r2.x, r2.x, r2.y, cb3[6].y
mov_sat r1.x, -r1.x
add r2.y, -r2.x, cb3[6].z
mad r1.x, r1.x, r2.y, r2.x
mul r1.x, r1.x, cb3[6].w
sample_l_indexable(texture2d)(float,float,float,float) r2.xyz, r0.xyxx, t2.xyzw, s2, l(0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r3.xyzw, r0.xyxx, t1.xyzw, s1, l(0.000000)
mul r2.w, r3.x, cb3[7].y
mad r4.xyz, r2.wwww, -r2.xyzx, r2.xyzx
mul r4.xyz, r4.xyzx, cb3[2].xyzx
mul r4.xyz, r1.xxxx, r4.xyzx
sample_l_indexable(texture2d)(float,float,float,float) r1.x, r0.xyxx, t4.xyzw, s4, l(0.000000)
max r1.x, |r1.x|, l(0.000001)
mul r1.x, r1.x, r1.x
dp3 r2.w, r1.yzwy, r1.yzwy
sqrt r2.w, r2.w
div r1.yzw, r1.yyzw, r2.wwww
sample_l_indexable(texture2d)(float,float,float,float) r2.w, r0.xyxx, t3.yzwx, s3, l(0.000000)
mad r4.w, r2.w, cb0[53].x, cb0[53].y
mad r2.w, r2.w, cb0[53].z, -cb0[53].w
div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w
add r2.w, r2.w, r4.w
div r0.zw, r0.zzzw, cb0[54].xxxy
mul r0.zw, r2.wwww, r0.zzzw

//Fix
  add r25.w, r2.w, -r25.y
  mul r25.w, r25.x, r25.w
  add r0.z, r0.z, -r25.w

mul r5.xyzw, r0.wwww, cb0[41].xyzw
mad r5.xyzw, r0.zzzz, cb0[40].xyzw, r5.xyzw
mad r5.xyzw, r2.wwww, cb0[42].xyzw, r5.xyzw
add r5.xyzw, r5.xyzw, cb0[43].xyzw
div r5.xyz, r5.xyzx, r5.wwww
add r6.xyz, r5.xyzx, -cb0[55].xyzx
dp3 r0.z, r6.xyzx, r6.xyzx
sqrt r0.z, r0.z
div r6.xyz, r6.xyzx, r0.zzzz
dp3 r0.z, r1.yzwy, r6.xyzx
dp2 r0.z, r0.zzzz, r1.wwww
add r0.z, -r6.z, r0.z
mad r0.w, cb3[7].z, l(2.000000), l(-1.000000)
mul_sat r0.z, r0.w, r0.z
mad r0.w, cb3[7].z, l(-2.000000), l(1.000000)
mul r0.w, r0.w, r6.z
mad_sat r0.w, r0.w, l(0.250000), l(1.000000)
mul r0.z, r0.w, r0.z
mul r0.w, r3.w, l(255.000000)
mad r1.y, r3.z, l(-18.000000), l(20.000000)
max r0.z, r0.z, l(0.000001)
log r0.z, r0.z
mul r1.y, r0.z, r1.y
exp r1.y, r1.y
dp3 r1.z, r2.xyzx, r2.xyzx
sqrt r1.z, r1.z
div_sat r2.xyz, r2.xyzx, r1.zzzz
add r6.xyz, r2.xyzx, l(-2.000000, -2.000000, -2.000000, 0.000000)
mad r6.xyz, r3.xxxx, r6.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000)
mul r2.xyz, r2.xyzx, r3.xxxx
mul r0.z, r0.z, l(30.000000)
exp r0.z, r0.z
mad r0.z, r0.z, l(19.000000), l(1.000000)
mul r2.xyz, r0.zzzz, r2.xyzx
mul r2.xyz, r1.yyyy, r2.xyzx
mad r1.yzw, r1.yyyy, r6.xxyz, r2.xxyz
mul r0.xy, r0.xyxx, cb0[118].xyxx
ftou r0.xy, r0.xyxx
ftou r0.z, cb0[135].x
iadd r0.x, r0.y, r0.x
iadd r0.x, r0.z, r0.x
round_ne r0.y, r0.w
ftou r0.y, r0.y
and r0.xy, r0.xyxx, l(1, 15, 0, 0)
ieq r0.y, r0.y, l(5)
lt r0.z, l(0.000000), cb0[139].x
lt r0.w, l(0.000000), cb0[169].w
and r0.z, r0.w, r0.z
movc r0.x, r0.x, l(0), l(1.000000)
mul r0.x, r0.x, r3.y
movc r0.x, r0.z, r0.x, r3.y
movc r0.x, r0.y, r0.x, r3.y
add r0.x, r0.x, r3.x
mul r0.xyz, r0.xxxx, r1.yzwy
mul r0.xyz, r0.xyzx, cb3[2].xyzx
mad r0.xyz, r4.xyzx, r1.xxxx, r0.xyzx
add r1.xy, -r5.xyxx, cb2[3].xyxx
dp2 r0.w, r1.xyxx, r1.xyxx
sqrt r0.w, r0.w
add r1.x, r0.w, -cb2[0].x
add r1.x, r1.x, cb2[1].x
div_sat r1.x, r1.x, cb2[1].x
max r1.x, r1.x, l(0.000001)
mad r1.x, -r1.x, r1.x, l(1.000000)
add r1.x, -r1.x, l(1.000000)
add r1.y, |cb2[0].w|, cb2[0].x
add r0.w, r0.w, -r1.y
add r0.w, r0.w, cb2[1].x
div_sat r0.w, r0.w, cb2[1].x
max r0.w, r0.w, l(0.000001)
mad r0.w, -r0.w, r0.w, l(1.000000)
mul r1.y, r0.w, r1.x
mad r0.w, -r1.x, r0.w, l(1.000000)
lt r1.z, l(0.100000), |cb2[0].w|
ge r1.w, cb2[0].w, l(0.000000)
movc r0.w, r1.w, r1.y, r0.w
movc r0.w, r1.z, r0.w, r1.x
max r0.w, r0.w, l(0.000001)
mul r0.w, r0.w, r0.w
mad r0.xyz, r0.wwww, r0.xyzx, cb3[3].xyzx
dp3 r0.w, cb1[2].xyzx, cb1[2].xyzx
sqrt r0.w, r0.w
mul r0.w, r0.w, l(100.000000)
mad r1.x, -cb3[7].z, r0.w, cb1[10].z
add r1.x, -r1.x, r5.z
div r0.w, |r1.x|, r0.w
min r0.w, r0.w, l(1.000000)
add r0.w, -r0.w, l(1.000000)
max r0.w, r0.w, l(0.000001)
log r0.w, r0.w
mul r0.w, r0.w, cb3[7].w
exp r0.w, r0.w
add r1.xyz, cb1[8].xyzx, cb1[9].xyzx
add r2.xyz, -r5.zxyz, r1.zxyz
div_sat r1.w, |r2.x|, cb3[8].x
add r3.xyz, cb1[8].xyzx, -cb1[9].xyzx
add r4.xyz, -r5.zxyz, r3.zxyz
div_sat r2.x, |r4.x|, cb3[8].x
mad r2.x, r1.w, r2.x, -r1.w
mad r1.w, cb3[7].z, r2.x, r1.w
mul r0.w, r0.w, r1.w
dp3 r1.w, cb1[1].xyzx, cb1[1].xyzx
sqrt r1.w, r1.w
mul r1.w, r1.w, cb3[8].y
div r2.x, |r4.y|, r1.w
div r1.w, |r2.y|, r1.w
mul r1.w, r1.w, r2.x
dp3 r2.x, cb1[0].xyzx, cb1[0].xyzx
sqrt r2.x, r2.x
mul r2.x, r2.x, cb3[8].y
div r2.y, |r4.z|, r2.x
div r2.x, |r2.z|, r2.x
mul r2.x, r2.x, r2.y
mul_sat r1.w, r1.w, r2.x
max r1.w, r1.w, l(0.000001)
log r1.w, r1.w
mul r1.w, r1.w, cb3[8].z
exp r1.w, r1.w
mul r0.w, r0.w, r1.w
add r2.xyz, -r3.xyzx, r5.xyzx
lt r2.xyz, l(0.000010, 0.000010, 0.000010, 0.000000), |r2.xyzx|
ge r3.xyz, r5.xyzx, r3.xyzx
and r2.xyz, r2.xyzx, r3.xyzx
and r2.xyz, r2.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
mul r1.w, r2.y, r2.x
mul r1.w, r2.z, r1.w
add r2.xyz, -r1.xyzx, r5.xyzx
lt r2.xyz, l(0.000010, 0.000010, 0.000010, 0.000000), |r2.xyzx|
ge r1.xyz, r5.xyzx, r1.xyzx
movc r1.xyz, r1.xyzx, l(0,0,0,0), l(1.000000,1.000000,1.000000,0)
and r1.xyz, r1.xyzx, r2.xyzx
mul r1.x, r1.y, r1.x
mul r1.x, r1.z, r1.x
mul r1.x, r1.x, r1.w
mul r0.w, r0.w, r1.x
mul_sat r1.w, r0.w, cb3[8].w
max r1.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
lt r0.x, l(0.000000), cb0[124].x
if_nz r0.x
  mul r0.xyzw, v2.yyyy, cb0[37].xyzw
  mad r0.xyzw, v2.xxxx, cb0[36].xyzw, r0.xyzw
  mad r0.xyzw, v2.zzzz, cb0[38].xyzw, r0.xyzw
  add r0.xyzw, r0.xyzw, cb0[39].xyzw
  div r0.xyz, r0.xyzx, r0.wwww
  add r0.xyz, r0.xyzx, -cb0[58].xyzx
  add r2.xyz, r0.xyzx, -cb1[8].xyzx
  add r3.xyz, cb1[9].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  lt r2.xyz, r3.xyzx, |r2.xyzx|
  or r0.w, r2.y, r2.x
  or r0.w, r2.z, r0.w
  dp3 r0.x, r0.xyzx, l(0.577000, 0.577000, 0.577000, 0.000000)
  mul r0.x, r0.x, l(0.002000)
  frc r0.x, r0.x
  lt r0.x, l(0.500000), r0.x
  movc r2.yzw, r0.xxxx, l(0,0,1.000000,1.000000), l(0,1.000000,1.000000,0)
  mov r2.x, l(1.000000)
  movc r1.xyzw, r0.wwww, r2.yzwx, r1.xyzw
endif 
mul o0.xyz, r1.wwww, r1.xyzx
mov o0.w, l(0)
ret 
// Approximately 0 instruction slots used
