//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
//   float4 AmbientDirVector;
//   float4 AmbientLightAtt;
//   float4 AmbientLightColor;
//   float4 CameraPos;
//   float4 DepthPlanes;
//   sampler2D Depth_RT;
//   sampler2D Diffuse_RT;
//   float4 DirVector;
//   float4 FixedLightColor;
//   float4 FixedLightColorC;
//   float4 Levels;
//   float4 LightColor;
//   sampler2D LightMapSampler;
//   float4 LightPos;
//   sampler2D Normal_RT;
//   float4 ProjUV;
//   sampler2D Specular_RT;
//   row_major float4x4 SpotLight_MatProjector;
//   row_major float4x4 matViewProjectionInv;
//
//
// Registers:
//
//   Name                   Reg   Size
//   ---------------------- ----- ----
//   matViewProjectionInv   c0       4
//   SpotLight_MatProjector c4       4
//   ProjUV                 c8       1
//   CameraPos              c9       1
//   DepthPlanes            c10      1
//   LightPos               c11      1
//   Levels                 c12      1
//   LightColor             c13      1
//   DirVector              c14      1
//   AmbientDirVector       c15      1
//   AmbientLightAtt        c16      1
//   AmbientLightColor      c17      1
//   FixedLightColor        c18      1
//   FixedLightColorC       c19      1
//   Depth_RT               s0       1
//   Normal_RT              s1       1
//   Diffuse_RT             s2       1
//   Specular_RT            s3       1
//   LightMapSampler        s7       1
//

    ps_3_0
    def c20, 0.5, 0.500100017, 0.499900013, 1
    def c21, 1.99608612, 2, -1, 1.99999995e-005
    def c22, -1, -0, 0.330000013, 0
def c220, 0, 0, 0.0625, 0
dcl_2d s13

    dcl_texcoord2 v0.xyw
    dcl_2d s0
    dcl_2d s1
    dcl_2d s2
    dcl_2d s3
    dcl_2d s7
    rcp r0.x, v0.w
    mul r0.xy, r0.x, v0
    mad r1.xy, r0, c20.x, c20.yzzw
    add r1.z, -r1.y, c20.w
    texld r2, r1.xzzw, s0
    mul r3, r0.y, c1
    mad r0, r0.x, c0, r3
    mad r0, r2.x, c2, r0
    add r0, r0, c3


mov r11,r0
rcp r11.w, r11.w
mul r11, r11, r11.w
mul r10, r11.y, c151
mad r10, r11.x, c150, r10
mad r10, r11.z, c152, r10
add r10, r10, c153
texldl r20, c220.z, s13
add r20.y, r10.w, -r20.y
mul r20.x, r20.x, r20.y
add r10.x, r10.x, -r20.x
rcp r11.w, r10.w
mul r10, r10, r11.w
mul r11, r10.y, c155
mad r11, r10.x, c154, r11
mad r11, r10.z, c156, r11
add r11, r11, c157
rcp r10.w, r11.w
mul r11, r11, r10.w
mul r11, r11, r0.w
mov r0, r11
    rcp r0.w, r0.w

    mul r2.yzw, r0.w, r0.xxyz
    mad r3.xyz, r0, -r0.w, c11
    abs r1.y, c14.w
    cmp r3.xyz, -r1.y, r3, c14
    texld_pp r4, r1.xzzw, s2
    add_pp r4.xyz, r4, r4
    mul_pp r1.y, r4.w, c21.x
    frc_pp r1.y, r1.y
    mad r1.y, r4.w, c21.x, -r1.y
    texld_pp r5, r1.xzzw, s1
    mad_pp r5.xyz, r5, c21.y, c21.z
    nrm_pp r6.xyz, r5
    mad r0.xyz, r0, -r0.w, c9
    dp3 r0.w, r0, r0
    rsq r0.w, r0.w
    texld_pp r5, r1.xzzw, s3
    nrm_pp r7.xyz, r3
    mad_pp r0.xyz, r0, r0.w, r7
    nrm_pp r3.xyz, r0
    dp3_sat_pp r0.x, r6, r7
    dp3_sat_pp r0.y, r6, r3
    mul r0.z, r5.w, c12.z
    pow_sat_pp r1.x, r0.y, r0.z
    mul r0.yzw, r2.z, c5.xxyw
    mad r0.yzw, r2.y, c4.xxyw, r0
    mad r0.yzw, r2.w, c6.xxyw, r0
    add r0.yzw, r0, c7.xxyw
    add r0.w, r0.w, r0.w
    rcp r0.w, r0.w
    mul r0.yz, r0.w, r0
    mad r0.yz, r0, c8.xzww, c8.xxyw
    frc r0.yz, r0
    texld_pp r3, r0.yzzw, s7
    add r0.y, -r2.x, c10.z
    rcp r0.y, r0.y
    mul r0.y, r0.y, c10.w
    mul_sat r0.y, r0.y, c21.w
    add r0.y, -r0.y, c20.w
    mad_pp r0.y, r0.y, -r3.x, c20.w
    mul_pp r1.xzw, r5.xyyz, r1.x
    mul_pp r1.xzw, r1, c12.w
    mad_pp r0.xzw, r0.x, r4.xyyz, r1
    mul_pp r0.xyz, r0.y, r0.xzww
    mul r0.xyz, r0, c13
    mul_sat r2.xy, r4.w, c12.yxzw
    add r2.xy, -r2, c20.w
    mov r3.xyz, c19
    mad_pp r3.xyz, r3, r1.y, c18
    dp3_pp r0.w, r6, c15
    mov r2.w, c20.w
    lrp_sat_pp r1.y, r0.w, r2.w, c16.x
    mad_pp r3.xyz, r1.y, c17, r3
    mul_pp r3.xyz, r3, r4
    mul r2.yzw, r2.y, r3.xxyz
    mad_pp r0.xyz, r0, r2.x, r2.yzww
    dp3 r0.w, r0, c20.w
    cmp r2, -r0_abs.w, c22.x, c22.y
    texkill r2
    dp3_pp oC0.w, r1.xzww, c22.z
    mov_pp oC0.xyz, r0

// approximately 78 instruction slots used (5 texture, 73 arithmetic)
 
