//DMC5 HUD 7 (mission menu fire).
// ---- Created with 3Dmigoto v1.3.15-re2_workaround on Sat Mar 23 17:59:16 2019

cbuffer SceneInfo : register(b0)
{
  row_major float4x4 viewProjMat : packoffset(c0);
  row_major float3x4 transposeViewMat : packoffset(c4);
  row_major float3x4 transposeViewInvMat : packoffset(c7);
  float4 projElement[2] : packoffset(c10);
  float4 projInvElements[2] : packoffset(c12);
  row_major float4x4 viewProjInvMat : packoffset(c14);
  row_major float4x4 prevViewProjMat : packoffset(c18);
  float3 ZToLinear : packoffset(c22);
  float subdivisionLevel : packoffset(c22.w);
  float2 screenSize : packoffset(c23);
  float2 screenInverseSize : packoffset(c23.z);
  float2 cullingHelper : packoffset(c24);
  float cameraNearPlane : packoffset(c24.z);
  float cameraFarPlane : packoffset(c24.w);
  float4 viewFrustum[6] : packoffset(c25);
  float4 clipplane : packoffset(c31);
}

cbuffer Polygon3DConstant : register(b1)
{
  float cbDepthBias : packoffset(c0);
  float cbSoftParticleDist : packoffset(c0.y);
  float cbFadeCone : packoffset(c0.z);
  float cbFadeSpread : packoffset(c0.w);
  float3 cbFadeConeDir : packoffset(c1);
  float cbFadeAlphaRate : packoffset(c1.w);
  float4 cbFadeDepth : packoffset(c2);
  float3 cbOcclusionSphereOffset : packoffset(c3);
  float cbOcclusionSphereRadius : packoffset(c3.w);
  float cbOcclusionSizeRate : packoffset(c4);
  uint cbEffect3DFlags : packoffset(c4.y);
  float cbDofNear : packoffset(c4.z);
  float cbDofMaxScale : packoffset(c4.w);
  float cbDofMinAlpha : packoffset(c5);
  uint cbDofUsingMipLevel : packoffset(c5.y);
  float cbDofVanishDistance : packoffset(c5.z);
  float cbFadeEnableAngle : packoffset(c5.w);
  float cbLumaBleed : packoffset(c6);
  float cbLumaSlide : packoffset(c6.y);
  float cbLumaScale : packoffset(c6.z);
  float cbLumaBias : packoffset(c6.w);
  float cbLumaTexelScale : packoffset(c7);
  float cbDistInfluence : packoffset(c7.y);
  float cbDensityColorMin : packoffset(c7.z);
  float cbDensityColorMax : packoffset(c7.w);
  float cbDensityAlphaMin : packoffset(c8);
  float cbDensityAlphaMax : packoffset(c8.y);
  float cbFlowStrength : packoffset(c8.z);
  float cbProjectionAdjust : packoffset(c8.w);
  float3 cbShadowColor : packoffset(c9);
  float cbProjectionTimeScale : packoffset(c9.w);
  float cbMieDensityMin : packoffset(c10);
  float cbMieDensityMax : packoffset(c10.y);
  float cbMieDensityScale : packoffset(c10.z);
  float cbMieAlphaScale : packoffset(c10.w);
  float4 cbProjectionUV : packoffset(c11);
  float3 cbEmitterPos : packoffset(c12);
  float cbEv : packoffset(c12.w);
  float cbPostEdgeDropoff : packoffset(c13);
  float cbAlphaRate : packoffset(c13.y);
  float cbMieDropoff : packoffset(c13.z);
  float cbIntensity3D : packoffset(c13.w);
  float4 cbEdgeOuterColor3D : packoffset(c14);
  float2 cbOffset : packoffset(c15);
  float cbEdgeBlendRange3D : packoffset(c15.z);
  float cbEmissiveRate : packoffset(c15.w);
  float cbUsePhysicalAlphaBlend3D : packoffset(c16);
  float cbDetonemapRate : packoffset(c16.y);
  float cbPtFadeCone : packoffset(c16.z);
  float cbPtFadeSpread : packoffset(c16.w);
  float cbPtFadeAlphaRate : packoffset(c17);
  float cbPtFadeEnableAngle : packoffset(c17.y);
  float cbPtFadeinStart : packoffset(c17.z);
  float cbPtFadeinEnd : packoffset(c17.w);
  float2 cbUvSeqRect : packoffset(c18);
  float2 cbProcDistOffset : packoffset(c18.z);
  float cbProcDistVFreq : packoffset(c19);
  float cbProcDistVAmp : packoffset(c19.y);
  float cbProcDistHFreq : packoffset(c19.z);
  float cbProcDistHAmp : packoffset(c19.w);
  uint3 cbTexUnitColor : packoffset(c20);
  uint cbEffect3DPlayerColor : packoffset(c20.w);
  float3 cbTexUnitColorRate : packoffset(c21);
  float cbInterleaveScale : packoffset(c21.w);
}

Texture2D<float> ReadonlyDepth : register(t0);


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


void main(
  float3 v0 : POSITION0,
  float4 v1 : COLOR0,
  float4 v2 : TEXCOORD0,
  float4 v3 : TEXCOORD1,
  float4 v4 : TEXCOORD2,
  float4 v5 : TEXCOORD3,
  uint4 v6 : GENERIC0,
  uint4 v7 : GENERIC1,
  uint2 v8 : GENERIC2,
  float4 v9 : GENERIC3,
  float3 v10 : GENERIC4,
  out float4 o0 : SV_Position0,
  out float4 o1 : Color0,
  out float4 o2 : AlphaCorrection0,
  out float4 o3 : GeometryAttribute0,
  out float2 o4 : TexCoord0,
  out float4 o5 : TexCoord1)
{
  float4 r0,r1,r2,r3,r4,r5,r6;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 stereo = StereoParams.Load(0);
  float4 iniparams = IniParams.Load(0);
  float4 iniparams1 = IniParams.Load(int2(1,0));
  float4 iniparams3 = IniParams.Load(int2(3,0));
  
  r0.xyzw = viewProjMat._m10_m11_m12_m13 * v0.yyyy;
  r0.xyzw = v0.xxxx * viewProjMat._m00_m01_m02_m03 + r0.xyzw;
  r0.xyzw = v0.zzzz * viewProjMat._m20_m21_m22_m23 + r0.xyzw;
  r0.xyzw = viewProjMat._m30_m31_m32_m33 + r0.xyzw;
  r1.x = cmp(0 < cbOcclusionSphereRadius);
  if (r1.x != 0) {
    r1.xy = projElement[0].xy / r0.ww;
    r0.xyz = r0.xyz / r0.www;
    r2.zw = float2(0,0);
    r1.zw = float2(0,0);
    r3.x = cbOcclusionSphereRadius;
    r3.y = 0;
    while (true) {
      r3.z = cmp((int)r3.y >= 3);
      if (r3.z != 0) break;
      r3.z = 0.196349546 + r1.w;
      r4.x = r1.z;
      r4.y = 0;
      r1.w = r3.z;
      while (true) {
        r3.w = cmp((int)r4.y >= 8);
        if (r3.w != 0) break;
        sincos(r1.w, r5.x, r6.x);
        r3.w = r6.x * r3.x + cbOcclusionSphereOffset.x;
        r4.z = r5.x * r3.x + cbOcclusionSphereOffset.y;
        r3.w = r3.w * r1.x + r0.x;
        r4.z = r4.z * r1.y + r0.y;
        r4.w = cmp(r3.w < -1);
        r5.x = cmp(1 < r3.w);
        r4.w = (int)r4.w | (int)r5.x;
        r5.x = cmp(r4.z < -1);
        r4.w = (int)r4.w | (int)r5.x;
        r5.x = cmp(1 < r4.z);
        r4.w = (int)r4.w | (int)r5.x;
        if (r4.w != 0) {
          r5.x = -1;
        }
        if (r4.w == 0) {
          r3.w = 1 + r3.w;
          r3.w = screenSize.x * r3.w;
          r3.w = r3.w * 0.5 + 0.5;
          r4.z = -1 + r4.z;
          r4.z = screenSize.y * r4.z;
          r4.z = r4.z * -0.5 + 0.5;
          r2.x = (int)r3.w;
          r2.y = (int)r4.z;
          r2.x = ReadonlyDepth.Load(r2.xyz).x;
          r5.x = cmp(r0.z < r2.x);
        }
        if (r5.x != 0) {
          r4.x = (int)r4.x + 1;
        }
        r4.y = (int)r4.y + 1;
        r1.w = 0.785398185 + r1.w;
      }
      r1.z = r4.x;
      r3.y = (int)r3.y + 1;
      r3.x = -cbOcclusionSphereRadius * 0.333333343 + r3.x;
    }
    r1.xy = cmp(r0.xy < float2(-1,-1));
    r2.xy = cmp(float2(1,1) < r0.xy);
    r1.x = (int)r1.x | (int)r2.x;
    r1.x = (int)r1.y | (int)r1.x;
    r1.x = (int)r2.y | (int)r1.x;
    if (r1.x != 0) {
      r1.y = -1;
    }
    if (r1.x == 0) {
      r0.xy = float2(1,-1) + r0.xy;
      r0.xy = screenSize.xy * r0.xy;
      r0.xy = r0.xy * float2(0.5,-0.5) + float2(0.5,0.5);
      r2.xy = (int2)r0.xy;
      r2.zw = float2(0,0);
      r0.x = ReadonlyDepth.Load(r2.xyz).x;
      r1.y = cmp(r0.z < r0.x);
    }
    if (r1.y != 0) {
      r1.z = (int)r1.z + 1;
    }
  } else {
    r1.z = 0;
  }
  r0.x = (int)r1.z;
  r0.x = -r0.x * 0.0399999991 + 1;
  r0.y = cmp(cbDofVanishDistance < 0);
  if (r0.y != 0) {
    r1.xy = float2(1,1);
    r2.z = -1;
    r0.z = -1;
  } else {
    if (cbDofUsingMipLevel != 0) {
      r1.z = r0.w / cbDofNear;
      r1.z = min(1, r1.z);
      r1.w = asuint(cbDofUsingMipLevel);
      r0.z = r1.z * r1.w;
    } else {
      r0.z = 0;
    }
  }
  if (r0.y == 0) {
    r0.y = cmp(r0.w >= cbDofVanishDistance);
    if (r0.y != 0) {
      r1.xy = float2(0,0);
    } else {
      r0.y = cmp(r0.w >= cbDofNear);
      if (r0.y != 0) {
        r1.xy = float2(1,1);
      } else {
        r0.y = r0.w / cbDofNear;
        r1.z = 1 + -cbDofMinAlpha;
        r1.x = r0.y * r1.z + cbDofMinAlpha;
        r1.z = 1 + -cbDofMaxScale;
        r1.y = r0.y * r1.z + cbDofMaxScale;
      }
    }
    r2.z = r0.z;
  }
  r0.y = 1 + -cbOcclusionSizeRate;
  r0.y = r0.x * r0.y + cbOcclusionSizeRate;
  r0.y = r0.y * r1.y;
  r0.yz = v5.xy * r0.yy;
  r3.xyzw = v9.xyzx + v9.xyzx;
  r1.yzw = v9.www * r3.xyz;
  r3.x = v9.z * r3.z;
  r4.x = r3.y * v9.y + r3.x;
  r4.x = 1 + -r4.x;
  r4.yz = r3.zy * v9.xx + -r1.zw;
  r1.z = r3.w * v9.x + r3.x;
  r1.z = 1 + -r1.z;
  r1.yw = r3.yz * v9.xy + r1.wy;
  r3.xyz = v10.xzx * r4.xyz;
  r4.xyz = v10.yzy * r1.ywz;
  r5.xy = abs(r0.yz) * v5.zw + r0.yz;
  r5.z = 1;
  r3.w = v0.x;
  r1.y = dot(r5.xyz, r3.xzw);
  r4.w = v0.y;
  r1.z = dot(r5.xyz, r4.xzw);
  r4.x = r3.y;
  r4.z = v0.z;
  r1.w = dot(r5.xyz, r4.xyz);
  r3.xyzw = viewProjMat._m10_m11_m12_m13 * r1.zzzz;
  r3.xyzw = r1.yyyy * viewProjMat._m00_m01_m02_m03 + r3.xyzw;
  r3.xyzw = r1.wwww * viewProjMat._m20_m21_m22_m23 + r3.xyzw;
  r3.xyzw = viewProjMat._m32_m33_m30_m31 + r3.zwxy;
  r1.y = cmp(cbDepthBias != 0.000000);
  if (r1.y != 0) {
    r1.y = -cbDepthBias + -r3.y;
    r1.z = projElement[1].y * r1.y;
    r1.y = r1.y * projElement[1].x + projElement[1].z;
    r1.z = max(r1.y, r1.z);
    r1.y = r1.y / r1.z;
    r1.z = max(0, r3.y);
    r3.x = r1.y * r1.z;
  }
  r1.yzw = asint(cbEffect3DFlags) & int3(1,2,4);
  r4.xyz = r1.yyy ? v0.xyz : cbEmitterPos.xyz;
  r1.y = cmp(r0.w < cbFadeDepth.x);
  r4.w = cmp(cbFadeDepth.w < r0.w);
  r1.y = (int)r1.y | (int)r4.w;
  if (r1.y != 0) {
    r1.y = 0;
  } else {
    r4.w = cmp(r0.w < cbFadeDepth.y);
    if (r4.w != 0) {
      r4.w = -cbFadeDepth.x + r0.w;
      r5.x = cbFadeDepth.y + -cbFadeDepth.x;
      r1.y = r4.w / r5.x;
    } else {
      r4.w = cmp(cbFadeDepth.z < r0.w);
      if (r4.w != 0) {
        r0.w = -cbFadeDepth.z + r0.w;
        r4.w = cbFadeDepth.w + -cbFadeDepth.z;
        r0.w = r0.w / r4.w;
        r1.y = 1 + -r0.w;
      } else {
        r1.y = 1;
      }
    }
  }
  r0.w = cmp((int)r1.w != 0);
  r5.x = transposeViewInvMat._m03;
  r5.y = transposeViewInvMat._m13;
  r5.z = transposeViewInvMat._m23;
  r4.xyz = -r5.xyz + r4.xyz;
  r1.w = dot(r4.xyz, r4.xyz);
  r1.w = rsqrt(r1.w);
  r4.xyz = r4.xyz * r1.www;
  r1.w = dot(cbFadeConeDir.xyz, r4.xyz);
  r4.x = cmp(-r1.w < 0);
  r0.w = r0.w ? r4.x : 0;
  if (r0.w == 0) {
    r1.w = -r1.w;
  }
  r0.w = cmp(r1.w >= cbFadeCone);
  if (r0.w != 0) {
    r0.w = r1.z ? cbFadeAlphaRate : 1;
  } else {
    r4.x = cmp(r1.w >= cbFadeSpread);
    if (r4.x != 0) {
      r1.w = -cbFadeSpread + r1.w;
      r4.x = cbFadeCone + -cbFadeSpread;
      r1.w = r1.w / r4.x;
      if (r1.z != 0) {
        r1.w = 1 + -r1.w;
      }
      r4.x = 1 + -cbFadeAlphaRate;
      r0.w = r1.w * r4.x + cbFadeAlphaRate;
    } else {
      r0.w = r1.z ? 1 : cbFadeAlphaRate;
    }
  }
  r1.z = 1 + -cbFadeEnableAngle;
  r0.w = r0.w * cbFadeEnableAngle + r1.z;
  r4.xyz = -cbEmitterPos.xyz + r5.xyz;
  r1.z = dot(r4.xyz, r4.xyz);
  r1.z = sqrt(r1.z);
  r1.w = 0.00999999978 + cbPtFadeinEnd;
  r1.w = max(cbPtFadeinStart, r1.w);
  r1.z = min(r1.z, r1.w);
  r1.z = max(cbPtFadeinEnd, r1.z);
  r1.zw = -cbPtFadeinEnd + r1.zw;
  r1.z = r1.z / r1.w;
  r1.z = 1 + -r1.z;
  r4.xy = float2(1,1) + -cbPtFadeAlphaRate;
  r5.xyz = cbEmitterPos.xyz + -r5.xyz;
  r1.w = dot(r5.xyz, r5.xyz);
  r1.w = rsqrt(r1.w);
  r5.xyz = r5.xyz * r1.www;
  r6.xyz = -cbEmitterPos.xyz + v0.xyz;
  r1.w = dot(r6.xyz, r6.xyz);
  r1.w = rsqrt(r1.w);
  r6.xyz = r6.xyz * r1.www;
  r1.w = dot(r6.xyz, r5.xyz);
  r4.z = cmp(-r1.w >= cbPtFadeCone);
  if (r4.z != 0) {
    r4.z = 1;
  } else {
    r4.w = cmp(-r1.w >= cbPtFadeSpread);
    if (r4.w != 0) {
      r1.w = -cbPtFadeSpread + -r1.w;
      r4.w = cbPtFadeCone + -cbPtFadeSpread;
      r1.w = r1.w / r4.w;
      r4.z = r1.w * r4.x + cbPtFadeAlphaRate;
    } else {
      r4.z = cbPtFadeAlphaRate;
    }
  }
  r1.z = saturate(r1.z * r4.x + r4.z);
  r1.z = r1.z * cbPtFadeEnableAngle + r4.y;
  r1.w = r0.w * cbFadeEnableAngle + cbFadeEnableAngle;
  r4.x = r1.z * cbPtFadeEnableAngle + cbPtFadeEnableAngle;
  r1.w = cmp(r1.w >= r4.x);
  r0.w = r1.w ? r0.w : r1.z;
  r0.w = r1.y * r0.w;
  r0.x = r0.w * r0.x;
  r0.x = r0.x * r1.x;
  r1.x = v1.w * r0.x;
  r4.yzw = asuint(cbEffect3DPlayerColor) >> int3(8,16,24);
  r4.x = cbEffect3DPlayerColor;
  r4.xyzw = (int4)r4.xyzw & int4(255,255,255,255);
  r4.xyzw = (uint4)r4.xyzw;
  r1.yzw = v1.xyz;
  r4.xyzw = r4.xyzw * r1.yzwx;
  o1.xyzw = float4(0.00392156886,0.00392156886,0.00392156886,0.00392156886) * r4.xyzw;
  r0.x = cmp(r4.w < 0.00254999986);
  if (r0.x != 0) {
    r3.y = 0x7f800000;
  }
  o5.zw = v3.xy + v3.zw;
  r0.xy = r0.yz / abs(r0.yz);
  r0.xy = float2(1,1) + r0.xy;
  r2.xy = saturate(float2(0.5,0.5) * r0.xy);
  r0.xyz = (uint3)v6.xyw;
  r4.xy = float2(0.00392156886,0.00392156886) * r0.xy;
  r0.w = cmp(1 < r0.z);
  if (r0.w != 0) {
    r0.x = r0.x * 0.00392156886 + -r4.y;
    r4.z = max(9.99999997e-007, r0.x);
    r4.w = 1;
    o2.xyzw = r4.yzww;
  } else {
    r0.x = cmp(0 < r0.z);
    if (r0.x != 0) {
      r0.x = (uint)v6.z;
      r0.x = -127 + r0.x;
      r0.z = cmp(0 < r0.x);
      r0.w = cmp(r0.x < 0);
      r0.z = (int)r0.w | (int)r0.z;
      if (r0.z != 0) {
        r0.xz = float2(0.0236220472,-0.214127213) * r0.xx;
        r0.w = 6.28318405 * r1.x;
        r0.w = max(9.99999997e-007, r0.w);
        r0.x = -r0.w * r0.x;
        r0.x = 1.44269502 * r0.x;
        r0.x = exp2(r0.x);
        r0.z = exp2(r0.z);
        r0.xz = float2(1,1) + -r0.xz;
        r1.x = saturate(r0.x / r0.z);
      }
      r1.x = -r4.x * r1.x + 1;
      r0.x = r0.y * 0.00392156886 + -r1.x;
      r1.y = max(9.99999997e-007, r0.x);
      r1.z = 1;
    } else {
      r1.xyz = float3(0,0,0);
    }
    o2.xyw = r1.xyz;
    o2.z = 0;
  }
  o0.xyzw = r3.zwxy;
  r2.w = 0;
  o3.xyzw = r2.xywz;
  o5.xy = v3.xy;
  o4.xy = v2.xy;
  o0.x=o0.x*iniparams.y;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.15-re2_workaround on Sat Mar 23 17:59:16 2019
//
//
// Buffer Definitions:
//
// cbuffer SceneInfo
// {
//
//   row_major float4x4 viewProjMat;    // Offset:    0 Size:    64
//   row_major float3x4 transposeViewMat;// Offset:   64 Size:    48 [unused]
//   row_major float3x4 transposeViewInvMat;// Offset:  112 Size:    48
//   float4 projElement[2];             // Offset:  160 Size:    32
//   float4 projInvElements[2];         // Offset:  192 Size:    32 [unused]
//   row_major float4x4 viewProjInvMat; // Offset:  224 Size:    64 [unused]
//   row_major float4x4 prevViewProjMat;// Offset:  288 Size:    64 [unused]
//   float3 ZToLinear;                  // Offset:  352 Size:    12 [unused]
//   float subdivisionLevel;            // Offset:  364 Size:     4 [unused]
//   float2 screenSize;                 // Offset:  368 Size:     8
//   float2 screenInverseSize;          // Offset:  376 Size:     8 [unused]
//   float2 cullingHelper;              // Offset:  384 Size:     8 [unused]
//   float cameraNearPlane;             // Offset:  392 Size:     4 [unused]
//   float cameraFarPlane;              // Offset:  396 Size:     4 [unused]
//   float4 viewFrustum[6];             // Offset:  400 Size:    96 [unused]
//   float4 clipplane;                  // Offset:  496 Size:    16 [unused]
//
// }
//
// cbuffer Polygon3DConstant
// {
//
//   float cbDepthBias;                 // Offset:    0 Size:     4
//   float cbSoftParticleDist;          // Offset:    4 Size:     4 [unused]
//   float cbFadeCone;                  // Offset:    8 Size:     4
//   float cbFadeSpread;                // Offset:   12 Size:     4
//   float3 cbFadeConeDir;              // Offset:   16 Size:    12
//   float cbFadeAlphaRate;             // Offset:   28 Size:     4
//   float4 cbFadeDepth;                // Offset:   32 Size:    16
//   float3 cbOcclusionSphereOffset;    // Offset:   48 Size:    12
//   float cbOcclusionSphereRadius;     // Offset:   60 Size:     4
//   float cbOcclusionSizeRate;         // Offset:   64 Size:     4
//   uint cbEffect3DFlags;              // Offset:   68 Size:     4
//   float cbDofNear;                   // Offset:   72 Size:     4
//   float cbDofMaxScale;               // Offset:   76 Size:     4
//   float cbDofMinAlpha;               // Offset:   80 Size:     4
//   uint cbDofUsingMipLevel;           // Offset:   84 Size:     4
//   float cbDofVanishDistance;         // Offset:   88 Size:     4
//   float cbFadeEnableAngle;           // Offset:   92 Size:     4
//   float cbLumaBleed;                 // Offset:   96 Size:     4 [unused]
//   float cbLumaSlide;                 // Offset:  100 Size:     4 [unused]
//   float cbLumaScale;                 // Offset:  104 Size:     4 [unused]
//   float cbLumaBias;                  // Offset:  108 Size:     4 [unused]
//   float cbLumaTexelScale;            // Offset:  112 Size:     4 [unused]
//   float cbDistInfluence;             // Offset:  116 Size:     4 [unused]
//   float cbDensityColorMin;           // Offset:  120 Size:     4 [unused]
//   float cbDensityColorMax;           // Offset:  124 Size:     4 [unused]
//   float cbDensityAlphaMin;           // Offset:  128 Size:     4 [unused]
//   float cbDensityAlphaMax;           // Offset:  132 Size:     4 [unused]
//   float cbFlowStrength;              // Offset:  136 Size:     4 [unused]
//   float cbProjectionAdjust;          // Offset:  140 Size:     4 [unused]
//   float3 cbShadowColor;              // Offset:  144 Size:    12 [unused]
//   float cbProjectionTimeScale;       // Offset:  156 Size:     4 [unused]
//   float cbMieDensityMin;             // Offset:  160 Size:     4 [unused]
//   float cbMieDensityMax;             // Offset:  164 Size:     4 [unused]
//   float cbMieDensityScale;           // Offset:  168 Size:     4 [unused]
//   float cbMieAlphaScale;             // Offset:  172 Size:     4 [unused]
//   float4 cbProjectionUV;             // Offset:  176 Size:    16 [unused]
//   float3 cbEmitterPos;               // Offset:  192 Size:    12
//   float cbEv;                        // Offset:  204 Size:     4 [unused]
//   float cbPostEdgeDropoff;           // Offset:  208 Size:     4 [unused]
//   float cbAlphaRate;                 // Offset:  212 Size:     4 [unused]
//   float cbMieDropoff;                // Offset:  216 Size:     4 [unused]
//   float cbIntensity3D;               // Offset:  220 Size:     4 [unused]
//   float4 cbEdgeOuterColor3D;         // Offset:  224 Size:    16 [unused]
//   float2 cbOffset;                   // Offset:  240 Size:     8 [unused]
//   float cbEdgeBlendRange3D;          // Offset:  248 Size:     4 [unused]
//   float cbEmissiveRate;              // Offset:  252 Size:     4 [unused]
//   float cbUsePhysicalAlphaBlend3D;   // Offset:  256 Size:     4 [unused]
//   float cbDetonemapRate;             // Offset:  260 Size:     4 [unused]
//   float cbPtFadeCone;                // Offset:  264 Size:     4
//   float cbPtFadeSpread;              // Offset:  268 Size:     4
//   float cbPtFadeAlphaRate;           // Offset:  272 Size:     4
//   float cbPtFadeEnableAngle;         // Offset:  276 Size:     4
//   float cbPtFadeinStart;             // Offset:  280 Size:     4
//   float cbPtFadeinEnd;               // Offset:  284 Size:     4
//   float2 cbUvSeqRect;                // Offset:  288 Size:     8 [unused]
//   float2 cbProcDistOffset;           // Offset:  296 Size:     8 [unused]
//   float cbProcDistVFreq;             // Offset:  304 Size:     4 [unused]
//   float cbProcDistVAmp;              // Offset:  308 Size:     4 [unused]
//   float cbProcDistHFreq;             // Offset:  312 Size:     4 [unused]
//   float cbProcDistHAmp;              // Offset:  316 Size:     4 [unused]
//   uint3 cbTexUnitColor;              // Offset:  320 Size:    12 [unused]
//   uint cbEffect3DPlayerColor;        // Offset:  332 Size:     4
//   float3 cbTexUnitColorRate;         // Offset:  336 Size:    12 [unused]
//   float cbInterleaveScale;           // Offset:  348 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// ReadonlyDepth                     texture   float          2d    0        1
// SceneInfo                         cbuffer      NA          NA    0        1
// Polygon3DConstant                 cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xy          2     NONE   float   xy
// TEXCOORD                 1   xyzw        3     NONE   float   xyzw
// TEXCOORD                 2   xyzw        4     NONE   float
// TEXCOORD                 3   xyzw        5     NONE   float   xyzw
// GENERIC                  0   xyzw        6     NONE    uint   xyzw
// GENERIC                  1   xyzw        7     NONE    uint
// GENERIC                  2   xy          8     NONE    uint
// GENERIC                  3   xyzw        9     NONE   float   xyzw
// GENERIC                  4   xyz        10     NONE   float   xyz
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// Color                    0   xyzw        1     NONE   float   xyzw
// AlphaCorrection          0   xyzw        2     NONE   float   xyzw
// GeometryAttribute        0   xyzw        3     NONE   float   xyzw
// TexCoord                 0   xy          4     NONE   float   xy
// TexCoord                 1   xyzw        5     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[24], immediateIndexed
dcl_constantbuffer cb1[21], immediateIndexed
dcl_resource_texture2d (float,float,float,float) t0
dcl_input v0.xyz
dcl_input v1.xyzw
dcl_input v2.xy
dcl_input v3.xyzw
dcl_input v5.xyzw
dcl_input v6.xyzw
dcl_input v9.xyzw
dcl_input v10.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xy
dcl_output o5.xyzw
dcl_temps 7
mul r0.xyzw, v0.yyyy, cb0[1].xyzw
mad r0.xyzw, v0.xxxx, cb0[0].xyzw, r0.xyzw
mad r0.xyzw, v0.zzzz, cb0[2].xyzw, r0.xyzw
add r0.xyzw, r0.xyzw, cb0[3].xyzw
lt r1.x, l(0.000000), cb1[3].w
if_nz r1.x
  div r1.xy, cb0[10].xyxx, r0.wwww
  div r0.xyz, r0.xyzx, r0.wwww
  mov r2.zw, l(0,0,0,0)
  mov r1.zw, l(0,0,0,0)
  mov r3.x, cb1[3].w
  mov r3.y, l(0)
  loop
    ige r3.z, r3.y, l(3)
    breakc_nz r3.z
    add r3.z, r1.w, l(0.196349546)
    mov r4.x, r1.z
    mov r4.y, l(0)
    mov r1.w, r3.z
    loop
      ige r3.w, r4.y, l(8)
      breakc_nz r3.w
      sincos r5.x, r6.x, r1.w
      mad r3.w, r6.x, r3.x, cb1[3].x
      mad r4.z, r5.x, r3.x, cb1[3].y
      mad r3.w, r3.w, r1.x, r0.x
      mad r4.z, r4.z, r1.y, r0.y
      lt r4.w, r3.w, l(-1.000000)
      lt r5.x, l(1.000000), r3.w
      or r4.w, r4.w, r5.x
      lt r5.x, r4.z, l(-1.000000)
      or r4.w, r4.w, r5.x
      lt r5.x, l(1.000000), r4.z
      or r4.w, r4.w, r5.x
      if_nz r4.w
        mov r5.x, l(-1)
      endif
      if_z r4.w
        add r3.w, r3.w, l(1.000000)
        mul r3.w, r3.w, cb0[23].x
        mad r3.w, r3.w, l(0.500000), l(0.500000)
        add r4.z, r4.z, l(-1.000000)
        mul r4.z, r4.z, cb0[23].y
        mad r4.z, r4.z, l(-0.500000), l(0.500000)
        ftoi r2.x, r3.w
        ftoi r2.y, r4.z
        ld_indexable(texture2d)(float,float,float,float) r2.x, r2.xyzw, t0.xyzw
        lt r5.x, r0.z, r2.x
      endif
      if_nz r5.x
        iadd r4.x, r4.x, l(1)
      endif
      iadd r4.y, r4.y, l(1)
      add r1.w, r1.w, l(0.785398185)
    endloop
    mov r1.z, r4.x
    iadd r3.y, r3.y, l(1)
    mad r3.x, -cb1[3].w, l(0.333333343), r3.x
  endloop
  lt r1.xy, r0.xyxx, l(-1.000000, -1.000000, 0.000000, 0.000000)
  lt r2.xy, l(1.000000, 1.000000, 0.000000, 0.000000), r0.xyxx
  or r1.x, r1.x, r2.x
  or r1.x, r1.y, r1.x
  or r1.x, r2.y, r1.x
  if_nz r1.x
    mov r1.y, l(-1)
  endif
  if_z r1.x
    add r0.xy, r0.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000)
    mul r0.xy, r0.xyxx, cb0[23].xyxx
    mad r0.xy, r0.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
    ftoi r2.xy, r0.xyxx
    mov r2.zw, l(0,0,0,0)
    ld_indexable(texture2d)(float,float,float,float) r0.x, r2.xyzw, t0.xyzw
    lt r1.y, r0.z, r0.x
  endif
  if_nz r1.y
    iadd r1.z, r1.z, l(1)
  endif
else
  mov r1.z, l(0)
endif
itof r0.x, r1.z
mad r0.x, -r0.x, l(0.040000), l(1.000000)
lt r0.y, cb1[5].z, l(0.000000)
if_nz r0.y
  mov r1.xy, l(1.000000,1.000000,0,0)
  mov r2.z, l(-1.000000)
  mov r0.z, l(-1.000000)
else
  if_nz cb1[5].y
    div r1.z, r0.w, cb1[4].z
    min r1.z, r1.z, l(1.000000)
    utof r1.w, cb1[5].y
    mul r0.z, r1.w, r1.z
  else
    mov r0.z, l(0)
  endif
endif
if_z r0.y
  ge r0.y, r0.w, cb1[5].z
  if_nz r0.y
    mov r1.xy, l(0,0,0,0)
  else
    ge r0.y, r0.w, cb1[4].z
    if_nz r0.y
      mov r1.xy, l(1.000000,1.000000,0,0)
    else
      div r0.y, r0.w, cb1[4].z
      add r1.z, -cb1[5].x, l(1.000000)
      mad r1.x, r0.y, r1.z, cb1[5].x
      add r1.z, -cb1[4].w, l(1.000000)
      mad r1.y, r0.y, r1.z, cb1[4].w
    endif
  endif
  mov r2.z, r0.z
endif
add r0.y, -cb1[4].x, l(1.000000)
mad r0.y, r0.x, r0.y, cb1[4].x
mul r0.y, r1.y, r0.y
mul r0.yz, r0.yyyy, v5.xxyx
add r3.xyzw, v9.xyzx, v9.xyzx
mul r1.yzw, r3.xxyz, v9.wwww
mul r3.x, r3.z, v9.z
mad r4.x, r3.y, v9.y, r3.x
add r4.x, -r4.x, l(1.000000)
mad r4.yz, r3.zzyz, v9.xxxx, -r1.zzwz
mad r1.z, r3.w, v9.x, r3.x
add r1.z, -r1.z, l(1.000000)
mad r1.yw, r3.yyyz, v9.xxxy, r1.wwwy
mul r3.xyz, r4.xyzx, v10.xzxx
mul r4.xyz, r1.ywzy, v10.yzyy
mad r5.xy, |r0.yzyy|, v5.zwzz, r0.yzyy
mov r5.z, l(1.000000)
mov r3.w, v0.x
dp3 r1.y, r5.xyzx, r3.xzwx
mov r4.w, v0.y
dp3 r1.z, r5.xyzx, r4.xzwx
mov r4.x, r3.y
mov r4.z, v0.z
dp3 r1.w, r5.xyzx, r4.xyzx
mul r3.xyzw, r1.zzzz, cb0[1].xyzw
mad r3.xyzw, r1.yyyy, cb0[0].xyzw, r3.xyzw
mad r3.xyzw, r1.wwww, cb0[2].xyzw, r3.xyzw
add r3.xyzw, r3.zwxy, cb0[3].zwxy
ne r1.y, cb1[0].x, l(0.000000)
if_nz r1.y
  add r1.y, -r3.y, -cb1[0].x
  mul r1.z, r1.y, cb0[11].y
  mad r1.y, r1.y, cb0[11].x, cb0[11].z
  max r1.z, r1.z, r1.y
  div r1.y, r1.y, r1.z
  max r1.z, r3.y, l(0.000000)
  mul r3.x, r1.z, r1.y
endif
and r1.yzw, cb1[4].yyyy, l(0, 1, 2, 4)
movc r4.xyz, r1.yyyy, v0.xyzx, cb1[12].xyzx
lt r1.y, r0.w, cb1[2].x
lt r4.w, cb1[2].w, r0.w
or r1.y, r1.y, r4.w
if_nz r1.y
  mov r1.y, l(0)
else
  lt r4.w, r0.w, cb1[2].y
  if_nz r4.w
    add r4.w, r0.w, -cb1[2].x
    add r5.x, -cb1[2].x, cb1[2].y
    div r1.y, r4.w, r5.x
  else
    lt r4.w, cb1[2].z, r0.w
    if_nz r4.w
      add r0.w, r0.w, -cb1[2].z
      add r4.w, -cb1[2].z, cb1[2].w
      div r0.w, r0.w, r4.w
      add r1.y, -r0.w, l(1.000000)
    else
      mov r1.y, l(1.000000)
    endif
  endif
endif
ine r0.w, r1.w, l(0)
mov r5.x, cb0[7].w
mov r5.y, cb0[8].w
mov r5.z, cb0[9].w
add r4.xyz, r4.xyzx, -r5.xyzx
dp3 r1.w, r4.xyzx, r4.xyzx
rsq r1.w, r1.w
mul r4.xyz, r1.wwww, r4.xyzx
dp3 r1.w, cb1[1].xyzx, r4.xyzx
lt r4.x, -r1.w, l(0.000000)
and r0.w, r0.w, r4.x
if_z r0.w
  mov r1.w, -r1.w
endif
ge r0.w, r1.w, cb1[0].z
if_nz r0.w
  movc r0.w, r1.z, cb1[1].w, l(1.000000)
else
  ge r4.x, r1.w, cb1[0].w
  if_nz r4.x
    add r1.w, r1.w, -cb1[0].w
    add r4.x, -cb1[0].w, cb1[0].z
    div r1.w, r1.w, r4.x
    if_nz r1.z
      add r1.w, -r1.w, l(1.000000)
    endif
    add r4.x, -cb1[1].w, l(1.000000)
    mad r0.w, r1.w, r4.x, cb1[1].w
  else
    movc r0.w, r1.z, l(1.000000), cb1[1].w
  endif
endif
add r1.z, -cb1[5].w, l(1.000000)
mad r0.w, r0.w, cb1[5].w, r1.z
add r4.xyz, r5.xyzx, -cb1[12].xyzx
dp3 r1.z, r4.xyzx, r4.xyzx
sqrt r1.z, r1.z
add r1.w, cb1[17].w, l(0.010000)
max r1.w, r1.w, cb1[17].z
min r1.z, r1.w, r1.z
max r1.z, r1.z, cb1[17].w
add r1.zw, r1.zzzw, -cb1[17].wwww
div r1.z, r1.z, r1.w
add r1.z, -r1.z, l(1.000000)
add r4.xy, -cb1[17].xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
add r5.xyz, -r5.xyzx, cb1[12].xyzx
dp3 r1.w, r5.xyzx, r5.xyzx
rsq r1.w, r1.w
mul r5.xyz, r1.wwww, r5.xyzx
add r6.xyz, v0.xyzx, -cb1[12].xyzx
dp3 r1.w, r6.xyzx, r6.xyzx
rsq r1.w, r1.w
mul r6.xyz, r1.wwww, r6.xyzx
dp3 r1.w, r6.xyzx, r5.xyzx
ge r4.z, -r1.w, cb1[16].z
if_nz r4.z
  mov r4.z, l(1.000000)
else
  ge r4.w, -r1.w, cb1[16].w
  if_nz r4.w
    add r1.w, -r1.w, -cb1[16].w
    add r4.w, -cb1[16].w, cb1[16].z
    div r1.w, r1.w, r4.w
    mad r4.z, r1.w, r4.x, cb1[17].x
  else
    mov r4.z, cb1[17].x
  endif
endif
mad_sat r1.z, r1.z, r4.x, r4.z
mad r1.z, r1.z, cb1[17].y, r4.y
mad r1.w, r0.w, cb1[5].w, cb1[5].w
mad r4.x, r1.z, cb1[17].y, cb1[17].y
ge r1.w, r1.w, r4.x
movc r0.w, r1.w, r0.w, r1.z
mul r0.w, r0.w, r1.y
mul r0.x, r0.x, r0.w
mul r0.x, r1.x, r0.x
mul r1.x, r0.x, v1.w
ushr r4.yzw, cb1[20].wwww, l(0, 8, 16, 24)
mov r4.x, cb1[20].w
and r4.xyzw, r4.xyzw, l(255, 255, 255, 255)
utof r4.xyzw, r4.xyzw
mov r1.yzw, v1.xxyz
mul r4.xyzw, r1.yzwx, r4.xyzw
mul o1.xyzw, r4.xyzw, l(0.00392156886, 0.00392156886, 0.00392156886, 0.00392156886)
lt r0.x, r4.w, l(0.00254999986)
if_nz r0.x
  mov r3.y, l(0x7f800000)
endif
add o5.zw, v3.zzzw, v3.xxxy
div r0.xy, r0.yzyy, |r0.yzyy|
add r0.xy, r0.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul_sat r2.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
utof r0.xyz, v6.xywx
mul r4.xy, r0.xyxx, l(0.00392156886, 0.00392156886, 0.000000, 0.000000)
lt r0.w, l(1.000000), r0.z
if_nz r0.w
  mad r0.x, r0.x, l(0.00392156886), -r4.y
  max r4.z, r0.x, l(0.000001)
  mov r4.w, l(1.000000)
  mov o2.xyzw, r4.yzww
else
  lt r0.x, l(0.000000), r0.z
  if_nz r0.x
    utof r0.x, v6.z
    add r0.x, r0.x, l(-127.000000)
    lt r0.z, l(0.000000), r0.x
    lt r0.w, r0.x, l(0.000000)
    or r0.z, r0.w, r0.z
    if_nz r0.z
      mul r0.xz, r0.xxxx, l(0.0236220472, 0.000000, -0.214127213, 0.000000)
      mul r0.w, r1.x, l(6.283184)
      max r0.w, r0.w, l(0.000001)
      mul r0.x, r0.x, -r0.w
      mul r0.x, r0.x, l(1.442695)
      exp r0.x, r0.x
      exp r0.z, r0.z
      add r0.xz, -r0.xxzx, l(1.000000, 0.000000, 1.000000, 0.000000)
      div_sat r1.x, r0.x, r0.z
    endif
    mad r1.x, -r4.x, r1.x, l(1.000000)
    mad r0.x, r0.y, l(0.00392156886), -r1.x
    max r1.y, r0.x, l(0.000001)
    mov r1.z, l(1.000000)
  else
    mov r1.xyz, l(0,0,0,0)
  endif
  mov o2.xyw, r1.xyxz
  mov o2.z, l(0)
endif
mov o0.xyzw, r3.zwxy
mov r2.w, l(0)
mov o3.xyzw, r2.xywz
mov o5.xy, v3.xyxx
mov o4.xy, v2.xyxx
ret
// Approximately 316 instruction slots used

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