//Lighting PS 15. Parking lot. High. Car lights.
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.181 on Sun Aug 27 11:47:26 2023
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float4 projParams;                 // Index:    0.xyzw           Components:     4 [unused]
//   float4 inLightPos[3];              // Index:    1 2 3            Components:    12 [unused]
//   float4 inLightInvRadiusSq;         // Index:    4.xyzw           Components:     4 [unused]
//   float4 inLightColor[4];            // Index:    5 6 7 8          Components:    16 [unused]
//   float4 inLightSpotDir[3];          // Index:    9 10 11          Components:    12 [unused]
//   float4 inLightSpotAngle;           // Index:   12.xyzw           Components:     4 [unused]
//   float4 inLightSpotFalloff;         // Index:   13.xyzw           Components:     4 [unused]
//   float4 ambient;                    // Index:   14.xyzw           Components:     4 [unused]
//   float roughness;                   // Index:   15.x              Components:     1 [unused]
//   float4 specularColor;              // Index:   16.xyzw           Components:     4 [unused]
//   float4 rtParams1;                  // Index:   17.xyzw           Components:     4
//   float3 lightPosition;              // Index:   18.xyz            Components:     3
//   float4 lightColor;                 // Index:   19.xyzw           Components:     4
//   float lightBrightness;             // Index:   20.x              Components:     1
//   float lightRange;                  // Index:   20.y              Components:     1
//   float2 lightAttenuation;           // Index:   20.zw             Components:     2
//   float3 lightDirection;             // Index:   21.xyz            Components:     3
//   float4 lightSpotParams;            // Index:   22.xyzw           Components:     4
//   float4 lightMapParams;             // Index:   23.xyzw           Components:     4
//   float4x4 worldToLightProj;         // Index:   24 25 26 27       Components:    16
//   float3 eyePosWorld;                // Index:   28.xyz            Components:     3 [unused]
//   float3 vEye;                       // Index:   29.xyz            Components:     3 [unused]
//   float4 lightParams;                // Index:   30.xyzw           Components:     4 [unused]
//   float shadowSoftness;              // Index:   31.x              Components:     1 [unused]
//   float4x4 screenToWorld;            // Index:   32 33 34 35       Components:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// prePassBuffer_sampler_            sampler      NA          NA    0        1
// prePassDepthBuffer_sampler_       sampler      NA          NA    1        1
// cookieMap_sampler_                sampler      NA          NA    3        1
// prePassBufferTex                  texture  float4          2d    0        1
// prePassDepthBufferTex             texture  float4          2d    1        1
// cookieMapTex                      texture  float4          2d    3        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyzw        2     NONE   float   xy w
// TEXCOORD                 2   xyzw        3     NONE   float
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB0[36], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s3, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t3
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyw
dcl_output o0.xyzw
dcl_temps 29
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r25.xyzw, l(0, 0, 0, 0), t125.xyzw
div r0.xy, v2.xyxx, v2.wwww
add r0.xy, r0.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r0.x, r0.x, cb0[17].z
mad r0.y, -r0.y, l(0.500000), l(1.000000)
mul r1.y, r0.y, cb0[17].w
mul r1.x, r0.x, l(0.500000)
add r0.xy, r1.xyxx, cb0[17].xyxx
mad r0.zw, r0.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
mul r0.zw, r0.zzzw, l(0.000000, 0.000000, 1.000000, -1.000000)

mul r11.xyzw, r0.wwww, cb0[33].xyzw
mad r11.xyzw, cb0[32].xyzw, r0.zzzz, r11.xyzw
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r10.z, r0.xyxx, t1.yzxw, s1, l(0.000000)
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r10.xyw, r0.xyxx, t0.xywz, s0, l(0.000000)
mad r11.xyzw, cb0[34].xyzw, r10.zzzz, r11.xyzw

mad r26.x, r25.y, r11.w, l(-1.0)
mad r0.z, r25.x, r26.x, r0.z

mul r1.xyzw, r0.wwww, cb0[33].xyzw
mad r1.xyzw, cb0[32].xyzw, r0.zzzz, r1.xyzw
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r0.z, r0.xyxx, t1.yzxw, s1, l(0.000000)
sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r0.xyw, r0.xyxx, t0.xywz, s0, l(0.000000)
mad r1.xyzw, cb0[34].xyzw, r0.zzzz, r1.xyzw
add r1.xyzw, r1.xyzw, cb0[35].xyzw
div r1.xyz, r1.xyzx, r1.wwww
add r2.xyz, r1.xyzx, -cb0[18].xyzx
dp3 r3.y, r2.xyzx, r2.xyzx
sqrt r3.x, r3.y
dp2 r0.z, cb0[20].zwzz, r3.xyxx
add r0.z, -r0.z, l(1.000000)
div r2.xyz, r2.xyzx, r3.xxxx
add r1.w, -r3.x, cb0[20].y
lt r1.w, r1.w, l(0.000000)
discard_nz r1.w
dp3 r1.w, cb0[21].xyzx, r2.xyzx
add r1.w, r1.w, -cb0[22].x
lt r2.w, r1.w, l(0.000000)
div r1.w, r1.w, cb0[22].y
discard_nz r2.w
mad r2.w, r0.z, r1.w, l(-0.000001)
mul r0.z, r0.z, r1.w
lt r1.w, r2.w, l(0.000000)
discard_nz r1.w
mad r0.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
max r0.w, r0.w, l(0.020000)
mul r0.w, r0.w, r0.w
ge r3.xy, r0.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r3.xy, r3.xyxx, l(1.000000,1.000000,0,0), l(-1.000000,-1.000000,0,0)
add r4.xyz, -|r0.xyxx|, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r3.xy, r3.xyxx, r4.yzyy
add r4.z, -|r0.y|, r4.x
ge r1.w, r4.z, l(0.000000)
movc r4.xy, r1.wwww, r0.xyxx, r3.xyxx
dp3 r0.x, r4.xyzx, r4.xyzx
rsq r0.x, r0.x
mul r3.xyz, r0.xxxx, r4.xyzx
dp4 r0.x, v1.xyzw, v1.xyzw
rsq r0.x, r0.x
mul r4.xyz, r0.xxxx, v1.xyzx
mad r5.xyz, -v1.xyzx, r0.xxxx, -r2.xyzx
dp3 r0.x, r3.xyzx, -r2.xyzx
dp3 r0.y, r3.xyzx, -r4.xyzx
max r0.y, r0.y, l(0.000010)
mul r1.w, r0.y, r0.y
mad r2.x, -r0.w, r0.w, l(1.000000)
mul r2.y, r0.w, r0.w
mad r0.w, r0.w, r0.w, l(-1.000000)
mad r1.w, r1.w, r2.x, r2.y
sqrt r1.w, r1.w
max r2.z, r0.x, l(0.000010)
mov_sat r0.xz, r0.xxzx
mul r2.w, r2.z, r2.z
mad r2.x, r2.w, r2.x, r2.y
sqrt r2.x, r2.x
mul r0.y, r0.y, r2.x
mad r0.y, r2.z, r1.w, r0.y
div r1.w, l(0.500000), r0.y
ge r0.y, l(0.000000), r0.y
movc r0.y, r0.y, l(0), r1.w
dp3 r1.w, r5.xyzx, r5.xyzx
rsq r1.w, r1.w
mul r2.xzw, r1.wwww, r5.xxyz
dp3 r1.w, r3.xyzx, r2.xzwx
max r1.w, r1.w, l(0.000010)
mul r1.w, r1.w, r1.w
mad r0.w, r1.w, r0.w, l(1.000000)
mul r0.w, r0.w, r0.w
mul r0.w, r0.w, l(3.14159274)
div r0.w, r2.y, r0.w
mul r0.y, r0.y, r0.w
mul r2.xyz, r1.yyyy, cb0[25].xywx
mad r1.xyw, cb0[24].xyxw, r1.xxxx, r2.xyxz
mad r1.xyz, cb0[26].xywx, r1.zzzz, r1.xywx
add r1.xyz, r1.xyzx, cb0[27].xywx
div r1.xy, r1.xyxx, r1.zzzz
mad r1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
add r1.z, -r1.y, l(1.000000)
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xzxx, t3.xyzw, s3
max r0.w, r1.z, r1.y
max r0.w, r0.w, r1.x
mul r1.xyz, r1.xyzx, cb0[19].xyzx
mul r1.xyz, r1.xyzx, cb0[23].xyzx
mul r0.z, r0.w, r0.z
mul_sat r0.x, r0.z, r0.x
mul r2.x, r0.x, cb0[20].x
mul_sat r2.y, r0.y, r2.x
mul r0.y, r2.y, cb0[20].x
mov r0.x, l(1.000000)
lt r0.z, cb0[23].w, l(0.000000)
movc r0.xy, r0.zzzz, r0.xyxx, r2.xyxx
movc r1.xyz, r0.zzzz, l(1.000000,1.000000,1.000000,0), r1.xyzx
mul o0.xyz, r0.xxxx, r1.xyzx
mov o0.w, r0.y
ret
// Approximately 105 instruction slots used
