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

SamplerState g_samPointClamp_s : register(s7);
Texture3D<float4> g_Texture_velocity1 : register(t1);
Texture3D<float4> g_Texture_obstacles : register(t3);
Texture3D<float4> g_Texture_obstvelocity : register(t4);


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


void main( 
  float4 v0 : SV_Position0,
  float4 v1 : TEXCOORD0,
  float4 v2 : TEXCOORD1,
  float2 v3 : TEXCOORD2,
  float2 w3 : TEXCOORD3,
  float2 v4 : TEXCOORD4,
  uint v5 : SV_RenderTargetArrayIndex0,
  out float o0 : SV_Target0)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = v3.x;
  r0.yz = v2.yz;
  r0.w = g_Texture_obstacles.SampleLevel(g_samPointClamp_s, r0.xyz, 0).x;
  r0.w = cmp(0.899999976 < r0.w);
  if (r0.w != 0) {
    r0.w = g_Texture_obstvelocity.SampleLevel(g_samPointClamp_s, r0.xyz, 0).x;
  } else {
    r0.w = g_Texture_velocity1.SampleLevel(g_samPointClamp_s, r0.xyz, 0).x;
  }
  r0.x = v3.y;
  r0.yz = v2.yz;
  r1.x = g_Texture_obstacles.SampleLevel(g_samPointClamp_s, r0.xyz, 0).x;
  r1.x = cmp(0.899999976 < r1.x);
  if (r1.x != 0) {
    r1.x = g_Texture_obstvelocity.SampleLevel(g_samPointClamp_s, r0.xyz, 0).x;
  } else {
    r1.x = g_Texture_velocity1.SampleLevel(g_samPointClamp_s, r0.xyz, 0).x;
  }
  r0.xz = v2.xz;
  r0.y = w3.x;
  r1.y = g_Texture_obstacles.SampleLevel(g_samPointClamp_s, r0.xyz, 0).x;
  r1.y = cmp(0.899999976 < r1.y);
  if (r1.y != 0) {
    r1.y = g_Texture_obstvelocity.SampleLevel(g_samPointClamp_s, r0.xyz, 0).y;
  } else {
    r1.y = g_Texture_velocity1.SampleLevel(g_samPointClamp_s, r0.xyz, 0).y;
  }
  r0.xz = v2.xz;
  r0.y = w3.y;
  r1.z = g_Texture_obstacles.SampleLevel(g_samPointClamp_s, r0.xyz, 0).x;
  r1.z = cmp(0.899999976 < r1.z);
  if (r1.z != 0) {
    r1.z = g_Texture_obstvelocity.SampleLevel(g_samPointClamp_s, r0.xyz, 0).y;
  } else {
    r1.z = g_Texture_velocity1.SampleLevel(g_samPointClamp_s, r0.xyz, 0).y;
  }
  r0.xy = v2.xy;
  r0.z = v4.x;
  r1.w = g_Texture_obstacles.SampleLevel(g_samPointClamp_s, r0.xyz, 0).x;
  r1.w = cmp(0.899999976 < r1.w);
  if (r1.w != 0) {
    r1.w = g_Texture_obstvelocity.SampleLevel(g_samPointClamp_s, r0.xyz, 0).z;
  } else {
    r1.w = g_Texture_velocity1.SampleLevel(g_samPointClamp_s, r0.xyz, 0).z;
  }
  r0.xy = v2.xy;
  r0.z = v4.y;
  r2.x = g_Texture_obstacles.SampleLevel(g_samPointClamp_s, r0.xyz, 0).x;
  r2.x = cmp(0.899999976 < r2.x);
  if (r2.x != 0) {
    r2.x = g_Texture_obstvelocity.SampleLevel(g_samPointClamp_s, r0.xyz, 0).z;
  } else {
    r2.x = g_Texture_velocity1.SampleLevel(g_samPointClamp_s, r0.xyz, 0).z;
  }
  r0.x = r1.x + -r0.w;
  r0.y = r1.z + -r1.y;
  r0.x = r0.x + r0.y;
  r0.y = r2.x + -r1.w;
  r0.x = r0.x + r0.y;
  o0.x = 0.5 * r0.x;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_samPointClamp                   sampler      NA          NA    7        1
// g_Texture_velocity1               texture  float4          3d    1        1
// g_Texture_obstacles               texture  float4          3d    3        1
// g_Texture_obstvelocity            texture  float4          3d    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float       
// TEXCOORD                 0   xyz         1     NONE   float       
// TEXCOORD                 1   xyz         2     NONE   float   xyz 
// TEXCOORD                 2   xy          3     NONE   float   xy  
// TEXCOORD                 3     zw        3     NONE   float     zw
// TEXCOORD                 4   xy          4     NONE   float   xy  
// SV_RenderTargetArrayIndex     0   x           5  RTINDEX    uint       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   x           0   TARGET   float   x   
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_sampler s7, mode_default
dcl_resource_texture3d (float,float,float,float) t1
dcl_resource_texture3d (float,float,float,float) t3
dcl_resource_texture3d (float,float,float,float) t4
dcl_input_ps linear v2.xyz
dcl_input_ps linear v3.xy
dcl_input_ps linear v3.zw
dcl_input_ps linear v4.xy
dcl_output o0.x
dcl_temps 3
mov r0.x, v3.x
mov r0.yz, v2.yyzy
sample_l_indexable(texture3d)(float,float,float,float) r0.w, r0.xyzx, t3.yzwx, s7, l(0.000000)
lt r0.w, l(0.900000), r0.w
if_nz r0.w
  sample_l_indexable(texture3d)(float,float,float,float) r0.w, r0.xyzx, t4.yzwx, s7, l(0.000000)
else 
  sample_l_indexable(texture3d)(float,float,float,float) r0.w, r0.xyzx, t1.yzwx, s7, l(0.000000)
endif 
mov r0.x, v3.y
mov r0.yz, v2.yyzy
sample_l_indexable(texture3d)(float,float,float,float) r1.x, r0.xyzx, t3.xyzw, s7, l(0.000000)
lt r1.x, l(0.900000), r1.x
if_nz r1.x
  sample_l_indexable(texture3d)(float,float,float,float) r1.x, r0.xyzx, t4.xyzw, s7, l(0.000000)
else 
  sample_l_indexable(texture3d)(float,float,float,float) r1.x, r0.xyzx, t1.xyzw, s7, l(0.000000)
endif 
mov r0.xz, v2.xxzx
mov r0.y, v3.z
sample_l_indexable(texture3d)(float,float,float,float) r1.y, r0.xyzx, t3.yxzw, s7, l(0.000000)
lt r1.y, l(0.900000), r1.y
if_nz r1.y
  sample_l_indexable(texture3d)(float,float,float,float) r1.y, r0.xyzx, t4.xyzw, s7, l(0.000000)
else 
  sample_l_indexable(texture3d)(float,float,float,float) r1.y, r0.xyzx, t1.xyzw, s7, l(0.000000)
endif 
mov r0.xz, v2.xxzx
mov r0.y, v3.w
sample_l_indexable(texture3d)(float,float,float,float) r1.z, r0.xyzx, t3.yzxw, s7, l(0.000000)
lt r1.z, l(0.900000), r1.z
if_nz r1.z
  sample_l_indexable(texture3d)(float,float,float,float) r1.z, r0.xyzx, t4.xzyw, s7, l(0.000000)
else 
  sample_l_indexable(texture3d)(float,float,float,float) r1.z, r0.xyzx, t1.xzyw, s7, l(0.000000)
endif 
mov r0.xy, v2.xyxx
mov r0.z, v4.x
sample_l_indexable(texture3d)(float,float,float,float) r1.w, r0.xyzx, t3.yzwx, s7, l(0.000000)
lt r1.w, l(0.900000), r1.w
if_nz r1.w
  sample_l_indexable(texture3d)(float,float,float,float) r1.w, r0.xyzx, t4.xywz, s7, l(0.000000)
else 
  sample_l_indexable(texture3d)(float,float,float,float) r1.w, r0.xyzx, t1.xywz, s7, l(0.000000)
endif 
mov r0.xy, v2.xyxx
mov r0.z, v4.y
sample_l_indexable(texture3d)(float,float,float,float) r2.x, r0.xyzx, t3.xyzw, s7, l(0.000000)
lt r2.x, l(0.900000), r2.x
if_nz r2.x
  sample_l_indexable(texture3d)(float,float,float,float) r2.x, r0.xyzx, t4.zxyw, s7, l(0.000000)
else 
  sample_l_indexable(texture3d)(float,float,float,float) r2.x, r0.xyzx, t1.zxyw, s7, l(0.000000)
endif 
add r0.x, -r0.w, r1.x
add r0.y, -r1.y, r1.z
add r0.x, r0.y, r0.x
add r0.y, -r1.w, r2.x
add r0.x, r0.y, r0.x
mul o0.x, r0.x, l(0.500000)
ret 
// Approximately 61 instruction slots used

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