// Shadows MEDIUM
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.34 on Wed Mar 23 19:07:33 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 5
dcl_temps 16

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) r16.xyzw, l(0, 0, 0, 0), t125.xyzw
  add r16.w, r0.z, -r16.y
  mul r16.w, r16.x, r16.w
  add r1.x, r1.x, -r16.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_indexable(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)
add r0.zw, -r4.wwwx, r4.zzzy
mad r0.zw, r2.xxxx, r0.zzzw, r4.wwwx
add r0.w, -r0.z, r0.w
mad r0.z, r2.y, r0.w, r0.z
ieq r4.xyzw, r1.yyyy, l(2, 3, 5, 6)
or r0.w, r4.y, r4.x
or r0.w, r4.z, r0.w
or r0.w, r4.w, r0.w
if_nz r0.w
  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_sat r1.xyzw, r1.xyzw
  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 r0.xy, -r1.wxww, r1.zyzz
  mad r0.xy, r2.xxxx, r0.xyxx, r1.wxww
  add r0.y, -r0.x, r0.y
  mad r0.x, r2.y, r0.y, r0.x
else 
  mov r0.x, l(1.000000)
endif 
add r0.y, r0.z, 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
