//Inverted mirror PS 1. Naomi cutscene. Also mission 3 briefing after frying egg.
// ---- Created with 3Dmigoto v0.6.163 on Wed Sep  9 22:31:50 2026
Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

Texture2D<float4> t100 : register(t100);

Texture2D<float4> t101 : register(t101);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

cbuffer cb0 : register(b0)
{
  float4 cb0[4];
}




// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
  float4 v0 : SV_POSITION0,
  float v1 : COLOR2,
  float2 w1 : TEXCOORD0,
  float4 v2 : TEXCOORD1,
  float4 v3 : TEXCOORD2,
  nointerpolation int4 v4 : TEXCOORD4,
  float4 v5 : TEXCOORD5,
  float4 v6 : TEXCOORD7,
  out float4 o0 : SV_TARGET0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  float4 iniparams3 = IniParams.Load(int2(3,0));
  
  r0.x = max(cb0[1].z, v1.x);
  r0.x = min(cb0[1].w, r0.x);
  r0.x = v5.y * r0.x;
  
  if (iniparams3.w==50) {
    w1.x-=stereo.x*(1-stereo.y/v0.w)*0.5;
    w1.x = w1.x*0.5;
    if (stereo.z==1) {
      w1.x+=0.5;
    }
    r1.xyzw = t100.Sample(s0_s, w1.xy).xyzw;
  } else if (iniparams3.w==51) {
    r1.xyzw = t101.Sample(s0_s, w1.xy).xyzw;
  } else {
    r1.xyzw = t0.Sample(s0_s, w1.xy).xyzw;
  }
  
  r1.xyzw = v4.xxxx ? float4(1,1,1,1) : r1.xyzw;
  r1.xyzw = v6.xyzw * r1.xyzw;
  r0.yzw = cb0[2].xyz * v5.xxx + -r1.xyz;
  o0.xyz = r0.xxx * r0.yzw + r1.xyz;
  r0.xy = v0.xy / cb0[3].xy;
  r0.x = t1.Sample(s1_s, r0.xy).x;
  r0.x = -v5.w + r0.x;
  r0.x = saturate(v5.z * r0.x);
  r0.x = r1.w * r0.x;
  r0.y = cmp(r0.x >= cb0[0].x);
  r0.y = r0.y ? 1.000000 : 0;
  o0.w = r0.x * r0.y;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.163 on Wed Sep  9 22:31:50 2026
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy
// COLOR                    2   x           1     NONE   float   x
// TEXCOORD                 0    yz         1     NONE   float    yz
// TEXCOORD                 1   xyzw        2     NONE   float
// TEXCOORD                 2   xyzw        3     NONE   float
// TEXCOORD                 4   xyzw        4     NONE     int   x
// TEXCOORD                 5   xyzw        5     NONE   float   xyzw
// TEXCOORD                 7   xyzw        6     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB0[4], 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_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.x
dcl_input_ps linear v1.yz
dcl_input_ps constant v4.x
dcl_input_ps linear v5.xyzw
dcl_input_ps linear v6.xyzw
dcl_output o0.xyzw
dcl_temps 2
max r0.x, v1.x, cb0[1].z
min r0.x, r0.x, cb0[1].w
mul r0.x, r0.x, v5.y
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, v1.yzyy, t0.xyzw, s0
movc r1.xyzw, v4.xxxx, l(1.000000,1.000000,1.000000,1.000000), r1.xyzw
mul r1.xyzw, r1.xyzw, v6.xyzw
mad r0.yzw, cb0[2].xxyz, v5.xxxx, -r1.xxyz
mad o0.xyz, r0.xxxx, r0.yzwy, r1.xyzx
div r0.xy, v0.xyxx, cb0[3].xyxx
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t1.xyzw, s1
add r0.x, r0.x, -v5.w
mul_sat r0.x, r0.x, v5.z
mul r0.x, r0.x, r1.w
ge r0.y, r0.x, cb0[0].x
and r0.y, r0.y, l(0x3f800000)
mul o0.w, r0.y, r0.x
ret
// Approximately 0 instruction slots used

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
