//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.16 on Tue Dec 29 10:48:42 2020
//
//
// Buffer Definitions:
//
// cbuffer CBufferUserConstant_Z
// {
//
//   struct StructUserConstant_Z
//   {
//
//       float4 c[58];                  // Offset:    0
//
//   } User;                            // Offset:    0 Size:   928
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// sUserResource0Sampler             sampler      NA          NA    0        1
// sUserResource0                    texture  float4          2d    0        1
// OutputDepthMip0                       UAV   float          2d    0        1
// OutputDepthMip1                       UAV   float          2d    1        1
// OutputDepthMip2                       UAV   float          2d    2        1
// OutputDepthMip3                       UAV   float          2d    3        1
// OutputDepthMip4                       UAV   float          2d    4        1
// OutputDepthMip5                       UAV   float          2d    5        1
// CBufferUserConstant_Z             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[2], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_uav_typed_texture2d (float,float,float,float) u0
dcl_uav_typed_texture2d (float,float,float,float) u1
dcl_uav_typed_texture2d (float,float,float,float) u2
dcl_uav_typed_texture2d (float,float,float,float) u3
dcl_uav_typed_texture2d (float,float,float,float) u4
dcl_uav_typed_texture2d (float,float,float,float) u5
dcl_input vThreadIDInGroupFlattened
dcl_input vThreadID.xy
dcl_temps 2
dcl_tgsm_structured g0, 4, 1024
dcl_thread_group 32, 32, 1
ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[1].z
if_nz r0.x
  utof r0.xy, vThreadID.xyxx
  add r0.xy, r0.xyxx, cb0[0].xyxx
  ftoi r0.xy, r0.xyxx
  mov r0.zw, l(0,0,0,0)
  ld_indexable(texture2d)(float,float,float,float) r0.x, r0.xyzw, t0.xyzw
else
  ishl r0.yz, vThreadID.xxyx, l(0, 1, 1, 0)
  utof r0.yz, r0.yyzy
  add r0.yz, r0.yyzy, l(0.000000, 0.500000, 0.500000, 0.000000)
  mul r0.yz, r0.yyzy, cb0[0].zzwz
  gather4_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.yzyy, t0.xyzw, s0.x
  min r0.y, r1.z, r1.y
  min r0.y, r0.y, r1.x
  min r0.x, r1.w, r0.y
endif
store_uav_typed u0.xyzw, vThreadID.xyyy, r0.xxxx
ftou r0.y, cb0[1].y
ieq r0.z, r0.y, l(1)
if_nz r0.z
  ret
endif
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.x
sync_g_t
and r0.z, vThreadIDInGroupFlattened.x, l(33)
if_z r0.z
  iadd r1.xyz, vThreadIDInGroupFlattened.xxxx, l(1, 32, 33, 0)
  ld_structured r0.z, r1.x, l(0), g0.xxxx
  ld_structured r0.w, r1.y, l(0), g0.xxxx
  ld_structured r1.x, r1.z, l(0), g0.xxxx
  min r0.z, r0.w, r0.z
  min r0.z, r0.z, r0.x
  min r0.x, r1.x, r0.z
  ushr r1.xyzw, vThreadID.xyyy, l(1, 1, 1, 1)
  store_uav_typed u1.xyzw, r1.xyzw, r0.xxxx
  store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.x
endif
ieq r0.z, r0.y, l(2)
if_nz r0.z
  ret
endif
sync_g_t
and r0.z, vThreadIDInGroupFlattened.x, l(99)
if_z r0.z
  iadd r1.xyz, vThreadIDInGroupFlattened.xxxx, l(2, 64, 66, 0)
  ld_structured r0.z, r1.x, l(0), g0.xxxx
  ld_structured r0.w, r1.y, l(0), g0.xxxx
  ld_structured r1.x, r1.z, l(0), g0.xxxx
  min r0.z, r0.w, r0.z
  min r0.z, r0.z, r0.x
  min r0.x, r1.x, r0.z
  ushr r1.xyzw, vThreadID.xyyy, l(2, 2, 2, 2)
  store_uav_typed u2.xyzw, r1.xyzw, r0.xxxx
  store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.x
endif
ieq r0.z, r0.y, l(3)
if_nz r0.z
  ret
endif
sync_g_t
and r0.z, vThreadIDInGroupFlattened.x, l(231)
if_z r0.z
  iadd r1.xyz, vThreadIDInGroupFlattened.xxxx, l(4, 128, 132, 0)
  ld_structured r0.z, r1.x, l(0), g0.xxxx
  ld_structured r0.w, r1.y, l(0), g0.xxxx
  ld_structured r1.x, r1.z, l(0), g0.xxxx
  min r0.z, r0.w, r0.z
  min r0.z, r0.z, r0.x
  min r0.x, r1.x, r0.z
  ushr r1.xyzw, vThreadID.xyyy, l(3, 3, 3, 3)
  store_uav_typed u3.xyzw, r1.xyzw, r0.xxxx
  store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.x
endif
ieq r0.z, r0.y, l(4)
if_nz r0.z
  ret
endif
sync_g_t
and r0.z, vThreadIDInGroupFlattened.x, l(495)
if_z r0.z
  iadd r1.xyz, vThreadIDInGroupFlattened.xxxx, l(8, 256, 264, 0)
  ld_structured r0.z, r1.x, l(0), g0.xxxx
  ld_structured r0.w, r1.y, l(0), g0.xxxx
  ld_structured r1.x, r1.z, l(0), g0.xxxx
  min r0.z, r0.w, r0.z
  min r0.z, r0.z, r0.x
  min r0.x, r1.x, r0.z
  ushr r1.xyzw, vThreadID.xyyy, l(4, 4, 4, 4)
  store_uav_typed u4.xyzw, r1.xyzw, r0.xxxx
  store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.x
endif
ieq r0.y, r0.y, l(5)
if_nz r0.y
  ret
endif
sync_g_t
if_z vThreadIDInGroupFlattened.x
  ld_structured r0.y, l(16), l(0), g0.xxxx
  ld_structured r0.z, l(512), l(0), g0.xxxx
  ld_structured r0.w, l(528), l(0), g0.xxxx
  min r0.y, r0.z, r0.y
  min r0.x, r0.y, r0.x
  min r0.x, r0.w, r0.x
  ushr r1.xyzw, vThreadID.xyyy, l(5, 5, 5, 5)
  store_uav_typed u5.xyzw, r1.xyzw, r0.xxxx
endif
ret
// Approximately 108 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v1.3.16 on Tue Dec 29 10:48:42 2020
// groupshared struct { float val[1]; } g0[1024];
//
// cbuffer CBufferUserConstant_Z : register(b0)
// {
//
//   struct
//   {
//     float4 c[58];
//   } User : packoffset(c0);
//
// }
//
// SamplerState sUserResource0Sampler_s : register(s0);
// Texture2D<float4> sUserResource0 : register(t0);
// RWTexture2D<float> OutputDepthMip0 : register(u0);
// RWTexture2D<float> OutputDepthMip1 : register(u1);
// RWTexture2D<float> OutputDepthMip2 : register(u2);
// RWTexture2D<float> OutputDepthMip3 : register(u3);
// RWTexture2D<float> OutputDepthMip4 : register(u4);
// RWTexture2D<float> OutputDepthMip5 : register(u5);
//
//
// // 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) u0
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u1
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u2
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u3
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u4
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u5
//   float4 r0,r1;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_thread_group 32, 32, 1
//   r0.x = cmp(0 != User.c[1].z);
//   if (r0.x != 0) {
//     r0.xy = (uint2)vThreadID.xy;
//     r0.xy = User.c[0].xy + r0.xy;
//     r0.xy = (int2)r0.xy;
//     r0.zw = float2(0,0);
//     r0.x = sUserResource0.Load(r0.xyz).x;
//   } else {
//     r0.yz = (uint2)vThreadID.xy << int2(1,1);
//     r0.yz = (uint2)r0.yz;
//     r0.yz = float2(0.5,0.5) + r0.yz;
//     r0.yz = User.c[0].zw * r0.yz;
//     r1.xyzw = sUserResource0.Gather(sUserResource0Sampler_s, r0.yz).xyzw;
//     r0.y = min(r1.y, r1.z);
//     r0.y = min(r1.x, r0.y);
//     r0.x = min(r0.y, r1.w);
//   }
// // No code for instruction (needs manual fix):
// store_uav_typed u0.xyzw, vThreadID.xyyy, r0.xxxx
//   r0.y = (uint)User.c[1].y;
//   r0.z = cmp((int)r0.y == 1);
//   if (r0.z != 0) {
//     return;
//   }
//   g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.x;
//   GroupMemoryBarrierWithGroupSync();
//   r0.z = (int)vThreadIDInGroupFlattened.x & 33;
//   if (r0.z == 0) {
//     r1.xyz = (int3)vThreadIDInGroupFlattened.xxx + int3(1,32,33);
//     r0.z = g0[r1.x].val[0/4];
//     r0.w = g0[r1.y].val[0/4];
//     r1.x = g0[r1.z].val[0/4];
//     r0.z = min(r0.z, r0.w);
//     r0.z = min(r0.x, r0.z);
//     r0.x = min(r0.z, r1.x);
//     r1.xyzw = (uint4)vThreadID.xyyy >> int4(1,1,1,1);
//   // No code for instruction (needs manual fix):
//     store_uav_typed u1.xyzw, r1.xyzw, r0.xxxx
//     g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.x;
//   }
//   r0.z = cmp((int)r0.y == 2);
//   if (r0.z != 0) {
//     return;
//   }
//   GroupMemoryBarrierWithGroupSync();
//   r0.z = (int)vThreadIDInGroupFlattened.x & 99;
//   if (r0.z == 0) {
//     r1.xyz = (int3)vThreadIDInGroupFlattened.xxx + int3(2,64,66);
//     r0.z = g0[r1.x].val[0/4];
//     r0.w = g0[r1.y].val[0/4];
//     r1.x = g0[r1.z].val[0/4];
//     r0.z = min(r0.z, r0.w);
//     r0.z = min(r0.x, r0.z);
//     r0.x = min(r0.z, r1.x);
//     r1.xyzw = (uint4)vThreadID.xyyy >> int4(2,2,2,2);
//   // No code for instruction (needs manual fix):
//     store_uav_typed u2.xyzw, r1.xyzw, r0.xxxx
//     g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.x;
//   }
//   r0.z = cmp((int)r0.y == 3);
//   if (r0.z != 0) {
//     return;
//   }
//   GroupMemoryBarrierWithGroupSync();
//   r0.z = (int)vThreadIDInGroupFlattened.x & 231;
//   if (r0.z == 0) {
//     r1.xyz = (int3)vThreadIDInGroupFlattened.xxx + int3(4,128,132);
//     r0.z = g0[r1.x].val[0/4];
//     r0.w = g0[r1.y].val[0/4];
//     r1.x = g0[r1.z].val[0/4];
//     r0.z = min(r0.z, r0.w);
//     r0.z = min(r0.x, r0.z);
//     r0.x = min(r0.z, r1.x);
//     r1.xyzw = (uint4)vThreadID.xyyy >> int4(3,3,3,3);
//   // No code for instruction (needs manual fix):
//     store_uav_typed u3.xyzw, r1.xyzw, r0.xxxx
//     g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.x;
//   }
//   r0.z = cmp((int)r0.y == 4);
//   if (r0.z != 0) {
//     return;
//   }
//   GroupMemoryBarrierWithGroupSync();
//   r0.z = (int)vThreadIDInGroupFlattened.x & 495;
//   if (r0.z == 0) {
//     r1.xyz = (int3)vThreadIDInGroupFlattened.xxx + int3(8,256,264);
//     r0.z = g0[r1.x].val[0/4];
//     r0.w = g0[r1.y].val[0/4];
//     r1.x = g0[r1.z].val[0/4];
//     r0.z = min(r0.z, r0.w);
//     r0.z = min(r0.x, r0.z);
//     r0.x = min(r0.z, r1.x);
//     r1.xyzw = (uint4)vThreadID.xyyy >> int4(4,4,4,4);
//   // No code for instruction (needs manual fix):
//     store_uav_typed u4.xyzw, r1.xyzw, r0.xxxx
//     g0[vThreadIDInGroupFlattened.x].val[0/4] = r0.x;
//   }
//   r0.y = cmp((int)r0.y == 5);
//   if (r0.y != 0) {
//     return;
//   }
//   GroupMemoryBarrierWithGroupSync();
//   if (vThreadIDInGroupFlattened.x == 0) {
//     r0.y = g0[16].val[0/4];
//     r0.z = g0[512].val[0/4];
//     r0.w = g0[528].val[0/4];
//     r0.y = min(r0.y, r0.z);
//     r0.x = min(r0.x, r0.y);
//     r0.x = min(r0.x, r0.w);
//     r1.xyzw = (uint4)vThreadID.xyyy >> int4(5,5,5,5);
//   // No code for instruction (needs manual fix):
//     store_uav_typed u5.xyzw, r1.xyzw, r0.xxxx
//   }
//   return;
// }
//////////////////////////////// HLSL Errors ////////////////////////////////
// E:\Games\SteamLibrary\steamapps\common\A Plague Tale Innocence\ShaderFixes\b8f1d870372eee44-cs_replace.txt(30,10): error X3000: syntax error: unexpected token ')'
/////////////////////////////////////////////////////////////////////////////
