//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
//   float4 AmbientColorAndSkyFactor;
//   float3 CameraWorldPos;
//   float4 DiffuseOverrideParameter;
//   float3 LowerSkyColor;
//   float4 MinZ_MaxZRatio;
//   float4 ObjectWorldPositionAndRadius;
//   sampler2D PixelTexture2D_0;
//   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_1;
//   float4 UniformPixelVector_2;
//   float4 UniformPixelVector_5;
//   float4 UniformPixelVector_7;
//   float4 UniformPixelVector_8;
//   float3 UpperSkyColor;
//   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_1         c14      1
//   UniformPixelVector_2         c15      1
//   UniformPixelVector_5         c16      1
//   UniformPixelVector_7         c17      1
//   UniformPixelVector_8         c18      1
//   UniformPixelScalars_0        c19      1
//   UniformPixelScalars_1        c20      1
//   UniformPixelScalars_5        c21      1
//   UpperSkyColor                c22      1
//   LowerSkyColor                c23      1
//   AmbientColorAndSkyFactor     c24      1
//   PixelTexture2D_0             s0       1
//   PixelTexture2D_1             s1       1
//   PixelTexture2D_2             s2       1
//   PixelTexture2D_3             s3       1
//

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

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

    mul r0.xyz, c9.xyww, v1.y
    mad r0.xyz, c8.xyww, v1.x, r0
    mad r0.xyz, c10.xyww, v1.z, r0
    mad r0.xyz, c11.xyww, 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_E1C39816_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, c20.y
    mad r0.xy, r0, r0.w, c16
    add r1.xy, r0, c3.z
    texld r2, r0, s3
    texld r1, r1, s2
    mul r0.x, r2.x, r1.x
    mov r0.w, c3.w
    mad r0.x, c21.x, -r0.x, r0.w
    mul r0.x, r0.x, c21.y
    texld r1, v4, s1
    mad r2, r1.w, r0.x, c5.x
    texkill r2
    nrm_pp r2.xyz, v3
    nrm_pp r3.xyz, v2
    mul_pp r0.x, r2.y, r3.x
    mad_pp r0.x, r2.x, r3.y, -r0.x
    mul r0.x, r0.x, v3.w
    add r2.xyw, c0.xyzz, v1.xyzz
    mov r4.yzw, c5
    add r4, r4.yzzw, 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, c19.w
    add r0.x, r0.x, c6.y
    add_sat r0.y, r1.w, c6.z
    cmp r0.x, r0.x, r0.y, c6.z
    mul r2.xyz, r1, r0.x
    mul r1.xyz, r1, c18
    dp3 r0.x, r4.yzww, r4.yzww
    rsq r0.x, r0.x
    rcp r0.x, r0.x
    mov r1.w, c12.w
    mul r0.y, r1.w, c19.y
    rcp r0.y, r0.y
    mul r0.x, r0.y, r0.x
    pow_sat r2.w, r0_abs.x, c19.z
    add r0.x, r0_abs.x, c6.y
    mul r3.xyz, r2.w, c15
    mul r3.xyz, r3, c15.w
    cmp r3.xyz, r0.x, r3, c5.z
    mul r0.x, r1.w, c6.x
    rcp r0.x, r0.x
    mul r0.x, r0.x, r4.x
    add r0.y, r0_abs.x, c6.y
    pow_sat r1.w, r0_abs.x, c19.x
    cmp r0.x, r0.y, r1.w, c5.z
    add r0.y, -r0.x, c3.w
    mad r4.xyz, r0.x, c17, r0.y
    mul r3.xyz, r3, r0.y
    mul r2.xyz, r2, r3
    mov r0.x, c20.x
    mad_pp r2.xyz, r0.x, r2, c13
    mul r1.xyz, r1, r4
    mad r1.xyz, r1, c4.w, c4
    texld r3, v4, s0
    mad r3.xyz, r3, c3.x, c3.y
    mul_pp r3.xyz, r3, c14
    nrm_pp r4.xyz, r3
    nrm r3.xyz, v0
    dp3 r0.x, r3, r4
    mad r0.xy, r0.x, c7, c7.x
    mul r0.xy, r0, r0
    mul r3.xyz, r0.y, r1
    mul r4.xyz, r0.x, r1
    mul r3.xyz, r3, c23
    mad r3.xyz, r4, c22, r3
    mad_pp r2.xyz, r3, c24.w, r2
    mad_pp oC0.xyz, r1, c24, r2
    add r0.x, r0.w, -c2.y
    mad oC0.w, -c2.x, r0.z, r0.x

// approximately 97 instruction slots used (4 texture, 93 arithmetic)
