//Bushes 3
cbuffer rage_matrices : register(b1)
{
  row_major float4x4 gWorld : packoffset(c0);
  row_major float4x4 gWorldView : packoffset(c4);
  row_major float4x4 gWorldViewProj : packoffset(c8);
  row_major float4x4 gViewInverse : packoffset(c12);
}

cbuffer misc_globals : register(b2)
{
  float4 globalFade : packoffset(c0);
  float globalHeightScale : packoffset(c1);
  float globalShaderQuality : packoffset(c1.y);
  float globalReuseMe00001 : packoffset(c1.z);
  float globalReuseMe00002 : packoffset(c1.w);
  float4 POMFlags : packoffset(c2);
  float4 g_Rage_Tessellation_CameraPosition : packoffset(c3);
  float4 g_Rage_Tessellation_CameraZAxis : packoffset(c4);
  float4 g_Rage_Tessellation_ScreenSpaceErrorParams : packoffset(c5);
  float4 g_Rage_Tessellation_LinearScale : packoffset(c6);
  float4 g_Rage_Tessellation_Frustum[4] : packoffset(c7);
  float4 g_Rage_Tessellation_Epsilons : packoffset(c11);
  float4 globalScalars : packoffset(c12);
  float4 globalScalars2 : packoffset(c13);
  float4 globalScalars3 : packoffset(c14);
  float4 globalScreenSize : packoffset(c15);
  uint4 gTargetAAParams : packoffset(c16);
  float4 colorize : packoffset(c17);
  float4 gGlobalParticleShadowBias : packoffset(c18);
  float gGlobalParticleDofAlphaScale : packoffset(c19);
  float gGlobalFogIntensity : packoffset(c19.y);
  float4 gPlayerLFootPos : packoffset(c20);
  float4 gPlayerRFootPos : packoffset(c21);
  float4 gStereoParams : packoffset(c22);
  float4 gStereoParams1 : packoffset(c23);
}

cbuffer tri_uMovment_and_branch_bend_shared : register(b11)
{
  float4 branchBendEtc_WindVector[4] : packoffset(c0);
  float4 branchBendEtc_WindSpeedSoftClamp : packoffset(c4);
  float4 branchBendEtc_UnderWaterTransition : packoffset(c5);
  float4 branchBendEtc_AABBInfo[2] : packoffset(c6);
  float4 branchBendEtc_SfxWindEvalModulation : packoffset(c8);
  float4 branchBendEtc_SfxWindValueModulation : packoffset(c9);
  float4 branchBendEtc_Control1Fake : packoffset(c10);
  float4 branchBendEtc_Control2Fake : packoffset(c11);
  float4 branchBendEtc_DebugRenderControl1Fake : packoffset(c12);
  float4 branchBendEtc_DebugRenderControl2Fake : packoffset(c13);
  float4 branchBendEtc_DebugRenderControl3Fake : packoffset(c14);
}

cbuffer playercolenabled_buffer : register(b8)
{
  int bPlayerCollEnabled : packoffset(c0);
  int bVehTreeColl0Enabled : packoffset(c0.y);
  int bVehTreeColl1Enabled : packoffset(c0.z);
  int bVehTreeColl2Enabled : packoffset(c0.w);
  int bVehTreeColl3Enabled : packoffset(c1);
}

cbuffer trees_common_shared_locals : register(b9)
{
  float4 _worldPlayerPos_umGlobalPhaseShift : packoffset(c0);
  float4 _vecvehColl0[3] : packoffset(c1);
  float4 _vecvehColl1[3] : packoffset(c4);
  float4 _vecvehColl2[3] : packoffset(c7);
  float4 _vecvehColl3[3] : packoffset(c10);
  float4 umGlobalOverrideParams : packoffset(c13);
  float4 _globalEntityScale : packoffset(c14);
}

cbuffer trees_common_locals : register(b10)
{
  float bumpiness : packoffset(c0);
  float4 umGlobalParams : packoffset(c1);
  float4 WindGlobalParams : packoffset(c2);
  float UseTreeNormals : packoffset(c3);
  float SelfShadowing : packoffset(c3.y);
  float AlphaScale : packoffset(c3.z);
  float AlphaTest : packoffset(c3.w);
  float ShadowFalloff : packoffset(c4);
  float AlphaScaleNormal : packoffset(c4.y);
  float AlphaClampNormal : packoffset(c4.z);
}
SamplerState SfxWindSampler3D_s : register(s2);
Texture3D<float4> SfxWindSampler3D : register(t2);

Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);

void main( 
  float3 v0 : POSITION0,
  float3 v1 : NORMAL0,
  float4 v2 : COLOR0,
  float4 v3 : COLOR1,
  float2 v4 : TEXCOORD0,
  float4 v5 : TANGENT0,
  out float4 o0 : SV_Position0,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : TEXCOORD1,
  out float4 o3 : TEXCOORD2,
  out float3 o4 : TEXCOORD3)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = gWorld._m10_m11_m12 * v1.yyy;
  r0.xyz = v1.xxx * gWorld._m00_m01_m02 + r0.xyz;
  r0.xyz = v1.zzz * gWorld._m20_m21_m22 + r0.xyz;
  r1.xyz = gWorld._m10_m11_m12 * v5.yyy;
  r1.xyz = v5.xxx * gWorld._m00_m01_m02 + r1.xyz;
  r1.xyz = v5.zzz * gWorld._m20_m21_m22 + r1.xyz;
  r2.xyz = r1.zxy * r0.yzx;
  r2.xyz = r1.yzx * r0.zxy + -r2.xyz;
  o4.xyz = v5.www * r2.xyz;
  r0.w = dot(branchBendEtc_UnderWaterTransition.xyz, v0.xyz);
  r0.w = saturate(branchBendEtc_UnderWaterTransition.w + r0.w);
  r1.w = 0 < r0.w;
  if (r1.w != 0) {
    r1.w = saturate(umGlobalParams.z * branchBendEtc_WindSpeedSoftClamp.z);
    r1.w = 1 + -r1.w;
    r2.x = branchBendEtc_WindVector[1].w * globalScalars2.x;
    r2.y = branchBendEtc_WindVector[2].w * globalScalars2.x;
    r2.xy = v2.yy + r2.xy;
    r2.xy = branchBendEtc_WindVector[3].ww + r2.xy;
    r2.xy = frac(r2.xy);
    r2.xy = float2(-0.5,-0.5) + r2.xy;
    r2.xy = -abs(r2.xy) * float2(2,2) + float2(1,1);
    r2.zw = r2.xy * r2.xy;
    r2.xy = -r2.xy * float2(2,2) + float2(3,3);
    r2.xy = r2.zw * r2.xy;
    r2.xy = r2.xy * float2(2,2) + float2(-1,-1);
    r2.zw = float2(1,1) + -r2.yx;
    r3.x = r2.w * r2.z;
    r2.zw = r2.xy * r2.zw;
    r2.x = r2.x * r2.y;
    r3.yzw = branchBendEtc_WindVector[1].xyz * r2.zzz;
    r3.xyz = r3.xxx * branchBendEtc_WindVector[0].xyz + r3.yzw;
    r2.yzw = r2.www * branchBendEtc_WindVector[2].xyz + r3.xyz;
    r2.xyz = r2.xxx * branchBendEtc_WindVector[3].xyz + r2.yzw;
    r3.xyz = branchBendEtc_SfxWindEvalModulation.xyz * globalScalars2.xxx + v2.yyy;
    r3.xyz = branchBendEtc_WindVector[3].www + r3.xyz;
    r3.xyz = frac(r3.xyz);
    r3.xyz = float3(-0.5,-0.5,-0.5) + r3.xyz;
    r3.xyz = -abs(r3.xyz) * float3(2,2,2) + float3(1,1,1);
    r4.xyz = r3.xyz * r3.xyz;
    r3.xyz = -r3.xyz * float3(2,2,2) + float3(3,3,3);
    r3.xyz = r4.xyz * r3.xyz;
    r2.w = r3.x + r3.x;
    r3.w = 0 < branchBendEtc_AABBInfo[0].w;
    //if (r3.w != 0) {
    //  r3.xyz = r3.xyz * float3(2,2,2) + float3(-1,-1,-1);
    //  r3.xyz = r3.xyz * branchBendEtc_SfxWindEvalModulation.www + v0.xyz;
    //  r3.xyz = -branchBendEtc_AABBInfo[0].xyz + r3.xyz;
    //  r3.xyz = branchBendEtc_AABBInfo[1].xyz * r3.xyz;
    //  r3.xyzw = SfxWindSampler3D.SampleLevel(SfxWindSampler3D_s, r3.xyz, 0).xyzw;
    //} else {
      r3.xyz = float3(0,0,0);
    //}
    r3.w = 1 + -branchBendEtc_SfxWindValueModulation.x;
    r2.w = branchBendEtc_SfxWindValueModulation.x * r2.w;
    r2.w = r2.w * 0.5 + r3.w;
    r2.xyz = r2.www * r3.xyz + r2.xyz;
    r2.w = max(v2.x, v2.z);
    r2.xyz = r2.www * r2.xyz;
    r2.xyz = r2.xyz * r1.www;
    r3.x = dot(gWorld._m00_m01_m02, r2.xyz);
    r3.y = dot(gWorld._m10_m11_m12, r2.xyz);
    r3.z = dot(gWorld._m20_m21_m22, r2.xyz);
    r2.x = dot(v0.xyz, v0.xyz);
    r2.yzw = float3(0.00100000005,0,0) + abs(r3.xyz);
    r2.y = dot(r2.yzw, r2.yzw);
    r2.xy = sqrt(r2.xy);
    r2.zw = branchBendEtc_WindSpeedSoftClamp.xy * r1.ww;
    r1.w = -branchBendEtc_WindSpeedSoftClamp.x * r1.w + r2.y;
    r1.w = max(0, r1.w);
    r1.w = r1.w / r2.w;
    r1.w = -1.44269502 * r1.w;
    r1.w = exp2(r1.w);
    r1.w = 1 + -r1.w;
    r1.w = r2.w * r1.w + r2.z;
    r1.w = r1.w / r2.y;
    r2.y = r2.z >= r2.y;
    r2.y = r2.y ? 1.000000 : 0;
    r2.z = 1 + -r1.w;
    r1.w = r2.z * r2.y + r1.w;
    r2.yzw = r3.xyz * r1.www + v0.xyz;
    r1.w = dot(r2.yzw, r2.yzw);
    r1.w = sqrt(r1.w);
    r1.w = r2.x / r1.w;
    r2.xyz = r2.yzw * r1.www;
  } else {
    r2.xyz = v0.xyz;
  }
  r1.w = r0.w < 1;
  r3.xyz = umGlobalParams.xxy * v2.xxz;
  r3.xyz = umGlobalOverrideParams.xxy * r3.xyz;
  r2.w = _worldPlayerPos_umGlobalPhaseShift.w + v2.y;
  r2.w = 6.28318501 * abs(r2.w);
  r4.xyz = umGlobalParams.zzw * umGlobalOverrideParams.zzw;
  r4.xyz = globalScalars2.xxx * r4.xyz + r2.www;
  r4.xyz = sin(r4.xyz);
  r3.xyz = r4.xyz * r3.xyz + v0.xyz;
  r3.xyz = r1.www ? r3.xyz : v0.xyz;
  r1.w = 1 + -r0.w;
  r2.xyz = r2.xyz * r0.www;
  r2.xyz = r1.www * r3.xyz + r2.xyz;
  r3.xyz = _globalEntityScale.zzz * gWorld._m00_m01_m02;
  r4.xyz = _globalEntityScale.zzz * gWorld._m10_m11_m12;
  r5.xyz = _globalEntityScale.www * gWorld._m20_m21_m22;
  r6.xyz = _globalEntityScale.xxy * r2.xyz;
  r6.w = 1;
  r7.x = r3.x;
  r7.y = r4.x;
  r7.z = r5.x;
  r7.w = gWorld._m30;
  r8.x = dot(r6.xyzw, r7.xyzw);
  r9.x = r3.y;
  r9.y = r4.y;
  r9.z = r5.y;
  r9.w = gWorld._m31;
  r8.y = dot(r6.xyzw, r9.xyzw);
  r10.x = r3.z;
  r10.y = r4.z;
  r10.z = r5.z;
  r10.w = gWorld._m32;
  r8.z = dot(r6.xyzw, r10.xyzw);
  r6.xyz = -_worldPlayerPos_umGlobalPhaseShift.xyz + r8.xyz;
  r0.w = dot(r6.xyz, r6.xyz);
  r1.w = 0.5625 + -r0.w;
  r1.w = 1.77777779 * r1.w;
  r1.w = max(0, r1.w);
  r0.w = rsqrt(r0.w);
  r6.xy = r6.xy * r0.ww;
  r6.xy = r6.xy * r1.ww;
  r8.xy = r6.xy * v2.xx + r8.xy;
  r6.xyz = -gWorld._m30_m31_m32 + r8.xyz;
  r6.xyz = _globalEntityScale.zzw * r6.xyz;
  r8.x = dot(r6.xyz, r3.xyz);
  r8.y = dot(r6.xyz, r4.xyz);
  r8.z = dot(r6.xyz, r5.xyz);
  r2.xyz = bPlayerCollEnabled ? r8.xyz : r2.xyz;
  if (bVehTreeColl0Enabled != 0) {
    r6.xyz = _globalEntityScale.xxy * r2.xyz;
    r6.w = 1;
    r7.x = dot(r6.xyzw, r7.xyzw);
    r7.y = dot(r6.xyzw, r9.xyzw);
    r0.w = dot(r6.xyzw, r10.xyzw);
    r6.xy = -_vecvehColl0[0].xy + r7.xy;
    r1.w = dot(_vecvehColl0[1].xy, r6.xy);
    r1.w = saturate(_vecvehColl0[1].w * r1.w);
    r6.xy = r1.ww * _vecvehColl0[1].xy + _vecvehColl0[0].xy;
    r6.xy = r7.xy + -r6.xy;
    r1.w = dot(r6.xy, r6.xy);
    r2.w = _vecvehColl0[2].y + -r1.w;
    r2.w = saturate(_vecvehColl0[2].z * r2.w);
    r3.w = _vecvehColl0[2].x * r2.w;
    r4.w = rsqrt(r1.w);
    r6.xy = r6.xy * r4.ww;
    r6.xy = r6.xy * r3.ww;
    r6.xy = r6.xy * v2.xx + r7.xy;
    r3.w = _vecvehColl0[2].w + -r0.w;
    r0.w = r2.w * r3.w + r0.w;
    r2.w = 0.5 * _vecvehColl0[2].x;
    r2.w = r2.w * r2.w;
    r1.w = r1.w < r2.w;
    r2.w = -0.25 + _vecvehColl0[2].w;
    r6.z = r1.w ? r2.w : r0.w;
    if (bVehTreeColl1Enabled != 0) {
      r7.xy = -_vecvehColl1[0].xy + r6.xy;
      r0.w = dot(_vecvehColl1[1].xy, r7.xy);
      r0.w = saturate(_vecvehColl1[1].w * r0.w);
      r7.xy = r0.ww * _vecvehColl1[1].xy + _vecvehColl1[0].xy;
      r7.xy = -r7.xy + r6.xy;
      r0.w = dot(r7.xy, r7.xy);
      r1.w = _vecvehColl1[2].y + -r0.w;
      r1.w = saturate(_vecvehColl1[2].z * r1.w);
      r2.w = _vecvehColl1[2].x * r1.w;
      r3.w = rsqrt(r0.w);
      r7.xy = r7.xy * r3.ww;
      r7.xy = r7.xy * r2.ww;
      r6.xy = r7.xy * v2.xx + r6.xy;
      r2.w = _vecvehColl1[2].w + -r6.z;
      r1.w = r1.w * r2.w + r6.z;
      r2.w = 0.5 * _vecvehColl1[2].x;
      r2.w = r2.w * r2.w;
      r0.w = r0.w < r2.w;
      r2.w = -0.25 + _vecvehColl1[2].w;
      r6.z = r0.w ? r2.w : r1.w;
    }
    if (bVehTreeColl2Enabled != 0) {
      r7.xy = -_vecvehColl2[0].xy + r6.xy;
      r0.w = dot(_vecvehColl2[1].xy, r7.xy);
      r0.w = saturate(_vecvehColl2[1].w * r0.w);
      r7.xy = r0.ww * _vecvehColl2[1].xy + _vecvehColl2[0].xy;
      r7.xy = -r7.xy + r6.xy;
      r0.w = dot(r7.xy, r7.xy);
      r1.w = _vecvehColl2[2].y + -r0.w;
      r1.w = saturate(_vecvehColl2[2].z * r1.w);
      r2.w = _vecvehColl2[2].x * r1.w;
      r3.w = rsqrt(r0.w);
      r7.xy = r7.xy * r3.ww;
      r7.xy = r7.xy * r2.ww;
      r6.xy = r7.xy * v2.xx + r6.xy;
      r2.w = _vecvehColl2[2].w + -r6.z;
      r1.w = r1.w * r2.w + r6.z;
      r2.w = 0.5 * _vecvehColl2[2].x;
      r2.w = r2.w * r2.w;
      r0.w = r0.w < r2.w;
      r2.w = -0.25 + _vecvehColl2[2].w;
      r6.z = r0.w ? r2.w : r1.w;
    }
    if (bVehTreeColl3Enabled != 0) {
      r7.xy = -_vecvehColl3[0].xy + r6.xy;
      r0.w = dot(_vecvehColl3[1].xy, r7.xy);
      r0.w = saturate(_vecvehColl3[1].w * r0.w);
      r7.xy = r0.ww * _vecvehColl3[1].xy + _vecvehColl3[0].xy;
      r7.xy = -r7.xy + r6.xy;
      r0.w = dot(r7.xy, r7.xy);
      r1.w = _vecvehColl3[2].y + -r0.w;
      r1.w = saturate(_vecvehColl3[2].z * r1.w);
      r2.w = _vecvehColl3[2].x * r1.w;
      r3.w = rsqrt(r0.w);
      r7.xy = r7.xy * r3.ww;
      r7.xy = r7.xy * r2.ww;
      r6.xy = r7.xy * v2.xx + r6.xy;
      r2.w = _vecvehColl3[2].w + -r6.z;
      r1.w = r1.w * r2.w + r6.z;
      r2.w = 0.5 * _vecvehColl3[2].x;
      r2.w = r2.w * r2.w;
      r0.w = r0.w < r2.w;
      r2.w = -0.25 + _vecvehColl3[2].w;
      r6.z = r0.w ? r2.w : r1.w;
    }
    r6.xyz = -gWorld._m30_m31_m32 + r6.xyz;
    r6.xyz = _globalEntityScale.zzw * r6.xyz;
    r2.x = dot(r6.xyz, r3.xyz);
    r2.y = dot(r6.xyz, r4.xyz);
    r2.z = dot(r6.xyz, r5.xyz);
  }
  r3.xyzw = gWorldViewProj._m10_m11_m12_m13 * r2.yyyy;
  r3.xyzw = r2.xxxx * gWorldViewProj._m00_m01_m02_m03 + r3.xyzw;
  r2.xyzw = r2.zzzz * gWorldViewProj._m20_m21_m22_m23 + r3.xyzw;
  o0.xyzw = gWorldViewProj._m30_m31_m32_m33 + r2.xyzw;
  o1.xy = v4.xy;
  o1.z = v2.w;
  o1.w = SelfShadowing;
  o2.xyz = r0.xyz;
  o3.xyz = r1.xyz;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.1.36 on Sat Aug 08 07:25:19 2015
//
//
// Buffer Definitions: 
//
// cbuffer rage_matrices
// {
//
//   row_major float4x4 gWorld;         // Offset:    0 Size:    64
//   row_major float4x4 gWorldView;     // Offset:   64 Size:    64 [unused]
//   row_major float4x4 gWorldViewProj; // Offset:  128 Size:    64
//   row_major float4x4 gViewInverse;   // Offset:  192 Size:    64 [unused]
//
// }
//
// cbuffer misc_globals
// {
//
//   float4 globalFade;                 // Offset:    0 Size:    16 [unused]
//   float globalHeightScale;           // Offset:   16 Size:     4 [unused]
//   float globalShaderQuality;         // Offset:   20 Size:     4 [unused]
//   float globalReuseMe00001;          // Offset:   24 Size:     4 [unused]
//   float globalReuseMe00002;          // Offset:   28 Size:     4 [unused]
//   float4 POMFlags;                   // Offset:   32 Size:    16 [unused]
//   float4 g_Rage_Tessellation_CameraPosition;// Offset:   48 Size:    16 [unused]
//   float4 g_Rage_Tessellation_CameraZAxis;// Offset:   64 Size:    16 [unused]
//   float4 g_Rage_Tessellation_ScreenSpaceErrorParams;// Offset:   80 Size:    16 [unused]
//   float4 g_Rage_Tessellation_LinearScale;// Offset:   96 Size:    16 [unused]
//   float4 g_Rage_Tessellation_Frustum[4];// Offset:  112 Size:    64 [unused]
//   float4 g_Rage_Tessellation_Epsilons;// Offset:  176 Size:    16 [unused]
//   float4 globalScalars;              // Offset:  192 Size:    16 [unused]
//   float4 globalScalars2;             // Offset:  208 Size:    16
//   float4 globalScalars3;             // Offset:  224 Size:    16 [unused]
//   float4 globalScreenSize;           // Offset:  240 Size:    16 [unused]
//   uint4 gTargetAAParams;             // Offset:  256 Size:    16 [unused]
//   float4 colorize;                   // Offset:  272 Size:    16 [unused]
//   float4 gGlobalParticleShadowBias;  // Offset:  288 Size:    16 [unused]
//   float gGlobalParticleDofAlphaScale;// Offset:  304 Size:     4 [unused]
//   float gGlobalFogIntensity;         // Offset:  308 Size:     4 [unused]
//   float4 gPlayerLFootPos;            // Offset:  320 Size:    16 [unused]
//   float4 gPlayerRFootPos;            // Offset:  336 Size:    16 [unused]
//   float4 gStereoParams;              // Offset:  352 Size:    16 [unused]
//   float4 gStereoParams1;             // Offset:  368 Size:    16 [unused]
//
// }
//
// cbuffer tri_uMovment_and_branch_bend_shared
// {
//
//   float4 branchBendEtc_WindVector[4];// Offset:    0 Size:    64
//   float4 branchBendEtc_WindSpeedSoftClamp;// Offset:   64 Size:    16
//   float4 branchBendEtc_UnderWaterTransition;// Offset:   80 Size:    16
//   float4 branchBendEtc_AABBInfo[2];  // Offset:   96 Size:    32
//   float4 branchBendEtc_SfxWindEvalModulation;// Offset:  128 Size:    16
//   float4 branchBendEtc_SfxWindValueModulation;// Offset:  144 Size:    16
//   float4 branchBendEtc_Control1Fake; // Offset:  160 Size:    16 [unused]
//   float4 branchBendEtc_Control2Fake; // Offset:  176 Size:    16 [unused]
//   float4 branchBendEtc_DebugRenderControl1Fake;// Offset:  192 Size:    16 [unused]
//   float4 branchBendEtc_DebugRenderControl2Fake;// Offset:  208 Size:    16 [unused]
//   float4 branchBendEtc_DebugRenderControl3Fake;// Offset:  224 Size:    16 [unused]
//
// }
//
// cbuffer playercolenabled_buffer
// {
//
//   int bPlayerCollEnabled;            // Offset:    0 Size:     4
//   int bVehTreeColl0Enabled;          // Offset:    4 Size:     4
//   int bVehTreeColl1Enabled;          // Offset:    8 Size:     4
//   int bVehTreeColl2Enabled;          // Offset:   12 Size:     4
//   int bVehTreeColl3Enabled;          // Offset:   16 Size:     4
//
// }
//
// cbuffer trees_common_shared_locals
// {
//
//   float4 _worldPlayerPos_umGlobalPhaseShift;// Offset:    0 Size:    16
//   float4 _vecvehColl0[3];            // Offset:   16 Size:    48
//   float4 _vecvehColl1[3];            // Offset:   64 Size:    48
//   float4 _vecvehColl2[3];            // Offset:  112 Size:    48
//   float4 _vecvehColl3[3];            // Offset:  160 Size:    48
//   float4 umGlobalOverrideParams;     // Offset:  208 Size:    16
//   float4 _globalEntityScale;         // Offset:  224 Size:    16
//
// }
//
// cbuffer trees_common_locals
// {
//
//   float bumpiness;                   // Offset:    0 Size:     4 [unused]
//   float4 umGlobalParams;             // Offset:   16 Size:    16
//   float4 WindGlobalParams;           // Offset:   32 Size:    16 [unused]
//   float UseTreeNormals;              // Offset:   48 Size:     4 [unused]
//   float SelfShadowing;               // Offset:   52 Size:     4
//   float AlphaScale;                  // Offset:   56 Size:     4 [unused]
//   float AlphaTest;                   // Offset:   60 Size:     4 [unused]
//   float ShadowFalloff;               // Offset:   64 Size:     4 [unused]
//   float AlphaScaleNormal;            // Offset:   68 Size:     4 [unused]
//   float AlphaClampNormal;            // Offset:   72 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SfxWindSampler3D                  sampler      NA          NA    2        1
// SfxWindSampler3D                  texture  float4          3d    2        1
// rage_matrices                     cbuffer      NA          NA    1        1
// misc_globals                      cbuffer      NA          NA    2        1
// playercolenabled_buffer           cbuffer      NA          NA    8        1
// trees_common_shared_locals        cbuffer      NA          NA    9        1
// trees_common_locals               cbuffer      NA          NA   10        1
// tri_uMovment_and_branch_bend_shared    cbuffer      NA          NA   11        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz 
// NORMAL                   0   xyz         1     NONE   float   xyz 
// COLOR                    0   xyzw        2     NONE   float   xyzw
// COLOR                    1   xyzw        3     NONE   float       
// TEXCOORD                 0   xy          4     NONE   float   xy  
// TANGENT                  0   xyzw        5     NONE   float   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                 1   xyz         2     NONE   float   xyz 
// TEXCOORD                 2   xyz         3     NONE   float   xyz 
// TEXCOORD                 3   xyz         4     NONE   float   xyz 
//
vs_4_0
dcl_constantbuffer cb1[12], immediateIndexed
dcl_constantbuffer cb2[14], immediateIndexed
dcl_constantbuffer cb11[10], immediateIndexed
dcl_constantbuffer cb8[2], immediateIndexed
dcl_constantbuffer cb9[15], immediateIndexed
dcl_constantbuffer cb10[4], immediateIndexed
dcl_sampler s2, mode_default
dcl_resource_texture3d (float,float,float,float) t2
dcl_input v0.xyz
dcl_input v1.xyz
dcl_input v2.xyzw
dcl_input v4.xy
dcl_input v5.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyz
dcl_output o3.xyz
dcl_output o4.xyz
dcl_temps 11
mul r0.xyz, v1.yyyy, cb1[1].xyzx
mad r0.xyz, v1.xxxx, cb1[0].xyzx, r0.xyzx
mad r0.xyz, v1.zzzz, cb1[2].xyzx, r0.xyzx
mul r1.xyz, v5.yyyy, cb1[1].xyzx
mad r1.xyz, v5.xxxx, cb1[0].xyzx, r1.xyzx
mad r1.xyz, v5.zzzz, cb1[2].xyzx, r1.xyzx
mul r2.xyz, r0.yzxy, r1.zxyz
mad r2.xyz, r1.yzxy, r0.zxyz, -r2.xyzx
mul o4.xyz, r2.xyzx, v5.wwww
dp3 r0.w, cb11[5].xyzx, v0.xyzx
add_sat r0.w, r0.w, cb11[5].w
lt r1.w, l(0.000000), r0.w
if_nz r1.w
  mul_sat r1.w, cb11[4].z, cb10[1].z
  add r1.w, -r1.w, l(1.000000)
  mul r2.x, cb2[13].x, cb11[1].w
  mul r2.y, cb2[13].x, cb11[2].w
  add r2.xy, r2.xyxx, v2.yyyy
  add r2.xy, r2.xyxx, cb11[3].wwww
  frc r2.xy, r2.xyxx
  add r2.xy, r2.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
  mad r2.xy, -|r2.xyxx|, l(2.000000, 2.000000, 0.000000, 0.000000), l(1.000000, 1.000000, 0.000000, 0.000000)
  mul r2.zw, r2.xxxy, r2.xxxy
  mad r2.xy, -r2.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(3.000000, 3.000000, 0.000000, 0.000000)
  mul r2.xy, r2.xyxx, r2.zwzz
  mad r2.xy, r2.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
  add r2.zw, -r2.yyyx, l(0.000000, 0.000000, 1.000000, 1.000000)
  mul r3.x, r2.z, r2.w
  mul r2.zw, r2.zzzw, r2.xxxy
  mul r2.x, r2.y, r2.x
  mul r3.yzw, r2.zzzz, cb11[1].xxyz
  mad r3.xyz, r3.xxxx, cb11[0].xyzx, r3.yzwy
  mad r2.yzw, r2.wwww, cb11[2].xxyz, r3.xxyz
  mad r2.xyz, r2.xxxx, cb11[3].xyzx, r2.yzwy
  mad r3.xyz, cb11[8].xyzx, cb2[13].xxxx, v2.yyyy
  add r3.xyz, r3.xyzx, cb11[3].wwww
  frc r3.xyz, r3.xyzx
  add r3.xyz, r3.xyzx, l(-0.500000, -0.500000, -0.500000, 0.000000)
  mad r3.xyz, -|r3.xyzx|, l(2.000000, 2.000000, 2.000000, 0.000000), l(1.000000, 1.000000, 1.000000, 0.000000)
  mul r4.xyz, r3.xyzx, r3.xyzx
  mad r3.xyz, -r3.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(3.000000, 3.000000, 3.000000, 0.000000)
  mul r3.xyz, r3.xyzx, r4.xyzx
  add r2.w, r3.x, r3.x
  lt r3.w, l(0.000000), cb11[6].w
  if_nz r3.w
    mad r3.xyz, r3.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
    mad r3.xyz, r3.xyzx, cb11[8].wwww, v0.xyzx
    add r3.xyz, r3.xyzx, -cb11[6].xyzx
    mul r3.xyz, r3.xyzx, cb11[7].xyzx
    sample_l r3.xyzw, r3.xyzx, t2.xyzw, s2, l(0.000000)
  else 
    mov r3.xyz, l(0,0,0,0)
  endif 
  add r3.w, -cb11[9].x, l(1.000000)
  mul r2.w, r2.w, cb11[9].x
  mad r2.w, r2.w, l(0.500000), r3.w
  mad r2.xyz, r2.wwww, r3.xyzx, r2.xyzx
  max r2.w, v2.z, v2.x
  mul r2.xyz, r2.xyzx, r2.wwww
  mul r2.xyz, r1.wwww, r2.xyzx
  dp3 r3.x, cb1[0].xyzx, r2.xyzx
  dp3 r3.y, cb1[1].xyzx, r2.xyzx
  dp3 r3.z, cb1[2].xyzx, r2.xyzx
  dp3 r2.x, v0.xyzx, v0.xyzx
  add r2.yzw, |r3.xxyz|, l(0.000000, 0.001000, 0.000000, 0.000000)
  dp3 r2.y, r2.yzwy, r2.yzwy
  sqrt r2.xy, r2.xyxx
  mul r2.zw, r1.wwww, cb11[4].xxxy
  mad r1.w, -cb11[4].x, r1.w, r2.y
  max r1.w, r1.w, l(0.000000)
  div r1.w, r1.w, r2.w
  mul r1.w, r1.w, l(-1.442695)
  exp r1.w, r1.w
  add r1.w, -r1.w, l(1.000000)
  mad r1.w, r2.w, r1.w, r2.z
  div r1.w, r1.w, r2.y
  ge r2.y, r2.z, r2.y
  and r2.y, r2.y, l(0x3f800000)
  add r2.z, -r1.w, l(1.000000)
  mad r1.w, r2.z, r2.y, r1.w
  mad r2.yzw, r3.xxyz, r1.wwww, v0.xxyz
  dp3 r1.w, r2.yzwy, r2.yzwy
  sqrt r1.w, r1.w
  div r1.w, r2.x, r1.w
  mul r2.xyz, r1.wwww, r2.yzwy
else 
  mov r2.xyz, v0.xyzx
endif 
lt r1.w, r0.w, l(1.000000)
mul r3.xyz, v2.xxzx, cb10[1].xxyx
mul r3.xyz, r3.xyzx, cb9[13].xxyx
add r2.w, v2.y, cb9[0].w
mul r2.w, |r2.w|, l(6.283185)
mul r4.xyz, cb9[13].zzwz, cb10[1].zzwz
mad r4.xyz, cb2[13].xxxx, r4.xyzx, r2.wwww
sincos r4.xyz, null, r4.xyzx
mad r3.xyz, r4.xyzx, r3.xyzx, v0.xyzx
movc r3.xyz, r1.wwww, r3.xyzx, v0.xyzx
add r1.w, -r0.w, l(1.000000)
mul r2.xyz, r0.wwww, r2.xyzx
mad r2.xyz, r1.wwww, r3.xyzx, r2.xyzx
mul r3.xyz, cb1[0].xyzx, cb9[14].zzzz
mul r4.xyz, cb1[1].xyzx, cb9[14].zzzz
mul r5.xyz, cb1[2].xyzx, cb9[14].wwww
mul r6.xyz, r2.xyzx, cb9[14].xxyx
mov r6.w, l(1.000000)
mov r7.x, r3.x
mov r7.y, r4.x
mov r7.z, r5.x
mov r7.w, cb1[3].x
dp4 r8.x, r6.xyzw, r7.xyzw
mov r9.x, r3.y
mov r9.y, r4.y
mov r9.z, r5.y
mov r9.w, cb1[3].y
dp4 r8.y, r6.xyzw, r9.xyzw
mov r10.x, r3.z
mov r10.y, r4.z
mov r10.z, r5.z
mov r10.w, cb1[3].z
dp4 r8.z, r6.xyzw, r10.xyzw
add r6.xyz, r8.xyzx, -cb9[0].xyzx
dp3 r0.w, r6.xyzx, r6.xyzx
add r1.w, -r0.w, l(0.562500)
mul r1.w, r1.w, l(1.777778)
max r1.w, r1.w, l(0.000000)
rsq r0.w, r0.w
mul r6.xy, r0.wwww, r6.xyxx
mul r6.xy, r1.wwww, r6.xyxx
mad r8.xy, r6.xyxx, v2.xxxx, r8.xyxx
add r6.xyz, r8.xyzx, -cb1[3].xyzx
mul r6.xyz, r6.xyzx, cb9[14].zzwz
dp3 r8.x, r6.xyzx, r3.xyzx
dp3 r8.y, r6.xyzx, r4.xyzx
dp3 r8.z, r6.xyzx, r5.xyzx
movc r2.xyz, cb8[0].xxxx, r8.xyzx, r2.xyzx
if_nz cb8[0].y
  mul r6.xyz, r2.xyzx, cb9[14].xxyx
  mov r6.w, l(1.000000)
  dp4 r7.x, r6.xyzw, r7.xyzw
  dp4 r7.y, r6.xyzw, r9.xyzw
  dp4 r0.w, r6.xyzw, r10.xyzw
  add r6.xy, r7.xyxx, -cb9[1].xyxx
  dp2 r1.w, cb9[2].xyxx, r6.xyxx
  mul_sat r1.w, r1.w, cb9[2].w
  mad r6.xy, r1.wwww, cb9[2].xyxx, cb9[1].xyxx
  add r6.xy, -r6.xyxx, r7.xyxx
  dp2 r1.w, r6.xyxx, r6.xyxx
  add r2.w, -r1.w, cb9[3].y
  mul_sat r2.w, r2.w, cb9[3].z
  mul r3.w, r2.w, cb9[3].x
  rsq r4.w, r1.w
  mul r6.xy, r4.wwww, r6.xyxx
  mul r6.xy, r3.wwww, r6.xyxx
  mad r6.xy, r6.xyxx, v2.xxxx, r7.xyxx
  add r3.w, -r0.w, cb9[3].w
  mad r0.w, r2.w, r3.w, r0.w
  mul r2.w, cb9[3].x, l(0.500000)
  mul r2.w, r2.w, r2.w
  lt r1.w, r1.w, r2.w
  add r2.w, cb9[3].w, l(-0.250000)
  movc r6.z, r1.w, r2.w, r0.w
  if_nz cb8[0].z
    add r7.xy, r6.xyxx, -cb9[4].xyxx
    dp2 r0.w, cb9[5].xyxx, r7.xyxx
    mul_sat r0.w, r0.w, cb9[5].w
    mad r7.xy, r0.wwww, cb9[5].xyxx, cb9[4].xyxx
    add r7.xy, r6.xyxx, -r7.xyxx
    dp2 r0.w, r7.xyxx, r7.xyxx
    add r1.w, -r0.w, cb9[6].y
    mul_sat r1.w, r1.w, cb9[6].z
    mul r2.w, r1.w, cb9[6].x
    rsq r3.w, r0.w
    mul r7.xy, r3.wwww, r7.xyxx
    mul r7.xy, r2.wwww, r7.xyxx
    mad r6.xy, r7.xyxx, v2.xxxx, r6.xyxx
    add r2.w, -r6.z, cb9[6].w
    mad r1.w, r1.w, r2.w, r6.z
    mul r2.w, cb9[6].x, l(0.500000)
    mul r2.w, r2.w, r2.w
    lt r0.w, r0.w, r2.w
    add r2.w, cb9[6].w, l(-0.250000)
    movc r6.z, r0.w, r2.w, r1.w
  endif 
  if_nz cb8[0].w
    add r7.xy, r6.xyxx, -cb9[7].xyxx
    dp2 r0.w, cb9[8].xyxx, r7.xyxx
    mul_sat r0.w, r0.w, cb9[8].w
    mad r7.xy, r0.wwww, cb9[8].xyxx, cb9[7].xyxx
    add r7.xy, r6.xyxx, -r7.xyxx
    dp2 r0.w, r7.xyxx, r7.xyxx
    add r1.w, -r0.w, cb9[9].y
    mul_sat r1.w, r1.w, cb9[9].z
    mul r2.w, r1.w, cb9[9].x
    rsq r3.w, r0.w
    mul r7.xy, r3.wwww, r7.xyxx
    mul r7.xy, r2.wwww, r7.xyxx
    mad r6.xy, r7.xyxx, v2.xxxx, r6.xyxx
    add r2.w, -r6.z, cb9[9].w
    mad r1.w, r1.w, r2.w, r6.z
    mul r2.w, cb9[9].x, l(0.500000)
    mul r2.w, r2.w, r2.w
    lt r0.w, r0.w, r2.w
    add r2.w, cb9[9].w, l(-0.250000)
    movc r6.z, r0.w, r2.w, r1.w
  endif 
  if_nz cb8[1].x
    add r7.xy, r6.xyxx, -cb9[10].xyxx
    dp2 r0.w, cb9[11].xyxx, r7.xyxx
    mul_sat r0.w, r0.w, cb9[11].w
    mad r7.xy, r0.wwww, cb9[11].xyxx, cb9[10].xyxx
    add r7.xy, r6.xyxx, -r7.xyxx
    dp2 r0.w, r7.xyxx, r7.xyxx
    add r1.w, -r0.w, cb9[12].y
    mul_sat r1.w, r1.w, cb9[12].z
    mul r2.w, r1.w, cb9[12].x
    rsq r3.w, r0.w
    mul r7.xy, r3.wwww, r7.xyxx
    mul r7.xy, r2.wwww, r7.xyxx
    mad r6.xy, r7.xyxx, v2.xxxx, r6.xyxx
    add r2.w, -r6.z, cb9[12].w
    mad r1.w, r1.w, r2.w, r6.z
    mul r2.w, cb9[12].x, l(0.500000)
    mul r2.w, r2.w, r2.w
    lt r0.w, r0.w, r2.w
    add r2.w, cb9[12].w, l(-0.250000)
    movc r6.z, r0.w, r2.w, r1.w
  endif 
  add r6.xyz, r6.xyzx, -cb1[3].xyzx
  mul r6.xyz, r6.xyzx, cb9[14].zzwz
  dp3 r2.x, r6.xyzx, r3.xyzx
  dp3 r2.y, r6.xyzx, r4.xyzx
  dp3 r2.z, r6.xyzx, r5.xyzx
endif 
mul r3.xyzw, r2.yyyy, cb1[9].xyzw
mad r3.xyzw, r2.xxxx, cb1[8].xyzw, r3.xyzw
mad r2.xyzw, r2.zzzz, cb1[10].xyzw, r3.xyzw
add o0.xyzw, r2.xyzw, cb1[11].xyzw
mov o1.xy, v4.xyxx
mov o1.z, v2.w
mov o1.w, cb10[3].y
mov o2.xyz, r0.xyzx
mov o3.xyz, r1.xyzx
ret 
// Approximately 244 instruction slots used

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