// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:30:28 2016

cbuffer cbSampleOffset : register(b1)
{
  float4 g_avSampleOffsets[16] : packoffset(c0);
}

SamplerState SS_ClampLinear_s : register(s3);
Texture2D<float4> g_SourceTex : register(t0);
Texture2D<float4> g_SourceTex2 : register(t3);


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


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

  r0.xyzw = g_SourceTex2.SampleLevel(SS_ClampLinear_s, v1.xy, 0).xyzw;
  r1.xyzw = float4(1,1,1,1) + -r0.xyzw;
  r2.xyzw = g_SourceTex.SampleLevel(SS_ClampLinear_s, v1.xy, 0).xyzw;
  r3.xyzw = float4(1,1,1,1) + -r2.xyzw;
  r3.xyzw = r3.xyzw + r3.xyzw;
  r1.xyzw = -r3.xyzw * r1.xyzw + float4(1,1,1,1);
  r0.xyzw = r2.xyzw * r0.xyzw;
  r0.xyzw = r0.xyzw + r0.xyzw;
  r3.xyzw = cmp(r2.xyzw < float4(0.5,0.5,0.5,0.5));
  r0.xyzw = r3.xyzw ? r0.xyzw : r1.xyzw;
  r0.xyzw = r0.xyzw + -r2.xyzw;
  o0.xyzw = g_avSampleOffsets[0].xxxx * r0.xyzw + r2.xyzw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer cbSampleOffset
// {
//
//   float4 g_avSampleOffsets[16];      // Offset:    0 Size:   256
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SS_ClampLinear                    sampler      NA          NA    3        1
// g_SourceTex                       texture  float4          2d    0        1
// g_SourceTex2                      texture  float4          2d    3        1
// cbSampleOffset                    cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float       
// TEXCOORD                 0   xy          1     NONE   float   xy  
//
//
// 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 cb1[1], immediateIndexed
dcl_sampler s3, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t3
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 4
sample_l_indexable(texture2d)(float,float,float,float) r0.xyzw, v1.xyxx, t3.xyzw, s3, l(0.000000)
add r1.xyzw, -r0.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
sample_l_indexable(texture2d)(float,float,float,float) r2.xyzw, v1.xyxx, t0.xyzw, s3, l(0.000000)
add r3.xyzw, -r2.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
add r3.xyzw, r3.xyzw, r3.xyzw
mad r1.xyzw, -r3.xyzw, r1.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
mul r0.xyzw, r0.xyzw, r2.xyzw
add r0.xyzw, r0.xyzw, r0.xyzw
lt r3.xyzw, r2.xyzw, l(0.500000, 0.500000, 0.500000, 0.500000)
movc r0.xyzw, r3.xyzw, r0.xyzw, r1.xyzw
add r0.xyzw, -r2.xyzw, r0.xyzw
mad o0.xyzw, cb1[0].xxxx, r0.xyzw, r2.xyzw
ret 
// Approximately 13 instruction slots used

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