// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:30:49 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 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 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,
  float4 v2 : COLOR1,
  int4 v3 : TEXCOORD0,
  float4 v4 : TEXCOORD1,
  out float4 o0 : SV_Position0,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : COLOR1,
  out float2 o3 : TEXCOORD4,
  out float o4 : SV_ClipDistance0,
  out float p4 : SV_ClipDistance1)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = (int)v1.w + (int)VC_InstanceData[0].matricesData.x;
  r0.x = (int)r0.x * 3;
  r1.xyz = v0.xyz;
  r1.w = 1;
  r2.x = dot(r1.xyzw, VC_aObjMatrix[r0.x/3]._m00_m10_m20_m30);
  r2.y = dot(r1.xyzw, VC_aObjMatrix[r0.x/3]._m01_m11_m21_m31);
  r2.z = dot(r1.xyzw, VC_aObjMatrix[r0.x/3]._m02_m12_m22_m32);
  r0.yzw = (uint3)v1.xyz;
  r0.yzw = float3(-127,-127,-127) + r0.yzw;
  r0.yzw = float3(0.00787401572,0.00787401572,0.00787401572) * r0.yzw;
  o1.x = dot(r0.yzw, VC_aObjMatrix[r0.x/3]._m00_m10_m20);
  o1.y = dot(r0.yzw, VC_aObjMatrix[r0.x/3]._m01_m11_m21);
  o1.z = dot(r0.yzw, VC_aObjMatrix[r0.x/3]._m02_m12_m22);
  r0.xy = (int2)v3.xy;
  r0.xy = VC_TexScroll_0.xy * r0.xy;
  o3.xy = r0.xy * float2(0.00048828125,0.00048828125) + VC_TexScroll_0.zw;
  r0.x = sqrt(VC_ModelSizeParam.y);
  r0.x = 1 / r0.x;
  r0.yz = min((int2)VC_ForceParam.WindForceLoopParam.xy, int2(0,0));
  r0.w = dot(r2.xz, r2.xz);
  r0.w = sqrt(r0.w);
  r1.xyz = float3(0,0,0);
  while (true) {
    r1.w = cmp((int)r1.z >= (int)r0.y);
    if (r1.w != 0) break;
    r1.w = VC_ForceParam.WindWaveNoiseScale[r1.z].z * VC_ForceParam.WindForceAndTime[r1.z].w;
    r1.w = r0.w * VC_ForceParam.WindWaveNoiseScale[r1.z].w + r1.w;
    r1.w = 0.000442097051 * r1.w;
    r2.w = cmp(r1.w >= -r1.w);
    r1.w = frac(abs(r1.w));
    r1.w = r2.w ? r1.w : -r1.w;
    r1.w = r1.w * 6.28318548 + -3.14159274;
    r1.w = sin(r1.w);
    r1.w = r1.w * 0.5 + 0.5;
    r2.w = r1.w * r1.w;
    r2.w = r2.w * r1.w;
    r3.x = r1.w * 6 + -15;
    r1.w = r1.w * r3.x + 10;
    r1.w = r2.w * r1.w;
    r2.w = VC_ForceParam.WindWaveNoiseScale[r1.z].y + -VC_ForceParam.WindWaveNoiseScale[r1.z].x;
    r1.w = r1.w * r2.w + VC_ForceParam.WindWaveNoiseScale[r1.z].x;
    r3.xyz = VC_ForceParam.WindForceAndTime[r1.z].xyz * r1.www;
    r4.xyz = -VC_ForceParam.WindPositionAndRange[r1.z].xyz + r2.xyz;
    r1.w = dot(r4.xyz, r4.xyz);
    r2.w = cmp(0 < r1.w);
    r1.w = sqrt(r1.w);
    r1.w = r2.w ? r1.w : 0;
    r2.w = cmp(0 < VC_ForceParam.WindPositionAndRange[r1.z].w);
    r3.w = max(VC_ForceParam.WindPositionAndRange[r1.z].w, 9.99999975e-005);
    r1.w = r1.w / r3.w;
    r1.w = 1 + -r1.w;
    r1.w = max(0, r1.w);
    r1.w = r2.w ? r1.w : 1;
    r2.w = cmp(0 < VC_ForceParam.WindForceAndTime[r1.z].w);
    r3.w = dot(r3.xyz, r3.xyz);
    r4.x = cmp(0 < r3.w);
    r3.w = rsqrt(r3.w);
    r4.yzw = r3.xyz * r3.www;
    r4.xyz = r4.xxx ? r4.yzw : 0;
    r3.y = dot(r4.xyz, r2.xyz);
    r3.y = v4.x * 6.28318548 + -r3.y;
    r3.w = VC_ForceParam.WindForceAndTime[r1.z].w * v4.z;
    r3.y = r3.w * 10 + r3.y;
    r3.y = 0.159154937 * r3.y;
    r3.w = cmp(r3.y >= -r3.y);
    r3.y = frac(abs(r3.y));
    r3.y = r3.w ? r3.y : -r3.y;
    r3.y = 6.28318548 * r3.y;
    r3.y = sin(r3.y);
    r4.xy = r3.xz * r1.ww;
    r4.xy = v4.yy * r4.xy;
    r4.xy = float2(10,10) * r4.xy;
    r3.xy = r3.xz * r3.yy;
    r3.xy = r3.xy * r1.ww + r4.xy;
    r3.xy = r2.ww ? r3.xy : 0;
    r1.xy = r3.xy * r0.xx + r1.xy;
    r1.z = (int)r1.z + 1;
  }
  r3.w = 0;
  r4.w = 1;
  r5.xz = r1.xy;
  r0.y = 0;
  while (true) {
    r1.z = cmp((int)r0.y >= (int)r0.z);
    if (r1.z != 0) break;
    r1.z = VC_ForceParam.WindWaveNoiseScalePoint[r0.y].z * VC_ForceParam.PointWindPositionAndTime[r0.y].w;
    r1.z = r0.w * VC_ForceParam.WindWaveNoiseScalePoint[r0.y].w + r1.z;
    r1.z = 0.000442097051 * r1.z;
    r1.w = cmp(r1.z >= -r1.z);
    r1.z = frac(abs(r1.z));
    r1.z = r1.w ? r1.z : -r1.z;
    r1.z = r1.z * 6.28318548 + -3.14159274;
    r1.z = sin(r1.z);
    r1.z = r1.z * 0.5 + 0.5;
    r1.w = r1.z * r1.z;
    r1.w = r1.w * r1.z;
    r2.w = r1.z * 6 + -15;
    r1.z = r1.z * r2.w + 10;
    r1.z = r1.w * r1.z;
    r1.w = VC_ForceParam.WindWaveNoiseScalePoint[r0.y].y + -VC_ForceParam.WindWaveNoiseScalePoint[r0.y].x;
    r1.z = r1.z * r1.w + VC_ForceParam.WindWaveNoiseScalePoint[r0.y].x;
    r6.xyz = VC_ForceParam.PointWindForce[r0.y].xyz * r1.zzz;
    r1.z = cmp(0 < VC_ForceParam.PointWindPositionAndTime[r0.y].w);
    r3.xyz = -VC_ForceParam.PointWindPositionAndTime[r0.y].xyz + r2.xyz;
    r1.w = dot(r3.xyz, r3.xyz);
    r2.w = cmp(0 < r1.w);
    r3.y = rsqrt(r1.w);
    r7.yz = r3.xz * r3.yy;
    r7.x = sqrt(r1.w);
    r1.w = dot(r3.xz, r3.xz);
    r1.w = rsqrt(r1.w);
    r5.yw = r3.xz * r1.ww;
    r5.yw = r2.ww ? r5.yw : 0;
    r4.xyz = r2.www ? r7.xyz : r3.wxz;
    r1.w = cmp(0 < VC_ForceParam.PointWindDirAndEnable[r0.y].w);
    r3.x = dot(VC_ForceParam.PointWindDirAndEnable[r0.y].xyz, VC_ForceParam.PointWindDirAndEnable[r0.y].xyz);
    r3.x = cmp(0 < r3.x);
    r3.y = dot(VC_ForceParam.PointWindDirAndEnable[r0.y].xz, VC_ForceParam.PointWindDirAndEnable[r0.y].xz);
    r3.y = rsqrt(r3.y);
    r3.yz = VC_ForceParam.PointWindDirAndEnable[r0.y].xz * r3.yy;
    r3.xy = r3.xx ? r3.yz : 0;
    r6.w = dot(r3.xy, r5.yw);
    r3.z = saturate(r6.w * 0.800000012 + 0.200000003);
    r5.yw = r1.ww ? r3.xy : r5.yw;
    r3.xyz = r1.www ? r3.xyz : r4.yzw;
    r1.w = max(0.00100000005, r6.y);
    r1.w = r4.x / r1.w;
    r1.w = min(1, r1.w);
    r1.w = 1 + -r1.w;
    r1.w = r1.w * r3.z;
    r3.z = cmp(0 < r1.w);
    r4.y = VC_ForceParam.PointWindPositionAndTime[r0.y].w * 10;
    r4.x = r4.x * -2 + r4.y;
    r4.x = 0.159154937 * r4.x;
    r4.y = cmp(r4.x >= -r4.x);
    r4.x = frac(abs(r4.x));
    r4.x = r4.y ? r4.x : -r4.x;
    r4.x = 6.28318548 * r4.x;
    r4.x = sin(r4.x);
    r3.xy = float2(10,10) * r3.xy;
    r3.xy = v4.yy * r3.xy;
    r4.yz = r3.xy * r6.xx;
    r4.yz = r4.yz * r1.ww;
    r3.xy = VC_ForceParam.WindAttractionParam[r0.y].xx * r3.xy;
    r6.x = r1.w * r6.x;
    r5.yw = r6.xx * r5.yw;
    r6.x = 1 + -r4.x;
    r4.x = r6.z * r6.x + r4.x;
    r4.xy = r5.yw * r4.xx + r4.yz;
    r3.xy = r3.xy * r1.ww + r4.xy;
    r3.xy = r3.zz ? r3.xy : 0;
    r3.xy = r2.ww ? r3.xy : 0;
    r1.zw = r1.zz ? r3.xy : 0;
    r5.xz = r1.zw * r0.xx + r5.xz;
    r0.y = (int)r0.y + 1;
  }
  r0.xy = r5.xz * r5.xz + float2(1,1);
  r0.xy = sqrt(r0.xy);
  r0.xz = r5.xz / r0.xy;
  r0.w = dot(r0.xz, r0.xz);
  r0.w = 1 + -r0.w;
  r0.w = max(0, r0.w);
  r0.w = sqrt(r0.w);
  r0.y = -1 + r0.w;
  r0.w = VC_ModelSizeParam.y * v4.y;
  r0.xyz = r0.xyz * r0.www + r2.xyz;
  r0.xyz = -SC_CameraPos.xyz + r0.xyz;
  r0.w = 1;
  r1.x = dot(r0.xyzw, VC_MatrixViewProj._m00_m10_m20_m30);
  r1.y = dot(r0.xyzw, VC_MatrixViewProj._m01_m11_m21_m31);
  r1.z = dot(r0.xyzw, VC_MatrixViewProj._m02_m12_m22_m32);
  r1.w = dot(r0.xyzw, VC_MatrixViewProj._m03_m13_m23_m33);
  o4.x = dot(r1.xyzw, VC_ClipPlane.xyzw);
  p4.x = dot(r1.xyzw, VC_InstanceData[0].userClipPlane.xyzw);
  o0.xyzw = r1.xyzw;
  o1.w = 0;
  o2.xyzw = v2.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 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
//   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 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
// ------------------------------ ---------- ------- ----------- ---- --------
// cbInstanceData                    cbuffer      NA          NA    4        1
// cbObjMatrix                       cbuffer      NA          NA    5        1
// cbvModelParam                     cbuffer      NA          NA    7        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   xyzw
// COLOR                    1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xy          3     NONE     int   xy  
// TEXCOORD                 1   xyzw        4     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
// COLOR                    1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 4   xy          3     NONE   float   xy  
// 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[28], immediateIndexed
dcl_constantbuffer cb4[6], immediateIndexed
dcl_constantbuffer cb7[44], dynamicIndexed
dcl_constantbuffer cb5[6], dynamicIndexed
dcl_constantbuffer cb11[1], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xyzw
dcl_input v2.xyzw
dcl_input v3.xy
dcl_input v4.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xy
dcl_output_siv o4.x, clip_distance
dcl_output_siv o4.y, clip_distance
dcl_temps 8
iadd r0.x, v1.w, cb4[5].x
imul null, r0.x, r0.x, l(3)
mov r1.xyz, v0.xyzx
mov r1.w, l(1.000000)
dp4 r2.x, r1.xyzw, cb5[r0.x + 0].xyzw
dp4 r2.y, r1.xyzw, cb5[r0.x + 1].xyzw
dp4 r2.z, r1.xyzw, cb5[r0.x + 2].xyzw
utof r0.yzw, v1.xxyz
add r0.yzw, r0.yyzw, l(0.000000, -127.000000, -127.000000, -127.000000)
mul r0.yzw, r0.yyzw, l(0.000000, 0.007874, 0.007874, 0.007874)
dp3 o1.x, r0.yzwy, cb5[r0.x + 0].xyzx
dp3 o1.y, r0.yzwy, cb5[r0.x + 1].xyzx
dp3 o1.z, r0.yzwy, cb5[r0.x + 2].xyzx
itof r0.xy, v3.xyxx
mul r0.xy, r0.xyxx, cb11[0].xyxx
mad o3.xy, r0.xyxx, l(0.000488, 0.000488, 0.000000, 0.000000), cb11[0].zwzz
sqrt r0.x, cb7[43].y
div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
imin r0.yz, l(0, 4, 4, 0), cb7[8].xxyx
dp2 r0.w, r2.xzxx, r2.xzxx
sqrt r0.w, r0.w
mov r1.xyz, l(0,0,0,0)
loop 
  ige r1.w, r1.z, r0.y
  breakc_nz r1.w
  mul r1.w, cb7[r1.z + 9].w, cb7[r1.z + 25].z
  mad r1.w, r0.w, cb7[r1.z + 25].w, r1.w
  mul r1.w, r1.w, l(0.000442)
  ge r2.w, r1.w, -r1.w
  frc r1.w, |r1.w|
  movc r1.w, r2.w, r1.w, -r1.w
  mad r1.w, r1.w, l(6.283185), l(-3.141593)
  sincos r1.w, null, r1.w
  mad r1.w, r1.w, l(0.500000), l(0.500000)
  mul r2.w, r1.w, r1.w
  mul r2.w, r1.w, r2.w
  mad r3.x, r1.w, l(6.000000), l(-15.000000)
  mad r1.w, r1.w, r3.x, l(10.000000)
  mul r1.w, r1.w, r2.w
  add r2.w, -cb7[r1.z + 25].x, cb7[r1.z + 25].y
  mad r1.w, r1.w, r2.w, cb7[r1.z + 25].x
  mul r3.xyz, r1.wwww, cb7[r1.z + 9].xyzx
  add r4.xyz, r2.xyzx, -cb7[r1.z + 21].xyzx
  dp3 r1.w, r4.xyzx, r4.xyzx
  lt r2.w, l(0.000000), r1.w
  sqrt r1.w, r1.w
  and r1.w, r1.w, r2.w
  lt r2.w, l(0.000000), cb7[r1.z + 21].w
  max r3.w, l(0.000100), cb7[r1.z + 21].w
  div r1.w, r1.w, r3.w
  add r1.w, -r1.w, l(1.000000)
  max r1.w, r1.w, l(0.000000)
  movc r1.w, r2.w, r1.w, l(1.000000)
  lt r2.w, l(0.000000), cb7[r1.z + 9].w
  dp3 r3.w, r3.xyzx, r3.xyzx
  lt r4.x, l(0.000000), r3.w
  rsq r3.w, r3.w
  mul r4.yzw, r3.wwww, r3.xxyz
  and r4.xyz, r4.yzwy, r4.xxxx
  dp3 r3.y, r4.xyzx, r2.xyzx
  mad r3.y, v4.x, l(6.283185), -r3.y
  mul r3.w, v4.z, cb7[r1.z + 9].w
  mad r3.y, r3.w, l(10.000000), r3.y
  mul r3.y, r3.y, l(0.159155)
  ge r3.w, r3.y, -r3.y
  frc r3.y, |r3.y|
  movc r3.y, r3.w, r3.y, -r3.y
  mul r3.y, r3.y, l(6.283185)
  sincos r3.y, null, r3.y
  mul r4.xy, r1.wwww, r3.xzxx
  mul r4.xy, r4.xyxx, v4.yyyy
  mul r4.xy, r4.xyxx, l(10.000000, 10.000000, 0.000000, 0.000000)
  mul r3.xy, r3.yyyy, r3.xzxx
  mad r3.xy, r3.xyxx, r1.wwww, r4.xyxx
  and r3.xy, r2.wwww, r3.xyxx
  mad r1.xy, r3.xyxx, r0.xxxx, r1.xyxx
  iadd r1.z, r1.z, l(1)
endloop 
mov r3.w, l(0)
mov r4.w, l(1.000000)
mov r5.xz, r1.xxyx
mov r0.y, l(0)
loop 
  ige r1.z, r0.y, r0.z
  breakc_nz r1.z
  mul r1.z, cb7[r0.y + 13].w, cb7[r0.y + 29].z
  mad r1.z, r0.w, cb7[r0.y + 29].w, r1.z
  mul r1.z, r1.z, l(0.000442)
  ge r1.w, r1.z, -r1.z
  frc r1.z, |r1.z|
  movc r1.z, r1.w, r1.z, -r1.z
  mad r1.z, r1.z, l(6.283185), l(-3.141593)
  sincos r1.z, null, r1.z
  mad r1.z, r1.z, l(0.500000), l(0.500000)
  mul r1.w, r1.z, r1.z
  mul r1.w, r1.z, r1.w
  mad r2.w, r1.z, l(6.000000), l(-15.000000)
  mad r1.z, r1.z, r2.w, l(10.000000)
  mul r1.z, r1.z, r1.w
  add r1.w, -cb7[r0.y + 29].x, cb7[r0.y + 29].y
  mad r1.z, r1.z, r1.w, cb7[r0.y + 29].x
  mul r6.xyz, r1.zzzz, cb7[r0.y + 17].xyzx
  lt r1.z, l(0.000000), cb7[r0.y + 13].w
  add r3.xyz, r2.xyzx, -cb7[r0.y + 13].xyzx
  dp3 r1.w, r3.xyzx, r3.xyzx
  lt r2.w, l(0.000000), r1.w
  rsq r3.y, r1.w
  mul r7.yz, r3.yyyy, r3.xxzx
  sqrt r7.x, r1.w
  dp2 r1.w, r3.xzxx, r3.xzxx
  rsq r1.w, r1.w
  mul r5.yw, r1.wwww, r3.xxxz
  and r5.yw, r2.wwww, r5.yyyw
  movc r4.xyz, r2.wwww, r7.xyzx, r3.wxzw
  lt r1.w, l(0.000000), cb7[r0.y + 33].w
  dp3 r3.x, cb7[r0.y + 33].xyzx, cb7[r0.y + 33].xyzx
  lt r3.x, l(0.000000), r3.x
  dp2 r3.y, cb7[r0.y + 33].xzxx, cb7[r0.y + 33].xzxx
  rsq r3.y, r3.y
  mul r3.yz, r3.yyyy, cb7[r0.y + 33].xxzx
  and r3.xy, r3.yzyy, r3.xxxx
  dp2 r6.w, r3.xyxx, r5.ywyy
  mad_sat r3.z, r6.w, l(0.800000), l(0.200000)
  movc r5.yw, r1.wwww, r3.xxxy, r5.yyyw
  movc r3.xyz, r1.wwww, r3.xyzx, r4.yzwy
  max r1.w, r6.y, l(0.001000)
  div r1.w, r4.x, r1.w
  min r1.w, r1.w, l(1.000000)
  add r1.w, -r1.w, l(1.000000)
  mul r1.w, r3.z, r1.w
  lt r3.z, l(0.000000), r1.w
  mul r4.y, l(10.000000), cb7[r0.y + 13].w
  mad r4.x, r4.x, l(-2.000000), r4.y
  mul r4.x, r4.x, l(0.159155)
  ge r4.y, r4.x, -r4.x
  frc r4.x, |r4.x|
  movc r4.x, r4.y, r4.x, -r4.x
  mul r4.x, r4.x, l(6.283185)
  sincos r4.x, null, r4.x
  mul r3.xy, r3.xyxx, l(10.000000, 10.000000, 0.000000, 0.000000)
  mul r3.xy, r3.xyxx, v4.yyyy
  mul r4.yz, r6.xxxx, r3.xxyx
  mul r4.yz, r1.wwww, r4.yyzy
  mul r3.xy, r3.xyxx, cb7[r0.y + 37].xxxx
  mul r6.x, r6.x, r1.w
  mul r5.yw, r5.yyyw, r6.xxxx
  add r6.x, -r4.x, l(1.000000)
  mad r4.x, r6.z, r6.x, r4.x
  mad r4.xy, r5.ywyy, r4.xxxx, r4.yzyy
  mad r3.xy, r3.xyxx, r1.wwww, r4.xyxx
  and r3.xy, r3.xyxx, r3.zzzz
  and r3.xy, r2.wwww, r3.xyxx
  and r1.zw, r1.zzzz, r3.xxxy
  mad r5.xz, r1.zzwz, r0.xxxx, r5.xxzx
  iadd r0.y, r0.y, l(1)
endloop 
mad r0.xy, r5.xzxx, r5.xzxx, l(1.000000, 1.000000, 0.000000, 0.000000)
sqrt r0.xy, r0.xyxx
div r0.xz, r5.xxzx, r0.xxyx
dp2 r0.w, r0.xzxx, r0.xzxx
add r0.w, -r0.w, l(1.000000)
max r0.w, r0.w, l(0.000000)
sqrt r0.w, r0.w
add r0.y, r0.w, l(-1.000000)
mul r0.w, v4.y, cb7[43].y
mad r0.xyz, r0.xyzx, r0.wwww, r2.xyzx
add r0.xyz, r0.xyzx, -cb8[3].xyzx
mov r0.w, l(1.000000)
dp4 r1.x, r0.xyzw, cb8[24].xyzw
dp4 r1.y, r0.xyzw, cb8[25].xyzw
dp4 r1.z, r0.xyzw, cb8[26].xyzw
dp4 r1.w, r0.xyzw, cb8[27].xyzw
dp4 o4.x, r1.xyzw, cb8[4].xyzw
dp4 o4.y, r1.xyzw, cb4[4].xyzw
mov o0.xyzw, r1.xyzw
mov o1.w, l(0)
mov o2.xyzw, v2.xyzw
ret 
// Approximately 178 instruction slots used

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