// REflections on the Wall
Texture2D<float4> t5 : register(t5);

Texture2D<float4> t4 : register(t4);

Texture2D<float4> t3 : register(t3);

Texture2D<float4> t2 : register(t2);

Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s5_s : register(s5);

SamplerState s4_s : register(s4);

SamplerState s3_s : register(s3);

SamplerState s2_s : register(s2);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

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




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


void main( 
  linear noperspective float4 v0 : TEXCOORD0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = t1.SampleLevel(s1_s, v0.xy, 0).xzyw;
  r0.w = 255 * r0.w;
  r0.w = round(r0.w);
  r0.w = (uint)r0.w;
  r0.w = (int)r0.w & 15;
  r1.x = cmp(0 < (uint)r0.w);
  r1.y = cmp((int)r0.w != 7);
  r1.x = r1.y ? r1.x : 0;
  if (r1.x != 0) {
    r1.xyz = t0.SampleLevel(s0_s, v0.xy, 0).xyz;
    r2.xyz = t2.SampleLevel(s2_s, v0.xy, 0).xyz;
    r3.xy = cb0[118].xy * v0.xy;
    r3.xy = (uint2)r3.xy;
    r1.w = (uint)cb0[135].x;
    r2.w = (int)r3.y + (int)r3.x;
    r1.w = (int)r1.w + (int)r2.w;
    r1.w = (int)r1.w & 1;
    r1.xyz = r1.xyz * float3(2,2,2) + float3(-1,-1,-1);
    r2.w = dot(r1.xyz, r1.xyz);
    r2.w = rsqrt(r2.w);
    r1.xyz = r2.www * r1.xyz;
	
	
    r2.w = 0.0799999982 * r0.z;
    r2.xyz = -r0.zzz * float3(0.0799999982,0.0799999982,0.0799999982) + r2.xyz;
    r2.xyz = r0.xxx * r2.xyz + r2.www;
    r0.z = cmp((int)r0.w == 5);
    r0.w = cmp(0 < cb0[139].x);
    r2.w = cmp(0 < cb0[169].w);
    r0.w = r0.w ? r2.w : 0;
    r1.w = r1.w ? 0 : 1;
    r3.xyz = r2.xyz * r1.www;
    r3.xyz = r0.www ? r3.xyz : r2.xyz;
    r2.xyz = r0.zzz ? r3.xyz : r2.xyz;
    r2.xyz = r2.xyz * cb0[121].www + cb0[121].xyz;
    r0.z = t3.SampleLevel(s3_s, v0.xy, 0).x;
	
	//Fix
    float4 stereo = StereoParams.Load(0);
    v0.z -= stereo.x;
	
    r3.xyz = cb0[41].xyz * v0.www;
    r3.xyz = v0.zzz * cb0[40].xyz + r3.xyz;
    r3.xyz = cb0[42].xyz + r3.xyz;
		
    r0.w = dot(r3.xyz, r3.xyz);
    r0.w = rsqrt(r0.w);
    r3.xyz = r3.xyz * r0.www;
		
    r0.x = saturate(dot(r1.xyz, -r3.xyz));
    r0.yw = t4.SampleLevel(s4_s, r0.xy, 0).xy;
    r1.x = saturate(50 * r2.y);
    r0.w = r1.x * r0.w;
    r1.xyz = r2.xyz * r0.yyy + r0.www;
    r0.x = r0.x + r0.z;
    r0.x = r0.x * r0.x + r0.z;
    r0.x = saturate(-1 + r0.x);
    r0.xyz = r1.xyz * r0.xxx;
    r1.xyz = t5.Sample(s5_s, v0.xy).xyz;
    r0.xyz = r1.xyz * r0.xyz;
    r0.xyz = min(float3(0,0,0), -r0.xyz);
    r0.xyz = -r0.xyz;
  } else {
    r0.xyz = float3(0,0,0);
  }
  o0.xyz = r0.xyz;
  o0.w = 0;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.65 on Sun Oct 01 09:57:31 2017
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xyzw        0     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[170], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_input_ps linear noperspective v0.xyzw
dcl_output o0.xyzw
dcl_temps 4
sample_l_indexable(texture2d)(float,float,float,float) r0.xyzw, v0.xyxx, t1.xzyw, s1, l(0.000000)
mul r0.w, r0.w, l(255.000000)
round_ne r0.w, r0.w
ftou r0.w, r0.w
and r0.w, r0.w, l(15)
ult r1.x, l(0), r0.w
ine r1.y, r0.w, l(7)
and r1.x, r1.y, r1.x
if_nz r1.x
  sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, v0.xyxx, t0.xyzw, s0, l(0.000000)
  sample_l_indexable(texture2d)(float,float,float,float) r2.xyz, v0.xyxx, t2.xyzw, s2, l(0.000000)
  mul r3.xy, v0.xyxx, cb0[118].xyxx
  ftou r3.xy, r3.xyxx
  ftou r1.w, cb0[135].x
  iadd r2.w, r3.y, r3.x
  iadd r1.w, r1.w, r2.w
  and r1.w, r1.w, l(1)
  mad r1.xyz, r1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  dp3 r2.w, r1.xyzx, r1.xyzx
  rsq r2.w, r2.w
  mul r1.xyz, r1.xyzx, r2.wwww
  mul r2.w, r0.z, l(0.080000)
  mad r2.xyz, -r0.zzzz, l(0.080000, 0.080000, 0.080000, 0.000000), r2.xyzx
  mad r2.xyz, r0.xxxx, r2.xyzx, r2.wwww
  ieq r0.z, r0.w, l(5)
  lt r0.w, l(0.000000), cb0[139].x
  lt r2.w, l(0.000000), cb0[169].w
  and r0.w, r0.w, r2.w
  movc r1.w, r1.w, l(0), l(1.000000)
  mul r3.xyz, r1.wwww, r2.xyzx
  movc r3.xyz, r0.wwww, r3.xyzx, r2.xyzx
  movc r2.xyz, r0.zzzz, r3.xyzx, r2.xyzx
  mad r2.xyz, r2.xyzx, cb0[121].wwww, cb0[121].xyzx
  sample_l_indexable(texture2d)(float,float,float,float) r0.z, v0.xyxx, t3.yzxw, s3, l(0.000000)
  mul r3.xyz, v0.wwww, cb0[41].xyzx
  mad r3.xyz, v0.zzzz, cb0[40].xyzx, r3.xyzx
  add r3.xyz, r3.xyzx, cb0[42].xyzx
  dp3 r0.w, r3.xyzx, r3.xyzx
  rsq r0.w, r0.w
  mul r3.xyz, r0.wwww, r3.xyzx
  dp3_sat r0.x, r1.xyzx, -r3.xyzx
  sample_l_indexable(texture2d)(float,float,float,float) r0.yw, r0.xyxx, t4.zxwy, s4, l(0.000000)
  mul_sat r1.x, r2.y, l(50.000000)
  mul r0.w, r0.w, r1.x
  mad r1.xyz, r2.xyzx, r0.yyyy, r0.wwww
  add r0.x, r0.z, r0.x
  mad r0.x, r0.x, r0.x, r0.z
  add_sat r0.x, r0.x, l(-1.000000)
  mul r0.xyz, r0.xxxx, r1.xyzx
  sample_indexable(texture2d)(float,float,float,float) r1.xyz, v0.xyxx, t5.xyzw, s5
  mul r0.xyz, r0.xyzx, r1.xyzx
  min r0.xyz, -r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  mov r0.xyz, -r0.xyzx
else 
  mov r0.xyz, l(0,0,0,0)
endif 
mov o0.xyz, r0.xyzx
mov o0.w, l(0)
ret 
// Approximately 0 instruction slots used

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