//shadows & lights (high)
// Generated by Microsoft (R) HLSL Shader Compiler 9.27.952.3022
//
//   using 3Dmigoto v1.3.16 on Mon Jul 20 23:36:53 2020
//
//
// Buffer Definitions:
//
// cbuffer constantsPS
// {
//
//   float4 gp_ambientRefColorsZConv[2];// Index:    0 1              Components:     8
//   float4 gp_upVector_cloudDensity;   // Index:    2.xyzw           Components:     4
//   float4 gp_cloudShadowTransform[2]; // Index:    3 4              Components:     8
//   row_major float3x4 gp_matrixPSSM[4];// Index:    5-16             Components:    48
//   float3 gp_directionPSSM;           // Index:   17.xyz            Components:     3
//   float gp_maxShadowDepth;           // Index:   17.w              Components:     1 [unused]
//   float3 gp_colorPSSM;               // Index:   18.xyz            Components:     3
//   float gp_aoIntensity;              // Index:   18.w              Components:     1 [unused]
//   float4 gp_shadowDepthScale[4];     // Index:   19 20 21 22       Components:    16
//   row_major float4x4 gv_matrixVInv;  // Index:   23 24 25 26       Components:    16
//   float gp_PCFSteps;                 // Index:   27.x              Components:     1 [unused]
//   float2 gp_texelSize;               // Index:   27.yz             Components:     2
//   float gp_useShadow;                // Index:   27.w              Components:     1
//   float2 gp_uvMulAO;                 // Index:   28.xy             Components:     2 [unused]
//   float gp_blendFactor;              // Index:   28.z              Components:     1 [unused]
//   float gp_shadowDrawDistance;       // Index:   28.w              Components:     1
//   float4 gp_depthConversion;         // Index:   29.xyzw           Components:     4 [unused]
//   float4 gp_AOParams;                // Index:   30.xyzw           Components:     4 [unused]
//   float4 gp_AORangeParams;           // Index:   31.xyzw           Components:     4 [unused]
//   float gp_contribIntensity;         // Index:   32.x              Components:     1 [unused]
//   float gp_skyMips;                  // Index:   32.y              Components:     1 [unused]
//   float gp_humidityIntensity;        // Index:   32.z              Components:     1
//   float gp_padding1;                 // Index:   32.w              Components:     1 [unused]
//
// }
//
// cbuffer variablesPS
// {
//
//   float4 gp_spotLights[72];          // Index:    0-71             Components:   288
//   float4 gp_pointLights[20];         // Index:   72-91             Components:    80
//   float2 gp_numLights;               // Index:   92.xy             Components:     2
//   float2 gp_padding2;                // Index:   92.zw             Components:     2 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// Reflection_CubeMapSampler         sampler      NA          NA    4        1
// shadowMapPSSMSampler            sampler_c      NA          NA    5        1
// Specular_CubeMapSampler           sampler      NA          NA    6        1
// lightMapTextureSampler          sampler_c      NA          NA    7        1
// lightMaskTextureSampler           sampler      NA          NA    8        1
// projectorPSSMSampler              sampler      NA          NA   13        1
// cloudShadowTexSampler             sampler      NA          NA   14        1
// projectorPSSM2Sampler             sampler      NA          NA   15        1
// gbufferDepth                      texture  float4          2d    0        1
// gbuffer1                          texture  float4          2d    1        1
// gbuffer2                          texture  float4          2d    2        1
// gbuffer3                          texture  float4          2d    3        1
// Reflection_CubeMap                texture  float4        cube    4        1
// shadowMapPSSM                     texture  float4     2darray    5        1
// Specular_CubeMap                  texture  float4        cube    6        1
// lightMapTexture                   texture  float4          2d    7        1
// lightMaskTexture                  texture  float4          2d    8        1
// projectorPSSM                     texture  float4     2darray   13        1
// cloudShadowTex                    texture  float4          2d   14        1
// projectorPSSM2                    texture  float4     2darray   15        1
// constantsPS                       cbuffer      NA          NA    0        1
// variablesPS                       cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
// TEXCOORD                 0   xyz         1     NONE   float   xyz
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_4_1
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[33], dynamicIndexed
dcl_constantbuffer cb1[93], dynamicIndexed
dcl_constantbuffer cb13[15], dynamicIndexed

dcl_sampler s4, mode_default
dcl_sampler s5, mode_comparison
dcl_sampler s6, mode_default
dcl_sampler s7, mode_comparison
dcl_sampler s8, mode_default
dcl_sampler s13, mode_default
dcl_sampler s14, mode_default
dcl_sampler s15, 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) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texturecube (float,float,float,float) t4
dcl_resource_texture2darray (float,float,float,float) t5
dcl_resource_texturecube (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2d (float,float,float,float) t8
dcl_resource_texture2darray (float,float,float,float) t13
dcl_resource_texture2d (float,float,float,float) t14
dcl_resource_texture2darray (float,float,float,float) t15
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyz
dcl_output o0.xyzw

dcl_resource_texture2d (float,float,float,float) t125
dcl_resource_texture1d (float,float,float,float) t120
dcl_temps 44

ld_indexable(texture2d)(float,float,float,float) r20.xyzw, l(0, 0, 0, 0), t125.xyzw
ld_indexable(texture1d)(float,float,float,float) r22.xyzw, l(1, 0, 0, 0), t120.xyzw

mov r40.xy, v0.xy
//mul r40.y, r40.y, r22.x

ftoi r0.xy, r40.xyxx
mov r0.zw, l(0,0,0,0)
ld r1.x, r0.xyww, t0.xyzw
ld r2.xyzw, r0.xyww, t1.xyzw
ld r3.xyzw, r0.xyww, t2.xyzw
ld r0.xyzw, r0.xyzw, t3.xyzw

mov r4.xzw, r0.xxyw
mov r4.y, r3.z
log r4.xyzw, |r4.xyzw|
mul r4.xyzw, r4.xyzw, l(2.200000, 2.200000, 2.200000, 2.200000)
exp r4.xyzw, r4.xyzw
log r0.xyw, r2.xyxz
mul r1.yzw, r0.xxyw, l(0.000000, 2.200000, 2.200000, 2.200000)
exp r1.yzw, r1.yyzw
add r1.x, r1.x, -cb0[0].w
div r1.x, cb0[1].w, r1.x
mul r5.xyz, r1.xxxx, v1.xyzx
eq r2.x, cb0[27].w, l(1.000000)
if_nz r2.x
  lt r2.x, r1.x, cb0[28].w
  if_nz r2.x
    mov r5.w, l(1.000000)

//shadows
mul r25.xyzw, r5.yyyy, cb13[1]
mad r25.xyzw, r5.xxxx, cb13[0].xyzw, r25.xyzw
mad r25.xyzw, r5.zzzz, cb13[2], r25.xyzw
add r25.xyzw, r25.xyzw, cb13[3]
add r20.w, r1.x, -r20.y
div r20.w, r20.w, cb13[4].x
mad r25.x, r20.x, -r20.w, r25.x
mul r5.xyzw, r25.yyyy, cb0[24].xyzw
mad r5.xyzw, r25.xxxx, cb0[23], r5.xyzw
mad r5.xyzw, r25.zzzz, cb0[25], r5.xyzw
mad r5.xyzw, r25.wwww, cb0[26], r5.xyzw

    dp4 r2.x, cb0[5].xyzw, r5.xyzw
    dp4 r2.y, cb0[6].xyzw, r5.xyzw
    dp4 r2.z, cb0[7].xyzw, r5.xyzw
    dp4 r6.x, cb0[8].xyzw, r5.xyzw
    dp4 r6.y, cb0[9].xyzw, r5.xyzw
    dp4 r6.z, cb0[10].xyzw, r5.xyzw
    dp4 r7.x, cb0[11].xyzw, r5.xyzw
    dp4 r7.y, cb0[12].xyzw, r5.xyzw
    dp4 r7.z, cb0[13].xyzw, r5.xyzw
    dp4 r8.x, cb0[14].xyzw, r5.xyzw
    dp4 r8.y, cb0[15].xyzw, r5.xyzw
    dp4 r8.z, cb0[16].xyzw, r5.xyzw
    mad r9.xyz, r2.xyzx, l(1.01185775, 1.01185775, -1.050000, 0.000000), l(-0.00592885399, -0.00592885399, 1.000000, 0.000000)
    round_ni r9.xyz, r9.xyzx
    ne r9.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r9.xyzx
    or r3.z, r9.y, r9.x
    or r3.z, r9.z, r3.z
    mad r9.xyz, r6.xyzx, l(1.01185775, 1.01185775, -1.050000, 0.000000), l(-0.00592885399, -0.00592885399, 1.000000, 0.000000)
    round_ni r9.xyz, r9.xyzx
    ne r9.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r9.xyzx
    or r5.w, r9.y, r9.x
    or r5.w, r9.z, r5.w
    mad r9.xyz, r7.xyzx, l(1.01185775, 1.01185775, -1.050000, 0.000000), l(-0.00592885399, -0.00592885399, 1.000000, 0.000000)
    round_ni r9.xyz, r9.xyzx
    ne r9.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r9.xyzx
    or r6.w, r9.y, r9.x
    or r6.w, r9.z, r6.w
    movc r6.w, r6.w, l(3), l(2)
    movc r5.w, r5.w, r6.w, l(1)
    and r5.w, r3.z, r5.w
    ieq r9.xy, r5.wwww, l(1, 2, 0, 0)
    movc r7.xyz, r9.yyyy, r7.xyzx, r8.xyzx
    movc r6.xyz, r9.xxxx, r6.xyzx, r7.xyzx
    movc r6.xyz, r3.zzzz, r6.xyzx, r2.xyzx
    add r2.x, -r6.z, l(1.000000)
    itof r6.w, r5.w
    sample_l r7.xyz, r6.xywx, t13.xyzw, s13, l(0.000000)
    sample_l r8.xyz, r6.xywx, t15.xyzw, s15, l(0.000000)
    eq r2.y, r3.w, l(1.000000)
    add_sat r9.xyz, r7.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
    movc r7.xyz, r2.yyyy, r9.xyzx, r7.xyzx
    add_sat r9.xyz, r8.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
    movc r8.xyz, r2.yyyy, r9.xyzx, r8.xyzx
    add r2.x, r2.x, -cb0[r5.w + 19].y
    div_sat r2.x, r2.x, cb0[r5.w + 19].x
    add r2.x, -r2.x, l(1.000000)
    mul r9.xy, cb0[27].yzyy, l(-1.500000, -1.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.y, r9.xyzx, t5.xxxx, s5, r2.x
    mul r9.xy, cb0[27].yzyy, l(-1.500000, -0.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(-1.500000, 0.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(-1.500000, 1.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(-0.500000, -1.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(-0.500000, -0.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(-0.500000, 0.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(-0.500000, 1.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(0.500000, -1.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(0.500000, -0.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(0.500000, 0.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(0.500000, 1.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(1.500000, -1.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(1.500000, -0.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(1.500000, 0.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r9.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.z, r9.xyzx, t5.xxxx, s5, r2.x
    add r2.y, r2.z, r2.y
    mul r9.xy, cb0[27].yzyy, l(1.500000, 1.500000, 0.000000, 0.000000)
    mov r9.z, l(0)
    add r6.xyz, r6.xywx, r9.xyzx
    sample_c_lz r2.x, r6.xyzx, t5.xxxx, s5, r2.x
    add r2.x, r2.x, r2.y
    mul r2.y, r2.x, l(0.062500)
    ge r2.x, l(15.200000), r2.x
    and r2.x, r2.x, l(0x3f800000)
    add r6.xyz, r8.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    mad r6.xyz, r2.xxxx, r6.xyzx, r7.xyzx
    mad r2.x, -cb0[28].w, l(0.750000), r1.x
    mul r2.z, cb0[28].w, l(0.250000)
    div r2.z, l(1.000000, 1.000000, 1.000000, 1.000000), r2.z
    mul_sat r2.x, r2.z, r2.x
    mad_sat r2.xyz, r2.yyyy, r6.xyzx, r2.xxxx
  else
    mov r2.xyz, l(1.000000,1.000000,1.000000,0)
  endif
else
  mov r2.xyz, l(1.000000,1.000000,1.000000,0)
endif
mad r6.xy, r5.xzxx, cb0[3].xyxx, cb0[3].zwzz
sample r3.z, r6.xyxx, t14.yzxw, s14
mad_sat r3.z, -r3.z, cb0[2].w, l(1.000000)
mul r2.xyz, r2.xyzx, r3.zzzz
mad r3.xy, r3.xyxx, l(4.000000, 4.000000, 0.000000, 0.000000), l(-2.000000, -2.000000, 0.000000, 0.000000)
dp2 r3.z, r3.xyxx, r3.xyxx
mad r6.xy, -r3.zzzz, l(0.250000, 0.500000, 0.000000, 0.000000), l(1.000000, 1.000000, 0.000000, 0.000000)
max r3.z, r6.x, l(0.000000)
sqrt r3.z, r3.z
mul r3.xy, r3.zzzz, r3.xyxx
mul r6.xzw, r3.yyyy, cb0[24].xxyz
mad r3.xyz, r3.xxxx, cb0[23].xyzx, r6.xzwx
mad r3.xyz, -r6.yyyy, cb0[25].xyzx, r3.xyzx
dp3 r5.w, r5.xyzx, r5.xyzx
rsq r5.w, r5.w
mul r6.xyz, r5.wwww, r5.xyzx
dp3 r6.w, r6.xyzx, r3.xyzx
add r6.w, r6.w, r6.w
mad r7.xyz, r3.xyzx, -r6.wwww, r6.xyzx
dp3 r6.w, r7.xyzx, r7.xyzx
rsq r6.w, r6.w
mul r7.xyz, r6.wwww, r7.xyzx
min r4.w, r4.w, l(1.000000)
mul r0.xyzw, r0.xyzw, l(3.960000, 3.960000, 10.000000, 3.960000)
log r0.z, r0.z
mul r0.z, r0.z, l(2.200000)
exp r0.z, r0.z
mov_sat r6.w, r3.y
mul r6.w, r6.w, cb0[32].z
exp r0.xyw, r0.xyxw
add r0.xyw, -r1.yzyw, r0.xyxw
mad r0.xyw, r6.wwww, r0.xyxw, r1.yzyw
add_sat r1.y, r2.w, l(0.300000)
add r1.y, -r2.w, r1.y
mad r1.y, r6.w, r1.y, r2.w
lt r1.z, l(0.600000), r3.w
mov_sat r1.w, r1.y
movc r1.z, r1.z, r1.w, l(1.000000)
mul_sat r1.w, r1.x, l(0.020000)
max r8.xyz, r4.xyzx, r1.yyyy
add r8.xyz, -r4.xyzx, r8.xyzx
dp3_sat r6.x, r3.xyzx, -r6.xyzx
add r6.x, -r6.x, l(1.000000)
mul r6.y, r6.x, r6.x
mul r6.y, r6.y, r6.y
mul r6.x, r6.y, r6.x
mad r6.xyz, r8.xyzx, r6.xxxx, r4.xyzx
mul r8.xyz, r1.zzzz, r6.xyzx
mul r6.w, r1.y, l(13.000000)
mad r1.y, -r1.y, l(8.000000), r1.w
add r1.y, r1.y, l(8.000000)
sample_l r7.xyzw, r7.xyzx, t6.xyzw, s6, r1.y
mul r7.xyz, r7.wwww, r7.xyzx
mul r7.xyz, r8.xyzx, r7.xyzx
mul r7.xyz, r4.wwww, r7.xyzx
mul r7.xyz, r7.xyzx, cb0[0].xyzx
sample_l r8.xyzw, r3.xyzx, t4.xyzw, s4, l(8.000000)
mul r8.xyz, r8.wwww, r8.xyzx
mul r8.xyz, r4.wwww, r8.xyzx
mul r8.xyz, r8.xyzx, l(0.955413, 0.955413, 0.955413, 0.000000)
mad r6.xyz, -r6.xyzx, r1.zzzz, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r6.xyz, r8.xyzx, r6.xyzx
mad r6.xyz, r6.xyzx, cb0[0].xyzx, r0.zzzz
exp r0.z, r6.w
add r1.y, r0.z, l(8.000000)
mul r1.y, r1.y, l(0.0398089178)
mul r2.xyz, r2.xyzx, cb0[18].xyzx
mad r8.xyz, -r5.xyzx, r5.wwww, cb0[17].xyzx
dp3 r1.w, r8.xyzx, r8.xyzx
rsq r1.w, r1.w
mul r8.xyz, r1.wwww, r8.xyzx
dp3_sat r1.w, r8.xyzx, r3.xyzx
dp3 r6.w, r3.xyzx, cb0[17].xyzx
eq r3.w, r3.w, l(1.000000)
mad r7.w, r6.w, l(0.500000), l(0.500000)
movc_sat r6.w, r3.w, r7.w, r6.w
mul r2.xyz, r2.xyzx, r6.wwww
add r9.xyz, -r4.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
dp3 r6.w, cb0[17].xyzx, r8.xyzx
add r6.w, -r6.w, l(1.000000)
mul r7.w, r6.w, r6.w
mul r7.w, r7.w, r7.w
mul r6.w, r6.w, r7.w
mad r8.xyz, r9.xyzx, r6.wwww, r4.xyzx
mul r8.xyz, r1.zzzz, r8.xyzx
log r1.w, r1.w
mul r1.w, r0.z, r1.w
exp r1.w, r1.w
mul r1.w, r1.y, r1.w
mul r8.xyz, r8.xyzx, r1.wwww
mul r8.xyz, r2.xyzx, r8.xyzx
mul r8.xyz, r4.wwww, r8.xyzx
mad r2.xyz, r2.xyzx, l(0.318471, 0.318471, 0.318471, 0.000000), r6.xyzx
mad r6.xyz, r7.xyzx, l(8.000000, 8.000000, 8.000000, 0.000000), r8.xyzx
ftoi r7.xy, cb1[92].xyxx
ishl r1.w, r7.x, l(1)
mov r7.xzw, r2.xxyz
mov r8.xyz, r6.xyzx
mov r6.w, l(0)
loop
  ige r8.w, r6.w, r1.w
  breakc_nz r8.w
  mad r10.xyz, -v1.xyzx, r1.xxxx, cb1[r6.w + 73].xyzx

//point lights
mul r25.xyzw, r10.yyyy, cb13[1].xyzw
mad r25.xyzw, r10.xxxx, cb13[0].xyzw, r25.xyzw
mad r25.xyzw, r10.zzzz, cb13[2].xyzw, r25.xyzw
add r25.xyzw, cb13[3].xyzw, r25.xyzw
add r20.w, r1.x, -r20.y
div r20.w, r20.w, cb13[4].x
mad r25.x, r20.x, r20.w, r25.x
mul r10.xyzw, r25.yyyy, cb0[24].xyzw
mad r10.xyzw, r25.xxxx, cb0[23].xyzw, r10.xyzw
mad r10.xyzw, r25.zzzz, cb0[25].xyzw, r10.xyzw
mad r10.xyzw, r25.wwww, cb0[26].xyzw, r10.xyzw

  dp3 r8.w, r10.xyzx, r10.xyzx
  mul r9.w, cb1[r6.w + 73].w, cb1[r6.w + 73].w
  lt r9.w, r8.w, r9.w
  if_nz r9.w
    sqrt r8.w, r8.w
    add r9.w, -r8.w, cb1[r6.w + 73].w
    div r10.xyz, r10.xyzx, r8.wwww
    div_sat r8.w, r9.w, cb1[r6.w + 73].w
    mul r11.xyz, r8.wwww, cb1[r6.w + 72].xyzx
    mad r12.xyz, -r5.xyzx, r5.wwww, r10.xyzx
    dp3 r8.w, r12.xyzx, r12.xyzx
    rsq r8.w, r8.w
    mul r12.xyz, r8.wwww, r12.xyzx
    dp3_sat r8.w, r12.xyzx, r3.xyzx
    dp3 r9.w, r3.xyzx, r10.xyzx
    mad r10.w, r9.w, l(0.500000), l(0.500000)
    movc_sat r9.w, r3.w, r10.w, r9.w
    mul r11.xyz, r11.xyzx, r9.wwww
    dp3 r9.w, r10.xyzx, r12.xyzx
    add r9.w, -r9.w, l(1.00000)
    mul r10.x, r9.w, r9.w
    mul r10.x, r10.x, r10.x
    mul r9.w, r9.w, r10.x
    mad r10.xyz, r9.xyzx, r9.wwww, r4.xyzx
    mul r10.xyz, r1.zzzz, r10.xyzx
    log r8.w, r8.w
    mul r8.w, r0.z, r8.w
    exp r8.w, r8.w
    mul r8.w, r1.y, r8.w
    mul r10.xyz, r10.xyzx, r8.wwww
    mul r10.xyz, r11.xyzx, r10.xyzx
    mad r7.xzw, r11.xxyz, l(0.318471, 0.000000, 0.318471, 0.318471), r7.xxzw
    mad r8.xyz, r10.xyzx, r4.wwww, r8.xyzx
  endif
  iadd r6.w, r6.w, l(2)
endloop
imul null, r1.w, r7.y, l(9)
mov r2.xyz, r7.xzwx
mov r6.xyz, r8.xyzx
mov r6.w, l(0)
loop
  ige r7.y, r6.w, r1.w
  breakc_nz r7.y
  mul r10.xyzw, r5.yyyy, cb1[r6.w + 3].xyzw
  mad r10.xyzw, r5.xxxx, cb1[r6.w + 2].xyzw, r10.xyzw
  mad r10.xyzw, r5.zzzz, cb1[r6.w + 4].xyzw, r10.xyzw
  add r10.xyzw, r10.xyzw, cb1[r6.w + 5].xyzw
  div r10.xyz, r10.zxyz, r10.wwww
  round_ni r11.xyz, r10.yzxy
  ne r11.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r11.xyzx
  or r7.y, r11.y, r11.x
  or r7.y, r11.z, r7.y
  if_z r7.y
    mad r11.xyz, -v1.xyzx, r1.xxxx, cb1[r6.w + 1].xyzx

//spotlights
mul r25.xyzw, r11.yyyy, cb13[1].xyzw
mad r25.xyzw, r11.xxxx, cb13[0].xyzw, r25.xyzw
mad r25.xyzw, r11.zzzz, cb13[2].xyzw, r25.xyzw
add r25.xyzw, cb13[3].xyzw, r25.xyzw
add r20.w, r1.x, -r20.y
div r20.w, r20.w, cb13[4].x
mad r25.x, r20.x, r20.w, r25.x
mul r11.xyzw, r25.yyyy, cb0[24].xyzw
mad r11.xyzw, r25.xxxx, cb0[23].xyzw, r11.xyzw
mad r11.xyzw, r25.zzzz, cb0[25].xyzw, r11.xyzw
mad r11.xyzw, r25.wwww, cb0[26].xyzw, r11.xyzw

    dp3 r7.y, r11.xyzx, r11.xyzx
    sqrt r7.y, r7.y
    add r8.w, -r7.y, cb1[r6.w + 1].w
    div r11.xyz, r11.xyzx, r7.yyyy
    div r7.y, l(1.000000, 1.000000, 1.000000, 1.000000), cb1[r6.w + 1].w
    mul_sat r7.y, r7.y, r8.w
    mad r12.xy, cb1[r6.w + 7].zwzz, r10.yzyy, cb1[r6.w + 7].xyxx
    sample_l r8.w, r12.xyxx, t8.yzwx, s8, l(0.000000)
    mul r7.y, r7.y, r8.w
    mul r7.y, r7.y, r7.y
    mov_sat r10.x, r10.x
    mad r10.yz, cb1[r6.w + 8].zzwz, r10.yyzy, cb1[r6.w + 8].xxyx
    sample_c_lz r8.w, r10.yzyy, t7.xxxx, s7, r10.x
    mul r7.y, r7.y, r8.w
    mul r10.xyz, r7.yyyy, cb1[r6.w + 0].xyzx
    mad r12.xyz, -r5.xyzx, r5.wwww, r11.xyzx
    dp3 r7.y, r12.xyzx, r12.xyzx
    rsq r7.y, r7.y
    mul r12.xyz, r7.yyyy, r12.xyzx
    dp3_sat r7.y, r12.xyzx, r3.xyzx
    dp3 r8.w, r3.xyzx, r11.xyzx
    mad r9.w, r8.w, l(0.500000), l(0.500000)
    movc_sat r8.w, r3.w, r9.w, r8.w
    mul r10.xyz, r10.xyzx, r8.wwww
    dp3 r8.w, r11.xyzx, r12.xyzx
    add r8.w, -r8.w, l(1.000000)
    mul r9.w, r8.w, r8.w
    mul r9.w, r9.w, r9.w
    mul r8.w, r8.w, r9.w
    mad r11.xyz, r9.xyzx, r8.wwww, r4.xyzx
    mul r11.xyz, r1.zzzz, r11.xyzx
    log r7.y, r7.y
    mul r7.y, r0.z, r7.y
    exp r7.y, r7.y
    mul r7.y, r1.y, r7.y
    mul r11.xyz, r11.xyzx, r7.yyyy
    mul r11.xyz, r10.xyzx, r11.xyzx
    mad r2.xyz, r10.xyzx, l(0.318471, 0.318471, 0.318471, 0.000000), r2.xyzx
    mad r6.xyz, r11.xyzx, r4.wwww, r6.xyzx
  endif
  iadd r6.w, r6.w, l(9)
endloop
mad o0.xyz, r2.xyzx, r0.xywx, r6.xyzx
mov o0.w, r2.w
ret
// Approximately 365 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v1.3.16 on Mon Jul 20 23:36:53 2020
//
// cbuffer constantsPS : register(b0)
// {
//   float4 gp_ambientRefColorsZConv[2] : packoffset(c0);
//   float4 gp_upVector_cloudDensity : packoffset(c2);
//   float4 gp_cloudShadowTransform[2] : packoffset(c3);
//   row_major float3x4 gp_matrixPSSM[4] : packoffset(c5);
//   float3 gp_directionPSSM : packoffset(c17);
//   float gp_maxShadowDepth : packoffset(c17.w);
//   float3 gp_colorPSSM : packoffset(c18);
//   float gp_aoIntensity : packoffset(c18.w);
//   float4 gp_shadowDepthScale[4] : packoffset(c19);
//   row_major float4x4 gv_matrixVInv : packoffset(c23);
//   float gp_PCFSteps : packoffset(c27);
//   float2 gp_texelSize : packoffset(c27.y);
//   float gp_useShadow : packoffset(c27.w);
//   float2 gp_uvMulAO : packoffset(c28);
//   float gp_blendFactor : packoffset(c28.z);
//   float gp_shadowDrawDistance : packoffset(c28.w);
//   float4 gp_depthConversion : packoffset(c29);
//   float4 gp_AOParams : packoffset(c30);
//   float4 gp_AORangeParams : packoffset(c31);
//   float gp_contribIntensity : packoffset(c32);
//   float gp_skyMips : packoffset(c32.y);
//   float gp_humidityIntensity : packoffset(c32.z);
//   float gp_padding1 : packoffset(c32.w);
// }
//
// cbuffer variablesPS : register(b1)
// {
//   float4 gp_spotLights[72] : packoffset(c0);
//   float4 gp_pointLights[20] : packoffset(c72);
//   float2 gp_numLights : packoffset(c92);
//   float2 gp_padding2 : packoffset(c92.z);
// }
//
// SamplerState Reflection_CubeMapSampler_s : register(s4);
// SamplerState Specular_CubeMapSampler_s : register(s6);
// SamplerState lightMaskTextureSampler_s : register(s8);
// SamplerState projectorPSSMSampler_s : register(s13);
// SamplerState cloudShadowTexSampler_s : register(s14);
// SamplerState projectorPSSM2Sampler_s : register(s15);
// SamplerComparisonState shadowMapPSSMSampler_s : register(s5);
// SamplerComparisonState lightMapTextureSampler_s : register(s7);
// Texture2D<float4> gbufferDepth : register(t0);
// Texture2D<float4> gbuffer1 : register(t1);
// Texture2D<float4> gbuffer2 : register(t2);
// Texture2D<float4> gbuffer3 : register(t3);
// TextureCube<float4> Reflection_CubeMap : register(t4);
// Texture2DArray<float4> shadowMapPSSM : register(t5);
// TextureCube<float4> Specular_CubeMap : register(t6);
// Texture2D<float4> lightMapTexture : register(t7);
// Texture2D<float4> lightMaskTexture : register(t8);
// Texture2DArray<float4> projectorPSSM : register(t13);
// Texture2D<float4> cloudShadowTex : register(t14);
// Texture2DArray<float4> projectorPSSM2 : register(t15);
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Texture2D<float4> StereoParams : register(t125);
//
//
// void main(
//   float4 v0 : SV_Position0,
//   float3 v1 : TEXCOORD0,
//   out float4 o0 : SV_Target0)
// {
//   float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
//   r0.xy = (int2)v0.xy;
//   r0.zw = float2(0,0);
//   r1.x = gbufferDepth.Load(r0.xyw).x;
//   r2.xyzw = gbuffer1.Load(r0.xyw).xyzw;
//   r3.xyzw = gbuffer2.Load(r0.xyw).xyzw;
//   r0.xyzw = gbuffer3.Load(r0.xyz).xyzw;
//   r4.xzw = r0.xyw;
//   r4.y = r3.z;
//   r4.xyzw = log2(abs(r4.xyzw));
//   r4.xyzw = float4(2.20000005,2.20000005,2.20000005,2.20000005) * r4.xyzw;
//   r4.xyzw = exp2(r4.xyzw);
//   r0.xyw = log2(r2.xyz);
//   r1.yzw = float3(2.20000005,2.20000005,2.20000005) * r0.xyw;
//   r1.yzw = exp2(r1.yzw);
//   r1.x = -gp_ambientRefColorsZConv[0].w + r1.x;
//   r1.x = gp_ambientRefColorsZConv[1].w / r1.x;
//   r5.xyz = v1.xyz * r1.xxx;
//   r2.x = cmp(gp_useShadow == 1.000000);
//   if (r2.x != 0) {
//     r2.x = cmp(r1.x < gp_shadowDrawDistance);
//     if (r2.x != 0) {
//       r5.w = 1;
//       r2.x = dot(gp_matrixPSSM[0]._m00_m01_m02_m03, r5.xyzw);
//       r2.y = dot(gp_matrixPSSM[0]._m10_m11_m12_m13, r5.xyzw);
//       r2.z = dot(gp_matrixPSSM[0]._m20_m21_m22_m23, r5.xyzw);
//       r6.x = dot(gp_matrixPSSM[0]._m30_m31_m32_m33, r5.xyzw);
//       r6.y = dot(gp_matrixPSSM[1]._m00_m01_m02_m03, r5.xyzw);
//       r6.z = dot(gp_matrixPSSM[1]._m10_m11_m12_m13, r5.xyzw);
//       r7.x = dot(gp_matrixPSSM[1]._m20_m21_m22_m23, r5.xyzw);
//       r7.y = dot(gp_matrixPSSM[1]._m30_m31_m32_m33, r5.xyzw);
//       r7.z = dot(gp_matrixPSSM[2]._m00_m01_m02_m03, r5.xyzw);
//       r8.x = dot(gp_matrixPSSM[2]._m10_m11_m12_m13, r5.xyzw);
//       r8.y = dot(gp_matrixPSSM[2]._m20_m21_m22_m23, r5.xyzw);
//       r8.z = dot(gp_matrixPSSM[2]._m30_m31_m32_m33, r5.xyzw);
//       r9.xyz = r2.xyz * float3(1.01185775,1.01185775,-1.04999995) + float3(-0.00592885399,-0.00592885399,1);
//       r9.xyz = floor(r9.xyz);
//       r9.xyz = cmp(float3(0,0,0) != r9.xyz);
//       r3.z = (int)r9.y | (int)r9.x;
//       r3.z = (int)r9.z | (int)r3.z;
//       r9.xyz = r6.xyz * float3(1.01185775,1.01185775,-1.04999995) + float3(-0.00592885399,-0.00592885399,1);
//       r9.xyz = floor(r9.xyz);
//       r9.xyz = cmp(float3(0,0,0) != r9.xyz);
//       r5.w = (int)r9.y | (int)r9.x;
//       r5.w = (int)r9.z | (int)r5.w;
//       r9.xyz = r7.xyz * float3(1.01185775,1.01185775,-1.04999995) + float3(-0.00592885399,-0.00592885399,1);
//       r9.xyz = floor(r9.xyz);
//       r9.xyz = cmp(float3(0,0,0) != r9.xyz);
//       r6.w = (int)r9.y | (int)r9.x;
//       r6.w = (int)r9.z | (int)r6.w;
//       r6.w = r6.w ? 3 : 2;
//       r5.w = r5.w ? r6.w : 1;
//       r5.w = (int)r3.z & (int)r5.w;
//       r9.xy = cmp((int2)r5.ww == int2(1,2));
//       r7.xyz = r9.yyy ? r7.xyz : r8.xyz;
//       r6.xyz = r9.xxx ? r6.xyz : r7.xyz;
//       r6.xyz = r3.zzz ? r6.xyz : r2.xyz;
//       r2.x = 1 + -r6.z;
//       r6.w = (int)r5.w;
//       r7.xyz = projectorPSSM.SampleLevel(projectorPSSMSampler_s, r6.xyw, 0).xyz;
//       r8.xyz = projectorPSSM2.SampleLevel(projectorPSSM2Sampler_s, r6.xyw, 0).xyz;
//       r2.y = cmp(r3.w == 1.000000);
//       r9.xyz = saturate(float3(0.5,0.5,0.5) + r7.xyz);
//       r7.xyz = r2.yyy ? r9.xyz : r7.xyz;
//       r9.xyz = saturate(float3(0.5,0.5,0.5) + r8.xyz);
//       r8.xyz = r2.yyy ? r9.xyz : r8.xyz;
//       r2.x = -gp_shadowDepthScale[r5.w].y + r2.x;
//       r2.x = saturate(r2.x / gp_shadowDepthScale[r5.w].x);
//       r2.x = 1 + -r2.x;
//       r9.xy = float2(-1.5,-1.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.y = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r9.xy = float2(-1.5,-0.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(-1.5,0.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(-1.5,1.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(-0.5,-1.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(-0.5,-0.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(-0.5,0.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(-0.5,1.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(0.5,-1.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(0.5,-0.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(0.5,0.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(0.5,1.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(1.5,-1.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(1.5,-0.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(1.5,0.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r9.xyz = r9.xyz + r6.xyw;
//       r2.z = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r9.xyz, r2.x).x;
//       r2.y = r2.y + r2.z;
//       r9.xy = float2(1.5,1.5) * gp_texelSize.xy;
//       r9.z = 0;
//       r6.xyz = r9.xyz + r6.xyw;
//       r2.x = shadowMapPSSM.SampleCmpLevelZero(shadowMapPSSMSampler_s, r6.xyz, r2.x).x;
//       r2.x = r2.y + r2.x;
//       r2.y = 0.0625 * r2.x;
//       r2.x = cmp(15.1999998 >= r2.x);
//       r2.x = r2.x ? 1.000000 : 0;
//       r6.xyz = float3(-1,-1,-1) + r8.xyz;
//       r6.xyz = r2.xxx * r6.xyz + r7.xyz;
//       r2.x = -gp_shadowDrawDistance * 0.75 + r1.x;
//       r2.z = 0.25 * gp_shadowDrawDistance;
//       r2.z = 1 / r2.z;
//       r2.x = saturate(r2.x * r2.z);
//       r2.xyz = saturate(r2.yyy * r6.xyz + r2.xxx);
//     } else {
//       r2.xyz = float3(1,1,1);
//     }
//   } else {
//     r2.xyz = float3(1,1,1);
//   }
//   r6.xy = r5.xz * gp_cloudShadowTransform[0].xy + gp_cloudShadowTransform[0].zw;
//   r3.z = cloudShadowTex.Sample(cloudShadowTexSampler_s, r6.xy).x;
//   r3.z = saturate(-r3.z * gp_upVector_cloudDensity.w + 1);
//   r2.xyz = r3.zzz * r2.xyz;
//   r3.xy = r3.xy * float2(4,4) + float2(-2,-2);
//   r3.z = dot(r3.xy, r3.xy);
//   r6.xy = -r3.zz * float2(0.25,0.5) + float2(1,1);
//   r3.z = max(0, r6.x);
//   r3.z = sqrt(r3.z);
//   r3.xy = r3.xy * r3.zz;
//   r6.xzw = gv_matrixVInv._m10_m11_m12 * r3.yyy;
//   r3.xyz = r3.xxx * gv_matrixVInv._m00_m01_m02 + r6.xzw;
//   r3.xyz = -r6.yyy * gv_matrixVInv._m20_m21_m22 + r3.xyz;
//   r5.w = dot(r5.xyz, r5.xyz);
//   r5.w = rsqrt(r5.w);
//   r6.xyz = r5.xyz * r5.www;
//   r6.w = dot(r6.xyz, r3.xyz);
//   r6.w = r6.w + r6.w;
//   r7.xyz = r3.xyz * -r6.www + r6.xyz;
//   r6.w = dot(r7.xyz, r7.xyz);
//   r6.w = rsqrt(r6.w);
//   r7.xyz = r7.xyz * r6.www;
//   r4.w = min(1, r4.w);
//   r0.xyzw = float4(3.96000004,3.96000004,10,3.96000004) * r0.xyzw;
//   r0.z = log2(r0.z);
//   r0.z = 2.20000005 * r0.z;
//   r0.z = exp2(r0.z);
//   r6.w = saturate(r3.y);
//   r6.w = gp_humidityIntensity * r6.w;
//   r0.xyw = exp2(r0.xyw);
//   r0.xyw = r0.xyw + -r1.yzw;
//   r0.xyw = r6.www * r0.xyw + r1.yzw;
//   r1.y = saturate(0.300000012 + r2.w);
//   r1.y = r1.y + -r2.w;
//   r1.y = r6.w * r1.y + r2.w;
//   r1.z = cmp(0.600000024 < r3.w);
//   r1.w = saturate(r1.y);
//   r1.z = r1.z ? r1.w : 1;
//   r1.w = saturate(0.0199999996 * r1.x);
//   r8.xyz = max(r1.yyy, r4.xyz);
//   r8.xyz = r8.xyz + -r4.xyz;
//   r6.x = saturate(dot(r3.xyz, -r6.xyz));
//   r6.x = 1 + -r6.x;
//   r6.y = r6.x * r6.x;
//   r6.y = r6.y * r6.y;
//   r6.x = r6.x * r6.y;
//   r6.xyz = r8.xyz * r6.xxx + r4.xyz;
//   r8.xyz = r6.xyz * r1.zzz;
//   r6.w = 13 * r1.y;
//   r1.y = -r1.y * 8 + r1.w;
//   r1.y = 8 + r1.y;
//   r7.xyzw = Specular_CubeMap.SampleLevel(Specular_CubeMapSampler_s, r7.xyz, r1.y).xyzw;
//   r7.xyz = r7.xyz * r7.www;
//   r7.xyz = r7.xyz * r8.xyz;
//   r7.xyz = r7.xyz * r4.www;
//   r7.xyz = gp_ambientRefColorsZConv[0].xyz * r7.xyz;
//   r8.xyzw = Reflection_CubeMap.SampleLevel(Reflection_CubeMapSampler_s, r3.xyz, 8).xyzw;
//   r8.xyz = r8.xyz * r8.www;
//   r8.xyz = r8.xyz * r4.www;
//   r8.xyz = float3(0.955412984,0.955412984,0.955412984) * r8.xyz;
//   r6.xyz = -r6.xyz * r1.zzz + float3(1,1,1);
//   r6.xyz = r6.xyz * r8.xyz;
//   r6.xyz = r6.xyz * gp_ambientRefColorsZConv[0].xyz + r0.zzz;
//   r0.z = exp2(r6.w);
//   r1.y = 8 + r0.z;
//   r1.y = 0.0398089178 * r1.y;
//   r2.xyz = gp_colorPSSM.xyz * r2.xyz;
//   r8.xyz = -r5.xyz * r5.www + gp_directionPSSM.xyz;
//   r1.w = dot(r8.xyz, r8.xyz);
//   r1.w = rsqrt(r1.w);
//   r8.xyz = r8.xyz * r1.www;
//   r1.w = saturate(dot(r8.xyz, r3.xyz));
//   r6.w = dot(r3.xyz, gp_directionPSSM.xyz);
//   r3.w = cmp(r3.w == 1.000000);
//   r7.w = r6.w * 0.5 + 0.5;
//   r6.w = saturate(r3.w ? r7.w : r6.w);
//   r2.xyz = r6.www * r2.xyz;
//   r9.xyz = float3(1,1,1) + -r4.xyz;
//   r6.w = dot(gp_directionPSSM.xyz, r8.xyz);
//   r6.w = 1 + -r6.w;
//   r7.w = r6.w * r6.w;
//   r7.w = r7.w * r7.w;
//   r6.w = r7.w * r6.w;
//   r8.xyz = r9.xyz * r6.www + r4.xyz;
//   r8.xyz = r8.xyz * r1.zzz;
//   r1.w = log2(r1.w);
//   r1.w = r1.w * r0.z;
//   r1.w = exp2(r1.w);
//   r1.w = r1.w * r1.y;
//   r8.xyz = r1.www * r8.xyz;
//   r8.xyz = r8.xyz * r2.xyz;
//   r8.xyz = r8.xyz * r4.www;
//   r2.xyz = r2.xyz * float3(0.318471014,0.318471014,0.318471014) + r6.xyz;
//   r6.xyz = r7.xyz * float3(8,8,8) + r8.xyz;
//   r7.xy = (int2)gp_numLights.xy;
//   r1.w = (uint)r7.x << 1;
//   r7.xzw = r2.xyz;
//   r8.xyz = r6.xyz;
//   r6.w = 0;
//   while (true) {
//     r8.w = cmp((int)r6.w >= (int)r1.w);
//     if (r8.w != 0) break;
//     r10.xyz = -v1.xyz * r1.xxx + gp_pointLights[r6.w+73].xyz;
//     r8.w = dot(r10.xyz, r10.xyz);
//     r9.w = gp_pointLights[r6.w+73].w * gp_pointLights[r6.w+73].w;
//     r9.w = cmp(r8.w < r9.w);
//     if (r9.w != 0) {
//       r8.w = sqrt(r8.w);
//       r9.w = gp_pointLights[r6.w+73].w + -r8.w;
//       r10.xyz = r10.xyz / r8.www;
//       r8.w = saturate(r9.w / gp_pointLights[r6.w+73].w);
//       r11.xyz = gp_pointLights[r6.w].xyz * r8.www;
//       r12.xyz = -r5.xyz * r5.www + r10.xyz;
//       r8.w = dot(r12.xyz, r12.xyz);
//       r8.w = rsqrt(r8.w);
//       r12.xyz = r12.xyz * r8.www;
//       r8.w = saturate(dot(r12.xyz, r3.xyz));
//       r9.w = dot(r3.xyz, r10.xyz);
//       r10.w = r9.w * 0.5 + 0.5;
//       r9.w = saturate(r3.w ? r10.w : r9.w);
//       r11.xyz = r9.www * r11.xyz;
//       r9.w = dot(r10.xyz, r12.xyz);
//       r9.w = 1 + -r9.w;
//       r10.x = r9.w * r9.w;
//       r10.x = r10.x * r10.x;
//       r9.w = r10.x * r9.w;
//       r10.xyz = r9.xyz * r9.www + r4.xyz;
//       r10.xyz = r10.xyz * r1.zzz;
//       r8.w = log2(r8.w);
//       r8.w = r8.w * r0.z;
//       r8.w = exp2(r8.w);
//       r8.w = r8.w * r1.y;
//       r10.xyz = r8.www * r10.xyz;
//       r10.xyz = r10.xyz * r11.xyz;
//       r7.xzw = r11.xyz * float3(0.318471014,0.318471014,0.318471014) + r7.xzw;
//       r8.xyz = r10.xyz * r4.www + r8.xyz;
//     }
//     r6.w = (int)r6.w + 2;
//   }
//   r1.w = (int)r7.y * 9;
//   r2.xyz = r7.xzw;
//   r6.xyz = r8.xyz;
//   r6.w = 0;
//   while (true) {
//     r7.y = cmp((int)r6.w >= (int)r1.w);
//     if (r7.y != 0) break;
//     r10.xyzw = gp_spotLights[r6.w+3].xyzw * r5.yyyy;
//     r10.xyzw = r5.xxxx * gp_spotLights[r6.w+2].xyzw + r10.xyzw;
//     r10.xyzw = r5.zzzz * gp_spotLights[r6.w+4].xyzw + r10.xyzw;
//     r10.xyzw = gp_spotLights[r6.w+5].xyzw + r10.xyzw;
//     r10.xyz = r10.zxy / r10.www;
//     r11.xyz = floor(r10.yzx);
//     r11.xyz = cmp(float3(0,0,0) != r11.xyz);
//     r7.y = (int)r11.y | (int)r11.x;
//     r7.y = (int)r11.z | (int)r7.y;
//     if (r7.y == 0) {
//       r11.xyz = -v1.xyz * r1.xxx + gp_spotLights[r6.w+1].xyz;
//       r7.y = dot(r11.xyz, r11.xyz);
//       r7.y = sqrt(r7.y);
//       r8.w = gp_spotLights[r6.w+1].w + -r7.y;
//       r11.xyz = r11.xyz / r7.yyy;
//       r7.y = 1 / gp_spotLights[r6.w+1].w;
//       r7.y = saturate(r8.w * r7.y);
//       r12.xy = gp_spotLights[r6.w+7].zw * r10.yz + gp_spotLights[r6.w+7].xy;
//       r8.w = lightMaskTexture.SampleLevel(lightMaskTextureSampler_s, r12.xy, 0).x;
//       r7.y = r8.w * r7.y;
//       r7.y = r7.y * r7.y;
//       r10.x = saturate(r10.x);
//       r10.yz = gp_spotLights[r6.w+8].zw * r10.yz + gp_spotLights[r6.w+8].xy;
//       r8.w = lightMapTexture.SampleCmpLevelZero(lightMapTextureSampler_s, r10.yz, r10.x).x;
//       r7.y = r8.w * r7.y;
//       r10.xyz = gp_spotLights[r6.w].xyz * r7.yyy;
//       r12.xyz = -r5.xyz * r5.www + r11.xyz;
//       r7.y = dot(r12.xyz, r12.xyz);
//       r7.y = rsqrt(r7.y);
//       r12.xyz = r12.xyz * r7.yyy;
//       r7.y = saturate(dot(r12.xyz, r3.xyz));
//       r8.w = dot(r3.xyz, r11.xyz);
//       r9.w = r8.w * 0.5 + 0.5;
//       r8.w = saturate(r3.w ? r9.w : r8.w);
//       r10.xyz = r8.www * r10.xyz;
//       r8.w = dot(r11.xyz, r12.xyz);
//       r8.w = 1 + -r8.w;
//       r9.w = r8.w * r8.w;
//       r9.w = r9.w * r9.w;
//       r8.w = r9.w * r8.w;
//       r11.xyz = r9.xyz * r8.www + r4.xyz;
//       r11.xyz = r11.xyz * r1.zzz;
//       r7.y = log2(r7.y);
//       r7.y = r7.y * r0.z;
//       r7.y = exp2(r7.y);
//       r7.y = r7.y * r1.y;
//       r11.xyz = r7.yyy * r11.xyz;
//       r11.xyz = r11.xyz * r10.xyz;
//       r2.xyz = r10.xyz * float3(0.318471014,0.318471014,0.318471014) + r2.xyz;
//       r6.xyz = r11.xyz * r4.www + r6.xyz;
//     }
//     r6.w = (int)r6.w + 9;
//   }
//   o0.xyz = r2.xyz * r0.xyw + r6.xyz;
//   o0.w = r2.w;
//   return;
// }
//////////////////////////////// HLSL Errors ////////////////////////////////
// D:\Trials Fusion\datapack\ShaderFixes\61776ba4b7221593-ps_replace.txt(100,18-50): error X3018: invalid subscript '_m30_m31_m32_m33'
/////////////////////////////////////////////////////////////////////////////
