//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
//   float4 CameraPos;
//   sampler2D Depth_RT;
//   sampler2D Diffuse_RT;
//   float4 DirVector;
//   float4 Levels;
//   float4 LightAtt;
//   float4 LightColor;
//   float4 LightColorEnd;
//   sampler2D LightMapSampler;
//   float4 LightPos;
//   float4 LightRange;
//   sampler2D Normal_RT;
//   sampler2D Specular_RT;
//   row_major float4x4 SpotLight_MatProjector;
//   row_major float4x4 matViewProjectionInv;
//
//
// Registers:
//
//   Name                   Reg   Size
//   ---------------------- ----- ----
//   matViewProjectionInv   c0       4
//   SpotLight_MatProjector c4       4
//   CameraPos              c8       1
//   LightPos               c9       1
//   LightRange             c10      1
//   Levels                 c11      1
//   LightColor             c12      1
//   LightColorEnd          c13      1
//   DirVector              c14      1
//   LightAtt               c15      1
//   Depth_RT               s0       1
//   Normal_RT              s1       1
//   Diffuse_RT             s2       1
//   Specular_RT            s3       1
//   LightMapSampler        s7       1
//

    ps_3_0
    def c16, 0.5, 0.500100017, 0.499900013, 1
    def c17, 1.00000095, -0, 2, -1
    def c18, 0.330000013, 0, 0, 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, c16.x, c16.yzzw
    add r1.z, -r1.y, c16.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.xyz, r0.w, r0
    mul r3, r2.y, c5
    mad r3, r2.x, c4, r3
    mad r2, r2.z, c6, r3
    add r2, r2, c7
    mov r3, r2.z
    texkill r3
    mul r1.yw, r2.xxzy, c16.x
    rcp r2.z, r2.w
    mad r1.yw, r1, r2.z, c16.x
    mov r3, r1.y
    texkill r3
    add r3.xy, -r1.ywzw, c16.w
    mov r4, r3.x
    texkill r4
    mov r4, r1.w
    texkill r4
    mov r3, r3.y
    texkill r3
    mad r3.xyz, r0, -r0.w, c9
    dp3 r1.y, r3, r3
    rsq r1.y, r1.y
    rcp r1.y, r1.y
    mov r4.y, c10.y
    mad r1.y, r4.y, -c15.y, r1.y
    mov r4.x, c17.x
    add r1.w, r4.x, -c15.y
    mul r2.z, r1.w, c10.y
    cmp r1.y, r1.y, -r1.y, c17.y
    mad r1.y, c10.y, r1.w, r1.y
    rcp r1.w, r2.z
    mul_pp r4, r1.w, r1.y
    texkill r4
    abs r2.z, c14.w
    cmp r3.xyz, -r2.z, r3, c14
    texld_pp r5, r1.xzzw, s2
    add_pp r4.xyz, r5, r5
    texld_pp r6, r1.xzzw, s1
    mad_pp r5.xyz, r6, c17.z, c17.w
    nrm_pp r6.xyz, r5
    mad r0.xyz, r0, -r0.w, c8
    dp3 r0.w, r0, r0
    rsq r0.w, r0.w
    texld_pp r7, r1.xzzw, s3
    nrm_pp r5.xyz, r3
    mad_pp r0.xyz, r0, r0.w, r5
    nrm_pp r3.xyz, r0
    dp3_sat_pp r0.x, r6, r5
    dp3_sat_pp r0.y, r6, r3
    mul r0.z, r7.w, c11.z
    pow_sat_pp r1.x, r0.y, r0.z
    mul_pp r0.yzw, r7.xxyz, r1.x
    mul_pp r0.yzw, r0, c11.w
    mad_pp r3.xyz, r0.x, r4, r0.yzww
    mul_pp r3.xyz, r4.w, r3
    mad_pp r0.x, r1.y, -r1.w, c16.w
    mul r1.xyz, r0.x, c13
    mad r1.xyz, c12, r4.w, r1
    mul r1.xyz, r1, r3
    mul_sat r0.x, r5.w, c11.y
    add r0.x, -r0.x, c16.w
    mul_pp r1.xyz, r0.x, r1
    add r0.x, r2.w, r2.w
    rcp r0.x, r0.x
    mad r2.xy, r2, r0.x, c16.x
    texld_pp r2, r2, s7
    mul_pp r1.xyz, r1, r2
    dp3 r0.x, r1, c16.w
    cmp r2, -r0_abs.x, c17.w, c17.y
    texkill r2
    dp3_pp oC0.w, r0.yzww, c18.x
    mov_pp oC0.xyz, r1

// approximately 90 instruction slots used (5 texture, 85 arithmetic)
 
