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

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

SamplerState SS_WhiteBorderPoint_s : register(s4);
Texture2D<float4> g_DepthTex : register(t0);


// 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;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xy = g_avSampleOffsets[1].xy + v1.xy;
  r0.yzw = g_DepthTex.SampleLevel(SS_WhiteBorderPoint_s, r0.xy, 0).xyz;
  r0.x = dot(r0.yzw, float3(1.53787005e-005,0.00392156886,1));
  r1.xy = g_avSampleOffsets[0].xy + v1.xy;
  r1.yzw = g_DepthTex.SampleLevel(SS_WhiteBorderPoint_s, r1.xy, 0).xyz;
  r1.x = dot(r1.yzw, float3(1.53787005e-005,0.00392156886,1));
  r2.x = cmp(r0.x < r1.x);
  r0.xyzw = r2.xxxx ? r0.xyzw : r1.xyzw;
  r1.xy = g_avSampleOffsets[2].xy + v1.xy;
  r1.yzw = g_DepthTex.SampleLevel(SS_WhiteBorderPoint_s, r1.xy, 0).xyz;
  r1.x = dot(r1.yzw, float3(1.53787005e-005,0.00392156886,1));
  r2.x = cmp(r1.x < r0.x);
  r0.xyzw = r2.xxxx ? r1.xyzw : r0.xyzw;
  r1.xy = g_avSampleOffsets[3].xy + v1.xy;
  r1.xyz = g_DepthTex.SampleLevel(SS_WhiteBorderPoint_s, r1.xy, 0).xyz;
  r1.w = dot(r1.xyz, float3(1.53787005e-005,0.00392156886,1));
  r0.x = cmp(r1.w < r0.x);
  o0.xyz = r0.xxx ? r1.xyz : r0.yzw;
  o0.w = 1;
  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_WhiteBorderPoint               sampler      NA          NA    4        1
// g_DepthTex                        texture  float4          2d    0        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[4], immediateIndexed
dcl_sampler s4, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 3
add r0.xy, v1.xyxx, cb1[1].xyxx
sample_l_indexable(texture2d)(float,float,float,float) r0.yzw, r0.xyxx, t0.wxyz, s4, l(0.000000)
dp3 r0.x, r0.yzwy, l(0.000015, 0.003922, 1.000000, 0.000000)
add r1.xy, v1.xyxx, cb1[0].xyxx
sample_l_indexable(texture2d)(float,float,float,float) r1.yzw, r1.xyxx, t0.wxyz, s4, l(0.000000)
dp3 r1.x, r1.yzwy, l(0.000015, 0.003922, 1.000000, 0.000000)
lt r2.x, r0.x, r1.x
movc r0.xyzw, r2.xxxx, r0.xyzw, r1.xyzw
add r1.xy, v1.xyxx, cb1[2].xyxx
sample_l_indexable(texture2d)(float,float,float,float) r1.yzw, r1.xyxx, t0.wxyz, s4, l(0.000000)
dp3 r1.x, r1.yzwy, l(0.000015, 0.003922, 1.000000, 0.000000)
lt r2.x, r1.x, r0.x
movc r0.xyzw, r2.xxxx, r1.xyzw, r0.xyzw
add r1.xy, v1.xyxx, cb1[3].xyxx
sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t0.xyzw, s4, l(0.000000)
dp3 r1.w, r1.xyzx, l(0.000015, 0.003922, 1.000000, 0.000000)
lt r0.x, r1.w, r0.x
movc o0.xyz, r0.xxxx, r1.xyzx, r0.yzwy
mov o0.w, l(1.000000)
ret 
// Approximately 20 instruction slots used

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