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

cbuffer cbMatDynParam : register(b2)
{
  bool FC_isDitherAlpha : packoffset(c0);
  float FC_TranslucencyScale : packoffset(c1);
  float4 FC_EmissiveColor : packoffset(c2);
  float4 FC_BlendMaskParam : packoffset(c3);
  float FC_PomHeightScale : packoffset(c4);
  float FC_PomHeightBias : packoffset(c4.y);
  float FC_PomMinSamples : packoffset(c4.z);
  float FC_PomMaxSamples : packoffset(c4.w);
  float FC_PomShadowSoftening : packoffset(c5);
  bool FC_bPomDisplayShadows : packoffset(c5.y);
  float4 FC_ParallaxParam : packoffset(c6);
  float FC_Pom2HeightScale : packoffset(c7);
  float FC_Pom2HeightBias : packoffset(c7.y);
  float FC_Pom2MinSamples : packoffset(c7.z);
  float FC_Pom2MaxSamples : packoffset(c7.w);
  bool VC_isEnableCloth : packoffset(c8);
  float FC_EnvMapDolBlendRate : packoffset(c9);
  float4 FC_SnowMaskParam : packoffset(c10);
  float FC_FROZEN_THRESHOLD : packoffset(c11);
  float FC_FROZEN_POW : packoffset(c11.y);
  float FC_BlendRate : packoffset(c12);
  float4 FC_FlowMapUvTiling : packoffset(c13);
  float4 FC_FlowMapIntencity : packoffset(c14);
  float FC_SoftVolume : packoffset(c15);
  float FC_PointCloudRate : packoffset(c16);
  float4 FC_WaterNormalUvScrollSpeed : packoffset(c17);
  float4 FC_WaterDiffuseUvScrollSpeed : packoffset(c18);
  float4 FC_WaterMiddleUvScrollSpeed : packoffset(c19);
  float4 FC_WaterFogParam0 : packoffset(c20);
  float4 FC_WaterFogParam1 : packoffset(c21);
  float4 FC_WaterFresnel : packoffset(c22);
  float4 FC_WaterFadeParam : packoffset(c23);
  float4 FC_DynamicDiffuseColor : packoffset(c24);
  float FC_SSS_ID : packoffset(c25);
  float4 FC_PhantomEdgeColor : packoffset(c26);
  float4 FC_PhantomFrontColor : packoffset(c27);
  float4 FC_PhantomDiffColor : packoffset(c28);
  float4 FC_PhantomSpecColor : packoffset(c29);
  float4 FC_PhantomLightColor : packoffset(c30);
  float VC_VelocityOffset : packoffset(c31);
  float4 FC_DamagedNormalParam : packoffset(c32);
  float4 FC_DamagedNormalUvTiling : packoffset(c33);
  float4 FC_DamagedNormal2UvTiling : packoffset(c34);
  float4 FC_WetDiffuseColor : packoffset(c35);
  float4 FC_WetParam1 : packoffset(c36);
  float4 FC_WetRefrectanceColor : packoffset(c37);
  float4 FC_WetParam2 : packoffset(c38);
}

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 cbMatrixWVP : register(b0)
{
  row_major float4x4 VC_View_MatrixCamera : packoffset(c0);
  float4x4 VC_View_MatrixViewProj : packoffset(c4);
  float4 VC_ViewFrustumPlanes[4] : packoffset(c8);
}

cbuffer cbvModelParam : register(b7)
{
  float4x3 VC_World : packoffset(c0);
  float4x3 VC_PrevWorld : packoffset(c3);
  float4 VC_VtxCullingParam : packoffset(c6);
  float4 VFC_PomLightDir : packoffset(c7);

  struct
  {
    int4 WindForceLoopParam;
    float4 WindForceAndTime[4];
    float4 PointWindPositionAndTime[4];
    float4 PointWindForce[4];
    float4 WindPositionAndRange[4];
    float4 WindWaveNoiseScale[4];
    float4 WindWaveNoiseScalePoint[4];
    float4 PointWindDirAndEnable[4];
    float4 WindAttractionParam[4];
  } VC_ForceParam : packoffset(c8);

  int VC_InstanceId : packoffset(c41);
  int3 VC_InstanceIdPad : packoffset(c41.y);
  float4 unused_VC_UserClipPlane : packoffset(c42);
  float4 VC_ModelSizeParam : packoffset(c43);
  float4 VC_LTWorldPosition : packoffset(c44);
  float4 VC_RTWorldPosition : packoffset(c45);
  float4 VC_LBWorldPosition : packoffset(c46);
}

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



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


void main( 
  float3 v0 : POSITION0,
  uint4 v1 : NORMAL0,
  uint4 v2 : BLENDINDICES0,
  float4 v3 : BLENDWEIGHT0,
  int4 v4 : TEXCOORD0,
  out float4 o0 : SV_Position0)
{
  float4 r0,r1,r2,r3,r4;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = v0.xyz;
  r0.w = 1;
  r1.x = dot(float4(1,1,1,1), v3.xyzw);
  r1.x = max(0.00100000005, r1.x);
  r1.xyzw = v3.xyzw / r1.xxxx;
  r2.xyzw = (int4)v2.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;
  r3.xyzw = VC_isEnableCloth ? VC_World._m00_m10_m20_m30 : r3.xyzw;
  r3.x = dot(r0.xyzw, r3.xyzw);
  r4.xyzw = VC_aObjMatrix[r2.y]._m01_m11_m21_m31 * r1.yyyy;
  r4.xyzw = VC_aObjMatrix[r2.x]._m01_m11_m21_m31 * r1.xxxx + r4.xyzw;
  r4.xyzw = VC_aObjMatrix[r2.z]._m01_m11_m21_m31 * r1.zzzz + r4.xyzw;
  r4.xyzw = VC_aObjMatrix[r2.w]._m01_m11_m21_m31 * r1.wwww + r4.xyzw;
  r4.xyzw = VC_isEnableCloth ? VC_World._m01_m11_m21_m31 : r4.xyzw;
  r3.y = dot(r0.xyzw, r4.xyzw);
  r4.xyzw = VC_aObjMatrix[r2.y]._m02_m12_m22_m32 * r1.yyyy;
  r4.xyzw = VC_aObjMatrix[r2.x]._m02_m12_m22_m32 * r1.xxxx + r4.xyzw;
  r4.xyzw = VC_aObjMatrix[r2.z]._m02_m12_m22_m32 * r1.zzzz + r4.xyzw;
  r1.xyzw = VC_aObjMatrix[r2.w]._m02_m12_m22_m32 * r1.wwww + r4.xyzw;
  r1.xyzw = VC_isEnableCloth ? VC_World._m02_m12_m22_m32 : r1.xyzw;
  r3.z = dot(r0.xyzw, r1.xyzw);
  r0.xyz = -VC_View_MatrixCamera._m30_m31_m32 + r3.xyz;
  r0.w = 1;
  o0.x = dot(r0.xyzw, VC_View_MatrixViewProj._m00_m10_m20_m30);
  o0.y = dot(r0.xyzw, VC_View_MatrixViewProj._m01_m11_m21_m31);
  o0.z = dot(r0.xyzw, VC_View_MatrixViewProj._m02_m12_m22_m32);
  o0.w = dot(r0.xyzw, VC_View_MatrixViewProj._m03_m13_m23_m33);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer cbMatDynParam
// {
//
//   bool FC_isDitherAlpha;             // Offset:    0 Size:     4 [unused]
//   float FC_TranslucencyScale;        // Offset:   16 Size:     4 [unused]
//   float4 FC_EmissiveColor;           // Offset:   32 Size:    16 [unused]
//   float4 FC_BlendMaskParam;          // Offset:   48 Size:    16 [unused]
//   float FC_PomHeightScale;           // Offset:   64 Size:     4 [unused]
//   float FC_PomHeightBias;            // Offset:   68 Size:     4 [unused]
//   float FC_PomMinSamples;            // Offset:   72 Size:     4 [unused]
//   float FC_PomMaxSamples;            // Offset:   76 Size:     4 [unused]
//   float FC_PomShadowSoftening;       // Offset:   80 Size:     4 [unused]
//   bool FC_bPomDisplayShadows;        // Offset:   84 Size:     4 [unused]
//   float4 FC_ParallaxParam;           // Offset:   96 Size:    16 [unused]
//   float FC_Pom2HeightScale;          // Offset:  112 Size:     4 [unused]
//   float FC_Pom2HeightBias;           // Offset:  116 Size:     4 [unused]
//   float FC_Pom2MinSamples;           // Offset:  120 Size:     4 [unused]
//   float FC_Pom2MaxSamples;           // Offset:  124 Size:     4 [unused]
//   bool VC_isEnableCloth;             // Offset:  128 Size:     4
//   float FC_EnvMapDolBlendRate;       // Offset:  144 Size:     4 [unused]
//   float4 FC_SnowMaskParam;           // Offset:  160 Size:    16 [unused]
//   float FC_FROZEN_THRESHOLD;         // Offset:  176 Size:     4 [unused]
//   float FC_FROZEN_POW;               // Offset:  180 Size:     4 [unused]
//   float FC_BlendRate;                // Offset:  192 Size:     4 [unused]
//   float4 FC_FlowMapUvTiling;         // Offset:  208 Size:    16 [unused]
//   float4 FC_FlowMapIntencity;        // Offset:  224 Size:    16 [unused]
//   float FC_SoftVolume;               // Offset:  240 Size:     4 [unused]
//   float FC_PointCloudRate;           // Offset:  256 Size:     4 [unused]
//   float4 FC_WaterNormalUvScrollSpeed;// Offset:  272 Size:    16 [unused]
//   float4 FC_WaterDiffuseUvScrollSpeed;// Offset:  288 Size:    16 [unused]
//   float4 FC_WaterMiddleUvScrollSpeed;// Offset:  304 Size:    16 [unused]
//   float4 FC_WaterFogParam0;          // Offset:  320 Size:    16 [unused]
//   float4 FC_WaterFogParam1;          // Offset:  336 Size:    16 [unused]
//   float4 FC_WaterFresnel;            // Offset:  352 Size:    16 [unused]
//   float4 FC_WaterFadeParam;          // Offset:  368 Size:    16 [unused]
//   float4 FC_DynamicDiffuseColor;     // Offset:  384 Size:    16 [unused]
//   float FC_SSS_ID;                   // Offset:  400 Size:     4 [unused]
//   float4 FC_PhantomEdgeColor;        // Offset:  416 Size:    16 [unused]
//   float4 FC_PhantomFrontColor;       // Offset:  432 Size:    16 [unused]
//   float4 FC_PhantomDiffColor;        // Offset:  448 Size:    16 [unused]
//   float4 FC_PhantomSpecColor;        // Offset:  464 Size:    16 [unused]
//   float4 FC_PhantomLightColor;       // Offset:  480 Size:    16 [unused]
//   float VC_VelocityOffset;           // Offset:  496 Size:     4 [unused]
//   float4 FC_DamagedNormalParam;      // Offset:  512 Size:    16 [unused]
//   float4 FC_DamagedNormalUvTiling;   // Offset:  528 Size:    16 [unused]
//   float4 FC_DamagedNormal2UvTiling;  // Offset:  544 Size:    16 [unused]
//   float4 FC_WetDiffuseColor;         // Offset:  560 Size:    16 [unused]
//   float4 FC_WetParam1;               // Offset:  576 Size:    16 [unused]
//   float4 FC_WetRefrectanceColor;     // Offset:  592 Size:    16 [unused]
//   float4 FC_WetParam2;               // Offset:  608 Size:    16 [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 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]
//
// }
//
// cbuffer cbvModelParam
// {
//
//   float4x3 VC_World;                 // Offset:    0 Size:    48
//   float4x3 VC_PrevWorld;             // Offset:   48 Size:    48 [unused]
//   float4 VC_VtxCullingParam;         // Offset:   96 Size:    16 [unused]
//   float4 VFC_PomLightDir;            // Offset:  112 Size:    16 [unused]
//   
//   struct ForceParamST
//   {
//       
//       int4 WindForceLoopParam;       // Offset:  128
//       float4 WindForceAndTime[4];    // Offset:  144
//       float4 PointWindPositionAndTime[4];// Offset:  208
//       float4 PointWindForce[4];      // Offset:  272
//       float4 WindPositionAndRange[4];// Offset:  336
//       float4 WindWaveNoiseScale[4];  // Offset:  400
//       float4 WindWaveNoiseScalePoint[4];// Offset:  464
//       float4 PointWindDirAndEnable[4];// Offset:  528
//       float4 WindAttractionParam[4]; // Offset:  592
//
//   } VC_ForceParam;                   // Offset:  128 Size:   528 [unused]
//   int VC_InstanceId;                 // Offset:  656 Size:     4 [unused]
//   int3 VC_InstanceIdPad;             // Offset:  660 Size:    12 [unused]
//   float4 unused_VC_UserClipPlane;    // Offset:  672 Size:    16 [unused]
//   float4 VC_ModelSizeParam;          // Offset:  688 Size:    16 [unused]
//   float4 VC_LTWorldPosition;         // Offset:  704 Size:    16 [unused]
//   float4 VC_RTWorldPosition;         // Offset:  720 Size:    16 [unused]
//   float4 VC_LBWorldPosition;         // Offset:  736 Size:    16 [unused]
//
// }
//
// cbuffer cbObjMatrix
// {
//
//   float4x3 VC_aObjMatrix[2];         // Offset:    0 Size:    96
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// cbMatrixWVP                       cbuffer      NA          NA    0        1
// cbMatDynParam                     cbuffer      NA          NA    2        1
// cbInstanceData                    cbuffer      NA          NA    4        1
// cbObjMatrix                       cbuffer      NA          NA    5        1
// cbvModelParam                     cbuffer      NA          NA    7        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz 
// NORMAL                   0   xyzw        1     NONE    uint       
// BLENDINDICES             0   xyzw        2     NONE    uint   xyzw
// BLENDWEIGHT              0   xyzw        3     NONE   float   xyzw
// TEXCOORD                 0   xyzw        4     NONE     int       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb2[9], immediateIndexed
dcl_constantbuffer cb4[6], immediateIndexed
dcl_constantbuffer cb0[8], immediateIndexed
dcl_constantbuffer cb7[3], immediateIndexed
dcl_constantbuffer cb5[6], dynamicIndexed
dcl_input v0.xyz
dcl_input v2.xyzw
dcl_input v3.xyzw
dcl_output_siv o0.xyzw, position
dcl_temps 5
mov r0.xyz, v0.xyzx
mov r0.w, l(1.000000)
dp4 r1.x, l(1.000000, 1.000000, 1.000000, 1.000000), v3.xyzw
max r1.x, r1.x, l(0.001000)
div r1.xyzw, v3.xyzw, r1.xxxx
iadd r2.xyzw, v2.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
movc r3.xyzw, cb2[8].xxxx, cb7[0].xyzw, r3.xyzw
dp4 r3.x, r0.xyzw, r3.xyzw
mul r4.xyzw, r1.yyyy, cb5[r2.y + 1].xyzw
mad r4.xyzw, cb5[r2.x + 1].xyzw, r1.xxxx, r4.xyzw
mad r4.xyzw, cb5[r2.z + 1].xyzw, r1.zzzz, r4.xyzw
mad r4.xyzw, cb5[r2.w + 1].xyzw, r1.wwww, r4.xyzw
movc r4.xyzw, cb2[8].xxxx, cb7[1].xyzw, r4.xyzw
dp4 r3.y, r0.xyzw, r4.xyzw
mul r4.xyzw, r1.yyyy, cb5[r2.y + 2].xyzw
mad r4.xyzw, cb5[r2.x + 2].xyzw, r1.xxxx, r4.xyzw
mad r4.xyzw, cb5[r2.z + 2].xyzw, r1.zzzz, r4.xyzw
mad r1.xyzw, cb5[r2.w + 2].xyzw, r1.wwww, r4.xyzw
movc r1.xyzw, cb2[8].xxxx, cb7[2].xyzw, r1.xyzw
dp4 r3.z, r0.xyzw, r1.xyzw
add r0.xyz, r3.xyzx, -cb0[3].xyzx
mov r0.w, l(1.000000)
dp4 o0.x, r0.xyzw, cb0[4].xyzw
dp4 o0.y, r0.xyzw, cb0[5].xyzw
dp4 o0.z, r0.xyzw, cb0[6].xyzw
dp4 o0.w, r0.xyzw, cb0[7].xyzw
ret 
// Approximately 32 instruction slots used

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