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

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

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

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


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

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

  r0.xyzw = cb2[1].xyzw * v0.yyyy;
  r0.xyzw = cb2[0].xyzw * v0.xxxx + r0.xyzw;
  r0.xyzw = cb2[2].xyzw * v0.zzzz + r0.xyzw;
  o2.xyzw = cb2[3].xyzw * v0.wwww + r0.xyzw;
  o0.xy = v2.xy * cb0[6].xy + cb0[6].zw;
  r0.xyz = cb2[5].xyz * v0.yyy;
  r0.xyz = cb2[4].xyz * v0.xxx + r0.xyz;
  r0.xyz = cb2[6].xyz * v0.zzz + r0.xyz;
  r0.xyz = cb2[7].xyz * v0.www + r0.xyz;
  r1.xyz = cb2[9].xyz * v1.yyy;
  r1.xyz = cb2[8].xyz * v1.xxx + r1.xyz;
  r1.xyz = cb2[10].xyz * v1.zzz + r1.xyz;
  r0.w = dot(r1.xyz, r1.xyz);
  r0.w = rsqrt(r0.w);
  r1.xyz = r1.xyz * r0.www;
  r2.xyz = cb3[4].xyz + cb3[4].xyz;
  r3.xyz = r2.xyz;
  r0.w = 0;
  while (true) {
    r1.w = (int)r0.w >= 4;
    if (r1.w != 0) break;
    r4.xyz = -r0.xyz * cb1[r0.w+14].www + cb1[r0.w+14].xyz;
    r1.w = dot(r4.xyz, r4.xyz);
    r2.w = rsqrt(r1.w);
    r4.xyz = r4.xyz * r2.www;
    r1.w = r1.w * cb1[r0.w+22].z + 1;
    r1.w = 1 / r1.w;
    r2.w = dot(r4.xyz, cb1[r0.w+30].xyz);
    r2.w = max(0, r2.w);
    r2.w = -cb1[r0.w+22].x + r2.w;
    r2.w = saturate(cb1[r0.w+22].y * r2.w);
    r1.w = r2.w * r1.w;
    r2.w = dot(r1.xyz, r4.xyz);
    r2.w = max(0, r2.w);
    r1.w = r2.w * r1.w;
    r3.xyz = cb1[r0.w+6].xyz * r1.www + r3.xyz;
    r0.w = (int)r0.w + 1;
  }
  o1.xyz = cb0[7].xyz * r3.xyz;
  o1.w = cb0[8].w * cb0[7].w;
  return;
}