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

cbuffer cbSceneParam : register(b8)
{
  float4 FC_FarClipInfo : packoffset(c0);
  float4 FC_ScreenSize : packoffset(c1);
  float4 FC_DepthComputeParam : packoffset(c2);
  float4 SC_CameraPos : packoffset(c3);
  float4 VC_ClipPlane : packoffset(c4);
  float4x3 FC_MatrixView : packoffset(c5);
  float4x4 FC_MatrixInvViewProj : packoffset(c8);
  float4x4 FC_MatrixInvProj : packoffset(c12);
  float4x4 FC_MatrixProj : packoffset(c16);
  float4x4 FC_MatrixInvView : packoffset(c20);
  float4x4 VC_MatrixViewProj : packoffset(c24);
  float4 FC_ShadowMapParam : packoffset(c28);
  float4 FC_ShadowColor : packoffset(c29);
  float4 FC_ShadowDir : packoffset(c30);
  float4x4 VC_ShadowMapMatrix : packoffset(c31);
  float FC_ShadowDepthRate : packoffset(c35);
  float FC_ShadowDepthScale : packoffset(c35.y);
  float FC_ShadowKernelScale : packoffset(c35.z);
  float FC_ShadowRandTexInvScale : packoffset(c35.w);
  float FC_ShadowTexInvScaleX : packoffset(c36);
  float FC_ShadowTexInvScaleY : packoffset(c36.y);
  float FC_ShadowDepthOffsetScale : packoffset(c36.z);
  float4 FC_ShadowViewKernelScale : packoffset(c37);
  float4x4 FC_ProjSpaceToShadowMatrix[4] : packoffset(c38);
  float4 FC_CascadeSelectDist : packoffset(c54);
  float FC_FrustumNear : packoffset(c55);
  float FC_FrustumSliceScale : packoffset(c55.y);
  float FC_FrustumSliceBias : packoffset(c55.z);
  uint FC_LightTile_Width : packoffset(c56);
  uint FC_LightTile_NumCellX : packoffset(c56.y);
  float4 FC_CloudShadowParam0 : packoffset(c57);
  float4 FC_CloudShadowParam1 : packoffset(c58);
  float FC_ShadowScale0 : packoffset(c59);
  float FC_ShadowScale1 : packoffset(c59.y);
}

cbuffer cbMatrixWVP : register(b0)
{
  row_major float4x4 VC_View_MatrixCamera : packoffset(c0);
  float4x4 VC_View_MatrixViewProj : packoffset(c4);
  float4 VC_ViewFrustumPlanes[4] : packoffset(c8);
}



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


void main( 
  float3 v0 : POSITION0,
  float4 v1 : NORMAL0,
  float4 v2 : TANGENT0,
  float4 v3 : TANGENT1,
  float2 v4 : TEXCOORD0,
  float2 w4 : TEXCOORD1,
  float2 v5 : TEXCOORD2,
  float2 w5 : TEXCOORD3,
  float4 v6 : TEXCOORD4,
  float4 v7 : TEXCOORD5,
  out float4 o0 : SV_Position0,
  out float2 o1 : TEXCOORD9,
  out float p1 : TEXCOORD12,
  out float4 o2 : COLOR1,
  out float4 o3 : TEXCOORD6,
  out float4 o4 : TEXCOORD7,
  out float o5 : SV_ClipDistance0,
  out float p5 : SV_ClipDistance1)
{
// Needs manual fix for instruction: 
// unknown dcl_: dcl_input_control_point_count 3
// Needs manual fix for instruction: 
// unknown dcl_: dcl_tessellator_domain domain_tri
  float4 r0,r1,r2,r3;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = vDomain.zzz * vpc1.yzw;
  r1.xyz = vDomain.xyz * vDomain.xyz;
  r2.xyz = vicp[1][0].xyz * r1.xxx;
  r2.xyz = vDomain.xxx * r2.xyz;
  r3.xyz = vicp[0][0].xyz * r1.zzz;
  r2.xyz = r3.xyz * vDomain.zzz + r2.xyz;
  r3.xyz = vicp[2][0].xyz * r1.yyy;
  r1.xyz = float3(3,3,3) * r1.xyz;
  r2.xyz = r3.xyz * vDomain.yyy + r2.xyz;
  r3.xyz = vpc0.yzw * r1.zzz;
  r2.xyz = r3.xyz * vDomain.xxx + r2.xyz;
  r0.xyz = r0.xyz * r1.xxx + r2.xyz;
  r2.xyz = vpc5.xyz * r1.zzz;
  r0.xyz = r2.xyz * vDomain.yyy + r0.xyz;
  r1.xzw = vpc2.yzw * r1.xxx;
  r0.xyz = r1.xzw * vDomain.yyy + r0.xyz;
  r1.xzw = vDomain.zzz * vpc4.xyz;
  r0.xyz = r1.xzw * r1.yyy + r0.xyz;
  r1.xzw = vDomain.xxx * vpc3.yzw;
  r0.xyz = r1.xzw * r1.yyy + r0.xyz;
  r1.xyz = vDomain.zzz * vpc6.xyz;
  r1.xyz = vDomain.xxx * r1.xyz;
  r1.xyz = vDomain.yyy * r1.xyz;
  r0.xyz = r1.xyz * float3(6,6,6) + r0.xyz;
  r0.xyz = -VC_View_MatrixCamera._m30_m31_m32 + r0.xyz;
  r0.w = 1;
  r1.x = dot(r0.xyzw, VC_View_MatrixViewProj._m00_m10_m20_m30);
  r1.y = dot(r0.xyzw, VC_View_MatrixViewProj._m01_m11_m21_m31);
  r1.z = dot(r0.xyzw, VC_View_MatrixViewProj._m02_m12_m22_m32);
  r1.w = dot(r0.xyzw, VC_View_MatrixViewProj._m03_m13_m23_m33);
  o0.xyzw = r1.xyzw;
  o5.x = dot(r1.xyzw, VC_ClipPlane.xyzw);
  o1.xy = r1.zw;
  p1.x = vicp[0][1].w;
  r0.xyzw = vicp[1][7].xyzw * vDomain.xxxx;
  r0.xyzw = vicp[0][7].xyzw * vDomain.zzzz + r0.xyzw;
  o2.xyzw = vicp[2][7].xyzw * vDomain.yyyy + r0.xyzw;
  r0.xyzw = vicp[1][4].xyzw * vDomain.xxxx;
  r0.xyzw = vicp[0][4].xyzw * vDomain.zzzz + r0.xyzw;
  o3.xyzw = vicp[2][4].xyzw * vDomain.yyyy + r0.xyzw;
  r0.xyzw = vicp[1][5].xyzw * vDomain.xxxx;
  r0.xyzw = vicp[0][5].xyzw * vDomain.zzzz + r0.xyzw;
  o4.xyzw = vicp[2][5].xyzw * vDomain.yyyy + r0.xyzw;
  p5.x = 0;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer cbSceneParam
// {
//
//   float4 FC_FarClipInfo;             // Offset:    0 Size:    16 [unused]
//   float4 FC_ScreenSize;              // Offset:   16 Size:    16 [unused]
//   float4 FC_DepthComputeParam;       // Offset:   32 Size:    16 [unused]
//   float4 SC_CameraPos;               // Offset:   48 Size:    16 [unused]
//   float4 VC_ClipPlane;               // Offset:   64 Size:    16
//   float4x3 FC_MatrixView;            // Offset:   80 Size:    48 [unused]
//   float4x4 FC_MatrixInvViewProj;     // Offset:  128 Size:    64 [unused]
//   float4x4 FC_MatrixInvProj;         // Offset:  192 Size:    64 [unused]
//   float4x4 FC_MatrixProj;            // Offset:  256 Size:    64 [unused]
//   float4x4 FC_MatrixInvView;         // Offset:  320 Size:    64 [unused]
//   float4x4 VC_MatrixViewProj;        // Offset:  384 Size:    64 [unused]
//   float4 FC_ShadowMapParam;          // Offset:  448 Size:    16 [unused]
//   float4 FC_ShadowColor;             // Offset:  464 Size:    16 [unused]
//   float4 FC_ShadowDir;               // Offset:  480 Size:    16 [unused]
//   float4x4 VC_ShadowMapMatrix;       // Offset:  496 Size:    64 [unused]
//   float FC_ShadowDepthRate;          // Offset:  560 Size:     4 [unused]
//   float FC_ShadowDepthScale;         // Offset:  564 Size:     4 [unused]
//   float FC_ShadowKernelScale;        // Offset:  568 Size:     4 [unused]
//   float FC_ShadowRandTexInvScale;    // Offset:  572 Size:     4 [unused]
//   float FC_ShadowTexInvScaleX;       // Offset:  576 Size:     4 [unused]
//   float FC_ShadowTexInvScaleY;       // Offset:  580 Size:     4 [unused]
//   float FC_ShadowDepthOffsetScale;   // Offset:  584 Size:     4 [unused]
//   float4 FC_ShadowViewKernelScale;   // Offset:  592 Size:    16 [unused]
//   float4x4 FC_ProjSpaceToShadowMatrix[4];// Offset:  608 Size:   256 [unused]
//   float4 FC_CascadeSelectDist;       // Offset:  864 Size:    16 [unused]
//   float FC_FrustumNear;              // Offset:  880 Size:     4 [unused]
//   float FC_FrustumSliceScale;        // Offset:  884 Size:     4 [unused]
//   float FC_FrustumSliceBias;         // Offset:  888 Size:     4 [unused]
//   uint FC_LightTile_Width;           // Offset:  896 Size:     4 [unused]
//   uint FC_LightTile_NumCellX;        // Offset:  900 Size:     4 [unused]
//   float4 FC_CloudShadowParam0;       // Offset:  912 Size:    16 [unused]
//   float4 FC_CloudShadowParam1;       // Offset:  928 Size:    16 [unused]
//   float FC_ShadowScale0;             // Offset:  944 Size:     4 [unused]
//   float FC_ShadowScale1;             // Offset:  948 Size:     4 [unused]
//
// }
//
// cbuffer cbMatrixWVP
// {
//
//   row_major float4x4 VC_View_MatrixCamera;// Offset:    0 Size:    64
//   float4x4 VC_View_MatrixViewProj;   // Offset:   64 Size:    64
//   float4 VC_ViewFrustumPlanes[4];    // Offset:  128 Size:    64 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// cbMatrixWVP                       cbuffer      NA          NA    0        1
// cbSceneParam                      cbuffer      NA          NA    8        1
//
//
//
// Patch Constant signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TessFactor            0   x           0  TRIEDGE   float       
// POSITION                 3    yzw        0     NONE   float    yzw
// SV_TessFactor            1   x           1  TRIEDGE   float       
// POSITION                 4    yzw        1     NONE   float    yzw
// SV_TessFactor            2   x           2  TRIEDGE   float       
// POSITION                 5    yzw        2     NONE   float    yzw
// SV_InsideTessFactor      0   x           3   TRIINT   float       
// POSITION                 6    yzw        3     NONE   float    yzw
// POSITION                 7   xyz         4     NONE   float   xyz 
// POSITION                 8   xyz         5     NONE   float   xyz 
// CENTER                   0   xyz         6     NONE   float   xyz 
// NORMAL                   3   xyz         7     NONE   float       
// NORMAL                   4   xyz         8     NONE   float       
// NORMAL                   5   xyz         9     NONE   float       
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz 
// NORMAL                   0   xyzw        1     NONE   float      w
// TANGENT                  0   xyzw        2     NONE   float       
// TANGENT                  1   xyzw        3     NONE   float       
// TEXCOORD                 0   xy          4     NONE   float   xy  
// TEXCOORD                 1     zw        4     NONE   float     zw
// TEXCOORD                 2   xy          5     NONE   float   xy  
// TEXCOORD                 3     zw        5     NONE   float     zw
// TEXCOORD                 4   xyz         6     NONE   float       
// TEXCOORD                 5   xyzw        7     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 9   xy          1     NONE   float   xy  
// TEXCOORD                12     z         1     NONE   float     z 
// COLOR                    1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 6   xyzw        3     NONE   float   xyzw
// TEXCOORD                 7   xyzw        4     NONE   float   xyzw
// SV_ClipDistance          0   x           5  CLIPDST   float   x   
// SV_ClipDistance          1    y          5  CLIPDST   float    y  
//
// Tessellation Domain   # of control points
// -------------------- --------------------
// Triangle                                3
//
ds_5_0
dcl_input_control_point_count 3
dcl_tessellator_domain domain_tri
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb8[5], immediateIndexed
dcl_constantbuffer cb0[8], immediateIndexed
dcl_input vpc0.yzw
dcl_input vpc1.yzw
dcl_input vpc2.yzw
dcl_input vpc3.yzw
dcl_input vpc4.xyz
dcl_input vpc5.xyz
dcl_input vpc6.xyz
dcl_input vDomain.xyz
dcl_input vicp[3][0].xyz
dcl_input vicp[3][1].w
dcl_input vicp[3][4].xy
dcl_input vicp[3][4].zw
dcl_input vicp[3][5].xy
dcl_input vicp[3][5].zw
dcl_input vicp[3][7].xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o1.z
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output_siv o5.x, clip_distance
dcl_output_siv o5.y, clip_distance
dcl_temps 4
mul r0.xyz, vpc1.yzwy, vDomain.zzzz
mul r1.xyz, vDomain.xyzx, vDomain.xyzx
mul r2.xyz, r1.xxxx, vicp[1][0].xyzx
mul r2.xyz, r2.xyzx, vDomain.xxxx
mul r3.xyz, r1.zzzz, vicp[0][0].xyzx
mad r2.xyz, r3.xyzx, vDomain.zzzz, r2.xyzx
mul r3.xyz, r1.yyyy, vicp[2][0].xyzx
mul r1.xyz, r1.xyzx, l(3.000000, 3.000000, 3.000000, 0.000000)
mad r2.xyz, r3.xyzx, vDomain.yyyy, r2.xyzx
mul r3.xyz, r1.zzzz, vpc0.yzwy
mad r2.xyz, r3.xyzx, vDomain.xxxx, r2.xyzx
mad r0.xyz, r0.xyzx, r1.xxxx, r2.xyzx
mul r2.xyz, r1.zzzz, vpc5.xyzx
mad r0.xyz, r2.xyzx, vDomain.yyyy, r0.xyzx
mul r1.xzw, r1.xxxx, vpc2.yyzw
mad r0.xyz, r1.xzwx, vDomain.yyyy, r0.xyzx
mul r1.xzw, vpc4.xxyz, vDomain.zzzz
mad r0.xyz, r1.xzwx, r1.yyyy, r0.xyzx
mul r1.xzw, vpc3.yyzw, vDomain.xxxx
mad r0.xyz, r1.xzwx, r1.yyyy, r0.xyzx
mul r1.xyz, vpc6.xyzx, vDomain.zzzz
mul r1.xyz, r1.xyzx, vDomain.xxxx
mul r1.xyz, r1.xyzx, vDomain.yyyy
mad r0.xyz, r1.xyzx, l(6.000000, 6.000000, 6.000000, 0.000000), r0.xyzx
add r0.xyz, r0.xyzx, -cb0[3].xyzx
mov r0.w, l(1.000000)
dp4 r1.x, r0.xyzw, cb0[4].xyzw
dp4 r1.y, r0.xyzw, cb0[5].xyzw
dp4 r1.z, r0.xyzw, cb0[6].xyzw
dp4 r1.w, r0.xyzw, cb0[7].xyzw
mov o0.xyzw, r1.xyzw
dp4 o5.x, r1.xyzw, cb8[4].xyzw
mov o1.xy, r1.zwzz
mov o1.z, vicp[0][1].w
mul r0.xyzw, vDomain.xxxx, vicp[1][7].xyzw
mad r0.xyzw, vicp[0][7].xyzw, vDomain.zzzz, r0.xyzw
mad o2.xyzw, vicp[2][7].xyzw, vDomain.yyyy, r0.xyzw
mul r0.xyzw, vDomain.xxxx, vicp[1][4].xyzw
mad r0.xyzw, vicp[0][4].xyzw, vDomain.zzzz, r0.xyzw
mad o3.xyzw, vicp[2][4].xyzw, vDomain.yyyy, r0.xyzw
mul r0.xyzw, vDomain.xxxx, vicp[1][5].xyzw
mad r0.xyzw, vicp[0][5].xyzw, vDomain.zzzz, r0.xyzw
mad o4.xyzw, vicp[2][5].xyzw, vDomain.yyyy, r0.xyzw
mov o5.y, l(0)
ret 
// Approximately 45 instruction slots used

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