// AUTOMATICALLY CONVERTED FROM SHADER FIXES 
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.164 on Tue Jun  2 01:10:11 2026
//
//
// Buffer Definitions:
//
// cbuffer cb2
// {
//
//   float4 cb2[10];                    // Offset:    0 Size:   160
//
// }
//
// cbuffer cb1
// {
//
//   float4 cb1;                        // Offset:    0 Size:    16
//
// }
//
// cbuffer cb0
// {
//
//   float4 cb0[143];                   // Offset:    0 Size:  2288
//
// }
//
// Resource bind info for t0
// {
//
//   struct t0_t
//   {
//
//       float val[4];                  // Offset:    0
//
//   } $Element;                        // Offset:    0 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// t0                                texture  struct         r/o    0        1
// t1                                texture  float4         buf    1        1
// cb0                               cbuffer      NA          NA    0        1
// cb1                               cbuffer      NA          NA    1        1
// cb2                               cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// ATTRIBUTE                0   xyzw        0     NONE   float   xyz
// ATTRIBUTE               13   x           1     NONE    uint   x
// SV_VertexID              0   x           2   VERTID    uint   x
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                10   xyzw        0     NONE   float   xyzw
// TEXCOORD                11   xyzw        1     NONE   float   xyzw
// PRIMITIVE_ID             0   x           2     NONE    uint   x
// SV_POSITION              0   xyzw        3      POS   float   xyzw
// P                        0   x           4  RTINDEX    uint   x
//
vs_5_0
dcl_resource_buffer (float,float,float,float) t125
dcl_output_siv o4.x, rendertarget_array_index
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB2[10], immediateIndexed
dcl_constantbuffer CB1[1], immediateIndexed
dcl_constantbuffer CB0[143], immediateIndexed
dcl_resource_structured t0, 16
dcl_resource_buffer (float,float,float,float) t1
dcl_input v0.xyz
dcl_input v1.x
dcl_input_sgv v2.x, vertex_id
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.x
dcl_output_siv o3.xyzw, position
dcl_temps 14
ld_indexable(buffer)(float,float,float,float) r13.xyzw, l(0, 0, 0, 0), t125.xyzw
mov o4.x, r13.z
iadd r0.x, v2.x, cb1[0].w
itof r0.x, r0.x
ftou r0.x, r0.x
ishl r0.y, r0.x, l(1)
bfi r0.x, l(31), l(1), r0.x, l(1)
utof r0.x, r0.x
ftoi r0.x, r0.x
ld_indexable(buffer)(float,float,float,float) r1.xyzw, r0.xxxx, t1.xyzw
utof r0.x, r0.y
ftoi r0.x, r0.x
ld_indexable(buffer)(float,float,float,float) r0.xyz, r0.xxxx, t1.xyzw
mul r2.xyz, r0.zxyz, r1.xyzx
mad r0.xyz, r1.zxyz, r0.xyzx, -r2.xyzx
mul r0.xyz, r1.wwww, r0.xyzx
mul r2.xyz, r1.yzxy, r0.yzxy
mad r0.xyz, r0.xyzx, r1.zxyz, -r2.xyzx
mul r0.xyz, r1.wwww, r0.xyzx
imul null, r0.w, v1.x, l(36)
imad r2.xy, v1.xxxx, l(36, 36, 0, 0), l(1, 3, 0, 0)
itof r2.xy, r2.xyxx
ftou r2.xy, r2.xyxx
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r3.x, r2.x, l(0), t0.xxxx
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r2.xyz, r2.y, l(0), t0.xyzx
add r2.xyz, r2.xyzx, cb0[70].xyzx
ftou r2.w, r3.x
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r3.yz, r2.w, l(4), t0.xxyx
imad r4.xyz, v1.xxxx, l(36, 36, 36, 0), l(4, 5, 28, 0)
itof r4.xyz, r4.xyzx
ftou r4.xyz, r4.xyzx
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r5.xyzw, r4.x, l(0), t0.xyzw
mul r6.xyz, r3.xyzx, r5.yyyy
mul r3.xyz, r3.xyzx, v0.yyyy
mul r7.xyz, r0.yyyy, r6.xyzx
mul r6.xyz, r1.yyyy, r6.xyzx
itof r0.y, r0.w
imad r0.w, v1.x, l(36), l(2)
itof r0.w, r0.w
ftou r0.yw, r0.yyyw
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r8.xyz, r0.w, l(0), t0.xyzx
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r9.xyz, r0.y, l(0), t0.xyzx
mul r10.xyz, r5.xxxx, r9.xyzx
mad r3.xyz, r9.xyzx, v0.xxxx, r3.xyzx
mad r3.xyz, r8.xyzx, v0.zzzz, r3.xyzx
mul r5.xyz, r5.zzzz, r8.xyzx
mul o1.w, r1.w, r5.w
add r2.xyz, r2.xyzx, r3.xyzx
mad r0.xyw, r0.xxxx, r10.xyxz, r7.xyxz
mad o0.xyz, r0.zzzz, r5.xyzx, r0.xywx
mad r0.xyz, r1.xxxx, r10.xyzx, r6.xyzx
mad o1.xyz, r1.zzzz, r5.xyzx, r0.xyzx
mov o0.w, l(0)
mov o2.x, v1.x
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r0.xyz, r4.y, l(0), t0.xyzx
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r1.xyzw, r4.z, l(0), t0.xyzw
add r3.xyz, r0.xyzx, -cb0[67].xyzx
dp3 r0.w, -r3.xyzx, -r3.xyzx
sqrt r0.w, r0.w
div_sat r0.w, r0.w, r1.w
add r0.w, -r0.w, l(1.000000)
add r1.w, -r0.w, l(1.000000)
mul_sat r0.w, r0.w, cb2[8].z
mul_sat r1.w, r1.w, cb2[8].w
min r0.w, r0.w, r1.w
mad r1.y, r1.y, r1.z, cb0[142].z
mul r1.y, r1.y, cb2[9].x
mul r1.y, r1.y, l(6.28318548)
sincos r1.y, null, r1.y
add r1.y, r1.y, l(1.000000)
mul r1.y, r1.y, l(0.500000)
add r1.z, -cb2[9].y, l(1.000000)
mad r1.y, r1.y, r1.z, cb2[9].y
add r1.y, r1.y, l(-1.000000)
mad r1.x, r1.x, r1.y, l(1.000000)
mul r0.w, r0.w, r1.x
add r1.xyz, r2.xyzx, -cb0[70].xyzx
add r0.xyz, r0.xyzx, -r1.xyzx
mad r0.xyz, r0.wwww, -r0.xyzx, r0.xyzx
add r0.xyz, r0.xyzx, r2.xyzx
mul r1.xyzw, r0.yyyy, cb0[1].xyzw
mad r1.xyzw, r0.xxxx, cb0[0].xyzw, r1.xyzw
mad r0.xyzw, r0.zzzz, cb0[2].xyzw, r1.xyzw
add r11.xyzw, r0.xyzw, cb0[3].xyzw
add r12.x, -r13.y, r11.w
mul r12.y, r13.x, r13.w
mad r12.x, r12.x, r12.y, r11.x
ne r12.y, l(1.000000), r11.w
movc r11.x, r12.y, r12.x, r11.x
mov o3.xyzw, r11.xyzw
ret
// Approximately 83 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v0.6.164 on Tue Jun  2 01:10:11 2026
//
// struct t0_t
// {
//     float val[4];                  // Offset:    0
// };
//
// cbuffer cb2 : register(b2)
// {
//   float4 cb2[10] : packoffset(c0);
// }
//
// cbuffer cb1 : register(b1)
// {
//   float4 cb1 : packoffset(c0);
// }
//
// cbuffer cb0 : register(b0)
// {
//   float4 cb0[143] : packoffset(c0);
// }
//
// StructuredBuffer<t0_t> t0 : register(t0);
// Buffer<float4> t1 : register(t1);
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Buffer<float4> StereoParams : register(t125);
//
//
// void main(
//   float4 v0 : ATTRIBUTE0,
//   uint v1 : ATTRIBUTE13,
//   uint v2 : SV_VertexID0,
//   out float4 o0 : TEXCOORD10,
//   out float4 o1 : TEXCOORD11,
//   out uint o2 : PRIMITIVE_ID0,
//   out float4 o3 : SV_POSITION0,
//   out uint o4 : P0)
// {
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_input_sgv v2.x, vertex_id
//   float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
//   r13.xyzw = StereoParams.Load(float4(0,0,0,0)).xyzw;
//   o4.x = r13.z;
//   r0.x = (int)v2.x + asint(cb1.w);
//   r0.x = (int)r0.x;
//   r0.x = (uint)r0.x;
//   r0.y = (uint)r0.x << 1;
//   bitmask.x = ((~(-1 << 31)) << 1) & 0xffffffff;  r0.x = (((uint)r0.x << 1) & bitmask.x) | ((uint)1 & ~bitmask.x);
//   r0.x = (uint)r0.x;
//   r0.x = (int)r0.x;
//   r1.xyzw = t1.Load(r0.x).xyzw;
//   r0.x = (uint)r0.y;
//   r0.x = (int)r0.x;
//   r0.xyz = t1.Load(r0.x).xyz;
//   r2.xyz = r1.xyz * r0.zxy;
//   r0.xyz = r1.zxy * r0.xyz + -r2.xyz;
//   r0.xyz = r0.xyz * r1.www;
//   r2.xyz = r0.yzx * r1.yzx;
//   r0.xyz = r0.xyz * r1.zxy + -r2.xyz;
//   r0.xyz = r0.xyz * r1.www;
//   r0.w = (int)v1.x * 36;
//   r2.xy = mad((int2)v1.xx, int2(36,36), int2(1,3));
//   r2.xy = (int2)r2.xy;
//   r2.xy = (uint2)r2.xy;
//   r3.x = t0[r2.x].val[0];
//   r2.x = t0[r2.y].val[0];
//   r2.y = t0[r2.y].val[1];
//   r2.z = t0[r2.y].val[2];
//   r2.xyz = cb0[70].xyz + r2.xyz;
//   r2.w = (uint)r3.x;
//   r3.y = t0[r2.w].val[1];
//   r3.z = t0[r2.w].val[2];
//   r4.xyz = mad((int3)v1.xxx, int3(36,36,36), int3(4,5,28));
//   r4.xyz = (int3)r4.xyz;
//   r4.xyz = (uint3)r4.xyz;
//   r5.x = t0[r4.x].val[0];
//   r5.y = t0[r4.x].val[1];
//   r5.z = t0[r4.x].val[2];
//   r5.w = t0[r4.x].val[3];
//   r6.xyz = r5.yyy * r3.xyz;
//   r3.xyz = v0.yyy * r3.xyz;
//   r7.xyz = r6.xyz * r0.yyy;
//   r6.xyz = r6.xyz * r1.yyy;
//   r0.y = (int)r0.w;
//   r0.w = mad((int)v1.x, 36, 2);
//   r0.w = (int)r0.w;
//   r0.yw = (uint2)r0.yw;
//   r8.x = t0[r0.w].val[0];
//   r8.y = t0[r0.w].val[1];
//   r8.z = t0[r0.w].val[2];
//   r9.x = t0[r0.y].val[0];
//   r9.y = t0[r0.y].val[1];
//   r9.z = t0[r0.y].val[2];
//   r10.xyz = r9.xyz * r5.xxx;
//   r3.xyz = r9.xyz * v0.xxx + r3.xyz;
//   r3.xyz = r8.xyz * v0.zzz + r3.xyz;
//   r5.xyz = r8.xyz * r5.zzz;
//   o1.w = r5.w * r1.w;
//   r2.xyz = r3.xyz + r2.xyz;
//   r0.xyw = r0.xxx * r10.xyz + r7.xyz;
//   o0.xyz = r0.zzz * r5.xyz + r0.xyw;
//   r0.xyz = r1.xxx * r10.xyz + r6.xyz;
//   o1.xyz = r1.zzz * r5.xyz + r0.xyz;
//   o0.w = 0;
//   o2.x = v1.x;
//   r0.x = t0[r4.y].val[0];
//   r0.y = t0[r4.y].val[1];
//   r0.z = t0[r4.y].val[2];
//   r1.x = t0[r4.z].val[0];
//   r1.y = t0[r4.z].val[1];
//   r1.z = t0[r4.z].val[2];
//   r1.w = t0[r4.z].val[3];
//   r3.xyz = -cb0[67].xyz + r0.xyz;
//   r0.w = dot(-r3.xyz, -r3.xyz);
//   r0.w = sqrt(r0.w);
//   r0.w = saturate(r0.w / r1.w);
//   r0.w = 1 + -r0.w;
//   r1.w = 1 + -r0.w;
//   r0.w = saturate(cb2[8].z * r0.w);
//   r1.w = saturate(cb2[8].w * r1.w);
//   r0.w = min(r1.w, r0.w);
//   r1.y = r1.y * r1.z + cb0[142].z;
//   r1.y = cb2[9].x * r1.y;
//   r1.y = 6.28318548 * r1.y;
//   r1.y = sin(r1.y);
//   r1.y = 1 + r1.y;
//   r1.y = 0.5 * r1.y;
//   r1.z = 1 + -cb2[9].y;
//   r1.y = r1.y * r1.z + cb2[9].y;
//   r1.y = -1 + r1.y;
//   r1.x = r1.x * r1.y + 1;
//   r0.w = r1.x * r0.w;
//   r1.xyz = -cb0[70].xyz + r2.xyz;
//   r0.xyz = -r1.xyz + r0.xyz;
//   r0.xyz = r0.www * -r0.xyz + r0.xyz;
//   r0.xyz = r2.xyz + r0.xyz;
//   r1.xyzw = cb0[1].xyzw * r0.yyyy;
//   r1.xyzw = r0.xxxx * cb0[0].xyzw + r1.xyzw;
//   r0.xyzw = r0.zzzz * cb0[2].xyzw + r1.xyzw;
//   r11.xyzw = cb0[3].xyzw + r0.xyzw;
//   r12.x = r11.w + -r13.y;
//   r12.y = r13.w * r13.x;
//   r12.x = r12.x * r12.y + r11.x;
//   r12.y = cmp(1.000000 != r11.w);
//   r11.x = r12.y ? r12.x : r11.x;
//   o3.xyzw = r11.xyzw;
//   return;
// }
/////////////////////////////////////////////////////////////////////////////
