// MANUALLY DUMPED [ShaderRegexDecalsClipping2][ShaderRegexDecalsContactShadows][ShaderRegexDecalsMain]
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.16 on Sat Dec 21 11:43:56 2019
//
//
// Note: shader requires additional functionality:
//       Minimum-precision data types
//
//
// Buffer Definitions:
//
// cbuffer SceneInfo
// {
//
//   row_major float4x4 viewProjMat;    // Index:    0 1 2 3          Components:    16
//   row_major float3x4 transposeViewMat;// Index:    4 5 6            Components:    12 [unused]
//   row_major float3x4 transposeViewInvMat;// Index:    7 8 9            Components:    12
//   float4 projElement[2];             // Index:   10 11             Components:     8 [unused]
//   float4 projInvElements[2];         // Index:   12 13             Components:     8 [unused]
//   row_major float4x4 viewProjInvMat; // Index:   14 15 16 17       Components:    16
//   row_major float4x4 prevViewProjMat;// Index:   18 19 20 21       Components:    16 [unused]
//   float3 ZToLinear;                  // Index:   22.xyz            Components:     3
//   float subdivisionLevel;            // Index:   22.w              Components:     1 [unused]
//   float2 screenSize;                 // Index:   23.xy             Components:     2
//   float2 screenInverseSize;          // Index:   23.zw             Components:     2
//   float2 cullingHelper;              // Index:   24.xy             Components:     2
//   float cameraNearPlane;             // Index:   24.z              Components:     1
//   float cameraFarPlane;              // Index:   24.w              Components:     1 [unused]
//   float4 viewFrustum[6];             // Index:   25-30             Components:    24 [unused]
//   float4 clipplane;                  // Index:   31.xyzw           Components:     4 [unused]
//
// }
//
// cbuffer EnvironmentInfo
// {
//
//   uint timeMillisecond;              // Index:    0.x              Components:     1 [unused]
//   uint frameCount;                   // Index:    0.y              Components:     1 [unused]
//   uint isOddFrame;                   // Index:    0.z              Components:     1
//   uint reserveEnvironmentInfo;       // Index:    0.w              Components:     1 [unused]
//   row_major float4x4 userGlobalParams;// Index:    1 2 3 4          Components:    16 [unused]
//   float breakingPBRSpecularIntensity;// Index:    5.x              Components:     1
//   float breakingPBRIBLReflectanceBias;// Index:    5.y              Components:     1 [unused]
//   float breakingPBRIBLIntensity;     // Index:    5.z              Components:     1 [unused]
//   float breakingPBR_Reserved;        // Index:    5.w              Components:     1 [unused]
//
// }
//
// cbuffer CheckerBoardInfo
// {
//
//   float2 cbr;                        // Index:    0.xy             Components:     2 [unused]
//   float cbr_bias;                    // Index:    0.z              Components:     1 [unused]
//   float cbr_using;                   // Index:    0.w              Components:     1
//
// }
//
// cbuffer LightParameters
// {
//
//   struct LightParameter
//   {
//
//       float3 position;               // Index:    0
//       float boundingRadius;          // Index:    0.w
//       float3 direction;              // Index:    1
//       float falloff;                 // Index:    1.w
//       float4 attenuation;            // Index:    2
//       float3 color;                  // Index:    3
//       float tolerance;               // Index:    3.w
//       uint shadowIndex;              // Index:    4
//       uint iesId;                    // Index:    4.y
//       uint2 reserved;                // Index:    4.z
//
//   } LightParameterSRV[256];          // Index:    0-1279           Components:  5120
//
//   struct LightParameter
//   {
//
//       float3 position;               // Index: 1280
//       float boundingRadius;          // Index: 1280.w
//       float3 direction;              // Index: 1281
//       float falloff;                 // Index: 1281.w
//       float4 attenuation;            // Index: 1282
//       float3 color;                  // Index: 1283
//       float tolerance;               // Index: 1283.w
//       uint shadowIndex;              // Index: 1284
//       uint iesId;                    // Index: 1284.y
//       uint2 reserved;                // Index: 1284.z
//
//   } AreaLightParameterSRV[256];      // Index: 1280-2559           Components:  5120 [unused]
//
//   struct ShadowParameter
//   {
//
//       row_major float4x4 viewProjection;// Index: 2560
//       float variance;                // Index: 2564
//       uint arrayIndex;               // Index: 2564.y
//       uint mipIndex;                 // Index: 2564.z
//       float bias;                    // Index: 2564.w
//
//   } ShadowParameterSRV[128];         // Index: 2560-3199           Components:  2560
//
//   struct IBLCubemapArrayInfo2
//   {
//
//       row_major float3x4 obbTest;    // Index: 3200
//       float4 centerIndex;            // Index: 3203
//
//   } IBLCubemapArrayList2SRV[128];    // Index: 3200-3711           Components:  2048 [unused]
//
// }
//
// cbuffer ShadowSamplingRotation
// {
//
//   float4 ShadowSamplePoints[8];      // Index:    0-7              Components:    32
//
// }
//
// cbuffer DirectionalLightParameter
// {
//
//   float3 DL_Direction;               // Index:    0.xyz            Components:     3
//   uint DL_Enable;                    // Index:    0.w              Components:     1
//   float3 DL_Color;                   // Index:    1.xyz            Components:     3
//   float DL_MinAlpha;                 // Index:    1.w              Components:     1
//   row_major float4x4 DL_ViewProjection;// Index:    2 3 4 5          Components:    16
//   float DL_Variance;                 // Index:    6.x              Components:     1
//   uint DL_ArrayIndex;                // Index:    6.y              Components:     1
//   uint DL_MipIndex;                  // Index:    6.z              Components:     1 [unused]
//   float DL_Bias;                     // Index:    6.w              Components:     1
//   float3 Cascade_Translate1;         // Index:    7.xyz            Components:     3
//   float Cascade_Bias1;               // Index:    7.w              Components:     1 [unused]
//   float3 Cascade_Translate2;         // Index:    8.xyz            Components:     3
//   float Cascade_Bias2;               // Index:    8.w              Components:     1 [unused]
//   float3 Cascade_Translate3;         // Index:    9.xyz            Components:     3
//   float Cascade_Bias3;               // Index:    9.w              Components:     1 [unused]
//   float2 Cascade_Scale1;             // Index:   10.xy             Components:     2
//   float2 Cascade_Scale2;             // Index:   10.zw             Components:     2
//   float2 Cascade_Scale3;             // Index:   11.xy             Components:     2
//   uint SDSMEnable;                   // Index:   11.z              Components:     1 [unused]
//   uint SDSMDebugDraw;                // Index:   11.w              Components:     1
//   float4 CascadeDistance;            // Index:   12.xyzw           Components:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// PointClamp                        sampler      NA          NA    0        1
// BilinearClamp                     sampler      NA          NA    1        1
// ReadonlyDepth                     texture   float          2d    0        1
// LightCullingVolumeSRV             texture    uint          3d    1        1
// LightCullingListSRV               texture    byte         r/o    2        1
// BaseColorMetallicSRV              texture  float4          2d    3        1
// NormalXNormalYRoughnessMiscSRV    texture  float4          2d    4        1
// OcclusionVelocityXVelocityYSubSurfaceSRV    texture  float4          2d    5        1
// IESLightTableSRV                  texture   float     1darray    6        1
// ShadowMapSRV                      texture   float     2darray    7        1
// GIDSRV                            texture    uint          2d    8        1
// SceneInfo                         cbuffer      NA          NA    0        1
// EnvironmentInfo                   cbuffer      NA          NA    1        1
// CheckerBoardInfo                  cbuffer      NA          NA    2        1
// LightParameters                   cbuffer      NA          NA    3        1
// ShadowSamplingRotation            cbuffer      NA          NA    4        1
// DirectionalLightParameter         cbuffer      NA          NA    5        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
// SV_TARGET                1   xyzw        1   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed | enableMinimumPrecision
dcl_constantbuffer cb0[25], immediateIndexed
dcl_constantbuffer cb1[6], immediateIndexed
dcl_constantbuffer cb2[1], immediateIndexed
dcl_constantbuffer cb3[3200], dynamicIndexed
dcl_constantbuffer cb4[8], dynamicIndexed
dcl_constantbuffer cb5[12], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture3d (uint,uint,uint,uint) t1
dcl_resource_raw t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture1darray (float,float,float,float) t6
dcl_resource_texture2darray (float,float,float,float) t7
dcl_resource_texture2d (uint,uint,uint,uint) t8
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_temps 46
dcl_resource_texture2d (float,float,float,float) t125
dcl_resource_texture1d (float,float,float,float) t120
mov r0.x, -cb0[7].z
mov r0.y, -cb0[8].z
mov r0.z, -cb0[9].z
ftoi r1.xy, v0.xyxx
mov r1.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r2.z, r1.xyww, t0.yzxw
ld_indexable(texture2d)(float,float,float,float) r3.xyzw, r1.xyww, t3.wxyz
ld_indexable(texture2d)(float,float,float,float) r0.w, r1.xyww, t5.yzwx
ld_indexable(texture2d)(float,float,float,float) r1.xyzw, r1.xyzw, t4.xyzw
max r1.z, r1.z, l(0.010000)
mad r4.xy, r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
add r1.x, -|r4.x|, l(1.000000)
add r4.z, -|r4.y|, r1.x
lt r1.x, r4.z, l(0.000000)
if_nz r1.x
  add r1.xy, -|r4.yxyy|, l(1.000000, 1.000000, 0.000000, 0.000000)
  ge r5.xy, r4.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
  movc r4.xy, r5.xyxx, r1.xyxx, -r1.xyxx
endif
dp3 r1.x, r4.xyzx, r4.xyzx
rsq r1.x, r1.x
mul r4.xyz, r1.xxxx, r4.xzyx
mul r1.x, r1.z, r1.z
lt r1.y, l(0.666666), r1.w
if_nz r1.y
  min r1.y, r3.x, l(0.080000)
  mov r1.z, l(0)
else
  mul r5.xy, r3.xxxx, l(16.000000, 15.937500, 0.000000, 0.000000)
  round_ni r1.w, r5.x
  mul_sat r1.z, r1.w, l(0.0666666701)
  ge r1.w, r5.y, -r5.y
  frc r2.w, |r5.y|
  movc r1.w, r1.w, r2.w, -r2.w
  mul r1.y, r1.w, l(0.0906666741)
  mov r3.x, l(0)
endif
ne r1.w, cb2[0].w, l(0.000000)
if_nz r1.w
  ftoi r1.w, v0.y
  iadd r1.w, r1.w, cb1[0].z
  and r1.w, r1.w, l(1)
  utof r5.z, r1.w
  mov r5.x, l(2.000000)
else
  mov r5.xz, l(1.000000,0,0,0)
endif
mul r6.xyzw, v0.xyxy, cb0[23].zwzw

mad r6.xy, r6.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
ld_indexable(texture2d)(float,float,float,float) r41.xyzw, l(0, 0, 0, 0), t125.xyzw
mul r42.xyzw, r6.yyyy, cb0[15].xyzw
mad r42.xyzw, r6.xxxx, cb0[14].xyzw, r42.xyzw
mad r42.xyzw, r2.zzzz, cb0[16].xyzw, r42.xyzw
add r42.xyzw, r42.xyzw, cb0[17].xyzw
add r6.x, -r41.x, r6.x
mul r43.xyzw, r6.yyyy, cb0[15].xyzw
mad r43.xyzw, r6.xxxx, cb0[14].xyzw, r43.xyzw
mad r43.xyzw, r2.zzzz, cb0[16].xyzw, r43.xyzw
add r43.xyzw, r43.xyzw, cb0[17].xyzw
mul r44.w, r41.x, r41.y
mad r6.x, r44.w, r42.w, r6.x

mul r7.xyzw, r6.yyyy, cb0[15].xyzw
mad r7.xyzw, r6.xxxx, cb0[14].xyzw, r7.xyzw

//Random comment.
mad r7.xyzw, r2.zzzz, cb0[16].xyzw, r7.xyzw
add r7.xyzw, r7.xyzw, cb0[17].xyzw
rcp r1.w, r7.w

rcp r45.w, r43.w
mul r8.xyz, r1.wwww, r7.xyzx
mov r9.x, -cb0[7].w
mov r9.y, -cb0[8].w
mov r9.z, -cb0[9].w

mad r9.xyz, r43.xyzx, r45.wwww, r9.xyzx
dp3 r2.w, r9.xyzx, r9.xyzx
rsq r2.w, r2.w
mul r10.xyz, r2.wwww, r9.xyzx
mov r5.yw, l(0,1.000000,0,0)
mad r2.xy, v0.xyxx, r5.xyxx, r5.zwzz
ftou r5.xy, v0.xyxx
mov r5.zw, l(0,0,0,0)
ld_indexable(texture2d)(uint,uint,uint,uint) r2.w, r5.xyzw, t8.yzwx
bfi r4.w, l(11), l(4), r2.w, l(0)
f16tof32 r5.x, r4.w
ushr r6.xy, r2.wwww, l(11, 22, 0, 0)
bfi r2.w, l(11), l(4), r6.x, l(0)
f16tof32 r5.y, r2.w
ishl r2.w, r6.y, l(5)
f16tof32 r5.z, r2.w
mul r5.xyz, r5.xyzx, l(3.14159274, 3.14159274, 3.14159274, 0.000000)
add r2.w, -r3.x, l(1.000000)
mul r5.xyz, r2.wwww, r5.xyzx
dp2 r4.w, r2.xyxx, l(0.0671105608, 0.00583714992, 0.000000, 0.000000)
frc r4.w, r4.w
mul r4.w, r4.w, l(52.982918)
frc r4.w, r4.w
mul r5.w, r4.w, l(6.28318548)
sincos r6.x, r11.x, r5.w
if_nz cb5[0].w
  dp3_sat r5.w, r4.xyzx, cb5[0].xyzx
  add r6.y, -r5.w, l(0.250000)
  mad r6.y, r1.z, r6.y, r5.w
  lt r7.w, l(0.000000), r5.w
  if_nz r7.w
    max r7.w, r1.x, cb5[1].w
    mul r8.w, r7.w, r7.w
    dp3 r9.w, cb5[0].xyzx, -r10.xyzx
    mad r9.w, r9.w, l(2.000000), l(2.000000)
    max r9.w, r9.w, l(0.000100)
    rsq r10.w, r9.w
    mul r9.w, r9.w, r10.w
    dp3_sat r11.y, r4.xyzx, -r10.xyzx
    add r11.z, r5.w, r11.y
    mul r10.w, r10.w, r11.z
    mad r9.w, -r9.w, l(0.500000), l(1.000000)
    mul r11.w, r9.w, r9.w
    mul r11.w, r11.w, r11.w
    mul r9.w, r9.w, r11.w
    mul r10.w, r10.w, r10.w
    mad r11.w, r7.w, r7.w, l(-1.000000)
    mad r10.w, r10.w, r11.w, l(1.000000)
    dp2 r11.w, r5.wwww, r11.yyyy
    add r11.z, -r11.w, r11.z
    mad r7.w, r7.w, r11.z, r11.w
    mul r10.w, r10.w, r10.w
    dp2 r7.w, r10.wwww, r7.wwww
    rcp r7.w, r7.w
    mul r7.w, r7.w, r8.w
    lt r8.w, l(0.000000), r11.y
    and r12.x, r7.w, r8.w
    mul r12.y, r9.w, r12.x
    mul r11.yz, r5.wwww, r12.xxyx
  else
    mov r11.yz, l(0,0,0,0)
  endif
  lt r5.w, l(0.000000), r6.y
  if_nz r5.w
    mul r12.xyz, r8.yyyy, cb5[3].xyzx
    mad r12.xyz, r8.xxxx, cb5[2].xyzx, r12.xyzx
    mad r12.xyz, r8.zzzz, cb5[4].xyzx, r12.xyzx
    add r12.xyz, r12.xyzx, cb5[5].xyzx
    add r13.xy, r12.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
    max r5.w, |r13.y|, |r13.x|
    lt r5.w, r5.w, l(0.500000)
    if_nz r5.w
      mad r13.xy, r12.xyxx, cb5[7].zzzz, cb5[7].xyxx
      mul r14.z, cb5[6].x, cb5[10].y
      mad r13.w, cb5[6].w, cb5[10].x, r12.z
      add r13.z, r12.z, cb5[6].w
      mov r7.w, cb5[6].y
      mov r14.x, cb5[6].x
      mov r8.w, l(0)
    else
      mad r14.yw, r12.xxxy, cb5[7].zzzz, cb5[7].xxxy
      add r15.xy, r14.ywyy, l(-0.500000, -0.500000, 0.000000, 0.000000)
      max r9.w, |r15.y|, |r15.x|
      lt r9.w, r9.w, l(0.500000)
      if_nz r9.w
        mad r13.xy, r12.xyxx, cb5[8].zzzz, cb5[8].xyxx
        mul r14.xz, cb5[6].xxxx, cb5[10].yywy
        mad r13.zw, cb5[6].wwww, cb5[10].xxxz, r12.zzzz
        iadd r7.w, cb5[6].y, l(1)
        mov r12.xy, r14.ywyy
        mov r8.w, l(0)
      else
        mad r14.yw, r12.xxxy, cb5[8].zzzz, cb5[8].xxxy
        add r15.xy, r14.ywyy, l(-0.500000, -0.500000, 0.000000, 0.000000)
        max r9.w, |r15.y|, |r15.x|
        lt r9.w, r9.w, l(0.500000)
        if_nz r9.w
          mad r13.xy, r12.xyxx, cb5[9].zzzz, cb5[9].xyxx
          mul r14.z, cb5[6].x, cb5[11].y
          mad r13.w, cb5[6].w, cb5[11].x, r12.z
          mul r14.x, cb5[6].x, cb5[10].w
          mad r13.z, cb5[6].w, cb5[10].z, r12.z
          iadd r7.w, cb5[6].y, l(2)
          mov r12.xy, r14.ywyy
          mov r8.w, l(0)
        else
          mad r14.yw, r12.xxxy, cb5[9].zzzz, cb5[9].xxxy
          add r15.xy, r14.ywyy, l(-0.500000, -0.500000, 0.000000, 0.000000)
          max r9.w, |r15.y|, |r15.x|
          lt r9.w, r9.w, l(0.500000)
          not r8.w, r9.w
          if_nz r9.w
            mul r14.x, cb5[6].x, cb5[11].y
            mad r13.z, cb5[6].w, cb5[11].x, r12.z
            iadd r7.w, cb5[6].y, l(3)
            mov r12.xy, r14.ywyy
          else
            mov r5.w, l(1.000000)
            mov r7.w, cb5[6].y
            mov r14.x, cb5[6].x
          endif
          mov r13.xyw, l(0,0,0,0)
          mov r14.z, l(0)
        endif
      endif
    endif
    if_z r8.w
      itof r15.z, r7.w
      mov r16.xz, r6.xxxx
      mov r16.yw, r11.xxxx
      mov r8.w, l(0)
      mov r9.w, l(0)
      loop
        uge r10.w, r9.w, l(8)
        breakc_nz r10.w
        dp2 r17.x, cb4[r9.w + 0].xyxx, r16.xyxx
        mul r10.w, r11.x, cb4[r9.w + 0].x
        mad r17.y, cb4[r9.w + 0].y, r6.x, -r10.w
        mad r15.xy, r17.xyxx, r14.xxxx, r12.xyxx
        add r12.zw, r15.xxxy, l(0.000000, 0.000000, -0.500000, -0.500000)
        max r10.w, |r12.w|, |r12.z|
        lt r10.w, l(0.500000), r10.w
        if_nz r10.w
          break
        endif
        sample_l_indexable(texture2darray)(float,float,float,float) r10.w, r15.xyzx, t7.yzwx, s0, l(0.000000)
        lt r10.w, r10.w, r13.z
        and r10.w, r10.w, l(0x3f800000)
        add r8.w, r8.w, r10.w
        iadd r9.w, r9.w, l(1)
      endloop
      iadd r7.w, r7.w, l(1)
      itof r12.z, r7.w
      mov r7.w, r8.w
      mov r10.w, r9.w
      loop
        uge r11.w, r10.w, l(8)
        breakc_nz r11.w
        dp2 r14.x, cb4[r10.w + 0].xyxx, r16.zwzz
        mul r11.w, r11.x, cb4[r10.w + 0].x
        mad r14.y, cb4[r10.w + 0].y, r6.x, -r11.w
        mad r12.xy, r14.xyxx, r14.zzzz, r13.xyxx
        sample_l_indexable(texture2darray)(float,float,float,float) r11.w, r12.xyzx, t7.yzwx, s0, l(0.000000)
        lt r11.w, r11.w, r13.w
        and r11.w, r11.w, l(0x3f800000)
        add r7.w, r7.w, r11.w
        iadd r10.w, r10.w, l(1)
      endloop
      mul r5.w, r7.w, l(0.125000)
    endif
    add r7.w, -cb5[11].w, l(1.000000)
    lt r8.w, l(0.000000), r5.w
    lt r9.w, l(0.000000), r7.w
    and r8.w, r8.w, r9.w
    if_nz r8.w
      mul r12.xyz, r7.wwww, cb5[0].xyzx
      mul r7.w, r7.w, l(-0.100000)
      dp3 r8.w, r0.xyzx, r12.xyzx
      min r7.w, r7.w, |r8.w|
      lt r9.w, r8.w, l(0.000000)
      if_nz r9.w
        dp3 r9.w, r0.xyzx, r9.xyzx
        add r9.w, -r9.w, cb0[24].z
        div_sat r8.w, r9.w, r8.w
      else
        mov r8.w, l(1.000000)
      endif
      mad r12.xyz, r12.xyzx, r8.wwww, r8.xyzx
      mul r13.xyzw, r12.yyyy, cb0[1].xyzw
      mad r13.xyzw, r12.xxxx, cb0[0].xyzw, r13.xyzw
      mad r12.xyzw, r12.zzzz, cb0[2].xyzw, r13.xyzw
      add r12.xyzw, r12.xyzw, cb0[3].xyzw

ld_indexable(texture2d)(float,float,float,float) r34.xyzw, l(0, 0, 0, 0), t125.xyzw
add r35.x, r12.w, -r34.y
mad r12.x, r34.x, r35.x, r12.x
      div r12.xyz, r12.xyzx, r12.wwww

      mad r13.xy, r12.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
      mul r12.xy, r13.xyxx, cb0[23].xyxx
      add r12.xyz, -r2.xyzx, r12.xyzx
      max r8.w, |r12.y|, |r12.x|
      lt r9.w, r8.w, l(1.000000)
      if_nz r9.w
        mov r10.w, l(1.000000)
      endif
      if_z r9.w
        mul r8.w, r8.w, l(0.750000)
        min r8.w, r8.w, l(10.000000)
        div r12.xyz, r12.xyzx, r8.wwww
        add r9.w, r4.w, l(0.250000)
        mad r13.xyz, r12.xyzx, r9.wwww, r2.xyzx
        mul r9.w, r7.w, l(0.010000)
        mov r14.zw, l(0,0,0,0)
        mov r15.xyz, r13.xyzx
        mov r10.w, l(1.000000)
        mov r11.w, l(0)
        loop
          ge r12.w, r11.w, r8.w
          breakc_nz r12.w
          ftoi r14.xy, r15.xyxx
          ld_indexable(texture2d)(float,float,float,float) r12.w, r14.xyzw, t0.yzwx
          ne r13.w, r2.z, r12.w
          if_nz r13.w
            mad r12.w, -r12.w, cb0[22].y, cb0[22].x
            div r12.w, cb0[22].z, r12.w
            mad r13.w, -r15.z, cb0[22].y, cb0[22].x
            div r13.w, cb0[22].z, r13.w
            add r12.w, r12.w, -r13.w
            lt r13.w, r12.w, r9.w
            lt r12.w, r7.w, r12.w
            and r12.w, r12.w, r13.w
            if_nz r12.w
              mov r10.w, l(0)
              break
            endif
          endif
          add r15.xyz, r12.xyzx, r15.xyzx
          add r11.w, r11.w, l(1.000000)
          mov r10.w, l(1.000000)
        endloop
      endif
      min r5.w, r5.w, r10.w
    endif
    mul r6.y, r5.w, r6.y
    mul r11.yz, r5.wwww, r11.yyzy
    mul r5.w, r2.w, r6.y
    mul r18.xyz {min16f}, r3.yzwy {def32 as min16f}, r3.xxxx {def32 as min16f}
    max r18.xyz {min16f}, r1.yyyy {def32 as min16f}, r18.xyzx {min16f}
    mad r5.xyz, cb5[1].xyzx, r5.wwww, r5.xyzx
    add r12.xyz, -r18.xyzx {min16f as def32}, l(1.000000, 1.000000, 1.000000, 0.000000)
    mul r12.xyz, r11.zzzz, r12.xyzx
    mad r11.yzw, r18.xxyz {min16f as def32}, r11.yyyy, r12.xxyz
    mul r11.yzw, r11.yyzw, cb5[1].xxyz
  else
    mov r11.yzw, l(0,0,0,0)
  endif
else
  mov r11.yzw, l(0,0,0,0)
endif

mad_sat r5.w, r1.y, l(125.000000), l(-0.250000)

mul r5.w, r5.w, cb1[5].x
mul r5.w, r5.w, l(0.318309873)
mad r6.y, -r2.z, cb0[22].y, cb0[22].x
div r6.y, cb0[22].z, r6.y
mul r6.y, r6.y, cb0[24].x
log r6.y, r6.y
mul r6.y, r6.y, cb0[24].y


ld_indexable(texture2d)(float,float,float,float) r27.xyzw, l(0, 0, 0, 0), t125.xyzw
mad r6.z, -r27.x, l(0.5), r6.z
mul r28.x, r27.y, l(-0.5)
mul r28.x, r28.x, r5.w
mad r6.z, -r27.x, r28.x, r6.z
mul r6.yzw, r6.yyzw, l(0.000000, 32.000000, 32.000000, 16.000000)

ftou r12.xyz, r6.zwyz
mov r12.w, l(0)
ld_indexable(texture3d)(uint,uint,uint,uint) r6.y, r12.xyzw, t1.yxzw
and r6.z, r6.y, l(255)
ushr r6.y, r6.y, l(6)
and r6.y, r6.y, l(0x03fffffc)
dp3_sat r6.w, r4.xyzx, -r10.xyzx
add r7.w, r6.w, r6.w
lt r8.w, l(0.000000), r6.w
mul r18.xyz {min16f}, r3.yzwy {def32 as min16f}, r3.xxxx {def32 as min16f}
max r18.xyz {min16f}, r1.yyyy {def32 as min16f}, r18.xyzx {min16f}
dp3 r1.y, r0.xyzx, r9.xyzx
mul r3.x, r6.x, r11.x
mad r3.x, -|r3.x|, l(0.200000), l(1.000000)
add r1.y, -r1.y, cb0[24].z
mov r2.xy, v0.xyxx
add r3.y, r4.w, l(0.250000)
add r9.xyz, -r18.xyzx {min16f as def32}, l(1.000000, 1.000000, 1.000000, 0.000000)
mov r12.zw, l(0,0,0,0)
mov r13.xz, r6.xxxx
mov r13.yw, r11.xxxx
mov r14.x, r13.x
mov r14.y, r11.x
mov r15.xyz, r5.xyzx
mov r16.xyz, r11.yzwy
mov r3.z, r6.z
loop
  breakc_z r3.z
  firstbit_lo r3.w, r3.z
  ishl r4.w, l(1), r3.w
  not r4.w, r4.w
  and r3.z, r3.z, r4.w
  ishl r14.zw, r3.wwww, l(0, 0, 2, 5)
  iadd r3.w, r6.y, r14.z
  ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r3.w, r3.w, t2.xxxx
  mov r17.xyz, r15.xyzx
  mov r19.xyz, r16.xyzx
  mov r4.w, r3.w
  loop
    breakc_z r4.w
    firstbit_lo r6.x, r4.w
    iadd r9.w, r6.x, r14.w
    ishl r6.x, l(1), r6.x
    not r6.x, r6.x
    and r6.x, r4.w, r6.x
    imul null, r9.w, r9.w, l(5)
    mad r20.xyz, -r7.xyzx, r1.wwww, cb3[r9.w + 0].xyzx
    dp3 r10.w, r20.xyzx, r20.xyzx
    mul r14.z, cb3[r9.w + 0].w, cb3[r9.w + 0].w
    lt r14.z, r14.z, r10.w
    if_nz r14.z
      mov r4.w, r6.x
      continue
    endif
    rsq r14.z, r10.w
    mul r10.w, r10.w, r14.z
    mul r21.xyz, r14.zzzz, r20.xyzx
    dp3 r15.w, r21.xyzx, cb3[r9.w + 1].xyzx
    mad r22.x, r15.w, l(0.500000), l(0.500000)
    ieq r15.w, l(-1), cb3[r9.w + 4].y
    utof r22.y, cb3[r9.w + 4].y
    sample_l_indexable(texture1darray)(float,float,float,float) r16.w, r22.xyxx, t6.yzwx, s1, l(0.000000)
    movc r15.w, r15.w, l(1.000000), r16.w
    mad r16.w, r10.w, cb3[r9.w + 2].x, l(1.000000)
    mul r16.w, r16.w, r16.w
    rcp r16.w, r16.w
    add_sat r16.w, r16.w, -cb3[r9.w + 3].w
    add r17.w, l(1.000000), -cb3[r9.w + 3].w
    iadd r17.w, -r17.w, l(0x7eef370b)
    mul r16.w, r16.w, r17.w
    dp3 r17.w, -cb3[r9.w + 1].xyzx, r21.xyzx
    mad_sat r17.w, r17.w, cb3[r9.w + 2].w, cb3[r9.w + 2].z
    div r19.w, l(1.000000, 1.000000, 1.000000, 1.000000), cb3[r9.w + 1].w
    mul_sat r17.w, r17.w, r19.w
    mad r19.w, r17.w, l(-2.000000), l(3.000000)
    mul r17.w, r17.w, r17.w
    mul r17.w, r17.w, r19.w
    mul_sat r16.w, r16.w, r17.w
    mul r15.w, r15.w, r16.w
    lt r16.w, l(0.000000), r15.w
    if_nz r16.w
      dp3_sat r16.w, r4.xyzx, r21.xyzx
      add r17.w, -r16.w, l(0.250000)
      mad r17.w, r1.z, r17.w, r16.w
      mul r17.w, r15.w, r17.w
      mul r15.w, r15.w, r16.w
      max r19.w, r1.x, cb3[r9.w + 2].y
      mul r20.w, r19.w, r19.w
      dp3 r21.x, r21.xyzx, -r10.xyzx
      mad r21.x, r21.x, l(2.000000), l(2.000000)
      max r21.x, r21.x, l(0.000100)
      rsq r21.y, r21.x
      mul r21.x, r21.y, r21.x
      add r21.z, r6.w, r16.w
      mad r21.x, -r21.x, l(0.500000), l(1.000000)
      mul r21.yw, r21.yyyx, r21.zzzx
      mul r21.w, r21.w, r21.w
      mul r21.xy, r21.wyww, r21.xyxx
      mad r21.w, r19.w, r19.w, l(-1.000000)
      mad r21.y, r21.y, r21.w, l(1.000000)
      mul r21.w, r7.w, r16.w
      mad r16.w, -r7.w, r16.w, r21.z
      mad r16.w, r19.w, r16.w, r21.w
      mul r19.w, r21.y, r21.y
      dp2 r16.w, r19.wwww, r16.wwww
      rcp r16.w, r16.w
      mul r16.w, r16.w, r20.w
      and r22.x, r8.w, r16.w
      mul r22.y, r21.x, r22.x
      mul r21.xy, r15.wwww, r22.xyxx
    else
      mov r21.xy, l(0,0,0,0)
      mov r17.w, l(0)
    endif
    ge r15.w, l(0.000000), r17.w
    if_nz r15.w
      mov r4.w, r6.x
      continue
    endif
    ult r15.w, cb3[r9.w + 4].x, l(256)
    if_nz r15.w
      if_z cb3[r9.w + 4].z
        imul null, r15.w, l(5), cb3[r9.w + 4].x
        mul r22.xyzw, r8.yyyy, cb3[r15.w + 2561].xyzw
        mad r22.xyzw, r8.xxxx, cb3[r15.w + 2560].xyzw, r22.xyzw
        mad r22.xyzw, r8.zzzz, cb3[r15.w + 2562].xyzw, r22.xyzw
        add r22.xyzw, r22.xyzw, cb3[r15.w + 2563].xyzw
        div r22.xyz, r22.xyzx, r22.wwww
        add r16.w, r22.z, cb3[r15.w + 2564].w
        mad r21.zw, r22.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
        lt r21.zw, l(0.000000, 0.000000, 1.000000, 1.000000), |r21.zzzw|
        or r19.w, r21.w, r21.z
        lt r20.w, r22.w, l(0.000000)
        or r19.w, r19.w, r20.w
        lt r20.w, r16.w, l(0.000000)
        or r19.w, r19.w, r20.w
        if_nz r19.w
          mov r20.w, l(1.000000)
        endif
        if_z r19.w
          utof r23.z, cb3[r15.w + 2564].y
          mov r19.w, l(0)
          mov r21.z, l(0)
          loop
            uge r21.w, r21.z, l(8)
            breakc_nz r21.w
            mul r22.zw, cb3[r15.w + 2564].xxxx, cb4[r21.z + 0].xxxy
            dp2 r24.x, r22.zwzz, r13.xyxx
            mul r21.w, r11.x, r22.z
            mad r24.y, r22.w, r13.x, -r21.w
            add r23.xy, r22.xyxx, r24.xyxx
            sample_l_indexable(texture2darray)(float,float,float,float) r21.w, r23.xyzx, t7.yzwx, s0, l(0.000000)
            lt r21.w, r21.w, r16.w
            and r21.w, r21.w, l(0x3f800000)
            add r19.w, r19.w, r21.w
            iadd r21.z, r21.z, l(1)
          endloop
          mul r20.w, r19.w, l(0.125000)
        endif
      else
        ieq r15.w, l(1), cb3[r9.w + 4].z
        if_nz r15.w
          imul null, r15.w, l(5), cb3[r9.w + 4].x
          mad r22.xyz, r7.xyzx, r1.wwww, -cb3[r9.w + 0].xyzx
          max r16.w, |r22.y|, |r22.x|
          max r16.w, |r22.z|, r16.w
          ge r21.zw, |r22.zzzz|, |r22.xxxy|
          and r21.z, r21.w, r21.z
          if_nz r21.z
            lt r21.w, r22.z, l(0.000000)
            movc r21.w, r21.w, l(5.000000), l(4.000000)
          endif
          if_z r21.z
            ge r21.z, |r22.y|, |r22.x|
            if_nz r21.z
              lt r22.w, r22.y, l(0.000000)
              movc r21.w, r22.w, l(3.000000), l(2.000000)
            endif
            if_z r21.z
              lt r21.z, r22.x, l(0.000000)
              and r21.w, r21.z, l(0x3f800000)
            endif
          endif
          ftoi r21.z, r21.w
          ishr r21.w, r21.z, l(1)
          ieq r22.w, r21.w, l(1)
          movc r22.xw, r22.wwww, r22.zzzx, r22.xxxy
          movc r22.xy, r21.wwww, r22.xwxx, r22.yzyy
          and r21.w, r21.z, l(1)
          movc r22.xy, r21.wwww, r22.xyxx, r22.yxyy
          mul r22.zw, -r16.wwww, cb3[r15.w + 2562].xxxy
          mad r23.x, cb3[r15.w + 2560].x, r22.x, r22.z
          mad r23.y, cb3[r15.w + 2561].y, r22.y, r22.w
          mad r23.zw, -r16.wwww, cb3[r15.w + 2562].zzzw, cb3[r15.w + 2563].zzzw
          div r22.xyz, r23.xyzx, r23.wwww
          add r16.w, r22.z, cb3[r15.w + 2564].w
          lt r21.w, l(1.000000), r16.w
          if_nz r21.w
            mov r20.w, l(1.000000)
          endif
          if_z r21.w
            iadd r21.z, r21.z, cb3[r15.w + 2564].y
            itof r23.z, r21.z
            mov r21.zw, l(0,0,0,0)
            loop
              uge r22.z, r21.w, l(8)
              breakc_nz r22.z
              mul r22.zw, cb3[r15.w + 2564].xxxx, cb4[r21.w + 0].xxxy
              dp2 r24.x, r22.zwzz, r13.zwzz
              mul r22.z, r11.x, r22.z
              mad r24.y, r22.w, r13.x, -r22.z
              add r23.xy, r22.xyxx, r24.xyxx
              sample_l_indexable(texture2darray)(float,float,float,float) r22.z, r23.xyzx, t7.yzxw, s0, l(0.000000)
              lt r22.z, r22.z, r16.w
              and r22.z, r22.z, l(0x3f800000)
              add r21.z, r21.z, r22.z
              iadd r21.w, r21.w, l(1)
            endloop
            mul r20.w, r21.z, l(0.125000)
          endif
        else
          ieq r15.w, l(3), cb3[r9.w + 4].z
          if_nz r15.w
            imul null, r15.w, l(5), cb3[r9.w + 4].x
            imad r16.w, cb3[r9.w + 4].x, l(5), l(5)
            mul r22.xyzw, r8.yyyy, cb3[r16.w + 2561].xyzw
            mad r22.xyzw, r8.xxxx, cb3[r16.w + 2560].xyzw, r22.xyzw
            mad r22.xyzw, r8.zzzz, cb3[r16.w + 2562].xyzw, r22.xyzw
            add r22.xyzw, r22.wxyz, cb3[r16.w + 2563].wxyz
            div r23.xyz, r22.yzwy, r22.xxxx
            mad r24.xy, r23.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
            max r21.w, |r24.y|, |r24.x|
            lt r21.w, r3.x, r21.w
            if_nz r21.w
              mul r24.xyzw, r8.yyyy, cb3[r15.w + 2561].xyzw
              mad r24.xyzw, r8.xxxx, cb3[r15.w + 2560].xyzw, r24.xyzw
              mad r24.xyzw, r8.zzzz, cb3[r15.w + 2562].xyzw, r24.xyzw
              add r22.xyzw, r24.wxyz, cb3[r15.w + 2563].wxyz
              div r23.xyz, r22.yzwy, r22.xxxx
              mov r15.w, cb3[r15.w + 2564].y
            else
              mov r15.w, cb3[r16.w + 2564].y
            endif
            add r21.w, r23.z, cb3[r16.w + 2564].w
            mad r22.yz, r23.xxyx, l(0.000000, 2.000000, 2.000000, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
            max r22.y, |r22.z|, |r22.y|
            lt r22.y, l(1.000000), r22.y
            lt r22.x, r22.x, l(0.000000)
            or r22.x, r22.x, r22.y
            lt r22.y, r21.w, l(0.000000)
            or r22.x, r22.y, r22.x
            if_nz r22.x
              mov r20.w, l(1.000000)
            endif
            if_z r22.x
              utof r22.z, r15.w
              mov r15.w, l(0)
              mov r22.w, l(0)
              loop
                uge r23.z, r22.w, l(8)
                breakc_nz r23.z
                mul r23.zw, cb3[r16.w + 2564].xxxx, cb4[r22.w + 0].xxxy
                dp2 r24.x, r23.zwzz, r14.xyxx
                mul r23.z, r11.x, r23.z
                mad r24.y, r23.w, r13.x, -r23.z
                add r22.xy, r23.xyxx, r24.xyxx
                sample_l_indexable(texture2darray)(float,float,float,float) r22.x, r22.xyzx, t7.xyzw, s0, l(0.000000)
                lt r22.x, r22.x, r21.w
                and r22.x, r22.x, l(0x3f800000)
                add r15.w, r15.w, r22.x
                iadd r22.w, r22.w, l(1)
              endloop
              mul r20.w, r15.w, l(0.125000)
            endif
          else
            mov r20.w, l(1.000000)
          endif
        endif
      endif
      add r16.w, l(1.000000), -cb3[r9.w + 4].w
      lt r21.w, l(0.000000), r16.w
      lt r22.x, l(0.000000), r20.w
      and r21.w, r21.w, r22.x
      if_nz r21.w
        min r10.w, r10.w, r16.w
        mul r10.w, r10.w, r14.z
        mul r20.xyz, r10.wwww, r20.xyzx
        mul r10.w, r16.w, l(-0.100000)
        dp3 r14.z, r0.xyzx, r20.xyzx
        min r10.w, r10.w, |r14.z|
        lt r16.w, r14.z, l(0.000000)
        if_nz r16.w
          div_sat r14.z, r1.y, r14.z
        else
          mov r14.z, l(1.000000)
        endif
        mad r20.xyz, r20.xyzx, r14.zzzz, r8.xyzx
        
mul r22.xyzw, r20.yyyy, cb0[1].xyzw
        mad r22.xyzw, r20.xxxx, cb0[0].xyzw, r22.xyzw
        mad r22.xyzw, r20.zzzz, cb0[2].xyzw, r22.xyzw
        add r22.xyzw, r22.xyzw, cb0[3].xyzw

ld_indexable(texture2d)(float,float,float,float) r34.xyzw, l(0, 0, 0, 0), t125.xyzw
add r36.x, r22.w, -r34.y
mad r22.x, r34.x, r36.x, r22.x
        div r20.xyz, r22.xyzx, r22.wwww

        mad r22.xy, r20.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
        mul r20.xy, r22.xyxx, cb0[23].xyxx
        add r20.xyz, -r2.xyzx, r20.xyzx
        max r14.z, |r20.y|, |r20.x|
        lt r16.w, r14.z, l(1.000000)
        if_nz r16.w
          mov r21.w, l(1.000000)
        endif
        if_z r16.w
          mul r14.z, r14.z, l(0.750000)
          min r14.z, r14.z, l(10.000000)
          div r20.xyz, r20.xyzx, r14.zzzz
          mad r22.xyz, r20.xyzx, r3.yyyy, r2.xyzx
          mul r16.w, r10.w, l(0.010000)
          mov r23.xyz, r22.xyzx
          mov r21.w, l(1.000000)
          mov r22.w, l(0)
          loop
            ge r23.w, r22.w, r14.z
            breakc_nz r23.w
            ftoi r12.xy, r23.xyxx
            ld_indexable(texture2d)(float,float,float,float) r12.x, r12.xyzw, t0.xyzw
            ne r12.y, r2.z, r12.x
            if_nz r12.y
              mad r12.x, -r12.x, cb0[22].y, cb0[22].x
              mad r12.y, -r23.z, cb0[22].y, cb0[22].x
              div r12.xy, cb0[22].zzzz, r12.xyxx
              add r12.x, -r12.y, r12.x
              lt r12.y, r12.x, r16.w
              lt r12.x, r10.w, r12.x
              and r12.x, r12.x, r12.y
              if_nz r12.x
                mov r21.w, l(0)
                break
              endif
            endif
            add r23.xyz, r20.xyzx, r23.xyzx
            add r22.w, r22.w, l(1.000000)
            mov r21.w, l(1.000000)
          endloop
        endif
        min r20.w, r20.w, r21.w
      endif
      mul r20.xyz, r20.wwww, cb3[r9.w + 3].xyzx
    else
      add_sat r10.w, r0.w, cb3[r9.w + 4].w
      mul r20.xyz, r10.wwww, cb3[r9.w + 3].xyzx
    endif
    mul r9.w, r2.w, r17.w
    mad r17.xyz, r20.xyzx, r9.wwww, r17.xyzx
    mul r22.xyz, r9.xyzx, r21.yyyy
    mad r22.xyz, r18.xyzx {min16f as def32}, r21.xxxx, r22.xyzx
    mad r19.xyz, r20.xyzx, r22.xyzx, r19.xyzx
    mov r4.w, r6.x
  endloop
  mov r15.xyz, r17.xyzx
  mov r16.xyz, r19.xyzx
endloop
mul r0.xyz, r5.wwww, r16.xyzx
mul r1.xyz, r15.xyzx, l(0.318309873, 0.318309873, 0.318309873, 0.000000)
max r1.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
min o1.xyz, r1.xyzx, l(65536.000000, 65536.000000, 65536.000000, 0.000000)
max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
min o0.xyz, r0.xyzx, l(65536.000000, 65536.000000, 65536.000000, 0.000000)
mov o0.w, l(0)
mov o1.w, l(0)
ret
// Approximately 691 instruction slots used
