// Shadows ASM
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.34 on Tue Mar 22 18:42:18 2016
//
//
// 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[44], 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 11
dcl_temps 13


mul r0.xy, v0.xyxx, cb1[43].zwzz
sample_l_indexable(texture2d)(float,float,float,float) r0.z, r0.xyxx, t2.yzxw, s2, l(0.000000)
mad r0.z, r0.z, cb1[40].z, -cb1[40].w
div r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r0.z
mad r1.xy, v0.xyxx, cb1[43].zwzz, -cb1[41].wzww
div r1.xy, r1.xyxx, cb1[41].xyxx
mul r1.xy, r0.zzzz, r1.xyxx

  ld_indexable(texture2d)(float,float,float,float) r13.xyzw, l(0, 0, 0, 0), t125.xyzw
  add r13.w, r0.z, -r13.y
  mul r13.w, r13.x, r13.w
  add r1.x, r1.x, -r13.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)
sample_l_indexable(texture2d)(float,float,float,float) r1.y, r0.xyxx, t0.xwyz, s0, l(0.000000)
lt r1.w, l(0.500000), r1.y
movc r1.w, r1.w, l(-0.500000), l(-0.000000)
add r1.y, r1.w, r1.y
mul r1.y, r1.y, l(14.000000)
ftou r1.y, r1.y
mad r0.zw, r0.zzzw, cb0[1].xxxy, l(0.000000, 0.000000, -0.500000, -0.500000)
frc r2.xy, r0.zwzz
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) r3.xyzw, r0.zwzz, t3.xyzw, s3.x
add r4.xyzw, -r1.xxxx, r3.xyzw
mad_sat r4.xyzw, r4.xyzw, cb0[0].zzzz, l(1.000000, 1.000000, 1.000000, 1.000000)
gather4_aoffimmi_indexable(1,-1,0)(texture2d)(float,float,float,float) r5.xyzw, r0.zwzz, t3.xyzw, s3.x
add r6.xyzw, -r1.xxxx, r5.xyzw
mad_sat r6.xyzw, r6.xyzw, cb0[0].zzzz, l(1.000000, 1.000000, 1.000000, 1.000000)
gather4_aoffimmi_indexable(-1,1,0)(texture2d)(float,float,float,float) r7.xyzw, r0.zwzz, t3.xyzw, s3.x
add r8.xyzw, -r1.xxxx, r7.xyzw
mad_sat r8.xyzw, r8.xyzw, cb0[0].zzzz, l(1.000000, 1.000000, 1.000000, 1.000000)
gather4_aoffimmi_indexable(1,1,0)(texture2d)(float,float,float,float) r9.xyzw, r0.zwzz, t3.xyzw, s3.x
add r10.xyzw, -r1.xxxx, r9.xyzw
mad_sat r10.xyzw, r10.xyzw, cb0[0].zzzz, l(1.000000, 1.000000, 1.000000, 1.000000)
add r0.zw, -r2.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000)
mad r1.xw, r4.wwwx, r0.zzzz, r4.zzzy
mad r2.zw, r8.wwwx, r0.zzzz, r8.zzzy
add r1.xw, r6.wwwx, r1.xxxw
add r2.zw, r10.wwwx, r2.zzzw
mad r4.xy, r6.zyzz, r2.xxxx, r1.xwxx
mad r4.zw, r10.zzzy, r2.xxxx, r2.zzzw
mul r6.x, r0.w, l(0.111111112)
mov r6.yz, l(0,0.111111112,0.111111112,0)
mul r6.w, r2.y, l(0.111111112)
dp4 r0.w, r4.xyzw, r6.xyzw
ieq r4.xyzw, r1.yyyy, l(2, 3, 5, 6)
or r1.x, r4.y, r4.x
or r1.x, r4.z, r1.x
or r1.x, r4.w, r1.x
if_nz r1.x
  sample_l_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t1.xyzw, s1, l(0.000000)
  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, cb0[31].y
  add r0.y, r1.z, cb0[31].x
  mul r0.x, r0.x, l(-0.0346573591)
  add r1.xyzw, -r3.xyzw, r0.yyyy
  max r1.xyzw, r1.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
  mul r1.xyzw, r0.xxxx, -r1.xyzw
  mul r1.xyzw, r1.xyzw, l(1.442695, 1.442695, 1.442695, 1.442695)
  exp r1.xyzw, r1.xyzw
  min r1.xyzw, r1.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  lt r3.xyzw, l(0.990000, 0.990000, 0.990000, 0.990000), r3.xyzw
  movc r1.xyzw, r3.xyzw, l(1.000000,1.000000,1.000000,1.000000), r1.xyzw
  add r3.xyzw, -r5.xyzw, r0.yyyy
  max r3.xyzw, r3.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
  mul r3.xyzw, r0.xxxx, -r3.xyzw
  mul r3.xyzw, r3.xyzw, l(1.442695, 1.442695, 1.442695, 1.442695)
  exp r3.xyzw, r3.xyzw
  min r3.xyzw, r3.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  lt r4.xyzw, l(0.990000, 0.990000, 0.990000, 0.990000), r5.xyzw
  movc r3.xyzw, r4.xyzw, l(1.000000,1.000000,1.000000,1.000000), r3.xyzw
  add r4.xyzw, -r7.xyzw, r0.yyyy
  max r4.xyzw, r4.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
  mul r4.xyzw, r0.xxxx, -r4.xyzw
  mul r4.xyzw, r4.xyzw, l(1.442695, 1.442695, 1.442695, 1.442695)
  exp r4.xyzw, r4.xyzw
  min r4.xyzw, r4.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  lt r5.xyzw, l(0.990000, 0.990000, 0.990000, 0.990000), r7.xyzw
  movc r4.xyzw, r5.xyzw, l(1.000000,1.000000,1.000000,1.000000), r4.xyzw
  add r5.xyzw, -r9.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 r7.xyzw, l(0.990000, 0.990000, 0.990000, 0.990000), r9.xyzw
  movc r5.xyzw, r7.xyzw, l(1.000000,1.000000,1.000000,1.000000), r5.xyzw
  mad r0.xy, r1.wxww, r0.zzzz, r1.zyzz
  mad r1.xy, r4.wxww, r0.zzzz, r4.zyzz
  add r0.xy, r3.wxww, r0.xyxx
  add r1.xy, r5.wxww, r1.xyxx
  mad r3.xy, r3.zyzz, r2.xxxx, r0.xyxx
  mad r3.zw, r5.zzzy, r2.xxxx, r1.xxxy
  dp4 r0.x, r3.xyzw, r6.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
