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

cbuffer DSCommonBuffer : register(b0)
{
  float4x4 g_ds_viewProjectionMatrix : packoffset(c0);
  float4x4 g_ds_viewMatrix : packoffset(c4);
  float4x4 g_ds_projectionMatrix : packoffset(c8);
  float4x4 g_ds_worldViewProjectionMatrix : packoffset(c12);
  float g_ds_fogStartZ : packoffset(c16);
  float g_ds_recFogEndZ : packoffset(c16.y);
  float g_ds_fogStartY : packoffset(c16.z);
  float g_ds_recFogEndY : packoffset(c16.w);
  float3 g_ds_lightDir : packoffset(c17);
  float4 g_ds_directionalLightColor : packoffset(c18);
  float4 g_ds_hemiLightColor0 : packoffset(c19);
  float4 g_ds_hemiLightColor1 : packoffset(c20);
  float g_ds_nearFar : packoffset(c21);
  float g_ds_nearFarDistance : packoffset(c21.y);
  float g_ds_far : packoffset(c21.z);
  float g_ds_near : packoffset(c21.w);
  float3 g_ds_eye : packoffset(c22);
  float g_ds_fadeNearStart : packoffset(c23);
  float g_ds_fadeNearDist : packoffset(c23.y);
  float g_ds_fadeFarStart : packoffset(c23.z);
  float g_ds_fadeFarDist : packoffset(c23.w);
  float3 g_ds_cameraPos : packoffset(c24);
  float3 g_ds_cameraUp : packoffset(c25);
  float4 g_ds_softSpriteParam : packoffset(c26);
  float2 g_ds_softSpriteScaleOffset : packoffset(c27);
  float2 g_ds_softSpriteScaleOffsetDummy : packoffset(c27.z);
}



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


void main( 
  float4 v0 : POSITION0,
  float4 v1 : COLOR0,
  float4 v2 : COLOR1,
  float4 v3 : TEXCOORD0,
  float3 v4 : TEXCOORD1,
  float w4 : TEXCOORD3,
  float4 v5 : TEXCOORD2,
  float4 v6 : TEXCOORD4,
  out float4 o0 : COLOR0,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : TEXCOORD1,
  out float4 o3 : TEXCOORD2,
  out float2 o4 : TEXCOORD3,
  out float p4 : TEXCOORD7,
  out float4 o5 : TEXCOORD4,
  out float3 o6 : TEXCOORD5,
  out float4 o7 : SV_POSITION0)
{
// Needs manual fix for instruction: 
// unknown dcl_: dcl_input_control_point_count 2
// Needs manual fix for instruction: 
// unknown dcl_: dcl_tessellator_domain domain_quad
  float4 r0,r1,r2,r3,r4;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = vicp[1][1].xyzw * vDomain.xxxx;
  r1.xy = float2(1,1) + -vDomain.xy;
  r0.xyzw = vicp[0][1].xyzw * r1.xxxx + r0.xyzw;
  r2.xyzw = vicp[1][2].xyzw * vDomain.xxxx;
  r2.xyzw = vicp[0][2].xyzw * r1.xxxx + r2.xyzw;
  r0.xyzw = r2.xyzw * r0.xyzw;
  o0.w = saturate(r0.w);
  o0.xyz = r0.xyz;
  r0.xyzw = vicp[1][3].xyzw * vDomain.xxxx;
  r0.xyzw = vicp[0][3].xyzw * r1.xxxx + r0.xyzw;
  r0.y = vDomain.y * r0.y;
  o1.y = r0.z * r1.y + r0.y;
  r0.y = -0.5 + vDomain.y;
  r0.y = dot(r0.yy, r0.ww);
  o1.x = r0.x;
  r0.xzw = vicp[1][0].xyz * vDomain.xxx;
  r0.xzw = vicp[0][0].xyz * r1.xxx + r0.xzw;
  r2.xyzw = vicp[1][6].xyzw * vDomain.xxxx;
  r2.xyzw = vicp[0][6].xyzw * r1.xxxx + r2.xyzw;
  r3.xyz = r2.xyz * r0.yyy + r0.xzw;
  r3.w = 1;
  r4.x = dot(r3.xyzw, g_ds_viewMatrix._m00_m10_m20_m30);
  r4.y = dot(r3.xyzw, g_ds_viewMatrix._m01_m11_m21_m31);
  r4.z = dot(r3.xyzw, g_ds_viewMatrix._m02_m12_m22_m32);
  r4.w = dot(r3.xyzw, g_ds_viewMatrix._m03_m13_m23_m33);
  r0.y = dot(r4.xyzw, g_ds_projectionMatrix._m03_m13_m23_m33);
  r1.y = -g_ds_fogStartZ + r0.y;
  o7.w = r0.y;
  o1.z = saturate(g_ds_recFogEndZ * r1.y);
  r1.yzw = vicp[1][5].xyz * vDomain.xxx;
  r1.yzw = vicp[0][5].xyz * r1.xxx + r1.yzw;
  r1.yzw = r1.yzw * float3(2,2,2) + float3(-1,-1,-1);
  o2.x = dot(r1.yzw, g_ds_lightDir.xyz);
  o3.x = r1.z;
  r1.yzw = vicp[1][4].xyz * vDomain.xxx;
  r1.xyz = vicp[0][4].xyz * r1.xxx + r1.yzw;
  r1.xyz = r1.xyz * float3(2,2,2) + float3(-1,-1,-1);
  o2.z = dot(r1.xyz, g_ds_lightDir.xyz);
  o3.z = r1.y;
  o2.y = dot(r2.xyz, g_ds_lightDir.xyz);
  o3.y = r2.y;
  o4.xy = r2.ww * float2(1,-1) + float2(0,1);
  p4.x = vicp[0][4].w;
  o5.xyz = g_ds_eye.xyz + -r0.xzw;
  o6.xyz = r0.xzw;
  o5.w = 0;
  o7.x = dot(r4.xyzw, g_ds_projectionMatrix._m00_m10_m20_m30);
  o7.y = dot(r4.xyzw, g_ds_projectionMatrix._m01_m11_m21_m31);
  o7.z = dot(r4.xyzw, g_ds_projectionMatrix._m02_m12_m22_m32);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer DSCommonBuffer
// {
//
//   float4x4 g_ds_viewProjectionMatrix;// Offset:    0 Size:    64 [unused]
//   float4x4 g_ds_viewMatrix;          // Offset:   64 Size:    64
//   float4x4 g_ds_projectionMatrix;    // Offset:  128 Size:    64
//   float4x4 g_ds_worldViewProjectionMatrix;// Offset:  192 Size:    64 [unused]
//   float g_ds_fogStartZ;              // Offset:  256 Size:     4
//   float g_ds_recFogEndZ;             // Offset:  260 Size:     4
//   float g_ds_fogStartY;              // Offset:  264 Size:     4 [unused]
//   float g_ds_recFogEndY;             // Offset:  268 Size:     4 [unused]
//   float3 g_ds_lightDir;              // Offset:  272 Size:    12
//   float4 g_ds_directionalLightColor; // Offset:  288 Size:    16 [unused]
//   float4 g_ds_hemiLightColor0;       // Offset:  304 Size:    16 [unused]
//   float4 g_ds_hemiLightColor1;       // Offset:  320 Size:    16 [unused]
//   float g_ds_nearFar;                // Offset:  336 Size:     4 [unused]
//   float g_ds_nearFarDistance;        // Offset:  340 Size:     4 [unused]
//   float g_ds_far;                    // Offset:  344 Size:     4 [unused]
//   float g_ds_near;                   // Offset:  348 Size:     4 [unused]
//   float3 g_ds_eye;                   // Offset:  352 Size:    12
//   float g_ds_fadeNearStart;          // Offset:  368 Size:     4 [unused]
//   float g_ds_fadeNearDist;           // Offset:  372 Size:     4 [unused]
//   float g_ds_fadeFarStart;           // Offset:  376 Size:     4 [unused]
//   float g_ds_fadeFarDist;            // Offset:  380 Size:     4 [unused]
//   float3 g_ds_cameraPos;             // Offset:  384 Size:    12 [unused]
//   float3 g_ds_cameraUp;              // Offset:  400 Size:    12 [unused]
//   float4 g_ds_softSpriteParam;       // Offset:  416 Size:    16 [unused]
//   float2 g_ds_softSpriteScaleOffset; // Offset:  432 Size:     8 [unused]
//   float2 g_ds_softSpriteScaleOffsetDummy;// Offset:  440 Size:     8 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// DSCommonBuffer                    cbuffer      NA          NA    0        1
//
//
//
// Patch Constant signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TESSFACTOR            0   x           0 QUADEDGE   float       
// SV_TESSFACTOR            1   x           1 QUADEDGE   float       
// SV_TESSFACTOR            2   x           2 QUADEDGE   float       
// SV_TESSFACTOR            3   x           3 QUADEDGE   float       
// SV_INSIDETESSFACTOR      0   x           4  QUADINT   float       
// SV_INSIDETESSFACTOR      1   x           5  QUADINT   float       
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyz 
// COLOR                    0   xyzw        1     NONE   float   xyzw
// COLOR                    1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xyzw        3     NONE   float   xyzw
// TEXCOORD                 1   xyz         4     NONE   float   xyz 
// TEXCOORD                 3      w        4     NONE   float      w
// TEXCOORD                 2   xyz         5     NONE   float   xyz 
// TEXCOORD                 4   xyzw        6     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR                    0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xyz         1     NONE   float   xyz 
// TEXCOORD                 1   xyz         2     NONE   float   xyz 
// TEXCOORD                 2   xyz         3     NONE   float   xyz 
// TEXCOORD                 3   xy          4     NONE   float   xy  
// TEXCOORD                 7     z         4     NONE   float     z 
// TEXCOORD                 4   xyzw        5     NONE   float   xyzw
// TEXCOORD                 5   xyz         6     NONE   float   xyz 
// SV_POSITION              0   xyzw        7      POS   float   xyzw
//
// Tessellation Domain   # of control points
// -------------------- --------------------
// Quadrilateral                           2
//
ds_5_0
dcl_input_control_point_count 2
dcl_tessellator_domain domain_quad
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[23], immediateIndexed
dcl_input vDomain.xy
dcl_input vicp[2][0].xyz
dcl_input vicp[2][1].xyzw
dcl_input vicp[2][2].xyzw
dcl_input vicp[2][3].xyzw
dcl_input vicp[2][4].xyz
dcl_input vicp[2][4].w
dcl_input vicp[2][5].xyz
dcl_input vicp[2][6].xyzw
dcl_output o0.xyzw
dcl_output o1.xyz
dcl_output o2.xyz
dcl_output o3.xyz
dcl_output o4.xy
dcl_output o4.z
dcl_output o5.xyzw
dcl_output o6.xyz
dcl_output_siv o7.xyzw, position
dcl_temps 5
mul r0.xyzw, vDomain.xxxx, vicp[1][1].xyzw
add r1.xy, -vDomain.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mad r0.xyzw, vicp[0][1].xyzw, r1.xxxx, r0.xyzw
mul r2.xyzw, vDomain.xxxx, vicp[1][2].xyzw
mad r2.xyzw, vicp[0][2].xyzw, r1.xxxx, r2.xyzw
mul r0.xyzw, r0.xyzw, r2.xyzw
mov_sat o0.w, r0.w
mov o0.xyz, r0.xyzx
mul r0.xyzw, vDomain.xxxx, vicp[1][3].xyzw
mad r0.xyzw, vicp[0][3].xyzw, r1.xxxx, r0.xyzw
mul r0.y, r0.y, vDomain.y
mad o1.y, r0.z, r1.y, r0.y
add r0.y, vDomain.y, l(-0.500000)
dp2 r0.y, r0.yyyy, r0.wwww
mov o1.x, r0.x
mul r0.xzw, vDomain.xxxx, vicp[1][0].xxyz
mad r0.xzw, vicp[0][0].xxyz, r1.xxxx, r0.xxzw
mul r2.xyzw, vDomain.xxxx, vicp[1][6].xyzw
mad r2.xyzw, vicp[0][6].xyzw, r1.xxxx, r2.xyzw
mad r3.xyz, r2.xyzx, r0.yyyy, r0.xzwx
mov r3.w, l(1.000000)
dp4 r4.x, r3.xyzw, cb0[4].xyzw
dp4 r4.y, r3.xyzw, cb0[5].xyzw
dp4 r4.z, r3.xyzw, cb0[6].xyzw
dp4 r4.w, r3.xyzw, cb0[7].xyzw
dp4 r0.y, r4.xyzw, cb0[11].xyzw
add r1.y, r0.y, -cb0[16].x
mov o7.w, r0.y
mul_sat o1.z, r1.y, cb0[16].y
mul r1.yzw, vDomain.xxxx, vicp[1][5].xxyz
mad r1.yzw, vicp[0][5].xxyz, r1.xxxx, r1.yyzw
mad r1.yzw, r1.yyzw, l(0.000000, 2.000000, 2.000000, 2.000000), l(0.000000, -1.000000, -1.000000, -1.000000)
dp3 o2.x, r1.yzwy, cb0[17].xyzx
mov o3.x, r1.z
mul r1.yzw, vDomain.xxxx, vicp[1][4].xxyz
mad r1.xyz, vicp[0][4].xyzx, r1.xxxx, r1.yzwy
mad r1.xyz, r1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 o2.z, r1.xyzx, cb0[17].xyzx
mov o3.z, r1.y
dp3 o2.y, r2.xyzx, cb0[17].xyzx
mov o3.y, r2.y
mad o4.xy, r2.wwww, l(1.000000, -1.000000, 0.000000, 0.000000), l(0.000000, 1.000000, 0.000000, 0.000000)
mov o4.z, vicp[0][4].w
add o5.xyz, -r0.xzwx, cb0[22].xyzx
mov o6.xyz, r0.xzwx
mov o5.w, l(0)
dp4 o7.x, r4.xyzw, cb0[8].xyzw
dp4 o7.y, r4.xyzw, cb0[9].xyzw
dp4 o7.z, r4.xyzw, cb0[10].xyzw
ret 
// Approximately 50 instruction slots used

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