//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
//   float4 DiffuseOverrideParameter;
//   float2 DistanceFadeParameters;
//   sampler2D LightAttenuationTexture;
//   float4 LightColorAndFalloffExponent;
//   float4 ScreenPositionScaleBias;
//   float4x4 ViewProjectionMatrix;
//   bool bEnableDistanceShadowFading;
//   bool bReceiveDynamicShadows;
//
//
// Registers:
//
//   Name                         Reg   Size
//   ---------------------------- ----- ----
//   bReceiveDynamicShadows       b0       1
//   bEnableDistanceShadowFading  b1       1
//   LightColorAndFalloffExponent c0       1
//   ScreenPositionScaleBias      c1       1
//   DiffuseOverrideParameter     c4       1
//   ViewProjectionMatrix         c8       4
//   DistanceFadeParameters       c12      1
//   LightAttenuationTexture      s0       1
//

    ps_3_0
    def c2, -1, 1, 0, 0
    dcl_texcoord4_pp v0.xyz
    dcl_texcoord7 v1
    dcl_2d s0

def c220, 0, 1, 0.0625, 0.5
dcl_2d s15

    dp3_pp r0.x, v0, v0
    rsq_pp r0.x, r0.x
    mul_pp r0.x, r0.x, v0.z
    if b0
      mul r0.yzw, c9.xxyw, v1.y
      mad r0.yzw, c8.xxyw, v1.x, r0
      mad r0.yzw, c10.xxyw, v1.z, r0
      mad r0.yzw, c11.xxyw, v1.w, r0

// Unreal Engine halo fix inserted with DarkStarSword's shadertool.py:
// shadertool.py -i --fix-unreal-ps-halo --stereo-sampler-ps=s15 --only-autofixed CRC32_A2D964BB_0.txt
texldl r31, c220.z, s15
add r31.w, r0.w, -r31.y
mad r0.y, r31.w, r31.x, r0.y

      rcp r0.w, r0.w
      mul r0.yz, r0.w, r0
      mad r0.yz, r0, c1.xxyw, c1.xwzw
      texld r1, r0.yzzw, s0
      mul_pp r0.yzw, r1.xxyz, r1.xxyz
      if b1
        dp3 r1.x, v1, v1
        rsq r1.x, r1.x
        rcp r1.x, r1.x
        add r1.x, -r1.x, c12.x
        mul_sat_pp r1.x, r1.x, c12.y
        mul_pp r1.x, r1.x, r1.x
        mad_pp r1.y, r1.w, r1.w, c2.x
        mad_pp r1.xyz, r1.x, r1.y, c2.y
      else
        mov_pp r1.xyz, c2.y
      endif
      mul_pp r0.yzw, r0, r1.xxyz
    else
      mov_pp r0.yzw, c2.y
    endif
    mul r1.xyz, r0.x, c4
    mul r0.yzw, r0, r1.xxyz
    mul r0.yzw, r0, c0.xxyz
    cmp oC0.xyz, r0.x, r0.yzww, c2.z
    mov_pp oC0.w, c2.z

// approximately 38 instruction slots used (1 texture, 37 arithmetic)
