// Lights
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.65 on Thu Oct 12 19:07:31 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[125], immediateIndexed
dcl_constantbuffer cb1[10], immediateIndexed
dcl_constantbuffer cb2[6], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_input_ps_siv linear noperspective v2.xyzw, position
dcl_output o0.xyzw
//dcl_temps 5

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.x, r0.xyxx, t1.xyzw, s1, l(0.000000)
mad r1.y, r1.x, cb0[53].x, cb0[53].y
mad r1.x, r1.x, cb0[53].z, -cb0[53].w
div r1.x, l(1.000000, 1.000000, 1.000000, 1.000000), r1.x
add r1.x, r1.x, r1.y
div r0.zw, r0.zzzw, cb0[54].xxxy
mul r0.zw, r1.xxxx, r0.zzzw

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

mul r2.xyzw, r0.wwww, cb0[41].xyzw
mad r2.xyzw, r0.zzzz, cb0[40].xyzw, r2.xyzw
mad r1.xyzw, r1.xxxx, cb0[42].xyzw, r2.xyzw
add r1.xyzw, r1.xyzw, cb0[43].xyzw
div r1.xyz, r1.xyzx, r1.wwww
add r2.xyz, -r1.xyzx, cb0[55].xyzx
dp3 r0.z, r2.xyzx, r2.xyzx
sqrt r0.z, r0.z
div r0.w, r0.z, cb2[4].x
max r0.w, |r0.w|, l(0.000001)
log r0.w, r0.w
mul r0.w, r0.w, cb2[4].y
exp r0.w, r0.w
mul r0.z, r0.z, l(0.002000)
max r0.z, r0.z, l(0.000001)
mul r0.z, r0.z, r0.z
min r0.zw, r0.zzzw, l(0.000000, 0.000000, 1.000000, 1.000000)
mul r0.z, r0.z, r0.w
max r0.w, r0.z, l(0.000001)
mul r1.w, r0.w, r0.w
mul r0.w, r0.w, r1.w
mad r2.xyz, r0.wwww, l(20.000000, 20.000000, 20.000000, 0.000000), cb2[1].xyzx
add r3.xyz, cb1[8].xyzx, -cb1[9].xyzx
add r4.xyz, r1.xyzx, -r3.xyzx
lt r4.xyz, l(0.000010, 0.000010, 0.000010, 0.000000), |r4.xyzx|
ge r3.xyz, r1.xyzx, r3.xyzx
and r3.xyz, r4.xyzx, r3.xyzx
and r3.xyz, r3.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
mul r0.w, r3.y, r3.x
mul r0.w, r3.z, r0.w
add r3.xyz, cb1[8].xyzx, cb1[9].xyzx
add r4.xyz, r1.xyzx, -r3.xyzx
lt r4.xyz, l(0.000010, 0.000010, 0.000010, 0.000000), |r4.xyzx|
ge r3.xyz, r1.xyzx, r3.xyzx
movc r3.xyz, r3.xyzx, l(0,0,0,0), l(1.000000,1.000000,1.000000,0)
and r3.xyz, r3.xyzx, r4.xyzx
mul r1.z, r3.y, r3.x
mul r1.z, r3.z, r1.z
mul r0.w, r0.w, r1.z
dp3 r1.z, cb1[1].xyzx, cb1[1].xyzx
sqrt r1.z, r1.z
add r1.w, r1.z, cb1[8].y
add r1.w, r1.w, -cb2[4].z
add r1.w, -r1.y, r1.w
mul r2.w, r1.z, cb2[4].w
div r1.w, |r1.w|, r2.w
max r1.w, |r1.w|, l(0.000001)
log r1.w, r1.w
mul r1.w, r1.w, l(50.000000)
exp r1.w, r1.w
min r1.w, r1.w, l(1.000000)
add r1.w, -r1.w, l(1.000000)
max r1.w, r1.w, l(0.000001)
mul r1.w, r1.w, r1.w
mul r1.w, r1.w, r1.w
sample_l_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t0.yxzw, s0, l(0.000000)
mad r0.x, r0.x, l(2.000000), l(-1.000000)
mov_sat r0.x, -r0.x
mul r0.y, r0.x, r1.w
add r1.xy, r1.xyxx, -cb1[8].xyxx
dp3 r2.w, cb1[0].xyzx, cb1[0].xyzx
sqrt r2.w, r2.w
mul r3.x, r2.w, l(50.000000)
div r1.x, r1.x, r3.x
max r1.x, |r1.x|, l(0.000001)
log r1.x, r1.x
mul r1.x, r1.x, r2.w
exp r1.x, r1.x
add r1.y, r1.y, cb2[4].z
mul r2.w, r1.z, l(50.000000)
div r1.y, r1.y, r2.w
max r1.y, |r1.y|, l(0.000001)
log r1.y, r1.y
mul r1.y, r1.y, r1.z
exp r1.y, r1.y
add r1.x, r1.y, r1.x
min r1.x, r1.x, l(1.000000)
add r1.x, -r1.x, l(1.000000)
max r1.x, r1.x, l(0.000001)
log r1.x, r1.x
mul r1.x, r1.x, cb2[5].x
exp r1.x, r1.x
mad r0.x, -r1.w, r0.x, l(1.000000)
mad r0.x, r1.x, r0.x, r0.y
mul r0.x, r0.x, r0.w
mul r0.x, r0.z, r0.x
min r0.w, r0.x, l(1.000000)
max r0.xyz, r2.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
lt r1.x, l(0.000000), cb0[124].x
if_nz r1.x
  mul r1.xyzw, v2.yyyy, cb0[37].xyzw
  mad r1.xyzw, v2.xxxx, cb0[36].xyzw, r1.xyzw
  mad r1.xyzw, v2.zzzz, cb0[38].xyzw, r1.xyzw
  add r1.xyzw, r1.xyzw, cb0[39].xyzw
  div r1.xyz, r1.xyzx, r1.wwww
  add r1.xyz, r1.xyzx, -cb0[58].xyzx
  add r2.xyz, r1.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 r1.w, r2.y, r2.x
  or r1.w, r2.z, r1.w
  dp3 r1.x, r1.xyzx, l(0.577000, 0.577000, 0.577000, 0.000000)
  mul r1.x, r1.x, l(0.002000)
  frc r1.x, r1.x
  lt r1.x, l(0.500000), r1.x
  movc r2.xyz, r1.xxxx, l(0,1.000000,1.000000,0), l(1.000000,1.000000,0,0)
  mov r2.w, l(1.000000)
  movc o0.xyzw, r1.wwww, r2.xyzw, r0.xyzw
else 
  mov o0.xyzw, r0.xyzw
endif 
ret 
// Approximately 0 instruction slots used
