//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.15 on Mon Mar 11 09:54:22 2019
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   int nClstPtch[2];                  // Offset:    0 Size:    20
//   float4 vClstZPrm;                  // Offset:   32 Size:    16
//   row_major float4x4 mTrsW2LPV[4];   // Offset:   48 Size:   256
//   row_major float4x4 mTrsW2LPVSR[4]; // Offset:  304 Size:   256
//   int nLPV3DDepth;                   // Offset:  560 Size:     4
//   float fDiffuseScale;               // Offset:  564 Size:     4
//   float fNormalDir;                  // Offset:  568 Size:     4
//   float4 fSHBlendRegion;             // Offset:  576 Size:    16
//   float4 g_vScrnSize;                // Offset:  592 Size:    16
//
// }
//
// cbuffer VolumetricFogConstBuf
// {
//
//   row_major float4x4 gV2W;           // Offset:    0 Size:    64
//   row_major float4x4 gPrevW2P;       // Offset:   64 Size:    64
//   float4 gAngleAndNearFar;           // Offset:  128 Size:    16
//   float4 gCalcVolumeFactor;          // Offset:  144 Size:    16
//   float4 gEyePosAndFogFar;           // Offset:  160 Size:    16
//   float4 gInjectionDesc;             // Offset:  176 Size:    16
//   int4 gLightInfo;                   // Offset:  192 Size:    16
//   float4 gFogNoiseInfo;              // Offset:  208 Size:    16
//   float4 gScatteringInfo;            // Offset:  224 Size:    16
//   float4 gAccParams;                 // Offset:  240 Size:    16
//   float4 gAttParam;                  // Offset:  256 Size:    16 [unused]
//   row_major float4x4 gW2P;           // Offset:  272 Size:    64
//
// }
//
// Resource bind info for sParaLightInfo
// {
//
//   struct slVFParallelLightInfo
//   {
//
//       struct slVFCommonLightInfo
//       {
//
//           float4 vMapDesc;           // Offset:    0
//           float4 vColorScale;        // Offset:   16
//           float4 vEcc;               // Offset:   32
//
//       } sCommon;                     // Offset:    0
//
//       struct slSVFParallelLight
//       {
//
//           float4 vDir;               // Offset:   48
//           float4 vDiffuse;           // Offset:   64
//
//       } sLightInfo;                  // Offset:   48
//       float4 vAttr;                  // Offset:   80
//       row_major float4x4 mW2S;       // Offset:   96
//       row_major float4x4 mW2S2;      // Offset:  160
//       row_major float4x4 mW2S3;      // Offset:  224
//       row_major float4x4 mW2S4;      // Offset:  288
//       float4 vSegs;                  // Offset:  352
//       row_major float4x4 mUVS;       // Offset:  368
//
//   } $Element;                        // Offset:    0 Size:   432
//
// }
//
// Resource bind info for sPointLightInfo
// {
//
//   struct slVFPointBasicLightInfo
//   {
//
//       struct slVFCommonLightInfo
//       {
//
//           float4 vMapDesc;           // Offset:    0
//           float4 vColorScale;        // Offset:   16
//           float4 vEcc;               // Offset:   32
//
//       } sCommon;                     // Offset:    0
//       float4 vW2S;                   // Offset:   48
//
//   } $Element;                        // Offset:    0 Size:    64
//
// }
//
// Resource bind info for sSpotLightInfo
// {
//
//   struct slVFSpotBasicLightInfo
//   {
//
//       struct slVFCommonLightInfo
//       {
//
//           float4 vMapDesc;           // Offset:    0
//           float4 vColorScale;        // Offset:   16
//           float4 vEcc;               // Offset:   32
//
//       } sCommon;                     // Offset:    0
//       row_major float4x4 vW2S;       // Offset:   48
//
//   } $Element;                        // Offset:    0 Size:   112
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// __smpsIES                         sampler      NA          NA    0        1
// __smpsLPVBuffer                   sampler      NA          NA    1        1
// __smpsPermutation                 sampler      NA          NA    8        1
// __smpsVolumeSrc                   sampler      NA          NA    9        1
// __smpsParallelShadwoMap           sampler      NA          NA   10        1
// __smpsSpotShadwoMap               sampler      NA          NA   12        1
// __smpsPointShadwoMapArray         sampler      NA          NA   13        1
// sIES                              texture  float4     2darray    0        1
// sLPVBuffer                        texture  float4     2darray    1        1
// sPermutation                      texture  float4          2d    8        1
// sVolumeSrc                        texture  float4          3d    9        1
// sParallelShadwoMap                texture  float4     2darray   10        1
// sSpotShadwoMap                    texture  float4     2darray   12        1
// sPointShadwoMapArray              texture  float4   cubearray   13        1
// tCllLightIndices                  texture    uint         buf   16        1
// tCllLightPositions                texture  float4         buf   17        1
// tCllLightAttributes               texture  float3         buf   18        1
// tCllLightExAttributes             texture    uint         buf   19        1
// tCllSptLightAttributes            texture  float3         buf   20        1
// tCllSptLightExAttributes          texture    uint         buf   21        1
// sParaLightInfo                    texture  struct         r/o   25        1
// sPointLightInfo                   texture  struct         r/o   26        1
// sSpotLightInfo                    texture  struct         r/o   27        1
// sPointScatterAttr                 texture   float         buf   28        1
// sSpotScatterAttr                  texture   float         buf   29        1
// uavTarget                             UAV  float4          3d    0        1
// $Globals                          cbuffer      NA          NA    0        1
// VolumetricFogConstBuf             cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Input
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Output
cs_5_0
dcl_globalFlags refactoringAllowed
dcl_immediateConstantBuffer { { 0.803872, 0.150443, 0, 0},
                              { 0.319390, 0.678267, 0, 0},
                              { 0.829900, 0.637985, 0, 0},
                              { 0.328207, 0.153939, 0, 0},
                              { 0.560534, 0.433465, 0, 0},
                              { 0.065083, 0.887866, 0, 0},
                              { 0.566012, 0.888956, 0, 0},
                              { 0.072389, 0.371696, 0, 0},
                              { 0.823005, 0.922220, 0, 0},
                              { 0.076603, 0.623061, 0, 0},
                              { 0.068519, 0.128029, 0, 0},
                              { 0.562161, 0.162508, 0, 0},
                              { 0.330991, 0.402450, 0, 0},
                              { 0.307688, 0.906845, 0, 0},
                              { 0.802652, 0.392071, 0, 0},
                              { 0.605639, 0.656884, 0, 0} }
dcl_constantbuffer cb0[38], immediateIndexed
dcl_constantbuffer cb1[21], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s8, mode_default
dcl_sampler s9, mode_default
dcl_sampler s10, mode_default
dcl_sampler s12, mode_default
dcl_sampler s13, mode_default
dcl_resource_texture2darray (float,float,float,float) t0
dcl_resource_texture2darray (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t8
dcl_resource_texture3d (float,float,float,float) t9
dcl_resource_texture2darray (float,float,float,float) t10
dcl_resource_texture2darray (float,float,float,float) t12
dcl_resource_texturecubearray (float,float,float,float) t13
dcl_resource_buffer (uint,uint,uint,uint) t16
dcl_resource_buffer (float,float,float,float) t17
dcl_resource_buffer (float,float,float,float) t18
dcl_resource_buffer (uint,uint,uint,uint) t19
dcl_resource_buffer (float,float,float,float) t20
dcl_resource_buffer (uint,uint,uint,uint) t21
dcl_resource_structured t25, 432
dcl_resource_structured t26, 64
dcl_resource_structured t27, 112
dcl_resource_buffer (float,float,float,float) t28
dcl_resource_buffer (float,float,float,float) t29
dcl_uav_typed_texture3d (float,float,float,float) u0
dcl_input vThreadID.xyz
dcl_temps 25
dcl_thread_group 8, 8, 4

dcl_resource_texture2d (float,float,float,float) t121
ld_indexable(texture2d)(float,float,float,float) r23.xyzw, l(0, 0, 0, 0), t121.xyzw

resinfo_indexable(texture3d)(float,float,float,float)_uint r0.xyz, l(0), u0.xyzw
utof r1.xyz, vThreadID.xyzx
add r1.xyz, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
utof r2.xyz, r0.xyzx
div r1.xyz, r1.xyzx, r2.xyzx
mad r1.xyz, r1.xyzx, l(2.000000, -2.000000, 1.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
iadd r0.w, vThreadID.z, l(1)
utof r0.w, r0.w
div r0.w, r0.w, r2.z
lt r3.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), cb1[11].zxyz
and r1.w, r3.y, r3.x
if_nz r1.w
  utof r3.xy, vThreadID.xzxx
  add r1.w, r3.x, cb1[11].x
  ishl r2.w, vThreadID.y, l(1)
  utof r2.w, r2.w
  add r1.w, r1.w, r2.w
  mad r1.w, r3.y, cb1[11].x, r1.w
  ftou r1.w, r1.w
  and r1.w, r1.w, l(15)
  add r3.xy, l(-0.500000, -0.500000, 0.000000, 0.000000), icb[r1.w + 0].xyxx
  utof r4.xy, r0.xyxx
  div r3.xy, r3.xyxx, r4.xyxx
  mad r3.xy, r3.xyxx, cb1[11].zzzz, r1.xyxx
else
  mov r3.xy, r1.xyxx
endif
mul r1.z, r1.z, cb1[9].w
mul r1.z, r1.z, l(1.442695)
exp r1.z, r1.z
mul r1.z, -r1.z, cb1[8].z
mul r0.w, r0.w, cb1[9].w
mul r0.w, r0.w, l(1.442695)
exp r0.w, r0.w
mul r0.w, -r0.w, cb1[8].z
mul r4.xy, r3.xyxx, cb1[8].xyxx
mul r4.zw, -r1.zzzz, r4.xxxy
mul r4.xy, -r0.wwww, r4.xyxx

// We need to correct two coordinates in view-space, but we don't have the
// projection or inverse projection matrix handy. We only need the FOV though,
// which we can derive from the matrices we do have via
//   (1,0,0,0) * gV2W * W2P
// = V2W[top row] * W2P

mul r24.xyzw, cb1[0].xxxx, cb1[17].xyzw
mad r24.xyzw, cb1[0].yyyy, cb1[18].xyzw, r24.xyzw
mad r24.xyzw, cb1[0].zzzz, cb1[19].xyzw, r24.xyzw
mad r24.xyzw, cb1[0].wwww, cb1[20].xyzw, r24.xyzw

// Remember, in this game view-space Z is negative linear depth

add r23.w, -r1.z, -r23.y
mul r23.w, r23.w, r23.x
div r23.w, r23.w, r24.x
add r4.z, r4.z, -r23.w

add r23.w, -r0.w, -r23.y
mul r23.w, r23.w, r23.x
div r23.w, r23.w, r24.x
add r4.x, r4.x, -r23.w

// gV2W
mul r5.xyzw, r4.wwww, cb1[1].xyzw
mad r5.xyzw, r4.zzzz, cb1[0].xyzw, r5.xyzw
mad r5.xyzw, r1.zzzz, cb1[2].xyzw, r5.xyzw
add r5.xyzw, r5.xyzw, cb1[3].xyzw
// gV2W
mul r4.yzw, r4.yyyy, cb1[1].xxyz
mad r4.xyz, r4.xxxx, cb1[0].xyzx, r4.yzwy
mad r4.xyz, r0.wwww, cb1[2].xyzx, r4.xyzx
add r4.xyz, r4.xyzx, cb1[3].xyzx
// gW2P
mul r6.xy, r5.yyyy, cb1[18].zwzz
mad r6.xy, r5.xxxx, cb1[17].zwzz, r6.xyxx
mad r6.xy, r5.zzzz, cb1[19].zwzz, r6.xyxx
mad r6.xy, r5.wwww, cb1[20].zwzz, r6.xyxx

div r0.w, r6.x, r6.y
add r6.xyz, r5.yzxy, -cb1[10].yzxy
dp3 r1.w, r6.xyzx, r6.xyzx
rsq r1.w, r1.w
mul r6.xyz, r1.wwww, r6.xyzx
add r7.xyz, -r4.xyzx, r5.xyzx
dp3 r1.w, r7.xyzx, r7.xyzx
sqrt r1.w, r1.w
lt r2.w, cb1[14].y, r5.y
add r3.w, r5.y, -cb1[14].y
div r3.w, -r3.w, cb1[14].y
mul r3.w, r3.w, l(1.442695)
exp r3.w, r3.w
mul r3.w, r3.w, cb1[14].x
movc r2.w, r2.w, r3.w, cb1[14].x
mov r7.xyz, l(0,0,0,0)
mov r3.w, l(0)
loop
  uge r4.w, r3.w, cb1[12].x
  breakc_nz r4.w
  ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r8.xyz, r3.w, l(0), t25.xyzx
  ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r9.xyz, r3.w, l(16), t25.xyzx
  ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r4.w, r3.w, l(32), t25.xxxx
  ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r10.xyz, r3.w, l(48), t25.xyzx
  ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r11.xyz, r3.w, l(64), t25.xyzx
  eq r6.w, r8.x, l(2.000000)
  if_nz r6.w
    mul r12.xyz, r9.xyzx, r11.xyzx
    dp3 r6.w, r10.yzxy, r6.xyzx
    mad r7.w, -r4.w, r4.w, l(1.000000)
    mad r8.w, r4.w, r4.w, l(1.000000)
    dp2 r6.w, r6.wwww, r4.wwww
    add r6.w, -r6.w, r8.w
    log r6.w, |r6.w|
    mul r6.w, r6.w, l(1.500000)
    exp r6.w, r6.w
    div r6.w, r7.w, r6.w
    mul r6.w, r6.w, l(0.785398)
    mad r7.xyz, r12.xyzx, r6.wwww, r7.xyzx
  else
    ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r6.w, r3.w, l(80), t25.xxxx
    ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r12.xyzw, r3.w, l(96), t25.xyzw
    ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r13.xyzw, r3.w, l(112), t25.xyzw
    ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r14.xyzw, r3.w, l(128), t25.xyzw
    ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r15.xyzw, r3.w, l(144), t25.xyzw
    lt r6.w, l(0.000000), r6.w
    if_nz r6.w
      ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r16.xyz, r3.w, l(352), t25.xyzx
      lt r6.w, r16.x, -r1.z
      if_nz r6.w
        lt r6.w, r16.y, -r1.z
        if_nz r6.w
          lt r6.w, r16.z, -r1.z
          if_nz r6.w
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r16.xyzw, r3.w, l(288), t25.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r17.xyzw, r3.w, l(304), t25.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r18.xyzw, r3.w, l(320), t25.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r15.xyzw, r3.w, l(336), t25.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r19.xyzw, r3.w, l(416), t25.xyzw
            mov r20.x, r16.x
            mov r20.y, r17.x
            mov r20.z, r18.x
            mov r20.w, r15.x
            mov r21.x, r16.y
            mov r21.y, r17.y
            mov r21.z, r18.y
            mov r21.w, r15.y
            mov r22.x, r16.z
            mov r22.y, r17.z
            mov r22.z, r18.z
            mov r22.w, r15.z
            mov r15.x, r16.w
            mov r15.y, r17.w
            mov r15.z, r18.w
          else
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r16.xyzw, r3.w, l(224), t25.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r17.xyzw, r3.w, l(240), t25.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r18.xyzw, r3.w, l(256), t25.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r15.xyzw, r3.w, l(272), t25.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r19.xyzw, r3.w, l(400), t25.xyzw
            mov r20.x, r16.x
            mov r20.y, r17.x
            mov r20.z, r18.x
            mov r20.w, r15.x
            mov r21.x, r16.y
            mov r21.y, r17.y
            mov r21.z, r18.y
            mov r21.w, r15.y
            mov r22.x, r16.z
            mov r22.y, r17.z
            mov r22.z, r18.z
            mov r22.w, r15.z
            mov r15.x, r16.w
            mov r15.y, r17.w
            mov r15.z, r18.w
          endif
        else
          ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r16.xyzw, r3.w, l(160), t25.xyzw
          ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r17.xyzw, r3.w, l(176), t25.xyzw
          ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r18.xyzw, r3.w, l(192), t25.xyzw
          ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r15.xyzw, r3.w, l(208), t25.xyzw
          ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r19.xyzw, r3.w, l(384), t25.xyzw
          mov r20.x, r16.x
          mov r20.y, r17.x
          mov r20.z, r18.x
          mov r20.w, r15.x
          mov r21.x, r16.y
          mov r21.y, r17.y
          mov r21.z, r18.y
          mov r21.w, r15.y
          mov r22.x, r16.z
          mov r22.y, r17.z
          mov r22.z, r18.z
          mov r22.w, r15.z
          mov r15.x, r16.w
          mov r15.y, r17.w
          mov r15.z, r18.w
        endif
      else
        ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r19.xyzw, r3.w, l(368), t25.xyzw
        mov r20.x, r12.x
        mov r20.y, r13.x
        mov r20.z, r14.x
        mov r20.w, r15.x
        mov r21.x, r12.y
        mov r21.y, r13.y
        mov r21.z, r14.y
        mov r21.w, r15.y
        mov r22.x, r12.z
        mov r22.y, r13.z
        mov r22.z, r14.z
        mov r22.w, r15.z
        mov r15.x, r12.w
        mov r15.y, r13.w
        mov r15.z, r14.w
      endif
    else
      mov r20.x, r12.x
      mov r20.y, r13.x
      mov r20.z, r14.x
      mov r20.w, r15.x
      mov r21.x, r12.y
      mov r21.y, r13.y
      mov r21.z, r14.y
      mov r21.w, r15.y
      mov r22.x, r12.z
      mov r22.y, r13.z
      mov r22.z, r14.z
      mov r22.w, r15.z
      mov r15.x, r12.w
      mov r15.y, r13.w
      mov r15.z, r14.w
      mov r19.xyzw, l(1.000000,1.000000,0,0)
    endif
    dp4 r12.x, r5.xyzw, r20.xyzw
    dp4 r12.y, r5.xyzw, r21.xyzw
    dp4 r12.z, r5.xyzw, r22.xyzw
    dp4 r6.w, r5.xyzw, r15.xyzw
    div r12.xyz, r12.xyzx, r6.wwww
    lt r13.xy, r12.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
    lt r13.zw, l(0.000000, 0.000000, 1.000000, 1.000000), r12.xxxy
    or r6.w, r13.z, r13.x
    or r6.w, r13.y, r6.w
    or r6.w, r13.w, r6.w
    if_nz r6.w
      mov r6.w, l(1.000000)
    else
      eq r7.w, r8.x, l(1.000000)
      mad r13.xy, r12.xyxx, r19.xyxx, r19.zwzz
      if_nz r7.w
        round_z r13.z, r8.y
        sample_l_indexable(texture2darray)(float,float,float,float) r7.w, r13.xyzx, t10.yzwx, s10, l(0.000000)
        mul r8.x, r8.z, r12.z
        mul r8.x, r8.x, l(1.442695)
        exp r8.x, r8.x
        div r7.w, r7.w, r8.x
        mad_sat r6.w, r7.w, l(1.200000), l(-0.200000)
      else
        round_z r13.w, r8.y
        sample_l_indexable(texture2darray)(float,float,float,float) r7.w, r13.xywx, t10.yzwx, s10, l(0.000000)
        lt r7.w, r12.z, r7.w
        and r6.w, r7.w, l(0x3f800000)
      endif
    endif
    mul r8.xyz, r6.wwww, r11.xyzx
    mul r8.xyz, r9.xyzx, r8.xyzx
    dp3 r6.w, r10.yzxy, r6.xyzx
    mad r7.w, -r4.w, r4.w, l(1.000000)
    mad r8.w, r4.w, r4.w, l(1.000000)
    dp2 r4.w, r6.wwww, r4.wwww
    add r4.w, -r4.w, r8.w
    log r4.w, |r4.w|
    mul r4.w, r4.w, l(1.500000)
    exp r4.w, r4.w
    div r4.w, r7.w, r4.w
    mul r4.w, r4.w, l(0.785398)
    mad r7.xyz, r8.xyzx, r4.wwww, r7.xyzx
  endif
  iadd r3.w, r3.w, l(1)
endloop
mad r0.w, r0.w, cb0[2].x, cb0[2].y
log r0.w, r0.w
mad r0.w, r0.w, cb0[2].z, cb0[2].w
max r0.w, r0.w, l(0.000000)
ftou r0.w, r0.w
ult r3.w, r0.w, l(16)
if_nz r3.w
  mad r3.xy, r3.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
  mad r3.xy, r3.xyxx, cb0[37].xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
  mul r3.xy, r3.xyxx, l(0.015625, 0.015625, 0.000000, 0.000000)
  ftou r3.xy, r3.xyxx
  imul null, r3.y, r3.y, cb0[0].x
  imad r0.w, cb0[1].x, r0.w, r3.y
  iadd r0.w, r3.x, r0.w
  ishl r3.x, r0.w, l(2)
  ld_indexable(buffer)(uint,uint,uint,uint) r3.x, r3.xxxx, t16.xyzw
  bfi r8.xyz, l(30, 30, 30, 0), l(2, 2, 2, 0), r0.wwww, l(1, 2, 3, 0)
  ld_indexable(buffer)(uint,uint,uint,uint) r0.w, r8.xxxx, t16.yzwx
  ishl r0.w, r0.w, l(16)
  or r0.w, r0.w, r3.x
  ld_indexable(buffer)(uint,uint,uint,uint) r3.x, r8.yyyy, t16.xyzw
  ld_indexable(buffer)(uint,uint,uint,uint) r3.y, r8.zzzz, t16.yxzw
  add r8.xyz, -r5.xyzx, r4.xyzx
  dp3 r3.w, r8.xyzx, r8.xyzx
  mov r9.x, l(1.000000)
  mov r10.xyz, r7.xyzx
  mov r4.w, l(0)
  loop
    uge r6.w, r4.w, r3.x
    breakc_nz r6.w
    iadd r6.w, r0.w, r4.w
    ld_indexable(buffer)(uint,uint,uint,uint) r6.w, r6.wwww, t16.yzwx
    ld_indexable(buffer)(float,float,float,float) r11.xyzw, r6.wwww, t17.xyzw
    lt r7.w, l(0.000000), r11.w
    mul r8.w, r11.w, r11.w
    movc r7.w, r7.w, r8.w, l(-1.000000)
    lt r8.w, l(0.000000), r7.w
    if_nz r8.w
      add r12.xyz, -r5.xyzx, r11.xyzx
      dp3 r13.x, r12.xyzx, r12.xyzx
      lt r8.w, r13.x, r7.w
      if_nz r8.w
        ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r14.xyz, r6.w, l(16), t26.xyzx
        ishl r8.w, r6.w, l(1)
        ld_indexable(buffer)(float,float,float,float) r8.w, r8.wwww, t28.yzwx
        mul r14.xyw, r8.wwww, r14.xyxz
        add r9.w, r14.y, r14.x
        mad r8.w, r14.z, r8.w, r9.w
        lt r8.w, l(0.000000), r8.w
        if_nz r8.w
          ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r8.w, r6.w, l(0), t26.xxxx
          bfi r9.w, l(31), l(1), r6.w, l(1)
          ld_indexable(buffer)(float,float,float,float) r9.w, r9.wwww, t28.yzwx
          imul null, r10.w, r6.w, l(3)
          ld_indexable(buffer)(float,float,float,float) r15.xyz, r10.wwww, t18.xyzw
          imad r11.w, l(3), r6.w, l(1)
          ld_indexable(buffer)(float,float,float,float) r16.xyz, r11.wwww, t18.xyzw
          ld_indexable(buffer)(uint,uint,uint,uint) r10.w, r10.wwww, t19.yzwx
          dp3 r11.w, r8.xyzx, r12.xyzx
          ge r12.w, l(0.000000), r11.w
          rsq r14.z, r13.x
          mul r13.yzw, r12.xxyz, r14.zzzz
          lt r14.z, r3.w, r11.w
          add r17.xyz, -r4.xyzx, r11.xyzx
          dp3 r18.x, r17.xyzx, r17.xyzx
          rsq r15.w, r18.x
          mul r18.yzw, r15.wwww, r17.xxyz
          div r11.w, r11.w, r3.w
          mad r17.xyz, r8.xyzx, r11.wwww, -r12.xyzx
          dp3 r19.x, r17.xyzx, r17.xyzx
          dp3 r11.w, -r17.xyzx, -r17.xyzx
          rsq r11.w, r11.w
          mul r19.yzw, r11.wwww, -r17.xxyz
          movc r17.xyzw, r14.zzzz, r18.xyzw, r19.xyzw
          movc r13.xyzw, r12.wwww, r13.xyzw, r17.xyzw
          ieq r11.w, r10.w, l(3)
          if_nz r11.w
            imad r11.w, l(3), r6.w, l(2)
            ld_indexable(buffer)(uint,uint,uint,uint) r12.w, r11.wwww, t19.yzwx
            ld_indexable(buffer)(float,float,float,float) r17.xyz, r11.wwww, t18.xyzw
            dp3 r11.w, -r12.xyzx, -r12.xyzx
            rsq r11.w, r11.w
            mul r12.xyz, r11.wwww, -r12.xyzx
            dp3 r11.w, r12.xyzx, r17.xyzx
            mad r18.x, r11.w, l(-0.500000), l(0.500000)
            dp3 r14.z, r12.xyzx, r16.xyzx
            mad r11.w, -r11.w, r11.w, l(1.000000)
            rsq r11.w, r11.w
            mul r11.w, r11.w, r14.z
            mul r19.xyz, r16.zxyz, r17.yzxy
            mad r17.xyz, r16.yzxy, r17.zxyz, -r19.xyzx
            dp3 r12.x, r17.xyzx, r12.xyzx
            ge r12.x, r12.x, l(0.000000)
            mad r12.yz, r11.wwww, l(0.000000, -0.250000, 0.250000, 0.000000), l(0.000000, 0.250000, 0.750000, 0.000000)
            movc r18.y, r12.x, r12.y, r12.z
            utof r18.z, r12.w
            sample_l_indexable(texture2darray)(float,float,float,float) r11.w, r18.xyzx, t0.yzwx, s0, l(0.000000)
            mul r11.w, r7.w, r11.w
            div r11.w, r11.w, r13.x
            div r7.w, r13.x, r7.w
            add_sat r7.w, -r7.w, l(1.000000)
            mul r7.w, r7.w, r11.w
          else
            rsq r11.w, r13.x
            ieq r10.w, r10.w, l(2)
            mul r12.x, r16.x, -r13.x
            mul r12.x, r12.x, l(1.442695)
            exp r12.x, r12.x
            mul_sat r12.x, r12.x, r16.y
            mul r9.y, r11.w, r13.x
            mov r9.z, r13.x
            dp3 r9.y, r16.xyzx, r9.xyzx
            div r9.y, l(1.000000, 1.000000, 1.000000, 1.000000), r9.y
            movc r7.w, r10.w, r12.x, r9.y
          endif
          mul r12.xyz, r7.wwww, r15.xyzx
          mul r12.xyz, r14.xywx, r12.xyzx
          eq r7.w, r8.w, l(2.000000)
          if_nz r7.w
            dp3 r7.w, r13.zwyz, r6.xyzx
            mad r9.y, -r9.w, r9.w, l(1.000000)
            mad r9.z, r9.w, r9.w, l(1.000000)
            dp2 r7.w, r7.wwww, r9.wwww
            add r7.w, -r7.w, r9.z
            log r7.w, |r7.w|
            mul r7.w, r7.w, l(1.500000)
            exp r7.w, r7.w
            div r7.w, r9.y, r7.w
            mul r7.w, r7.w, l(0.785398)
            mul r14.xyz, r7.wwww, r12.xyzx
          else
            ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r9.yz, r6.w, l(48), t26.xxyx
            utof r15.w, r6.w
            eq r7.w, r8.w, l(1.000000)
            add r11.xyz, r5.xyzx, -r11.xyzx
            mul r11.xyz, r9.yyyy, r11.xyzx
            mov r11.w, -r11.z
            dp3 r8.w, r11.xywx, r11.xywx
            sqrt r8.w, r8.w
            add_sat r8.w, r9.z, r8.w
            if_nz r7.w
              ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r6.w, r6.w, l(8), t26.xxxx
              mov r15.xyz, r11.xywx
              sample_l_indexable(texturecubearray)(float,float,float,float) r7.w, r15.xyzw, t13.yzwx, s13, l(0.000000)
              mul r6.w, r6.w, r8.w
              mul r6.w, r6.w, l(1.442695)
              exp r6.w, r6.w
              div r6.w, r7.w, r6.w
              mad_sat r6.w, r6.w, l(1.200000), l(-0.200000)
            else
              mov r15.xyz, r11.xywx
              sample_l_indexable(texturecubearray)(float,float,float,float) r7.w, r15.xyzw, t13.yzwx, s13, l(0.000000)
              lt r7.w, r8.w, r7.w
              and r6.w, r7.w, l(0x3f800000)
            endif
            mul r11.xyz, r6.wwww, r12.xyzx
            dp3 r6.w, r13.zwyz, r6.xyzx
            mad r7.w, -r9.w, r9.w, l(1.000000)
            mad r8.w, r9.w, r9.w, l(1.000000)
            dp2 r6.w, r6.wwww, r9.wwww
            add r6.w, -r6.w, r8.w
            log r6.w, |r6.w|
            mul r6.w, r6.w, l(1.500000)
            exp r6.w, r6.w
            div r6.w, r7.w, r6.w
            mul r6.w, r6.w, l(0.785398)
            mul r14.xyz, r6.wwww, r11.xyzx
          endif
          add r10.xyz, r10.xyzx, r14.xyzx
        endif
      endif
    endif
    iadd r4.w, r4.w, l(1)
  endloop
  iadd r0.w, r0.w, r3.x
  mov r9.x, l(1.000000)
  mov r7.xyz, r10.xyzx
  mov r3.x, l(0)
  loop
    uge r4.w, r3.x, r3.y
    breakc_nz r4.w
    iadd r4.w, r0.w, r3.x
    ld_indexable(buffer)(uint,uint,uint,uint) r4.w, r4.wwww, t16.yzwx
    imul null, r6.w, r4.w, l(5)
    imad r7.w, l(5), r4.w, l(4)
    ld_indexable(buffer)(float,float,float,float) r11.xyz, r7.wwww, t20.xyzw
    lt r7.w, l(0.000000), r11.x
    if_nz r7.w
      ld_indexable(buffer)(float,float,float,float) r12.xyz, r6.wwww, t20.xyzw
      add r13.xyz, -r5.xyzx, r12.xyzx
      dp3 r14.x, r13.xyzx, r13.xyzx
      lt r6.w, r14.x, r11.x
      if_nz r6.w
        ld_structured_indexable(structured_buffer, stride=112)(mixed,mixed,mixed,mixed) r15.xyz, r4.w, l(16), t27.xyzx
        ishl r6.w, r4.w, l(1)
        ld_indexable(buffer)(float,float,float,float) r6.w, r6.wwww, t29.yzwx
        mul r15.xyw, r6.wwww, r15.xyxz
        add r7.w, r15.y, r15.x
        mad r6.w, r15.z, r6.w, r7.w
        lt r6.w, l(0.000000), r6.w
        if_nz r6.w
          imad r16.xyz, l(5, 5, 5, 0), r4.wwww, l(1, 2, 3, 0)
          ld_indexable(buffer)(float,float,float,float) r17.xyz, r16.xxxx, t20.xyzw
          ld_indexable(buffer)(float,float,float,float) r16.xyw, r16.yyyy, t20.xywz
          ld_indexable(buffer)(float,float,float,float) r18.xyz, r16.zzzz, t20.xyzw
          imul null, r6.w, r4.w, l(3)
          ld_structured_indexable(structured_buffer, stride=112)(mixed,mixed,mixed,mixed) r7.w, r4.w, l(0), t27.xxxx
          bfi r8.w, l(31), l(1), r4.w, l(1)
          ld_indexable(buffer)(float,float,float,float) r8.w, r8.wwww, t29.yzwx
          ld_indexable(buffer)(uint,uint,uint,uint) r6.w, r6.wwww, t21.yzwx
          dp3 r9.w, r8.xyzx, r13.xyzx
          ge r10.w, l(0.000000), r9.w
          rsq r11.w, r14.x
          mul r14.yzw, r11.wwww, r13.xxyz
          lt r11.w, r3.w, r9.w
          add r12.xyz, -r4.xyzx, r12.xyzx
          dp3 r19.x, r12.xyzx, r12.xyzx
          rsq r12.w, r19.x
          mul r19.yzw, r12.wwww, r12.xxyz
          div r9.w, r9.w, r3.w
          mad r12.xyz, r8.xyzx, r9.wwww, -r13.xyzx
          dp3 r20.x, r12.xyzx, r12.xyzx
          dp3 r9.w, -r12.xyzx, -r12.xyzx
          rsq r9.w, r9.w
          mul r20.yzw, r9.wwww, -r12.xxyz
          movc r12.xyzw, r11.wwww, r19.xyzw, r20.xyzw
          movc r12.xyzw, r10.wwww, r14.xyzw, r12.xyzw
          rsq r9.w, r12.x
          mul r14.xyz, r9.wwww, -r13.xyzx
          dp3 r10.w, -r14.xyzx, r17.xyzx
          mad_sat r10.w, r10.w, r11.z, r11.y
          ieq r11.w, r6.w, l(3)
          if_nz r11.w
            imad r11.w, l(3), r4.w, l(2)
            ld_indexable(buffer)(uint,uint,uint,uint) r11.w, r11.wwww, t21.yzwx
            dp3 r13.w, -r13.xyzx, -r13.xyzx
            rsq r13.w, r13.w
            mul r13.xyz, r13.wwww, -r13.xyzx
            dp3 r13.w, r13.xyzx, r17.xyzx
            mad r14.x, r13.w, l(-0.500000), l(0.500000)
            dp3 r14.w, r13.xyzx, r18.xyzx
            mad r13.w, -r13.w, r13.w, l(1.000000)
            rsq r13.w, r13.w
            mul r13.w, r13.w, r14.w
            mul r19.xyz, r17.yzxy, r18.zxyz
            mad r19.xyz, r18.yzxy, r17.zxyz, -r19.xyzx
            dp3 r13.x, r19.xyzx, r13.xyzx
            ge r13.x, r13.x, l(0.000000)
            mad r13.yz, r13.wwww, l(0.000000, -0.250000, 0.250000, 0.000000), l(0.000000, 0.250000, 0.750000, 0.000000)
            movc r14.y, r13.x, r13.y, r13.z
            utof r14.z, r11.w
            sample_l_indexable(texture2darray)(float,float,float,float) r11.w, r14.xyzx, t0.yzwx, s0, l(0.000000)
            mul r11.w, r11.x, r11.w
            div r11.w, r11.w, r12.x
            div r11.x, r12.x, r11.x
            add_sat r11.x, -r11.x, l(1.000000)
            mul r11.x, r11.x, r11.w
            mul r11.x, r10.w, r11.x
          else
            ieq r6.w, r6.w, l(2)
            mul r11.w, r18.x, -r12.x
            mul r11.w, r11.w, l(1.442695)
            exp r11.w, r11.w
            mul_sat r11.w, r11.w, r18.y
            mul r11.w, r10.w, r11.w
            mul r9.y, r9.w, r12.x
            mov r9.z, r12.x
            dp3 r9.y, r9.xyzx, r18.xyzx
            div r9.y, r10.w, r9.y
            movc r11.x, r6.w, r11.w, r9.y
          endif
          mul r9.yzw, r11.xxxx, r16.xxyw
          mul r9.yzw, r15.xxyw, r9.yyzw
          eq r6.w, r7.w, l(2.000000)
          if_nz r6.w
            dp3 r6.w, r12.yzwy, r17.xyzx
            mad_sat r6.w, r6.w, r11.z, r11.y
            mul r13.xyz, r6.wwww, r9.yzwy
            dp3 r6.w, r12.zwyz, r6.xyzx
            mad r10.w, -r8.w, r8.w, l(1.000000)
            mad r11.x, r8.w, r8.w, l(1.000000)
            dp2 r6.w, r6.wwww, r8.wwww
            add r6.w, -r6.w, r11.x
            log r6.w, |r6.w|
            mul r6.w, r6.w, l(1.500000)
            exp r6.w, r6.w
            div r6.w, r10.w, r6.w
            mul r6.w, r6.w, l(0.785398)
            mul r13.xyz, r6.wwww, r13.xyzx
          else
            ld_structured_indexable(structured_buffer, stride=112)(mixed,mixed,mixed,mixed) r14.xyzw, r4.w, l(48), t27.xyzw
            ld_structured_indexable(structured_buffer, stride=112)(mixed,mixed,mixed,mixed) r15.xyzw, r4.w, l(64), t27.xyzw
            ld_structured_indexable(structured_buffer, stride=112)(mixed,mixed,mixed,mixed) r16.xyzw, r4.w, l(80), t27.xyzw
            ld_structured_indexable(structured_buffer, stride=112)(mixed,mixed,mixed,mixed) r18.xyzw, r4.w, l(96), t27.xyzw
            mov r19.x, r14.x
            mov r19.y, r15.x
            mov r19.z, r16.x
            mov r19.w, r18.x
            dp4 r19.x, r5.xyzw, r19.xyzw
            mov r20.x, r14.y
            mov r20.y, r15.y
            mov r20.z, r16.y
            mov r20.w, r18.y
            dp4 r19.y, r5.xyzw, r20.xyzw
            mov r20.x, r14.z
            mov r20.y, r15.z
            mov r20.z, r16.z
            mov r20.w, r18.z
            dp4 r19.z, r5.xyzw, r20.xyzw
            mov r18.x, r14.w
            mov r18.y, r15.w
            mov r18.z, r16.w
            dp4 r6.w, r5.xyzw, r18.xyzw
            div r14.xyz, r19.xyzx, r6.wwww
            lt r11.xw, r14.xxxy, l(0.000000, 0.000000, 0.000000, 0.000000)
            lt r15.xy, l(1.000000, 1.000000, 0.000000, 0.000000), r14.xyxx
            or r6.w, r11.x, r15.x
            or r6.w, r11.w, r6.w
            or r6.w, r15.y, r6.w
            if_nz r6.w
              mov r6.w, l(1.000000)
            else
              utof r14.w, r4.w
              eq r7.w, r7.w, l(1.000000)
              if_nz r7.w
                ld_structured_indexable(structured_buffer, stride=112)(mixed,mixed,mixed,mixed) r4.w, r4.w, l(8), t27.xxxx
                sample_l_indexable(texture2darray)(float,float,float,float) r7.w, r14.xywx, t12.yzwx, s12, l(0.000000)
                mul r4.w, r4.w, r14.z
                mul r4.w, r4.w, l(1.442695)
                exp r4.w, r4.w
                div r4.w, r7.w, r4.w
                mad_sat r6.w, r4.w, l(1.200000), l(-0.200000)
              else
                sample_l_indexable(texture2darray)(float,float,float,float) r4.w, r14.xywx, t12.yzwx, s12, l(0.000000)
                lt r4.w, r14.z, r4.w
                and r6.w, r4.w, l(0x3f800000)
              endif
            endif
            mul r9.yzw, r6.wwww, r9.yyzw
            dp3 r4.w, r12.yzwy, r17.xyzx
            mad_sat r4.w, r4.w, r11.z, r11.y
            mul r9.yzw, r4.wwww, r9.yyzw
            dp3 r4.w, r12.zwyz, r6.xyzx
            mad r6.w, -r8.w, r8.w, l(1.000000)
            mad r7.w, r8.w, r8.w, l(1.000000)
            dp2 r4.w, r4.wwww, r8.wwww
            add r4.w, -r4.w, r7.w
            log r4.w, |r4.w|
            mul r4.w, r4.w, l(1.500000)
            exp r4.w, r4.w
            div r4.w, r6.w, r4.w
            mul r4.w, r4.w, l(0.785398)
            mul r13.xyz, r4.wwww, r9.yzwy
          endif
          add r7.xyz, r7.xyzx, r13.xyzx
        endif
      endif
    endif
    iadd r3.x, r3.x, l(1)
  endloop
endif
mul r3.xyw, r5.yyyy, cb0[20].xyxz
mad r3.xyw, r5.xxxx, cb0[19].xyxz, r3.xyxw
mad r3.xyw, r5.zzzz, cb0[21].xyxz, r3.xyxw
mad r3.xyw, r5.wwww, cb0[22].xyxz, r3.xyxw
eq r0.w, cb0[36].x, l(0.000000)
add r4.xyz, r3.xywx, l(-0.500000, -0.500000, -0.500000, 0.000000)
max r4.y, |r4.z|, |r4.y|
max r4.x, r4.y, |r4.x|
lt r4.x, l(0.500000), r4.x
movc r4.x, r4.x, l(0), l(1.000000)
min r4.yzw, r3.xxyw, cb0[36].xxxx
add r3.xyw, -r3.xyxw, l(1.000000, 1.000000, 0.000000, 1.000000)
min r3.xyw, r3.xyxw, cb0[36].xxxx
min r3.xyw, r3.xyxw, r4.yzyw
min r3.y, r3.w, r3.y
min r3.x, r3.y, r3.x
div_sat r3.x, r3.x, cb0[36].x
movc r0.w, r0.w, r4.x, r3.x
ne r3.x, r0.w, l(0.000000)
if_nz r3.x
  mul r3.xyw, r5.yyyy, cb0[4].xyxz
  mad r3.xyw, r5.xxxx, cb0[3].xyxz, r3.xyxw
  mad r3.xyw, r5.zzzz, cb0[5].xyxz, r3.xyxw
  mad r4.xyz, r5.wwww, cb0[6].zxyz, r3.wxyw
  mul r3.xyw, r6.xyxz, cb0[35].zzzz
  mul r6.yzw, r3.xxyw, l(0.000000, -1.02332747, 1.02332747, -1.02332747)
  itof r3.x, cb0[35].x
  mul r3.y, r3.x, r4.x
  round_ni r4.w, r3.y
  ftoi r3.y, r4.w
  iadd r3.y, r3.y, l(1)
  iadd r3.w, cb0[35].x, l(-1)
  imin r3.y, r3.w, r3.y
  mad r3.w, r4.x, r3.x, -r4.w
  add r5.w, -r3.w, l(1.000000)
  itof r4.x, r3.y
  sample_l_indexable(texture2darray)(float,float,float,float) r8.xyzw, r4.yzwy, t1.xyzw, s1, l(0.000000)
  sample_l_indexable(texture2darray)(float,float,float,float) r9.xyzw, r4.yzxy, t1.xyzw, s1, l(0.000000)
  mul r9.xyzw, r3.wwww, r9.xyzw
  mad r8.xyzw, r5.wwww, r8.xyzw, r9.xyzw
  add r4.w, r3.x, r4.w
  add r9.zw, r3.xxxx, r4.xxxw
  sample_l_indexable(texture2darray)(float,float,float,float) r10.xyzw, r4.yzwy, t1.xyzw, s1, l(0.000000)
  mov r9.xy, r4.yzyy
  sample_l_indexable(texture2darray)(float,float,float,float) r4.xyzw, r9.xyzx, t1.xyzw, s1, l(0.000000)
  mul r4.xyzw, r3.wwww, r4.xyzw
  mad r4.xyzw, r5.wwww, r10.xyzw, r4.xyzw
  add r9.z, r3.x, r9.z
  sample_l_indexable(texture2darray)(float,float,float,float) r10.xyzw, r9.xywx, t1.xyzw, s1, l(0.000000)
  sample_l_indexable(texture2darray)(float,float,float,float) r9.xyzw, r9.xyzx, t1.xyzw, s1, l(0.000000)
  mul r9.xyzw, r3.wwww, r9.xyzw
  mad r9.xyzw, r5.wwww, r10.xyzw, r9.xyzw
  mov r6.x, l(0.886227369)
  dp4 r3.x, r8.xyzw, r6.xyzw
  max r3.x, r3.x, l(0.000000)
  mul r8.x, r0.w, r3.x
  dp4 r3.x, r4.xyzw, r6.xyzw
  max r3.x, r3.x, l(0.000000)
  mul r8.y, r0.w, r3.x
  dp4 r3.x, r9.xyzw, r6.xyzw
  max r3.x, r3.x, l(0.000000)
  mul r8.z, r0.w, r3.x
else
  mov r8.xyz, l(0,0,0,0)
endif
mul r3.xyw, r8.xyxz, cb0[35].yyyy
mad r3.xyw, r3.xyxw, cb1[15].xxxx, r7.xyxz
ne r0.w, cb1[13].w, l(0.000000)
if_nz r0.w
  mad r4.xyz, r5.xyzx, cb1[13].wwww, cb1[13].xyzx
  round_ni r5.xyz, r4.xyzx
  ftoi r6.xyz, r5.xyzx
  and r6.xyz, r6.xyzx, l(255, 255, 255, 0)
  add r4.xyz, r4.xyzx, -r5.xyzx
  mul r5.xyz, r4.xyzx, r4.xyzx
  mul r5.xyz, r4.xyzx, r5.xyzx
  mad r7.xyz, r4.xyzx, l(6.000000, 6.000000, 6.000000, 0.000000), l(-15.000000, -15.000000, -15.000000, 0.000000)
  mad r7.xyz, r4.xyzx, r7.xyzx, l(10.000000, 10.000000, 10.000000, 0.000000)
  mul r5.xyz, r5.xyzx, r7.xyzx
  mov r6.w, l(0)
  ld_indexable(texture2d)(float,float,float,float) r7.xyzw, r6.xyww, t8.xyzw
  itof r0.w, r6.z
  mul r0.w, r0.w, l(0.00390625000)
  mad r6.xyzw, r7.xzyw, l(0.996093750, 0.996093750, 0.996093750, 0.996093750), r0.wwww
  add r7.xyzw, r6.zxwy, l(0.001953, 0.001953, 0.001953, 0.001953)
  mov r8.xz, r7.yywy
  mov r8.yw, l(0,256.500000,0,256.500000)
  sample_l_indexable(texture2d)(float,float,float,float) r9.xyz, r8.xyxx, t8.xyzw, s8, l(0.000000)
  mad r9.xyz, r9.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  dp3 r0.w, r9.xyzx, r4.xyzx
  add r9.xyz, r4.xyzx, l(-1.000000, 0.000000, 0.000000, 0.000000)
  sample_l_indexable(texture2d)(float,float,float,float) r8.xyz, r8.zwzz, t8.xyzw, s8, l(0.000000)
  mad r8.xyz, r8.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  dp3 r4.w, r8.xyzx, r9.xyzx
  add r4.w, -r0.w, r4.w
  mad r0.w, r5.x, r4.w, r0.w
  add r8.xyz, r4.xyzx, l(0.000000, -1.000000, 0.000000, 0.000000)
  mov r7.yw, l(0,256.500000,0,256.500000)
  sample_l_indexable(texture2d)(float,float,float,float) r9.xyz, r7.xyxx, t8.xyzw, s8, l(0.000000)
  mad r9.xyz, r9.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  dp3 r4.w, r9.xyzx, r8.xyzx
  add r8.xyz, r4.xyzx, l(-1.000000, -1.000000, 0.000000, 0.000000)
  sample_l_indexable(texture2d)(float,float,float,float) r7.xyz, r7.zwzz, t8.xyzw, s8, l(0.000000)
  mad r7.xyz, r7.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  dp3 r5.w, r7.xyzx, r8.xyzx
  add r5.w, -r4.w, r5.w
  mad r4.w, r5.x, r5.w, r4.w
  add r4.w, -r0.w, r4.w
  mad r0.w, r5.y, r4.w, r0.w
  add r7.xyz, r4.xyzx, l(0.000000, 0.000000, -1.000000, 0.000000)
  add r6.xyzw, r6.zxwy, l(0.00585899968, 0.00585899968, 0.00585899968, 0.00585899968)
  mov r8.xz, r6.yywy
  mov r8.yw, l(0,256.500000,0,256.500000)
  sample_l_indexable(texture2d)(float,float,float,float) r9.xyz, r8.xyxx, t8.xyzw, s8, l(0.000000)
  mad r9.xyz, r9.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  dp3 r4.w, r9.xyzx, r7.xyzx
  add r7.xyz, r4.xyzx, l(-1.000000, 0.000000, -1.000000, 0.000000)
  sample_l_indexable(texture2d)(float,float,float,float) r8.xyz, r8.zwzz, t8.xyzw, s8, l(0.000000)
  mad r8.xyz, r8.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  dp3 r5.w, r8.xyzx, r7.xyzx
  add r5.w, -r4.w, r5.w
  mad r4.w, r5.x, r5.w, r4.w
  add r7.xyz, r4.xyzx, l(0.000000, -1.000000, -1.000000, 0.000000)
  mov r6.yw, l(0,256.500000,0,256.500000)
  sample_l_indexable(texture2d)(float,float,float,float) r8.xyz, r6.xyxx, t8.xyzw, s8, l(0.000000)
  mad r8.xyz, r8.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  dp3 r5.w, r8.xyzx, r7.xyzx
  add r4.xyz, r4.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
  sample_l_indexable(texture2d)(float,float,float,float) r6.xyz, r6.zwzz, t8.xyzw, s8, l(0.000000)
  mad r6.xyz, r6.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  dp3 r4.x, r6.xyzx, r4.xyzx
  add r4.x, -r5.w, r4.x
  mad r4.x, r5.x, r4.x, r5.w
  add r4.x, -r4.w, r4.x
  mad r4.x, r5.y, r4.x, r4.w
  add r4.x, -r0.w, r4.x
  mad r0.w, r5.z, r4.x, r0.w
  add r0.w, r0.w, l(1.000000)
else
  mov r0.w, l(1.000000)
endif
mul r1.w, r1.w, r2.w
mul r4.w, r0.w, r1.w
mul r4.xyz, r3.xywx, r4.wwww
if_nz r3.z
  mul r1.xy, r1.xyxx, cb1[8].xyxx
  mul r1.xy, -r1.zzzz, r1.xyxx

// gV2W
  mul r3.xyzw, r1.yyyy, cb1[1].xyzw
  mad r3.xyzw, r1.xxxx, cb1[0].xyzw, r3.xyzw
  mad r1.xyzw, r1.zzzz, cb1[2].xyzw, r3.xyzw
  add r1.xyzw, r1.xyzw, cb1[3].xyzw
// gPrevW2P
  mul r3.xyzw, r1.yyyy, cb1[5].xyzw
  mad r3.xyzw, r1.xxxx, cb1[4].xyzw, r3.xyzw
  mad r3.xyzw, r1.zzzz, cb1[6].xyzw, r3.xyzw
  mad r1.xyzw, r1.wwww, cb1[7].xyzw, r3.xyzw

// Adjusting here makes things worse

  div r1.xyz, r1.xyzx, r1.wwww
  add r0.w, r1.z, cb1[9].y
  div r0.w, -cb1[9].x, r0.w
  log r0.w, r0.w
  mul r0.w, r0.w, l(0.693147182)
  log r1.z, cb1[9].z
  mul r1.z, r1.z, l(0.693147182)
  div r3.z, r0.w, r1.z
  mad r3.xy, r1.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
  iadd r0.xyz, r0.xyzx, l(-1, -1, -1, 0)
  utof r0.xyz, r0.xyzx
  mul r0.xyz, r0.xyzx, r3.xyzx
  div r0.xyz, r0.xyzx, r2.xyzx
  div r1.xyz, l(0.500000, 0.500000, 0.500000, 0.000000), r2.xyzx
  add r0.xyz, r0.xyzx, r1.xyzx
  sample_l_indexable(texture3d)(float,float,float,float) r0.xyzw, r0.xyzx, t9.xyzw, s9, l(0.000000)
  add r0.xyzw, -r4.xyzw, r0.xyzw
  mad r4.xyzw, cb1[11].yyyy, r0.xyzw, r4.xyzw
endif
store_uav_typed u0.xyzw, vThreadID.xyzz, r4.xyzw
ret
// Approximately 787 instruction slots used
