// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:30:39 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 cbTessScene : register(b5)
{
  float4x4 g_f4x4ViewProjection : packoffset(c0);
  float4 g_f4Eye : packoffset(c4);
  float4 g_f4ViewVector : packoffset(c5);
  float4 g_f4GUIParams2 : packoffset(c6);
  float4 g_f4ViewFrustumPlanes[4] : packoffset(c7);
  float g_fGlobalTime : packoffset(c11);
}



// 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,
  float2 v3 : TEXCOORD0,
  float2 w3 : TEXCOORD2,
  float4 v4 : COLOR1,
  float3 v5 : TEXCOORD16,
  out float4 o0 : SV_Position0,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : TEXCOORD2,
  out float4 o3 : COLOR1,
  out float4 o4 : TEXCOORD6,
  out float4 o5 : TEXCOORD9,
  out float3 o6 : TEXCOORD16,
  out float o7 : SV_ClipDistance0,
  out float p7 : 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;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = vicp[1][0].xyz * vDomain.xxx;
  r0.xyz = vicp[0][0].xyz * vDomain.zzz + r0.xyz;
  r0.xyz = vicp[2][0].xyz * vDomain.yyy + r0.xyz;
  r0.w = 1;
  r1.x = dot(r0.xyzw, g_f4x4ViewProjection._m00_m10_m20_m30);
  r1.y = dot(r0.xyzw, g_f4x4ViewProjection._m01_m11_m21_m31);
  r1.z = dot(r0.xyzw, g_f4x4ViewProjection._m02_m12_m22_m32);
  r1.w = dot(r0.xyzw, g_f4x4ViewProjection._m03_m13_m23_m33);
  o0.xyzw = r1.xyzw;
  r0.xyz = vicp[1][1].xyz * vDomain.xxx;
  r0.xyz = vicp[0][1].xyz * vDomain.zzz + r0.xyz;
  r0.xyz = vicp[2][1].xyz * vDomain.yyy + r0.xyz;
  r0.w = dot(r0.xyz, r0.xyz);
  r0.w = rsqrt(r0.w);
  o1.xyz = r0.xyz * r0.www;
  o1.w = vicp[0][1].w;
  r0.xyzw = vicp[1][2].xyzw * vDomain.xxxx;
  r0.xyzw = vicp[0][2].xyzw * vDomain.zzzz + r0.xyzw;
  r0.xyzw = vicp[2][2].xyzw * vDomain.yyyy + r0.xyzw;
  r2.x = dot(r0.xyzw, r0.xyzw);
  r2.x = rsqrt(r2.x);
  o2.xyzw = r2.xxxx * 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][3].xyzw * vDomain.xxxx;
  r0.xyzw = vicp[0][3].xyzw * vDomain.zzzz + r0.xyzw;
  o4.xyzw = vicp[2][3].xyzw * vDomain.yyyy + r0.xyzw;
  o5.xyzw = r1.xyzw;
  o7.x = dot(r1.xyzw, VC_ClipPlane.xyzw);
  r0.xyz = vicp[1][5].xyz * vDomain.xxx;
  r0.xyz = vicp[0][5].xyz * vDomain.zzz + r0.xyz;
  o6.xyz = vicp[2][5].xyz * vDomain.yyy + r0.xyz;
  p7.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 cbTessScene
// {
//
//   float4x4 g_f4x4ViewProjection;     // Offset:    0 Size:    64
//   float4 g_f4Eye;                    // Offset:   64 Size:    16 [unused]
//   float4 g_f4ViewVector;             // Offset:   80 Size:    16 [unused]
//   float4 g_f4GUIParams2;             // Offset:   96 Size:    16 [unused]
//   float4 g_f4ViewFrustumPlanes[4];   // Offset:  112 Size:    64 [unused]
//   float g_fGlobalTime;               // Offset:  176 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// cbTessScene                       cbuffer      NA          NA    5        1
// cbSceneParam                      cbuffer      NA          NA    8        1
//
//
//
// Patch Constant signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TessFactor            0   x           0  TRIEDGE   float       
// SV_TessFactor            1   x           1  TRIEDGE   float       
// SV_TessFactor            2   x           2  TRIEDGE   float       
// SV_InsideTessFactor      0   x           3   TRIINT   float       
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz 
// NORMAL                   0   xyzw        1     NONE   float   xyzw
// TANGENT                  0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xy          3     NONE   float   xy  
// TEXCOORD                 2     zw        3     NONE   float     zw
// COLOR                    1   xyzw        4     NONE   float   xyzw
// TEXCOORD                16   xyz         5     NONE   float   xyz 
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 2   xyzw        2     NONE   float   xyzw
// COLOR                    1   xyzw        3     NONE   float   xyzw
// TEXCOORD                 6   xyzw        4     NONE   float   xyzw
// TEXCOORD                 9   xyzw        5     NONE   float   xyzw
// TEXCOORD                16   xyz         6     NONE   float   xyz 
// SV_ClipDistance          0   x           7  CLIPDST   float   x   
// SV_ClipDistance          1    y          7  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 cb5[4], immediateIndexed
dcl_input vDomain.xyz
dcl_input vicp[3][0].xyz
dcl_input vicp[3][1].xyzw
dcl_input vicp[3][2].xyzw
dcl_input vicp[3][3].xy
dcl_input vicp[3][3].zw
dcl_input vicp[3][4].xyzw
dcl_input vicp[3][5].xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyz
dcl_output_siv o7.x, clip_distance
dcl_output_siv o7.y, clip_distance
dcl_temps 3
mul r0.xyz, vDomain.xxxx, vicp[1][0].xyzx
mad r0.xyz, vicp[0][0].xyzx, vDomain.zzzz, r0.xyzx
mad r0.xyz, vicp[2][0].xyzx, vDomain.yyyy, r0.xyzx
mov r0.w, l(1.000000)
dp4 r1.x, r0.xyzw, cb5[0].xyzw
dp4 r1.y, r0.xyzw, cb5[1].xyzw
dp4 r1.z, r0.xyzw, cb5[2].xyzw
dp4 r1.w, r0.xyzw, cb5[3].xyzw
mov o0.xyzw, r1.xyzw
mul r0.xyz, vDomain.xxxx, vicp[1][1].xyzx
mad r0.xyz, vicp[0][1].xyzx, vDomain.zzzz, r0.xyzx
mad r0.xyz, vicp[2][1].xyzx, vDomain.yyyy, r0.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul o1.xyz, r0.wwww, r0.xyzx
mov o1.w, vicp[0][1].w
mul r0.xyzw, vDomain.xxxx, vicp[1][2].xyzw
mad r0.xyzw, vicp[0][2].xyzw, vDomain.zzzz, r0.xyzw
mad r0.xyzw, vicp[2][2].xyzw, vDomain.yyyy, r0.xyzw
dp4 r2.x, r0.xyzw, r0.xyzw
rsq r2.x, r2.x
mul o2.xyzw, r0.xyzw, r2.xxxx
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][3].xyzw
mad r0.xyzw, vicp[0][3].xyzw, vDomain.zzzz, r0.xyzw
mad o4.xyzw, vicp[2][3].xyzw, vDomain.yyyy, r0.xyzw
mov o5.xyzw, r1.xyzw
dp4 o7.x, r1.xyzw, cb8[4].xyzw
mul r0.xyz, vDomain.xxxx, vicp[1][5].xyzx
mad r0.xyz, vicp[0][5].xyzx, vDomain.zzzz, r0.xyzx
mad o6.xyz, vicp[2][5].xyzx, vDomain.yyyy, r0.xyzx
mov o7.y, l(0)
ret 
// Approximately 35 instruction slots used

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