// MANUALLY DUMPED [ShaderRegex\ShaderFixes\Plague_DHR.ini\_Shadows1]
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.16 on Tue Dec 29 15:31:10 2020
//
//
// Buffer Definitions:
//
// cbuffer CBufferGlobalConstant_Z
// {
//
//   struct StructGlobalConstant_Z
//   {
//
//       float4 c[90];                  // Offset:    0
//
//   } Global;                          // Offset:    0 Size:  1440
//
// }
//
// cbuffer CBufferScatteringConstant_Z
// {
//
//   struct StructScatteringConstant_Z
//   {
//
//       float4 c[36];                  // Offset:    0
//
//   } Scattering;                      // Offset:    0 Size:   576
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// sZBufferSampler                   sampler      NA          NA    1        1
// sLastFrameColorBufferSampler      sampler      NA          NA    2        1
// sLastFrameHiZBufferSampler        sampler      NA          NA    3        1
// sFogOcclusionSampler              sampler      NA          NA    4        1
// sMipFog0Sampler                   sampler      NA          NA    5        1
// sGBuffer0                         texture    uint          2d    1        1
// sGBuffer1                         texture    uint          2d    2        1
// sVelocityBuffer                   texture    uint          2d    3        1
// sVelocityBufferZ                  texture   float          2d    4        1
// sZBuffer                          texture  float4          2d    5        1
// sLastFrameColorBuffer             texture  float4          2d    6        1
// sLastFrameHiZBuffer               texture  float4          2d    7        1
// sBlueNoiseR8                      texture  float4     2darray    8        1
// sFogOcclusion                     texture  float4          2d    9        1
// sMipFog0                          texture  float4          2d   10        1
// sMipFog1                          texture  float4          2d   11        1
// sUserResource0                    texture  float4          2d   12        1
// CBufferGlobalConstant_Z           cbuffer      NA          NA    0        1
// CBufferScatteringConstant_Z       cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
// TEXCOORD                 0   xy          1     NONE   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
dcl_constantbuffer cb0[69], immediateIndexed
dcl_constantbuffer cb1[23], immediateIndexed
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_resource_texture2d (uint,uint,uint,uint) t1
dcl_resource_texture2d (uint,uint,uint,uint) t2
dcl_resource_texture2d (uint,uint,uint,uint) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2darray (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texture2d (float,float,float,float) t10
dcl_resource_texture2d (float,float,float,float) t11
dcl_resource_texture2d (float,float,float,float) t12
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 17
dcl_resource_texture2d (float,float,float,float) t125
sample_l_indexable(texture2d)(float,float,float,float) r0.z, v1.xyxx, t5.yzxw, s1, l(0.000000)
ftoi r1.xy, v0.xyxx
mov r1.zw, l(0,0,0,0)
ld_indexable(texture2d)(uint,uint,uint,uint) r2.x, r1.xyww, t1.xyzw
ld_indexable(texture2d)(uint,uint,uint,uint) r2.y, r1.xyww, t2.yxzw
and r2.z, r2.x, l(4095)
ubfe r2.x, l(12), l(12), r2.x
utof r3.xy, r2.zxzz
mad r3.xy, r3.xyxx, l(0.000488400517, 0.000488400517, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mov r3.zw, l(0,0,1.000000,-1.000000)
dp3 r4.z, r3.xyzx, -r3.xywx
max r2.x, r4.z, l(0.000000)
sqrt r2.x, r2.x
mul r4.xy, r2.xxxx, r3.xyxx
mad r2.xzw, r4.xxyz, l(2.000000, 0.000000, 2.000000, -2.000000), l(0.000000, 0.000000, 0.000000, 1.000000)
ubfe r3.xy, l(8, 4, 0, 0), l(8, 16, 0, 0), r2.yyyy
utof r2.y, r3.x
mul r3.x, r2.y, l(0.00392156886)
ftou r3.zw, v0.xxxy
mad r0.xy, v1.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
mov r0.w, l(1.000000)


dp4 r4.x, r0.xyzw, cb0[53].xyzw
dp4 r4.y, r0.xyzw, cb0[54].xyzw
dp4 r4.z, r0.xyzw, cb0[55].xyzw
dp4 r0.x, r0.xyzw, cb0[56].xyzw
div r0.xyz, r4.xyzx, r0.xxxx
dp3 r4.x, r0.xyzx, r0.xyzx
rsq r4.x, r4.x
mul r4.xyz, r0.xyzx, r4.xxxx

ld_indexable(texture2d)(float,float,float,float) r11.xyzw, l(0, 0, 0, 0), t125.xyzw




dp3 r4.w, r4.xyzx, r2.xzwx
add r4.w, r4.w, r4.w
mad r5.xyz, r2.xzwx, -r4.wwww, r4.xyzx
dp3 r5.w, r5.xyzx, r5.xyzx
rsq r5.w, r5.w
mad r6.x, -r3.x, r3.x, l(1.000000)
sqrt r6.y, r6.x
mad r6.y, r3.x, r3.x, r6.y
mul r6.x, r6.y, r6.x
mad r5.xyz, r5.xyzx, r5.wwww, -r2.xzwx
mad r2.xzw, r6.xxxx, r5.xxyz, r2.xxzw
dp3 r5.x, r2.xzwx, r2.xzwx
rsq r5.x, r5.x
mul r2.xzw, r2.xxzw, r5.xxxx
eq r5.x, cb0[49].z, l(0.000000)
ftou r5.y, cb0[1].w
movc r5.z, r5.x, l(0), r5.y
and r5.xy, r3.zwzz, l(63, 63, 0, 0)
mov r5.w, l(0)
ld_indexable(texture2darray)(float,float,float,float) r3.z, r5.xyzw, t8.yzxw
dp3 r3.w, r2.xzwx, r4.xyzx
mul_sat r3.w, r3.w, l(2.857143)
mad r4.x, r3.w, l(-2.000000), l(3.000000)
mul r3.w, r3.w, r3.w
mul r3.w, r3.w, r4.x
ieq r3.y, r3.y, l(0)
lt r4.x, l(50.999996), r2.y
or r3.y, r3.y, r4.x
ge r4.x, l(0.000000), r3.w
or r3.y, r3.y, r4.x
if_nz r3.y
  mov r4.xyz, l(0,0,0,0)
  mov r3.y, l(0)
else
  mad r5.xyz, r2.xzwx, l(500000.000000, 500000.000000, 500000.000000, 0.000000), r0.xyzx
  mov r0.w, l(1.000000)




  dp4 r6.x, r0.xyzw, cb0[49].xyzw
  dp4 r6.y, r0.xyzw, cb0[50].xyzw
  dp4 r6.z, r0.xyzw, cb0[51].xyzw
  dp4 r0.w, r0.xyzw, cb0[52].xyzw
  mov r5.w, l(1.000000)





  dp4 r7.x, r5.xyzw, cb0[49].xyzw
  dp4 r7.y, r5.xyzw, cb0[50].xyzw
  dp4 r7.z, r5.xyzw, cb0[51].xyzw
  dp4 r5.x, r5.xyzw, cb0[52].xyzw



  //div r5.yzw, r6.xxyz, r0.wwww
  //div r6.xyz, r7.xyzx, r5.xxxx




  lt r7.xy, l(1.000000, 1.000000, 0.000000, 0.000000), r6.yxyy
  lt r7.zw, r6.yyyx, l(0.000000, 0.000000, -1.000000, -1.000000)
  or r7.zw, r7.zzzw, r7.xxxy
  movc r7.xy, r7.xyxx, l(-1.000000,-1.000000,0,0), l(1.000000,1.000000,0,0)
  add r7.xy, r6.yxyy, r7.xyxx
  add r8.xy, -r5.zyzz, r6.yxyy
  div r7.xy, r7.xyxx, r8.xyxx
  and r0.w, r7.x, r7.z
  max r5.x, r7.y, r0.w
  movc r0.w, r7.w, r5.x, r0.w
  add r7.xyz, r5.yzwy, -r6.xyzx
  mad r6.xyz, r0.wwww, r7.xyzx, r6.xyzx
  add r6.xyz, -r5.yzwy, r6.xyzx
  mul r0.w, |r6.z|, l(0.062500)
  mul r5.x, r3.z, l(0.062500)
  mad r6.w, r3.z, l(0.062500), l(0.062500)
  mul r7.xyz, r6.xyzx, l(0.500000, -0.500000, 1.000000, 0.000000)
  mad r5.yzw, r5.yyzw, l(0.000000, 0.500000, -0.500000, 1.000000), l(0.000000, 0.500000, 0.500000, 0.000000)
  mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
  sample_l_indexable(texture2d)(float,float,float,float) r6.x, r8.xyxx, t5.xyzw, s1, l(0.000000)
  add r6.x, -r8.z, r6.x
  mad r6.y, -|r6.z|, l(0.062500), r6.x
  ge r6.y, r0.w, |r6.y|
  if_nz r6.y
    min r5.x, r5.x, l(1.000000)
  else
    mov r5.x, l(1.000000)
  endif
  movc r6.x, r6.y, l(0), r6.x
  if_z r6.y
    mad r6.w, r3.z, l(0.062500), l(0.125000)
    if_z r6.y
      mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
      mul r6.y, r2.y, l(0.000980392215)
      sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r6.y
      add r6.y, -r8.z, r6.y
      mad r7.w, -|r6.z|, l(0.062500), r6.y
      ge r7.w, r0.w, |r7.w|
      if_nz r7.w
        add r8.x, -r6.y, r6.x
        div_sat r8.x, r6.x, r8.x
        mad r8.x, r8.x, l(0.062500), r6.w
        add r8.x, r8.x, l(-0.062500)
        min r5.x, r5.x, r8.x
      endif
      movc r6.x, r7.w, r6.x, r6.y
    else
      mov r7.w, l(-1)
    endif
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.w, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
    mul r6.y, r2.y, l(0.00196078443)
    sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r6.y
    add r6.y, -r8.z, r6.y
    mad r7.w, -|r6.z|, l(0.062500), r6.y
    ge r7.w, r0.w, |r7.w|
    if_nz r7.w
      add r8.x, -r6.y, r6.x
      div_sat r8.x, r6.x, r8.x
      mad r8.x, r8.x, l(0.062500), r6.w
      add r8.x, r8.x, l(-0.062500)
      min r5.x, r5.x, r8.x
    endif
    movc r6.x, r7.w, r6.x, r6.y
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.w, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
    mul r6.y, r2.y, l(0.00294117676)
    sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r6.y
    add r6.y, -r8.z, r6.y
    mad r7.w, -|r6.z|, l(0.062500), r6.y
    ge r7.w, r0.w, |r7.w|
    if_nz r7.w
      add r8.x, -r6.y, r6.x
      div_sat r8.x, r6.x, r8.x
      mad r8.x, r8.x, l(0.062500), r6.w
      add r8.x, r8.x, l(-0.062500)
      min r5.x, r5.x, r8.x
    endif
    movc r6.x, r7.w, r6.x, r6.y
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.w, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
    sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r3.x
    add r6.y, -r8.z, r6.y
    mad r7.w, -|r6.z|, l(0.062500), r6.y
    ge r7.w, r0.w, |r7.w|
    if_nz r7.w
      add r8.x, -r6.y, r6.x
      div_sat r8.x, r6.x, r8.x
      mad r8.x, r8.x, l(0.062500), r6.w
      add r8.x, r8.x, l(-0.062500)
      min r5.x, r5.x, r8.x
    endif
    movc r6.x, r7.w, r6.x, r6.y
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.w, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
    mul r6.y, r2.y, l(0.00490196096)
    sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r6.y
    add r6.y, -r8.z, r6.y
    mad r7.w, -|r6.z|, l(0.062500), r6.y
    ge r7.w, r0.w, |r7.w|
    if_nz r7.w
      add r8.x, -r6.y, r6.x
      div_sat r8.x, r6.x, r8.x
      mad r8.x, r8.x, l(0.062500), r6.w
      add r8.x, r8.x, l(-0.062500)
      min r5.x, r5.x, r8.x
    endif
    movc r6.x, r7.w, r6.x, r6.y
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.w, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
    mul r6.y, r2.y, l(0.00588235352)
    sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r6.y
    add r6.y, -r8.z, r6.y
    mad r7.w, -|r6.z|, l(0.062500), r6.y
    ge r7.w, r0.w, |r7.w|
    if_nz r7.w
      add r8.x, -r6.y, r6.x
      div_sat r8.x, r6.x, r8.x
      mad r8.x, r8.x, l(0.062500), r6.w
      add r8.x, r8.x, l(-0.062500)
      min r5.x, r5.x, r8.x
    endif
    movc r6.x, r7.w, r6.x, r6.y
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.w, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
    mul r6.y, r2.y, l(0.00686274562)
    sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r6.y
    add r6.y, -r8.z, r6.y
    mad r7.w, -|r6.z|, l(0.062500), r6.y
    ge r7.w, r0.w, |r7.w|
    if_nz r7.w
      add r8.x, -r6.y, r6.x
      div_sat r8.x, r6.x, r8.x
      mad r8.x, r8.x, l(0.062500), r6.w
      add r8.x, r8.x, l(-0.062500)
      min r5.x, r5.x, r8.x
    endif
    movc r6.x, r7.w, r6.x, r6.y
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.w, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
    mul r6.y, r2.y, l(0.00784313772)
    sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r6.y
    add r6.y, -r8.z, r6.y
    mad r7.w, -|r6.z|, l(0.062500), r6.y
    ge r7.w, r0.w, |r7.w|
    if_nz r7.w
      add r8.x, -r6.y, r6.x
      div_sat r8.x, r6.x, r8.x
      mad r8.x, r8.x, l(0.062500), r6.w
      add r8.x, r8.x, l(-0.062500)
      min r5.x, r5.x, r8.x
    endif
    movc r6.x, r7.w, r6.x, r6.y
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.w, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
    mul r6.y, r2.y, l(0.00882352982)
    sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r6.y
    add r6.y, -r8.z, r6.y
    mad r7.w, -|r6.z|, l(0.062500), r6.y
    ge r7.w, r0.w, |r7.w|
    if_nz r7.w
      add r8.x, -r6.y, r6.x
      div_sat r8.x, r6.x, r8.x
      mad r8.x, r8.x, l(0.062500), r6.w
      add r8.x, r8.x, l(-0.062500)
      min r5.x, r5.x, r8.x
    endif
    movc r6.x, r7.w, r6.x, r6.y
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.w, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
    mul r6.y, r2.y, l(0.00980392192)
    sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r6.y
    add r6.y, -r8.z, r6.y
    mad r7.w, -|r6.z|, l(0.062500), r6.y
    ge r7.w, r0.w, |r7.w|
    if_nz r7.w
      add r8.x, -r6.y, r6.x
      div_sat r8.x, r6.x, r8.x
      mad r8.x, r8.x, l(0.062500), r6.w
      add r8.x, r8.x, l(-0.062500)
      min r5.x, r5.x, r8.x
    endif
    movc r6.x, r7.w, r6.x, r6.y
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.w, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
    mul r6.y, r2.y, l(0.0107843140)
    sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r6.y
    add r6.y, -r8.z, r6.y
    mad r7.w, -|r6.z|, l(0.062500), r6.y
    ge r7.w, r0.w, |r7.w|
    if_nz r7.w
      add r8.x, -r6.y, r6.x
      div_sat r8.x, r6.x, r8.x
      mad r8.x, r8.x, l(0.062500), r6.w
      add r8.x, r8.x, l(-0.062500)
      min r5.x, r5.x, r8.x
    endif
    movc r6.x, r7.w, r6.x, r6.y
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.w, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
    mul r6.y, r2.y, l(0.0117647070)
    sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r6.y
    add r6.y, -r8.z, r6.y
    mad r7.w, -|r6.z|, l(0.062500), r6.y
    ge r7.w, r0.w, |r7.w|
    if_nz r7.w
      add r8.x, -r6.y, r6.x
      div_sat r8.x, r6.x, r8.x
      mad r8.x, r8.x, l(0.062500), r6.w
      add r8.x, r8.x, l(-0.062500)
      min r5.x, r5.x, r8.x
    endif
    movc r6.x, r7.w, r6.x, r6.y
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.w, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
    mul r6.y, r2.y, l(0.0127450991)
    sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r6.y
    add r6.y, -r8.z, r6.y
    mad r7.w, -|r6.z|, l(0.062500), r6.y
    ge r7.w, r0.w, |r7.w|
    if_nz r7.w
      add r8.x, -r6.y, r6.x
      div_sat r8.x, r6.x, r8.x
      mad r8.x, r8.x, l(0.062500), r6.w
      add r8.x, r8.x, l(-0.062500)
      min r5.x, r5.x, r8.x
    endif
    movc r6.x, r7.w, r6.x, r6.y
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.w, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.wwww, r5.yzwy
    mul r6.y, r2.y, l(0.0137254912)
    sample_l_indexable(texture2d)(float,float,float,float) r6.y, r8.xyxx, t5.yxzw, s1, r6.y
    add r6.y, -r8.z, r6.y
    mad r7.w, -|r6.z|, l(0.062500), r6.y
    ge r7.w, r0.w, |r7.w|
    if_nz r7.w
      add r8.x, -r6.y, r6.x
      div_sat r8.x, r6.x, r8.x
      mad r8.x, r8.x, l(0.062500), r6.w
      add r8.x, r8.x, l(-0.062500)
      min r5.x, r5.x, r8.x
    endif
    movc r6.x, r7.w, r6.x, r6.y
  else
    mov r7.w, l(-1)
  endif
  if_z r7.w
    add r6.y, r6.w, l(0.062500)
    mad r8.xyz, r7.xyzx, r6.yyyy, r5.yzwy
    mul r6.w, r2.y, l(0.0147058833)
    sample_l_indexable(texture2d)(float,float,float,float) r6.w, r8.xyxx, t5.yzwx, s1, r6.w
    add r6.w, -r8.z, r6.w
    mad r6.z, -|r6.z|, l(0.062500), r6.w
    ge r0.w, r0.w, |r6.z|
    if_nz r0.w
      add r0.w, -r6.w, r6.x
      div_sat r0.w, r6.x, r0.w
      mad r0.w, r0.w, l(0.062500), r6.y
      add r0.w, r0.w, l(-0.062500)
      min r5.x, r0.w, r5.x
    endif
  endif
  mad r5.yzw, r7.xxyz, r5.xxxx, r5.yyzw
  lt r0.w, r5.x, l(1.000000)
  add r6.xy, r5.yzyy, l(-0.500000, -0.500000, 0.000000, 0.000000)
  ge r6.xy, l(0.500000, 0.500000, 0.000000, 0.000000), |r6.xyxx|
  and r5.x, r6.y, r6.x
  and r0.w, r0.w, r5.x
  if_nz r0.w
    mul r6.xy, r5.yzyy, cb0[18].xyxx
    ftoi r6.xy, r6.xyxx
    mov r6.zw, l(0,0,0,0)
    ld_indexable(texture2d)(uint,uint,uint,uint) r0.w, r6.xyww, t3.yzwx
    ld_indexable(texture2d)(float,float,float,float) r5.x, r6.xyzw, t4.xyzw
    and r6.x, r0.w, l(0x0000ffff)
    f16tof32 r6.x, r6.x
    ushr r0.w, r0.w, l(16)
    f16tof32 r6.y, r0.w
    add r6.xy, r5.yzyy, -r6.xyxx
    sample_l_indexable(texture2d)(float,float,float,float) r0.w, r6.xyxx, t7.yzwx, s3, l(0.000000)
    add r0.w, -|r5.x|, r0.w
    ge r0.w, l(0.010000), r0.w
    mov_sat r6.zw, r6.xxxy
    add r6.zw, -r6.zzzw, r6.xxxy
    dp2 r5.x, r6.zwzz, r6.zwzz
    eq r5.x, r5.x, l(0.000000)
    and r0.w, r0.w, r5.x
    if_nz r0.w
      mad r0.w, -r2.y, l(0.00392156886), l(1.000000)
      mad r0.w, r0.w, l(10.000000), l(1.000000)
      exp r0.w, r0.w
      add r0.w, r0.w, l(1.000000)
      div r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r0.w
      mul r0.w, r0.w, l(-2.03504682)
      exp r0.w, r0.w
      add r5.x, -r0.w, l(1.000000)
      sqrt r5.x, r5.x
      mad r6.z, r0.w, l(-0.0187292993), l(0.074261)
      mad r6.z, r6.z, r0.w, l(-0.212114394)
      mad r0.w, r6.z, r0.w, l(1.57072878)
      mul r0.w, r5.x, r0.w
      mul r0.w, r0.w, l(0.500000)
      sincos r5.x, r7.x, r0.w
      div r0.w, r5.x, r7.x
      mov_sat r4.w, r4.w
      sqrt r3.x, r3.x
      add r5.x, -r4.w, l(1.000000)
      mad r3.x, r3.x, r5.x, r4.w
      mul r0.w, r0.w, r3.x
      add r6.zw, r5.yyyz, -v1.xxxy
      dp2 r3.x, r6.zwzz, r6.zwzz
      sqrt r3.x, r3.x
      mul r0.w, r0.w, r3.x
      max r3.x, cb0[18].y, cb0[18].x
      dp2 r0.w, r3.xxxx, r0.wwww
      log r0.w, r0.w
      max r0.w, r0.w, l(0.000000)
      min r0.w, r0.w, l(7.000000)
      lt r3.x, l(0.000000), r2.y
      and r3.x, r3.x, l(0x3f800000)
      mul r0.w, r0.w, r3.x
      mul r3.x, r3.z, l(0.200000)
      sample_l_indexable(texture2d)(float,float,float,float) r7.xyz, r6.xyxx, t6.xyzw, s2, r0.w
      mad r8.xyz, r5.yzwy, l(2.000000, -2.000000, 1.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
      mov r8.w, l(1.000000)




      dp3 r0.w, r8.xyzx, r8.xyzx
      sqrt r0.w, r0.w
      mul r9.xyz, r8.yyyy, cb0[37].zxyz
      mad r9.xyz, r8.xxxx, cb0[36].zxyz, r9.xyzx
      mad r9.xyz, r8.zzzz, cb0[38].zxyz, r9.xyzx
      dp3 r4.w, r9.xyzx, r9.xyzx
      rsq r4.w, r4.w
      mul r9.xyz, r4.wwww, r9.xyzx
      sample_l_indexable(texture2d)(float,float,float,float) r4.w, r5.yzyy, t9.yzwx, s4, l(0.000000)
      add r5.x, r0.w, -cb1[19].y
      div_sat r5.x, r5.x, cb1[19].z
      mad r5.x, -r5.x, r4.w, l(1.000000)
      mul r5.y, r5.x, cb1[19].w
      min r5.z, |r9.y|, |r9.x|
      max r5.w, |r9.y|, |r9.x|
      div r5.w, l(1.000000, 1.000000, 1.000000, 1.000000), r5.w
      mul r5.z, r5.w, r5.z
      mul r5.w, r5.z, r5.z
      mad r6.z, r5.w, l(0.0208350997), l(-0.085133)
      mad r6.z, r5.w, r6.z, l(0.180141)
      mad r6.z, r5.w, r6.z, l(-0.330299497)
      mad r5.w, r5.w, r6.z, l(0.999866)
      mul r6.z, r5.w, r5.z
      lt r6.w, |r9.y|, |r9.x|
      mad r6.z, r6.z, l(-2.000000), l(1.57079637)
      and r6.z, r6.w, r6.z
      mad r5.z, r5.z, r5.w, r6.z
      lt r6.zw, r9.yyyz, -r9.yyyz
      and r5.w, r6.z, l(0xc0490fdb)
      add r5.z, r5.w, r5.z
      min r5.w, r9.y, r9.x
      max r6.z, r9.y, r9.x
      lt r5.w, r5.w, -r5.w
      ge r6.z, r6.z, -r6.z
      and r5.w, r5.w, r6.z
      movc r5.z, r5.w, -r5.z, r5.z
      mad r9.x, r5.z, l(0.159154937), l(0.500000)
      add r5.z, -|r9.z|, l(1.000000)
      sqrt r5.z, r5.z
      mad r5.w, |r9.z|, l(-0.0187292993), l(0.074261)
      mad r5.w, r5.w, |r9.z|, l(-0.212114394)
      mad r5.w, r5.w, |r9.z|, l(1.57072878)
      mul r6.z, r5.z, r5.w
      mad r6.z, r6.z, l(-2.000000), l(3.14159274)
      and r6.z, r6.w, r6.z
      mad r5.z, r5.w, r5.z, r6.z
      mul r9.y, r5.z, l(0.318309873)
      sample_l_indexable(texture2d)(float,float,float,float) r10.xyzw, r9.xyxx, t10.xyzw, s5, r5.y
      lt r5.z, l(0.000000), cb1[22].w
      if_nz r5.z
        sample_l_indexable(texture2d)(float,float,float,float) r9.xyzw, r9.xyxx, t11.xyzw, s5, r5.y
        add r9.xyzw, -r10.xyzw, r9.xyzw
        mad r10.xyzw, cb1[22].wwww, r9.xyzw, r10.xyzw
      endif
      mad r9.xyz, r10.xyzx, cb1[20].wwww, cb1[20].xyzx
      add r9.xyz, -r10.xyzx, r9.xyzx
      mad r5.xyw, r5.xxxx, r9.xyxz, r10.xyxz
      add r9.xyz, -cb1[21].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      mad r9.xyz, r4.wwww, r9.xyzx, cb1[21].xyzx
      mul r5.xyw, r5.xyxw, r9.xyxz
      mul r5.xyw, r5.xyxw, cb1[21].wwww
      mul r0.w, -r0.w, cb1[19].x
      mul r0.w, r0.w, l(1.442695)
      exp r0.w, r0.w
      add r0.w, -r0.w, l(1.000000)
      mul r6.z, r0.w, r10.w
      mad r5.xyw, r5.xyxw, r6.zzzz, -r7.xyxz
      mad r0.w, r10.w, r0.w, l(-1.000000)
      div r5.xyw, r5.xyxw, r0.wwww
      add r0.xyz, -r0.xyzx, r8.xyzx
      dp3 r0.x, r0.xyzx, r0.xyzx
      sqrt r0.x, r0.x
      mul r0.yzw, r2.zzzz, cb0[32].zzxy
      mad r0.yzw, r2.xxxx, cb0[31].zzxy, r0.yyzw
      mad r0.yzw, r2.wwww, cb0[33].zzxy, r0.yyzw
      add r2.x, r0.x, -cb1[19].y
      div_sat r2.x, r2.x, cb1[19].z
      mad r2.x, -r2.x, r4.w, l(1.000000)
      mul r2.z, r2.x, cb1[19].w
      min r2.w, |r0.z|, |r0.y|
      max r4.w, |r0.z|, |r0.y|
      div r4.w, l(1.000000, 1.000000, 1.000000, 1.000000), r4.w
      mul r2.w, r2.w, r4.w
      mul r4.w, r2.w, r2.w
      mad r6.z, r4.w, l(0.0208350997), l(-0.085133)
      mad r6.z, r4.w, r6.z, l(0.180141)
      mad r6.z, r4.w, r6.z, l(-0.330299497)
      mad r4.w, r4.w, r6.z, l(0.999866)
      mul r6.z, r2.w, r4.w
      lt r6.w, |r0.z|, |r0.y|
      mad r6.z, r6.z, l(-2.000000), l(1.57079637)
      and r6.z, r6.w, r6.z
      mad r2.w, r2.w, r4.w, r6.z
      lt r6.zw, r0.zzzw, -r0.zzzw
      and r4.w, r6.z, l(0xc0490fdb)
      add r2.w, r2.w, r4.w
      min r4.w, r0.z, r0.y
      max r0.y, r0.z, r0.y
      lt r0.z, r4.w, -r4.w
      ge r0.y, r0.y, -r0.y
      and r0.y, r0.y, r0.z
      movc r0.y, r0.y, -r2.w, r2.w
      mad r7.x, r0.y, l(0.159154937), l(0.500000)
      add r0.y, -|r0.w|, l(1.000000)
      sqrt r0.y, r0.y
      mad r0.z, |r0.w|, l(-0.0187292993), l(0.074261)
      mad r0.z, r0.z, |r0.w|, l(-0.212114394)
      mad r0.z, r0.z, |r0.w|, l(1.57072878)
      mul r0.w, r0.y, r0.z
      mad r0.w, r0.w, l(-2.000000), l(3.14159274)
      and r0.w, r6.w, r0.w
      mad r0.y, r0.z, r0.y, r0.w
      mul r7.y, r0.y, l(0.318309873)
      sample_l_indexable(texture2d)(float,float,float,float) r8.xyzw, r7.xyxx, t10.xyzw, s5, r2.z
      if_nz r5.z
        sample_l_indexable(texture2d)(float,float,float,float) r7.xyzw, r7.xyxx, t11.xyzw, s5, r2.z
        add r7.xyzw, -r8.xyzw, r7.xyzw
        mad r8.xyzw, cb1[22].wwww, r7.xyzw, r8.xyzw
      endif
      mad r0.yzw, r8.xxyz, cb1[20].wwww, cb1[20].xxyz
      add r0.yzw, -r8.xxyz, r0.yyzw
      mad r0.yzw, r2.xxxx, r0.yyzw, r8.xxyz
      mul r0.yzw, r9.xxyz, r0.yyzw
      mul r0.x, -r0.x, cb1[19].x
      mul r0.x, r0.x, l(1.442695)
      exp r0.x, r0.x
      add r0.x, -r0.x, l(1.000000)
      mul r0.x, r0.x, r8.w
      mad r0.yzw, r0.yyzw, cb1[21].wwww, -r5.xxyw
      mad r0.xyz, r0.xxxx, r0.yzwy, r5.xywx
      mad r2.xz, r6.xxyx, l(2.000000, 0.000000, 2.000000, 0.000000), l(-1.000000, 0.000000, -1.000000, 0.000000)
      add r2.xz, -|r2.xxzx|, l(1.000000, 0.000000, 1.000000, 0.000000)
      min r0.w, r2.z, r2.x
      div_sat r0.w, r0.w, r3.x
      min r4.xyz, -r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
      mov r4.xyz, -r4.xyzx
    else
      mov r4.xyz, l(0,0,0,0)
      mov r0.w, l(0)
    endif
  else
    mov r4.xyz, l(0,0,0,0)
    mov r0.w, l(0)
  endif
  mul r0.x, r3.w, r0.w
  mad r0.y, r2.y, l(0.00392156886), l(-0.200000)
  mul_sat r0.y, r0.y, l(-10.000000)
  mul r3.y, r0.y, r0.x
endif
ld_indexable(texture2d)(float,float,float,float) r0.xyzw, r1.xyzw, t12.xyzw
max r0.w, r0.w, l(1.000000)
div r0.xyz, r0.xyzx, r0.wwww
lt r0.w, r3.y, l(1.000000)
mul r1.x, r3.z, l(0.500000)
and r0.w, r0.w, r1.x
add_sat r0.w, -r0.w, r3.y
mad r1.xyz, r3.yyyy, r4.xyzx, -r0.xyzx
mad o0.xyz, r0.wwww, r1.xyzx, r0.xyzx
mov o0.w, l(1.000000)
ret
// Approximately 618 instruction slots used
