//Nioh 2 volumetric fog CS.
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Sat Feb 06 00:49:42 2021
//
//
// Buffer Definitions:
//
// cbuffer VolumetricFogConstBuf
// {
//
//   row_major float4x4 gV2W;           // Index:    0 1 2 3          Components:    16
//   row_major float4x4 gPrevW2P;       // Index:    4 5 6 7          Components:    16
//   float4 gAngleAndNearFar;           // Index:    8.xyzw           Components:     4
//   float4 gCalcVolumeFactor;          // Index:    9.xyzw           Components:     4
//   float4 gEyePosAndFogFar;           // Index:   10.xyzw           Components:     4
//   float4 gInjectionDesc;             // Index:   11.xyzw           Components:     4
//   int4 gLightInfo;                   // Index:   12.xyzw           Components:     4
//   float4 gFogNoiseInfo;              // Index:   13.xyzw           Components:     4
//   float4 gScatteringInfo;            // Index:   14.xyzw           Components:     4
//   float4 gAccParams;                 // Index:   15.xyzw           Components:     4 [unused]
//   float4 gAttParam;                  // Index:   16.xyzw           Components:     4 [unused]
//   row_major float4x4 gW2P;           // Index:   17 18 19 20       Components:    16 [unused]
//
// }
//
// Resource bind info for sParaLightInfo
// {
//
//   struct slVFParallelLightInfo
//   {
//
//       struct slVFCommonLightInfo
//       {
//
//           float4 vMapDesc;           // Index:    0
//           float4 vColorScale;        // Index:    1
//           float4 vEcc;               // Index:    2
//
//       } sCommon;                     // Index:    0
//
//       struct slSVFParallelLight
//       {
//
//           float4 vDir;               // Index:    3
//           float4 vDiffuse;           // Index:    4
//
//       } sLightInfo;                  // Index:    3
//       float4 vAttr;                  // Index:    5
//       row_major float4x4 mW2S;       // Index:    6
//       row_major float4x4 mW2S2;      // Index:   10
//       row_major float4x4 mW2S3;      // Index:   14
//       row_major float4x4 mW2S4;      // Index:   18
//       float4 vSegs;                  // Index:   22
//       row_major float4x4 mUVS;       // Index:   23
//
//   } $Element;                        // Index:    0-26             Components:   108
//
// }
//
// Resource bind info for sPointLightInfo
// {
//
//   struct slVFPointLightInfo
//   {
//
//       struct slVFPointBasicLightInfo
//       {
//
//           struct slVFCommonLightInfo
//           {
//
//               float4 vMapDesc;       // Index:    0
//               float4 vColorScale;    // Index:    1
//               float4 vEcc;           // Index:    2
//
//           } sCommon;                 // Index:    0
//           float4 vW2S;               // Index:    3
//
//       } sBase;                       // Index:    0
//
//       struct slSVFPointLight
//       {
//
//           float4 vPos;               // Index:    4
//           float4 vDiffuse;           // Index:    5
//           float4 vAmbient;           // Index:    6
//           float4 vAtt;               // Index:    7
//
//       } sLightInfo;                  // Index:    4
//
//   } $Element;                        // Index:    0-7              Components:    32
//
// }
//
// Resource bind info for sSpotLightInfo
// {
//
//   struct slVFSpotLightInfo
//   {
//
//       struct slVFSpotBasicLightInfo
//       {
//
//           struct slVFCommonLightInfo
//           {
//
//               float4 vMapDesc;       // Index:    0
//               float4 vColorScale;    // Index:    1
//               float4 vEcc;           // Index:    2
//
//           } sCommon;                 // Index:    0
//           row_major float4x4 vW2S;   // Index:    3
//
//       } sBase;                       // Index:    0
//
//       struct slSVFSpotLight
//       {
//
//           float4 vPos;               // Index:    7
//           float4 vDir;               // Index:    8
//           float4 vDiffuse;           // Index:    9
//           float4 vAmbient;           // Index:   10
//           float4 vAtt;               // Index:   11
//           float4 vCos;               // Index:   12
//
//       } sLightInfo;                  // Index:    7
//
//   } $Element;                        // Index:    0-12             Components:    52
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// __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
// 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
// sParaLightInfo                    texture  struct         r/o   16        1
// sPointLightInfo                   texture  struct         r/o   17        1
// sSpotLightInfo                    texture  struct         r/o   18        1
// uavTarget                             UAV  float4          3d    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 cb1[15], immediateIndexed
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_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_structured t16, 432
dcl_resource_structured t17, 128
dcl_resource_structured t18, 208
dcl_uav_typed_texture3d (float,float,float,float) u0
dcl_input vThreadID.xyz
dcl_temps 40
dcl_thread_group 8, 8, 4
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r25.xyzw, l(0, 0, 0, 0), t125.xyzw
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r26.xyzw, l(10, 0, 0, 0), t120.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 r3.xy, r3.xyxx, cb1[8].xyxx
mul r4.xy, -r1.zzzz, r3.xyxx
mul r3.xy, -r0.wwww, r3.xyxx

if_z r26.y
add r25.w, r0.w, r25.y
mul r25.w, r25.w, cb1[8].x
mad r3.x, r25.x, r25.w, r3.x
add r25.w, r1.z, r25.y
mul r25.w, r25.w, cb1[8].x
mad r4.x, r25.x, r25.w, r4.x
endif

mul r5.xyzw, r4.yyyy, cb1[1].xyzw
mad r4.xyzw, r4.xxxx, cb1[0].xyzw, r5.xyzw
mad r4.xyzw, r1.zzzz, cb1[2].xyzw, r4.xyzw
add r4.xyzw, r4.xyzw, cb1[3].xyzw
mul r5.xyz, r3.yyyy, cb1[1].xyzx
mad r3.xyw, r3.xxxx, cb1[0].xyxz, r5.xyxz
mad r3.xyw, r0.wwww, cb1[2].xyxz, r3.xyxw
add r3.xyw, r3.xyxw, cb1[3].xyxz
add r5.xyz, r4.xyzx, -cb1[10].xyzx
dp3 r0.w, r5.xyzx, r5.xyzx
rsq r0.w, r0.w
mul r5.xyz, r0.wwww, r5.xyzx
add r6.xyz, -r3.xywx, r4.xyzx
dp3 r0.w, r6.xyzx, r6.xyzx
sqrt r0.w, r0.w
lt r1.w, cb1[14].y, r4.y
add r2.w, r4.y, -cb1[14].y
div r2.w, -r2.w, cb1[14].y
mul r2.w, r2.w, l(1.442695)
exp r2.w, r2.w
mul r2.w, r2.w, cb1[14].x
movc r1.w, r1.w, r2.w, cb1[14].x
mov r6.xyz, l(0,0,0,0)
mov r2.w, l(0)
loop
  uge r5.w, r2.w, cb1[12].x
  breakc_nz r5.w
  ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r7.xyz, r2.w, l(0), t16.xyzx
  ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r8.xyz, r2.w, l(16), t16.xyzx
  ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r5.w, r2.w, l(32), t16.xxxx
  ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r9.xyz, r2.w, l(48), t16.xyzx
  ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r10.xyz, r2.w, l(64), t16.xyzx
  eq r6.w, r7.x, l(2.000000)
  if_nz r6.w
    mul r11.xyz, r8.xyzx, r10.xyzx
    dp3 r6.w, r9.xyzx, r5.xyzx
    mad r7.w, -r5.w, r5.w, l(1.000000)
    mad r8.w, r5.w, r5.w, l(1.000000)
    dp2 r6.w, r6.wwww, r5.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 r6.xyz, r11.xyzx, r6.wwww, r6.xyzx
  else
    ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r6.w, r2.w, l(80), t16.xxxx
    ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r11.xyzw, r2.w, l(96), t16.xyzw
    ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r12.xyzw, r2.w, l(112), t16.xyzw
    ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r13.xyzw, r2.w, l(128), t16.xyzw
    ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r14.xyzw, r2.w, l(144), t16.xyzw
    lt r6.w, l(0.000000), r6.w
    if_nz r6.w
      ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r15.xyz, r2.w, l(352), t16.xyzx
      lt r6.w, r15.x, -r1.z
      if_nz r6.w
        lt r6.w, r15.y, -r1.z
        if_nz r6.w
          lt r6.w, r15.z, -r1.z
          if_nz r6.w
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r15.xyzw, r2.w, l(288), t16.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r16.xyzw, r2.w, l(304), t16.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r17.xyzw, r2.w, l(320), t16.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r14.xyzw, r2.w, l(336), t16.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r18.xyzw, r2.w, l(416), t16.xyzw
            mov r19.x, r15.x
            mov r19.y, r16.x
            mov r19.z, r17.x
            mov r19.w, r14.x
            mov r20.x, r15.y
            mov r20.y, r16.y
            mov r20.z, r17.y
            mov r20.w, r14.y
            mov r21.x, r15.z
            mov r21.y, r16.z
            mov r21.z, r17.z
            mov r21.w, r14.z
            mov r14.x, r15.w
            mov r14.y, r16.w
            mov r14.z, r17.w
          else
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r15.xyzw, r2.w, l(224), t16.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r16.xyzw, r2.w, l(240), t16.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r17.xyzw, r2.w, l(256), t16.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r14.xyzw, r2.w, l(272), t16.xyzw
            ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r18.xyzw, r2.w, l(400), t16.xyzw
            mov r19.x, r15.x
            mov r19.y, r16.x
            mov r19.z, r17.x
            mov r19.w, r14.x
            mov r20.x, r15.y
            mov r20.y, r16.y
            mov r20.z, r17.y
            mov r20.w, r14.y
            mov r21.x, r15.z
            mov r21.y, r16.z
            mov r21.z, r17.z
            mov r21.w, r14.z
            mov r14.x, r15.w
            mov r14.y, r16.w
            mov r14.z, r17.w
          endif
        else
          ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r15.xyzw, r2.w, l(160), t16.xyzw
          ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r16.xyzw, r2.w, l(176), t16.xyzw
          ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r17.xyzw, r2.w, l(192), t16.xyzw
          ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r14.xyzw, r2.w, l(208), t16.xyzw
          ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r18.xyzw, r2.w, l(384), t16.xyzw
          mov r19.x, r15.x
          mov r19.y, r16.x
          mov r19.z, r17.x
          mov r19.w, r14.x
          mov r20.x, r15.y
          mov r20.y, r16.y
          mov r20.z, r17.y
          mov r20.w, r14.y
          mov r21.x, r15.z
          mov r21.y, r16.z
          mov r21.z, r17.z
          mov r21.w, r14.z
          mov r14.x, r15.w
          mov r14.y, r16.w
          mov r14.z, r17.w
        endif
      else
        ld_structured_indexable(structured_buffer, stride=432)(mixed,mixed,mixed,mixed) r18.xyzw, r2.w, l(368), t16.xyzw
        mov r19.x, r11.x
        mov r19.y, r12.x
        mov r19.z, r13.x
        mov r19.w, r14.x
        mov r20.x, r11.y
        mov r20.y, r12.y
        mov r20.z, r13.y
        mov r20.w, r14.y
        mov r21.x, r11.z
        mov r21.y, r12.z
        mov r21.z, r13.z
        mov r21.w, r14.z
        mov r14.x, r11.w
        mov r14.y, r12.w
        mov r14.z, r13.w
      endif
    else
      mov r19.x, r11.x
      mov r19.y, r12.x
      mov r19.z, r13.x
      mov r19.w, r14.x
      mov r20.x, r11.y
      mov r20.y, r12.y
      mov r20.z, r13.y
      mov r20.w, r14.y
      mov r21.x, r11.z
      mov r21.y, r12.z
      mov r21.z, r13.z
      mov r21.w, r14.z
      mov r14.x, r11.w
      mov r14.y, r12.w
      mov r14.z, r13.w
      mov r18.xyzw, l(1.000000,1.000000,0,0)
    endif
    dp4 r11.x, r4.xyzw, r19.xyzw
    dp4 r11.y, r4.xyzw, r20.xyzw
    dp4 r11.z, r4.xyzw, r21.xyzw
    dp4 r6.w, r4.xyzw, r14.xyzw
    div r11.xyz, r11.xyzx, r6.wwww
    lt r12.xy, r11.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
    lt r12.zw, l(0.000000, 0.000000, 1.000000, 1.000000), r11.xxxy
    or r6.w, r12.z, r12.x
    or r6.w, r12.y, r6.w
    or r6.w, r12.w, r6.w
    if_nz r6.w
      mov r6.w, l(1.000000)
    else
      eq r7.x, r7.x, l(1.000000)
      mad r12.xy, r11.xyxx, r18.xyxx, r18.zwzz
      if_nz r7.x
        round_z r12.z, r7.y
        sample_l_indexable(texture2darray)(float,float,float,float) r7.x, r12.xyzx, t10.xyzw, s10, l(0.000000)
        mul r7.z, r7.z, r11.z
        mul r7.z, r7.z, l(1.442695)
        exp r7.z, r7.z
        div r7.x, r7.x, r7.z
        mad_sat r6.w, r7.x, l(1.200000), l(-0.200000)
      else
        round_z r12.w, r7.y
        sample_l_indexable(texture2darray)(float,float,float,float) r7.x, r12.xywx, t10.xyzw, s10, l(0.000000)
        lt r7.x, r11.z, r7.x
        and r6.w, r7.x, l(0x3f800000)
      endif
    endif
    mul r7.xyz, r6.wwww, r10.xyzx
    mul r7.xyz, r8.xyzx, r7.xyzx
    dp3 r6.w, r9.xyzx, r5.xyzx
    mad r7.w, -r5.w, r5.w, l(1.000000)
    mad r8.x, r5.w, r5.w, l(1.000000)
    dp2 r5.w, r6.wwww, r5.wwww
    add r5.w, -r5.w, r8.x
    log r5.w, |r5.w|
    mul r5.w, r5.w, l(1.500000)
    exp r5.w, r5.w
    div r5.w, r7.w, r5.w
    mul r5.w, r5.w, l(0.785398)
    mad r6.xyz, r7.xyzx, r5.wwww, r6.xyzx
  endif
  iadd r2.w, r2.w, l(1)
endloop
add r7.xyz, -r4.xyzx, r3.xywx
dp3 r2.w, r7.xyzx, r7.xyzx
mov r8.xyz, r6.xyzx
mov r5.w, l(0)
loop
  uge r6.w, r5.w, cb1[12].y
  breakc_nz r6.w
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r6.w, r5.w, l(124), t17.xxxx
  lt r7.w, l(0.000000), r6.w
  if_nz r7.w
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r9.xyz, r5.w, l(64), t17.xyzx
    add r10.xyz, -r4.xyzx, r9.xyzx
    dp3 r11.x, r10.xyzx, r10.xyzx
    lt r6.w, r11.x, r6.w
    if_nz r6.w
      ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r12.xyz, r5.w, l(16), t17.xyzx
      add r6.w, r12.y, r12.x
      add r6.w, r12.z, r6.w
      lt r6.w, l(0.000000), r6.w
      if_nz r6.w
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r13.xyz, r5.w, l(0), t17.xyzx
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r6.w, r5.w, l(32), t17.xxxx
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r14.xyz, r5.w, l(80), t17.xyzx
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r15.xy, r5.w, l(112), t17.xyxx
        dp3 r7.w, r7.xyzx, r10.xyzx
        ge r8.w, l(0.000000), r7.w
        rsq r9.w, r11.x
        mul r11.yzw, r9.wwww, r10.xxyz
        lt r9.w, r2.w, r7.w
        add r16.xyz, -r3.xywx, r9.xyzx
        dp3 r17.x, r16.xyzx, r16.xyzx
        rsq r10.w, r17.x
        mul r17.yzw, r10.wwww, r16.xxyz
        div r7.w, r7.w, r2.w
        mad r10.xyz, r7.xyzx, r7.wwww, -r10.xyzx
        dp3 r16.x, r10.xyzx, r10.xyzx
        dp3 r7.w, -r10.xyzx, -r10.xyzx
        rsq r7.w, r7.w
        mul r16.yzw, r7.wwww, -r10.xxyz
        movc r10.xyzw, r9.wwww, r17.xyzw, r16.xyzw
        movc r10.xyzw, r8.wwww, r11.xyzw, r10.xyzw
        mul r7.w, r15.x, -r10.x
        mul r7.w, r7.w, l(1.442695)
        exp r7.w, r7.w
        mul_sat r7.w, r7.w, r15.y
        mul r11.xyz, r7.wwww, r14.xyzx
        mul r11.xyz, r12.xyzx, r11.xyzx
        eq r7.w, r13.x, l(2.000000)
        if_nz r7.w
          dp3 r7.w, r10.yzwy, r5.xyzx
          mad r8.w, -r6.w, r6.w, l(1.000000)
          mad r9.w, r6.w, r6.w, l(1.000000)
          dp2 r7.w, r7.wwww, r6.wwww
          add r7.w, -r7.w, r9.w
          log r7.w, |r7.w|
          mul r7.w, r7.w, l(1.500000)
          exp r7.w, r7.w
          div r7.w, r8.w, r7.w
          mul r7.w, r7.w, l(0.785398)
          mul r12.xyz, r7.wwww, r11.xyzx
        else
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r14.xy, r5.w, l(48), t17.xyxx
          eq r7.w, r13.x, l(1.000000)
          add r9.xyz, r4.xyzx, -r9.xyzx
          mul r9.xyw, r14.xxxx, r9.xyxz
          mov r9.z, -r9.w
          dp3 r8.w, r9.xyzx, r9.xyzx
          sqrt r8.w, r8.w
          add_sat r8.w, r14.y, r8.w
          round_z r9.w, r13.y
          if_nz r7.w
            sample_l_indexable(texturecubearray)(float,float,float,float) r7.w, r9.xyzw, t13.yzwx, s13, l(0.000000)
            mul r10.x, r13.z, r8.w
            mul r10.x, r10.x, l(1.442695)
            exp r10.x, r10.x
            div r7.w, r7.w, r10.x
            mad_sat r7.w, r7.w, l(1.200000), l(-0.200000)
          else
            sample_l_indexable(texturecubearray)(float,float,float,float) r9.x, r9.xyzw, t13.xyzw, s13, l(0.000000)
            lt r8.w, r8.w, r9.x
            and r7.w, r8.w, l(0x3f800000)
          endif
          mul r9.xyz, r7.wwww, r11.xyzx
          dp3 r7.w, r10.yzwy, r5.xyzx
          mad r8.w, -r6.w, r6.w, l(1.000000)
          mad r9.w, r6.w, r6.w, l(1.000000)
          dp2 r6.w, r7.wwww, r6.wwww
          add r6.w, -r6.w, r9.w
          log r6.w, |r6.w|
          mul r6.w, r6.w, l(1.500000)
          exp r6.w, r6.w
          div r6.w, r8.w, r6.w
          mul r6.w, r6.w, l(0.785398)
          mul r12.xyz, r6.wwww, r9.xyzx
        endif
        add r8.xyz, r8.xyzx, r12.xyzx
      endif
    endif
  endif
  iadd r5.w, r5.w, l(1)
endloop
mov r6.xyz, r8.xyzx
mov r5.w, l(0)
loop
  uge r6.w, r5.w, cb1[12].z
  breakc_nz r6.w
  ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r9.xy, r5.w, l(188), t18.xyxx
  lt r6.w, l(0.000000), r9.x
  if_nz r6.w
    ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r10.xyz, r5.w, l(112), t18.xyzx
    add r11.xyz, -r4.xyzx, r10.xyzx
    dp3 r12.x, r11.xyzx, r11.xyzx
    lt r6.w, r12.x, r9.x
    if_nz r6.w
      ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r9.xzw, r5.w, l(16), t18.xxyz
      add r6.w, r9.z, r9.x
      add r6.w, r9.w, r6.w
      lt r6.w, l(0.000000), r6.w
      if_nz r6.w
        ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r6.w, r5.w, l(204), t18.xxxx
        ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r13.xyz, r5.w, l(128), t18.xyzx
        ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r14.xyz, r5.w, l(144), t18.xyzx
        ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r15.xy, r5.w, l(176), t18.xyxx
        ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r16.xyz, r5.w, l(0), t18.xyzx
        ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r7.w, r5.w, l(32), t18.xxxx
        dp3 r8.w, r7.xyzx, r11.xyzx
        ge r10.w, l(0.000000), r8.w
        rsq r11.w, r12.x
        mul r12.yzw, r11.wwww, r11.xxyz
        lt r11.w, r2.w, r8.w
        add r10.xyz, -r3.xywx, r10.xyzx
        dp3 r17.x, r10.xyzx, r10.xyzx
        rsq r13.w, r17.x
        mul r17.yzw, r10.xxyz, r13.wwww
        div r8.w, r8.w, r2.w
        mad r10.xyz, r7.xyzx, r8.wwww, -r11.xyzx
        dp3 r18.x, r10.xyzx, r10.xyzx
        dp3 r8.w, -r10.xyzx, -r10.xyzx
        rsq r8.w, r8.w
        mul r18.yzw, r8.wwww, -r10.xxyz
        movc r17.xyzw, r11.wwww, r17.xyzw, r18.xyzw
        movc r10.xyzw, r10.wwww, r12.xyzw, r17.xyzw
        rsq r8.w, r10.x
        mul r11.xyz, r8.wwww, -r11.xyzx
        dp3 r8.w, -r11.xyzx, r13.xyzx
        mad_sat r8.w, r8.w, r6.w, r9.y
        mul r10.x, r15.x, -r10.x
        mul r10.x, r10.x, l(1.442695)
        exp r10.x, r10.x
        mul_sat r10.x, r10.x, r15.y
        mul r8.w, r8.w, r10.x
        mul r11.xyz, r8.wwww, r14.xyzx
        mul r9.xzw, r9.xxzw, r11.xxyz
        eq r8.w, r16.x, l(2.000000)
        if_nz r8.w
          dp3 r8.w, r10.yzwy, r13.xyzx
          mad_sat r8.w, r8.w, r6.w, r9.y
          mul r11.xyz, r8.wwww, r9.xzwx
          dp3 r8.w, r10.yzwy, r5.xyzx
          mad r10.x, -r7.w, r7.w, l(1.000000)
          mad r11.w, r7.w, r7.w, l(1.000000)
          dp2 r8.w, r8.wwww, r7.wwww
          add r8.w, -r8.w, r11.w
          log r8.w, |r8.w|
          mul r8.w, r8.w, l(1.500000)
          exp r8.w, r8.w
          div r8.w, r10.x, r8.w
          mul r8.w, r8.w, l(0.785398)
          mul r11.xyz, r8.wwww, r11.xyzx
        else
          ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r12.xyzw, r5.w, l(48), t18.xyzw
          ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r14.xyzw, r5.w, l(64), t18.xyzw
          ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r15.xyzw, r5.w, l(80), t18.xyzw
          ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r17.xyzw, r5.w, l(96), t18.xyzw
          mov r18.x, r12.x
          mov r18.y, r14.x
          mov r18.z, r15.x
          mov r18.w, r17.x
          dp4 r18.x, r4.xyzw, r18.xyzw
          mov r19.x, r12.y
          mov r19.y, r14.y
          mov r19.z, r15.y
          mov r19.w, r17.y
          dp4 r18.y, r4.xyzw, r19.xyzw
          mov r19.x, r12.z
          mov r19.y, r14.z
          mov r19.z, r15.z
          mov r19.w, r17.z
          dp4 r18.z, r4.xyzw, r19.xyzw
          mov r17.x, r12.w
          mov r17.y, r14.w
          mov r17.z, r15.w
          dp4 r8.w, r4.xyzw, r17.xyzw
          div r12.xyz, r18.xyzx, r8.wwww
          lt r14.xy, r12.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
          lt r14.zw, l(0.000000, 0.000000, 1.000000, 1.000000), r12.xxxy
          or r8.w, r14.z, r14.x
          or r8.w, r14.y, r8.w
          or r8.w, r14.w, r8.w
          if_nz r8.w
            mov r8.w, l(1.000000)
          else
            eq r10.x, r16.x, l(1.000000)
            if_nz r10.x
              round_z r12.w, r16.y
              sample_l_indexable(texture2darray)(float,float,float,float) r10.x, r12.xywx, t12.xyzw, s12, l(0.000000)
              mul r11.w, r16.z, r12.z
              mul r11.w, r11.w, l(1.442695)
              exp r11.w, r11.w
              div r10.x, r10.x, r11.w
              mad_sat r8.w, r10.x, l(1.200000), l(-0.200000)
            else
              round_z r14.z, r16.y
              mov r14.xy, r12.xyxx
              sample_l_indexable(texture2darray)(float,float,float,float) r10.x, r14.xyzx, t12.xyzw, s12, l(0.000000)
              lt r10.x, r12.z, r10.x
              and r8.w, r10.x, l(0x3f800000)
            endif
          endif
          mul r9.xzw, r8.wwww, r9.xxzw
          dp3 r8.w, r10.yzwy, r13.xyzx
          mad_sat r6.w, r8.w, r6.w, r9.y
          mul r9.xyz, r6.wwww, r9.xzwx
          dp3 r6.w, r10.yzwy, r5.xyzx
          mad r8.w, -r7.w, r7.w, l(1.000000)
          mad r9.w, r7.w, r7.w, l(1.000000)
          dp2 r6.w, r6.wwww, r7.wwww
          add r6.w, -r6.w, r9.w
          log r6.w, |r6.w|
          mul r6.w, r6.w, l(1.500000)
          exp r6.w, r6.w
          div r6.w, r8.w, r6.w
          mul r6.w, r6.w, l(0.785398)
          mul r11.xyz, r6.wwww, r9.xyzx
        endif
        add r6.xyz, r6.xyzx, r11.xyzx
      endif
    endif
  endif
  iadd r5.w, r5.w, l(1)
endloop
ne r2.w, cb1[13].w, l(0.000000)
if_nz r2.w
  mad r3.xyw, r4.xyxz, cb1[13].wwww, cb1[13].xyxz
  round_ni r4.xyz, r3.xywx
  ftoi r5.xyz, r4.xyzx
  and r5.xyz, r5.xyzx, l(255, 255, 255, 0)
  add r3.xyw, r3.xyxw, -r4.xyxz
  mul r4.xyz, r3.xywx, r3.xywx
  mul r4.xyz, r3.xywx, r4.xyzx
  mad r7.xyz, r3.xywx, l(6.000000, 6.000000, 6.000000, 0.000000), l(-15.000000, -15.000000, -15.000000, 0.000000)
  mad r7.xyz, r3.xywx, r7.xyzx, l(10.000000, 10.000000, 10.000000, 0.000000)
  mul r4.xyz, r4.xyzx, r7.xyzx
  mov r5.w, l(0)
  ld_indexable(texture2d)(float,float,float,float) r7.xyzw, r5.xyww, t8.xyzw
  itof r2.w, r5.z
  mul r2.w, r2.w, l(0.00390625000)
  mad r5.xyzw, r7.xzyw, l(0.996093750, 0.996093750, 0.996093750, 0.996093750), r2.wwww
  add r7.xyzw, r5.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 r2.w, r9.xyzx, r3.xywx
  add r9.xyz, r3.xywx, 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, -r2.w, r4.w
  mad r2.w, r4.x, r4.w, r2.w
  add r8.xyz, r3.xywx, 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, r3.xywx, 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 r6.w, r7.xyzx, r8.xyzx
  add r6.w, -r4.w, r6.w
  mad r4.w, r4.x, r6.w, r4.w
  add r4.w, -r2.w, r4.w
  mad r2.w, r4.y, r4.w, r2.w
  add r7.xyz, r3.xywx, l(0.000000, 0.000000, -1.000000, 0.000000)
  add r5.xyzw, r5.zxwy, l(0.00585899968, 0.00585899968, 0.00585899968, 0.00585899968)
  mov r8.xz, r5.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, r3.xywx, 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 r6.w, r8.xyzx, r7.xyzx
  add r6.w, -r4.w, r6.w
  mad r4.w, r4.x, r6.w, r4.w
  add r7.xyz, r3.xywx, l(0.000000, -1.000000, -1.000000, 0.000000)
  mov r5.yw, l(0,256.500000,0,256.500000)
  sample_l_indexable(texture2d)(float,float,float,float) r8.xyz, r5.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.x, r8.xyzx, r7.xyzx
  add r3.xyw, r3.xyxw, l(-1.000000, -1.000000, 0.000000, -1.000000)
  sample_l_indexable(texture2d)(float,float,float,float) r5.yzw, r5.zwzz, t8.wxyz, s8, l(0.000000)
  mad r5.yzw, r5.yyzw, l(0.000000, 2.000000, 2.000000, 2.000000), l(0.000000, -1.000000, -1.000000, -1.000000)
  dp3 r3.x, r5.yzwy, r3.xywx
  add r3.x, -r5.x, r3.x
  mad r3.x, r4.x, r3.x, r5.x
  add r3.x, -r4.w, r3.x
  mad r3.x, r4.y, r3.x, r4.w
  add r3.x, -r2.w, r3.x
  mad r2.w, r4.z, r3.x, r2.w
  add r2.w, r2.w, l(1.000000)
else
  mov r2.w, l(1.000000)
endif
mul r0.w, r0.w, r1.w
mul r4.w, r2.w, r0.w
mul r4.xyz, r4.wwww, r6.xyzx
if_nz r3.z
  mul r1.xy, r1.xyxx, cb1[8].xyxx
  mul r1.xy, -r1.zzzz, r1.xyxx
  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
  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
  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 595 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v1.3.16 on Sat Feb 06 00:49:42 2021
//
// struct slVFParallelLightInfo
// {
//     struct {
//         float4 vMapDesc;           // Offset:    0
//         float4 vColorScale;        // Offset:   16
//         float4 vEcc;               // Offset:   32
//     } sCommon;                     // Offset:    0
//     struct {
//         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
// };
//
// struct slVFPointLightInfo
// {
//     struct {
//         struct {
//             float4 vMapDesc;       // Offset:    0
//             float4 vColorScale;    // Offset:   16
//             float4 vEcc;           // Offset:   32
//         } sCommon;                 // Offset:    0
//         float4 vW2S;               // Offset:   48
//     } sBase;                       // Offset:    0
//     struct {
//         float4 vPos;               // Offset:   64
//         float4 vDiffuse;           // Offset:   80
//         float4 vAmbient;           // Offset:   96
//         float4 vAtt;               // Offset:  112
//     } sLightInfo;                  // Offset:   64
// };
//
// struct slVFSpotLightInfo
// {
//     struct {
//         struct {
//             float4 vMapDesc;       // Offset:    0
//             float4 vColorScale;    // Offset:   16
//             float4 vEcc;           // Offset:   32
//         } sCommon;                 // Offset:    0
//         row_major float4x4 vW2S;   // Offset:   48
//     } sBase;                       // Offset:    0
//     struct {
//         float4 vPos;               // Offset:  112
//         float4 vDir;               // Offset:  128
//         float4 vDiffuse;           // Offset:  144
//         float4 vAmbient;           // Offset:  160
//         float4 vAtt;               // Offset:  176
//         float4 vCos;               // Offset:  192
//     } sLightInfo;                  // Offset:  112
// };
//
// cbuffer VolumetricFogConstBuf : register(b1)
// {
//   row_major float4x4 gV2W : packoffset(c0);
//   row_major float4x4 gPrevW2P : packoffset(c4);
//   float4 gAngleAndNearFar : packoffset(c8);
//   float4 gCalcVolumeFactor : packoffset(c9);
//   float4 gEyePosAndFogFar : packoffset(c10);
//   float4 gInjectionDesc : packoffset(c11);
//   int4 gLightInfo : packoffset(c12);
//   float4 gFogNoiseInfo : packoffset(c13);
//   float4 gScatteringInfo : packoffset(c14);
//   float4 gAccParams : packoffset(c15);
//   float4 gAttParam : packoffset(c16);
//   row_major float4x4 gW2P : packoffset(c17);
// }
//
// SamplerState __smpsPermutation_s : register(s8);
// SamplerState __smpsVolumeSrc_s : register(s9);
// SamplerState __smpsParallelShadwoMap_s : register(s10);
// SamplerState __smpsSpotShadwoMap_s : register(s12);
// SamplerState __smpsPointShadwoMapArray_s : register(s13);
// Texture2D<float4> sPermutation : register(t8);
// Texture3D<float4> sVolumeSrc : register(t9);
// Texture2DArray<float4> sParallelShadwoMap : register(t10);
// Texture2DArray<float4> sSpotShadwoMap : register(t12);
// TextureCubeArray<float4> sPointShadwoMapArray : register(t13);
// StructuredBuffer<slVFParallelLightInfo> sParaLightInfo : register(t16);
// StructuredBuffer<slVFPointLightInfo> sPointLightInfo : register(t17);
// StructuredBuffer<slVFSpotLightInfo> sSpotLightInfo : register(t18);
// RWTexture3D<float4> uavTarget : register(u0);
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Texture2D<float4> StereoParams : register(t125);
//
//
// void main)
// {
//   const float4 icb[] = { { 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} };
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture3d (float,float,float,float) u0
//   float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16,r17,r18,r19,r20,r21;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_thread_group 8, 8, 4
//   r0.xyz = uiDest.xyz;
// // Unknown use of GetDimensions for resinfo_ from missing reflection info, need manual fix.
// // resinfo_indexable(texture3d)(float,float,float,float)_uint r0.xyz, l(0), u0.xyzw
// // Example for texture2d type, uint return:
// tx.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
// rx = uiDest;
//  state=0, constZero.eType=4, returnType=2, texture.eType=7, afImmediates[0]=0.000000
//   r1.xyz = (uint3)vThreadID.xyz;
//   r1.xyz = float3(0.5,0.5,0.5) + r1.xyz;
//   r2.xyz = (uint3)r0.xyz;
//   r1.xyz = r1.xyz / r2.xyz;
//   r1.xyz = r1.xyz * float3(2,-2,1) + float3(-1,1,0);
//   r0.w = (int)vThreadID.z + 1;
//   r0.w = (uint)r0.w;
//   r0.w = r0.w / r2.z;
//   r3.xyz = cmp(float3(0,0,0) < gInjectionDesc.zxy);
//   r1.w = r3.y ? r3.x : 0;
//   if (r1.w != 0) {
//     r3.xy = (uint2)vThreadID.xz;
//     r1.w = gInjectionDesc.x + r3.x;
//     r2.w = (uint)vThreadID.y << 1;
//     r2.w = (uint)r2.w;
//     r1.w = r2.w + r1.w;
//     r1.w = r3.y * gInjectionDesc.x + r1.w;
//     r1.w = (uint)r1.w;
//     r1.w = (int)r1.w & 15;
//     r3.xy = icb[r1.w+0].xy + float2(-0.5,-0.5);
//     r4.xy = (uint2)r0.xy;
//     r3.xy = r3.xy / r4.xy;
//     r3.xy = r3.xy * gInjectionDesc.zz + r1.xy;
//   } else {
//     r3.xy = r1.xy;
//   }
//   r1.z = gCalcVolumeFactor.w * r1.z;
//   r1.z = 1.44269502 * r1.z;
//   r1.z = exp2(r1.z);
//   r1.z = gAngleAndNearFar.z * -r1.z;
//   r0.w = gCalcVolumeFactor.w * r0.w;
//   r0.w = 1.44269502 * r0.w;
//   r0.w = exp2(r0.w);
//   r0.w = gAngleAndNearFar.z * -r0.w;
//   r3.xy = gAngleAndNearFar.xy * r3.xy;
//   r4.xy = r3.xy * -r1.zz;
//   r3.xy = r3.xy * -r0.ww;
//   r5.xyzw = gV2W._m10_m11_m12_m13 * r4.yyyy;
//   r4.xyzw = r4.xxxx * gV2W._m00_m01_m02_m03 + r5.xyzw;
//   r4.xyzw = r1.zzzz * gV2W._m20_m21_m22_m23 + r4.xyzw;
//   r4.xyzw = gV2W._m30_m31_m32_m33 + r4.xyzw;
//   r5.xyz = gV2W._m10_m11_m12 * r3.yyy;
//   r3.xyw = r3.xxx * gV2W._m00_m01_m02 + r5.xyz;
//   r3.xyw = r0.www * gV2W._m20_m21_m22 + r3.xyw;
//   r3.xyw = gV2W._m30_m31_m32 + r3.xyw;
//   r5.xyz = -gEyePosAndFogFar.xyz + r4.xyz;
//   r0.w = dot(r5.xyz, r5.xyz);
//   r0.w = rsqrt(r0.w);
//   r5.xyz = r5.xyz * r0.www;
//   r6.xyz = r4.xyz + -r3.xyw;
//   r0.w = dot(r6.xyz, r6.xyz);
//   r0.w = sqrt(r0.w);
//   r1.w = cmp(gScatteringInfo.y < r4.y);
//   r2.w = -gScatteringInfo.y + r4.y;
//   r2.w = -r2.w / gScatteringInfo.y;
//   r2.w = 1.44269502 * r2.w;
//   r2.w = exp2(r2.w);
//   r2.w = gScatteringInfo.x * r2.w;
//   r1.w = r1.w ? r2.w : gScatteringInfo.x;
//   r6.xyz = float3(0,0,0);
//   r2.w = 0;
//   while (true) {
//     r5.w = cmp((uint)r2.w >= (uint)gLightInfo.x);
//     if (r5.w != 0) break;
//     r7.x = sParaLightInfo[r2.w].sCommon.vMapDesc.x;
//     r7.y = sParaLightInfo[r2.w].sCommon.vMapDesc.y;
//     r7.z = sParaLightInfo[r2.w].sCommon.vMapDesc.z;
//     r8.x = sParaLightInfo[r2.w].sCommon.vColorScale.x;
//     r8.y = sParaLightInfo[r2.w].sCommon.vColorScale.y;
//     r8.z = sParaLightInfo[r2.w].sCommon.vColorScale.z;
//     r5.w = sParaLightInfo[r2.w].sCommon.vEcc.x;
//     r9.x = sParaLightInfo[r2.w].sLightInfo.vDir;
//     r9.y = sParaLightInfo[r2.w].sLightInfo.vDir;
//     r9.z = sParaLightInfo[r2.w].sLightInfo.vDir;
//     r10.x = sParaLightInfo[r2.w].sLightInfo.vDiffuse;
//     r10.y = sParaLightInfo[r2.w].sLightInfo.vDiffuse;
//     r10.z = sParaLightInfo[r2.w].sLightInfo.vDiffuse;
//     r6.w = cmp(r7.x == 2.000000);
//     if (r6.w != 0) {
//       r11.xyz = r10.xyz * r8.xyz;
//       r6.w = dot(r9.xyz, r5.xyz);
//       r7.w = -r5.w * r5.w + 1;
//       r8.w = r5.w * r5.w + 1;
//       r6.w = dot(r6.ww, r5.ww);
//       r6.w = r8.w + -r6.w;
//       r6.w = log2(abs(r6.w));
//       r6.w = 1.5 * r6.w;
//       r6.w = exp2(r6.w);
//       r6.w = r7.w / r6.w;
//       r6.w = 0.785398006 * r6.w;
//       r6.xyz = r11.xyz * r6.www + r6.xyz;
//     } else {
//       r6.w = sParaLightInfo[r2.w].vAttr.x;
//       r11.x = sParaLightInfo[r2.w].mW2S._m00;
//       r11.y = sParaLightInfo[r2.w].mW2S._m10;
//       r11.z = sParaLightInfo[r2.w].mW2S._m20;
//       r11.w = sParaLightInfo[r2.w].mW2S._m30;
//       r12.x = sParaLightInfo[r2.w].mW2S._m01;
//       r12.y = sParaLightInfo[r2.w].mW2S._m11;
//       r12.z = sParaLightInfo[r2.w].mW2S._m21;
//       r12.w = sParaLightInfo[r2.w].mW2S._m31;
//       r13.x = sParaLightInfo[r2.w].mW2S._m02;
//       r13.y = sParaLightInfo[r2.w].mW2S._m12;
//       r13.z = sParaLightInfo[r2.w].mW2S._m22;
//       r13.w = sParaLightInfo[r2.w].mW2S._m32;
//       r14.x = sParaLightInfo[r2.w].mW2S._m03;
//       r14.y = sParaLightInfo[r2.w].mW2S._m13;
//       r14.z = sParaLightInfo[r2.w].mW2S._m23;
//       r14.w = sParaLightInfo[r2.w].mW2S._m33;
//       r6.w = cmp(0 < r6.w);
//       if (r6.w != 0) {
//         r15.x = sParaLightInfo[r2.w].vSegs.x;
//         r15.y = sParaLightInfo[r2.w].vSegs.y;
//         r15.z = sParaLightInfo[r2.w].vSegs.z;
//         r6.w = cmp(r15.x < -r1.z);
//         if (r6.w != 0) {
//           r6.w = cmp(r15.y < -r1.z);
//           if (r6.w != 0) {
//             r6.w = cmp(r15.z < -r1.z);
//             if (r6.w != 0) {
//               r15.x = sParaLightInfo[r2.w].mW2S4._m00;
//               r15.y = sParaLightInfo[r2.w].mW2S4._m10;
//               r15.z = sParaLightInfo[r2.w].mW2S4._m20;
//               r15.w = sParaLightInfo[r2.w].mW2S4._m30;
//               r16.x = sParaLightInfo[r2.w].mW2S4._m01;
//               r16.y = sParaLightInfo[r2.w].mW2S4._m11;
//               r16.z = sParaLightInfo[r2.w].mW2S4._m21;
//               r16.w = sParaLightInfo[r2.w].mW2S4._m31;
//               r17.x = sParaLightInfo[r2.w].mW2S4._m02;
//               r17.y = sParaLightInfo[r2.w].mW2S4._m12;
//               r17.z = sParaLightInfo[r2.w].mW2S4._m22;
//               r17.w = sParaLightInfo[r2.w].mW2S4._m32;
//               r14.x = sParaLightInfo[r2.w].mW2S4._m03;
//               r14.y = sParaLightInfo[r2.w].mW2S4._m13;
//               r14.z = sParaLightInfo[r2.w].mW2S4._m23;
//               r14.w = sParaLightInfo[r2.w].mW2S4._m33;
//               r18.x = sParaLightInfo[r2.w].mUVS._m03;
//               r18.y = sParaLightInfo[r2.w].mUVS._m13;
//               r18.z = sParaLightInfo[r2.w].mUVS._m23;
//               r18.w = sParaLightInfo[r2.w].mUVS._m33;
//               r19.x = r15.x;
//               r19.y = r16.x;
//               r19.z = r17.x;
//               r19.w = r14.x;
//               r20.x = r15.y;
//               r20.y = r16.y;
//               r20.z = r17.y;
//               r20.w = r14.y;
//               r21.x = r15.z;
//               r21.y = r16.z;
//               r21.z = r17.z;
//               r21.w = r14.z;
//               r14.x = r15.w;
//               r14.y = r16.w;
//               r14.z = r17.w;
//             } else {
//               r15.x = sParaLightInfo[r2.w].mW2S3._m00;
//               r15.y = sParaLightInfo[r2.w].mW2S3._m10;
//               r15.z = sParaLightInfo[r2.w].mW2S3._m20;
//               r15.w = sParaLightInfo[r2.w].mW2S3._m30;
//               r16.x = sParaLightInfo[r2.w].mW2S3._m01;
//               r16.y = sParaLightInfo[r2.w].mW2S3._m11;
//               r16.z = sParaLightInfo[r2.w].mW2S3._m21;
//               r16.w = sParaLightInfo[r2.w].mW2S3._m31;
//               r17.x = sParaLightInfo[r2.w].mW2S3._m02;
//               r17.y = sParaLightInfo[r2.w].mW2S3._m12;
//               r17.z = sParaLightInfo[r2.w].mW2S3._m22;
//               r17.w = sParaLightInfo[r2.w].mW2S3._m32;
//               r14.x = sParaLightInfo[r2.w].mW2S3._m03;
//               r14.y = sParaLightInfo[r2.w].mW2S3._m13;
//               r14.z = sParaLightInfo[r2.w].mW2S3._m23;
//               r14.w = sParaLightInfo[r2.w].mW2S3._m33;
//               r18.x = sParaLightInfo[r2.w].mUVS._m02;
//               r18.y = sParaLightInfo[r2.w].mUVS._m12;
//               r18.z = sParaLightInfo[r2.w].mUVS._m22;
//               r18.w = sParaLightInfo[r2.w].mUVS._m32;
//               r19.x = r15.x;
//               r19.y = r16.x;
//               r19.z = r17.x;
//               r19.w = r14.x;
//               r20.x = r15.y;
//               r20.y = r16.y;
//               r20.z = r17.y;
//               r20.w = r14.y;
//               r21.x = r15.z;
//               r21.y = r16.z;
//               r21.z = r17.z;
//               r21.w = r14.z;
//               r14.x = r15.w;
//               r14.y = r16.w;
//               r14.z = r17.w;
//             }
//           } else {
//             r15.x = sParaLightInfo[r2.w].mW2S2._m00;
//             r15.y = sParaLightInfo[r2.w].mW2S2._m10;
//             r15.z = sParaLightInfo[r2.w].mW2S2._m20;
//             r15.w = sParaLightInfo[r2.w].mW2S2._m30;
//             r16.x = sParaLightInfo[r2.w].mW2S2._m01;
//             r16.y = sParaLightInfo[r2.w].mW2S2._m11;
//             r16.z = sParaLightInfo[r2.w].mW2S2._m21;
//             r16.w = sParaLightInfo[r2.w].mW2S2._m31;
//             r17.x = sParaLightInfo[r2.w].mW2S2._m02;
//             r17.y = sParaLightInfo[r2.w].mW2S2._m12;
//             r17.z = sParaLightInfo[r2.w].mW2S2._m22;
//             r17.w = sParaLightInfo[r2.w].mW2S2._m32;
//             r14.x = sParaLightInfo[r2.w].mW2S2._m03;
//             r14.y = sParaLightInfo[r2.w].mW2S2._m13;
//             r14.z = sParaLightInfo[r2.w].mW2S2._m23;
//             r14.w = sParaLightInfo[r2.w].mW2S2._m33;
//             r18.x = sParaLightInfo[r2.w].mUVS._m01;
//             r18.y = sParaLightInfo[r2.w].mUVS._m11;
//             r18.z = sParaLightInfo[r2.w].mUVS._m21;
//             r18.w = sParaLightInfo[r2.w].mUVS._m31;
//             r19.x = r15.x;
//             r19.y = r16.x;
//             r19.z = r17.x;
//             r19.w = r14.x;
//             r20.x = r15.y;
//             r20.y = r16.y;
//             r20.z = r17.y;
//             r20.w = r14.y;
//             r21.x = r15.z;
//             r21.y = r16.z;
//             r21.z = r17.z;
//             r21.w = r14.z;
//             r14.x = r15.w;
//             r14.y = r16.w;
//             r14.z = r17.w;
//           }
//         } else {
//           r18.x = sParaLightInfo[r2.w].mUVS._m00;
//           r18.y = sParaLightInfo[r2.w].mUVS._m10;
//           r18.z = sParaLightInfo[r2.w].mUVS._m20;
//           r18.w = sParaLightInfo[r2.w].mUVS._m30;
//           r19.x = r11.x;
//           r19.y = r12.x;
//           r19.z = r13.x;
//           r19.w = r14.x;
//           r20.x = r11.y;
//           r20.y = r12.y;
//           r20.z = r13.y;
//           r20.w = r14.y;
//           r21.x = r11.z;
//           r21.y = r12.z;
//           r21.z = r13.z;
//           r21.w = r14.z;
//           r14.x = r11.w;
//           r14.y = r12.w;
//           r14.z = r13.w;
//         }
//       } else {
//         r19.x = r11.x;
//         r19.y = r12.x;
//         r19.z = r13.x;
//         r19.w = r14.x;
//         r20.x = r11.y;
//         r20.y = r12.y;
//         r20.z = r13.y;
//         r20.w = r14.y;
//         r21.x = r11.z;
//         r21.y = r12.z;
//         r21.z = r13.z;
//         r21.w = r14.z;
//         r14.x = r11.w;
//         r14.y = r12.w;
//         r14.z = r13.w;
//         r18.xyzw = float4(1,1,0,0);
//       }
//       r11.x = dot(r4.xyzw, r19.xyzw);
//       r11.y = dot(r4.xyzw, r20.xyzw);
//       r11.z = dot(r4.xyzw, r21.xyzw);
//       r6.w = dot(r4.xyzw, r14.xyzw);
//       r11.xyz = r11.xyz / r6.www;
//       r12.xy = cmp(r11.xy < float2(0,0));
//       r12.zw = cmp(float2(1,1) < r11.xy);
//       r6.w = (int)r12.z | (int)r12.x;
//       r6.w = (int)r12.y | (int)r6.w;
//       r6.w = (int)r12.w | (int)r6.w;
//       if (r6.w != 0) {
//         r6.w = 1;
//       } else {
//         r7.x = cmp(r7.x == 1.000000);
//         r12.xy = r11.xy * r18.xy + r18.zw;
//         if (r7.x != 0) {
//           r12.z = trunc(r7.y);
//           r7.x = sParallelShadwoMap.SampleLevel(__smpsParallelShadwoMap_s, r12.xyz, 0).x;
//           r7.z = r11.z * r7.z;
//           r7.z = 1.44269502 * r7.z;
//           r7.z = exp2(r7.z);
//           r7.x = r7.x / r7.z;
//           r6.w = saturate(r7.x * 1.20000005 + -0.200000003);
//         } else {
//           r12.w = trunc(r7.y);
//           r7.x = sParallelShadwoMap.SampleLevel(__smpsParallelShadwoMap_s, r12.xyw, 0).x;
//           r7.x = cmp(r11.z < r7.x);
//           r6.w = r7.x ? 1.000000 : 0;
//         }
//       }
//       r7.xyz = r10.xyz * r6.www;
//       r7.xyz = r7.xyz * r8.xyz;
//       r6.w = dot(r9.xyz, r5.xyz);
//       r7.w = -r5.w * r5.w + 1;
//       r8.x = r5.w * r5.w + 1;
//       r5.w = dot(r6.ww, r5.ww);
//       r5.w = r8.x + -r5.w;
//       r5.w = log2(abs(r5.w));
//       r5.w = 1.5 * r5.w;
//       r5.w = exp2(r5.w);
//       r5.w = r7.w / r5.w;
//       r5.w = 0.785398006 * r5.w;
//       r6.xyz = r7.xyz * r5.www + r6.xyz;
//     }
//     r2.w = (int)r2.w + 1;
//   }
//   r7.xyz = r3.xyw + -r4.xyz;
//   r2.w = dot(r7.xyz, r7.xyz);
//   r8.xyz = r6.xyz;
//   r5.w = 0;
//   while (true) {
//     r6.w = cmp((uint)r5.w >= (uint)gLightInfo.y);
//     if (r6.w != 0) break;
//     r6.w = sPointLightInfo[r5.w].sLightInfo.vAtt;
//     r7.w = cmp(0 < r6.w);
//     if (r7.w != 0) {
//       r9.x = sPointLightInfo[r5.w].sLightInfo.vPos;
//       r9.y = sPointLightInfo[r5.w].sLightInfo.vPos;
//       r9.z = sPointLightInfo[r5.w].sLightInfo.vPos;
//       r10.xyz = r9.xyz + -r4.xyz;
//       r11.x = dot(r10.xyz, r10.xyz);
//       r6.w = cmp(r11.x < r6.w);
//       if (r6.w != 0) {
//         r12.x = sPointLightInfo[r5.w].sBase.sCommon.vColorScale.x;
//         r12.y = sPointLightInfo[r5.w].sBase.sCommon.vColorScale.y;
//         r12.z = sPointLightInfo[r5.w].sBase.sCommon.vColorScale.z;
//         r6.w = r12.x + r12.y;
//         r6.w = r6.w + r12.z;
//         r6.w = cmp(0 < r6.w);
//         if (r6.w != 0) {
//           r13.x = sPointLightInfo[r5.w].sBase.sCommon.vMapDesc.x;
//           r13.y = sPointLightInfo[r5.w].sBase.sCommon.vMapDesc.y;
//           r13.z = sPointLightInfo[r5.w].sBase.sCommon.vMapDesc.z;
//           r6.w = sPointLightInfo[r5.w].sBase.sCommon.vEcc.x;
//           r14.x = sPointLightInfo[r5.w].sLightInfo.vDiffuse;
//           r14.y = sPointLightInfo[r5.w].sLightInfo.vDiffuse;
//           r14.z = sPointLightInfo[r5.w].sLightInfo.vDiffuse;
//           r15.x = sPointLightInfo[r5.w].sLightInfo.vAtt;
//           r15.y = sPointLightInfo[r5.w].sLightInfo.vAtt;
//           r7.w = dot(r7.xyz, r10.xyz);
//           r8.w = cmp(0 >= r7.w);
//           r9.w = rsqrt(r11.x);
//           r11.yzw = r10.xyz * r9.www;
//           r9.w = cmp(r2.w < r7.w);
//           r16.xyz = r9.xyz + -r3.xyw;
//           r17.x = dot(r16.xyz, r16.xyz);
//           r10.w = rsqrt(r17.x);
//           r17.yzw = r16.xyz * r10.www;
//           r7.w = r7.w / r2.w;
//           r10.xyz = r7.xyz * r7.www + -r10.xyz;
//           r16.x = dot(r10.xyz, r10.xyz);
//           r7.w = dot(-r10.xyz, -r10.xyz);
//           r7.w = rsqrt(r7.w);
//           r16.yzw = -r10.xyz * r7.www;
//           r10.xyzw = r9.wwww ? r17.xyzw : r16.xyzw;
//           r10.xyzw = r8.wwww ? r11.xyzw : r10.xyzw;
//           r7.w = -r10.x * r15.x;
//           r7.w = 1.44269502 * r7.w;
//           r7.w = exp2(r7.w);
//           r7.w = saturate(r15.y * r7.w);
//           r11.xyz = r14.xyz * r7.www;
//           r11.xyz = r11.xyz * r12.xyz;
//           r7.w = cmp(r13.x == 2.000000);
//           if (r7.w != 0) {
//             r7.w = dot(r10.yzw, r5.xyz);
//             r8.w = -r6.w * r6.w + 1;
//             r9.w = r6.w * r6.w + 1;
//             r7.w = dot(r7.ww, r6.ww);
//             r7.w = r9.w + -r7.w;
//             r7.w = log2(abs(r7.w));
//             r7.w = 1.5 * r7.w;
//             r7.w = exp2(r7.w);
//             r7.w = r8.w / r7.w;
//             r7.w = 0.785398006 * r7.w;
//             r12.xyz = r11.xyz * r7.www;
//           } else {
//             r14.x = sPointLightInfo[r5.w].sBase.vW2S.x;
//             r14.y = sPointLightInfo[r5.w].sBase.vW2S.y;
//             r7.w = cmp(r13.x == 1.000000);
//             r9.xyz = -r9.xyz + r4.xyz;
//             r9.xyw = r9.xyz * r14.xxx;
//             r9.z = -r9.w;
//             r8.w = dot(r9.xyz, r9.xyz);
//             r8.w = sqrt(r8.w);
//             r8.w = saturate(r8.w + r14.y);
//             r9.w = trunc(r13.y);
//             if (r7.w != 0) {
//               r7.w = sPointShadwoMapArray.SampleLevel(__smpsPointShadwoMapArray_s, r9.xyzw, 0).x;
//               r10.x = r8.w * r13.z;
//               r10.x = 1.44269502 * r10.x;
//               r10.x = exp2(r10.x);
//               r7.w = r7.w / r10.x;
//               r7.w = saturate(r7.w * 1.20000005 + -0.200000003);
//             } else {
//               r9.x = sPointShadwoMapArray.SampleLevel(__smpsPointShadwoMapArray_s, r9.xyzw, 0).x;
//               r8.w = cmp(r8.w < r9.x);
//               r7.w = r8.w ? 1.000000 : 0;
//             }
//             r9.xyz = r11.xyz * r7.www;
//             r7.w = dot(r10.yzw, r5.xyz);
//             r8.w = -r6.w * r6.w + 1;
//             r9.w = r6.w * r6.w + 1;
//             r6.w = dot(r7.ww, r6.ww);
//             r6.w = r9.w + -r6.w;
//             r6.w = log2(abs(r6.w));
//             r6.w = 1.5 * r6.w;
//             r6.w = exp2(r6.w);
//             r6.w = r8.w / r6.w;
//             r6.w = 0.785398006 * r6.w;
//             r12.xyz = r9.xyz * r6.www;
//           }
//           r8.xyz = r12.xyz + r8.xyz;
//         }
//       }
//     }
//     r5.w = (int)r5.w + 1;
//   }
//   r6.xyz = r8.xyz;
//   r5.w = 0;
//   while (true) {
//     r6.w = cmp((uint)r5.w >= (uint)gLightInfo.z);
//     if (r6.w != 0) break;
//     r9.x = sSpotLightInfo[r5.w].sLightInfo.vAtt;
//     r9.y = sSpotLightInfo[r5.w].sLightInfo.vCos;
//     r6.w = cmp(0 < r9.x);
//     if (r6.w != 0) {
//       r10.x = sSpotLightInfo[r5.w].sLightInfo.vPos;
//       r10.y = sSpotLightInfo[r5.w].sLightInfo.vPos;
//       r10.z = sSpotLightInfo[r5.w].sLightInfo.vPos;
//       r11.xyz = r10.xyz + -r4.xyz;
//       r12.x = dot(r11.xyz, r11.xyz);
//       r6.w = cmp(r12.x < r9.x);
//       if (r6.w != 0) {
//         r9.x = sSpotLightInfo[r5.w].sBase.sCommon.vColorScale.x;
//         r9.z = sSpotLightInfo[r5.w].sBase.sCommon.vColorScale.y;
//         r9.w = sSpotLightInfo[r5.w].sBase.sCommon.vColorScale.z;
//         r6.w = r9.x + r9.z;
//         r6.w = r6.w + r9.w;
//         r6.w = cmp(0 < r6.w);
//         if (r6.w != 0) {
//           r6.w = sSpotLightInfo[r5.w].sLightInfo.vCos;
//           r13.x = sSpotLightInfo[r5.w].sLightInfo.vDir;
//           r13.y = sSpotLightInfo[r5.w].sLightInfo.vDir;
//           r13.z = sSpotLightInfo[r5.w].sLightInfo.vDir;
//           r14.x = sSpotLightInfo[r5.w].sLightInfo.vDiffuse;
//           r14.y = sSpotLightInfo[r5.w].sLightInfo.vDiffuse;
//           r14.z = sSpotLightInfo[r5.w].sLightInfo.vDiffuse;
//           r15.x = sSpotLightInfo[r5.w].sLightInfo.vAtt;
//           r15.y = sSpotLightInfo[r5.w].sLightInfo.vAtt;
//           r16.x = sSpotLightInfo[r5.w].sBase.sCommon.vMapDesc.x;
//           r16.y = sSpotLightInfo[r5.w].sBase.sCommon.vMapDesc.y;
//           r16.z = sSpotLightInfo[r5.w].sBase.sCommon.vMapDesc.z;
//           r7.w = sSpotLightInfo[r5.w].sBase.sCommon.vEcc.x;
//           r8.w = dot(r7.xyz, r11.xyz);
//           r10.w = cmp(0 >= r8.w);
//           r11.w = rsqrt(r12.x);
//           r12.yzw = r11.xyz * r11.www;
//           r11.w = cmp(r2.w < r8.w);
//           r10.xyz = r10.xyz + -r3.xyw;
//           r17.x = dot(r10.xyz, r10.xyz);
//           r13.w = rsqrt(r17.x);
//           r17.yzw = r13.www * r10.xyz;
//           r8.w = r8.w / r2.w;
//           r10.xyz = r7.xyz * r8.www + -r11.xyz;
//           r18.x = dot(r10.xyz, r10.xyz);
//           r8.w = dot(-r10.xyz, -r10.xyz);
//           r8.w = rsqrt(r8.w);
//           r18.yzw = -r10.xyz * r8.www;
//           r17.xyzw = r11.wwww ? r17.xyzw : r18.xyzw;
//           r10.xyzw = r10.wwww ? r12.xyzw : r17.xyzw;
//           r8.w = rsqrt(r10.x);
//           r11.xyz = -r11.xyz * r8.www;
//           r8.w = dot(-r11.xyz, r13.xyz);
//           r8.w = saturate(r8.w * r6.w + r9.y);
//           r10.x = -r10.x * r15.x;
//           r10.x = 1.44269502 * r10.x;
//           r10.x = exp2(r10.x);
//           r10.x = saturate(r15.y * r10.x);
//           r8.w = r10.x * r8.w;
//           r11.xyz = r14.xyz * r8.www;
//           r9.xzw = r11.xyz * r9.xzw;
//           r8.w = cmp(r16.x == 2.000000);
//           if (r8.w != 0) {
//             r8.w = dot(r10.yzw, r13.xyz);
//             r8.w = saturate(r8.w * r6.w + r9.y);
//             r11.xyz = r9.xzw * r8.www;
//             r8.w = dot(r10.yzw, r5.xyz);
//             r10.x = -r7.w * r7.w + 1;
//             r11.w = r7.w * r7.w + 1;
//             r8.w = dot(r8.ww, r7.ww);
//             r8.w = r11.w + -r8.w;
//             r8.w = log2(abs(r8.w));
//             r8.w = 1.5 * r8.w;
//             r8.w = exp2(r8.w);
//             r8.w = r10.x / r8.w;
//             r8.w = 0.785398006 * r8.w;
//             r11.xyz = r11.xyz * r8.www;
//           } else {
//             r12.x = sSpotLightInfo[r5.w].sBase.vW2S._m00;
//             r12.y = sSpotLightInfo[r5.w].sBase.vW2S._m10;
//             r12.z = sSpotLightInfo[r5.w].sBase.vW2S._m20;
//             r12.w = sSpotLightInfo[r5.w].sBase.vW2S._m30;
//             r14.x = sSpotLightInfo[r5.w].sBase.vW2S._m01;
//             r14.y = sSpotLightInfo[r5.w].sBase.vW2S._m11;
//             r14.z = sSpotLightInfo[r5.w].sBase.vW2S._m21;
//             r14.w = sSpotLightInfo[r5.w].sBase.vW2S._m31;
//             r15.x = sSpotLightInfo[r5.w].sBase.vW2S._m02;
//             r15.y = sSpotLightInfo[r5.w].sBase.vW2S._m12;
//             r15.z = sSpotLightInfo[r5.w].sBase.vW2S._m22;
//             r15.w = sSpotLightInfo[r5.w].sBase.vW2S._m32;
//             r17.x = sSpotLightInfo[r5.w].sBase.vW2S._m03;
//             r17.y = sSpotLightInfo[r5.w].sBase.vW2S._m13;
//             r17.z = sSpotLightInfo[r5.w].sBase.vW2S._m23;
//             r17.w = sSpotLightInfo[r5.w].sBase.vW2S._m33;
//             r18.x = r12.x;
//             r18.y = r14.x;
//             r18.z = r15.x;
//             r18.w = r17.x;
//             r18.x = dot(r4.xyzw, r18.xyzw);
//             r19.x = r12.y;
//             r19.y = r14.y;
//             r19.z = r15.y;
//             r19.w = r17.y;
//             r18.y = dot(r4.xyzw, r19.xyzw);
//             r19.x = r12.z;
//             r19.y = r14.z;
//             r19.z = r15.z;
//             r19.w = r17.z;
//             r18.z = dot(r4.xyzw, r19.xyzw);
//             r17.x = r12.w;
//             r17.y = r14.w;
//             r17.z = r15.w;
//             r8.w = dot(r4.xyzw, r17.xyzw);
//             r12.xyz = r18.xyz / r8.www;
//             r14.xy = cmp(r12.xy < float2(0,0));
//             r14.zw = cmp(float2(1,1) < r12.xy);
//             r8.w = (int)r14.z | (int)r14.x;
//             r8.w = (int)r14.y | (int)r8.w;
//             r8.w = (int)r14.w | (int)r8.w;
//             if (r8.w != 0) {
//               r8.w = 1;
//             } else {
//               r10.x = cmp(r16.x == 1.000000);
//               if (r10.x != 0) {
//                 r12.w = trunc(r16.y);
//                 r10.x = sSpotShadwoMap.SampleLevel(__smpsSpotShadwoMap_s, r12.xyw, 0).x;
//                 r11.w = r12.z * r16.z;
//                 r11.w = 1.44269502 * r11.w;
//                 r11.w = exp2(r11.w);
//                 r10.x = r10.x / r11.w;
//                 r8.w = saturate(r10.x * 1.20000005 + -0.200000003);
//               } else {
//                 r14.z = trunc(r16.y);
//                 r14.xy = r12.xy;
//                 r10.x = sSpotShadwoMap.SampleLevel(__smpsSpotShadwoMap_s, r14.xyz, 0).x;
//                 r10.x = cmp(r12.z < r10.x);
//                 r8.w = r10.x ? 1.000000 : 0;
//               }
//             }
//             r9.xzw = r9.xzw * r8.www;
//             r8.w = dot(r10.yzw, r13.xyz);
//             r6.w = saturate(r8.w * r6.w + r9.y);
//             r9.xyz = r9.xzw * r6.www;
//             r6.w = dot(r10.yzw, r5.xyz);
//             r8.w = -r7.w * r7.w + 1;
//             r9.w = r7.w * r7.w + 1;
//             r6.w = dot(r6.ww, r7.ww);
//             r6.w = r9.w + -r6.w;
//             r6.w = log2(abs(r6.w));
//             r6.w = 1.5 * r6.w;
//             r6.w = exp2(r6.w);
//             r6.w = r8.w / r6.w;
//             r6.w = 0.785398006 * r6.w;
//             r11.xyz = r9.xyz * r6.www;
//           }
//           r6.xyz = r11.xyz + r6.xyz;
//         }
//       }
//     }
//     r5.w = (int)r5.w + 1;
//   }
//   r2.w = cmp(gFogNoiseInfo.w != 0.000000);
//   if (r2.w != 0) {
//     r3.xyw = r4.xyz * gFogNoiseInfo.www + gFogNoiseInfo.xyz;
//     r4.xyz = floor(r3.xyw);
//     r5.xyz = (int3)r4.xyz;
//     r5.xyz = (int3)r5.xyz & int3(255,255,255);
//     r3.xyw = -r4.xyz + r3.xyw;
//     r4.xyz = r3.xyw * r3.xyw;
//     r4.xyz = r4.xyz * r3.xyw;
//     r7.xyz = r3.xyw * float3(6,6,6) + float3(-15,-15,-15);
//     r7.xyz = r3.xyw * r7.xyz + float3(10,10,10);
//     r4.xyz = r7.xyz * r4.xyz;
//     r5.w = 0;
//     r7.xyzw = sPermutation.Load(r5.xyw).xyzw;
//     r2.w = (int)r5.z;
//     r2.w = 0.00390625 * r2.w;
//     r5.xyzw = r7.xzyw * float4(0.99609375,0.99609375,0.99609375,0.99609375) + r2.wwww;
//     r7.xyzw = float4(0.00195299997,0.00195299997,0.00195299997,0.00195299997) + r5.zxwy;
//     r8.xz = r7.yw;
//     r8.yw = float2(256.5,256.5);
//     r9.xyz = sPermutation.SampleLevel(__smpsPermutation_s, r8.xy, 0).xyz;
//     r9.xyz = r9.xyz * float3(2,2,2) + float3(-1,-1,-1);
//     r2.w = dot(r9.xyz, r3.xyw);
//     r9.xyz = float3(-1,0,0) + r3.xyw;
//     r8.xyz = sPermutation.SampleLevel(__smpsPermutation_s, r8.zw, 0).xyz;
//     r8.xyz = r8.xyz * float3(2,2,2) + float3(-1,-1,-1);
//     r4.w = dot(r8.xyz, r9.xyz);
//     r4.w = r4.w + -r2.w;
//     r2.w = r4.x * r4.w + r2.w;
//     r8.xyz = float3(0,-1,0) + r3.xyw;
//     r7.yw = float2(256.5,256.5);
//     r9.xyz = sPermutation.SampleLevel(__smpsPermutation_s, r7.xy, 0).xyz;
//     r9.xyz = r9.xyz * float3(2,2,2) + float3(-1,-1,-1);
//     r4.w = dot(r9.xyz, r8.xyz);
//     r8.xyz = float3(-1,-1,0) + r3.xyw;
//     r7.xyz = sPermutation.SampleLevel(__smpsPermutation_s, r7.zw, 0).xyz;
//     r7.xyz = r7.xyz * float3(2,2,2) + float3(-1,-1,-1);
//     r6.w = dot(r7.xyz, r8.xyz);
//     r6.w = r6.w + -r4.w;
//     r4.w = r4.x * r6.w + r4.w;
//     r4.w = r4.w + -r2.w;
//     r2.w = r4.y * r4.w + r2.w;
//     r7.xyz = float3(0,0,-1) + r3.xyw;
//     r5.xyzw = float4(0.00585899968,0.00585899968,0.00585899968,0.00585899968) + r5.zxwy;
//     r8.xz = r5.yw;
//     r8.yw = float2(256.5,256.5);
//     r9.xyz = sPermutation.SampleLevel(__smpsPermutation_s, r8.xy, 0).xyz;
//     r9.xyz = r9.xyz * float3(2,2,2) + float3(-1,-1,-1);
//     r4.w = dot(r9.xyz, r7.xyz);
//     r7.xyz = float3(-1,0,-1) + r3.xyw;
//     r8.xyz = sPermutation.SampleLevel(__smpsPermutation_s, r8.zw, 0).xyz;
//     r8.xyz = r8.xyz * float3(2,2,2) + float3(-1,-1,-1);
//     r6.w = dot(r8.xyz, r7.xyz);
//     r6.w = r6.w + -r4.w;
//     r4.w = r4.x * r6.w + r4.w;
//     r7.xyz = float3(0,-1,-1) + r3.xyw;
//     r5.yw = float2(256.5,256.5);
//     r8.xyz = sPermutation.SampleLevel(__smpsPermutation_s, r5.xy, 0).xyz;
//     r8.xyz = r8.xyz * float3(2,2,2) + float3(-1,-1,-1);
//     r5.x = dot(r8.xyz, r7.xyz);
//     r3.xyw = float3(-1,-1,-1) + r3.xyw;
//     r5.yzw = sPermutation.SampleLevel(__smpsPermutation_s, r5.zw, 0).xyz;
//     r5.yzw = r5.yzw * float3(2,2,2) + float3(-1,-1,-1);
//     r3.x = dot(r5.yzw, r3.xyw);
//     r3.x = r3.x + -r5.x;
//     r3.x = r4.x * r3.x + r5.x;
//     r3.x = r3.x + -r4.w;
//     r3.x = r4.y * r3.x + r4.w;
//     r3.x = r3.x + -r2.w;
//     r2.w = r4.z * r3.x + r2.w;
//     r2.w = 1 + r2.w;
//   } else {
//     r2.w = 1;
//   }
//   r0.w = r1.w * r0.w;
//   r4.w = r0.w * r2.w;
//   r4.xyz = r6.xyz * r4.www;
//   if (r3.z != 0) {
//     r1.xy = gAngleAndNearFar.xy * r1.xy;
//     r1.xy = r1.xy * -r1.zz;
//     r3.xyzw = gV2W._m10_m11_m12_m13 * r1.yyyy;
//     r3.xyzw = r1.xxxx * gV2W._m00_m01_m02_m03 + r3.xyzw;
//     r1.xyzw = r1.zzzz * gV2W._m20_m21_m22_m23 + r3.xyzw;
//     r1.xyzw = gV2W._m30_m31_m32_m33 + r1.xyzw;
//     r3.xyzw = gPrevW2P._m10_m11_m12_m13 * r1.yyyy;
//     r3.xyzw = r1.xxxx * gPrevW2P._m00_m01_m02_m03 + r3.xyzw;
//     r3.xyzw = r1.zzzz * gPrevW2P._m20_m21_m22_m23 + r3.xyzw;
//     r1.xyzw = r1.wwww * gPrevW2P._m30_m31_m32_m33 + r3.xyzw;
//     r1.xyz = r1.xyz / r1.www;
//     r0.w = gCalcVolumeFactor.y + r1.z;
//     r0.w = -gCalcVolumeFactor.x / r0.w;
//     r0.w = log2(r0.w);
//     r0.w = 0.693147182 * r0.w;
//     r1.z = log2(gCalcVolumeFactor.z);
//     r1.z = 0.693147182 * r1.z;
//     r3.z = r0.w / r1.z;
//     r3.xy = r1.xy * float2(0.5,-0.5) + float2(0.5,0.5);
//     r0.xyz = (int3)r0.xyz + int3(-1,-1,-1);
//     r0.xyz = (uint3)r0.xyz;
//     r0.xyz = r3.xyz * r0.xyz;
//     r0.xyz = r0.xyz / r2.xyz;
//     r1.xyz = float3(0.5,0.5,0.5) / r2.xyz;
//     r0.xyz = r1.xyz + r0.xyz;
//     r0.xyzw = sVolumeSrc.SampleLevel(__smpsVolumeSrc_s, r0.xyz, 0).xyzw;
//     r0.xyzw = r0.xyzw + -r4.xyzw;
//     r4.xyzw = gInjectionDesc.yyyy * r0.xyzw + r4.xyzw;
//   }
// // No code for instruction (needs manual fix):
// store_uav_typed u0.xyzw, vThreadID.xyzz, r4.xyzw
//   return;
// }
//////////////////////////////// HLSL Errors ////////////////////////////////
// F:\SteamLibrary\steamapps\common\Nioh2\ShaderFixes\205c66b0c2ba351a-cs_replace.txt(99,10): error X3000: syntax error: unexpected token ')'
/////////////////////////////////////////////////////////////////////////////
