// ??
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.16 on Sat May 18 07:48:08 2019
//
//
// Buffer Definitions:
//
// cbuffer CBufferGlobalConstant_Z
// {
//
//   struct StructGlobalConstant_Z
//   {
//
//       float4 c[90];                  // Offset:    0
//
//   } Global;                          // Offset:    0 Size:  1440
//
// }
//
// cbuffer CBufferScatteringConstant_Z
// {
//
//   struct StructScatteringConstant_Z
//   {
//
//       float4 c[36];                  // Offset:    0
//
//   } Scattering;                      // Offset:    0 Size:   576
//
// }
//
// cbuffer CBufferLightConstant_Z
// {
//
//   struct StructLightConstant_Z
//   {
//
//       float4 c[3];                   // Offset:    0
//
//   } Light;                           // Offset:    0 Size:    48
//
// }
//
// cbuffer CBufferObjectConstant_Z
// {
//
//   struct StructObjectConstant_Z
//   {
//
//       float4 c[32];                  // Offset:    0
//
//   } Object;                          // Offset:    0 Size:   512
//
// }
//
// cbuffer CBufferShadowReceiveConstant_Z
// {
//
//   struct StructShadowReceiveConstant_Z
//   {
//
//       struct ShadowMatrix
//       {
//
//           float4x4 Mat;              // Offset:    0
//           float4 NormalBias;         // Offset:   64
//
//       } Slices[4];                   // Offset:    0
//       float4 TextureSize;            // Offset:  320
//       float4 FadeParams;             // Offset:  336
//       float4 SliceDistMin;           // Offset:  352
//       float4 SliceDistMax;           // Offset:  368
//
//   } Shadow;                          // Offset:    0 Size:   384
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// sMaterialSampler                  sampler      NA          NA    0        1
// sEnvCubeSampler                   sampler      NA          NA    1        1
// sShadowMapSampler               sampler_c      NA          NA    2        1
// sRenderTargetSampler              sampler      NA          NA    3        1
// sFogOcclusionSampler              sampler      NA          NA    4        1
// sMipFog0Sampler                   sampler      NA          NA    5        1
// sDiffuse                          texture  float4          2d    0        1
// sNormalRoughMetal                 texture  float4          2d    1        1
// sEnvCube                          texture  float4        cube    2        1
// sShadowMap                        texture  float4     2darray    3        1
// sBlueNoiseR8                      texture  float4     2darray    4        1
// sRenderTarget                     texture  float4          2d    5        1
// sFogOcclusion                     texture  float4          2d    6        1
// sMipFog0                          texture  float4          2d    7        1
// sMipFog1                          texture  float4          2d    8        1
// CBufferGlobalConstant_Z           cbuffer      NA          NA    0        1
// CBufferScatteringConstant_Z       cbuffer      NA          NA    1        1
// CBufferLightConstant_Z            cbuffer      NA          NA    2        1
// CBufferObjectConstant_Z           cbuffer      NA          NA    3        1
// CBufferShadowReceiveConstant_Z    cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
// PREVIOUS_POSITION        0   xyzw        1     NONE   float
// COLOR                    0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xyzw        3     NONE   float   xy
// TEXSPACE_MAT             0   xyzw        4     NONE   float   xyzw
// TEXSPACE_MAT             1   xyzw        5     NONE   float   xyzw
// TEXSPACE_MAT             2   xyzw        6     NONE   float   xyzw
// SHADOW_TCPROJ            0   xyzw        7     NONE   float   xyz
// INSTANCE_COLOR           0   x           8     NONE   float
// INSTANCE_INDEXES         0   xy          9     NONE    uint
//
//
// 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[53], immediateIndexed
dcl_constantbuffer cb1[27], immediateIndexed
dcl_constantbuffer cb2[3], immediateIndexed
dcl_constantbuffer cb3[26], immediateIndexed
dcl_constantbuffer cb4[22], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_comparison
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texturecube (float,float,float,float) t2
dcl_resource_texture2darray (float,float,float,float) t3
dcl_resource_texture2darray (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2d (float,float,float,float) t8
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v2.xyzw
dcl_input_ps linear v3.xy
dcl_input_ps linear v4.xyzw
dcl_input_ps linear v5.xyzw
dcl_input_ps linear v6.xyzw
dcl_input_ps linear v7.xyz
dcl_output o0.xyzw
dcl_temps 14
mov r0.x, v4.w
mov r0.y, v5.w
mov r0.z, v6.w
add r1.xyz, -r0.zxyz, cb0[2].zxyz
dp3 r1.w, r1.xyzx, r1.xyzx
rsq r1.w, r1.w
mul r2.xyz, r1.wwww, r1.xyzx
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, v3.xyxx, t0.xyzw, s0
mul r4.xyz, r3.xyzx, cb3[20].xyzx
mul r5.xyzw, r3.wxyz, cb3[21].wxyz
mul r2.w, r5.x, v2.w
sample_indexable(texture2d)(float,float,float,float) r6.xyzw, v3.xyxx, t1.xyzw, s0
mul r3.xy, r6.zxzz, cb3[23].yxyy
mad r6.yw, r6.yyyw, l(0.000000, 2.000000, 0.000000, 2.000000), l(0.000000, -1.000000, 0.000000, -1.000000)
mul r6.yw, r6.yyyw, cb3[23].zzzz
dp2 r3.z, r6.ywyy, r6.ywyy
add r3.z, -r3.z, l(1.000000)
max r3.z, r3.z, l(0.000000)
sqrt r3.z, r3.z



mul r7.xyz, r6.wwww, v5.xyzx
mad r7.xyz, r6.yyyy, v4.xyzx, r7.xyzx
mad r7.xyz, r3.zzzz, v6.xyzx, r7.xyzx
dp3 r3.z, r7.xyzx, r7.xyzx
rsq r3.z, r3.z
mul r8.xyz, r3.zzzz, r7.xyzx
mul r9.xyz, v2.xyzx, cb3[18].xyzx
mul r4.xyz, r4.xyzx, r9.xyzx
mul r5.yzw, r5.yyzw, r9.xxyz
mad r3.w, v2.w, r3.w, l(-1.000000)
mad r3.w, cb3[25].z, r3.w, l(1.000000)
mul r3.w, r3.w, cb3[18].w
ne r4.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[12].z
if_nz r4.w
  mad r4.w, r8.z, l(0.050000), v6.y
  mad_sat r4.w, r4.w, l(3.000000), l(-1.000000)
  mad r3.y, -r3.y, l(0.900000), l(1.000000)
  mul r3.y, r3.y, r3.x
  add r9.xyz, cb0[12].zzzz, l(-0.010000, -0.200000, -0.450000, 0.000000)
  mul_sat r6.yw, r9.xxxy, l(0.000000, 2.94117641, 0.000000, 1.250000)
  mul r3.y, r3.y, r6.y
  mad r9.xyw, r4.xyxz, r4.xyxz, -r4.xyxz
  mad r4.xyz, r3.yyyy, r9.xywx, r4.xyzx
  mul r3.y, r3.x, r3.x
  mul r3.y, r3.x, r3.y
  mul r6.y, r3.y, l(0.150000)
  mad r3.y, -r3.y, l(0.150000), l(0.050000)
  mad r3.y, r4.w, r3.y, r6.y
  mad r3.y, -cb3[23].y, r6.z, r3.y
  mad r3.x, r6.w, r3.y, r3.x
  mad r6.yzw, -r7.xxyz, r3.zzzz, v6.xxyz
  mul r6.yzw, r4.wwww, r6.yyzw
  add_sat r3.y, r9.z, r9.z
  mad r8.xyz, r3.yyyy, r6.yzwy, r8.xyzx
endif
dp3 r3.y, r8.xyzx, r8.xyzx
rsq r3.y, r3.y
mul r6.yzw, r3.yyyy, r8.xxyz
dp3 r3.y, r6.wyzw, r2.xyzx
mad r3.z, -cb3[23].x, r6.x, l(1.000000)
mul r4.xyz, r3.zzzz, r4.xyzx
mov_sat r3.z, r3.y
mad r7.xyzw, r3.xxxx, l(-1.000000, -0.027500, -0.572000, 0.022000), l(1.000000, 0.042500, 1.040000, -0.040000)
mul r4.w, r7.x, r7.x
mul r3.z, r3.z, l(-9.280000)
exp r3.z, r3.z
min r3.z, r3.z, r4.w
mad r3.z, r3.z, r7.x, r7.y
mad r7.xy, r3.zzzz, l(-1.040000, 1.040000, 0.000000, 0.000000), r7.zwzz
mad r3.z, r7.x, l(0.050000), r7.y
mul r7.xyz, cb2[1].xyzx, cb3[19].yyyy
dp3 r4.w, r6.yzwy, cb2[0].xyzx
lt r6.x, l(0.000000), cb4[21].w
if_nz r6.x
  dp3 r8.x, r6.yzwy, cb0[31].xyzx
  dp3 r8.y, r6.yzwy, cb0[32].xyzx
  dp3 r8.z, r6.yzwy, cb0[33].xyzx
  mad r9.xyz, r8.xyzx, cb4[4].xyzx, v7.xyzx
  dp3 r6.x, r9.xyzx, cb4[0].xyzx
  dp3 r7.w, r9.xyzx, cb4[1].xyzx
  dp3 r8.w, r9.xyzx, cb4[2].xyzx
  add r9.x, r6.x, cb4[0].w
  add r9.y, r7.w, cb4[1].w
  add r9.z, r8.w, cb4[2].w
  mad r10.xyz, r8.xyzx, cb4[9].xyzx, v7.xyzx
  dp3 r6.x, r10.xyzx, cb4[5].xyzx
  dp3 r7.w, r10.xyzx, cb4[6].xyzx
  dp3 r8.w, r10.xyzx, cb4[7].xyzx
  add r10.x, r6.x, cb4[5].w
  add r10.y, r7.w, cb4[6].w
  add r10.z, r8.w, cb4[7].w
  mad r11.xyz, r8.xyzx, cb4[14].xyzx, v7.xyzx
  dp3 r6.x, r11.xyzx, cb4[10].xyzx
  dp3 r7.w, r11.xyzx, cb4[11].xyzx
  dp3 r8.w, r11.xyzx, cb4[12].xyzx
  add r11.x, r6.x, cb4[10].w
  add r11.y, r7.w, cb4[11].w
  add r11.z, r8.w, cb4[12].w
  mad r8.xyz, r8.xyzx, cb4[19].xyzx, v7.xyzx
  dp3 r6.x, r8.xyzx, cb4[15].xyzx
  dp3 r7.w, r8.xyzx, cb4[16].xyzx
  dp3 r8.x, r8.xyzx, cb4[17].xyzx
  add r12.x, r6.x, cb4[15].w
  add r12.y, r7.w, cb4[16].w
  add r12.z, r8.x, cb4[17].w
  eq r6.x, cb0[49].z, l(0.000000)
  ftou r8.xy, v0.xyxx
  ftou r7.w, cb0[1].w
  movc r13.z, r6.x, l(0), r7.w
  and r13.xy, r8.xyxx, l(63, 63, 0, 0)
  mov r13.w, l(0)
  ld_indexable(texture2darray)(float,float,float,float) r6.x, r13.xyzw, t4.xyzw
  eq r8.xyzw, cb4[21].wwww, l(1.000000, 2.000000, 3.000000, 4.000000)
  movc r8.xyzw, r8.xyzw, cb4[21].xxxx, cb4[21].zzzz
  mad r8.xyzw, r6.xxxx, r8.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  add r13.xy, r9.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
  mul r13.xy, r8.xxxx, |r13.xyxx|
  lt r13.xy, r13.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
  and r6.x, r13.y, r13.x
  add r13.xy, r10.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
  mul r8.xy, r8.yyyy, |r13.xyxx|
  lt r8.xy, r8.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
  and r7.w, r8.y, r8.x
  add r8.xy, r11.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
  mul r8.xy, r8.zzzz, |r8.xyxx|
  lt r8.xy, r8.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
  and r8.x, r8.y, r8.x
  add r8.yz, r12.xxyx, l(0.000000, -0.500000, -0.500000, 0.000000)
  mul r8.yz, r8.wwww, |r8.yyzy|
  lt r8.yz, r8.yyzy, l(0.000000, 0.500000, 0.500000, 0.000000)
  and r8.y, r8.z, r8.y
  mov r12.w, l(3.000000)
  movc r12.xyzw, r8.yyyy, r12.xyzw, l(42.000000,42.000000,42.000000,42.000000)
  mov r11.w, l(2.000000)
  movc r8.xyzw, r8.xxxx, r11.xyzw, r12.xyzw
  mov r10.w, l(1.000000)
  movc r8.xyzw, r7.wwww, r10.xyzw, r8.xyzw
  mov r9.w, l(0)
  movc r8.xyzw, r6.xxxx, r9.xyzw, r8.xyzw
  lt r6.x, l(0.000000), r8.z
  movc r8.xyzw, r6.xxxx, r8.xywz, l(42.000000,42.000000,42.000000,42.000000)
  ftou r6.x, r8.z
  ftou r7.w, cb4[21].w
  ult r6.x, r6.x, r7.w
  if_nz r6.x
    add r6.x, r8.w, l(2.384185791E-007)
    mad r9.xy, r8.xyxx, cb4[20].xxxx, l(0.500000, 0.500000, 0.000000, 0.000000)
    round_ni r9.zw, r9.xxxy
    add r9.xy, -r9.zwzz, r9.xyxx
    mad r10.xy, -r9.yxyy, l(3.000000, 3.000000, 0.000000, 0.000000), l(4.000000, 4.000000, 0.000000, 0.000000)
    mad r10.zw, r9.xxxy, l(0.000000, 0.000000, 3.000000, 3.000000), l(0.000000, 0.000000, 1.000000, 1.000000)
    mad r11.xy, -r9.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(3.000000, 3.000000, 0.000000, 0.000000)
    div r11.xy, r11.xyxx, r10.yxyy
    add r11.zw, r9.xxxy, l(0.000000, 0.000000, 3.000000, 3.000000)
    div r9.xy, r9.xyxx, r10.zwzz
    add r11.xy, r11.xyxx, l(-2.000000, -2.000000, 0.000000, 0.000000)
    mul r11.zw, r11.zzzw, cb4[20].yyyy
    add r9.xyzw, r9.xyzw, l(2.000000, 2.000000, -0.500000, -0.500000)
    mul r12.xw, r11.xxxy, cb4[20].yyyy
    mul r12.yz, r11.wwzw, l(0.000000, 0.142857149, 0.142857149, 0.000000)
    mul r11.xy, r9.xyxx, cb4[20].yyyy
    mul r7.w, r10.x, r10.y
    mad r8.xy, r9.zwzz, cb4[20].yyyy, r12.xwxx
    sample_c_lz_indexable(texture2darray)(float,float,float,float) r8.w, r8.xyzx, t3.xxxx, s2, r6.x
    mul r9.xy, r10.xyxx, l(7.000000, 7.000000, 0.000000, 0.000000)
    mad r8.xy, r9.zwzz, cb4[20].yyyy, r12.zwzz
    sample_c_lz_indexable(texture2darray)(float,float,float,float) r13.x, r8.xyzx, t3.xxxx, s2, r6.x
    mul r9.x, r9.x, r13.x
    mad r7.w, r7.w, r8.w, r9.x
    mul r10.xy, r10.xyxx, r10.zwzz
    mov r11.zw, r12.wwwy
    mad r8.xy, r9.zwzz, cb4[20].yyyy, r11.xzxx
    sample_c_lz_indexable(texture2darray)(float,float,float,float) r8.w, r8.xyzx, t3.xxxx, s2, r6.x
    mad r7.w, r10.x, r8.w, r7.w
    mad r8.xy, r9.zwzz, cb4[20].yyyy, r12.xyxx
    sample_c_lz_indexable(texture2darray)(float,float,float,float) r8.w, r8.xyzx, t3.xxxx, s2, r6.x
    mad r7.w, r9.y, r8.w, r7.w
    mad r8.xy, r9.zwzz, cb4[20].yyyy, r12.zyzz
    sample_c_lz_indexable(texture2darray)(float,float,float,float) r8.w, r8.xyzx, t3.xxxx, s2, r6.x
    mad r7.w, r8.w, l(49.000000), r7.w
    mul r9.xy, r10.zwzz, l(7.000000, 7.000000, 0.000000, 0.000000)
    mad r8.xy, r9.zwzz, cb4[20].yyyy, r11.xwxx
    sample_c_lz_indexable(texture2darray)(float,float,float,float) r8.w, r8.xyzx, t3.xxxx, s2, r6.x
    mad r7.w, r9.x, r8.w, r7.w
    mov r12.y, r11.y
    mad r8.xy, r9.zwzz, cb4[20].yyyy, r12.xyxx
    sample_c_lz_indexable(texture2darray)(float,float,float,float) r8.w, r8.xyzx, t3.xxxx, s2, r6.x
    mad r7.w, r10.y, r8.w, r7.w
    mad r8.xy, r9.zwzz, cb4[20].yyyy, r12.zyzz
    sample_c_lz_indexable(texture2darray)(float,float,float,float) r8.w, r8.xyzx, t3.xxxx, s2, r6.x
    mad r7.w, r9.y, r8.w, r7.w
    mul r8.w, r10.w, r10.z
    mad r8.xy, r9.zwzz, cb4[20].yyyy, r11.xyxx
    sample_c_lz_indexable(texture2darray)(float,float,float,float) r6.x, r8.xyzx, t3.xxxx, s2, r6.x
    mad r6.x, r8.w, r6.x, r7.w
    mul r6.x, r6.x, l(0.00694444450)
    mul r6.x, r6.x, r6.x
  else
    mov r6.x, cb4[21].y
  endif
else
  mov r6.x, cb4[21].y
endif
mul r7.xyz, r6.xxxx, r7.xyzx
dp3 r6.x, -r2.yzxy, r6.yzwy
add r6.x, r6.x, r6.x
mad r8.xyz, r6.yzwy, -r6.xxxx, -r2.yzxy
dp3 r6.x, cb2[0].xyzx, r8.xyzx
mad r9.xyz, -r6.xxxx, cb2[0].xyzx, r8.xyzx
lt r6.x, r6.x, l(0.999988675)
dp3 r7.w, r9.xyzx, r9.xyzx
rsq r7.w, r7.w
mul r9.xyz, r7.wwww, r9.xyzx
mul r9.xyz, r9.xyzx, l(0.00475598220, 0.00475598220, 0.00475598220, 0.000000)
mad r9.xyz, cb2[0].xyzx, l(0.999988675, 0.999988675, 0.999988675, 0.000000), r9.xyzx
dp3 r7.w, r9.xyzx, r9.xyzx
rsq r7.w, r7.w
mul r9.xyz, r7.wwww, r9.xyzx
movc r9.xyz, r6.xxxx, r9.xyzx, r8.xyzx
max r6.x, r3.x, cb2[1].w
max r6.x, r6.x, l(0.080000)
mad r1.xyz, r1.yzxy, r1.wwww, r9.xyzx
dp3 r1.w, r1.xyzx, r1.xyzx
rsq r1.w, r1.w
mul r1.xyz, r1.wwww, r1.xyzx
dp3_sat r1.w, r1.xyzx, r9.xyzx
dp3_sat r1.x, r6.yzwy, r1.xyzx
dp3_sat r1.y, r6.yzwy, r9.xyzx
add r1.z, -r1.w, l(1.000000)
mul r7.w, r1.z, r1.z
mul r7.w, r7.w, r7.w
mul r1.z, r1.z, r7.w
mad r1.z, r1.z, l(0.950000), l(0.050000)
mul r7.w, r6.x, r6.x
mul r7.w, r7.w, r7.w
mad r9.x, r1.x, r7.w, -r1.x
mad r1.x, r9.x, r1.x, l(1.000000)
mul r1.x, r1.x, r1.x
div r1.x, r7.w, r1.x
mad r9.xy, r6.xxxx, l(0.500000, -0.337748349, 0.000000, 0.000000), l(0.500000, 1.000000, 0.000000, 0.000000)
mul r7.w, r9.x, r9.x
mad r9.x, -r9.x, r9.x, l(1.000000)
mad r9.z, |r3.y|, r9.x, r7.w
mad r7.w, r1.y, r9.x, r7.w
mul r7.w, |r3.y|, r7.w
mad r7.w, r1.y, r9.z, r7.w
add r7.w, r7.w, l(0.000010)
rcp r7.w, r7.w
mul r7.w, r7.w, l(0.500000)
mul r1.x, r1.x, r1.z
mul r1.x, r7.w, r1.x
mul r1.z, r1.w, r1.w
dp2 r1.z, r1.zzzz, r6.xxxx
mad r1.z, r6.x, l(0.500000), r1.z
add r1.z, r1.z, l(-1.000000)
add r1.w, -r1.y, l(1.000000)
mul r6.x, r1.w, r1.w
mul r6.x, r6.x, r6.x
mul r1.w, r1.w, r6.x
mad r1.w, r1.z, r1.w, l(1.000000)
add r3.y, -|r3.y|, l(1.000000)
mul r6.x, r3.y, r3.y
mul r6.x, r6.x, r6.x
mul r3.y, r3.y, r6.x
mad r1.z, r1.z, r3.y, l(1.000000)
mul r1.z, r1.z, r1.w
mul r1.z, r9.y, r1.z
mul r9.xyz, r7.xyzx, r1.zzzz
mov_sat r1.z, r4.w
mul r7.xyz, r7.xyzx, r1.xxxx
add r1.x, -r3.z, l(1.000000)
add r1.w, r4.w, l(-1.000000)
mad r1.w, r1.w, cb2[2].w, l(1.000000)
mad r3.y, r6.z, l(0.500000), l(0.500000)
mad r4.w, -r6.z, l(0.500000), l(0.500000)
mul r3.y, r3.y, r3.y
mul r4.w, r4.w, r4.w
mul r10.xyz, r4.wwww, cb1[26].xyzx
mad r10.xyz, r3.yyyy, cb1[25].xyzx, r10.xyzx
mad r10.xyz, cb2[2].xyzx, r1.wwww, r10.xyzx
dp3_sat r1.w, r6.yzwy, cb1[24].xyzx
mad r10.xyz, cb1[23].xyzx, r1.wwww, r10.xyzx
mul r10.xyz, r1.xxxx, r10.xyzx
mad r9.xyz, r9.xyzx, r1.zzzz, r10.xyzx
mad r5.yzw, r9.xxyz, r4.xxyz, r5.yyzw
log r1.z, r3.x
mad r1.z, -r1.z, l(1.800000), l(1.000000)
add r1.z, -r1.z, l(8.000000)
mov r8.w, -r8.z
sample_l_indexable(texturecube)(float,float,float,float) r8.xyz, r8.xywx, t2.xyzw, s1, r1.z
mul r8.xyz, r3.zzzz, r8.xyzx
mad r1.yzw, r7.xxyz, r1.yyyy, r8.xxyz
mad r1.yzw, r2.wwww, r5.yyzw, r1.yyzw
mul r1.x, r1.x, r1.x
mul r5.yzw, r8.xxyz, r1.xxxx
mad r2.w, -r5.x, v2.w, l(1.000000)
mul r4.xyz, r4.xyzx, r2.wwww
mul r7.xyz, r4.xyzx, r4.xyzx
mad r1.yzw, r5.yyzw, r7.xxyz, r1.yyzw
mov r0.w, l(1.000000)
add r5.xyzw, r0.xyzw, -cb0[35].xyzw
dp4 r7.x, r5.xyzw, cb0[31].xyzw
dp4 r7.y, r5.xyzw, cb0[32].xyzw
dp4 r7.z, r5.xyzw, cb0[33].xyzw
mad r3.xy, v0.xyxx, cb0[20].xyxx, cb0[20].zwzz
dp3 r0.w, r7.xyzx, r7.xyzx
sqrt r0.w, r0.w
sample_l_indexable(texture2d)(float,float,float,float) r2.w, r3.xyxx, t6.yzwx, s4, l(0.000000)
add r3.x, r0.w, -cb1[19].y
div_sat r3.x, r3.x, cb1[19].z
mad r3.x, -r3.x, r2.w, l(1.000000)
mul r3.y, r3.x, cb1[19].w
min r4.w, |r2.y|, |r2.x|
max r5.x, |r2.y|, |r2.x|
div r5.x, l(1.000000, 1.000000, 1.000000, 1.000000), r5.x
mul r4.w, r4.w, r5.x
mul r5.x, r4.w, r4.w
mad r5.y, r5.x, l(0.0208350997), l(-0.085133)
mad r5.y, r5.x, r5.y, l(0.180141)
mad r5.y, r5.x, r5.y, l(-0.330299497)
mad r5.x, r5.x, r5.y, l(0.999866)
mul r5.y, r4.w, r5.x
lt r5.z, |r2.y|, |r2.x|
mad r5.y, r5.y, l(-2.000000), l(1.57079637)
and r5.y, r5.z, r5.y
mad r4.w, r4.w, r5.x, r5.y
lt r5.xy, -r2.yzyy, r2.yzyy
and r5.x, r5.x, l(0xc0490fdb)
add r4.w, r4.w, r5.x
min r5.x, -r2.y, -r2.x
max r2.x, -r2.y, -r2.x
lt r2.y, r5.x, -r5.x
ge r2.x, r2.x, -r2.x
and r2.x, r2.x, r2.y
movc r2.x, r2.x, -r4.w, r4.w
mad r2.x, r2.x, l(0.159154937), l(0.500000)
add r4.w, -|r2.z|, l(1.000000)
sqrt r4.w, r4.w
mad r5.x, |r2.z|, l(-0.0187292993), l(0.074261)
mad r5.x, r5.x, |r2.z|, l(-0.212114394)
mad r2.z, r5.x, |r2.z|, l(1.57072878)
mul r5.x, r4.w, r2.z
mad r5.x, r5.x, l(-2.000000), l(3.14159274)
and r5.x, r5.y, r5.x
mad r2.z, r2.z, r4.w, r5.x
mul r2.y, r2.z, l(0.318309873)
sample_l_indexable(texture2d)(float,float,float,float) r5.xyzw, r2.xyxx, t7.xyzw, s5, r3.y
lt r2.z, l(0.000000), cb1[22].w
if_nz r2.z
  sample_l_indexable(texture2d)(float,float,float,float) r7.xyzw, r2.xyxx, t8.xyzw, s5, r3.y
  add r7.xyzw, -r5.xyzw, r7.xyzw
  mad r5.xyzw, cb1[22].wwww, r7.xyzw, r5.xyzw
endif
mad r2.xyz, r5.xyzx, cb1[20].wwww, cb1[20].xyzx
add r2.xyz, -r5.xyzx, r2.xyzx
mad r2.xyz, r3.xxxx, r2.xyzx, r5.xyzx
add r5.xyz, -cb1[21].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mad r5.xyz, r2.wwww, r5.xyzx, cb1[21].xyzx
mul r2.xyz, r2.xyzx, r5.xyzx
mul r2.xyz, r2.xyzx, cb1[21].wwww
mul r0.w, -r0.w, cb1[19].x
mul r0.w, r0.w, l(1.442695)
exp r0.w, r0.w
add r0.w, -r0.w, l(1.000000)
mul r0.w, r0.w, r5.w
mad r2.xyz, r2.xyzx, cb3[20].wwww, -r1.yzwy
mad r1.yzw, r0.wwww, r2.xxyz, r1.yyzw
mul r0.w, r3.w, cb3[25].y
mad r0.xyz, r0.wwww, -r6.yzwy, r0.xyzx
add r0.xyz, r0.xyzx, -cb0[35].xyzx
mov r0.w, l(1.000000)
dp4 r2.x, r0.xyzw, cb0[31].xyzw
dp4 r2.y, r0.xyzw, cb0[32].xyzw
dp4 r2.z, r0.xyzw, cb0[33].xyzw
mov r2.w, l(1.000000)
dp3 r0.x, r2.xywx, cb0[49].xywx
dp3 r0.y, r2.xywx, cb0[50].xywx
dp4 r0.z, r2.xyzw, cb0[52].xyzw
div r0.xy, r0.xyxx, r0.zzzz
mad r0.xy, r0.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t5.xyzw, s3
mul r2.xyz, r4.xyzx, r0.xyzx
mad r0.w, r1.x, r3.z, r3.z
add r0.w, -r0.w, l(1.000000)
mad r1.xyz, r2.xyzx, r0.wwww, r1.yzwy
add r1.xyz, -r0.xyzx, r1.xyzx
mad r0.xyz, r3.wwww, r1.xyzx, r0.xyzx
ubfe r0.w, l(3), l(2), cb0[1].x
uge r0.w, r0.w, l(5)
if_nz r0.w
  and r0.w, cb0[1].x, l(1)
  if_nz r0.w
    log r1.xyz, r0.xyzx
    round_ni r1.xyz, r1.xyzx
    add r1.xyz, r1.xyzx, l(-6.000000, -6.000000, -5.000000, 0.000000)
    exp r1.xyz, r1.xyzx
    ftou r2.xy, v0.xyxx
    and r2.xy, r2.xyxx, l(63, 63, 0, 0)
    mov r2.zw, l(0,0,0,0)
    ld_indexable(texture2darray)(float,float,float,float) r2.x, r2.xyzw, t4.xyzw
    mov r2.yz, l(0,1.000000,-1.000000,0)
    mul r3.xyz, r1.xyzx, r2.xyyx
    mul r1.xyz, r1.xyzx, l(1.000000, 0.000000, 0.000000, 0.000000)
    lt r4.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r0.xyzx
    and r4.xyz, r4.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
    mad r1.xyz, r2.zxxz, r3.xyzx, r1.xyzx
    mad r0.xyz, r4.xyzx, r1.xyzx, r0.xyzx
  else
    ftou r1.xy, v0.xyxx
    and r1.xy, r1.xyxx, l(63, 63, 0, 0)
    mov r1.zw, l(0,0,0,0)
    ld_indexable(texture2darray)(float,float,float,float) r0.w, r1.xyzw, t4.yzwx
    lt r1.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r0.xyzx
    and r1.xyz, r1.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
    mad r2.xyz, r0.wwww, l(-0.00392156886, 0.00392156886, 0.00392156886, 0.000000), l(0.00392156886, 0.000000, 0.000000, 0.000000)
    mad r0.xyz, r1.xyzx, r2.xyzx, r0.xyzx
  endif
endif
mov o0.xyz, r0.xyzx
mov o0.w, l(1.000000)
ret
// Approximately 420 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v1.3.16 on Sat May 18 07:48:08 2019
//
// cbuffer CBufferGlobalConstant_Z : register(b0)
// {
//
//   struct
//   {
//     float4 c[90];
//   } Global : packoffset(c0);
//
// }
//
// cbuffer CBufferScatteringConstant_Z : register(b1)
// {
//
//   struct
//   {
//     float4 c[36];
//   } Scattering : packoffset(c0);
//
// }
//
// cbuffer CBufferLightConstant_Z : register(b2)
// {
//
//   struct
//   {
//     float4 c[3];
//   } Light : packoffset(c0);
//
// }
//
// cbuffer CBufferObjectConstant_Z : register(b3)
// {
//
//   struct
//   {
//     float4 c[32];
//   } Object : packoffset(c0);
//
// }
//
// cbuffer CBufferShadowReceiveConstant_Z : register(b4)
// {
//
//   struct
//   {
//
//     struct
//     {
//       float4x4 Mat;
//       float4 NormalBias;
//     } Slices[4];
//
//     float4 TextureSize;
//     float4 FadeParams;
//     float4 SliceDistMin;
//     float4 SliceDistMax;
//   } Shadow : packoffset(c0);
//
// }
//
// SamplerState sMaterialSampler_s : register(s0);
// SamplerState sEnvCubeSampler_s : register(s1);
// SamplerState sRenderTargetSampler_s : register(s3);
// SamplerState sFogOcclusionSampler_s : register(s4);
// SamplerState sMipFog0Sampler_s : register(s5);
// SamplerComparisonState sShadowMapSampler_s : register(s2);
// Texture2D<float4> sDiffuse : register(t0);
// Texture2D<float4> sNormalRoughMetal : register(t1);
// TextureCube<float4> sEnvCube : register(t2);
// Texture2DArray<float4> sShadowMap : register(t3);
// Texture2DArray<float4> sBlueNoiseR8 : register(t4);
// Texture2D<float4> sRenderTarget : register(t5);
// Texture2D<float4> sFogOcclusion : register(t6);
// Texture2D<float4> sMipFog0 : register(t7);
// Texture2D<float4> sMipFog1 : register(t8);
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Texture2D<float4> StereoParams : register(t125);
//
//
// void main(
//   float4 v0 : SV_Position0,
//   float4 v1 : PREVIOUS_POSITION0,
//   float4 v2 : COLOR0,
//   float4 v3 : TEXCOORD0,
//   float4 v4 : TEXSPACE_MAT0,
//   float4 v5 : TEXSPACE_MAT1,
//   float4 v6 : TEXSPACE_MAT2,
//   float4 v7 : SHADOW_TCPROJ0,
//   float v8 : INSTANCE_COLOR0,
//   uint2 v9 : INSTANCE_INDEXES0,
//   out float4 o0 : SV_Target0)
// {
//   float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
//   r0.x = v4.w;
//   r0.y = v5.w;
//   r0.z = v6.w;
//   r1.xyz = Global.c[2].zxy + -r0.zxy;
//   r1.w = dot(r1.xyz, r1.xyz);
//   r1.w = rsqrt(r1.w);
//   r2.xyz = r1.xyz * r1.www;
//   r3.xyzw = sDiffuse.Sample(sMaterialSampler_s, v3.xy).xyzw;
//   r4.xyz = Object.c[20].xyz * r3.xyz;
//   r5.xyzw = Object.c[21].wxyz * r3.wxyz;
//   r2.w = v2.w * r5.x;
//   r6.xyzw = sNormalRoughMetal.Sample(sMaterialSampler_s, v3.xy).xyzw;
//   r3.xy = Object.c[23].yx * r6.zx;
//   r6.yw = r6.yw * float2(2,2) + float2(-1,-1);
//   r6.yw = Object.c[23].zz * r6.yw;
//   r3.z = dot(r6.yw, r6.yw);
//   r3.z = 1 + -r3.z;
//   r3.z = max(0, r3.z);
//   r3.z = sqrt(r3.z);
//   r7.xyz = v5.xyz * r6.www;
//   r7.xyz = r6.yyy * v4.xyz + r7.xyz;
//   r7.xyz = r3.zzz * v6.xyz + r7.xyz;
//   r3.z = dot(r7.xyz, r7.xyz);
//   r3.z = rsqrt(r3.z);
//   r8.xyz = r7.xyz * r3.zzz;
//   r9.xyz = Object.c[18].xyz * v2.xyz;
//   r4.xyz = r9.xyz * r4.xyz;
//   r5.yzw = r9.xyz * r5.yzw;
//   r3.w = v2.w * r3.w + -1;
//   r3.w = Object.c[25].z * r3.w + 1;
//   r3.w = Object.c[18].w * r3.w;
//   r4.w = cmp(0 != Global.c[12].z);
//   if (r4.w != 0) {
//     r4.w = r8.z * 0.0500000007 + v6.y;
//     r4.w = saturate(r4.w * 3 + -1);
//     r3.y = -r3.y * 0.899999976 + 1;
//     r3.y = r3.x * r3.y;
//     r9.xyz = float3(-0.00999999978,-0.200000003,-0.449999988) + Global.c[12].zzz;
//     r6.yw = saturate(float2(2.94117641,1.25) * r9.xy);
//     r3.y = r6.y * r3.y;
//     r9.xyw = r4.xyz * r4.xyz + -r4.xyz;
//     r4.xyz = r3.yyy * r9.xyw + r4.xyz;
//     r3.y = r3.x * r3.x;
//     r3.y = r3.y * r3.x;
//     r6.y = 0.150000006 * r3.y;
//     r3.y = -r3.y * 0.150000006 + 0.0500000007;
//     r3.y = r4.w * r3.y + r6.y;
//     r3.y = -Object.c[23].y * r6.z + r3.y;
//     r3.x = r6.w * r3.y + r3.x;
//     r6.yzw = -r7.xyz * r3.zzz + v6.xyz;
//     r6.yzw = r6.yzw * r4.www;
//     r3.y = saturate(r9.z + r9.z);
//     r8.xyz = r3.yyy * r6.yzw + r8.xyz;
//   }
//   r3.y = dot(r8.xyz, r8.xyz);
//   r3.y = rsqrt(r3.y);
//   r6.yzw = r8.xyz * r3.yyy;
//   r3.y = dot(r6.wyz, r2.xyz);
//   r3.z = -Object.c[23].x * r6.x + 1;
//   r4.xyz = r4.xyz * r3.zzz;
//   r3.z = saturate(r3.y);
//   r7.xyzw = r3.xxxx * float4(-1,-0.0274999999,-0.572000027,0.0219999999) + float4(1,0.0425000004,1.03999996,-0.0399999991);
//   r4.w = r7.x * r7.x;
//   r3.z = -9.27999973 * r3.z;
//   r3.z = exp2(r3.z);
//   r3.z = min(r4.w, r3.z);
//   r3.z = r3.z * r7.x + r7.y;
//   r7.xy = r3.zz * float2(-1.03999996,1.03999996) + r7.zw;
//   r3.z = r7.x * 0.0500000007 + r7.y;
//   r7.xyz = Object.c[19].yyy * Light.c[1].xyz;
//   r4.w = dot(r6.yzw, Light.c[0].xyz);
//   r6.x = cmp(0 < Shadow.Shadow.FadeParams.w);
//   if (r6.x != 0) {
//     r8.x = dot(r6.yzw, Global.c[31].xyz);
//     r8.y = dot(r6.yzw, Global.c[32].xyz);
//     r8.z = dot(r6.yzw, Global.c[33].xyz);
//     r9.xyz = r8.xyz * Shadow.Slices[0].NormalBias.xyz + v7.xyz;
//     r6.x = dot(r9.xyz, Shadow.Slices[0].Mat._m00_m10_m20);
//     r7.w = dot(r9.xyz, Shadow.Slices[0].Mat._m01_m11_m21);
//     r8.w = dot(r9.xyz, Shadow.Slices[0].Mat._m02_m12_m22);
//     r9.x = Shadow.Slices[0].Mat._m30 + r6.x;
//     r9.y = Shadow.Slices[0].Mat._m31 + r7.w;
//     r9.z = Shadow.Slices[0].Mat._m32 + r8.w;
//     r10.xyz = r8.xyz * cb4[9].xyzx + v7.xyz;
//     r6.x = dot(r10.xyz, cb4[5].xyzx);
//     r7.w = dot(r10.xyz, cb4[6].xyzx);
//     r8.w = dot(r10.xyz, cb4[7].xyzx);
//     r10.x = cb4[5].w + r6.x;
//     r10.y = cb4[6].w + r7.w;
//     r10.z = cb4[7].w + r8.w;
//     r11.xyz = r8.xyz * cb4[14].xyzx + v7.xyz;
//     r6.x = dot(r11.xyz, cb4[10].xyzx);
//     r7.w = dot(r11.xyz, cb4[11].xyzx);
//     r8.w = dot(r11.xyz, cb4[12].xyzx);
//     r11.x = cb4[10].w + r6.x;
//     r11.y = cb4[11].w + r7.w;
//     r11.z = cb4[12].w + r8.w;
//     r8.xyz = r8.xyz * Shadow.Slices[1].Mat.xyz + v7.xyz;
//     r6.x = dot(r8.xyz, cb4[15].xyzx);
//     r7.w = dot(r8.xyz, cb4[16].xyzx);
//     r8.x = dot(r8.xyz, Shadow.Slices[1].Mat.xyz);
//     r12.x = cb4[15].w + r6.x;
//     r12.y = cb4[16].w + r7.w;
//     r12.z = Shadow.Slices[1].Mat.w + r8.x;
//     r6.x = cmp(Global.c[49].z == 0.000000);
//     r8.xy = (uint2)v0.xy;
//     r7.w = (uint)Global.c[1].w;
//     r13.z = r6.x ? 0 : r7.w;
//     r13.xy = (int2)r8.xy & int2(63,63);
//     r13.w = 0;
//     r6.x = sBlueNoiseR8.Load(r13.xyzw).x;
//     r8.xyzw = cmp(Shadow.Shadow.FadeParams.wwww == float4(1,2,3,4));
//     r8.xyzw = r8.xyzw ? Shadow.Shadow.FadeParams.xxxx : Shadow.Shadow.FadeParams.zzzz;
//     r8.xyzw = r6.xxxx * r8.xyzw + float4(1,1,1,1);
//     r13.xy = float2(-0.5,-0.5) + r9.xy;
//     r13.xy = abs(r13.xy) * r8.xx;
//     r13.xy = cmp(r13.xy < float2(0.5,0.5));
//     r6.x = r13.y ? r13.x : 0;
//     r13.xy = float2(-0.5,-0.5) + r10.xy;
//     r8.xy = abs(r13.xy) * r8.yy;
//     r8.xy = cmp(r8.xy < float2(0.5,0.5));
//     r7.w = r8.y ? r8.x : 0;
//     r8.xy = float2(-0.5,-0.5) + r11.xy;
//     r8.xy = abs(r8.xy) * r8.zz;
//     r8.xy = cmp(r8.xy < float2(0.5,0.5));
//     r8.x = r8.y ? r8.x : 0;
//     r8.yz = float2(-0.5,-0.5) + r12.xy;
//     r8.yz = abs(r8.yz) * r8.ww;
//     r8.yz = cmp(r8.yz < float2(0.5,0.5));
//     r8.y = r8.z ? r8.y : 0;
//     r12.w = 3;
//     r12.xyzw = r8.yyyy ? r12.xyzw : float4(42,42,42,42);
//     r11.w = 2;
//     r8.xyzw = r8.xxxx ? r11.xyzw : r12.xyzw;
//     r10.w = 1;
//     r8.xyzw = r7.wwww ? r10.xyzw : r8.xyzw;
//     r9.w = 0;
//     r8.xyzw = r6.xxxx ? r9.xyzw : r8.xyzw;
//     r6.x = cmp(0 < r8.z);
//     r8.xyzw = r6.xxxx ? r8.xywz : float4(42,42,42,42);
//     r6.x = (uint)r8.z;
//     r7.w = (uint)Shadow.Shadow.FadeParams.w;
//     r6.x = cmp((uint)r6.x < (uint)r7.w);
//     if (r6.x != 0) {
//       r6.x = 2.38418579e-007 + r8.w;
//       r9.xy = r8.xy * Shadow.Shadow.TextureSize.xx + float2(0.5,0.5);
//       r9.zw = floor(r9.xy);
//       r9.xy = r9.xy + -r9.zw;
//       r10.xy = -r9.yx * float2(3,3) + float2(4,4);
//       r10.zw = r9.xy * float2(3,3) + float2(1,1);
//       r11.xy = -r9.xy * float2(2,2) + float2(3,3);
//       r11.xy = r11.xy / r10.yx;
//       r11.zw = float2(3,3) + r9.xy;
//       r9.xy = r9.xy / r10.zw;
//       r11.xy = float2(-2,-2) + r11.xy;
//       r11.zw = Shadow.Shadow.TextureSize.yy * r11.zw;
//       r9.xyzw = float4(2,2,-0.5,-0.5) + r9.xyzw;
//       r12.xw = Shadow.Shadow.TextureSize.yy * r11.xy;
//       r12.yz = float2(0.142857149,0.142857149) * r11.wz;
//       r11.xy = Shadow.Shadow.TextureSize.yy * r9.xy;
//       r7.w = r10.y * r10.x;
//       r8.xy = r9.zw * Shadow.Shadow.TextureSize.yy + r12.xw;
//       r8.w = sShadowMap.SampleCmpLevelZero(sShadowMapSampler_s, r8.xyz, r6.x).x;
//       r9.xy = float2(7,7) * r10.xy;
//       r8.xy = r9.zw * Shadow.Shadow.TextureSize.yy + r12.zw;
//       r13.x = sShadowMap.SampleCmpLevelZero(sShadowMapSampler_s, r8.xyz, r6.x).x;
//       r9.x = r13.x * r9.x;
//       r7.w = r7.w * r8.w + r9.x;
//       r10.xy = r10.zw * r10.xy;
//       r11.zw = r12.wy;
//       r8.xy = r9.zw * Shadow.Shadow.TextureSize.yy + r11.xz;
//       r8.w = sShadowMap.SampleCmpLevelZero(sShadowMapSampler_s, r8.xyz, r6.x).x;
//       r7.w = r10.x * r8.w + r7.w;
//       r8.xy = r9.zw * Shadow.Shadow.TextureSize.yy + r12.xy;
//       r8.w = sShadowMap.SampleCmpLevelZero(sShadowMapSampler_s, r8.xyz, r6.x).x;
//       r7.w = r9.y * r8.w + r7.w;
//       r8.xy = r9.zw * Shadow.Shadow.TextureSize.yy + r12.zy;
//       r8.w = sShadowMap.SampleCmpLevelZero(sShadowMapSampler_s, r8.xyz, r6.x).x;
//       r7.w = r8.w * 49 + r7.w;
//       r9.xy = float2(7,7) * r10.zw;
//       r8.xy = r9.zw * Shadow.Shadow.TextureSize.yy + r11.xw;
//       r8.w = sShadowMap.SampleCmpLevelZero(sShadowMapSampler_s, r8.xyz, r6.x).x;
//       r7.w = r9.x * r8.w + r7.w;
//       r12.y = r11.y;
//       r8.xy = r9.zw * Shadow.Shadow.TextureSize.yy + r12.xy;
//       r8.w = sShadowMap.SampleCmpLevelZero(sShadowMapSampler_s, r8.xyz, r6.x).x;
//       r7.w = r10.y * r8.w + r7.w;
//       r8.xy = r9.zw * Shadow.Shadow.TextureSize.yy + r12.zy;
//       r8.w = sShadowMap.SampleCmpLevelZero(sShadowMapSampler_s, r8.xyz, r6.x).x;
//       r7.w = r9.y * r8.w + r7.w;
//       r8.w = r10.z * r10.w;
//       r8.xy = r9.zw * Shadow.Shadow.TextureSize.yy + r11.xy;
//       r6.x = sShadowMap.SampleCmpLevelZero(sShadowMapSampler_s, r8.xyz, r6.x).x;
//       r6.x = r8.w * r6.x + r7.w;
//       r6.x = 0.0069444445 * r6.x;
//       r6.x = r6.x * r6.x;
//     } else {
//       r6.x = Shadow.Shadow.FadeParams.y;
//     }
//   } else {
//     r6.x = Shadow.Shadow.FadeParams.y;
//   }
//   r7.xyz = r7.xyz * r6.xxx;
//   r6.x = dot(-r2.yzx, r6.yzw);
//   r6.x = r6.x + r6.x;
//   r8.xyz = r6.yzw * -r6.xxx + -r2.yzx;
//   r6.x = dot(Light.c[0].xyz, r8.xyz);
//   r9.xyz = -r6.xxx * Light.c[0].xyz + r8.xyz;
//   r6.x = cmp(r6.x < 0.999988675);
//   r7.w = dot(r9.xyz, r9.xyz);
//   r7.w = rsqrt(r7.w);
//   r9.xyz = r9.xyz * r7.www;
//   r9.xyz = float3(0.0047559822,0.0047559822,0.0047559822) * r9.xyz;
//   r9.xyz = Light.c[0].xyz * float3(0.999988675,0.999988675,0.999988675) + r9.xyz;
//   r7.w = dot(r9.xyz, r9.xyz);
//   r7.w = rsqrt(r7.w);
//   r9.xyz = r9.xyz * r7.www;
//   r9.xyz = r6.xxx ? r9.xyz : r8.xyz;
//   r6.x = max(Light.c[1].w, r3.x);
//   r6.x = max(0.0799999982, r6.x);
//   r1.xyz = r1.yzx * r1.www + r9.xyz;
//   r1.w = dot(r1.xyz, r1.xyz);
//   r1.w = rsqrt(r1.w);
//   r1.xyz = r1.xyz * r1.www;
//   r1.w = saturate(dot(r1.xyz, r9.xyz));
//   r1.x = saturate(dot(r6.yzw, r1.xyz));
//   r1.y = saturate(dot(r6.yzw, r9.xyz));
//   r1.z = 1 + -r1.w;
//   r7.w = r1.z * r1.z;
//   r7.w = r7.w * r7.w;
//   r1.z = r7.w * r1.z;
//   r1.z = r1.z * 0.949999988 + 0.0500000007;
//   r7.w = r6.x * r6.x;
//   r7.w = r7.w * r7.w;
//   r9.x = r1.x * r7.w + -r1.x;
//   r1.x = r9.x * r1.x + 1;
//   r1.x = r1.x * r1.x;
//   r1.x = r7.w / r1.x;
//   r9.xy = r6.xx * float2(0.5,-0.337748349) + float2(0.5,1);
//   r7.w = r9.x * r9.x;
//   r9.x = -r9.x * r9.x + 1;
//   r9.z = abs(r3.y) * r9.x + r7.w;
//   r7.w = r1.y * r9.x + r7.w;
//   r7.w = r7.w * abs(r3.y);
//   r7.w = r1.y * r9.z + r7.w;
//   r7.w = 9.99999975e-006 + r7.w;
//   r7.w = rcp(r7.w);
//   r7.w = 0.5 * r7.w;
//   r1.x = r1.z * r1.x;
//   r1.x = r1.x * r7.w;
//   r1.z = r1.w * r1.w;
//   r1.z = dot(r1.zz, r6.xx);
//   r1.z = r6.x * 0.5 + r1.z;
//   r1.z = -1 + r1.z;
//   r1.w = 1 + -r1.y;
//   r6.x = r1.w * r1.w;
//   r6.x = r6.x * r6.x;
//   r1.w = r6.x * r1.w;
//   r1.w = r1.z * r1.w + 1;
//   r3.y = 1 + -abs(r3.y);
//   r6.x = r3.y * r3.y;
//   r6.x = r6.x * r6.x;
//   r3.y = r6.x * r3.y;
//   r1.z = r1.z * r3.y + 1;
//   r1.z = r1.w * r1.z;
//   r1.z = r1.z * r9.y;
//   r9.xyz = r1.zzz * r7.xyz;
//   r1.z = saturate(r4.w);
//   r7.xyz = r1.xxx * r7.xyz;
//   r1.x = 1 + -r3.z;
//   r1.w = -1 + r4.w;
//   r1.w = r1.w * Light.c[2].w + 1;
//   r3.y = r6.z * 0.5 + 0.5;
//   r4.w = -r6.z * 0.5 + 0.5;
//   r3.y = r3.y * r3.y;
//   r4.w = r4.w * r4.w;
//   r10.xyz = Scattering.c[26].xyz * r4.www;
//   r10.xyz = r3.yyy * Scattering.c[25].xyz + r10.xyz;
//   r10.xyz = Light.c[2].xyz * r1.www + r10.xyz;
//   r1.w = saturate(dot(r6.yzw, Scattering.c[24].xyz));
//   r10.xyz = Scattering.c[23].xyz * r1.www + r10.xyz;
//   r10.xyz = r10.xyz * r1.xxx;
//   r9.xyz = r9.xyz * r1.zzz + r10.xyz;
//   r5.yzw = r9.xyz * r4.xyz + r5.yzw;
//   r1.z = log2(r3.x);
//   r1.z = -r1.z * 1.79999995 + 1;
//   r1.z = 8 + -r1.z;
//   r8.w = -r8.z;
//   r8.xyz = sEnvCube.SampleLevel(sEnvCubeSampler_s, r8.xyw, r1.z).xyz;
//   r8.xyz = r8.xyz * r3.zzz;
//   r1.yzw = r7.xyz * r1.yyy + r8.xyz;
//   r1.yzw = r2.www * r5.yzw + r1.yzw;
//   r1.x = r1.x * r1.x;
//   r5.yzw = r1.xxx * r8.xyz;
//   r2.w = -r5.x * v2.w + 1;
//   r4.xyz = r2.www * r4.xyz;
//   r7.xyz = r4.xyz * r4.xyz;
//   r1.yzw = r5.yzw * r7.xyz + r1.yzw;
//   r0.w = 1;
//   r5.xyzw = -Global.c[35].xyzw + r0.xyzw;
//   r7.x = dot(r5.xyzw, Global.c[31].xyzw);
//   r7.y = dot(r5.xyzw, Global.c[32].xyzw);
//   r7.z = dot(r5.xyzw, Global.c[33].xyzw);
//   r3.xy = v0.xy * Global.c[20].xy + Global.c[20].zw;
//   r0.w = dot(r7.xyz, r7.xyz);
//   r0.w = sqrt(r0.w);
//   r2.w = sFogOcclusion.SampleLevel(sFogOcclusionSampler_s, r3.xy, 0).x;
//   r3.x = -Scattering.c[19].y + r0.w;
//   r3.x = saturate(r3.x / Scattering.c[19].z);
//   r3.x = -r3.x * r2.w + 1;
//   r3.y = Scattering.c[19].w * r3.x;
//   r4.w = min(abs(r2.x), abs(r2.y));
//   r5.x = max(abs(r2.x), abs(r2.y));
//   r5.x = 1 / r5.x;
//   r4.w = r5.x * r4.w;
//   r5.x = r4.w * r4.w;
//   r5.y = r5.x * 0.0208350997 + -0.0851330012;
//   r5.y = r5.x * r5.y + 0.180141002;
//   r5.y = r5.x * r5.y + -0.330299497;
//   r5.x = r5.x * r5.y + 0.999866009;
//   r5.y = r5.x * r4.w;
//   r5.z = cmp(abs(r2.y) < abs(r2.x));
//   r5.y = r5.y * -2 + 1.57079637;
//   r5.y = r5.z ? r5.y : 0;
//   r4.w = r4.w * r5.x + r5.y;
//   r5.xy = cmp(-r2.yz < r2.yz);
//   r5.x = r5.x ? -3.141593 : 0;
//   r4.w = r5.x + r4.w;
//   r5.x = min(-r2.x, -r2.y);
//   r2.x = max(-r2.x, -r2.y);
//   r2.y = cmp(r5.x < -r5.x);
//   r2.x = cmp(r2.x >= -r2.x);
//   r2.x = r2.x ? r2.y : 0;
//   r2.x = r2.x ? -r4.w : r4.w;
//   r2.x = r2.x * 0.159154937 + 0.5;
//   r4.w = 1 + -abs(r2.z);
//   r4.w = sqrt(r4.w);
//   r5.x = abs(r2.z) * -0.0187292993 + 0.0742610022;
//   r5.x = r5.x * abs(r2.z) + -0.212114394;
//   r2.z = r5.x * abs(r2.z) + 1.57072878;
//   r5.x = r2.z * r4.w;
//   r5.x = r5.x * -2 + 3.14159274;
//   r5.x = r5.y ? r5.x : 0;
//   r2.z = r2.z * r4.w + r5.x;
//   r2.y = 0.318309873 * r2.z;
//   r5.xyzw = sMipFog0.SampleLevel(sMipFog0Sampler_s, r2.xy, r3.y).xyzw;
//   r2.z = cmp(0 < Scattering.c[22].w);
//   if (r2.z != 0) {
//     r7.xyzw = sMipFog1.SampleLevel(sMipFog0Sampler_s, r2.xy, r3.y).xyzw;
//     r7.xyzw = r7.xyzw + -r5.xyzw;
//     r5.xyzw = Scattering.c[22].wwww * r7.xyzw + r5.xyzw;
//   }
//   r2.xyz = r5.xyz * Scattering.c[20].www + Scattering.c[20].xyz;
//   r2.xyz = r2.xyz + -r5.xyz;
//   r2.xyz = r3.xxx * r2.xyz + r5.xyz;
//   r5.xyz = float3(1,1,1) + -Scattering.c[21].xyz;
//   r5.xyz = r2.www * r5.xyz + Scattering.c[21].xyz;
//   r2.xyz = r5.xyz * r2.xyz;
//   r2.xyz = Scattering.c[21].www * r2.xyz;
//   r0.w = Scattering.c[19].x * -r0.w;
//   r0.w = 1.44269502 * r0.w;
//   r0.w = exp2(r0.w);
//   r0.w = 1 + -r0.w;
//   r0.w = r5.w * r0.w;
//   r2.xyz = r2.xyz * Object.c[20].www + -r1.yzw;
//   r1.yzw = r0.www * r2.xyz + r1.yzw;
//   r0.w = Object.c[25].y * r3.w;
//   r0.xyz = r0.www * -r6.yzw + r0.xyz;
//   r0.xyz = -Global.c[35].xyz + r0.xyz;
//   r0.w = 1;
//   r2.x = dot(r0.xyzw, Global.c[31].xyzw);
//   r2.y = dot(r0.xyzw, Global.c[32].xyzw);
//   r2.z = dot(r0.xyzw, Global.c[33].xyzw);
//   r2.w = 1;
//   r0.x = dot(r2.xyw, Global.c[49].xyw);
//   r0.y = dot(r2.xyw, Global.c[50].xyw);
//   r0.z = dot(r2.xyzw, Global.c[52].xyzw);
//   r0.xy = r0.xy / r0.zz;
//   r0.xy = r0.xy * float2(0.5,-0.5) + float2(0.5,0.5);
//   r0.xyz = sRenderTarget.Sample(sRenderTargetSampler_s, r0.xy).xyz;
//   r2.xyz = r0.xyz * r4.xyz;
//   r0.w = r1.x * r3.z + r3.z;
//   r0.w = 1 + -r0.w;
//   r1.xyz = r2.xyz * r0.www + r1.yzw;
//   r1.xyz = r1.xyz + -r0.xyz;
//   r0.xyz = r3.www * r1.xyz + r0.xyz;
//   if (3 == 0) r0.w = 0; else if (3+2 < 32) {   r0.w = (uint)Global.c[1].x << (32-(3 + 2)); r0.w = (uint)r0.w >> (32-3);  } else r0.w = (uint)Global.c[1].x >> 2;
//   r0.w = cmp((uint)r0.w >= 5);
//   if (r0.w != 0) {
//     r0.w = (int)Global.c[1].x & 1;
//     if (r0.w != 0) {
//       r1.xyz = log2(r0.xyz);
//       r1.xyz = floor(r1.xyz);
//       r1.xyz = float3(-6,-6,-5) + r1.xyz;
//       r1.xyz = exp2(r1.xyz);
//       r2.xy = (uint2)v0.xy;
//       r2.xy = (int2)r2.xy & int2(63,63);
//       r2.zw = float2(0,0);
//       r2.x = sBlueNoiseR8.Load(r2.xyzw).x;
//       r2.yz = float2(1,-1);
//       r3.xyz = r2.xyy * r1.xyz;
//       r1.xyz = float3(1,0,0) * r1.xyz;
//       r4.xyz = cmp(float3(0,0,0) < r0.xyz);
//       r4.xyz = r4.xyz ? float3(1,1,1) : 0;
//       r1.xyz = r2.zxx * r3.xyz + r1.xyz;
//       r0.xyz = r4.xyz * r1.xyz + r0.xyz;
//     } else {
//       r1.xy = (uint2)v0.xy;
//       r1.xy = (int2)r1.xy & int2(63,63);
//       r1.zw = float2(0,0);
//       r0.w = sBlueNoiseR8.Load(r1.xyzw).x;
//       r1.xyz = cmp(float3(0,0,0) < r0.xyz);
//       r1.xyz = r1.xyz ? float3(1,1,1) : 0;
//       r2.xyz = r0.www * float3(-0.00392156886,0.00392156886,0.00392156886) + float3(0.00392156886,0,0);
//       r0.xyz = r1.xyz * r2.xyz + r0.xyz;
//     }
//   }
//   o0.xyz = r0.xyz;
//   o0.w = 1;
//   return;
// }
//////////////////////////////// HLSL Errors ////////////////////////////////
// D:\GAMES\A Plague Tale Innocence\ShaderFixes\3c28bfa9870c9fab-ps_replace.txt(174,18-30): error X3018: invalid subscript 'Shadow'
/////////////////////////////////////////////////////////////////////////////
