//
// 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_aligned;// 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].zxxz, l(7, 1023, 0x40000000, 8)
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.y, 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.zzzz, 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
bfi r0.x, l(10), l(5), CB0[0][0].w, l(0)
if_nz r2.w
  ubfe r0.z, l(3), l(4), CB0[0][0].z
  ushr r0.w, CB0[0][0].w, l(10)
  ishl r0.w, r0.w, l(5)
  ishr r4.xyzw, r3.zwzw, l(4, 5, 3, 3)
  ishr r1.z, r0.z, l(2)
  ushr r0.w, r0.w, l(4)
  and r0.w, r0.w, l(0x00007ffe)
  imad r0.w, r1.z, r0.w, r4.x
  ushr r1.w, r0.x, l(5)
  imad r0.w, r0.w, r1.w, r4.y
  ishl r1.w, r3.z, l(11)
  and r1.w, r1.w, l(0x00003000)
  bfi r1.w, l(3), l(9), r3.w, r1.w
  ishr r1.w, r1.w, l(6)
  iadd r1.z, r1.z, r4.z
  bfi r2.y, l(1), l(1), r1.z, l(0)
  iadd r2.y, r2.y, r4.w
  bfi r2.y, l(2), l(1), r2.y, l(0)
  bfi r1.z, l(1), l(0), r1.z, r2.y
  and r2.y, r1.w, l(240)
  bfi r2.zw, l(0, 0, 19, 19), l(0, 0, 11, 14), r0.wwww, l(0, 0, 0, 0)
  imad r2.yz, r2.yyyy, l(0, 2, 16, 0), r2.zzwz
  bfi r2.yz, l(0, 4, 4, 0), l(0, 0, 3, 0), r1.wwww, r2.yyzy
  bfi r0.zw, l(0, 0, 2, 2), l(0, 0, 9, 12), r0.zzzz, r2.yyyz
  ubfe r1.w, l(3), l(6), r0.z
  and r2.y, 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.y, l(4), r1.z
  bfi r0.zw, l(0, 0, 1, 1), l(0, 0, 4, 7), r3.zzzz, r0.zzzw
  bfi r0.w, l(9), l(3), r1.z, r0.w
  bfi r0.z, l(6), l(0), r0.z, r0.w
else 
  ishr r4.xyzw, r3.xyzw, l(5, 5, 2, 3)
  ushr r0.x, r0.x, l(5)
  imad r0.x, r4.y, r0.x, r4.x
  ishl r1.zw, r3.zzzz, l(0, 0, 5, 7)
  and r1.zw, r1.zzzw, l(0, 0, 448, 2048)
  bfi r0.w, 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.x, r1.z
  bfi r2.y, l(4), l(0), r0.w, r2.y
  bfi r2.y, l(1), l(4), r3.z, r2.y
  ishl r2.zw, r1.zzzz, l(0, 0, 3, 2)
  bfi r2.zw, l(0, 0, 22, 22), l(0, 0, 13, 12), r0.xxxx, r2.zzzw
  bfi r0.xw, l(4, 0, 0, 4), l(3, 0, 0, 2), r0.wwww, r2.zzzw
  bfi r0.xw, l(1, 0, 0, 1), l(7, 0, 0, 6), r3.zzzz, r0.xxxw
  bfi r0.x, l(12), l(0), r1.w, r0.x
  and r0.w, r0.w, l(1792)
  iadd r0.x, r0.x, r0.w
  and r0.w, r4.z, l(2)
  iadd r0.w, r4.w, r0.w
  bfi r0.w, l(2), l(6), r0.w, l(0)
  iadd r0.x, r0.x, r0.w
  bfi r0.z, l(6), l(0), r2.y, r0.x
endif 
imul null, r0.x, r0.z, l(9)
ushr r0.xy, r0.xyxx, l(3, 1, 0, 0)
imad r0.z, r1.y, l(3), r0.y
iadd r0.w, r1.x, r0.z
ld r1.yz, r0.wwww, T0[0].zxyw
and r0.w, CB0[0][0].z, l(0x01000000)
if_nz r0.w
  ubfe r1.w, l(4), l(25), CB0[0][0].x
  ieq r2.yz, r1.wwww, l(0, 5, 7, 0)
  or r1.w, r2.z, r2.y
  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.x, l(4)
if_nz r1.w
  mov r1.yz, r1.zzyz
  mov r2.y, l(2)
else 
  mov r2.y, r2.x
endif 
ieq r2.yzw, r2.yyyy, l(0, 1, 2, 3)
or r2.yz, r2.zzwz, r2.yyzy
if_nz r2.y
  ishl r2.yw, r1.yyyz, l(0, 8, 0, 8)
  and r2.yw, r2.yyyw, l(0, 0xff00ff00, 0, 0xff00ff00)
  ushr r3.xy, r1.yzyy, l(8, 8, 0, 0)
  and r3.xy, r3.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r1.yz, r2.yywy, r3.xxyx
endif 
if_nz r2.z
  ushr r2.yz, r1.yyzy, l(0, 16, 16, 0)
  bfi r1.yz, l(0, 16, 16, 0), l(0, 16, 16, 0), r1.yyzy, r2.yyzy
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.zzzz, l(0, 1, 2, 0)
ld r2.yz, r1.yyyy, T0[0].zxyw
if_nz r0.w
  ubfe r0.z, l(4), l(25), CB0[0][0].x
  ieq r4.xy, r0.zzzz, l(5, 7, 0, 0)
  or r0.z, r4.y, r4.x
  if_nz r0.z
    bfi r2.yz, l(0, 16, 16, 0), l(0, 0, 0, 0), r2.zzyz, r2.yyzy
  endif 
endif 
if_nz r1.w
  mov r2.yz, r2.zzyz
  mov r0.z, l(2)
else 
  mov r0.z, r2.x
endif 
ieq r4.xyz, r0.zzzz, l(1, 2, 3, 0)
or r4.xy, r4.yzyy, r4.xyxx
if_nz r4.x
  ishl r4.xz, r2.yyzy, l(8, 0, 8, 0)
  and r4.xz, r4.xxzx, l(0xff00ff00, 0, 0xff00ff00, 0)
  ushr r5.xy, r2.yzyy, l(8, 8, 0, 0)
  and r5.xy, r5.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r2.yz, r4.xxzx, r5.xxyx
endif 
if_nz r4.y
  ushr r4.xy, r2.yzyy, l(16, 16, 0, 0)
  bfi r2.yz, l(0, 16, 16, 0), l(0, 16, 16, 0), r2.yyzy, r4.xxyx
endif 
store_uav_typed U0[0].xyzw, r3.xxxx, r2.yzyy
ld r1.yz, r1.zzzz, T0[0].zxyw
if_nz r0.w
  ubfe r0.z, l(4), l(25), CB0[0][0].x
  ieq r2.yz, r0.zzzz, l(0, 5, 7, 0)
  or r0.z, r2.z, r2.y
  if_nz r0.z
    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.z, l(2)
else 
  mov r0.z, r2.x
endif 
ieq r2.yzw, r0.zzzz, l(0, 1, 2, 3)
or r2.yz, r2.zzwz, r2.yyzy
if_nz r2.y
  ishl r2.yw, r1.yyyz, l(0, 8, 0, 8)
  and r2.yw, r2.yyyw, l(0, 0xff00ff00, 0, 0xff00ff00)
  ushr r4.xy, r1.yzyy, l(8, 8, 0, 0)
  and r4.xy, r4.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r1.yz, r2.yywy, r4.xxyx
endif 
if_nz r2.z
  ushr r2.yz, r1.yyzy, l(0, 16, 16, 0)
  bfi r1.yz, l(0, 16, 16, 0), l(0, 16, 16, 0), r1.yyzy, r2.yyzy
endif 
store_uav_typed U0[0].xyzw, r3.yyyy, r1.yzyy
iadd r0.z, r1.x, r0.y
iadd r1.xy, r0.zzzz, l(3, 6, 0, 0)
ld r1.xz, r1.xxxx, T0[0].xzyw
if_nz r0.w
  ubfe r0.z, l(4), l(25), CB0[0][0].x
  ieq r2.yz, r0.zzzz, l(0, 5, 7, 0)
  or r0.z, r2.z, r2.y
  if_nz r0.z
    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.z, l(2)
else 
  mov r0.z, r2.x
endif 
ieq r2.yzw, r0.zzzz, l(0, 1, 2, 3)
or r2.yz, r2.zzwz, r2.yyzy
if_nz r2.y
  ishl r2.yw, r1.xxxz, l(0, 8, 0, 8)
  and r2.yw, r2.yyyw, l(0, 0xff00ff00, 0, 0xff00ff00)
  ushr r3.xy, r1.xzxx, l(8, 8, 0, 0)
  and r3.xy, r3.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r1.xz, r2.yywy, r3.xxyx
endif 
if_nz r2.z
  ushr r2.yz, r1.xxzx, l(0, 16, 16, 0)
  bfi r1.xz, l(16, 0, 16, 0), l(16, 0, 16, 0), r1.xxzx, r2.yyzy
endif 
store_uav_typed U0[0].xyzw, r3.zzzz, r1.xzxx
iadd r4.xyzw, r0.yyyy, l(4, 5, 7, 8)
ld r0.yz, r4.xxxx, T0[0].zxyw
if_nz r0.w
  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.yz, l(0, 16, 16, 0), l(0, 0, 0, 0), r0.zzyz, r0.yyzy
  endif 
endif 
if_nz r1.w
  mov r0.yz, r0.zzyz
  mov r1.x, l(2)
else 
  mov r1.x, r2.x
endif 
ieq r2.yzw, r1.xxxx, l(0, 1, 2, 3)
or r1.xz, r2.zzwz, r2.yyzy
if_nz r1.x
  ishl r2.yz, r0.yyzy, l(0, 8, 8, 0)
  and r2.yz, r2.yyzy, l(0, 0xff00ff00, 0xff00ff00, 0)
  ushr r3.xy, r0.yzyy, l(8, 8, 0, 0)
  and r3.xy, r3.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r0.yz, r2.yyzy, r3.xxyx
endif 
if_nz r1.z
  ushr r1.xz, r0.yyzy, l(16, 0, 16, 0)
  bfi r0.yz, l(0, 16, 16, 0), l(0, 16, 16, 0), r0.yyzy, r1.xxzx
endif 
store_uav_typed U0[0].xyzw, r3.wwww, r0.yzyy
iadd r3.xyzw, r0.xxxx, l(5, 6, 7, 8)
ld r0.yz, r4.yyyy, T0[0].zxyw
if_nz r0.w
  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.yz, l(0, 16, 16, 0), l(0, 0, 0, 0), r0.zzyz, r0.yyzy
  endif 
endif 
if_nz r1.w
  mov r0.yz, r0.zzyz
  mov r1.x, l(2)
else 
  mov r1.x, r2.x
endif 
ieq r2.yzw, r1.xxxx, l(0, 1, 2, 3)
or r1.xz, r2.zzwz, r2.yyzy
if_nz r1.x
  ishl r2.yz, r0.yyzy, l(0, 8, 8, 0)
  and r2.yz, r2.yyzy, l(0, 0xff00ff00, 0xff00ff00, 0)
  ushr r4.xy, r0.yzyy, l(8, 8, 0, 0)
  and r4.xy, r4.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r0.yz, r2.yyzy, r4.xxyx
endif 
if_nz r1.z
  ushr r1.xz, r0.yyzy, l(16, 0, 16, 0)
  bfi r0.yz, l(0, 16, 16, 0), l(0, 16, 16, 0), r0.yyzy, r1.xxzx
endif 
store_uav_typed U0[0].xyzw, r3.xxxx, r0.yzyy
ld r0.yz, r1.yyyy, T0[0].zxyw
if_nz r0.w
  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.yz, l(0, 16, 16, 0), l(0, 0, 0, 0), r0.zzyz, r0.yyzy
  endif 
endif 
if_nz r1.w
  mov r0.yz, r0.zzyz
  mov r1.x, l(2)
else 
  mov r1.x, r2.x
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.yyzy, l(8, 0, 8, 0)
  and r1.xz, r1.xxzx, l(0xff00ff00, 0, 0xff00ff00, 0)
  ushr r2.yz, r0.yyzy, l(0, 8, 8, 0)
  and r2.yz, r2.yyzy, l(0, 0x00ff00ff, 0x00ff00ff, 0)
  iadd r0.yz, r1.xxzx, r2.yyzy
endif 
if_nz r1.y
  ushr r1.xy, r0.yzyy, l(16, 16, 0, 0)
  bfi r0.yz, l(0, 16, 16, 0), l(0, 16, 16, 0), r0.yyzy, r1.xxyx
endif 
store_uav_typed U0[0].xyzw, r3.yyyy, r0.yzyy
ld r0.yz, r4.zzzz, T0[0].zxyw
if_nz r0.w
  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.yz, l(0, 16, 16, 0), l(0, 0, 0, 0), r0.zzyz, r0.yyzy
  endif 
endif 
if_nz r1.w
  mov r0.yz, r0.zzyz
  mov r1.x, l(2)
else 
  mov r1.x, r2.x
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.yyzy, l(8, 0, 8, 0)
  and r1.xz, r1.xxzx, l(0xff00ff00, 0, 0xff00ff00, 0)
  ushr r2.yz, r0.yyzy, l(0, 8, 8, 0)
  and r2.yz, r2.yyzy, l(0, 0x00ff00ff, 0x00ff00ff, 0)
  iadd r0.yz, r1.xxzx, r2.yyzy
endif 
if_nz r1.y
  ushr r1.xy, r0.yzyy, l(16, 16, 0, 0)
  bfi r0.yz, l(0, 16, 16, 0), l(0, 16, 16, 0), r0.yyzy, r1.xxyx
endif 
store_uav_typed U0[0].xyzw, r3.zzzz, r0.yzyy
ld r0.yz, r4.wwww, T0[0].zxyw
if_nz r0.w
  ubfe r0.w, l(4), l(25), CB0[0][0].x
  ieq r1.xy, r0.wwww, l(5, 7, 0, 0)
  or r0.w, r1.y, r1.x
  if_nz r0.w
    bfi r0.yz, l(0, 16, 16, 0), l(0, 0, 0, 0), r0.zzyz, r0.yyzy
  endif 
endif 
if_nz r1.w
  mov r0.yz, r0.zzyz
  mov r2.x, l(2)
endif 
ieq r1.xyz, r2.xxxx, l(1, 2, 3, 0)
or r1.xy, r1.yzyy, r1.xyxx
if_nz r1.x
  ishl r1.xz, r0.yyzy, l(8, 0, 8, 0)
  and r1.xz, r1.xxzx, l(0xff00ff00, 0, 0xff00ff00, 0)
  ushr r2.xy, r0.yzyy, l(8, 8, 0, 0)
  and r2.xy, r2.xyxx, l(0x00ff00ff, 0x00ff00ff, 0, 0)
  iadd r0.yz, r1.xxzx, r2.xxyx
endif 
if_nz r1.y
  ushr r1.xy, r0.yzyy, l(16, 16, 0, 0)
  bfi r0.yz, l(0, 16, 16, 0), l(0, 16, 16, 0), r0.yyzy, r1.xxyx
endif 
store_uav_typed U0[0].xyzw, r3.wwww, r0.yzyy
ret 
// Approximately 368 instruction slots used
