// ---- Created with 3Dmigoto v1.2.56 on Wed Mar 22 11:35:11 2017

SamplerState g_TexColorSampler_s : register(s0);
Texture2D<float4> g_TexColor : 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,r3;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = g_TexColor.SampleLevel(g_TexColorSampler_s, v1.xy, 0).xyz;
  r1.xyz = g_TexColor.SampleLevel(g_TexColorSampler_s, v1.xy, 0, int2(-1, 0)).xyz;
  r2.xyz = g_TexColor.SampleLevel(g_TexColorSampler_s, v1.xy, 0, int2(0, -1)).xyz;
  r1.xyz = -r1.xyz + r0.xyz;
  r0.w = max(abs(r1.x), abs(r1.y));
  r1.x = max(r0.w, abs(r1.z));
  r2.xyz = -r2.xyz + r0.xyz;
  r0.w = max(abs(r2.x), abs(r2.y));
  r1.y = max(r0.w, abs(r2.z));
  r1.zw = cmp(r1.xy >= float2(0.100000001,0.100000001));
  r1.zw = r1.zw ? float2(1,1) : 0;
  r0.w = dot(r1.zw, float2(1,1));
  r0.w = cmp(r0.w == 0.000000);
  if (r0.w != 0) {
    o0.xyzw = float4(0,0,0,1);
    return;
  }
  r2.xyz = g_TexColor.SampleLevel(g_TexColorSampler_s, v1.xy, 0, int2(1, 0)).xyz;
  r3.xyz = g_TexColor.SampleLevel(g_TexColorSampler_s, v1.xy, 0, int2(0, 1)).xyz;
  r2.xyz = -r2.xyz + r0.xyz;
  r0.w = max(abs(r2.x), abs(r2.y));
  r0.w = max(r0.w, abs(r2.z));
  r2.xyz = -r3.xyz + r0.xyz;
  r2.x = max(abs(r2.x), abs(r2.y));
  r2.x = max(r2.x, abs(r2.z));
  r2.y = max(r1.x, r1.y);
  r0.w = max(r2.y, r0.w);
  r0.w = max(r0.w, r2.x);
  r2.xyz = g_TexColor.SampleLevel(g_TexColorSampler_s, v1.xy, 0, int2(-2, 0)).xyz;
  r3.xyz = g_TexColor.SampleLevel(g_TexColorSampler_s, v1.xy, 0, int2(0, -2)).xyz;
  r2.xyz = -r2.xyz + r0.xyz;
  r2.x = max(abs(r2.x), abs(r2.y));
  r2.x = max(r2.x, abs(r2.z));
  r0.xyz = -r3.xyz + r0.xyz;
  r0.x = max(abs(r0.x), abs(r0.y));
  r0.x = max(r0.x, abs(r0.z));
  r0.y = max(r2.x, r0.w);
  r0.x = max(r0.y, r0.x);
  r0.x = 0.5 * r0.x;
  r0.xy = cmp(r1.xy >= r0.xx);
  r0.xy = r0.xy ? float2(1,1) : 0;
  o0.xy = r1.zw * r0.xy;
  o0.zw = float2(0,1);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.56 on Wed Mar 22 11:35:11 2017
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_TexColorSampler                 sampler      NA          NA    0        1
// g_TexColor                        texture  float4          2d    0        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_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 4
sample_l_indexable(texture2d)(float,float,float,float) r0.xyz, v1.xyxx, t0.xyzw, s0, l(0.000000)
sample_l_aoffimmi_indexable(-1,0,0)(texture2d)(float,float,float,float) r1.xyz, v1.xyxx, t0.xyzw, s0, l(0.000000)
sample_l_aoffimmi_indexable(0,-1,0)(texture2d)(float,float,float,float) r2.xyz, v1.xyxx, t0.xyzw, s0, l(0.000000)
add r1.xyz, r0.xyzx, -r1.xyzx
max r0.w, |r1.y|, |r1.x|
max r1.x, |r1.z|, r0.w
add r2.xyz, r0.xyzx, -r2.xyzx
max r0.w, |r2.y|, |r2.x|
max r1.y, |r2.z|, r0.w
ge r1.zw, r1.xxxy, l(0.000000, 0.000000, 0.100000, 0.100000)
and r1.zw, r1.zzzw, l(0, 0, 0x3f800000, 0x3f800000)
dp2 r0.w, r1.zwzz, l(1.000000, 1.000000, 0.000000, 0.000000)
eq r0.w, r0.w, l(0.000000)
if_nz r0.w
  mov o0.xyzw, l(0,0,0,1.000000)
  ret 
endif 
sample_l_aoffimmi_indexable(1,0,0)(texture2d)(float,float,float,float) r2.xyz, v1.xyxx, t0.xyzw, s0, l(0.000000)
sample_l_aoffimmi_indexable(0,1,0)(texture2d)(float,float,float,float) r3.xyz, v1.xyxx, t0.xyzw, s0, l(0.000000)
add r2.xyz, r0.xyzx, -r2.xyzx
max r0.w, |r2.y|, |r2.x|
max r0.w, |r2.z|, r0.w
add r2.xyz, r0.xyzx, -r3.xyzx
max r2.x, |r2.y|, |r2.x|
max r2.x, |r2.z|, r2.x
max r2.y, r1.y, r1.x
max r0.w, r0.w, r2.y
max r0.w, r2.x, r0.w
sample_l_aoffimmi_indexable(-2,0,0)(texture2d)(float,float,float,float) r2.xyz, v1.xyxx, t0.xyzw, s0, l(0.000000)
sample_l_aoffimmi_indexable(0,-2,0)(texture2d)(float,float,float,float) r3.xyz, v1.xyxx, t0.xyzw, s0, l(0.000000)
add r2.xyz, r0.xyzx, -r2.xyzx
max r2.x, |r2.y|, |r2.x|
max r2.x, |r2.z|, r2.x
add r0.xyz, r0.xyzx, -r3.xyzx
max r0.x, |r0.y|, |r0.x|
max r0.x, |r0.z|, r0.x
max r0.y, r0.w, r2.x
max r0.x, r0.x, r0.y
mul r0.x, r0.x, l(0.500000)
ge r0.xy, r1.xyxx, r0.xxxx
and r0.xy, r0.xyxx, l(0x3f800000, 0x3f800000, 0, 0)
mul o0.xy, r0.xyxx, r1.zwzz
mov o0.zw, l(0,0,0,1.000000)
ret 
// Approximately 44 instruction slots used

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