// AO2 ?
Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

cbuffer cb1 : register(b1)
{
  float4 cb1[146];
}

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




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

#include "matrix.hlsl"

void main( 
  float4 v0 : SV_POSITION0,
  out float4 o0 : SV_Target0,
  out float4 o1 : SV_Target1)
{
  float4 r0,r1,r2,r3,r4;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xy = cb1[116].zw * v0.xy;
  r0.z = t0.SampleLevel(s0_s, r0.xy, 0).x;
  

  
  r0.w = r0.z * cb1[51].z + -cb1[51].w;
  r0.z = r0.z * cb1[51].x + cb1[51].y;
  r0.w = 1 / r0.w;
  r0.z = r0.z + r0.w;
  r1.xy = asuint(cb0[4].xy);
  r0.xy = -r1.xy * cb1[116].zw + r0.xy;
  r1.xy = float2(0.5,0.5) * cb1[145].zw;
  r1.xy = floor(r1.xy);
  r1.zw = r0.xy * r1.xy + float2(-0.5,-0.5);
  r1.zw = floor(r1.zw);
  r1.zw = r1.zw / r1.xy;
  r2.xy = float2(1,1) / r1.xy;
  r1.zw = r2.xy * float2(0.5,0.5) + r1.zw;
  r3.xy = r1.zw + r2.xy;
  r3.xy = t1.SampleLevel(s1_s, r3.xy, 0).xy;
  r4.w = r3.y;
  r2.z = 0;
  r2.xyzw = r1.zwzw + r2.xzzy;
  r2.xy = t1.SampleLevel(s1_s, r2.xy, 0).xy;
  r2.zw = t1.SampleLevel(s1_s, r2.zw, 0).xy;
  r4.yz = r2.yw;
  r2.yw = t1.SampleLevel(s1_s, r1.zw, 0).xy;
  r0.xy = -r1.zw + r0.xy;
  r4.x = r2.w;
  r4.xyzw = abs(r4.xyzw) + -r0.zzzz;
  r4.xyzw = float4(9.99999975e-005,9.99999975e-005,9.99999975e-005,9.99999975e-005) + abs(r4.xyzw);
  r4.xyzw = float4(1,1,1,1) / r4.xyzw;
  r0.zw = r0.xy * r1.xy;
  r0.xy = -r0.yx * r1.yx + float2(1,1);
  r1.xyzw = r0.xxyw * r0.yzwz;
  r0.xyzw = r1.xyzw * r4.xyzw;
  r1.x = r0.y * r2.x;
  r1.x = r0.x * r2.y + r1.x;
  r1.x = r0.z * r2.z + r1.x;
  r1.x = r0.w * r3.x + r1.x;
  r0.x = dot(r0.xyzw, float4(1,1,1,1));
  r0.xyzw = r1.xxxx / r0.xxxx;
  r1.x = sqrt(r0.w);
  r1.y = cmp(0 < cb0[7].z);
  o0.xyzw = r1.yyyy ? r1.xxxx : r0.wwww;
  o1.xyzw = r0.xyzw;
  
  
  
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xyzw        1   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[8], immediateIndexed
dcl_constantbuffer cb1[146], 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_output o0.xyzw
dcl_output o1.xyzw
dcl_temps 5
mul r0.xy, v0.xyxx, cb1[116].zwzz
sample_l_indexable(texture2d)(float,float,float,float) r0.z, r0.xyxx, t0.yzxw, s0, l(0.000000)
mad r0.w, r0.z, cb1[51].z, -cb1[51].w
mad r0.z, r0.z, cb1[51].x, cb1[51].y
div r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r0.w
add r0.z, r0.w, r0.z
utof r1.xy, cb0[4].xyxx
mad r0.xy, -r1.xyxx, cb1[116].zwzz, r0.xyxx
mul r1.xy, cb1[145].zwzz, l(0.500000, 0.500000, 0.000000, 0.000000)
round_ni r1.xy, r1.xyxx
mad r1.zw, r0.xxxy, r1.xxxy, l(0.000000, 0.000000, -0.500000, -0.500000)
round_ni r1.zw, r1.zzzw
div r1.zw, r1.zzzw, r1.xxxy
div r2.xy, l(1.000000, 1.000000, 1.000000, 1.000000), r1.xyxx
mad r1.zw, r2.xxxy, l(0.000000, 0.000000, 0.500000, 0.500000), r1.zzzw
add r3.xy, r2.xyxx, r1.zwzz
sample_l_indexable(texture2d)(float,float,float,float) r3.xy, r3.xyxx, t1.xyzw, s1, l(0.000000)
mov r4.w, r3.y
mov r2.z, l(0)
add r2.xyzw, r2.xzzy, r1.zwzw
sample_l_indexable(texture2d)(float,float,float,float) r2.xy, r2.xyxx, t1.xyzw, s1, l(0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r2.zw, r2.zwzz, t1.zwxy, s1, l(0.000000)
mov r4.yz, r2.yywy
sample_l_indexable(texture2d)(float,float,float,float) r2.yw, r1.zwzz, t1.zxwy, s1, l(0.000000)
add r0.xy, r0.xyxx, -r1.zwzz
mov r4.x, r2.w
add r4.xyzw, -r0.zzzz, |r4.xyzw|
add r4.xyzw, |r4.xyzw|, l(0.000100, 0.000100, 0.000100, 0.000100)
div r4.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000), r4.xyzw
mul r0.zw, r1.xxxy, r0.xxxy
mad r0.xy, -r0.yxyy, r1.yxyy, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r1.xyzw, r0.yzwz, r0.xxyw
mul r0.xyzw, r4.xyzw, r1.xyzw
mul r1.x, r2.x, r0.y
mad r1.x, r0.x, r2.y, r1.x
mad r1.x, r0.z, r2.z, r1.x
mad r1.x, r0.w, r3.x, r1.x
dp4 r0.x, r0.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
div r0.xyzw, r1.xxxx, r0.xxxx
sqrt r1.x, r0.w
lt r1.y, l(0.000000), cb0[7].z
movc o0.xyzw, r1.yyyy, r1.xxxx, r0.wwww
mov o1.xyzw, r0.xyzw
ret 
// Approximately 0 instruction slots used

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