//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//
// Buffer Definitions: 
//
// cbuffer XeResolveConstants
// {
//
//   uint xe_resolve_edram_info;        // Offset:    0 Size:     4
//   uint xe_resolve_address_info;      // Offset:    4 Size:     4
//   uint xe_resolve_dest_info;         // Offset:    8 Size:     4
//   uint xe_resolve_dest_pitch;        // Offset:   12 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim      ID      HLSL Bind  Count
// ------------------------------ ---------- ------- ----------- ------- -------------- ------
// xe_resolve_source                 texture   uint2         buf      T0             t0      1 
// xe_resolve_dest                       UAV   uint2         buf      U0             u0      1 
// XeResolveConstants                cbuffer      NA          NA     CB0            cb0      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_1
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB0[0:0][1], immediateIndexed, space=0
dcl_resource_buffer (uint,uint,uint,uint) T0[0:0], space=0
dcl_uav_typed_buffer (uint,uint,uint,uint) U0[0:0], space=0
dcl_input vThreadID.xy
dcl_temps 6
dcl_thread_group 8, 8, 1
ushr r0.xy, CB0[0][0].yyyy, l(5, 29, 0, 0)
mov r0.z, CB0[0][0].y
bfi r1.xy, l(5, 2, 0, 0), l(3, 3, 0, 0), r0.zxzz, l(0, 0, 0, 0)
iadd r1.xy, r1.xyxx, vThreadID.xyxx
and r2.xyzw, CB0[0][0].xxwz, l(1023, 0x40000000, 0x00003fff, 7)
ubfe r1.zw, l(0, 0, 12, 2), l(0, 0, 13, 10), CB0[0][0].xxxx
uge r0.w, l(3), r0.y
if_nz r0.w
  mov r3.y, r0.y
else 
  ieq r0.w, r0.y, l(5)
  if_nz r0.w
    mov r3.y, l(2)
  else 
    mov r3.y, l(0)
  endif 
endif 
uge r0.yw, r1.wwww, l(0, 2, 0, 1)
and r0.yw, r0.yyyw, l(0, 1, 0, 1)
ishl r0.yw, r1.xxxy, r0.yyyw
ushr r3.x, r3.y, l(1)
and r1.xy, r3.xyxx, l(1, 1, 0, 0)
iadd r0.yw, r0.yyyw, r1.xxxy
udiv r1.xy, null, r0.ywyy, l(80, 16, 0, 0)
ishl r1.w, r1.x, l(1)
imad r1.w, r1.y, r2.x, r1.w
iadd r1.z, r1.w, r1.z
imad r0.yw, -r1.xxxy, l(0, 80, 0, 16), r0.yyyw
imad r0.y, r0.w, l(80), r0.y
ishl r0.y, r0.y, l(1)
imad r0.y, r1.z, l(1280), r0.y
imul null, r0.y, r0.y, l(9)
movc r1.xy, vThreadID.xyxx, l(0,0,0,0), l(1,1,0,0)
movc r1.xy, r2.yyyy, r1.xyxx, l(0,0,0,0)
bfi r3.xyzw, l(2, 2, 2, 2), l(3, 3, 3, 3), r0.zxxz, l(0, 0, 0, 0)
iadd r3.xyzw, r3.xyzw, vThreadID.xyyx
and r0.xz, CB0[0][0].zzzz, l(8, 0, 0x01000000, 0)
if_nz r0.x
  ubfe r2.xy, l(3, 14, 0, 0), l(4, 16, 0, 0), CB0[0][0].zwzz
  iadd r0.xw, r2.yyyz, l(31, 0, 0, 31)
  ishr r4.xyzw, r3.zwzw, l(4, 5, 3, 3)
  ishr r1.z, r2.x, l(2)
  ushr r0.xw, r0.xxxw, l(4, 0, 0, 5)
  and r0.x, r0.x, l(2046)
  imad r0.x, r1.z, r0.x, r4.x
  imad r0.x, r0.x, r0.w, r4.y
  ishl r0.w, r3.z, l(11)
  and r0.w, r0.w, l(0x00003000)
  bfi r0.w, l(3), l(9), r3.w, r0.w
  ishr r0.w, r0.w, l(6)
  iadd r1.z, r1.z, r4.z
  bfi r1.w, l(1), l(1), r1.z, l(0)
  iadd r1.w, r1.w, r4.w
  bfi r1.w, l(2), l(1), r1.w, l(0)
  bfi r1.z, l(1), l(0), r1.z, r1.w
  and r1.w, r0.w, l(240)
  bfi r4.xy, l(19, 19, 0, 0), l(11, 14, 0, 0), r0.xxxx, l(0, 0, 0, 0)
  imad r4.xy, r1.wwww, l(2, 16, 0, 0), r4.xyxx
  bfi r0.xw, l(4, 0, 0, 4), l(0, 0, 0, 3), r0.wwww, r4.xxxy
  bfi r0.xw, l(2, 0, 0, 2), l(9, 0, 0, 12), r2.xxxx, r0.xxxw
  ubfe r1.w, l(3), l(6), r0.x
  and r2.x, r1.z, l(6)
  bfi r1.z, l(1), l(8), r1.z, l(0)
  imad r1.z, r1.w, l(32), r1.z
  imad r1.z, r2.x, l(4), r1.z
  bfi r0.xw, l(1, 0, 0, 1), l(4, 0, 0, 7), r3.zzzz, r0.xxxw
  bfi r0.w, l(9), l(3), r1.z, r0.w
  bfi r0.x, l(6), l(0), r0.x, r0.w
else 
  ishr r4.xyzw, r3.xyzw, l(5, 5, 2, 3)
  iadd r0.w, r2.z, l(31)
  ushr r0.w, r0.w, l(5)
  imad r0.w, r4.y, r0.w, r4.x
  ishl r1.zw, r3.zzzz, l(0, 0, 5, 7)
  and r1.zw, r1.zzzw, l(0, 0, 448, 2048)
  bfi r2.x, l(3), l(3), r3.w, r1.z
  ishl r1.z, r1.z, l(1)
  bfi r1.z, l(3), l(4), r3.w, r1.z
  and r1.z, r1.z, l(992)
  bfi r2.y, l(22), l(10), r0.w, r1.z
  bfi r2.y, l(4), l(0), r2.x, r2.y
  ishl r3.xy, r1.zzzz, l(3, 2, 0, 0)
  bfi r3.xy, l(22, 22, 0, 0), l(13, 12, 0, 0), r0.wwww, r3.xyxx
  bfi r2.xz, l(4, 0, 4, 0), l(3, 0, 2, 0), r2.xxxx, r3.xxyx
  bfi r2.xyz, l(1, 1, 1, 0), l(7, 4, 6, 0), r3.zzzz, r2.xyzx
  bfi r0.w, l(12), l(0), r1.w, r2.x
  and r1.z, r2.z, l(1792)
  iadd r0.w, r0.w, r1.z
  and r1.z, r4.z, l(2)
  iadd r1.z, r4.w, r1.z
  bfi r1.z, l(2), l(6), r1.z, l(0)
  iadd r0.w, r0.w, r1.z
  bfi r0.x, l(6), l(0), r2.y, r0.w
endif 
imul null, r0.x, r0.x, l(9)
ushr r0.xy, r0.xyxx, l(3, 1, 0, 0)
imad r0.w, r1.y, l(3), r0.y
iadd r1.y, r1.x, r0.w
ld r1.yz, r1.yyyy, T0[0].zxyw
if_nz r0.z
  ubfe r1.w, l(4), l(25), CB0[0][0].x
  ieq r2.xy, r1.wwww, l(5, 7, 0, 0)
  or r1.w, r2.y, r2.x
  if_nz r1.w
    bfi r1.yz, l(0, 16, 16, 0), l(0, 0, 0, 0), r1.zzyz, r1.yyzy
  endif 
endif 
ieq r1.w, r2.w, l(4)
if_nz r1.w
  mov r1.yz, r1.zzyz
  mov r2.x, l(2)
else 
  mov r2.x, r2.w
endif 
ieq r2.xyz, r2.xxxx, l(1, 2, 3, 0)
or r2.xy, r2.yzyy, r2.xyxx
if_nz r2.x
  ishl r2.xz, r1.yyzy, l(8, 0, 8, 0)
  and r2.xz, r2.xxzx, l(0xff00ff00, 0, 0xff00ff00, 0)
  ushr r3.xy, r1.yzyy, l(8, 8, 0, 0)
  and r3.xy, r3.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r1.yz, r2.xxzx, r3.xxyx
endif 
if_nz r2.y
  ushr r2.xy, r1.yzyy, l(16, 16, 0, 0)
  bfi r1.yz, l(0, 16, 16, 0), l(0, 16, 16, 0), r1.yyzy, r2.xxyx
endif 
store_uav_typed U0[0].xyzw, r0.xxxx, r1.yzyy
iadd r3.xyzw, r0.xxxx, l(1, 2, 3, 4)
iadd r1.yz, r0.wwww, l(0, 1, 2, 0)
ld r2.xy, r1.yyyy, T0[0].xyzw
if_nz r0.z
  ubfe r0.w, l(4), l(25), CB0[0][0].x
  ieq r4.xy, r0.wwww, l(5, 7, 0, 0)
  or r0.w, r4.y, r4.x
  if_nz r0.w
    bfi r2.xy, l(16, 16, 0, 0), l(0, 0, 0, 0), r2.yxyy, r2.xyxx
  endif 
endif 
if_nz r1.w
  mov r2.xy, r2.yxyy
  mov r0.w, l(2)
else 
  mov r0.w, r2.w
endif 
ieq r4.xyz, r0.wwww, l(1, 2, 3, 0)
or r4.xy, r4.yzyy, r4.xyxx
if_nz r4.x
  ishl r4.xz, r2.xxyx, l(8, 0, 8, 0)
  and r4.xz, r4.xxzx, l(0xff00ff00, 0, 0xff00ff00, 0)
  ushr r5.xy, r2.xyxx, l(8, 8, 0, 0)
  and r5.xy, r5.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r2.xy, r4.xzxx, r5.xyxx
endif 
if_nz r4.y
  ushr r4.xy, r2.xyxx, l(16, 16, 0, 0)
  bfi r2.xy, l(16, 16, 0, 0), l(16, 16, 0, 0), r2.xyxx, r4.xyxx
endif 
store_uav_typed U0[0].xyzw, r3.xxxx, r2.xyxx
ld r1.yz, r1.zzzz, T0[0].zxyw
if_nz r0.z
  ubfe r0.w, l(4), l(25), CB0[0][0].x
  ieq r2.xy, r0.wwww, l(5, 7, 0, 0)
  or r0.w, r2.y, r2.x
  if_nz r0.w
    bfi r1.yz, l(0, 16, 16, 0), l(0, 0, 0, 0), r1.zzyz, r1.yyzy
  endif 
endif 
if_nz r1.w
  mov r1.yz, r1.zzyz
  mov r0.w, l(2)
else 
  mov r0.w, r2.w
endif 
ieq r2.xyz, r0.wwww, l(1, 2, 3, 0)
or r2.xy, r2.yzyy, r2.xyxx
if_nz r2.x
  ishl r2.xz, r1.yyzy, l(8, 0, 8, 0)
  and r2.xz, r2.xxzx, l(0xff00ff00, 0, 0xff00ff00, 0)
  ushr r4.xy, r1.yzyy, l(8, 8, 0, 0)
  and r4.xy, r4.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r1.yz, r2.xxzx, r4.xxyx
endif 
if_nz r2.y
  ushr r2.xy, r1.yzyy, l(16, 16, 0, 0)
  bfi r1.yz, l(0, 16, 16, 0), l(0, 16, 16, 0), r1.yyzy, r2.xxyx
endif 
store_uav_typed U0[0].xyzw, r3.yyyy, r1.yzyy
iadd r0.w, r1.x, r0.y
iadd r1.xy, r0.wwww, l(3, 6, 0, 0)
ld r1.xz, r1.xxxx, T0[0].xzyw
if_nz r0.z
  ubfe r0.w, l(4), l(25), CB0[0][0].x
  ieq r2.xy, r0.wwww, l(5, 7, 0, 0)
  or r0.w, r2.y, r2.x
  if_nz r0.w
    bfi r1.xz, l(16, 0, 16, 0), l(0, 0, 0, 0), r1.zzxz, r1.xxzx
  endif 
endif 
if_nz r1.w
  mov r1.xz, r1.zzxz
  mov r0.w, l(2)
else 
  mov r0.w, r2.w
endif 
ieq r2.xyz, r0.wwww, l(1, 2, 3, 0)
or r2.xy, r2.yzyy, r2.xyxx
if_nz r2.x
  ishl r2.xz, r1.xxzx, l(8, 0, 8, 0)
  and r2.xz, r2.xxzx, l(0xff00ff00, 0, 0xff00ff00, 0)
  ushr r3.xy, r1.xzxx, l(8, 8, 0, 0)
  and r3.xy, r3.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r1.xz, r2.xxzx, r3.xxyx
endif 
if_nz r2.y
  ushr r2.xy, r1.xzxx, l(16, 16, 0, 0)
  bfi r1.xz, l(16, 0, 16, 0), l(16, 0, 16, 0), r1.xxzx, r2.xxyx
endif 
store_uav_typed U0[0].xyzw, r3.zzzz, r1.xzxx
iadd r4.xyzw, r0.yyyy, l(4, 5, 7, 8)
ld r0.yw, r4.xxxx, T0[0].zxwy
if_nz r0.z
  ubfe r1.x, l(4), l(25), CB0[0][0].x
  ieq r1.xz, r1.xxxx, l(5, 0, 7, 0)
  or r1.x, r1.z, r1.x
  if_nz r1.x
    bfi r0.yw, l(0, 16, 0, 16), l(0, 0, 0, 0), r0.wwwy, r0.yyyw
  endif 
endif 
if_nz r1.w
  mov r0.yw, r0.wwwy
  mov r1.x, l(2)
else 
  mov r1.x, r2.w
endif 
ieq r2.xyz, r1.xxxx, l(1, 2, 3, 0)
or r1.xz, r2.yyzy, r2.xxyx
if_nz r1.x
  ishl r2.xy, r0.ywyy, l(8, 8, 0, 0)
  and r2.xy, r2.xyxx, l(0xff00ff00, 0xff00ff00, 0, 0)
  ushr r3.xy, r0.ywyy, l(8, 8, 0, 0)
  and r3.xy, r3.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r0.yw, r2.xxxy, r3.xxxy
endif 
if_nz r1.z
  ushr r1.xz, r0.yywy, l(16, 0, 16, 0)
  bfi r0.yw, l(0, 16, 0, 16), l(0, 16, 0, 16), r0.yyyw, r1.xxxz
endif 
store_uav_typed U0[0].xyzw, r3.wwww, r0.ywyy
iadd r3.xyzw, r0.xxxx, l(5, 6, 7, 8)
ld r0.yw, r4.yyyy, T0[0].zxwy
if_nz r0.z
  ubfe r1.x, l(4), l(25), CB0[0][0].x
  ieq r1.xz, r1.xxxx, l(5, 0, 7, 0)
  or r1.x, r1.z, r1.x
  if_nz r1.x
    bfi r0.yw, l(0, 16, 0, 16), l(0, 0, 0, 0), r0.wwwy, r0.yyyw
  endif 
endif 
if_nz r1.w
  mov r0.yw, r0.wwwy
  mov r1.x, l(2)
else 
  mov r1.x, r2.w
endif 
ieq r2.xyz, r1.xxxx, l(1, 2, 3, 0)
or r1.xz, r2.yyzy, r2.xxyx
if_nz r1.x
  ishl r2.xy, r0.ywyy, l(8, 8, 0, 0)
  and r2.xy, r2.xyxx, l(0xff00ff00, 0xff00ff00, 0, 0)
  ushr r4.xy, r0.ywyy, l(8, 8, 0, 0)
  and r4.xy, r4.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r0.yw, r2.xxxy, r4.xxxy
endif 
if_nz r1.z
  ushr r1.xz, r0.yywy, l(16, 0, 16, 0)
  bfi r0.yw, l(0, 16, 0, 16), l(0, 16, 0, 16), r0.yyyw, r1.xxxz
endif 
store_uav_typed U0[0].xyzw, r3.xxxx, r0.ywyy
ld r0.yw, r1.yyyy, T0[0].zxwy
if_nz r0.z
  ubfe r1.x, l(4), l(25), CB0[0][0].x
  ieq r1.xy, r1.xxxx, l(5, 7, 0, 0)
  or r1.x, r1.y, r1.x
  if_nz r1.x
    bfi r0.yw, l(0, 16, 0, 16), l(0, 0, 0, 0), r0.wwwy, r0.yyyw
  endif 
endif 
if_nz r1.w
  mov r0.yw, r0.wwwy
  mov r1.x, l(2)
else 
  mov r1.x, r2.w
endif 
ieq r1.xyz, r1.xxxx, l(1, 2, 3, 0)
or r1.xy, r1.yzyy, r1.xyxx
if_nz r1.x
  ishl r1.xz, r0.yywy, l(8, 0, 8, 0)
  and r1.xz, r1.xxzx, l(0xff00ff00, 0, 0xff00ff00, 0)
  ushr r2.xy, r0.ywyy, l(8, 8, 0, 0)
  and r2.xy, r2.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r0.yw, r1.xxxz, r2.xxxy
endif 
if_nz r1.y
  ushr r1.xy, r0.ywyy, l(16, 16, 0, 0)
  bfi r0.yw, l(0, 16, 0, 16), l(0, 16, 0, 16), r0.yyyw, r1.xxxy
endif 
store_uav_typed U0[0].xyzw, r3.yyyy, r0.ywyy
ld r0.yw, r4.zzzz, T0[0].zxwy
if_nz r0.z
  ubfe r1.x, l(4), l(25), CB0[0][0].x
  ieq r1.xy, r1.xxxx, l(5, 7, 0, 0)
  or r1.x, r1.y, r1.x
  if_nz r1.x
    bfi r0.yw, l(0, 16, 0, 16), l(0, 0, 0, 0), r0.wwwy, r0.yyyw
  endif 
endif 
if_nz r1.w
  mov r0.yw, r0.wwwy
  mov r1.x, l(2)
else 
  mov r1.x, r2.w
endif 
ieq r1.xyz, r1.xxxx, l(1, 2, 3, 0)
or r1.xy, r1.yzyy, r1.xyxx
if_nz r1.x
  ishl r1.xz, r0.yywy, l(8, 0, 8, 0)
  and r1.xz, r1.xxzx, l(0xff00ff00, 0, 0xff00ff00, 0)
  ushr r2.xy, r0.ywyy, l(8, 8, 0, 0)
  and r2.xy, r2.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r0.yw, r1.xxxz, r2.xxxy
endif 
if_nz r1.y
  ushr r1.xy, r0.ywyy, l(16, 16, 0, 0)
  bfi r0.yw, l(0, 16, 0, 16), l(0, 16, 0, 16), r0.yyyw, r1.xxxy
endif 
store_uav_typed U0[0].xyzw, r3.zzzz, r0.ywyy
ld r0.yw, r4.wwww, T0[0].zxwy
if_nz r0.z
  ubfe r0.z, l(4), l(25), CB0[0][0].x
  ieq r1.xy, r0.zzzz, l(5, 7, 0, 0)
  or r0.z, r1.y, r1.x
  if_nz r0.z
    bfi r0.yw, l(0, 16, 0, 16), l(0, 0, 0, 0), r0.wwwy, r0.yyyw
  endif 
endif 
if_nz r1.w
  mov r0.yw, r0.wwwy
  mov r2.w, l(2)
endif 
ieq r1.xyz, r2.wwww, l(1, 2, 3, 0)
or r1.xy, r1.yzyy, r1.xyxx
if_nz r1.x
  ishl r1.xz, r0.yywy, l(8, 0, 8, 0)
  and r1.xz, r1.xxzx, l(0xff00ff00, 0, 0xff00ff00, 0)
  ushr r2.xy, r0.ywyy, l(8, 8, 0, 0)
  and r2.xy, r2.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r0.yw, r1.xxxz, r2.xxxy
endif 
if_nz r1.y
  ushr r1.xy, r0.ywyy, l(16, 16, 0, 0)
  bfi r0.yw, l(0, 16, 0, 16), l(0, 16, 0, 16), r0.yyyw, r1.xxxy
endif 
store_uav_typed U0[0].xyzw, r3.wwww, r0.ywyy
ret 
// Approximately 365 instruction slots used
