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

cbuffer Constants : register(b0)
{
  float4 cxadd : packoffset(c0);
  float4 cxmul : packoffset(c1);
}

SamplerState sampler_dsttex_s : register(s0);
SamplerState sampler_srctex_s : register(s1);
Texture2D<float4> dsttex : register(t0);
Texture2D<float4> srctex : register(t1);


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


void main( 
  float2 v0 : TEXCOORD0,
  float2 w0 : TEXCOORD1,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = srctex.Sample(sampler_srctex_s, v0.xy).xyzw;
  r0.xyzw = saturate(r0.xyzw * cxmul.xyzw + cxadd.xyzw);
  r1.xyzw = float4(1,1,1,1) + -r0.xyzw;
  r1.xyz = r1.xyz + r1.xyz;
  r2.xyzw = dsttex.Sample(sampler_dsttex_s, w0.xy).xyzw;
  r3.xyzw = float4(1,1,1,1) + -r2.xyzw;
  r1.xyz = -r1.xyz * r3.xyz + float3(1,1,1);
  r3.xyz = r3.www * r0.xyz;
  r4.xyz = cmp(r2.xyz >= float3(0.5,0.5,0.5));
  r5.xyz = r4.xyz ? float3(0,0,0) : float3(1,1,1);
  r4.xyz = r4.xyz ? 1.000000 : 0;
  r1.xyz = r5.xyz * r1.xyz;
  r0.xyz = r2.xyz * r0.xyz;
  r0.xyz = r0.xyz + r0.xyz;
  r0.xyz = r0.xyz * r4.xyz + r1.xyz;
  r0.xyz = r0.xyz * r0.www + r3.xyz;
  o0.w = r2.w * r1.w + r0.w;
  o0.xyz = r2.xyz * r1.www + r0.xyz;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer Constants
// {
//
//   float4 cxadd;                      // Offset:    0 Size:    16
//   float4 cxmul;                      // Offset:   16 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// sampler_dsttex                    sampler      NA          NA    0        1
// sampler_srctex                    sampler      NA          NA    1        1
// dsttex                            texture  float4          2d    0        1
// srctex                            texture  float4          2d    1        1
// Constants                         cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float   xy  
// TEXCOORD                 1     zw        0     NONE   float     zw
//
//
// 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[2], 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 linear v0.xy
dcl_input_ps linear v0.zw
dcl_output o0.xyzw
dcl_temps 6
sample_indexable(texture2d)(float,float,float,float) r0.xyzw, v0.xyxx, t1.xyzw, s1
mad_sat r0.xyzw, r0.xyzw, cb0[1].xyzw, cb0[0].xyzw
add r1.xyzw, -r0.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
add r1.xyz, r1.xyzx, r1.xyzx
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, v0.zwzz, t0.xyzw, s0
add r3.xyzw, -r2.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
mad r1.xyz, -r1.xyzx, r3.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r3.xyz, r0.xyzx, r3.wwww
ge r4.xyz, r2.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
movc r5.xyz, r4.xyzx, l(0,0,0,0), l(1.000000,1.000000,1.000000,0)
and r4.xyz, r4.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
mul r1.xyz, r1.xyzx, r5.xyzx
mul r0.xyz, r0.xyzx, r2.xyzx
add r0.xyz, r0.xyzx, r0.xyzx
mad r0.xyz, r0.xyzx, r4.xyzx, r1.xyzx
mad r0.xyz, r0.xyzx, r0.wwww, r3.xyzx
mad o0.w, r2.w, r1.w, r0.w
mad o0.xyz, r2.xyzx, r1.wwww, r0.xyzx
ret 
// Approximately 19 instruction slots used

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