//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v1.3.16 on Sun Jan 16 20:41:12 2022
//
//
// Note: shader requires additional functionality:
//       64 UAV slots
//
//
// Buffer Definitions:
//
// cbuffer ConstBuf__constants
// {
//
//   struct DownsampleDepthPassCB
//   {
//
//       float imageWidth1Rcp;          // Index:    0
//       float imageHeight1Rcp;         // Index:    0.y
//       float depthReprojectScale;     // Index:    0.z
//       float depthReprojectBias;      // Index:    0.w
//       uint2 imageHTilesCount;        // Index:    1
//       float2 targetMipSizeRcp;       // Index:    1.z
//       uint htileMode;                // Index:    2
//       uint framePhase;               // Index:    2.y
//       uint startingMip;              // Index:    2.z
//       uint enableSDSMReadback;       // Index:    2.w
//       float sdsmMaximumDistance;     // Index:    3
//       uint convertAspectRatio;       // Index:    3.y
//
//       struct DoFCoCStruct
//       {
//
//           float m_Enabled;           // Index:    4
//           float m_DebugDOF;          // Index:    4.y
//           float m_NearDistanceOfAcceptableSharpness;// Index:    4.z
//           float m_FarDistanceOfAcceptableSharpness;// Index:    4.w
//           float m_CircleOfConfusionMultiplier;// Index:    5
//           float m_CameraApertureHeightRelativeRcp;// Index:    5.y
//           float m_HyperFocalDistance;// Index:    5.z
//           float m_FocusDistance;     // Index:    5.w
//           float m_FStop;             // Index:    6
//           float m_DepthReprojectScale;// Index:    6.y
//           float m_DepthReprojectBias;// Index:    6.z
//
//       } dofCoCInfo;                  // Index:    4
//
//   } resourceTables__constants;       // Index:    0-6.z            Components:    27
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// resourceTables__passData__smpPointClamp    sampler      NA          NA    0        1
// resourceTables__passData__smpLinearClamp    sampler      NA          NA    1        1
// resourceTables__passData.texDepth    texture   float          2d    0        1
// resourceTables__passData.texNormal    texture  float4          2d    1        1
// resourceTables__passData.texGloss    texture  float4          2d    2        1
// resourceTables__passData.outLinear        UAV   float          2d    8        1
// resourceTables__passData.outByTwoLinearMip0        UAV   float          2d   10        1
// resourceTables__passData.outByTwoLinearMip1        UAV   float          2d   11        1
// resourceTables__passData.outByTwoLinearMip2        UAV   float          2d   12        1
// resourceTables__passData.outByTwoLinearMip3        UAV   float          2d   13        1
// resourceTables__passData.outByTwoNormal        UAV  float4          2d   14        1
// resourceTables__passData.outDepthBufferByTwo        UAV   float          2d   15        1
// resourceTables__passData.outBy8        UAV  float4          2d   16        1
// ConstBuf__constants               cbuffer      NA          NA    0        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_constantbuffer cb0[3], 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_uav_typed_texture2d (float,float,float,float) u8
dcl_uav_typed_texture2d (float,float,float,float) u10
dcl_uav_typed_texture2d (float,float,float,float) u11
dcl_uav_typed_texture2d (float,float,float,float) u12
dcl_uav_typed_texture2d (float,float,float,float) u13
dcl_uav_typed_texture2d (float,float,float,float) u14
dcl_uav_typed_texture2d (float,float,float,float) u15
dcl_uav_typed_texture2d (float,float,float,float) u16
dcl_input vThreadIDInGroupFlattened
dcl_input vThreadGroupID.xy
dcl_temps 50
dcl_tgsm_structured g0, 4, 64
dcl_thread_group 8, 8, 1
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r40.xyzw, l(0, 0, 0, 0), t125.xyzw
and r0.x, vThreadIDInGroupFlattened.x, l(7)
ushr r0.y, vThreadIDInGroupFlattened.x, l(3)
imad r1.xyzw, vThreadGroupID.xyyy, l(8, 8, 8, 8), r0.xyyy
ishl r2.xyzw, r0.xyyy, l(1, 1, 1, 1)
imad r2.xyzw, vThreadGroupID.xyyy, l(16, 16, 16, 16), r2.xyzw
utof r0.xw, r2.xxxw

mov r30.xyw, r0.xyxw
mul r40.w, cb0[3].x, l(-1.0)
//mad r30.x, r40.x, r40.w, r30.x


add r33.xy, r30.xwxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r33.xy, r33.xyxx, cb0[0].xyxx

add r3.xy, r0.xwxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r3.xy, r3.xyxx, cb0[0].xyxx

//mov r33.xy, r3.xyxx
//mad r33.x, r40.x, l(-0.5), r33.x

//add r3.x, r40.x, r3.x


gather4_indexable(texture2d)(float,float,float,float) r4.xyzw, r3.xyxx, t0.xyzw, s0.x

gather4_indexable(texture2d)(float,float,float,float) r34.xyzw, r33.xyxx, t0.xyzw, s0.x
mad r35.xyzw, r34.xyzw, cb0[0].zzzz, cb0[0].wwww
rcp r35.xyzw, r35.xyzw
mov r35.xyzw, -r35.xyzw

mad r5.xyzw, r4.xyzw, cb0[0].zzzz, cb0[0].wwww
rcp r5.xyzw, r5.xyzw
mov r5.xyzw, -r5.xyzw

//mad r3.x, r40.x, l(0.5), r3.x

gather4_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.xyxx, t2.xyzw, s0.w
mul r3.xyzw, r3.xyzw, l(255.000000, 255.000000, 255.000000, 255.000000)
ftou r3.xyzw, r3.xyzw
and r3.xyzw, r3.xyzw, l(16, 16, 16, 16)
and r6.xyzw, r5.xyzw, l(1, 1, 1, 1)
xor r6.xyzw, r5.xyzw, r6.xyzw
movc r3.xyzw, r3.xyzw, l(1,1,1,1), l(0,0,0,0)
or r3.xyzw, r3.xyzw, r6.xyzw
store_uav_typed u8.xyzw, r2.xwww, r3.wwww
iadd r6.xyzw, r2.xwxw, l(1, 0, 0, 1)
store_uav_typed u8.xyzw, r6.xyyy, r3.zzzz
store_uav_typed u8.xyzw, r6.zwww, r3.xxxx
iadd r6.xyzw, r2.xyzw, l(1, 1, 1, 1)
store_uav_typed u8.xyzw, r6.xyzw, r3.yyyy
min r2.x, r35.z, r35.y
min r2.x, r2.x, r35.x
min r2.x, r35.w, r2.x
max r2.y, r35.z, r35.y
max r2.y, r2.y, r35.x
max r2.y, r35.w, r2.y
iadd r2.z, r1.x, cb0[2].y
and r2.z, r2.z, l(1)
and r3.xyz, r1.wxww, l(1, 1, 1, 0)
ieq r2.z, r2.z, r3.x
movc r2.w, r2.z, r2.x, r2.y
store_uav_typed u10.xyzw, r1.xwww, r2.wwww
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r2.w
sync_g_t
xor r6.xyzw, vThreadIDInGroupFlattened.xxxx, l(1, 8, 2, 16)
ld_structured r3.x, r6.x, l(0), g0.xxxx
max r3.x, r2.w, r3.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r3.x
sync_g_t
ld_structured r3.w, r6.y, l(0), g0.xxxx
max r3.x, r3.w, r3.x
ieq r3.yz, r3.yyzy, l(0, 0, 0, 0)
and r3.y, r3.z, r3.y
if_nz r3.y
  ushr r7.xyzw, r1.xwww, l(1, 1, 1, 1)
  store_uav_typed u11.xyzw, r7.xyzw, r3.xxxx
endif
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r3.x
sync_g_t
ld_structured r3.y, r6.z, l(0), g0.xxxx
max r3.x, r3.y, r3.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r3.x
sync_g_t
ld_structured r3.y, r6.w, l(0), g0.xxxx
max r3.x, r3.y, r3.x
and r7.xyzw, r1.xwxw, l(3, 3, 7, 7)
ieq r7.xyzw, r7.xyzw, l(0, 0, 0, 0)
and r3.yz, r7.yywy, r7.xxzx
if_nz r3.y
  ushr r7.xyzw, r1.xwww, l(2, 2, 2, 2)
  store_uav_typed u12.xyzw, r7.xyzw, r3.xxxx
endif
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r3.x
sync_g_t
xor r3.y, vThreadIDInGroupFlattened.x, l(4)
ld_structured r3.y, r3.y, l(0), g0.xxxx
max r3.x, r3.y, r3.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r3.x
sync_g_t
ld_structured r3.y, l(32), l(0), g0.xxxx
if_nz r3.z
  max r3.x, r3.y, r3.x
  ushr r7.xyzw, r1.xwww, l(3, 3, 3, 3)
  store_uav_typed u13.xyzw, r7.xyzw, r3.xxxx
endif
min r3.x, r4.z, r4.y
min r3.x, r3.x, r4.x
min r3.x, r4.w, r3.x
max r3.y, r4.z, r4.y
max r3.y, r3.y, r4.x
max r3.y, r4.w, r3.y
movc r2.z, r2.z, r3.y, r3.x
store_uav_typed u15.xyzw, r1.xwww, r2.zzzz
max r2.z, r2.w, l(0.000100)
rcp r2.z, r2.z
mad r3.xyzw, r5.xyzw, r2.zzzz, l(-1.000000, -1.000000, -1.000000, -1.000000)
lt r3.xyzw, |r3.xyzw|, l(0.100000, 0.100000, 0.100000, 0.100000)
lt r4.xyzw, r5.xyzw, l(50.000000, 50.000000, 50.000000, 50.000000)
and r2.zw, r3.zzzw, r3.xxxy
and r2.z, r2.w, r2.z
not r2.z, r2.z
and r4.xy, r4.zwzz, r4.xyxx
and r2.w, r4.y, r4.x
and r2.z, r2.w, r2.z
if_nz r2.z
  and r2.z, r3.z, r3.w
  if_nz r2.z
    mov r2.zw, l(0,0,1,0)
  else
    and r4.xyz, r3.yxyy, r3.xwzx
    movc r3.xy, r3.xxxx, l(0,2,0,0), l(2,2,0,0)
    movc r3.xy, r3.zzzz, l(2,0,0,0), r3.xyxx
    movc r3.xy, r3.wwww, l(0,0,0,0), r3.xyxx
    movc r3.xy, r4.zzzz, l(2,1,0,0), r3.xyxx
    movc r3.xy, r4.yyyy, l(0,1,0,0), r3.xyxx
    movc r2.zw, r4.xxxx, l(0,0,1,2), r3.xxxy
  endif
else
  mov r2.zw, l(0,0,1,1)
endif
utof r2.zw, r2.zzzw

//mad r2.z, r40.x, l(1280.0), r2.z

mad r0.xw, r2.zzzw, l(0.500000, 0.000000, 0.000000, 0.500000), r0.xxxw
add r0.xw, r0.xxxw, l(0.500000, 0.000000, 0.000000, 0.500000)
mul r0.xw, r0.xxxw, cb0[0].xxxy

//add r0.x, r40.x, r0.x

//mad r0.x, r40.x, l(0.5), r0.x

sample_l_indexable(texture2d)(float,float,float,float) r3.xyz, r0.xwxx, t1.xyzw, s1, l(0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r3.w, r0.xwxx, t2.xywz, s1, l(0.000000)

//mad r0.x, r40.x, l(-1280.0), r0.x

store_uav_typed u14.xyzw, r1.xwww, r3.xyzw
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r2.x
sync_g_t
ld_structured r0.x, r6.y, l(0), g0.xxxx
min r0.x, r0.x, r2.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.x
sync_g_t
ld_structured r0.w, r6.x, l(0), g0.xxxx
min r0.x, r0.w, r0.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r2.y
sync_g_t
ld_structured r0.w, r6.y, l(0), g0.xxxx
max r0.w, r0.w, r2.y
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.w
sync_g_t
ld_structured r2.x, r6.x, l(0), g0.xxxx
max r0.w, r0.w, r2.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.x
sync_g_t
ld_structured r2.x, r6.w, l(0), g0.xxxx
min r0.x, r0.x, r2.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.x
sync_g_t
ld_structured r2.x, r6.z, l(0), g0.xxxx
min r2.x, r0.x, r2.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.w
sync_g_t
ld_structured r0.x, r6.w, l(0), g0.xxxx
max r0.x, r0.x, r0.w
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.x
sync_g_t
ld_structured r0.w, r6.z, l(0), g0.xxxx
max r2.y, r0.w, r0.x
mov r0.z, vThreadIDInGroupFlattened.x
and r0.xy, r0.zyzz, l(3, 3, 0, 0)
ieq r0.xy, r0.xyxx, l(0, 0, 0, 0)
and r0.x, r0.y, r0.x
add r0.y, r2.y, r2.x
mul r0.y, r0.y, l(0.500000)
lt r3.xyzw, r5.xyzw, r0.yyyy
movc r3.xyzw, r3.xyzw, r5.xyzw, r2.xxxx
lt r4.xyzw, r0.yyyy, r5.xyzw
movc r4.xyzw, r4.xyzw, r5.xyzw, r2.yyyy
max r0.y, r3.z, r3.y
max r0.y, r0.y, r3.x
max r0.y, r3.w, r0.y
min r0.z, r4.z, r4.y
min r0.z, r0.z, r4.x
min r0.z, r4.w, r0.z
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.y
sync_g_t
ld_structured r0.w, r6.x, l(0), g0.xxxx
max r0.y, r0.w, r0.y
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.y
sync_g_t
ld_structured r0.w, r6.y, l(0), g0.xxxx
max r0.y, r0.w, r0.y
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.y
sync_g_t
ld_structured r0.w, r6.z, l(0), g0.xxxx
max r0.y, r0.w, r0.y
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.y
sync_g_t
ld_structured r0.w, r6.w, l(0), g0.xxxx
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.z
sync_g_t
ld_structured r3.x, r6.x, l(0), g0.xxxx
min r0.z, r0.z, r3.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.z
sync_g_t
ld_structured r3.x, r6.y, l(0), g0.xxxx
min r0.z, r0.z, r3.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.z
sync_g_t
ld_structured r3.x, r6.z, l(0), g0.xxxx
min r0.z, r0.z, r3.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.z
sync_g_t
if_nz r0.x
  max r2.z, r0.w, r0.y
  ld_structured r0.x, r6.w, l(0), g0.xxxx
  min r2.w, r0.x, r0.z
  ushr r0.xyzw, r1.xyzw, l(2, 2, 2, 2)
  store_uav_typed u16.xyzw, r0.xyzw, r2.xyzw
endif
ret
// Approximately 229 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v1.3.16 on Sun Jan 16 20:41:12 2022
// groupshared struct { float val[1]; } g0[64];
//
// cbuffer ConstBuf__constants : register(b0)
// {
//
//   struct
//   {
//     float imageWidth1Rcp;
//     float imageHeight1Rcp;
//     float depthReprojectScale;
//     float depthReprojectBias;
//     uint2 imageHTilesCount;
//     float2 targetMipSizeRcp;
//     uint htileMode;
//     uint framePhase;
//     uint startingMip;
//     uint enableSDSMReadback;
//     float sdsmMaximumDistance;
//     uint convertAspectRatio;
//
//     struct
//     {
//       float m_Enabled;
//       float m_DebugDOF;
//       float m_NearDistanceOfAcceptableSharpness;
//       float m_FarDistanceOfAcceptableSharpness;
//       float m_CircleOfConfusionMultiplier;
//       float m_CameraApertureHeightRelativeRcp;
//       float m_HyperFocalDistance;
//       float m_FocusDistance;
//       float m_FStop;
//       float m_DepthReprojectScale;
//       float m_DepthReprojectBias;
//     } dofCoCInfo;
//
//   } resourceTables__constants : packoffset(c0);
//
// }
//
// SamplerState resourceTables__passData__smpPointClamp_s : register(s0);
// SamplerState resourceTables__passData__smpLinearClamp_s : register(s1);
// Texture2D<float> resourceTables__passData.texDepth : register(t0);
// Texture2D<float4> resourceTables__passData.texNormal : register(t1);
// Texture2D<float4> resourceTables__passData.texGloss : register(t2);
// RWTexture2D<float> resourceTables__passData.outLinear : register(u8);
// RWTexture2D<float> resourceTables__passData.outByTwoLinearMip0 : register(u10);
// RWTexture2D<float> resourceTables__passData.outByTwoLinearMip1 : register(u11);
// RWTexture2D<float> resourceTables__passData.outByTwoLinearMip2 : register(u12);
// RWTexture2D<float> resourceTables__passData.outByTwoLinearMip3 : register(u13);
// RWTexture2D<float4> resourceTables__passData.outByTwoNormal : register(u14);
// RWTexture2D<float> resourceTables__passData.outDepthBufferByTwo : register(u15);
// RWTexture2D<float4> resourceTables__passData.outBy8 : register(u16);
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Texture2D<float4> StereoParams : register(t125);
//
//
// void main)
// {
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u8
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u10
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u11
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u12
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u13
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u14
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u15
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u16
//   float4 r0,r1,r2,r3,r4,r5,r6,r7;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_thread_group 8, 8, 1
//   r0.x = (int)vThreadIDInGroupFlattened.x & 7;
//   r0.y = (uint)vThreadIDInGroupFlattened.x >> 3;
//   r1.xyzw = mad((int4)vThreadGroupID.xyyy, int4(8,8,8,8), (int4)r0.xyyy);
//   r2.xyzw = (uint4)r0.xyyy << int4(1,1,1,1);
//   r2.xyzw = mad((int4)vThreadGroupID.xyyy, int4(16,16,16,16), (int4)r2.xyzw);
//   r0.xw = (uint2)r2.xw;
//   r3.xy = float2(1,1) + r0.xw;
//   r3.xy = resourceTables__constants.imageWidth1Rcp * r3.xy;
//   r4.xyzw = resourceTables__passData.texDepth.Gather(resourceTables__passData__smpPointClamp_s, r3.xy).xyzw;
//   r5.xyzw = r4.xyzw * resourceTables__constants.depthReprojectScale + resourceTables__constants.depthReprojectBias;
//   r5.xyzw = rcp(r5.xyzw);
//   r5.xyzw = -r5.xyzw;
//   r3.xyzw = resourceTables__passData.texGloss.Gather(resourceTables__passData__smpPointClamp_s, r3.xy).xyzw;
//   r3.xyzw = float4(255,255,255,255) * r3.xyzw;
//   r3.xyzw = (uint4)r3.xyzw;
//   r3.xyzw = (int4)r3.xyzw & int4(16,16,16,16);
//   r6.xyzw = (int4)r5.xyzw & int4(1,1,1,1);
//   r6.xyzw = (int4)r5.xyzw ^ (int4)r6.xyzw;
//   r3.xyzw = r3.xyzw ? float4(1,1,1,1) : float4(0,0,0,0);
//   r3.xyzw = (int4)r3.xyzw | (int4)r6.xyzw;
// // No code for instruction (needs manual fix):
// store_uav_typed u8.xyzw, r2.xwww, r3.wwww
//   r6.xyzw = (int4)r2.xwxw + int4(1,0,0,1);
// // No code for instruction (needs manual fix):
// store_uav_typed u8.xyzw, r6.xyyy, r3.zzzz
// // No code for instruction (needs manual fix):
// store_uav_typed u8.xyzw, r6.zwww, r3.xxxx
//   r6.xyzw = (int4)r2.xyzw + int4(1,1,1,1);
// // No code for instruction (needs manual fix):
// store_uav_typed u8.xyzw, r6.xyzw, r3.yyyy
//   r2.x = min(r5.y, r5.z);
//   r2.x = min(r5.x, r2.x);
//   r2.x = min(r2.x, r5.w);
//   r2.y = max(r5.y, r5.z);
//   r2.y = max(r5.x, r2.y);
//   r2.y = max(r2.y, r5.w);
//   r2.z = (int)r1.x + (int10)resourceTables__constants.framePhase;
//   r2.z = (int)r2.z & 1;
//   r3.xyz = (int3)r1.wxw & int3(1,1,1);
//   r2.z = cmp((int)r2.z == (int)r3.x);
//   r2.w = r2.z ? r2.x : r2.y;
// // No code for instruction (needs manual fix):
// store_uav_typed u10.xyzw, r1.xwww, r2.wwww
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r2.w;
//   GroupMemoryBarrierWithGroupSync();
//   r6.xyzw = (int4)vThreadIDInGroupFlattened.xxxx ^ int4(1,8,2,16);
//   r3.x = g0[r6.x].val[0/4];
//   r3.x = max(r3.x, r2.w);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r3.x;
//   GroupMemoryBarrierWithGroupSync();
//   r3.w = g0[r6.y].val[0/4];
//   r3.x = max(r3.x, r3.w);
//   r3.yz = cmp((int2)r3.yz == int2(0,0));
//   r3.y = r3.z ? r3.y : 0;
//   if (r3.y != 0) {
//     r7.xyzw = (uint4)r1.xwww >> int4(1,1,1,1);
//   // No code for instruction (needs manual fix):
//     store_uav_typed u11.xyzw, r7.xyzw, r3.xxxx
//   }
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r3.x;
//   GroupMemoryBarrierWithGroupSync();
//   r3.y = g0[r6.z].val[0/4];
//   r3.x = max(r3.x, r3.y);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r3.x;
//   GroupMemoryBarrierWithGroupSync();
//   r3.y = g0[r6.w].val[0/4];
//   r3.x = max(r3.x, r3.y);
//   r7.xyzw = (int4)r1.xwxw & int4(3,3,7,7);
//   r7.xyzw = cmp((int4)r7.xyzw == int4(0,0,0,0));
//   r3.yz = r7.yw ? r7.xz : 0;
//   if (r3.y != 0) {
//     r7.xyzw = (uint4)r1.xwww >> int4(2,2,2,2);
//   // No code for instruction (needs manual fix):
//     store_uav_typed u12.xyzw, r7.xyzw, r3.xxxx
//   }
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r3.x;
//   GroupMemoryBarrierWithGroupSync();
//   r3.y = (int)vThreadIDInGroupFlattened.x ^ 4;
//   r3.y = g0[r3.y].val[0/4];
//   r3.x = max(r3.x, r3.y);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r3.x;
//   GroupMemoryBarrierWithGroupSync();
//   r3.y = g0[32].val[0/4];
//   if (r3.z != 0) {
//     r3.x = max(r3.x, r3.y);
//     r7.xyzw = (uint4)r1.xwww >> int4(3,3,3,3);
//   // No code for instruction (needs manual fix):
//     store_uav_typed u13.xyzw, r7.xyzw, r3.xxxx
//   }
//   r3.x = min(r4.y, r4.z);
//   r3.x = min(r4.x, r3.x);
//   r3.x = min(r3.x, r4.w);
//   r3.y = max(r4.y, r4.z);
//   r3.y = max(r4.x, r3.y);
//   r3.y = max(r3.y, r4.w);
//   r2.z = r2.z ? r3.y : r3.x;
// // No code for instruction (needs manual fix):
// store_uav_typed u15.xyzw, r1.xwww, r2.zzzz
//   r2.z = max(9.99999975e-005, r2.w);
//   r2.z = rcp(r2.z);
//   r3.xyzw = r5.xyzw * r2.zzzz + float4(-1,-1,-1,-1);
//   r3.xyzw = cmp(abs(r3.xyzw) < float4(0.100000001,0.100000001,0.100000001,0.100000001));
//   r4.xyzw = cmp(r5.xyzw < float4(50,50,50,50));
//   r2.zw = r3.zw ? r3.xy : 0;
//   r2.z = (int)r2.w & (int)r2.z;
//   r2.z = ~(int)r2.z;
//   r4.xy = r4.zw ? r4.xy : 0;
//   r2.w = r4.y ? r4.x : 0;
//   r2.z = (int)r2.w & (int)r2.z;
//   if (r2.z != 0) {
//     r2.z = r3.z ? r3.w : 0;
//     if (r2.z != 0) {
//       r2.zw = float2(1.40129846e-045,0);
//     } else {
//       r4.xyz = r3.yxy ? r3.xwz : 0;
//       r3.xy = r3.xx ? float2(0,2.80259693e-045) : float2(2,2);
//       r3.xy = r3.zz ? float2(2,0) : r3.xy;
//       r3.xy = r3.ww ? float2(0,0) : r3.xy;
//       r3.xy = r4.zz ? float2(2,1) : r3.xy;
//       r3.xy = r4.yy ? float2(0,1.40129846e-045) : r3.xy;
//       r2.zw = r4.xx ? float2(1.40129846e-045,2.80259693e-045) : r3.xy;
//     }
//   } else {
//     r2.zw = float2(1.40129846e-045,1.40129846e-045);
//   }
//   r2.zw = (uint2)r2.zw;
//   r0.xw = r2.zw * float2(0.5,0.5) + r0.xw;
//   r0.xw = float2(0.5,0.5) + r0.xw;
//   r0.xw = resourceTables__constants.imageWidth1Rcp * r0.xw;
//   r3.xyz = resourceTables__passData.texNormal.SampleLevel(resourceTables__passData__smpLinearClamp_s, r0.xw, 0).xyz;
//   r3.w = resourceTables__passData.texGloss.SampleLevel(resourceTables__passData__smpLinearClamp_s, r0.xw, 0).z;
// // No code for instruction (needs manual fix):
// store_uav_typed u14.xyzw, r1.xwww, r3.xyzw
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r2.x;
//   GroupMemoryBarrierWithGroupSync();
//   r0.x = g0[r6.y].val[0/4];
//   r0.x = min(r2.x, r0.x);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.x;
//   GroupMemoryBarrierWithGroupSync();
//   r0.w = g0[r6.x].val[0/4];
//   r0.x = min(r0.x, r0.w);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r2.y;
//   GroupMemoryBarrierWithGroupSync();
//   r0.w = g0[r6.y].val[0/4];
//   r0.w = max(r2.y, r0.w);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.w;
//   GroupMemoryBarrierWithGroupSync();
//   r2.x = g0[r6.x].val[0/4];
//   r0.w = max(r2.x, r0.w);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.x;
//   GroupMemoryBarrierWithGroupSync();
//   r2.x = g0[r6.w].val[0/4];
//   r0.x = min(r2.x, r0.x);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.x;
//   GroupMemoryBarrierWithGroupSync();
//   r2.x = g0[r6.z].val[0/4];
//   r2.x = min(r2.x, r0.x);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.w;
//   GroupMemoryBarrierWithGroupSync();
//   r0.x = g0[r6.w].val[0/4];
//   r0.x = max(r0.w, r0.x);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.x;
//   GroupMemoryBarrierWithGroupSync();
//   r0.w = g0[r6.z].val[0/4];
//   r2.y = max(r0.x, r0.w);
//   r0.z = vThreadIDInGroupFlattened.x;
//   r0.xy = (int2)r0.zy & int2(3,3);
//   r0.xy = cmp((int2)r0.xy == int2(0,0));
//   r0.x = r0.y ? r0.x : 0;
//   r0.y = r2.x + r2.y;
//   r0.y = 0.5 * r0.y;
//   r3.xyzw = cmp(r5.xyzw < r0.yyyy);
//   r3.xyzw = r3.xyzw ? r5.xyzw : r2.xxxx;
//   r4.xyzw = cmp(r0.yyyy < r5.xyzw);
//   r4.xyzw = r4.xyzw ? r5.xyzw : r2.yyyy;
//   r0.y = max(r3.y, r3.z);
//   r0.y = max(r3.x, r0.y);
//   r0.y = max(r0.y, r3.w);
//   r0.z = min(r4.y, r4.z);
//   r0.z = min(r4.x, r0.z);
//   r0.z = min(r0.z, r4.w);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.y;
//   GroupMemoryBarrierWithGroupSync();
//   r0.w = g0[r6.x].val[0/4];
//   r0.y = max(r0.y, r0.w);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.y;
//   GroupMemoryBarrierWithGroupSync();
//   r0.w = g0[r6.y].val[0/4];
//   r0.y = max(r0.y, r0.w);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.y;
//   GroupMemoryBarrierWithGroupSync();
//   r0.w = g0[r6.z].val[0/4];
//   r0.y = max(r0.y, r0.w);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.y;
//   GroupMemoryBarrierWithGroupSync();
//   r0.w = g0[r6.w].val[0/4];
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.z;
//   GroupMemoryBarrierWithGroupSync();
//   r3.x = g0[r6.x].val[0/4];
//   r0.z = min(r3.x, r0.z);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.z;
//   GroupMemoryBarrierWithGroupSync();
//   r3.x = g0[r6.y].val[0/4];
//   r0.z = min(r3.x, r0.z);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.z;
//   GroupMemoryBarrierWithGroupSync();
//   r3.x = g0[r6.z].val[0/4];
//   r0.z = min(r3.x, r0.z);
//   GroupMemoryBarrierWithGroupSync();
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.z;
//   GroupMemoryBarrierWithGroupSync();
//   if (r0.x != 0) {
//     r2.z = max(r0.y, r0.w);
//     r0.x = g0[r6.w].val[0/4];
//     r2.w = min(r0.z, r0.x);
//     r0.xyzw = (uint4)r1.xyzw >> int4(2,2,2,2);
//   // No code for instruction (needs manual fix):
//     store_uav_typed u16.xyzw, r0.xyzw, r2.xyzw
//   }
//   return;
// }
//////////////////////////////// HLSL Errors ////////////////////////////////
// F:\SteamLibrary\steamapps\common\GodOfWar\ShaderFixes\e3cde40df9dab329-cs_replace.txt(43,42): error X3000: syntax error: unexpected token '.'
/////////////////////////////////////////////////////////////////////////////
