//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//
// Buffer Definitions: 
//
// cbuffer XeTextureLoadConstants
// {
//
//   uint xe_texture_load_guest_base;   // Offset:    0 Size:     4
//   uint xe_texture_load_guest_pitch;  // Offset:    4 Size:     4
//   uint xe_texture_load_host_base;    // Offset:    8 Size:     4
//   uint xe_texture_load_host_pitch;   // Offset:   12 Size:     4
//   uint3 xe_texture_load_size_texels; // Offset:   16 Size:    12
//   bool xe_texture_load_is_3d;        // Offset:   28 Size:     4
//   uint3 xe_texture_load_size_blocks; // Offset:   32 Size:    12
//   uint xe_texture_load_endianness;   // Offset:   44 Size:     4
//   uint2 xe_texture_guest_storage_width_height;// Offset:   48 Size:     8
//   uint xe_texture_load_guest_format; // Offset:   56 Size:     4 [unused]
//   uint3 xe_texture_load_guest_mip_offset;// Offset:   64 Size:    12
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim      ID      HLSL Bind  Count
// ------------------------------ ---------- ------- ----------- ------- -------------- ------
// xe_texture_load_source            texture    byte         r/o      T0             t0      1 
// xe_texture_load_dest                  UAV    byte         r/w      U0             u0      1 
// XeTextureLoadConstants            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][5], immediateIndexed, space=0
dcl_resource_raw T0[0:0], space=0
dcl_uav_raw U0[0:0], space=0
dcl_input vThreadID.xyz
dcl_temps 7
dcl_thread_group 16, 32, 1
ishl r0.x, vThreadID.x, l(1)
mov r0.yz, vThreadID.yyzy
uge r1.xyz, r0.xyzx, CB0[0][2].xyzx
or r0.w, r1.y, r1.x
or r0.w, r1.z, r0.w
if_nz r0.w
  ret 
endif 
iadd r1.xyz, r0.xyzx, CB0[0][4].xyzx
ieq r0.z, CB0[0][0].y, l(-1)
if_nz r0.z
  if_nz CB0[0][1].w
    iadd r0.zw, CB0[0][3].yyyx, l(0, 0, 31, 31)
    iadd r2.xyzw, r1.xxxx, l(0, 1, 0, 1)
    ushr r3.xyz, r1.yzyy, l(4, 2, 3, 0)
    ushr r0.zw, r0.zzzw, l(0, 0, 4, 5)
    and r0.z, r0.z, l(0x0ffffffe)
    imad r0.z, r3.y, r0.z, r3.x
    ushr r4.xyzw, r2.zwzw, l(5, 5, 3, 3)
    imad r5.xyzw, r0.zzzz, r0.wwww, r4.xyxy
    ishl r0.z, r1.y, l(11)
    and r0.z, r0.z, l(0x00003000)
    bfi r2.xyzw, l(3, 3, 3, 3), l(9, 9, 9, 9), r2.xyzw, r0.zzzz
    ushr r2.xyzw, r2.xyzw, l(6, 6, 6, 6)
    iadd r0.z, r3.y, r3.z
    bfi r0.w, l(1), l(1), r0.z, l(0)
    iadd r3.xy, r0.wwww, r4.zwzz
    bfi r3.xy, l(2, 2, 0, 0), l(1, 1, 0, 0), r3.xyxx, l(0, 0, 0, 0)
    bfi r0.zw, l(0, 0, 1, 1), l(0, 0, 0, 0), r0.zzzz, r3.xxxy
    and r3.xyzw, r2.zwzw, l(240, 240, 240, 240)
    bfi r4.xyzw, l(19, 19, 19, 19), l(11, 11, 14, 14), r5.xyzw, l(0, 0, 0, 0)
    imad r3.xyzw, r3.xyzw, l(2, 2, 16, 16), r4.xyzw
    bfi r2.xyzw, l(4, 4, 4, 4), l(0, 0, 3, 3), r2.xyzw, r3.xyzw
    bfi r2.xyzw, l(2, 2, 2, 2), l(9, 9, 12, 12), r1.zzzz, r2.xyzw
    ubfe r3.xy, l(3, 3, 0, 0), l(6, 6, 0, 0), r2.xyxx
    and r3.zw, r0.zzzw, l(0, 0, 6, 6)
    bfi r0.zw, l(0, 0, 1, 1), l(0, 0, 8, 8), r0.zzzw, l(0, 0, 0, 0)
    imad r0.zw, r3.xxxy, l(0, 0, 32, 32), r0.zzzw
    imad r0.zw, r3.zzzw, l(0, 0, 4, 4), r0.zzzw
    bfi r2.xyzw, l(1, 1, 1, 1), l(4, 4, 7, 7), r1.yyyy, r2.xyzw
    bfi r0.zw, l(0, 0, 9, 9), l(0, 0, 3, 3), r0.zzzw, r2.zzzw
    bfi r0.zw, l(0, 0, 6, 6), l(0, 0, 0, 0), r2.xxxy, r0.zzzw
  else 
    iadd r2.xyzw, r1.xxxx, l(0, 1, 0, 1)
    ushr r3.xyzw, r2.zwzw, l(5, 5, 3, 3)
    ushr r4.xy, r1.yyyy, l(5, 2, 0, 0)
    iadd r1.w, CB0[0][3].x, l(31)
    ushr r1.w, r1.w, l(5)
    imad r5.xyzw, r4.xxxx, r1.wwww, r3.xyxy
    ishl r3.xy, r1.yyyy, l(5, 7, 0, 0)
    and r3.xy, r3.xyxx, l(448, 2048, 0, 0)
    bfi r6.xyzw, l(3, 3, 3, 3), l(3, 3, 3, 3), r2.zwzw, r3.xxxx
    ishl r1.w, r3.x, l(1)
    bfi r2.xyzw, l(3, 3, 3, 3), l(4, 4, 4, 4), r2.xyzw, r1.wwww
    and r2.xyzw, r2.xyzw, l(992, 992, 992, 992)
    bfi r4.xz, l(22, 0, 22, 0), l(10, 0, 10, 0), r5.zzwz, r2.zzwz
    bfi r4.xz, l(4, 0, 4, 0), l(0, 0, 0, 0), r6.zzwz, r4.xxzx
    bfi r4.xz, l(1, 0, 1, 0), l(4, 0, 4, 0), r1.yyyy, r4.xxzx
    ishl r2.xyzw, r2.xyzw, l(3, 3, 2, 2)
    bfi r2.xyzw, l(22, 22, 22, 22), l(13, 13, 12, 12), r5.xyzw, r2.xyzw
    bfi r2.xyzw, l(4, 4, 4, 4), l(3, 3, 2, 2), r6.xyzw, r2.xyzw
    bfi r2.xyzw, l(1, 1, 1, 1), l(7, 7, 6, 6), r1.yyyy, r2.xyzw
    bfi r2.xy, l(12, 12, 0, 0), l(0, 0, 0, 0), r3.yyyy, r2.xyxx
    and r2.zw, r2.zzzw, l(0, 0, 1792, 1792)
    iadd r2.xy, r2.xyxx, r2.zwzz
    and r1.w, r4.y, l(2)
    iadd r2.zw, r1.wwww, r3.zzzw
    bfi r2.zw, l(0, 0, 2, 2), l(0, 0, 6, 6), r2.zzzw, l(0, 0, 0, 0)
    iadd r2.xy, r2.xyxx, r2.zwzz
    bfi r0.zw, l(0, 0, 6, 6), l(0, 0, 0, 0), r4.xxxz, r2.xxxy
  endif 
else 
  ishl r1.x, r1.x, l(3)
  iadd r1.w, CB0[0][2].y, l(31)
  and r1.w, r1.w, l(-32)
  imad r1.y, r1.z, r1.w, r1.y
  imad r1.x, r1.y, CB0[0][0].y, r1.x
  iadd r0.zw, r1.xxxx, l(0, 0, 0, 8)
endif 
iadd r0.zw, r0.zzzw, CB0[0][0].xxxx
ld_raw r1.xz, r0.z, T0[0].xxyx
ld_raw r1.yw, r0.w, T0[0].xxxy
ushr r0.z, CB0[0][2].w, l(1)
xor r0.z, r0.z, CB0[0][2].w
and r0.z, r0.z, l(1)
if_nz r0.z
  ishl r2.xyzw, r1.xzyw, l(8, 8, 8, 8)
  and r2.xyzw, r2.xyzw, l(0xff00ff00, 0xff00ff00, 0xff00ff00, 0xff00ff00)
  ushr r3.xyzw, r1.xzyw, l(8, 8, 8, 8)
  and r3.xyzw, r3.xyzw, l(0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff)
  iadd r1.xyzw, r2.xzyw, r3.xzyw
endif 
and r0.z, CB0[0][2].w, l(2)
if_nz r0.z
  ushr r2.xyzw, r1.xzyw, l(16, 16, 16, 16)
  bfi r1.xyzw, l(16, 16, 16, 16), l(16, 16, 16, 16), r1.xyzw, r2.xzyw
endif 
ishl r0.xy, r0.xyxx, l(2, 2, 0, 0)
ishl r0.x, r0.x, l(1)
imad r0.z, vThreadID.z, CB0[0][1].y, r0.y
imad r0.x, r0.z, CB0[0][0].w, r0.x
iadd r0.x, r0.x, CB0[0][0].z
mov r0.z, CB0[0][1].y
mov r0.w, r0.y
mov r2.x, r0.x
mov r2.y, l(0)
loop 
  uge r2.z, r2.y, l(4)
  breakc_nz r2.z
  uge r2.z, r2.y, l(2)
  movc r2.zw, r2.zzzz, r1.zzzw, r1.xxxy
  bfi r3.x, l(1), l(4), r2.y, l(0)
  ushr r3.xz, r2.zzwz, r3.xxxx
  ushr r4.xyzw, r3.xxzz, l(3, 11, 3, 11)
  bfi r4.xyzw, l(1, 1, 1, 1), l(8, 8, 8, 8), r4.xyzw, l(0, 0, 0, 0)
  ushr r5.xyzw, r3.xxzz, l(7, 15, 7, 15)
  bfi r5.xyzw, l(1, 1, 1, 1), l(24, 24, 24, 24), r5.xyzw, l(0, 0, 0, 0)
  iadd r4.xyzw, r4.xyzw, r5.xyzw
  ushr r5.xyzw, r3.xxzz, l(2, 10, 2, 10)
  bfi r5.xyzw, l(1, 1, 1, 1), l(4, 4, 4, 4), r5.xyzw, l(0, 0, 0, 0)
  iadd r4.xyzw, r4.xyzw, r5.xyzw
  ushr r5.xyzw, r3.xxzz, l(6, 14, 6, 14)
  bfi r4.xyzw, l(1, 1, 1, 1), l(20, 20, 20, 20), r5.xyzw, r4.xyzw
  ubfe r5.xyzw, l(1, 1, 1, 1), l(1, 9, 1, 9), r3.xxzz
  iadd r4.xyzw, r4.xyzw, r5.xyzw
  ushr r5.xyzw, r3.xxzz, l(5, 13, 5, 13)
  bfi r4.xyzw, l(1, 1, 1, 1), l(16, 16, 16, 16), r5.xyzw, r4.xyzw
  ushr r3.yw, r3.xxxz, l(0, 8, 0, 8)
  bfi r4.xyzw, l(1, 1, 1, 1), l(12, 12, 12, 12), r3.xyzw, r4.xyzw
  ushr r3.xyzw, r3.xxzz, l(4, 12, 4, 12)
  bfi r5.xyzw, l(1, 1, 1, 1), l(28, 28, 28, 28), r3.xyzw, l(0, 0, 0, 0)
  iadd r5.xyzw, r4.xyzw, r5.xyzw
  bfi r3.xyzw, l(1, 1, 1, 1), l(29, 29, 29, 29), r3.xyzw, l(0, 0, 0, 0)
  imad r3.xyzw, r4.xyzw, l(2, 2, 2, 2), r3.xyzw
  iadd r3.xyzw, r3.xyzw, r5.xyzw
  ishl r4.xyzw, r3.xyzw, l(2, 2, 2, 2)
  iadd r3.xyzw, r3.xyzw, r4.xyzw
  store_raw U0[0].xyzw, r2.x, r3.xyzw
  iadd r0.w, r0.w, l(1)
  uge r2.z, r0.w, r0.z
  if_nz r2.z
    ret 
  endif 
  iadd r2.x, r2.x, CB0[0][0].w
  iadd r2.y, r2.y, l(1)
endloop 
ret 
// Approximately 147 instruction slots used
