//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
//   float4 AmbientColorAndSkyFactor;
//   float3 CameraWorldPos;
//   float4 DiffuseOverrideParameter;
//   float4 MinZ_MaxZRatio;
//   float4 ObjectWorldPositionAndRadius;
//   sampler2D PixelTexture2D_1;
//   sampler2D PixelTexture2D_2;
//   sampler2D PixelTexture2D_3;
//   float4 ScreenPositionScaleBias;
//   float4 UniformPixelScalars_0;
//   float4 UniformPixelScalars_1;
//   float4 UniformPixelScalars_5;
//   float4 UniformPixelVector_0;
//   float4 UniformPixelVector_2;
//   float4 UniformPixelVector_5;
//   float4 UniformPixelVector_7;
//   float4 UniformPixelVector_8;
//   float4x4 ViewProjectionMatrix;
//
//
// Registers:
//
//   Name                         Reg   Size
//   ---------------------------- ----- ----
//   CameraWorldPos               c0       1
//   ScreenPositionScaleBias      c1       1
//   MinZ_MaxZRatio               c2       1
//   DiffuseOverrideParameter     c4       1
//   ViewProjectionMatrix         c8       4
//   ObjectWorldPositionAndRadius c12      1
//   UniformPixelVector_0         c13      1
//   UniformPixelVector_2         c14      1
//   UniformPixelVector_5         c15      1
//   UniformPixelVector_7         c16      1
//   UniformPixelVector_8         c17      1
//   UniformPixelScalars_0        c18      1
//   UniformPixelScalars_1        c19      1
//   UniformPixelScalars_5        c20      1
//   AmbientColorAndSkyFactor     c21      1
//   PixelTexture2D_1             s0       1
//   PixelTexture2D_2             s1       1
//   PixelTexture2D_3             s2       1
//

    ps_3_0
    def c3, 0.5, 1, -0.333299994, 1.20000005
    def c5, 420, 0, 10, -9.99999997e-007
    def c6, 0.600000024, 0, 0, 0
    dcl_texcoord5 v0
    dcl_color v1.xyz
    dcl_color1 v2
    dcl_texcoord v3.xy
    dcl_2d s0
    dcl_2d s1
    dcl_2d s2

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

    mul r0.xyz, c9.xyww, v0.y
    mad r0.xyz, c8.xyww, v0.x, r0
    mad r0.xyz, c10.xyww, v0.z, r0
    mad r0.xyz, c11.xyww, v0.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_F014A70E_0.txt
texldl r31, c220.z, s15
add r31.w, r0.z, -r31.y
mad r0.x, r31.w, r31.x, r0.x

    rcp r0.z, r0.z
    mul r0.xy, r0.z, r0
    mad r0.xy, r0, c1, c1.wzzw
    rcp r0.w, c19.y
    mad r0.xy, r0, r0.w, c15
    add r1.xy, r0, c3.x
    texld r2, r0, s2
    texld r1, r1, s1
    mul r0.x, r2.x, r1.x
    mov r0.yw, c3
    mad r0.x, c20.x, -r0.x, r0.y
    mul r0.x, r0.x, c20.y
    texld r1, v3, s0
    mad r2, r1.w, r0.x, c3.z
    texkill r2
    nrm_pp r2.xyz, v2
    nrm_pp r3.xyz, v1
    mul_pp r0.x, r2.y, r3.x
    mad_pp r0.x, r2.x, r3.y, -r0.x
    mul r0.x, r0.x, v2.w
    add r2.xyw, c0.xyzz, v0.xyzz
    mov r4.xyz, c5
    add r4, r4.xyyz, c12.zxyz
    add r3.xyw, r2, -r4.yzzw
    add r4, -r2.wxyw, r4
    nrm r5.xyz, r3.xyww
    mul r0.x, r0.x, r5.y
    mad r0.x, r5.x, r3.z, r0.x
    mad_sat r0.x, r5.z, r2.z, r0.x
    pow_sat r1.w, r0.x, c18.w
    add r0.x, r0.x, c5.w
    add_sat r1.w, r1.w, c6.x
    cmp r0.x, r0.x, r1.w, c6.x
    mul r2.xyz, r1, r0.x
    mul r1.xyz, r1, c17
    dp3 r0.x, r4.yzww, r4.yzww
    rsq r0.x, r0.x
    rcp r0.x, r0.x
    mov r1.w, c12.w
    mul r1.w, r1.w, c18.y
    rcp r1.w, r1.w
    mul r0.x, r0.x, r1.w
    pow_sat r1.w, r0_abs.x, c18.z
    add r0.x, r0_abs.x, c5.w
    mul r3.xyz, r1.w, c14
    mul r3.xyz, r3, c14.w
    cmp r3.xyz, r0.x, r3, c5.y
    mul r0.x, r0.w, c12.w
    rcp r0.x, r0.x
    mul r0.x, r0.x, r4.x
    add r0.w, r0_abs.x, c5.w
    pow_sat r1.w, r0_abs.x, c18.x
    cmp r0.x, r0.w, r1.w, c5.y
    add r0.w, -r0.x, c3.y
    mad r4.xyz, r0.x, c16, r0.w
    mul r3.xyz, r3, r0.w
    mul r2.xyz, r2, r3
    mov r0.x, c19.x
    mad_pp r2.xyz, r0.x, r2, c13
    mul r1.xyz, r1, r4
    mad r1.xyz, r1, c4.w, c4
    mad_pp oC0.xyz, r1, c21, r2
    add r0.x, r0.y, -c2.y
    mad oC0.w, -c2.x, r0.z, r0.x

// approximately 80 instruction slots used (3 texture, 77 arithmetic)
