// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:30:47 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 cbInstanceData : register(b4)
{

  struct
  {
    float4x3 mWorld;
    float4 atlasUvScaleOffset;
    float4 userClipPlane;
    uint4 matricesData;
    uint envData;
    bool dynamicLightDisable;
    uint2 envPad;
    float4 mulCol;
    float4 aSh[3];
    float4 ShLightMask;
    float4 vDominantRotateParam;
    float4 parallaxCorrectedCubemapOrigin_envMapInterpRatio;
    float4 parallaxCorrectedCubemapAabbMin_envMapColorScale0;
    float4 parallaxCorrectedCubemapAabbMax_envMapColorScale1;
    float ditherFadeAlpha;
  } VC_InstanceData[2] : packoffset(c0);

}

cbuffer cbObjMatrix : register(b5)
{
  float4x3 VC_aObjMatrix[2] : packoffset(c0);
}

cbuffer cbTexScroll : register(b11)
{
  float4 VC_TexScroll_0 : packoffset(c0);
  float4 VC_TexScroll_1 : packoffset(c1);
  float4 VC_TexScroll_2 : packoffset(c2);
  float4 VC_TexScroll_3 : packoffset(c3);
}



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


void main( 
  float3 v0 : POSITION0,
  uint4 v1 : NORMAL0,
  uint4 v2 : TANGENT0,
  uint4 v3 : TANGENT1,
  uint4 v4 : BLENDINDICES0,
  float4 v5 : BLENDWEIGHT0,
  float4 v6 : COLOR0,
  float4 v7 : COLOR1,
  int4 v8 : TEXCOORD0,
  out float4 o0 : SV_Position0,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : TEXCOORD3,
  out float4 o3 : TEXCOORD4,
  out float4 o4 : COLOR1,
  out float4 o5 : TEXCOORD5,
  out float4 o6 : COLOR0,
  out float o7 : SV_ClipDistance0,
  out float p7 : SV_ClipDistance1)
{
  float4 r0,r1,r2,r3,r4,r5,r6;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = v0.xyz;
  r0.w = 1;
  r1.x = dot(float4(1,1,1,1), v5.xyzw);
  r1.x = max(0.00100000005, r1.x);
  r1.xyzw = v5.xyzw / r1.xxxx;
  r2.xyzw = (int4)v4.xyzw + (int4)VC_InstanceData[0].matricesData.xxxx;
  r2.xyzw = (int4)r2.xyzw * int4(3,3,3,3);
  r3.xyzw = VC_aObjMatrix[r2.y]._m00_m10_m20_m30 * r1.yyyy;
  r3.xyzw = VC_aObjMatrix[r2.x]._m00_m10_m20_m30 * r1.xxxx + r3.xyzw;
  r3.xyzw = VC_aObjMatrix[r2.z]._m00_m10_m20_m30 * r1.zzzz + r3.xyzw;
  r3.xyzw = VC_aObjMatrix[r2.w]._m00_m10_m20_m30 * r1.wwww + r3.xyzw;
  r4.x = dot(r0.xyzw, r3.xyzw);
  r5.xyzw = VC_aObjMatrix[r2.y]._m01_m11_m21_m31 * r1.yyyy;
  r5.xyzw = VC_aObjMatrix[r2.x]._m01_m11_m21_m31 * r1.xxxx + r5.xyzw;
  r5.xyzw = VC_aObjMatrix[r2.z]._m01_m11_m21_m31 * r1.zzzz + r5.xyzw;
  r5.xyzw = VC_aObjMatrix[r2.w]._m01_m11_m21_m31 * r1.wwww + r5.xyzw;
  r4.y = dot(r0.xyzw, r5.xyzw);
  r6.xyzw = VC_aObjMatrix[r2.y]._m02_m12_m22_m32 * r1.yyyy;
  r6.xyzw = VC_aObjMatrix[r2.x]._m02_m12_m22_m32 * r1.xxxx + r6.xyzw;
  r6.xyzw = VC_aObjMatrix[r2.z]._m02_m12_m22_m32 * r1.zzzz + r6.xyzw;
  r1.xyzw = VC_aObjMatrix[r2.w]._m02_m12_m22_m32 * r1.wwww + r6.xyzw;
  r4.z = dot(r0.xyzw, r1.xyzw);
  r0.xyz = -SC_CameraPos.xyz + r4.xyz;
  r0.w = 1;
  r2.x = dot(r0.xyzw, VC_MatrixViewProj._m00_m10_m20_m30);
  r2.y = dot(r0.xyzw, VC_MatrixViewProj._m01_m11_m21_m31);
  r2.z = dot(r0.xyzw, VC_MatrixViewProj._m02_m12_m22_m32);
  r2.w = dot(r0.xyzw, VC_MatrixViewProj._m03_m13_m23_m33);
  o0.xyzw = r2.xyzw;
  r0.xyz = (uint3)v1.xyz;
  r0.xyz = float3(-127,-127,-127) + r0.xyz;
  r0.xyz = float3(0.00787401572,0.00787401572,0.00787401572) * r0.xyz;
  o1.x = dot(r0.xyz, r3.xyz);
  o1.y = dot(r0.xyz, r5.xyz);
  o1.z = dot(r0.xyz, r1.xyz);
  o1.w = 0;
  r0.xyzw = (uint4)v2.xyzw;
  r0.xyzw = float4(-127,-127,-127,-127) + r0.xyzw;
  r0.xyzw = float4(0.00787401572,0.00787401572,0.00787401572,0.00787401572) * r0.xyzw;
  o2.x = dot(r0.xyz, r3.xyz);
  o2.y = dot(r0.xyz, r5.xyz);
  o2.z = dot(r0.xyz, r1.xyz);
  o2.w = r0.w;
  r0.xyzw = (uint4)v3.xyzw;
  r0.xyzw = float4(-127,-127,-127,-127) + r0.xyzw;
  r0.xyzw = float4(0.00787401572,0.00787401572,0.00787401572,0.00787401572) * r0.xyzw;
  o3.x = dot(r0.xyz, r3.xyz);
  o3.y = dot(r0.xyz, r5.xyz);
  o3.z = dot(r0.xyz, r1.xyz);
  o3.w = r0.w;
  o4.xyz = v7.xyz;
  o4.w = v6.w;
  r0.xyzw = (int4)v8.xyzw;
  r0.xy = VC_TexScroll_0.xy * r0.xy;
  r0.zw = VC_TexScroll_1.xy * r0.zw;
  o5.zw = r0.zw * float2(0.00048828125,0.00048828125) + VC_TexScroll_1.zw;
  o5.xy = r0.xy * float2(0.00048828125,0.00048828125) + VC_TexScroll_0.zw;
  o6.xyzw = v6.xyzw;
  o7.x = dot(r2.xyzw, VC_ClipPlane.xyzw);
  p7.x = dot(r2.xyzw, VC_InstanceData[0].userClipPlane.xyzw);
  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
//   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
//   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 cbInstanceData
// {
//
//   struct PerInstanceData
//   {
//       
//       float4x3 mWorld;               // Offset:    0
//       float4 atlasUvScaleOffset;     // Offset:   48
//       float4 userClipPlane;          // Offset:   64
//       uint4 matricesData;            // Offset:   80
//       uint envData;                  // Offset:   96
//       bool dynamicLightDisable;      // Offset:  100
//       uint2 envPad;                  // Offset:  104
//       float4 mulCol;                 // Offset:  112
//       float4 aSh[3];                 // Offset:  128
//       float4 ShLightMask;            // Offset:  176
//       float4 vDominantRotateParam;   // Offset:  192
//       float4 parallaxCorrectedCubemapOrigin_envMapInterpRatio;// Offset:  208
//       float4 parallaxCorrectedCubemapAabbMin_envMapColorScale0;// Offset:  224
//       float4 parallaxCorrectedCubemapAabbMax_envMapColorScale1;// Offset:  240
//       float ditherFadeAlpha;         // Offset:  256
//
//   } VC_InstanceData[2];              // Offset:    0 Size:   532
//
// }
//
// cbuffer cbObjMatrix
// {
//
//   float4x3 VC_aObjMatrix[2];         // Offset:    0 Size:    96
//
// }
//
// cbuffer cbTexScroll
// {
//
//   float4 VC_TexScroll_0;             // Offset:    0 Size:    16
//   float4 VC_TexScroll_1;             // Offset:   16 Size:    16
//   float4 VC_TexScroll_2;             // Offset:   32 Size:    16 [unused]
//   float4 VC_TexScroll_3;             // Offset:   48 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// cbInstanceData                    cbuffer      NA          NA    4        1
// cbObjMatrix                       cbuffer      NA          NA    5        1
// cbSceneParam                      cbuffer      NA          NA    8        1
// cbTexScroll                       cbuffer      NA          NA   11        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz 
// NORMAL                   0   xyzw        1     NONE    uint   xyz 
// TANGENT                  0   xyzw        2     NONE    uint   xyzw
// TANGENT                  1   xyzw        3     NONE    uint   xyzw
// BLENDINDICES             0   xyzw        4     NONE    uint   xyzw
// BLENDWEIGHT              0   xyzw        5     NONE   float   xyzw
// COLOR                    0   xyzw        6     NONE   float   xyzw
// COLOR                    1   xyzw        7     NONE   float   xyz 
// TEXCOORD                 0   xyzw        8     NONE     int   xyzw
//
//
// 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                 3   xyzw        2     NONE   float   xyzw
// TEXCOORD                 4   xyzw        3     NONE   float   xyzw
// COLOR                    1   xyzw        4     NONE   float   xyzw
// TEXCOORD                 5   xyzw        5     NONE   float   xyzw
// COLOR                    0   xyzw        6     NONE   float   xyzw
// SV_ClipDistance          0   x           7  CLIPDST   float   x   
// SV_ClipDistance          1    y          7  CLIPDST   float    y  
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb8[28], immediateIndexed
dcl_constantbuffer cb4[6], immediateIndexed
dcl_constantbuffer cb5[6], dynamicIndexed
dcl_constantbuffer cb11[2], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xyz
dcl_input v2.xyzw
dcl_input v3.xyzw
dcl_input v4.xyzw
dcl_input v5.xyzw
dcl_input v6.xyzw
dcl_input v7.xyz
dcl_input v8.xyzw
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.xyzw
dcl_output_siv o7.x, clip_distance
dcl_output_siv o7.y, clip_distance
dcl_temps 7
mov r0.xyz, v0.xyzx
mov r0.w, l(1.000000)
dp4 r1.x, l(1.000000, 1.000000, 1.000000, 1.000000), v5.xyzw
max r1.x, r1.x, l(0.001000)
div r1.xyzw, v5.xyzw, r1.xxxx
iadd r2.xyzw, v4.xyzw, cb4[5].xxxx
imul null, r2.xyzw, r2.xyzw, l(3, 3, 3, 3)
mul r3.xyzw, r1.yyyy, cb5[r2.y + 0].xyzw
mad r3.xyzw, cb5[r2.x + 0].xyzw, r1.xxxx, r3.xyzw
mad r3.xyzw, cb5[r2.z + 0].xyzw, r1.zzzz, r3.xyzw
mad r3.xyzw, cb5[r2.w + 0].xyzw, r1.wwww, r3.xyzw
dp4 r4.x, r0.xyzw, r3.xyzw
mul r5.xyzw, r1.yyyy, cb5[r2.y + 1].xyzw
mad r5.xyzw, cb5[r2.x + 1].xyzw, r1.xxxx, r5.xyzw
mad r5.xyzw, cb5[r2.z + 1].xyzw, r1.zzzz, r5.xyzw
mad r5.xyzw, cb5[r2.w + 1].xyzw, r1.wwww, r5.xyzw
dp4 r4.y, r0.xyzw, r5.xyzw
mul r6.xyzw, r1.yyyy, cb5[r2.y + 2].xyzw
mad r6.xyzw, cb5[r2.x + 2].xyzw, r1.xxxx, r6.xyzw
mad r6.xyzw, cb5[r2.z + 2].xyzw, r1.zzzz, r6.xyzw
mad r1.xyzw, cb5[r2.w + 2].xyzw, r1.wwww, r6.xyzw
dp4 r4.z, r0.xyzw, r1.xyzw
add r0.xyz, r4.xyzx, -cb8[3].xyzx
mov r0.w, l(1.000000)
dp4 r2.x, r0.xyzw, cb8[24].xyzw
dp4 r2.y, r0.xyzw, cb8[25].xyzw
dp4 r2.z, r0.xyzw, cb8[26].xyzw
dp4 r2.w, r0.xyzw, cb8[27].xyzw
mov o0.xyzw, r2.xyzw
utof r0.xyz, v1.xyzx
add r0.xyz, r0.xyzx, l(-127.000000, -127.000000, -127.000000, 0.000000)
mul r0.xyz, r0.xyzx, l(0.007874, 0.007874, 0.007874, 0.000000)
dp3 o1.x, r0.xyzx, r3.xyzx
dp3 o1.y, r0.xyzx, r5.xyzx
dp3 o1.z, r0.xyzx, r1.xyzx
mov o1.w, l(0)
utof r0.xyzw, v2.xyzw
add r0.xyzw, r0.xyzw, l(-127.000000, -127.000000, -127.000000, -127.000000)
mul r0.xyzw, r0.xyzw, l(0.007874, 0.007874, 0.007874, 0.007874)
dp3 o2.x, r0.xyzx, r3.xyzx
dp3 o2.y, r0.xyzx, r5.xyzx
dp3 o2.z, r0.xyzx, r1.xyzx
mov o2.w, r0.w
utof r0.xyzw, v3.xyzw
add r0.xyzw, r0.xyzw, l(-127.000000, -127.000000, -127.000000, -127.000000)
mul r0.xyzw, r0.xyzw, l(0.007874, 0.007874, 0.007874, 0.007874)
dp3 o3.x, r0.xyzx, r3.xyzx
dp3 o3.y, r0.xyzx, r5.xyzx
dp3 o3.z, r0.xyzx, r1.xyzx
mov o3.w, r0.w
mov o4.xyz, v7.xyzx
mov o4.w, v6.w
itof r0.xyzw, v8.xyzw
mul r0.xy, r0.xyxx, cb11[0].xyxx
mul r0.zw, r0.zzzw, cb11[1].xxxy
mad o5.zw, r0.zzzw, l(0.000000, 0.000000, 0.000488, 0.000488), cb11[1].zzzw
mad o5.xy, r0.xyxx, l(0.000488, 0.000488, 0.000000, 0.000000), cb11[0].zwzz
mov o6.xyzw, v6.xyzw
dp4 o7.x, r2.xyzw, cb8[4].xyzw
dp4 o7.y, r2.xyzw, cb4[4].xyzw
ret 
// Approximately 61 instruction slots used

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