// Lights
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.65 on Thu Sep 21 19:41:30 2017
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy w
//
//
// 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[119], immediateIndexed
dcl_constantbuffer cb1[13], 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_texture3d (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_resource_texture2d (uint,uint,uint,uint) t5
dcl_input_ps_siv linear noperspective v0.xyw, position
dcl_output o0.xyzw
//dcl_temps 10

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, v0.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, v0.wwww
mov r0.z, v0.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, t3.xyzw, s3, 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
div r2.xyz, r1.xyzx, cb1[4].xyzx
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r2.xzxx, t2.xyzw, s2
sample_indexable(texture2d)(float,float,float,float) r4.xyz, r2.yzyy, t2.xyzw, s2
sample_l_indexable(texture2d)(float,float,float,float) r0.zw, r0.xyxx, t1.ywxz, s1, l(0.000000)
mad r0.zw, r0.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
mad_sat r2.zw, |r0.zzzw|, l(0.000000, 0.000000, 3.000000, 3.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
add r4.xyz, -r3.xyzx, r4.xyzx
mad r3.xyz, r2.zzzz, r4.xyzx, r3.xyzx
sample_indexable(texture2d)(float,float,float,float) r4.xyz, r2.xyxx, t2.xyzw, s2
add r4.xyz, -r3.xyzx, r4.xyzx
mad r3.xyz, r2.wwww, r4.xyzx, r3.xyzx
div r4.xyz, r1.xyzx, cb1[8].xyzx
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r4.xzxx, t2.xyzw, s2
sample_indexable(texture2d)(float,float,float,float) r6.xyz, r4.yzyy, t2.xyzw, s2
add r6.xyz, -r5.xyzx, r6.xyzx
mad r2.xyz, r2.zzzz, r6.xyzx, r5.xyzx
sample_indexable(texture2d)(float,float,float,float) r4.xyz, r4.xyxx, t2.xyzw, s2
add r4.xyz, -r2.xyzx, r4.xyzx
mad r2.xyz, r2.wwww, r4.xyzx, r2.xyzx
mul r1.xyz, r1.xyzx, l(0.010000, 0.010000, 0.010000, 0.000000)
mov r4.xyz, r1.xyzx
mov r0.z, l(0)
mov r1.w, l(0)
loop 
  uge r2.w, r1.w, l(1)
  breakc_nz r2.w
  mul r5.xyz, r4.xyzx, l(0.0666666701, 0.0666666701, 0.0666666701, 0.000000)
  frc r5.xyz, r5.xyzx
  mul r6.xyz, r5.xyzx, l(15.000000, 15.000000, 15.000000, 0.000000)
  frc r7.xyz, r6.xyzx
  mad r5.xyz, r5.xyzx, l(15.000000, 15.000000, 15.000000, 0.000000), -r7.xyzx
  mul r8.xyz, r7.xyzx, r7.xyzx
  mul r8.xyz, r7.xyzx, r8.xyzx
  mad r9.xyz, r7.xyzx, l(6.000000, 6.000000, 6.000000, 0.000000), l(-15.000000, -15.000000, -15.000000, 0.000000)
  mad r7.xyz, r7.xyzx, r9.xyzx, l(10.000000, 10.000000, 10.000000, 0.000000)
  mad r5.xyz, r8.xyzx, r7.xyzx, r5.xyzx
  mad r5.xyz, r5.xyzx, l(0.062500, 0.062500, 0.062500, 0.000000), l(0.031250, 0.031250, 0.031250, 0.000000)
  sample_l_indexable(texture3d)(float,float,float,float) r5.xyzw, r5.xyzx, t0.xyzw, s0, l(0.000000)
  mad r5.xyzw, r5.xyzw, l(2.007874, 2.007874, 2.007874, 255.000000), l(-1.000000, -1.000000, -1.000000, -127.000000)
  dp3 r2.w, r6.xyzx, r5.xyzx
  add r2.w, -r5.w, r2.w
  add r0.z, r0.z, r2.w
  iadd r1.w, r1.w, l(1)
endloop 
mad r0.z, r0.z, l(0.500000), l(0.500000)
add r1.xyz, -r3.xyzx, r2.xyzx
mad r1.xyz, r0.zzzz, r1.xyzx, r3.xyzx
mul r2.xy, r0.xyxx, cb0[118].xyxx
round_z r2.xy, r2.xyxx
ftoi r2.xy, r2.xyxx
mov r2.zw, l(0,0,0,0)
ld_indexable(texture2d)(uint,uint,uint,uint) r0.z, r2.xyzw, t5.xzyw
utof r0.z, r0.z
mad r2.xy, r0.zzzz, l(0.00392156886, 0.00392156886, 0.000000, 0.000000), l(-1.000000, -0.784313738, 0.000000, 0.000000)
lt r2.xy, l(0.000010, 0.000010, 0.000000, 0.000000), |r2.xyxx|
and r0.z, r2.x, r2.y
and r0.z, r0.z, l(0x3f800000)
mad r1.xyz, -r1.xyzx, r0.zzzz, l(1.000000, 1.000000, 1.000000, 0.000000)
max r1.xyz, |r1.xyzx|, l(0.000001, 0.000001, 0.000001, 0.000000)
mad r1.xyz, r1.xyzx, r1.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
mad r1.xyz, cb1[12].zzzz, r1.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
min r0.z, |r0.w|, l(0.500000)
add r2.xyz, -r1.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mad r1.xyz, r0.zzzz, r2.xyzx, r1.xyzx
sample_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t4.xyzw, s4
mad r0.xyz, r1.xyzx, r0.xyzx, cb1[9].xyzx
max o0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mov o0.w, l(1.000000)
ret 
// Approximately 0 instruction slots used
