cbuffer cb4 : register(b4)
{
  float4 cb4[13];
}

cbuffer cb3 : register(b3)
{
  float4 cb3[19];
}

cbuffer cb2 : register(b2)
{
  float4 cb2[6];
}

cbuffer cb1 : register(b1)
{
  float4 cb1[1];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[7];
}


Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);

void main( 
  float4 v0 : POSITION0,
  float3 v1 : NORMAL0,
  float4 v2 : TEXCOORD0,
  out float4 o0 : SV_POSITION0,
  out float2 o1 : TEXCOORD1)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = cb3[16].x * v1.x;
  r0.y = cb3[17].x * v1.x;
  r0.z = cb3[18].x * v1.x;
  r1.x = cb3[16].y * v1.y;
  r1.y = cb3[17].y * v1.y;
  r1.z = cb3[18].y * v1.y;
  r0.xyz = r1.xyz + r0.xyz;
  r1.x = cb3[16].z * v1.z;
  r1.y = cb3[17].z * v1.z;
  r1.z = cb3[18].z * v1.z;
  r0.xyz = r1.xyz + r0.xyz;
  r0.w = dot(r0.xyz, r0.xyz);
  r0.w = rsqrt(r0.w);
  r0.xyz = r0.xyz * r0.www;
  r1.xyz = cb3[13].xyz * v0.yyy;
  r1.xyz = cb3[12].xyz * v0.xxx + r1.xyz;
  r1.xyz = cb3[14].xyz * v0.zzz + r1.xyz;
  r1.xyz = cb3[15].xyz + r1.xyz;
  r2.xyz = -r1.xyz * cb1[0].www + cb1[0].xyz;
  r0.w = dot(r2.xyz, r2.xyz);
  r0.w = rsqrt(r0.w);
  r2.xyz = r2.xyz * r0.www;
  r0.w = dot(r0.xyz, r2.xyz);
  r0.w = -r0.w * r0.w + 1;
  r0.w = sqrt(r0.w);
  r0.w = cb2[5].z * r0.w;
  r0.xyz = -r0.xyz * r0.www + r1.xyz;
  r1.xyzw = cb4[10].xyzw * r0.yyyy;
  r1.xyzw = cb4[9].xyzw * r0.xxxx + r1.xyzw;
  r0.xyzw = cb4[11].xyzw * r0.zzzz + r1.xyzw;
  r0.xyzw = cb4[12].xyzw + r0.xyzw;
  r1.xyzw = cb3[1].xyzw * v0.yyyy;
  r1.xyzw = cb3[0].xyzw * v0.xxxx + r1.xyzw;
  r1.xyzw = cb3[2].xyzw * v0.zzzz + r1.xyzw;
  r1.xyzw = cb3[3].xyzw + r1.xyzw;
  r2.x = cb2[5].z != 0.000000;
  r0.xyzw = r2.xxxx ? r0.xyzw : r1.xyzw;
  r1.x = saturate(cb2[5].x / r0.w);
  r0.z = r1.x + r0.z;
  o0.xyw = r0.xyw; //-------------------------
  r0.x = max(0, r0.z);
  r0.x = r0.x + -r0.z;
  o0.z = cb2[5].y * r0.x + r0.z;
  o1.xy = v2.xy * cb0[6].xy + cb0[6].zw;
  return;
}