// Lights
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.57 on Fri Apr 28 12:12:29 2017
//
//
// Note: shader requires additional functionality:
//       Early depth-stencil
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed | forceEarlyDepthStencil
dcl_constantbuffer cb0[32], immediateIndexed
dcl_constantbuffer cb1[117], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, 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_input_ps_siv linear noperspective v0.xy, position
dcl_output o0.xyzw
//dcl_temps 10

dcl_temps 19

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

mul r0.xy, v0.xyxx, cb1[116].zwzz
sample_l_indexable(texture2d)(float,float,float,float) r0.z, r0.xyxx, t2.yzxw, s2, l(0.000000)
mad r0.w, r0.z, cb1[51].x, cb1[51].y
mad r0.z, r0.z, cb1[51].z, -cb1[51].w
div r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r0.z
add r0.z, r0.z, r0.w
mad r1.xy, v0.xyxx, cb1[116].zwzz, -cb1[52].wzww
div r1.xy, r1.xyxx, cb1[52].xyxx
mul r1.xy, r0.zzzz, r1.xyxx

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

mul r2.xyzw, r1.yyyy, cb0[28].xyzw
mad r1.xyzw, r1.xxxx, cb0[27].xyzw, r2.xyzw
mad r1.xyzw, r0.zzzz, cb0[29].xyzw, r1.xyzw
add r1.xyzw, r1.xyzw, cb0[30].xyzw
div r0.zw, r1.xxxy, r1.wwww
min r1.x, r1.z, l(0.999990)
mad r0.zw, r0.zzzw, cb0[1].xxxy, l(0.000000, 0.000000, -0.500000, -0.500000)
frc r1.yw, r0.zzzw
round_ni r0.zw, r0.zzzw
add r0.zw, r0.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000)
mul r0.zw, r0.zzzw, cb0[1].zzzw
gather4_aoffimmi_indexable(-1,-1,0)(texture2d)(float,float,float,float) r2.xyzw, r0.zwzz, t3.xyzw, s3.x
add r3.xyzw, -r1.xxxx, r2.xyzw
mad_sat r3.xyzw, r3.xyzw, cb0[0].zzzz, l(1.000000, 1.000000, 1.000000, 1.000000)
gather4_aoffimmi_indexable(1,-1,0)(texture2d)(float,float,float,float) r4.xyzw, r0.zwzz, t3.xyzw, s3.x
add r5.xyzw, -r1.xxxx, r4.xyzw
mad_sat r5.xyzw, r5.xyzw, cb0[0].zzzz, l(1.000000, 1.000000, 1.000000, 1.000000)
gather4_aoffimmi_indexable(-1,1,0)(texture2d)(float,float,float,float) r6.xyzw, r0.zwzz, t3.xyzw, s3.x
add r7.xyzw, -r1.xxxx, r6.xyzw
mad_sat r7.xyzw, r7.xyzw, cb0[0].zzzz, l(1.000000, 1.000000, 1.000000, 1.000000)
gather4_aoffimmi_indexable(1,1,0)(texture2d)(float,float,float,float) r8.xyzw, r0.zwzz, t3.xyzw, s3.x
add r9.xyzw, -r1.xxxx, r8.xyzw
mad_sat r9.xyzw, r9.xyzw, cb0[0].zzzz, l(1.000000, 1.000000, 1.000000, 1.000000)
add r0.zw, -r1.yyyw, l(0.000000, 0.000000, 1.000000, 1.000000)
mad r3.xy, r3.wxww, r0.zzzz, r3.zyzz
mad r3.zw, r7.wwwx, r0.zzzz, r7.zzzy
add r3.xy, r5.wxww, r3.xyxx
add r3.zw, r9.wwwx, r3.zzzw
mad r5.xy, r5.zyzz, r1.yyyy, r3.xyxx
mad r5.zw, r9.zzzy, r1.yyyy, r3.zzzw
mul r3.x, r0.w, l(0.111111112)
mov r3.yz, l(0,0.111111112,0.111111112,0)
mul r3.w, r1.w, l(0.111111112)
dp4 r0.w, r5.xyzw, r3.xyzw
sample_l_indexable(texture2d)(float,float,float,float) r1.x, r0.xyxx, t0.wxyz, s0, l(0.000000)
mul r1.x, r1.x, l(255.000000)
round_ne r1.x, r1.x
ftou r1.x, r1.x
and r1.w, r1.x, l(15)
ieq r5.xyzw, r1.wwww, l(2, 3, 5, 6)
or r5.x, r5.y, r5.x
or r5.x, r5.z, r5.x
or r5.x, r5.w, r5.x
ieq r5.yz, r1.wwww, l(0, 7, 9, 0)
or r1.w, r5.y, r5.x
or r1.w, r5.z, r1.w
if_nz r1.w
  sample_l_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t1.wxyz, s1, l(0.000000)
  and r0.y, r1.x, l(16)
  min r0.x, r0.x, l(0.999000)
  add r0.x, -r0.x, l(1.000000)
  log r0.x, r0.x
  mul r0.x, r0.x, l(-0.0346573591)
  movc r0.x, r0.y, l(-0.000000), r0.x
  or r0.y, r5.z, r5.y
  movc r0.x, r0.y, l(1.000000), r0.x
  add r0.y, r1.z, cb0[31].x
  mul r0.x, r0.x, cb0[31].y
  add r5.xyzw, -r2.xyzw, r0.yyyy
  max r5.xyzw, r5.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
  mul r5.xyzw, r0.xxxx, -r5.xyzw
  mul r5.xyzw, r5.xyzw, l(1.442695, 1.442695, 1.442695, 1.442695)
  exp r5.xyzw, r5.xyzw
  min r5.xyzw, r5.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  lt r2.xyzw, l(0.990000, 0.990000, 0.990000, 0.990000), r2.xyzw
  movc r2.xyzw, r2.xyzw, l(1.000000,1.000000,1.000000,1.000000), r5.xyzw
  add r5.xyzw, -r4.xyzw, r0.yyyy
  max r5.xyzw, r5.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
  mul r5.xyzw, r0.xxxx, -r5.xyzw
  mul r5.xyzw, r5.xyzw, l(1.442695, 1.442695, 1.442695, 1.442695)
  exp r5.xyzw, r5.xyzw
  min r5.xyzw, r5.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  lt r4.xyzw, l(0.990000, 0.990000, 0.990000, 0.990000), r4.xyzw
  movc r4.xyzw, r4.xyzw, l(1.000000,1.000000,1.000000,1.000000), r5.xyzw
  add r5.xyzw, -r6.xyzw, r0.yyyy
  max r5.xyzw, r5.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
  mul r5.xyzw, r0.xxxx, -r5.xyzw
  mul r5.xyzw, r5.xyzw, l(1.442695, 1.442695, 1.442695, 1.442695)
  exp r5.xyzw, r5.xyzw
  min r5.xyzw, r5.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  lt r6.xyzw, l(0.990000, 0.990000, 0.990000, 0.990000), r6.xyzw
  movc r5.xyzw, r6.xyzw, l(1.000000,1.000000,1.000000,1.000000), r5.xyzw
  add r6.xyzw, -r8.xyzw, r0.yyyy
  max r6.xyzw, r6.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
  mul r6.xyzw, r0.xxxx, -r6.xyzw
  mul r6.xyzw, r6.xyzw, l(1.442695, 1.442695, 1.442695, 1.442695)
  exp r6.xyzw, r6.xyzw
  min r6.xyzw, r6.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  lt r7.xyzw, l(0.990000, 0.990000, 0.990000, 0.990000), r8.xyzw
  movc r6.xyzw, r7.xyzw, l(1.000000,1.000000,1.000000,1.000000), r6.xyzw
  mad r0.xy, r2.wxww, r0.zzzz, r2.zyzz
  mad r1.xz, r5.wwxw, r0.zzzz, r5.zzyz
  add r0.xy, r4.wxww, r0.xyxx
  add r1.xz, r6.wwxw, r1.xxzx
  mad r2.xy, r4.zyzz, r1.yyyy, r0.xyxx
  mad r2.zw, r6.zzzy, r1.yyyy, r1.xxxz
  dp4 r0.x, r2.xyzw, r3.xyzw
else 
  mov r0.x, l(1.000000)
endif 
add r0.y, r0.w, l(-0.500000)
mad_sat r0.y, r0.y, cb0[26].z, l(0.500000)
mad r0.y, r0.y, r0.y, l(-1.000000)
mad r0.y, cb0[26].y, r0.y, l(1.000000)
mad r0.x, r0.x, r0.x, l(-1.000000)
mad r0.x, cb0[26].y, r0.x, l(1.000000)
sqrt o0.xyzw, r0.yxyx
ret 
// Approximately 0 instruction slots used
