//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.164 on Sat Nov 15 07:21:13 2025
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// cursor_mask                       texture  float4          2d  100        1
// cursor_color                      texture  float4          2d  101        1
// IniParams                         texture  float4          1d  120        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_VertexID              0   x           0   VERTID    uint   x
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy
// P                        0   x           2  RTINDEX    uint   x
//
vs_5_0
dcl_resource_buffer (float,float,float,float) t125
dcl_output_siv o2.x, rendertarget_array_index
dcl_globalFlags refactoringAllowed
dcl_resource_texture2d (float,float,float,float) t100
dcl_resource_texture2d (float,float,float,float) t101
dcl_resource_texture1d (float,float,float,float) t120
dcl_input_sgv v0.x, vertex_id
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_temps 6
ld_indexable(buffer)(float,float,float,float) r5.xyzw, l(0, 0, 0, 0), t125.xyzw
mov o2.x, r5.z
ld_indexable(texture1d)(float,float,float,float) r0.xyzw, l(1, 0, 0, 0), t120.xyzw
ne r0.z, l(0.000000, 0.000000, 0.000000, 0.000000), r0.z
if_z r0.z
  mov r3.xyzw, l(0,0,0,0)
  mov o1.xy, l(0,0,0,0)
  add r4.x, -r5.y, r3.w
  mul r4.y, r5.x, r5.w
  mad r4.x, r4.x, r4.y, r3.x
  ne r4.y, l(1.000000), r3.w
  movc r3.x, r4.y, r4.x, r3.x
  mov o0.xyzw, r3.xyzw
  ret
endif
resinfo_indexable(texture2d)(float,float,float,float)_uint r1.xy, l(0), t101.xyzw
if_nz r1.x
  eq r0.z, r0.w, l(2.000000)
  if_nz r0.z
    mov r3.xyzw, l(0,0,0,0)
    mov o1.xy, l(0,0,0,0)
    add r4.x, -r5.y, r3.w
    mul r4.y, r5.x, r5.w
    mad r4.x, r4.x, r4.y, r3.x
    ne r4.y, l(1.000000), r3.w
    movc r3.x, r4.y, r4.x, r3.x
    mov o0.xyzw, r3.xyzw
    ret
  endif
  utof r1.xz, r1.xxyx
else
  eq r0.z, r0.w, l(1.000000)
  if_nz r0.z
    mov r3.xyzw, l(0,0,0,0)
    mov o1.xy, l(0,0,0,0)
    add r4.x, -r5.y, r3.w
    mul r4.y, r5.x, r5.w
    mad r4.x, r4.x, r4.y, r3.x
    ne r4.y, l(1.000000), r3.w
    movc r3.x, r4.y, r4.x, r3.x
    mov o0.xyzw, r3.xyzw
    ret
  endif
  resinfo_indexable(texture2d)(float,float,float,float)_uint r0.zw, l(0), t100.zwxy
  ushr r0.w, r0.w, l(1)
  utof r1.xz, r0.zzwz
endif
ld_indexable(texture1d)(float,float,float,float) r2.xyzw, l(0, 0, 0, 0), t120.xyzw
add r2.yz, -r2.wwzw, r2.yyxy
switch v0.x
  case l(0)
  mov r2.xy, r2.zyzz
  mov r1.w, l(0)
  mov r1.xy, r1.wzww
  break
  case l(1)
  add r2.w, r1.z, r2.y
  mov r2.xy, r2.zwzz
  mov r1.xy, l(0,0,0,0)
  break
  case l(2)
  add r2.x, r1.x, r2.z
  mov r1.xy, r1.xzxx
  break
  case l(3)
  add r2.xy, r1.xzxx, r2.zyzz
  mov r1.y, l(0)
  break
  default
  mov r2.xy, l(0,0,0,0)
  mov r1.xy, l(0,0,0,0)
  break
endswitch
mov o1.xy, r1.xyxx
div r0.xy, r2.xyxx, r0.xyxx
mad r0.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mul r3.xy, r0.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000)
mov r3.zw, l(0,0,0,1.000000)
add r4.x, -r5.y, r3.w
mul r4.y, r5.x, r5.w
mad r4.x, r4.x, r4.y, r3.x
ne r4.y, l(1.000000), r3.w
movc r3.x, r4.y, r4.x, r3.x
mov o0.xyzw, r3.xyzw
ret
// Approximately 59 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v0.6.164 on Sat Nov 15 07:21:13 2025
//
// Texture2D<float4> cursor_mask : register(t100);
// Texture2D<float4> cursor_color : register(t101);
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Buffer<float4> StereoParams : register(t125);
//
//
// void main(
//   uint v0 : SV_VertexID0,
//   out float4 o0 : SV_Position0,
//   out float2 o1 : TEXCOORD0,
//   out uint o2 : P0)
// {
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_input_sgv v0.x, vertex_id
//   float4 r0,r1,r2,r3,r4,r5;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
//   r5.xyzw = StereoParams.Load(float4(0,0,0,0)).xyzw;
//   o2.x = r5.z;
//   r0.xyzw = IniParams.Load(float4(1,0,0,0)).xyzw;
//   r0.z = cmp(0 != r0.z);
//   if (r0.z == 0) {
//     r3.xyzw = float4(0,0,0,0);
//     o1.xy = float2(0,0);
//     r4.x = r3.w + -r5.y;
//     r4.y = r5.w * r5.x;
//     r4.x = r4.x * r4.y + r3.x;
//     r4.y = cmp(1.000000 != r3.w);
//     r3.x = r4.y ? r4.x : r3.x;
//     o0.xyzw = r3.xyzw;
//     return;
//   }
//   cursor_color.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
//   r1.xy = uiDest.xy;
//   if (r1.x != 0) {
//     r0.z = cmp(r0.w == 2.000000);
//     if (r0.z != 0) {
//       r3.xyzw = float4(0,0,0,0);
//       o1.xy = float2(0,0);
//       r4.x = r3.w + -r5.y;
//       r4.y = r5.w * r5.x;
//       r4.x = r4.x * r4.y + r3.x;
//       r4.y = cmp(1.000000 != r3.w);
//       r3.x = r4.y ? r4.x : r3.x;
//       o0.xyzw = r3.xyzw;
//       return;
//     }
//     r1.xz = (uint2)r1.xy;
//   } else {
//     r0.z = cmp(r0.w == 1.000000);
//     if (r0.z != 0) {
//       r3.xyzw = float4(0,0,0,0);
//       o1.xy = float2(0,0);
//       r4.x = r3.w + -r5.y;
//       r4.y = r5.w * r5.x;
//       r4.x = r4.x * r4.y + r3.x;
//       r4.y = cmp(1.000000 != r3.w);
//       r3.x = r4.y ? r4.x : r3.x;
//       o0.xyzw = r3.xyzw;
//       return;
//     }
//     cursor_mask.GetDimensions(0, uiDest.x, uiDest.y, uiDest.z);
//     r0.zw = uiDest.xy;
//     r0.w = (uint)r0.w >> 1;
//     r1.xz = (uint2)r0.zw;
//   }
//   r2.xyzw = IniParams.Load(float4(0,0,0,0)).xyzw;
//   r2.yz = r2.yx + -r2.wz;
//   switch (v0.x) {
//     case 0 :    r2.xy = r2.zy;
//     r1.w = 0;
//     r1.xy = r1.wz;
//     break;
//     case 1 :    r2.w = r2.y + r1.z;
//     r2.xy = r2.zw;
//     r1.xy = float2(0,0);
//     break;
//     case 2 :    r2.x = r2.z + r1.x;
//     r1.xy = r1.xz;
//     break;
//     case 3 :    r2.xy = r2.zy + r1.xz;
//     r1.y = 0;
//     break;
//     default :
//     r2.xy = float2(0,0);
//     r1.xy = float2(0,0);
//     break;
//   }
//   o1.xy = r1.xy;
//   r0.xy = r2.xy / r0.xy;
//   r0.xy = r0.xy * float2(2,2) + float2(-1,-1);
//   r3.xy = float2(1,-1) * r0.xy;
//   r3.zw = float2(0,1);
//   r4.x = r3.w + -r5.y;
//   r4.y = r5.w * r5.x;
//   r4.x = r4.x * r4.y + r3.x;
//   r4.y = cmp(1.000000 != r3.w);
//   r3.x = r4.y ? r4.x : r3.x;
//   o0.xyzw = r3.xyzw;
//   return;
// }
/////////////////////////////////////////////////////////////////////////////
