// MANUALLY DUMPED [ShaderRegex\ShaderFixes\Plague_DHR.ini\_Shadows1]
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.16 on Sat Dec 26 15:07:00 2020
//
//
// Buffer Definitions:
//
// cbuffer CBufferGlobalConstant_Z
// {
//
//   struct StructGlobalConstant_Z
//   {
//
//       float4 c[90];                  // Offset:    0
//
//   } Global;                          // Offset:    0 Size:  1440
//
// }
//
// cbuffer CBufferUserConstant_Z
// {
//
//   struct StructUserConstant_Z
//   {
//
//       float4 c[58];                  // Offset:    0
//
//   } User;                            // Offset:    0 Size:   928
//
// }
//
// cbuffer CBufferOmniConstant_Z
// {
//
//   struct StructOmniConstant_Z
//   {
//
//       struct ShaderOmni_Z
//       {
//
//           float4 Pos;                // Offset:    0
//           float4 Dir;                // Offset:   16
//           float4 Color;              // Offset:   32
//           float4 Value;              // Offset:   48
//           float4 Value2;             // Offset:   64
//           float4 Value3;             // Offset:   80
//           float4x4 ViewMat;          // Offset:   96
//           float4x4 ProjMat;          // Offset:  160
//
//       } Elt[5];                      // Offset:    0
//
//   } OmniArray;                       // Offset:    0 Size:  1120
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// sZBufferSampler                   sampler      NA          NA    1        1
// sProjSpotSampler                  sampler      NA          NA    2        1
// sGBuffer0                         texture    uint          2d    1        1
// sGBuffer1                         texture    uint          2d    2        1
// sGBuffer2                         texture    uint          2d    3        1
// sGBuffer3                         texture    uint          2d    4        1
// sZBuffer                          texture  float4          2d    5        1
// sBlueNoiseR8                      texture  float4     2darray    6        1
// sProjSpotTexArray[0]              texture  float4          2d    7        1
// CBufferGlobalConstant_Z           cbuffer      NA          NA    0        1
// CBufferUserConstant_Z             cbuffer      NA          NA    1        1
// CBufferOmniConstant_Z             cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// INSTANCE_COLOR           0   x           2     NONE   float
// INSTANCE_INDEXES         0   xy          3     NONE    uint
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xyzw        1   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[57], immediateIndexed
dcl_constantbuffer cb1[3], immediateIndexed
dcl_constantbuffer cb2[14], immediateIndexed
dcl_sampler s1, mode_default
dcl_sampler s2, 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 (uint,uint,uint,uint) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2darray (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear noperspective v1.xyzw
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_temps 23
dcl_resource_texture2d (float,float,float,float) t125
ftoi r0.xy, v0.xyxx
mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(uint,uint,uint,uint) r1.x, r0.xyww, t1.xyzw
ld_indexable(texture2d)(uint,uint,uint,uint) r1.y, r0.xyww, t2.yxzw
ld_indexable(texture2d)(uint,uint,uint,uint) r1.z, r0.xyww, t3.yzxw
ubfe r2.xy, l(8, 4, 0, 0), l(8, 16, 0, 0), r1.yyyy
utof r1.w, r2.x
mul r3.x, r1.w, l(0.00392156886)
ushr r2.x, r1.y, l(20)
and r2.z, r1.z, l(255)
ubfe r3.zw, l(0, 0, 8, 8), l(0, 0, 8, 16), r1.zzzz
utof r4.x, r2.z
utof r4.yz, r3.zzwz
mul r4.xyz, r4.xyzx, l(0.00392156886, 0.00392156886, 0.00392156886, 0.000000)
mul r5.xyz, r4.xyzx, r4.xyzx
ieq r1.z, r2.y, l(7)
if_nz r1.z
  ld_indexable(texture2d)(uint,uint,uint,uint) r0.x, r0.xyzw, t4.xyzw
  ushr r0.y, r1.x, l(24)
  utof r0.y, r0.y
  mul r3.y, r0.y, l(0.00392156886)
  ushr r0.yz, r0.xxxx, l(0, 17, 6, 0)
  and r0.yz, r0.yyzy, l(0, 0x00007ff0, 0x00007ff0, 0)
  bfi r0.x, l(10), l(5), r0.x, l(0)
  f16tof32 r6.xyz, r0.yzxy
  mad r0.xyz, r6.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  min r0.w, r3.y, r3.x
  mad r0.w, r0.w, l(2.000000), l(-1.000000)
  max r0.w, r0.w, l(0.000000)
  mad r6.xyz, r0.wwww, l(-0.040000, -0.040000, -0.040000, 0.000000), l(0.040000, 0.040000, 0.040000, 0.000000)
  mov r2.zw, r3.xxxy
else
  and r0.w, r1.y, l(255)
  utof r0.w, r0.w
  mul r0.w, r0.w, l(0.00392156886)
  mad r1.y, r1.w, l(0.00784313772), l(-1.000000)
  max r1.y, r1.y, l(0.000000)
  mad r1.y, r1.y, l(-0.040000), l(0.040000)
  mad r3.yzw, r4.xxyz, r4.xxyz, -r1.yyyy
  mad r6.xyz, r0.wwww, r3.yzwy, r1.yyyy
endif
and r0.w, r2.x, cb2[5].y
and r0.w, r0.w, l(15)
if_nz r0.w
  sample_l_indexable(texture2d)(float,float,float,float) r4.z, v1.xyxx, t5.yzxw, s1, l(0.000000)
  and r0.w, r1.x, l(4095)
  utof r7.x, r0.w
  ubfe r0.w, l(12), l(12), r1.x
  utof r7.y, r0.w
  mad r7.xy, r7.xyxx, l(0.000488400517, 0.000488400517, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
  mov r7.zw, l(0,0,1.000000,-1.000000)
  dp3 r8.z, r7.xyzx, -r7.xywx
  max r0.w, r8.z, l(0.000000)
  sqrt r0.w, r0.w
  mul r8.xy, r0.wwww, r7.xyxx
  mad r1.xyw, r8.xyxz, l(2.000000, 2.000000, 0.000000, -2.000000), l(0.000000, 0.000000, 0.000000, 1.000000)
  mov r4.xy, v1.zwzz
  mov r4.w, l(1.000000)

// Pattern Fix for Shadows, Lights and Reflections 1:
ld_indexable(texture2d)(float,float,float,float) r17.xyzw, l(0, 0, 0, 0), t125.xyzw
dp4 r19.w, r4.xyzw, cb0[56].xyzw
mul r18.x r17.y, r19.w
add r18.x, r18.x, l(-1.0)
mul r18.x, r17.x, r18.x
add r4.x, r4.x, r18.x


  dp4 r7.x, r4.xyzw, cb0[53].xyzw
  dp4 r7.y, r4.xyzw, cb0[54].xyzw
  dp4 r7.z, r4.xyzw, cb0[55].xyzw
  dp4 r0.w, r4.xyzw, cb0[56].xyzw
  div r7.xyz, r7.xyzx, r0.wwww
  if_z r1.z
    mov r5.xyz, l(0,0,0,0)
    mov r0.xyz, l(0,0,0,0)
    mov r2.zw, l(0,0,0,0)
  endif
  add r3.yzw, -r7.xxyz, cb2[0].xxyz
  dp3 r0.w, r3.yzwy, r3.yzwy
  sqrt r2.x, r0.w
  div r4.xyw, r3.yzyw, r2.xxxx
  dp3_sat r5.w, r1.xywx, r4.xywx
  mul r6.w, r0.w, cb2[4].y
  mad r8.x, r0.w, cb2[4].y, l(1.000000)
  div r8.x, l(1.000000, 1.000000, 1.000000, 1.000000), r8.x
  div r8.y, l(1.000000, 1.000000, 1.000000, 1.000000), cb2[3].y
  mul r8.y, r8.y, r8.y
  mul r6.w, r6.w, r8.y
  mad r6.w, -r6.w, r6.w, l(1.000000)
  max r6.w, r6.w, l(0.000000)
  mul r6.w, r6.w, r6.w
  dp3 r4.x, cb2[1].xyzx, r4.xywx
  mad_sat r4.x, r4.x, cb2[3].z, cb2[3].w
  mul r4.y, r4.x, r4.x
  mul r4.x, r4.y, r4.x
  mul r4.y, r6.w, r8.x
  mul r4.x, r4.x, r4.y
  ge r4.y, l(0.000000), r4.x
  eq r4.w, cb2[3].x, l(0.000000)
  ge r6.w, l(0.000000), r5.w
  and r4.w, r4.w, r6.w
  or r4.y, r4.w, r4.y
  ftou r8.xy, v0.xyxx
  if_nz r4.y
    mov r9.xyz, l(0,0,0,0)
  endif
  if_z r4.y
    dp3 r4.y, -r7.xyzx, -r7.xyzx
    rsq r4.y, r4.y
    mul r10.xyz, r4.yyyy, -r7.xyzx
    mul r4.xyw, r4.xxxx, cb2[2].xyxz
    lt r6.w, l(0.000000), cb2[3].x
    if_nz r6.w
      max r6.w, r3.x, l(0.080000)
      mul r6.w, r6.w, r6.w
      dp3 r9.w, -r10.xyzx, r1.xywx
      add r9.w, r9.w, r9.w
      mad r11.xyz, r1.xywx, -r9.wwww, -r10.xyzx
      dp3 r9.w, r11.xyzx, r11.xyzx
      rsq r9.w, r9.w
      mul r11.xyz, r9.wwww, r11.xyzx
      add r2.x, r2.x, l(0.000010)
      div r2.x, l(1.000000, 1.000000, 1.000000, 1.000000), r2.x
      mul_sat r2.x, r2.x, cb2[3].x
      mad r2.x, r2.x, l(0.500000), r6.w
      min r2.x, r2.x, l(1.000000)
      div r2.x, r6.w, r2.x
      mul r2.x, r2.x, r2.x
      dp3 r6.w, r3.yzwy, r11.xyzx
      mad r11.xyz, r6.wwww, r11.xyzx, -r3.yzwy
      dp3 r6.w, r11.xyzx, r11.xyzx
      sqrt r6.w, r6.w
      div_sat r6.w, cb2[3].x, r6.w
      mad r11.xyz, r11.xyzx, r6.wwww, r3.yzwy
    else
      mov r11.xyz, r3.yzwy
      mov r2.x, l(1.000000)
    endif
    dp3 r6.w, r11.xyzx, r11.xyzx
    rsq r6.w, r6.w
    mul r12.xyz, r6.wwww, r11.xyzx
    if_nz r1.z
      mul r13.xyz, r1.ywxy, r0.zxyz
      mad r13.xyz, r0.yzxy, r1.wxyw, -r13.xyzx
      max r14.xy, r2.zwzz, cb2[4].zzzz
      max r14.xy, r14.xyxx, l(0.080000, 0.080000, 0.000000, 0.000000)
      mad r15.xyz, r11.xyzx, r6.wwww, r10.xyzx
      dp3 r1.z, r15.xyzx, r15.xyzx
      rsq r1.z, r1.z
      mul r15.xyz, r1.zzzz, r15.xyzx
      dp3 r1.z, r1.xywx, r10.xyzx
      dp3_sat r9.w, r15.xyzx, r12.xyzx
      dp3_sat r10.w, r1.xywx, r15.xyzx
      dp3_sat r11.w, r1.xywx, r12.xyzx
      dp3 r12.w, r0.xyzx, r15.xyzx
      dp3 r13.w, r13.xyzx, r15.xyzx
      dp3 r14.z, r0.xyzx, r10.xyzx
      dp3 r14.w, r13.xyzx, r10.xyzx
      dp3 r0.x, r0.xyzx, r12.xyzx
      dp3 r0.y, r13.xyzx, r12.xyzx
      add r13.xyz, -r6.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      add r0.z, -r9.w, l(1.000000)
      mul r9.w, r0.z, r0.z
      mul r9.w, r9.w, r9.w
      mul r0.z, r0.z, r9.w
      mad r13.xyz, r13.xyzx, r0.zzzz, r6.xyzx
      mul r15.xyz, r14.xyxx, r14.xyxx
      mul r15.xyz, r15.xyyx, r15.xyzx
      mul r0.z, r12.w, r12.w
      div r9.w, r0.z, r15.x
      mul r12.w, r13.w, r13.w
      div r13.w, r12.w, r15.y
      add r9.w, r9.w, r13.w
      mad r9.w, r10.w, r10.w, r9.w
      mul r9.w, r9.w, r9.w
      mad r9.w, r9.w, r15.z, l(1.000000012E-007)
      rcp r9.w, r9.w
      mad r14.xy, r14.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
      mul r14.xy, r14.xyxx, r14.xyxx
      mul r13.w, r14.z, r14.z
      mul r14.xyz, r14.xywx, r14.xywx
      mul r14.w, r14.y, r14.z
      mad r14.w, r13.w, r14.x, r14.w
      mad r14.w, |r1.z|, |r1.z|, r14.w
      mul r0.xy, r0.xyxx, r0.xyxx
      mul r14.y, r14.y, r0.y
      mad r14.x, r0.x, r14.x, r14.y
      mad r14.x, r11.w, r11.w, r14.x
      sqrt r14.xw, r14.xxxw
      mul r14.x, |r1.z|, r14.x
      mad r14.x, r11.w, r14.w, r14.x
      add r14.x, r14.x, l(0.000010)
      div r14.x, l(0.500000), r14.x
      mul r15.xyz, r9.wwww, r13.xyzx
      mul r14.xyw, r14.xxxx, r15.xyxz
      add r15.xyz, -r13.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      mad r16.xyz, r5.xyzx, l(0.990000, 0.990000, 0.990000, 0.000000), l(0.010000, 0.010000, 0.010000, 0.000000)
      dp3 r9.w, r16.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
      div r5.xyz, r5.xyzx, r9.wwww
      mul r5.xyz, r14.xywx, r5.xyzx
      add r5.xyz, r5.xyzx, r5.xyzx
      log r2.zw, r2.zzzw
      mul r2.zw, r2.zzzw, l(0.000000, 0.000000, 1.500000, 1.500000)
      exp r2.zw, r2.zzzw
      max r2.zw, r2.zzzw, cb2[4].zzzz
      max r2.zw, r2.zzzw, l(0.000000, 0.000000, 0.080000, 0.080000)
      mul r14.xyw, r2.zwzz, r2.zwzz
      mul r14.xyw, r14.xyxy, r14.xyxw
      div r0.z, r0.z, r14.x
      div r9.w, r12.w, r14.y
      add r0.z, r0.z, r9.w
      mad r0.z, r10.w, r10.w, r0.z
      mul r0.z, r0.z, r0.z
      mad r0.z, r0.z, r14.w, l(1.000000012E-007)
      rcp r0.z, r0.z
      mad r2.zw, r2.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000), l(0.000000, 0.000000, 0.500000, 0.500000)
      mul r2.zw, r2.zzzw, r2.zzzw
      mul r2.zw, r2.zzzw, r2.zzzw
      mul r9.w, r2.w, r14.z
      mad r9.w, r13.w, r2.z, r9.w
      mad r9.w, |r1.z|, |r1.z|, r9.w
      sqrt r9.w, r9.w
      mul r0.y, r0.y, r2.w
      mad r0.x, r0.x, r2.z, r0.y
      mad r0.x, r11.w, r11.w, r0.x
      sqrt r0.x, r0.x
      mul r0.x, r0.x, |r1.z|
      mad r0.x, r11.w, r9.w, r0.x
      add r0.x, r0.x, l(0.000010)
      div r0.x, l(0.500000), r0.x
      mul r13.xyz, r0.zzzz, r13.xyzx
      mul r0.xyz, r0.xxxx, r13.xyzx
      mad r0.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), r5.xyzx
    else
      max r1.z, r3.x, cb2[4].z
      max r1.z, r1.z, l(0.080000)
      mad r5.xyz, r11.xyzx, r6.wwww, r10.xyzx
      dp3 r2.z, r5.xyzx, r5.xyzx
      rsq r2.z, r2.z
      mul r5.xyz, r2.zzzz, r5.xyzx
      dp3 r2.z, r1.xywx, r10.xyzx
      dp3_sat r2.w, r5.xyzx, r12.xyzx
      dp3_sat r3.x, r1.xywx, r5.xyzx
      dp3_sat r5.x, r1.xywx, r12.xyzx
      add r10.xyz, -r6.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      add r5.y, -r2.w, l(1.000000)
      mul r5.z, r5.y, r5.y
      mul r5.z, r5.z, r5.z
      mul r5.y, r5.y, r5.z
      mad r6.xyz, r10.xyzx, r5.yyyy, r6.xyzx
      mul r5.y, r1.z, r1.z
      mul r5.y, r5.y, r5.y
      mad r5.z, r3.x, r5.y, -r3.x
      mad r3.x, r5.z, r3.x, l(1.000000)
      mul r3.x, r3.x, r3.x
      div r3.x, r5.y, r3.x
      mad r5.yz, r1.zzzz, l(0.000000, 0.500000, -0.337748349, 0.000000), l(0.000000, 0.500000, 1.000000, 0.000000)
      mul r6.w, r5.y, r5.y
      mad r5.y, -r5.y, r5.y, l(1.000000)
      mad r9.w, |r2.z|, r5.y, r6.w
      mad r5.y, r5.x, r5.y, r6.w
      mul r5.y, |r2.z|, r5.y
      mad r5.y, r5.x, r9.w, r5.y
      add r5.y, r5.y, l(0.000010)
      rcp r5.y, r5.y
      mul r5.y, r5.y, l(0.500000)
      mul r6.xyz, r3.xxxx, r6.xyzx
      mul r0.xyz, r5.yyyy, r6.xyzx
      mul r2.w, r2.w, r2.w
      dp2 r2.w, r2.wwww, r1.zzzz
      mad r1.z, r1.z, l(0.500000), r2.w
      add r1.z, r1.z, l(-1.000000)
      add r2.w, -r5.x, l(1.000000)
      mul r3.x, r2.w, r2.w
      mul r3.x, r3.x, r3.x
      mul r2.w, r2.w, r3.x
      mad r2.w, r1.z, r2.w, l(1.000000)
      add r2.z, -|r2.z|, l(1.000000)
      mul r3.x, r2.z, r2.z
      mul r3.x, r3.x, r3.x
      mul r2.z, r2.z, r3.x
      mad r1.z, r1.z, r2.z, l(1.000000)
      mul r1.z, r1.z, r2.w
      mul r15.xyz, r5.zzzz, r1.zzzz
    endif
    mul r5.xyz, r5.wwww, r4.xywx
    mul r9.xyz, r5.xyzx, r15.xyzx
    dp3_sat r1.z, r1.xywx, r12.xyzx
    mul r4.xyw, r1.zzzz, r4.xyxw
    mul r2.xzw, r2.xxxx, r4.xxyw
    mul r0.xyz, r0.xyzx, r2.xzwx
  else
    mov r0.xyz, l(0,0,0,0)
  endif
  lt r2.xzw, l(0.000000, 0.000000, 0.000000, 0.000000), r9.xxyz
  or r1.z, r2.z, r2.x
  or r1.z, r2.w, r1.z
  lt r2.xzw, l(0.000000, 0.000000, 0.000000, 0.000000), r0.xxyz
  or r2.x, r2.z, r2.x
  or r2.x, r2.w, r2.x
  or r1.z, r1.z, r2.x
  if_nz r1.z
    mov r7.w, l(1.000000)
    dp4 r4.x, r7.xyzw, cb2[10].xyzw
    dp4 r4.y, r7.xyzw, cb2[11].xyzw
    dp4 r1.z, r7.xyzw, cb2[13].xyzw
    div r2.xz, r4.xxyx, r1.zzzz
    mov r8.zw, l(0,0,0,0)
    ld_aoffimmi_indexable(-1,0,0)(texture2d)(float,float,float,float) r4.x, r8.xyww, t5.xywz
    ld_aoffimmi_indexable(1,0,0)(texture2d)(float,float,float,float) r5.x, r8.xyww, t5.xyzw
    ld_aoffimmi_indexable(0,-1,0)(texture2d)(float,float,float,float) r6.x, r8.xyww, t5.xyzw
    ld_aoffimmi_indexable(0,1,0)(texture2d)(float,float,float,float) r10.x, r8.xyzw, t5.xyzw
    add r1.z, -r4.z, r4.x
    add r2.w, -r4.z, r5.x
    lt r1.z, |r1.z|, |r2.w|
    mov r4.yw, l(0,-1.000000,0,0)
    mov r5.yzw, l(0,1.000000,0,1.000000)
    movc r5.xyz, r1.zzzz, r4.ywxy, r5.yzxy
    add r1.z, -r4.z, r6.x
    add r2.w, -r4.z, r10.x
    lt r1.z, |r1.z|, |r2.w|
    mov r6.yz, l(0,0,-1.000000,0)
    mov r10.yz, l(0,0,1.000000,0)
    movc r4.xyz, r1.zzzz, r6.yzxy, r10.yzxy
    utof r6.xy, r8.xyxx
    add r6.zw, r5.xxxy, r6.xxxy
    mul r6.zw, r6.zzzw, cb0[18].zzzw
    mad r5.xy, r6.zwzz, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
    dp4 r10.x, r5.xyzw, cb0[53].xyzw
    dp4 r10.y, r5.xyzw, cb0[54].xyzw
    dp4 r10.z, r5.xyzw, cb0[55].xyzw
    dp4 r1.z, r5.xyzw, cb0[56].xyzw
    div r5.xyz, r10.xyzx, r1.zzzz
    add r6.xy, r4.xyxx, r6.xyxx
    mul r6.xy, r6.xyxx, cb0[18].zwzz
    mad r4.xy, r6.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
    mov r4.w, l(1.000000)
    dp4 r6.x, r4.xyzw, cb0[53].xyzw
    dp4 r6.y, r4.xyzw, cb0[54].xyzw
    dp4 r6.z, r4.xyzw, cb0[55].xyzw
    dp4 r1.z, r4.xyzw, cb0[56].xyzw
    div r4.xyz, r6.xyzx, r1.zzzz
    mov r5.w, l(1.000000)
    dp4 r6.x, r5.xyzw, cb2[10].xyzw
    dp4 r6.y, r5.xyzw, cb2[11].xyzw
    dp4 r1.z, r5.xyzw, cb2[13].xyzw
    div r5.xy, r6.xyxx, r1.zzzz
    mov r4.w, l(1.000000)
    dp4 r6.x, r4.xyzw, cb2[10].xyzw
    dp4 r6.y, r4.xyzw, cb2[11].xyzw
    dp4 r1.z, r4.xyzw, cb2[13].xyzw
    div r4.xy, r6.xyxx, r1.zzzz
    add r4.zw, -r2.xxxz, r5.xxxy
    add r4.xy, -r2.xzxx, r4.xyxx
    mov r4.xyzw, |r4.xyzw|
    sample_d_indexable(texture2d)(float,float,float,float) r2.xzw, r2.xzxx, t7.xwyz, s2, r4.zwzz, r4.xyxx
    mul r9.xyz, r2.xzwx, r9.xyzx
    mul r0.xyz, r0.xyzx, r2.xzwx
  endif
  lt r1.z, l(0.000000), cb1[2].x
  ieq r2.xy, r2.yyyy, l(4, 6, 0, 0)
  or r2.x, r2.y, r2.x
  and r1.z, r1.z, r2.x
  lt r2.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r9.xyzx
  or r2.x, r2.y, r2.x
  or r2.x, r2.z, r2.x
  lt r2.yzw, l(0.000000, 0.000000, 0.000000, 0.000000), r0.xxyz
  or r2.y, r2.z, r2.y
  or r2.y, r2.w, r2.y
  or r2.x, r2.y, r2.x
  and r1.z, r1.z, r2.x
  if_nz r1.z
    rsq r0.w, r0.w
    mul r2.xyz, r0.wwww, r3.yzwy
    ftou r0.w, cb1[2].z
    dp3 r1.z, r1.xywx, r2.xyzx
    mad r1.z, -r1.z, r1.z, l(1.000000)
    max r1.z, r1.z, l(0.000000)
    mul r1.z, r1.z, l(0.001000)
    mad r1.xyz, r1.zzzz, r1.xywx, r7.xyzx
    mov r1.w, l(1.000000)
    dp4 r3.x, r1.xyzw, cb0[49].xyzw
    dp4 r3.y, r1.xyzw, cb0[50].xyzw
    dp4 r3.z, r1.xyzw, cb0[51].xyzw
    dp4 r1.w, r1.xyzw, cb0[52].xyzw
    div r3.xyz, r3.xyzx, r1.wwww
    mad r4.xy, r3.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
    mad r1.xyz, r2.xyzx, l(0.150000, 0.150000, 0.150000, 0.000000), r1.xyzx
    mov r1.w, l(1.000000)
    dp4 r2.x, r1.xyzw, cb0[49].xyzw
    dp4 r2.y, r1.xyzw, cb0[50].xyzw
    dp4 r2.z, r1.xyzw, cb0[51].xyzw
    dp4 r1.x, r1.xyzw, cb0[52].xyzw
    div r1.xyw, r2.xyxz, r1.xxxx
    mad r2.xyz, r3.xyzx, l(0.500000, -0.500000, 1.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
    mad r1.xyw, r1.xyxw, l(0.500000, -0.500000, 0.000000, 1.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
    add r1.xyw, -r2.xyxz, r1.xyxw
    lt r1.z, r1.z, l(0.000000)
    movc r1.z, r1.z, l(-1.000000), l(1.000000)
    mul r3.xyz, r1.zzzz, r1.xywx
    max r2.w, |r3.y|, |r3.x|
    div r3.xyz, r3.xyzx, r2.wwww
    max r2.w, cb0[18].w, cb0[18].z
    mul r3.xyz, r2.wwww, r3.xyzx
    add r5.xyz, r3.xyzx, r3.xyzx
    mad r2.xyz, r3.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r2.xyzx
    mad r1.xyz, r1.xywx, r1.zzzz, -r5.xyzx
    iadd r3.xy, r0.wwww, l(-1, 2, 0, 0)
    imul null, r1.w, r3.y, r3.x
    ushr r1.w, r1.w, l(1)
    utof r1.w, r1.w
    div r1.xyz, r1.xyzx, r1.wwww
    eq r1.w, cb0[49].z, l(0.000000)
    ftou r2.w, cb0[1].w
    movc r3.z, r1.w, l(0), r2.w
    and r3.xy, r8.xyxx, l(63, 63, 0, 0)
    mov r3.w, l(0)
    ld_indexable(texture2darray)(float,float,float,float) r1.w, r3.xyzw, t6.yzwx
    mov r3.xyz, r2.xyzx
    mov r5.xyz, r2.xyzx
    mov r2.w, l(1.000000)
    mov r3.w, l(-1.000000)
    mov r4.z, l(2)
    loop
      ult r4.w, r0.w, r4.z
      breakc_nz r4.w
      sample_l_indexable(texture2d)(float,float,float,float) r4.w, r5.xyxx, t5.yzwx, s1, l(0.000000)
      add r4.w, r4.w, -cb0[51].z
      div r4.w, cb0[51].w, r4.w
      add r5.w, r5.z, -cb0[51].z
      div r5.w, cb0[51].w, r5.w
      add r4.w, -r4.w, r5.w
      add r4.w, r4.w, l(-0.075000)
      lt r4.w, |r4.w|, l(0.075000)
      lt r5.w, r3.w, l(0.000000)
      and r4.w, r4.w, r5.w
      movc r3.w, r4.w, r2.w, r3.w
      utof r4.w, r4.z
      mul r6.xyz, r1.xyzx, r4.wwww
      mad r5.xyz, r6.xyzx, r1.wwww, r3.xyzx
      mad r3.xyz, r4.wwww, r1.xyzx, r3.xyzx
      add r2.w, r2.w, r4.w
      iadd r4.z, r4.z, l(1)
    endloop
    lt r0.w, l(0.000000), r3.w
    and r0.w, r0.w, l(0x3f800000)
    mad r1.xy, r1.xyxx, r3.wwww, r4.xyxx
    mad r1.xy, r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
    mad r1.xy, |r1.xyxx|, l(7.000000, 7.000000, 0.000000, 0.000000), l(-6.000000, -6.000000, 0.000000, 0.000000)
    max r1.xy, r1.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
    mad r1.x, -r1.x, r1.x, l(1.000000)
    mad r1.x, -r1.y, r1.y, r1.x
    max r1.x, r1.x, l(0.000000)
    mad r0.w, -r0.w, r1.x, l(1.000000)
    mul r9.xyz, r0.wwww, r9.xyzx
    mul r0.xyz, r0.wwww, r0.xyzx
  endif
  mov o0.xyz, r9.xyzx
  mov o0.w, l(1.000000)
  mov o1.xyz, r0.xyzx
  mov o1.w, l(1.000000)
else
  mov o0.xyzw, l(0,0,0,0)
  mov o1.xyzw, l(0,0,0,0)
endif
ret
// Approximately 457 instruction slots used
