// AUTOMATICALLY CONVERTED FROM SHADER FIXES 
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.164 on Sat Nov 15 07:21:11 2025
//
//
// Buffer Definitions:
//
// cbuffer cb3
// {
//
//   float4 cb3[3];                     // Offset:    0 Size:    48
//
// }
//
// cbuffer cb2
// {
//
//   float4 cb2[16];                    // Offset:    0 Size:   256
//
// }
//
// cbuffer cb1
// {
//
//   float4 cb1;                        // Offset:    0 Size:    16
//
// }
//
// cbuffer cb0
// {
//
//   float4 cb0[115];                   // Offset:    0 Size:  1840
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// s0_s                              sampler      NA          NA    0        1
// s1_s                              sampler      NA          NA    1        1
// t0                                texture  float4          2d    0        1
// t1                                texture  float4          2d    1        1
// StereoParams                      texture  float4          2d  125        1
// cb0                               cbuffer      NA          NA    0        1
// cb1                               cbuffer      NA          NA    1        1
// cb2                               cbuffer      NA          NA    2        1
// cb3                               cbuffer      NA          NA    3        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// CUSTOM_INSTANCE_ID       0   x           1     NONE    uint   x
// TEXCOORD                 0   xyzw        2     NONE   float   xyz
// TEXCOORD                 1   xyzw        3     NONE   float
// TEXCOORD                 2   xyzw        4     NONE   float
// TEXCOORD                 3   xyz         5     NONE   float   xyz
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer CB3[3], immediateIndexed
dcl_constantbuffer CB2[16], dynamicIndexed
dcl_constantbuffer CB1[1], immediateIndexed
dcl_constantbuffer CB0[115], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_buffer (float,float,float,float) t125
dcl_input_ps constant v1.x
dcl_input_ps linear v2.xyz
dcl_input_ps linear v5.xyz
dcl_output o0.xyzw
dcl_temps 5
mul r0.xyz, v2.yyyy, cb0[62].xywx
mad r0.xyz, cb0[61].xywx, v2.xxxx, r0.xyzx
mad r0.xyz, cb0[63].xywx, v2.zzzz, r0.xyzx
add r0.xyz, r0.xyzx, cb0[64].xywx
mul r0.w, r0.y, cb0[12].x
mul r0.xyw, r0.xzxw, l(0.500000, 0.500000, 0.000000, 0.500000)
add r1.yz, r0.yyyy, r0.xxwx
ld r2.xyzw, l(0, 0, 0, 0), t125.xyzw
add r0.x, r0.z, -r2.y
mul r0.x, r0.x, r2.x
mul r0.y, r2.y, r2.x
mad r1.x, r0.x, l(0.500000), r1.y
div r0.xz, r1.xxzx, r0.zzzz
sample r1.xyzw, r0.xzxx, t0.xyzw, s0
mad r0.x, cb0[14].z, r1.x, cb0[14].w
div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
mul r0.z, cb0[62].x, cb0[62].x
mad r0.z, cb0[61].x, cb0[61].x, r0.z
mad r0.z, cb0[63].x, cb0[63].x, r0.z
rsq r0.z, r0.z
mov r1.y, cb0[58].x
mov r1.x, cb0[57].x
mov r1.z, cb0[59].x
dp3 r0.w, r1.xyzx, r1.xyzx
sqrt r0.w, r0.w
mul r0.y, r0.w, r0.y
mul r0.y, r0.z, r0.y
dp2 r0.z, r1.xzxx, r1.xzxx
sqrt r0.z, r0.z
div r0.zw, r1.xxxz, r0.zzzz
mad r1.xz, r0.zzwz, r0.yyyy, v5.xxzx
iadd r1.w, v1.x, cb1[0].x
itof r1.w, r1.w
ftou r1.w, r1.w
ishl r1.w, r1.w, l(3)
utof r2.x, r1.w
add r3.xyzw, r2.xxxx, l(5.000000, 4.000000, 6.000000, 7.000000)
add r2.xyz, r2.xxxx, l(1.000000, 2.000000, 3.000000, 0.000000)
ftou r2.xyz, r2.xyzx
ftou r3.xyzw, r3.xyzw
mul r4.xyz, cb0[59].yyyy, cb2[r3.x + 0].xyzx
mad r4.xyz, cb2[r3.y + 0].xyzx, cb0[59].xxxx, r4.xyzx
mad r3.xyz, cb2[r3.z + 0].xyzx, cb0[59].zzzz, r4.xyzx
mad r3.xyz, cb2[r3.w + 0].xyzx, cb0[59].wwww, r3.xyzx
mul r4.xyz, r3.yyyy, cb2[r2.x + 0].xyzx
mad r3.xyw, cb2[r1.w + 0].xyxz, r3.xxxx, r4.xyxz
mad r3.xyz, cb2[r2.y + 0].xyzx, r3.zzzz, r3.xywx
dp3 r2.x, v5.xyzx, -r3.xyzx
mov r1.y, v5.y
div r1.xyz, r1.xyzx, r2.xxxx
mad r1.xyz, r0.xxxx, r1.xyzx, cb0[11].xyzx
mad r1.xz, r0.zzwz, r0.yyyy, r1.xxzx
add r0.xyz, r1.xyzx, -cb2[r2.z + 0].xyzx
add r1.xyz, -r1.xyzx, cb3[2].yzwy
dp3 r0.w, r1.xyzx, r1.xyzx
dp3 r1.x, cb2[r1.w + 0].xyzx, cb2[r1.w + 0].xyzx
max r1.y, r1.x, l(1.175494351E-38)
sqrt r1.x, r1.x
div r3.x, l(1.000000, 1.000000, 1.000000, 1.000000), r1.x
rsq r1.x, r1.y
mul r1.xyz, r1.xxxx, cb2[r1.w + 0].xyzx
dp3 r1.w, r0.xyzx, r1.xyzx
mul r2.xzw, r1.wwww, r1.xxyz
dp3 r1.w, r1.xyzx, r1.xyzx
div r2.xzw, r2.xxzw, r1.wwww
dp3 r1.x, r2.xzwx, r1.xyzx
dp3 r1.z, cb2[r2.y + 0].xyzx, cb2[r2.y + 0].xyzx
max r1.w, r1.z, l(1.175494351E-38)
sqrt r1.z, r1.z
div r3.y, l(1.000000, 1.000000, 1.000000, 1.000000), r1.z
rsq r1.z, r1.w
mul r2.xyz, r1.zzzz, cb2[r2.y + 0].xyzx
dp3 r0.x, r0.xyzx, r2.xyzx
mul r0.xyz, r2.xyzx, r0.xxxx
dp3 r1.z, r2.xyzx, r2.xyzx
div r0.xyz, r0.xyzx, r1.zzzz
dp3 r1.y, r0.xyzx, r2.xyzx
mad r0.xy, r1.xyxx, r3.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
frc r1.xy, r0.xyxx
mov r2.x, cb3[2].y
add r2.y, cb3[2].z, -cb0[114].x
add r1.zw, -r2.xxxy, cb3[2].yyyz
dp2 r0.z, r1.zwzz, r1.zwzz
sqrt r0.zw, r0.zzzw
add r0.z, r0.z, l(1.000000)
ge r0.z, r0.z, r0.w
and r0.zw, r1.xxxy, r0.zzzz
sample r1.xyzw, r0.zwzz, t1.xyzw, s1
round_pi_sat r0.z, r1.x
ge r1.xy, l(1.000000, 1.000000, 0.000000, 0.000000), r0.xyxx
ge r0.xy, r0.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
and r0.xy, r0.xyxx, l(0x3f800000, 0x3f800000, 0, 0)
and r1.xy, r1.xyxx, l(0x3f800000, 0x3f800000, 0, 0)
min r0.xy, r0.xyxx, r1.xyxx
min r0.x, r0.y, r0.x
mul r0.x, r0.z, r0.x
mul o0.w, r0.x, l(0.500000)
mov o0.xyz, l(0,0,0,0)
ret
// Approximately 99 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v0.6.164 on Sat Nov 15 07:21:11 2025
//
// cbuffer cb3 : register(b3)
// {
//   float4 cb3[3] : packoffset(c0);
// }
//
// cbuffer cb2 : register(b2)
// {
//   float4 cb2[16] : packoffset(c0);
// }
//
// cbuffer cb1 : register(b1)
// {
//   float4 cb1 : packoffset(c0);
// }
//
// cbuffer cb0 : register(b0)
// {
//   float4 cb0[115] : packoffset(c0);
// }
//
// SamplerState s0_s_s : register(s0);
// SamplerState s1_s_s : register(s1);
// Texture2D<float4> t0 : register(t0);
// Texture2D<float4> t1 : register(t1);
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Buffer<float4> StereoParams : register(t125);
//
//
// void main(
//   float4 v0 : SV_POSITION0,
//   nointerpolation uint v1 : CUSTOM_INSTANCE_ID0,
//   float4 v2 : TEXCOORD0,
//   float4 v3 : TEXCOORD1,
//   float4 v4 : TEXCOORD2,
//   float3 v5 : TEXCOORD3,
//   out float4 o0 : SV_TARGET0)
// {
//   float4 r0,r1,r2,r3,r4;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
//   r0.xyz = cb0[62].xyw * v2.yyy;
//   r0.xyz = cb0[61].xyw * v2.xxx + r0.xyz;
//   r0.xyz = cb0[63].xyw * v2.zzz + r0.xyz;
//   r0.xyz = cb0[64].xyw + r0.xyz;
//   r0.w = cb0[12].x * r0.y;
//   r0.xyw = float3(0.5,0.5,0.5) * r0.xzw;
//   r1.yz = r0.xw + r0.yy;
//   r2.xyzw = StereoParams.Load(float4(0,0,0,0)).xyzw;
//   r0.x = -r2.y + r0.z;
//   r0.x = r2.x * r0.x;
//   r0.y = r2.x * r2.y;
//   r1.x = r0.x * 0.5 + r1.y;
//   r0.xz = r1.xz / r0.zz;
//   r1.xyzw = t0.Sample(s0_s_s, r0.xz).xyzw;
//   r0.x = cb0[14].z * r1.x + cb0[14].w;
//   r0.x = 1 / r0.x;
//   r0.z = cb0[62].x * cb0[62].x;
//   r0.z = cb0[61].x * cb0[61].x + r0.z;
//   r0.z = cb0[63].x * cb0[63].x + r0.z;
//   r0.z = rsqrt(r0.z);
//   r1.y = cb0[58].x;
//   r1.x = cb0[57].x;
//   r1.z = cb0[59].x;
//   r0.w = dot(r1.xyz, r1.xyz);
//   r0.w = sqrt(r0.w);
//   r0.y = r0.y * r0.w;
//   r0.y = r0.y * r0.z;
//   r0.z = dot(r1.xz, r1.xz);
//   r0.z = sqrt(r0.z);
//   r0.zw = r1.xz / r0.zz;
//   r1.xz = r0.zw * r0.yy + v5.xz;
//   r1.w = (int)v1.x + asint(cb1.x);
//   r1.w = (int)r1.w;
//   r1.w = (uint)r1.w;
//   r1.w = (uint)r1.w << 3;
//   r2.x = (uint)r1.w;
//   r3.xyzw = float4(5,4,6,7) + r2.xxxx;
//   r2.xyz = float3(1,2,3) + r2.xxx;
//   r2.xyz = (uint3)r2.xyz;
//   r3.xyzw = (uint4)r3.xyzw;
//   r4.xyz = cb2[r3.x+0].xyz * cb0[59].yyy;
//   r4.xyz = cb2[r3.y+0].xyz * cb0[59].xxx + r4.xyz;
//   r3.xyz = cb2[r3.z+0].xyz * cb0[59].zzz + r4.xyz;
//   r3.xyz = cb2[r3.w+0].xyz * cb0[59].www + r3.xyz;
//   r4.xyz = cb2[r2.x+0].xyz * r3.yyy;
//   r3.xyw = cb2[r1.w+0].xyz * r3.xxx + r4.xyz;
//   r3.xyz = cb2[r2.y+0].xyz * r3.zzz + r3.xyw;
//   r2.x = dot(v5.xyz, -r3.xyz);
//   r1.y = v5.y;
//   r1.xyz = r1.xyz / r2.xxx;
//   r1.xyz = r0.xxx * r1.xyz + cb0[11].xyz;
//   r1.xz = r0.zw * r0.yy + r1.xz;
//   r0.xyz = -cb2[r2.z+0].xyz + r1.xyz;
//   r1.xyz = cb3[2].yzw + -r1.xyz;
//   r0.w = dot(r1.xyz, r1.xyz);
//   r1.x = dot(cb2[r1.w+0].xyz, cb2[r1.w+0].xyz);
//   r1.y = max(1.17549435e-38, r1.x);
//   r1.x = sqrt(r1.x);
//   r3.x = 1 / r1.x;
//   r1.x = rsqrt(r1.y);
//   r1.xyz = cb2[r1.w+0].xyz * r1.xxx;
//   r1.w = dot(r0.xyz, r1.xyz);
//   r2.xzw = r1.xyz * r1.www;
//   r1.w = dot(r1.xyz, r1.xyz);
//   r2.xzw = r2.xzw / r1.www;
//   r1.x = dot(r2.xzw, r1.xyz);
//   r1.z = dot(cb2[r2.y+0].xyz, cb2[r2.y+0].xyz);
//   r1.w = max(1.17549435e-38, r1.z);
//   r1.z = sqrt(r1.z);
//   r3.y = 1 / r1.z;
//   r1.z = rsqrt(r1.w);
//   r2.xyz = cb2[r2.y+0].xyz * r1.zzz;
//   r0.x = dot(r0.xyz, r2.xyz);
//   r0.xyz = r0.xxx * r2.xyz;
//   r1.z = dot(r2.xyz, r2.xyz);
//   r0.xyz = r0.xyz / r1.zzz;
//   r1.y = dot(r0.xyz, r2.xyz);
//   r0.xy = r1.xy * r3.xy + float2(0.5,0.5);
//   r1.xy = frac(r0.xy);
//   r2.x = cb3[2].y;
//   r2.y = -cb0[114].x + cb3[2].z;
//   r1.zw = cb3[2].yz + -r2.xy;
//   r0.z = dot(r1.zw, r1.zw);
//   r0.zw = sqrt(r0.zw);
//   r0.z = 1 + r0.z;
//   r0.z = cmp(r0.z >= r0.w);
//   r0.zw = r0.zz ? r1.xy : 0;
//   r1.xyzw = t1.Sample(s1_s_s, r0.zw).xyzw;
//   r0.z = saturate(ceil(r1.x));
//   r1.xy = cmp(float2(1,1) >= r0.xy);
//   r0.xy = cmp(r0.xy >= float2(0,0));
//   r0.xy = r0.xy ? float2(1,1) : 0;
//   r1.xy = r1.xy ? float2(1,1) : 0;
//   r0.xy = min(r1.xy, r0.xy);
//   r0.x = min(r0.x, r0.y);
//   r0.x = r0.x * r0.z;
//   o0.w = 0.5 * r0.x;
//   o0.xyz = float3(0,0,0);
//   return;
// }
/////////////////////////////////////////////////////////////////////////////
