// MANUALLY DUMPED [ShaderRegexDecalsMain2] Decals CS 8. More screen space reflections CS.
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.16 on Fri Jan 07 00:07:19 2022
//
//
// 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
//   float3 ZToLinear;                  // Index:   22.xyz            Components:     3 [unused]
//   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 [unused]
//   float cameraNearPlane;             // Index:   24.z              Components:     1 [unused]
//   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 [unused]
//   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 [unused]
//   float breakingPBRIBLReflectanceBias;// Index:    5.y              Components:     1
//   float breakingPBRIBLIntensity;     // Index:    5.z              Components:     1
//   float breakingPBR_Reserved;        // Index:    5.w              Components:     1 [unused]
//
// }
//
// cbuffer FogParam
// {
//
//   float3 fogInscatteringColor;       // Index:    0.xyz            Components:     3
//   float fogDensity;                  // Index:    0.w              Components:     1
//   float fogHeightFalloff;            // Index:    1.x              Components:     1
//   float fogMaxOpacity;               // Index:    1.y              Components:     1
//   float fogStartDistance;            // Index:    1.z              Components:     1
//   float fogHightStartDistance;       // Index:    1.w              Components:     1
//
// }
//
// cbuffer SSRControl
// {
//
//   float RoughnessLimit;              // Index:    0.x              Components:     1 [unused]
//   float DetailRoughnessLimit;        // Index:    0.y              Components:     1 [unused]
//   float TemporalBlendRate;           // Index:    0.z              Components:     1
//   float ColorClampRate;              // Index:    0.w              Components:     1
//
// }
//
// cbuffer CBResolve
// {
//
//   int2 offset0;                      // Index:    0.xy             Components:     2
//   int2 offset1;                      // Index:    0.zw             Components:     2
//   int2 offset2;                      // Index:    1.xy             Components:     2
//   int2 offset3;                      // Index:    1.zw             Components:     2
//   row_major float4x4 uvViewProjInvMat;// Index:    2 3 4 5          Components:    16
//   row_major float4x4 viewProjUVMat;  // Index:    6 7 8 9          Components:    16
//   float2 rep2UvScale;                // Index:   10.xy             Components:     2
//   float2 rep2UvOffset;               // Index:   10.zw             Components:     2
//   float2 screenToUVScale;            // Index:   11.xy             Components:     2
//   float2 screenToUVOffset;           // Index:   11.zw             Components:     2
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// BilinearClamp                     sampler      NA          NA    0        1
// TrilinearClamp                    sampler      NA          NA    1        1
// ReadonlyDepth                     texture   float          2d    0        1
// BaseColorMetallicSRV              texture  float4          2d    1        1
// NormalXNormalYRoughnessMiscSRV    texture  float4          2d    2        1
// AmbientBRDF                       texture  float2          2d    3        1
// GISSRV                            texture    uint          2d    4        1
// HDRImage                          texture  float3          2d    5        1
// PrevHDRImage                      texture    uint          2d    6        1
// SSRSRV                            texture  float4          2d    7        1
// DiffuseImageSRV                   texture  float4          2d    8        1
// GIRUAV                                UAV    uint          2d    0        1
// HDRImageUAV                           UAV  float3          2d    1        1
// SceneInfo                         cbuffer      NA          NA    0        1
// EnvironmentInfo                   cbuffer      NA          NA    1        1
// FogParam                          cbuffer      NA          NA    2        1
// SSRControl                        cbuffer      NA          NA    3        1
// CBResolve                         cbuffer      NA          NA    4        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 | enableMinimumPrecision
dcl_constantbuffer cb0[24], immediateIndexed
dcl_constantbuffer cb1[6], immediateIndexed
dcl_constantbuffer cb2[2], immediateIndexed
dcl_constantbuffer cb3[1], immediateIndexed
dcl_constantbuffer cb4[12], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (uint,uint,uint,uint) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (uint,uint,uint,uint) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2d (float,float,float,float) t8
dcl_uav_typed_texture2d (uint,uint,uint,uint) u0
dcl_uav_typed_texture2d (float,float,float,float) u1
dcl_input vThreadGroupID.xy
dcl_input vThreadIDInGroup.x
dcl_temps 44
dcl_tgsm_structured g0, 4, 784
dcl_tgsm_structured g1, 12, 256
dcl_tgsm_structured g2, 12, 257
dcl_thread_group 256, 1, 1
dcl_resource_texture2d (float,float,float,float) t125
dcl_resource_texture1d (float,float,float,float) t120
ubfe r0.xyzw, l(1, 1, 1, 1), l(1, 2, 3, 4), vThreadIDInGroup.xxxx
bfi r0.y, l(31), l(1), r0.y, vThreadIDInGroup.x
imad r0.x, r0.z, l(2), r0.x
ubfe r1.xy, l(1, 1, 0, 0), l(5, 6, 0, 0), vThreadIDInGroup.xxxx
imad r0.y, r0.w, l(4), r0.y
imad r0.x, r1.x, l(4), r0.x
ushr r0.z, vThreadIDInGroup.x, l(7)
imad r1.zw, r1.yyyy, l(0, 0, 8, 8), r0.yyyy
imad r1.xy, r0.zzzz, l(8, 8, 0, 0), r0.xxxx
imad r0.xy, vThreadGroupID.xyxx, l(16, 16, 0, 0), r1.wyww
mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(uint,uint,uint,uint) r2.x, r0.xyww, t4.xyzw
bfi r2.y, l(11), l(4), r2.x, l(0)
f16tof32 r3.x, r2.y
ushr r2.yz, r2.xxxx, l(0, 11, 22, 0)
bfi r2.y, l(11), l(4), r2.y, l(0)
f16tof32 r3.y, r2.y
ishl r2.y, r2.z, l(5)
f16tof32 r3.z, r2.y
ld_indexable(texture2d)(float,float,float,float) r2.y, r0.xyww, t0.yxzw
utof r2.zw, r0.xxxy
mul r4.xy, r2.zwzz, cb0[23].zwzz
mad r4.xy, r4.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) r22.xyzw, l(0, 0, 0, 0), t125.xyzw
mul r23.xyzw, r4.yyyy, cb0[15].xyzw
mad r23.xyzw, r4.xxxx, cb0[14].xyzw, r23.xyzw
mad r23.xyzw, r2.yyyy, cb0[16].xyzw, r23.xyzw
add r23.xyzw, r23.xyzw, cb0[17].xyzw
add r4.x, -r22.x, r4.x
mul r24.xyzw, r4.yyyy, cb0[15].xyzw
mad r24.xyzw, r4.xxxx, cb0[14].xyzw, r24.xyzw
mad r24.xyzw, r2.yyyy, cb0[16].xyzw, r24.xyzw
add r24.xyzw, r24.xyzw, cb0[17].xyzw
mul r25.w, r22.x, r22.y
mad r4.x, r25.w, r23.w, r4.x

mul r5.xyzw, r4.yyyy, cb0[15].xyzw
mad r4.xyzw, r4.xxxx, cb0[14].xyzw, r5.xyzw

//Random comment.
mad r4.xyzw, r2.yyyy, cb0[16].xyzw, r4.xyzw
add r4.xyzw, r4.xyzw, cb0[17].xyzw
div r4.xyz, r4.xyzx, r4.wwww
div r34.xyz, r23.xyzx, r23.wwww

mov r5.x, -cb0[7].w
mov r5.y, -cb0[8].w
mov r5.z, -cb0[9].w
add r35.xyz, r34.xyzx, r5.xyzx
add r5.xyz, r4.xyzx, r5.xyzx
dp3 r3.w, r5.xyzx, r5.xyzx
dp3 r33.w, r35.xyzx, r35.xyzx
rsq r4.w, r3.w
rsq r34.w, r33.w
lt r2.y, l(0.000000), r2.y
if_nz r2.y
  mul r5.xzw, r4.wwww, r5.xxyz
  mul r35.xzw, r34.wwww, r35.xxyz
  iadd r6.xyzw, r0.xxyy, cb4[0].xzyw
  ushr r7.xy, r6.xyxx, l(1, 1, 0, 0)
  ushr r6.xy, r6.zwzz, l(1, 1, 0, 0)
  mov r7.z, r6.x
  mov r7.w, l(0)
  ld_indexable(texture2d)(float,float,float,float) r8.xyz, r7.xzww, t7.xyzw
  mov r6.zw, r7.yyyw
  ld_indexable(texture2d)(float,float,float,float) r6.xyz, r6.zyww, t7.xyzw
  iadd r7.xyzw, r0.xxyy, cb4[1].xzyw
  ushr r9.xy, r7.xyxx, l(1, 1, 0, 0)
  ushr r7.xy, r7.zwzz, l(1, 1, 0, 0)
  mov r9.z, r7.x
  mov r9.w, l(0)
  ld_indexable(texture2d)(float,float,float,float) r10.xyz, r9.xzww, t7.xyzw
  mov r7.zw, r9.yyyw
  ld_indexable(texture2d)(float,float,float,float) r7.xyz, r7.zyww, t7.xyzw
  ld_indexable(texture2d)(float,float,float,float) r9.xyzw, r0.xyww, t1.wxyz
  ld_indexable(texture2d)(float,float,float,float) r11.xyzw, r0.xyww, t2.xyzw
  max r12.y, r11.z, l(0.010000)
  mad r11.xy, r11.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
  add r6.w, -|r11.x|, l(1.000000)
  add r11.z, -|r11.y|, r6.w
  lt r6.w, r11.z, l(0.000000)
  if_nz r6.w
    add r12.zw, -|r11.yyyx|, l(0.000000, 0.000000, 1.000000, 1.000000)
    ge r13.xy, r11.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
    movc r11.xy, r13.xyxx, r12.zwzz, -r12.zwzz
  endif
  dp3 r6.w, r11.xyzx, r11.xyzx
  rsq r6.w, r6.w
  mul r11.xyz, r6.wwww, r11.xzyx
  mul r6.w, r12.y, r12.y
  lt r7.w, l(0.666666), r11.w
  if_nz r7.w
    min r7.w, r9.x, l(0.080000)
  else
    mul r8.w, r9.x, l(15.937500)
    ge r10.w, r8.w, -r8.w
    frc r8.w, |r8.w|
    movc r8.w, r10.w, r8.w, -r8.w
    mul r7.w, r8.w, l(0.0906666741)
    mov r9.x, l(0)
  endif
  mad_sat r8.w, r7.w, l(125.000000), l(-0.250000)
  dp3 r12.x, r5.xzwx, r11.xyzx
  add r10.w, r12.x, r12.x
  mad r13.xyz, r11.xyzx, -r10.wwww, r35.xzwx
  dp3 r10.w, r13.xyzx, r13.xyzx
  rsq r10.w, r10.w
  mul r13.xyz, r10.wwww, r13.xyzx
  dp3_sat r10.w, r11.xyzx, -r5.xzwx
  mul r11.w, cb0[23].y, l(0.250000)
  add r10.w, r10.w, r10.w
  min r10.w, r10.w, l(1.000000)
  ishr r12.z, r12.y, l(1)
  iadd r12.z, r12.z, l(0x1fbd1df5)
  add r12.w, -r10.w, l(1.000000)
  mad r10.w, r12.z, r12.w, r10.w
  mul r10.w, r10.w, r11.w
  lt r11.w, l(0.000000), r8.z
  if_nz r11.w
    mul r14.xyzw, r8.yyyy, cb4[3].xyzw
    mad r14.xyzw, r8.xxxx, cb4[2].xyzw, r14.xyzw
    mad r14.xyzw, r8.zzzz, cb4[4].xyzw, r14.xyzw
    add r14.xyzw, r14.xyzw, cb4[5].xyzw
    div r14.xyz, r14.xyzx, r14.wwww
    add r15.xyz, -r34.xyzx, r14.xyzx
    dp3 r8.z, r15.xyzx, r15.xyzx
    rsq r8.z, r8.z
    mul r16.xyz, r8.zzzz, r15.xyzx
    mad r17.xyz, r15.xyzx, r8.zzzz, -r35.xzwx
    dp3 r8.z, r17.xyzx, r17.xyzx
    rsq r8.z, r8.z
    mul r17.xyz, r8.zzzz, r17.xyzx
    dp3_sat r8.z, r11.xyzx, r16.xyzx
    dp3_sat r11.w, r11.xyzx, r17.xyzx
    mul r11.w, r11.w, r11.w
    mad r12.z, r12.y, r12.y, l(-1.000000)
    mad r11.w, r11.w, r12.z, l(1.000000)
    mul r11.w, r11.w, r11.w
    rcp r11.w, r11.w
    mul r11.w, r6.w, r11.w
    mul r8.z, r8.z, r11.w
    dp3 r11.w, r13.xyzx, r15.xyzx
    mad r15.xyz, r11.wwww, r13.xyzx, r4.xyzx
    mul r16.xyz, r15.yyyy, cb4[7].xywx
    mad r15.xyw, r15.xxxx, cb4[6].xyxw, r16.xyxz
    mad r15.xyz, r15.zzzz, cb4[8].xywx, r15.xywx
    add r15.xyz, r15.xyzx, cb4[9].xywx
    div r12.zw, r15.xxxy, r15.zzzz
    add r12.zw, r8.xxxy, -r12.zzzw
    dp2 r11.w, r12.zwzz, r12.zwzz
    sqrt r11.w, r11.w
    mul r11.w, r10.w, r11.w
    log r11.w, r11.w
    max r11.w, r11.w, l(0.000000)
    min r11.w, r11.w, l(7.000000)
    sample_l_indexable(texture2d)(float,float,float,float) r15.xyz, r8.xyxx, t8.xyzw, s1, r11.w
    mul r15.xyz, r8.zzzz, r15.xyzx
    mov r8.x, l(0.250000)
  else
    mov r15.xyz, l(0,0,0,0)
    mov r14.xyz, l(0,0,0,0)
    mov r8.xz, l(0,0,0,0)
  endif
  lt r8.y, l(0.000000), r6.z
  if_nz r8.y
    mul r16.xyzw, r6.yyyy, cb4[3].xyzw
    mad r16.xyzw, r6.xxxx, cb4[2].xyzw, r16.xyzw
    mad r16.xyzw, r6.zzzz, cb4[4].xyzw, r16.xyzw
    add r16.xyzw, r16.xyzw, cb4[5].xyzw
    div r14.xyz, r16.xyzx, r16.wwww
    add r16.xyz, -r34.xyzx, r14.xyzx
    dp3 r6.z, r16.xyzx, r16.xyzx
    rsq r6.z, r6.z
    mul r17.xyz, r6.zzzz, r16.xyzx
    mad r18.xyz, r16.xyzx, r6.zzzz, -r35.xzwx
    dp3 r6.z, r18.xyzx, r18.xyzx
    rsq r6.z, r6.z
    mul r18.xyz, r6.zzzz, r18.xyzx
    dp3_sat r6.z, r11.xyzx, r17.xyzx
    dp3_sat r8.y, r11.xyzx, r18.xyzx
    mul r8.y, r8.y, r8.y
    mad r11.w, r12.y, r12.y, l(-1.000000)
    mad r8.y, r8.y, r11.w, l(1.000000)
    mul r8.y, r8.y, r8.y
    rcp r8.y, r8.y
    mul r8.y, r6.w, r8.y
    mul r11.w, r6.z, r8.y
    dp3 r12.z, r13.xyzx, r16.xyzx
    mad r16.xyz, r12.zzzz, r13.xyzx, r4.xyzx
    mul r17.xyz, r16.yyyy, cb4[7].xywx
    mad r16.xyw, r16.xxxx, cb4[6].xyxw, r17.xyxz
    mad r16.xyz, r16.zzzz, cb4[8].xywx, r16.xywx
    add r16.xyz, r16.xyzx, cb4[9].xywx
    div r12.zw, r16.xxxy, r16.zzzz
    add r12.zw, r6.xxxy, -r12.zzzw
    dp2 r12.z, r12.zwzz, r12.zwzz
    sqrt r12.z, r12.z
    mul r12.z, r10.w, r12.z
    log r12.z, r12.z
    max r12.z, r12.z, l(0.000000)
    min r12.z, r12.z, l(7.000000)
    sample_l_indexable(texture2d)(float,float,float,float) r16.xyz, r6.xyxx, t8.xyzw, s1, r12.z
    mad r15.xyz, r16.xyzx, r11.wwww, r15.xyzx
    mad r8.z, r8.y, r6.z, r8.z
    add r8.x, r8.x, l(0.250000)
  endif
  lt r6.x, l(0.000000), r10.z
  if_nz r6.x
    mul r16.xyzw, r10.yyyy, cb4[3].xyzw
    mad r16.xyzw, r10.xxxx, cb4[2].xyzw, r16.xyzw
    mad r16.xyzw, r10.zzzz, cb4[4].xyzw, r16.xyzw
    add r16.xyzw, r16.xyzw, cb4[5].xyzw
    div r14.xyz, r16.xyzx, r16.wwww
    add r6.xyz, -r34.xyzx, r14.xyzx
    dp3 r8.y, r6.xyzx, r6.xyzx
    rsq r8.y, r8.y
    mul r16.xyz, r6.xyzx, r8.yyyy
    mad r17.xyz, r6.xyzx, r8.yyyy, -r35.xzwx
    dp3 r8.y, r17.xyzx, r17.xyzx
    rsq r8.y, r8.y
    mul r17.xyz, r8.yyyy, r17.xyzx
    dp3_sat r8.y, r11.xyzx, r16.xyzx
    dp3_sat r10.z, r11.xyzx, r17.xyzx
    mul r10.z, r10.z, r10.z
    mad r11.w, r12.y, r12.y, l(-1.000000)
    mad r10.z, r10.z, r11.w, l(1.000000)
    mul r10.z, r10.z, r10.z
    rcp r10.z, r10.z
    mul r10.z, r6.w, r10.z
    mul r11.w, r8.y, r10.z
    dp3 r6.x, r13.xyzx, r6.xyzx
    mad r6.xyz, r6.xxxx, r13.xyzx, r4.xyzx
    mul r16.xyz, r6.yyyy, cb4[7].xywx
    mad r16.xyz, r6.xxxx, cb4[6].xywx, r16.xyzx
    mad r6.xyz, r6.zzzz, cb4[8].xywx, r16.xyzx
    add r6.xyz, r6.xyzx, cb4[9].xywx
    div r6.xy, r6.xyxx, r6.zzzz
    add r6.xy, -r6.xyxx, r10.xyxx
    dp2 r6.x, r6.xyxx, r6.xyxx
    sqrt r6.x, r6.x
    mul r6.x, r10.w, r6.x
    log r6.x, r6.x
    max r6.x, r6.x, l(0.000000)
    min r6.x, r6.x, l(7.000000)
    sample_l_indexable(texture2d)(float,float,float,float) r6.xyz, r10.xyxx, t8.xyzw, s1, r6.x
    mad r15.xyz, r6.xyzx, r11.wwww, r15.xyzx
    mad r8.z, r10.z, r8.y, r8.z
    add r8.x, r8.x, l(0.250000)
  endif
  lt r6.x, l(0.000000), r7.z
  if_nz r6.x
    mul r16.xyzw, r7.yyyy, cb4[3].xyzw
    mad r16.xyzw, r7.xxxx, cb4[2].xyzw, r16.xyzw
    mad r16.xyzw, r7.zzzz, cb4[4].xyzw, r16.xyzw
    add r16.xyzw, r16.xyzw, cb4[5].xyzw
    div r14.xyz, r16.xyzx, r16.wwww
    add r6.xyz, -r34.xyzx, r14.xyzx
    dp3 r7.z, r6.xyzx, r6.xyzx
    rsq r7.z, r7.z
    mul r10.xyz, r6.xyzx, r7.zzzz
    mad r5.xzw, r6.xxyz, r7.zzzz, -r35.xxzw
    dp3 r7.z, r5.xzwx, r5.xzwx
    rsq r7.z, r7.z
    mul r5.xzw, r5.xxzw, r7.zzzz
    dp3_sat r7.z, r11.xyzx, r10.xyzx
    dp3_sat r5.x, r11.xyzx, r5.xzwx
    mul r5.x, r5.x, r5.x
    mad r5.z, r12.y, r12.y, l(-1.000000)
    mad r5.x, r5.x, r5.z, l(1.000000)
    mul r5.x, r5.x, r5.x
    rcp r5.x, r5.x
    mul r5.x, r5.x, r6.w
    mul r5.z, r7.z, r5.x
    dp3 r5.w, r13.xyzx, r6.xyzx
    mad r6.xyz, r5.wwww, r13.xyzx, r4.xyzx
    mul r10.xyz, r6.yyyy, cb4[7].xywx
    mad r6.xyw, r6.xxxx, cb4[6].xyxw, r10.xyxz
    mad r6.xyz, r6.zzzz, cb4[8].xywx, r6.xywx
    add r6.xyz, r6.xyzx, cb4[9].xywx
    div r4.xz, r6.xxyx, r6.zzzz
    add r4.xz, -r4.xxzx, r7.xxyx
    dp2 r4.x, r4.xzxx, r4.xzxx
    sqrt r4.x, r4.x
    mul r4.x, r10.w, r4.x
    log r4.x, r4.x
    max r4.x, r4.x, l(0.000000)
    min r4.x, r4.x, l(7.000000)
    sample_l_indexable(texture2d)(float,float,float,float) r6.xyz, r7.xyxx, t8.xyzw, s1, r4.x
    mad r15.xyz, r6.xyzx, r5.zzzz, r15.xyzx
    mad r8.z, r5.x, r7.z, r8.z
    add r8.x, r8.x, l(0.250000)
  endif
  lt r4.x, l(0.000000), r8.z
  if_nz r4.x
    div r5.xzw, r15.xxyz, r8.zzzz
    mul r6.xyz, r14.yyyy, cb0[19].xywx
    mad r6.xyz, r14.xxxx, cb0[18].xywx, r6.xyzx
    mad r6.xyz, r14.zzzz, cb0[20].xywx, r6.xyzx
    add r6.xyz, r6.xyzx, cb0[21].xywx
    rcp r4.x, r6.z
    mul r7.xyz, r14.yyyy, cb0[1].xywx
    mad r7.xyz, r14.xxxx, cb0[0].xywx, r7.xyzx
    mad r7.xyz, r14.zzzz, cb0[2].xywx, r7.xyzx
    add r7.xyz, r7.xyzx, cb0[3].xywx
    mad r2.zw, r2.zzzw, cb4[10].xxxy, cb4[10].zzzw
    add r6.xy, r6.xyxx, -r7.xyxx
    mad r2.zw, r6.xxxy, r4.xxxx, r2.zzzw
    mul r4.x, r4.x, r7.z
    mul r2.zw, r2.zzzw, r4.xxxx
    max r4.x, |r2.w|, |r2.z|
    lt r4.x, r4.x, l(1.000000)
    if_nz r4.x
      mad r2.zw, r2.zzzw, cb4[11].xxxy, cb4[11].zzzw
      ftoi r6.xy, r2.zwzz
    else
      mov r6.xy, r0.xyxx
    endif
    add r5.xzw, -r3.xxyz, r5.xxzw
    mad r3.xyz, r8.xxxx, r5.xzwx, r3.xyzx
  else
    mov r6.xy, r0.xyxx
  endif
  mov r6.z, l(0)
  ld_indexable(texture2d)(uint,uint,uint,uint) r2.x, r6.xyzz, t6.xyzw
  mov_sat r12.x, -r12.x
  mul r19.xyz {min16f}, r9.yzwy {def32 as min16f}, r9.xxxx {def32 as min16f}
  max r19.xyz {min16f}, r7.wwww {def32 as min16f}, r19.xyzx {min16f}
  sample_l_indexable(texture2d)(float,float,float,float) r2.zw, r12.xyxx, t3.zwxy, s0, l(0.000000)
  mad r5.xzw, r19.xxyz {min16f as def32}, r2.zzzz, r2.wwww
  add_sat r5.xzw, r5.xxzw, cb1[5].yyyy
  mul r5.xzw, r5.xxzw, cb1[5].zzzz
  mul r5.xzw, r8.wwww, r5.xxzw
else
  mov r5.xzw, l(0,0,0,0)
endif
imul null, r2.zw, r1.wwwy, l(0, 0, 49, 3)
iadd r2.z, r2.w, r2.z
store_structured g0.x, r2.z, l(0), r3.x
iadd r4.xz, r2.zzzz, l(1, 0, 2, 0)
store_structured g0.x, r4.x, l(0), r3.y
store_structured g0.x, r4.z, l(0), r3.z
store_structured g1.xyz, vThreadIDInGroup.x, l(0), r3.xyzx
sync_g_t
ult r6.xyzw, vThreadIDInGroup.xxxx, l(128, 64, 32, 16)
if_nz r6.x
  ishl r2.z, vThreadIDInGroup.x, l(1)
  ld_structured r7.xyz, r2.z, l(0), g1.xyzx
  imad r2.z, vThreadIDInGroup.x, l(2), l(1)
  ld_structured r8.xyz, r2.z, l(0), g1.xyzx
  max r9.xyz, r7.xyzx, r8.xyzx
  store_structured g2.xyz, vThreadIDInGroup.x, l(0), r9.xyzx
  iadd r2.z, vThreadIDInGroup.x, l(129)
  min r7.xyz, r7.xyzx, r8.xyzx
  store_structured g2.xyz, r2.z, l(0), r7.xyzx
endif
sync_g_t
if_nz r6.y
  ishl r2.z, vThreadIDInGroup.x, l(1)
  ld_structured r7.xyz, r2.z, l(0), g2.xyzx
  imad r2.w, vThreadIDInGroup.x, l(2), l(1)
  ld_structured r8.xyz, r2.w, l(0), g2.xyzx
  max r7.xyz, r7.xyzx, r8.xyzx
  store_structured g1.xyz, vThreadIDInGroup.x, l(0), r7.xyzx
  iadd r4.x, vThreadIDInGroup.x, l(65)
  iadd r2.z, r2.z, l(129)
  ld_structured r7.xyz, r2.z, l(0), g2.xyzx
  iadd r2.z, r2.w, l(129)
  ld_structured r8.xyz, r2.z, l(0), g2.xyzx
  min r7.xyz, r7.xyzx, r8.xyzx
  store_structured g1.xyz, r4.x, l(0), r7.xyzx
endif
sync_g_t
if_nz r6.z
  ishl r2.z, vThreadIDInGroup.x, l(1)
  ld_structured r6.xyz, r2.z, l(0), g1.xyzx
  imad r2.w, vThreadIDInGroup.x, l(2), l(1)
  ld_structured r7.xyz, r2.w, l(0), g1.xyzx
  max r6.xyz, r6.xyzx, r7.xyzx
  store_structured g2.xyz, vThreadIDInGroup.x, l(0), r6.xyzx
  iadd r4.x, vThreadIDInGroup.x, l(33)
  iadd r2.z, r2.z, l(65)
  ld_structured r6.xyz, r2.z, l(0), g1.xyzx
  iadd r2.z, r2.w, l(65)
  ld_structured r7.xyz, r2.z, l(0), g1.xyzx
  min r6.xyz, r6.xyzx, r7.xyzx
  store_structured g2.xyz, r4.x, l(0), r6.xyzx
endif
sync_g_t
if_nz r6.w
  ishl r2.z, vThreadIDInGroup.x, l(1)
  ld_structured r6.xyz, r2.z, l(0), g2.xyzx
  imad r2.w, vThreadIDInGroup.x, l(2), l(1)
  ld_structured r7.xyz, r2.w, l(0), g2.xyzx
  max r6.xyz, r6.xyzx, r7.xyzx
  store_structured g1.xyz, vThreadIDInGroup.x, l(0), r6.xyzx
  iadd r4.x, vThreadIDInGroup.x, l(17)
  iadd r2.z, r2.z, l(33)
  ld_structured r6.xyz, r2.z, l(0), g2.xyzx
  iadd r2.z, r2.w, l(33)
  ld_structured r7.xyz, r2.z, l(0), g2.xyzx
  min r6.xyz, r6.xyzx, r7.xyzx
  store_structured g1.xyz, r4.x, l(0), r6.xyzx
endif
sync_g_t
ult r2.z, vThreadIDInGroup.x, l(8)
if_nz r2.z
  ishl r2.z, vThreadIDInGroup.x, l(1)
  ld_structured r6.xyz, r2.z, l(0), g1.xyzx
  imad r2.w, vThreadIDInGroup.x, l(2), l(1)
  ld_structured r7.xyz, r2.w, l(0), g1.xyzx
  max r6.xyz, r6.xyzx, r7.xyzx
  store_structured g2.xyz, vThreadIDInGroup.x, l(0), r6.xyzx
  iadd r4.x, vThreadIDInGroup.x, l(9)
  iadd r2.z, r2.z, l(17)
  ld_structured r6.xyz, r2.z, l(0), g1.xyzx
  iadd r2.z, r2.w, l(17)
  ld_structured r7.xyz, r2.z, l(0), g1.xyzx
  min r6.xyz, r6.xyzx, r7.xyzx
  store_structured g2.xyz, r4.x, l(0), r6.xyzx
endif
sync_g_t
ftou r2.zw, cb0[23].xxxy
uge r2.zw, r0.xxxy, r2.zzzw
or r2.z, r2.w, r2.z
if_nz r2.z
  ret
endif
ld_indexable(texture2d)(float,float,float,float) r6.xyz, r0.xyzw, t5.xyzw
if_nz r2.y
  ushr r0.z, vThreadIDInGroup.x, l(6)
  ishl r0.w, r0.z, l(1)
  ld_structured r2.yzw, r0.w, l(0), g2.xxyz
  imad r0.zw, r0.zzzz, l(0, 0, 2, 2), l(0, 0, 1, 9)
  ld_structured r7.xyz, r0.z, l(0), g2.xyzx
  max r2.yzw, r2.yyzw, r7.xxyz
  ld_structured r7.xyz, r0.w, l(0), g2.xyzx
  iadd r0.z, r0.z, l(9)
  ld_structured r8.xyz, r0.z, l(0), g2.xyzx
  min r7.xyz, r7.xyzx, r8.xyzx
  umin r8.xyzw, r1.wwyy, l(14, 14, 14, 14)
  umax r1.xyzw, r1.xyzw, l(1, 1, 1, 1)
  imad r8.xyzw, r8.xyzw, l(49, 49, 3, 3), l(49, 49, 3, 3)
  imad r1.xyzw, r1.xyzw, l(3, 3, 49, 49), l(-3, -3, -49, -49)
  iadd r9.xyzw, r1.xyzw, r8.xyzw
  ld_structured r0.z, r9.y, l(0), g0.xxxx
  iadd r10.xyzw, r9.xyzw, l(1, 2, 1, 2)
  ld_structured r0.w, r10.x, l(0), g0.xxxx
  ld_structured r1.x, r10.y, l(0), g0.xxxx
  iadd r1.z, r8.w, r8.y
  ld_structured r4.x, r1.z, l(0), g0.xxxx
  iadd r8.xy, r1.zzzz, l(1, 2, 0, 0)
  ld_structured r1.z, r8.x, l(0), g0.xxxx
  ld_structured r4.z, r8.y, l(0), g0.xxxx
  min r6.w, r0.z, r3.x
  min r6.w, r4.x, r6.w
  min r7.w, r0.w, r3.y
  min r7.w, r1.z, r7.w
  min r8.x, r1.x, r3.z
  min r8.x, r4.z, r8.x
  max r0.zw, r0.zzzw, r3.xxxy
  max r0.z, r4.x, r0.z
  max r0.w, r1.z, r0.w
  max r1.x, r1.x, r3.z
  max r1.x, r4.z, r1.x
  iadd r1.y, r1.y, r1.w
  ld_structured r1.z, r1.y, l(0), g0.xxxx
  iadd r1.yw, r1.yyyy, l(0, 1, 0, 2)
  ld_structured r1.y, r1.y, l(0), g0.xxxx
  ld_structured r1.w, r1.w, l(0), g0.xxxx
  ld_structured r4.x, r9.w, l(0), g0.xxxx
  ld_structured r4.z, r10.z, l(0), g0.xxxx
  ld_structured r8.y, r10.w, l(0), g0.xxxx
  min r6.w, r1.z, r6.w
  min r9.x, r4.x, r6.w
  min r6.w, r1.y, r7.w
  min r9.y, r4.z, r6.w
  min r6.w, r1.w, r8.x
  min r9.z, r8.y, r6.w
  max r0.z, r0.z, r1.z
  max r10.x, r4.x, r0.z
  max r0.z, r0.w, r1.y
  max r10.y, r4.z, r0.z
  max r0.z, r1.w, r1.x
  max r10.z, r8.y, r0.z
  bfi r0.z, l(11), l(4), r2.x, l(0)
  f16tof32 r1.x, r0.z
  ushr r0.zw, r2.xxxx, l(0, 0, 11, 22)
  bfi r0.z, l(11), l(4), r0.z, l(0)
  f16tof32 r1.y, r0.z
  ishl r0.z, r0.w, l(5)
  f16tof32 r1.z, r0.z
  max r7.xyz, r7.xyzx, r1.xyzx
  min r2.xyz, r2.yzwy, r7.xyzx
  max r1.xyz, r9.xyzx, r1.xyzx
  min r1.xyz, r10.xyzx, r1.xyzx
  add r1.xyz, -r2.xyzx, r1.xyzx
  mad r1.xyz, cb3[0].wwww, r1.xyzx, r2.xyzx
  add r1.xyz, -r3.xyzx, r1.xyzx
  mad r1.xyz, cb3[0].zzzz, r1.xyzx, r3.xyzx
  max r1.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  min r1.xyz, r1.xyzx, l(655536.000000, 655536.000000, 655536.000000, 0.000000)
  mad r6.xyz, r1.xyzx, r5.xzwx, r6.xyzx
  f32tof16 r1.xyz, r1.xyzx
  ubfe r0.z, l(11), l(4), r1.x
  ushr r1.xy, r1.yzyy, l(4, 5, 0, 0)
  bfi r0.w, l(11), l(11), r1.x, l(0)
  iadd r0.z, r0.w, r0.z
  bfi r0.z, l(10), l(22), r1.y, r0.z
  store_uav_typed u0.xyzw, r0.xyyy, r0.zzzz
endif
lt r0.z, l(0.000000), cb2[1].y
if_nz r0.z
  mul r0.z, r4.w, r5.y
  lt r0.w, |r0.z|, l(0.000100)
  movc r0.z, r0.w, l(0.000100), r0.z
  mad r0.w, r3.w, r4.w, -cb2[1].z
  max r0.w, r0.w, l(0.000000)
  add r1.x, r4.y, -cb2[1].w
  max r1.x, r1.x, l(0.000000)
  mul r1.y, r0.z, -r0.w
  mul r1.y, r1.y, cb2[0].w
  lt r1.z, l(0.000010), |r1.y|
  mul r1.y, r1.y, l(1.442695)
  exp r1.y, r1.y
  add r1.y, -r1.y, l(1.000000)
  div r0.z, r1.y, r0.z
  mul r0.w, r0.w, cb2[0].w
  movc r0.z, r1.z, r0.z, r0.w
  mul r0.w, -r1.x, cb2[1].x
  mul r0.w, r0.w, l(1.442695)
  exp r0.w, r0.w
  mul r0.z, r0.z, r0.w
  min r0.z, r0.z, cb2[1].y
  mul r1.xyz, r0.zzzz, cb2[0].xyzx
  add r0.z, -r0.z, l(1.000000)
else
  mov r1.xyz, l(0,0,0,0)
  mov r0.z, l(1.000000)
endif
mad r1.xyzw, r6.xyzx, r0.zzzz, r1.xyzx
store_uav_typed u1.xyzw, r0.xyyy, r1.xyzw
ret
// Approximately 521 instruction slots used
