// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:30:52 2016
Buffer<mixed4> t4 : register(t4);


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 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);
}

cbuffer cbInstanceIdxParam : register(b10)
{
  int VC_InstanceIdxOffset : packoffset(c0);
  int3 pad : packoffset(c0.y);
}

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,
  int4 v2 : TEXCOORD0,
  float4 v3 : TEXCOORD1,
  uint v4 : SV_INSTANCEID0,
  out float4 o0 : SV_Position0,
  out float2 o1 : TEXCOORD9,
  out float p1 : TEXCOORD12,
  out float4 o2 : COLOR1,
  out float4 o3 : TEXCOORD6,
  out float o4 : SV_ClipDistance0,
  out float p4 : SV_ClipDistance1)
{
// Needs manual fix for instruction: 
// unknown dcl_: dcl_input_sgv v4.x, instance_id
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = (int)v4.x + VC_InstanceIdxOffset;
  r0.yz = (int2)r0.xx * int2(17,33);
  r0.w = (int)v1.w + (int)VC_InstanceData[r0.y].matricesData.x;
  r0.w = (int)r0.w * 3;
  r1.xyz = v0.xyz;
  r1.w = 1;
  r2.x = dot(r1.xyzw, VC_aObjMatrix[r0.w/3]._m00_m10_m20_m30);
  r2.y = dot(r1.xyzw, VC_aObjMatrix[r0.w/3]._m01_m11_m21_m31);
  r2.z = dot(r1.xyzw, VC_aObjMatrix[r0.w/3]._m02_m12_m22_m32);
  r1.xy = (int2)v2.xy;
  r1.xy = VC_TexScroll_0.xy * r1.xy;
  o3.xy = r1.xy * float2(0.00048828125,0.00048828125) + VC_TexScroll_0.zw;
  r0.zw = t4.Load(r0.z).xy;
  r1.x = sqrt(VC_ModelSizeParam.y);
  r1.x = 1 / r1.x;
  r0.zw = min(int2(0,0), (int2)r0.zw);
  r1.y = dot(r2.xz, r2.xz);
  r1.y = sqrt(r1.y);
  r1.zw = float2(0,0);
  r2.w = 0;
  while (true) {
    r3.x = cmp((int)r2.w >= (int)r0.z);
    if (r3.x != 0) break;
    r3.x = mad((int)r0.x, 33, (int)r2.w);
    r3.xyz = (int3)r3.xxx + int3(1,13,17);
    r4.xyzw = t4.Load(r3.x).xyzw;
    r5.xyzw = t4.Load(r3.y).xyzw;
    r3.xyzw = t4.Load(r3.z).xyzw;
    r3.z = r4.w * r3.z;
    r3.z = r1.y * r3.w + r3.z;
    r3.z = 0.000442097051 * r3.z;
    r3.w = cmp(r3.z >= -r3.z);
    r3.z = frac(abs(r3.z));
    r3.z = r3.w ? r3.z : -r3.z;
    r3.z = r3.z * 6.28318548 + -3.14159274;
    r3.z = sin(r3.z);
    r3.z = r3.z * 0.5 + 0.5;
    r3.w = r3.z * r3.z;
    r3.w = r3.w * r3.z;
    r6.x = r3.z * 6 + -15;
    r3.z = r3.z * r6.x + 10;
    r3.z = r3.w * r3.z;
    r3.y = r3.y + -r3.x;
    r3.x = r3.z * r3.y + r3.x;
    r3.xyz = r4.xyz * r3.xxx;
    r4.xyz = -r5.xyz + r2.xyz;
    r3.w = dot(r4.xyz, r4.xyz);
    r4.x = cmp(0 < r3.w);
    r3.w = sqrt(r3.w);
    r3.w = r4.x ? r3.w : 0;
    r4.x = cmp(0 < r5.w);
    r4.y = max(9.99999975e-005, r5.w);
    r3.w = r3.w / r4.y;
    r3.w = 1 + -r3.w;
    r3.w = max(0, r3.w);
    r3.w = r4.x ? r3.w : 1;
    r4.y = dot(r3.xyz, r3.xyz);
    r4.xz = cmp(float2(0,0) < r4.wy);
    r4.y = rsqrt(r4.y);
    r5.xyz = r4.yyy * r3.xyz;
    r5.xyz = r4.zzz ? r5.xyz : 0;
    r3.y = dot(r5.xyz, r2.xyz);
    r3.y = v3.x * 6.28318548 + -r3.y;
    r4.y = v3.z * r4.w;
    r3.y = r4.y * 10 + r3.y;
    r3.y = 0.159154937 * r3.y;
    r4.y = cmp(r3.y >= -r3.y);
    r3.y = frac(abs(r3.y));
    r3.y = r4.y ? r3.y : -r3.y;
    r3.y = 6.28318548 * r3.y;
    r3.y = sin(r3.y);
    r4.yz = r3.xz * r3.ww;
    r4.yz = v3.yy * r4.yz;
    r4.yz = float2(10,10) * r4.yz;
    r3.xy = r3.xz * r3.yy;
    r3.xy = r3.xy * r3.ww + r4.yz;
    r3.xy = r4.xx ? r3.xy : 0;
    r1.zw = r3.xy * r1.xx + r1.zw;
    r2.w = (int)r2.w + 1;
  }
  r3.w = 0;
  r4.w = 1;
  r5.xz = r1.zw;
  r0.z = 0;
  while (true) {
    r2.w = cmp((int)r0.z >= (int)r0.w);
    if (r2.w != 0) break;
    r2.w = mad((int)r0.x, 33, (int)r0.z);
    r6.xyzw = (int4)r2.wwww + int4(5,9,21,25);
    r7.xyzw = t4.Load(r6.x).xyzw;
    r8.xyz = t4.Load(r6.y).xyz;
    r9.xyzw = t4.Load(r6.z).xyzw;
    r6.xyzw = t4.Load(r6.w).xyzw;
    r2.w = (int)r2.w + 29;
    r2.w = t4.Load(r2.w).x;
    r5.y = r9.z * r7.w;
    r5.y = r1.y * r9.w + r5.y;
    r5.y = 0.000442097051 * r5.y;
    r5.w = cmp(r5.y >= -r5.y);
    r5.y = frac(abs(r5.y));
    r5.y = r5.w ? r5.y : -r5.y;
    r5.y = r5.y * 6.28318548 + -3.14159274;
    r5.y = sin(r5.y);
    r5.y = r5.y * 0.5 + 0.5;
    r5.w = r5.y * r5.y;
    r5.w = r5.w * r5.y;
    r8.w = r5.y * 6 + -15;
    r5.y = r5.y * r8.w + 10;
    r5.y = r5.w * r5.y;
    r5.w = r9.y + -r9.x;
    r5.y = r5.y * r5.w + r9.x;
    r8.xyz = r8.xyz * r5.yyy;
    r5.y = cmp(0 < r7.w);
    r3.xyz = -r7.xyz + r2.xyz;
    r3.y = dot(r3.xyz, r3.xyz);
    r5.w = cmp(0 < r3.y);
    r7.x = rsqrt(r3.y);
    r7.yz = r7.xx * r3.xz;
    r7.x = sqrt(r3.y);
    r3.y = dot(r3.xz, r3.xz);
    r3.y = rsqrt(r3.y);
    r9.xy = r3.xz * r3.yy;
    r9.xy = r5.ww ? r9.xy : 0;
    r4.xyz = r5.www ? r7.xyz : r3.wxz;
    r3.x = cmp(0 < r6.w);
    r3.y = dot(r6.xyz, r6.xyz);
    r3.y = cmp(0 < r3.y);
    r3.z = dot(r6.xz, r6.xz);
    r3.z = rsqrt(r3.z);
    r6.xy = r6.xz * r3.zz;
    r6.xy = r3.yy ? r6.xy : 0;
    r3.y = dot(r6.xy, r9.xy);
    r6.z = saturate(r3.y * 0.800000012 + 0.200000003);
    r3.yz = r3.xx ? r6.xy : r9.xy;
    r6.xyz = r3.xxx ? r6.xyz : r4.yzw;
    r3.x = max(0.00100000005, r8.y);
    r3.x = r4.x / r3.x;
    r3.x = min(1, r3.x);
    r3.x = 1 + -r3.x;
    r3.x = r3.x * r6.z;
    r4.y = cmp(0 < r3.x);
    r4.z = 10 * r7.w;
    r4.x = r4.x * -2 + r4.z;
    r4.x = 0.159154937 * r4.x;
    r4.z = cmp(r4.x >= -r4.x);
    r4.x = frac(abs(r4.x));
    r4.x = r4.z ? r4.x : -r4.x;
    r4.x = 6.28318548 * r4.x;
    r4.x = sin(r4.x);
    r6.xy = float2(10,10) * r6.xy;
    r6.xy = v3.yy * r6.xy;
    r6.zw = r6.xy * r8.xx;
    r6.zw = r6.zw * r3.xx;
    r6.xy = r6.xy * r2.ww;
    r2.w = r3.x * r8.x;
    r3.yz = r2.ww * r3.yz;
    r2.w = 1 + -r4.x;
    r2.w = r8.z * r2.w + r4.x;
    r3.yz = r3.yz * r2.ww + r6.zw;
    r3.xy = r6.xy * r3.xx + r3.yz;
    r3.xy = r4.yy ? r3.xy : 0;
    r3.xy = r5.ww ? r3.xy : 0;
    r3.xy = r5.yy ? r3.xy : 0;
    r5.xz = r3.xy * r1.xx + r5.xz;
    r0.z = (int)r0.z + 1;
  }
  r0.zw = r5.xz * r5.xz + float2(1,1);
  r0.zw = sqrt(r0.zw);
  r1.xz = r5.xz / r0.zw;
  r0.z = dot(r1.xz, r1.xz);
  r0.z = 1 + -r0.z;
  r0.z = max(0, r0.z);
  r0.z = sqrt(r0.z);
  r1.y = -1 + r0.z;
  r0.z = VC_ModelSizeParam.y * v3.y;
  r1.xyz = r1.xyz * r0.zzz + r2.xyz;
  r1.xyz = -VC_View_MatrixCamera._m30_m31_m32 + r1.xyz;
  r1.w = 1;
  r2.x = dot(r1.xyzw, VC_View_MatrixViewProj._m00_m10_m20_m30);
  r2.y = dot(r1.xyzw, VC_View_MatrixViewProj._m01_m11_m21_m31);
  r2.z = dot(r1.xyzw, VC_View_MatrixViewProj._m02_m12_m22_m32);
  r2.w = dot(r1.xyzw, VC_View_MatrixViewProj._m03_m13_m23_m33);
  p1.x = (uint)r0.x;
  o4.x = dot(r2.xyzw, VC_ClipPlane.xyzw);
  p4.x = dot(r2.xyzw, VC_InstanceData[r0.y].userClipPlane.xyzw);
  o0.xyzw = r2.xyzw;
  o2.xyzw = float4(0,0,0,1);
  o3.zw = VC_InstanceData[r0.y].atlasUvScaleOffset.zw;
  o1.xy = r2.zw;
  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 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 [unused]
//   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
//   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
//
// }
//
// cbuffer cbInstanceIdxParam
// {
//
//   int VC_InstanceIdxOffset;          // Offset:    0 Size:     4
//   int3 pad;                          // Offset:    4 Size:    12 [unused]
//
// }
//
// tbuffer tbForce
// {
//
//   struct ForceParamST
//   {
//       
//       int4 WindForceLoopParam;       // Offset:    0
//       float4 WindForceAndTime[4];    // Offset:   16
//       float4 PointWindPositionAndTime[4];// Offset:   80
//       float4 PointWindForce[4];      // Offset:  144
//       float4 WindPositionAndRange[4];// Offset:  208
//       float4 WindWaveNoiseScale[4];  // Offset:  272
//       float4 WindWaveNoiseScalePoint[4];// Offset:  336
//       float4 PointWindDirAndEnable[4];// Offset:  400
//       float4 WindAttractionParam[4]; // Offset:  464
//
//   } VT_aForceParam[2];               // Offset:    0 Size:  1056
//
// }
//
// cbuffer cbTexScroll
// {
//
//   float4 VC_TexScroll_0;             // Offset:    0 Size:    16
//   float4 VC_TexScroll_1;             // Offset:   16 Size:    16 [unused]
//   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
// ------------------------------ ---------- ------- ----------- ---- --------
// tbForce                           tbuffer      NA          NA    4        1
// cbMatrixWVP                       cbuffer      NA          NA    0        1
// cbInstanceData                    cbuffer      NA          NA    4        1
// cbObjMatrix                       cbuffer      NA          NA    5        1
// cbvModelParam                     cbuffer      NA          NA    7        1
// cbSceneParam                      cbuffer      NA          NA    8        1
// cbInstanceIdxParam                cbuffer      NA          NA   10        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      w
// TEXCOORD                 0   xyzw        2     NONE     int   xy  
// TEXCOORD                 1   xyzw        3     NONE   float   xyz 
// SV_INSTANCEID            0   x           4   INSTID    uint   x   
//
//
// 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
// SV_ClipDistance          0   x           4  CLIPDST   float   x   
// SV_ClipDistance          1    y          4  CLIPDST   float    y  
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb8[5], immediateIndexed
dcl_constantbuffer cb4[34], dynamicIndexed
dcl_constantbuffer cb0[8], immediateIndexed
dcl_constantbuffer cb7[44], immediateIndexed
dcl_constantbuffer cb5[6], dynamicIndexed
dcl_constantbuffer cb10[1], immediateIndexed
dcl_constantbuffer cb11[1], immediateIndexed
dcl_resource_buffer (mixed,mixed,mixed,mixed) t4
dcl_input v0.xyz
dcl_input v1.w
dcl_input v2.xy
dcl_input v3.xyz
dcl_input_sgv v4.x, instance_id
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o1.z
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output_siv o4.x, clip_distance
dcl_output_siv o4.y, clip_distance
dcl_temps 10
iadd r0.x, v4.x, cb10[0].x
imul null, r0.yz, r0.xxxx, l(0, 17, 33, 0)
iadd r0.w, v1.w, cb4[r0.y + 5].x
imul null, r0.w, r0.w, l(3)
mov r1.xyz, v0.xyzx
mov r1.w, l(1.000000)
dp4 r2.x, r1.xyzw, cb5[r0.w + 0].xyzw
dp4 r2.y, r1.xyzw, cb5[r0.w + 1].xyzw
dp4 r2.z, r1.xyzw, cb5[r0.w + 2].xyzw
itof r1.xy, v2.xyxx
mul r1.xy, r1.xyxx, cb11[0].xyxx
mad o3.xy, r1.xyxx, l(0.000488, 0.000488, 0.000000, 0.000000), cb11[0].zwzz
ld_indexable(buffer)(mixed,mixed,mixed,mixed) r0.zw, r0.zzzz, t4.zwxy
sqrt r1.x, cb7[43].y
div r1.x, l(1.000000, 1.000000, 1.000000, 1.000000), r1.x
imin r0.zw, r0.zzzw, l(0, 0, 4, 4)
dp2 r1.y, r2.xzxx, r2.xzxx
sqrt r1.y, r1.y
mov r1.zw, l(0,0,0,0)
mov r2.w, l(0)
loop 
  ige r3.x, r2.w, r0.z
  breakc_nz r3.x
  imad r3.x, r0.x, l(33), r2.w
  iadd r3.xyz, r3.xxxx, l(1, 13, 17, 0)
  ld_indexable(buffer)(mixed,mixed,mixed,mixed) r4.xyzw, r3.xxxx, t4.xyzw
  ld_indexable(buffer)(mixed,mixed,mixed,mixed) r5.xyzw, r3.yyyy, t4.xyzw
  ld_indexable(buffer)(mixed,mixed,mixed,mixed) r3.xyzw, r3.zzzz, t4.xyzw
  mul r3.z, r3.z, r4.w
  mad r3.z, r1.y, r3.w, r3.z
  mul r3.z, r3.z, l(0.000442)
  ge r3.w, r3.z, -r3.z
  frc r3.z, |r3.z|
  movc r3.z, r3.w, r3.z, -r3.z
  mad r3.z, r3.z, l(6.283185), l(-3.141593)
  sincos r3.z, null, r3.z
  mad r3.z, r3.z, l(0.500000), l(0.500000)
  mul r3.w, r3.z, r3.z
  mul r3.w, r3.z, r3.w
  mad r6.x, r3.z, l(6.000000), l(-15.000000)
  mad r3.z, r3.z, r6.x, l(10.000000)
  mul r3.z, r3.z, r3.w
  add r3.y, -r3.x, r3.y
  mad r3.x, r3.z, r3.y, r3.x
  mul r3.xyz, r3.xxxx, r4.xyzx
  add r4.xyz, r2.xyzx, -r5.xyzx
  dp3 r3.w, r4.xyzx, r4.xyzx
  lt r4.x, l(0.000000), r3.w
  sqrt r3.w, r3.w
  and r3.w, r3.w, r4.x
  lt r4.x, l(0.000000), r5.w
  max r4.y, r5.w, l(0.000100)
  div r3.w, r3.w, r4.y
  add r3.w, -r3.w, l(1.000000)
  max r3.w, r3.w, l(0.000000)
  movc r3.w, r4.x, r3.w, l(1.000000)
  dp3 r4.y, r3.xyzx, r3.xyzx
  lt r4.xz, l(0.000000, 0.000000, 0.000000, 0.000000), r4.wwyw
  rsq r4.y, r4.y
  mul r5.xyz, r3.xyzx, r4.yyyy
  and r5.xyz, r4.zzzz, r5.xyzx
  dp3 r3.y, r5.xyzx, r2.xyzx
  mad r3.y, v3.x, l(6.283185), -r3.y
  mul r4.y, r4.w, v3.z
  mad r3.y, r4.y, l(10.000000), r3.y
  mul r3.y, r3.y, l(0.159155)
  ge r4.y, r3.y, -r3.y
  frc r3.y, |r3.y|
  movc r3.y, r4.y, r3.y, -r3.y
  mul r3.y, r3.y, l(6.283185)
  sincos r3.y, null, r3.y
  mul r4.yz, r3.wwww, r3.xxzx
  mul r4.yz, r4.yyzy, v3.yyyy
  mul r4.yz, r4.yyzy, l(0.000000, 10.000000, 10.000000, 0.000000)
  mul r3.xy, r3.yyyy, r3.xzxx
  mad r3.xy, r3.xyxx, r3.wwww, r4.yzyy
  and r3.xy, r3.xyxx, r4.xxxx
  mad r1.zw, r3.xxxy, r1.xxxx, r1.zzzw
  iadd r2.w, r2.w, l(1)
endloop 
mov r3.w, l(0)
mov r4.w, l(1.000000)
mov r5.xz, r1.zzwz
mov r0.z, l(0)
loop 
  ige r2.w, r0.z, r0.w
  breakc_nz r2.w
  imad r2.w, r0.x, l(33), r0.z
  iadd r6.xyzw, r2.wwww, l(5, 9, 21, 25)
  ld_indexable(buffer)(mixed,mixed,mixed,mixed) r7.xyzw, r6.xxxx, t4.xyzw
  ld_indexable(buffer)(mixed,mixed,mixed,mixed) r8.xyz, r6.yyyy, t4.xyzw
  ld_indexable(buffer)(mixed,mixed,mixed,mixed) r9.xyzw, r6.zzzz, t4.xyzw
  ld_indexable(buffer)(mixed,mixed,mixed,mixed) r6.xyzw, r6.wwww, t4.xyzw
  iadd r2.w, r2.w, l(29)
  ld_indexable(buffer)(mixed,mixed,mixed,mixed) r2.w, r2.wwww, t4.yzwx
  mul r5.y, r7.w, r9.z
  mad r5.y, r1.y, r9.w, r5.y
  mul r5.y, r5.y, l(0.000442)
  ge r5.w, r5.y, -r5.y
  frc r5.y, |r5.y|
  movc r5.y, r5.w, r5.y, -r5.y
  mad r5.y, r5.y, l(6.283185), l(-3.141593)
  sincos r5.y, null, r5.y
  mad r5.y, r5.y, l(0.500000), l(0.500000)
  mul r5.w, r5.y, r5.y
  mul r5.w, r5.y, r5.w
  mad r8.w, r5.y, l(6.000000), l(-15.000000)
  mad r5.y, r5.y, r8.w, l(10.000000)
  mul r5.y, r5.y, r5.w
  add r5.w, -r9.x, r9.y
  mad r5.y, r5.y, r5.w, r9.x
  mul r8.xyz, r5.yyyy, r8.xyzx
  lt r5.y, l(0.000000), r7.w
  add r3.xyz, r2.xyzx, -r7.xyzx
  dp3 r3.y, r3.xyzx, r3.xyzx
  lt r5.w, l(0.000000), r3.y
  rsq r7.x, r3.y
  mul r7.yz, r3.xxzx, r7.xxxx
  sqrt r7.x, r3.y
  dp2 r3.y, r3.xzxx, r3.xzxx
  rsq r3.y, r3.y
  mul r9.xy, r3.yyyy, r3.xzxx
  and r9.xy, r5.wwww, r9.xyxx
  movc r4.xyz, r5.wwww, r7.xyzx, r3.wxzw
  lt r3.x, l(0.000000), r6.w
  dp3 r3.y, r6.xyzx, r6.xyzx
  lt r3.y, l(0.000000), r3.y
  dp2 r3.z, r6.xzxx, r6.xzxx
  rsq r3.z, r3.z
  mul r6.xy, r3.zzzz, r6.xzxx
  and r6.xy, r3.yyyy, r6.xyxx
  dp2 r3.y, r6.xyxx, r9.xyxx
  mad_sat r6.z, r3.y, l(0.800000), l(0.200000)
  movc r3.yz, r3.xxxx, r6.xxyx, r9.xxyx
  movc r6.xyz, r3.xxxx, r6.xyzx, r4.yzwy
  max r3.x, r8.y, l(0.001000)
  div r3.x, r4.x, r3.x
  min r3.x, r3.x, l(1.000000)
  add r3.x, -r3.x, l(1.000000)
  mul r3.x, r6.z, r3.x
  lt r4.y, l(0.000000), r3.x
  mul r4.z, r7.w, l(10.000000)
  mad r4.x, r4.x, l(-2.000000), r4.z
  mul r4.x, r4.x, l(0.159155)
  ge r4.z, r4.x, -r4.x
  frc r4.x, |r4.x|
  movc r4.x, r4.z, r4.x, -r4.x
  mul r4.x, r4.x, l(6.283185)
  sincos r4.x, null, r4.x
  mul r6.xy, r6.xyxx, l(10.000000, 10.000000, 0.000000, 0.000000)
  mul r6.xy, r6.xyxx, v3.yyyy
  mul r6.zw, r8.xxxx, r6.xxxy
  mul r6.zw, r3.xxxx, r6.zzzw
  mul r6.xy, r2.wwww, r6.xyxx
  mul r2.w, r8.x, r3.x
  mul r3.yz, r3.yyzy, r2.wwww
  add r2.w, -r4.x, l(1.000000)
  mad r2.w, r8.z, r2.w, r4.x
  mad r3.yz, r3.yyzy, r2.wwww, r6.zzwz
  mad r3.xy, r6.xyxx, r3.xxxx, r3.yzyy
  and r3.xy, r3.xyxx, r4.yyyy
  and r3.xy, r3.xyxx, r5.wwww
  and r3.xy, r3.xyxx, r5.yyyy
  mad r5.xz, r3.xxyx, r1.xxxx, r5.xxzx
  iadd r0.z, r0.z, l(1)
endloop 
mad r0.zw, r5.xxxz, r5.xxxz, l(0.000000, 0.000000, 1.000000, 1.000000)
sqrt r0.zw, r0.zzzw
div r1.xz, r5.xxzx, r0.zzwz
dp2 r0.z, r1.xzxx, r1.xzxx
add r0.z, -r0.z, l(1.000000)
max r0.z, r0.z, l(0.000000)
sqrt r0.z, r0.z
add r1.y, r0.z, l(-1.000000)
mul r0.z, v3.y, cb7[43].y
mad r1.xyz, r1.xyzx, r0.zzzz, r2.xyzx
add r1.xyz, r1.xyzx, -cb0[3].xyzx
mov r1.w, l(1.000000)
dp4 r2.x, r1.xyzw, cb0[4].xyzw
dp4 r2.y, r1.xyzw, cb0[5].xyzw
dp4 r2.z, r1.xyzw, cb0[6].xyzw
dp4 r2.w, r1.xyzw, cb0[7].xyzw
utof o1.z, r0.x
dp4 o4.x, r2.xyzw, cb8[4].xyzw
dp4 o4.y, r2.xyzw, cb4[r0.y + 4].xyzw
mov o0.xyzw, r2.xyzw
mov o2.xyzw, l(0,0,0,1.000000)
mov o3.zw, cb4[r0.y + 3].zzzw
mov o1.xy, r2.zwzz
ret 
// Approximately 190 instruction slots used

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