// MANUALLY DUMPED [ShaderRegex_LightingPS1] P5S water haloing PS 2.
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Wed Mar 16 23:50:47 2022
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float4 litDir[4];                  // Index:    0 1 2 3          Components:    16
//   float4 litCol[4];                  // Index:    4 5 6 7          Components:    16
//   float4 litOcc;                     // Index:    8.xyzw           Components:     4
//   float4 ambLit;                     // Index:    9.xyzw           Components:     4
//   int nDirLit;                       // Index:   10.x              Components:     1
//   float4 vEye;                       // Index:   11.xyzw           Components:     4
//   float2 vOccRate;                   // Index:   12.xy             Components:     2
//      = 0x3f800000 0x3f800000
//   int rampIndex;                     // Index:   12.z              Components:     1
//      = 0x00000000
//   float4 rampPkPrms[3];              // Index:   13 14 15          Components:    12
//   float4 vClstZPrm;                  // Index:   16.xyzw           Components:     4
//   int nClstPtch[2];                  // Index:   17-18.x           Components:     5
//   float fClstScl;                    // Index:   18.y              Components:     1 [unused]
//   float2 vFadeDist;                  // Index:   18.zw             Components:     2
//   float3 vCameraPos;                 // Index:   19.xyz            Components:     3
//   float3 vCameraDir;                 // Index:   20.xyz            Components:     3
//   float2 vD2Z;                       // Index:   21.xy             Components:     2
//   float4 mRrW2T[3];                  // Index:   22 23 24          Components:    12
//   row_major float4x4 mV2W;           // Index:   25 26 27 28       Components:    16
//   row_major float4x4 mP2W;           // Index:   29 30 31 32       Components:    16
//   float fAmbMapsDORate;              // Index:   33.x              Components:     1
//      = 0x00000000
//   float4 vAmbDifScl;                 // Index:   34.xyzw           Components:     4
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
//   int rampTexHeight;                 // Index:   35.x              Components:     1
//   float4 vAmbSpcScl;                 // Index:   36.xyzw           Components:     4
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
//   float4 vTsbViewPort;               // Index:   37.xyzw           Components:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// __smpsIES                         sampler      NA          NA    0        1
// __smpsDepthMap                    sampler      NA          NA    1        1
// __smpsGxAmbLut                    sampler      NA          NA    2        1
// __smpsAmbSpc                      sampler      NA          NA    3        1
// __smpsTrnsSpc                     sampler      NA          NA    4        1
// __smpsRamp                        sampler      NA          NA    5        1
// sIES                              texture  float4     2darray    0        1
// sDepthMap                         texture  float4          2d    1        1
// sGxAmbLut                         texture  float4          2d    2        1
// sAmbSpc                           texture  float4        cube    3        1
// sTrnsSpc                          texture  float4          2d    4        1
// sRamp                             texture  float4          2d    5        1
// sDepth                            texture  float4          2d    6        1
// sGBuf0                            texture  float4          2d    7        1
// sGBuf1                            texture  float4     2darray    8        1
// sGBuf2                            texture  float4          2d    9        1
// sGBuf3                            texture  float4     2darray   10        1
// tCllLightIndices                  texture    uint         buf   16        1
// tCllLightPositions                texture  float4         buf   17        1
// tCllLightAttributes               texture  float3         buf   18        1
// tCllLightExAttributes             texture    uint         buf   19        1
// tCllSptLightAttributes            texture  float3         buf   20        1
// tCllSptLightExAttributes          texture    uint         buf   21        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
// TEXCOORD                 0   xyzw        1     NONE   float   xy w
//
//
// 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[38], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_resource_texture2darray (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texturecube (float,float,float,float) t3
dcl_resource_texture2d (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_texture2darray (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texture2darray (float,float,float,float) t10
dcl_resource_buffer (uint,uint,uint,uint) t16
dcl_resource_buffer (float,float,float,float) t17
dcl_resource_buffer (float,float,float,float) t18
dcl_resource_buffer (uint,uint,uint,uint) t19
dcl_resource_buffer (float,float,float,float) t20
dcl_resource_buffer (uint,uint,uint,uint) t21
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyw
dcl_output o0.xyzw
dcl_temps 37
dcl_resource_texture2d (float,float,float,float) t125
ftoi r0.xy, v0.xyxx
mov r0.zw, l(0,0,1,0)
ld_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.xyww, t7.xyzw
ld_indexable(texture2darray)(float,float,float,float) r2.xyzw, r0.xyww, t8.xyzw
ld_indexable(texture2d)(float,float,float,float) r3.xyz, r0.xyww, t9.xyzw
ld_indexable(texture2darray)(float,float,float,float) r4.xyz, r0.xyww, t10.xyzw
ld_indexable(texture2darray)(float,float,float,float) r5.xyz, r0.xyzw, t10.xyzw
mov r0.z, l(3)
ld_indexable(texture2darray)(float,float,float,float) r6.xyz, r0.xyzw, t8.xywz
ld_indexable(texture2d)(float,float,float,float) r0.x, r0.xyww, t6.xyzw

ld_indexable(texture2d)(float,float,float,float) r32.xyzw, l(0, 0, 0, 0), t125.xyzw
mov r33.x, v1.x
mul r34.xyzw, v1.yyyy, cb0[30].xyzw
mad r34.xyzw, r33.xxxx, cb0[29].xyzw, r34.xyzw
mad r34.xyzw, r0.xxxx, cb0[31].xyzw, r34.xyzw
add r34.xyzw, r34.xyzw, cb0[32].xyzw
add r33.x, -r32.x, r33.x
mul r35.xyzw, v1.yyyy, cb0[30].xyzw
mad r35.xyzw, r33.xxxx, cb0[29].xyzw, r35.xyzw
mad r35.xyzw, r0.xxxx, cb0[31].xyzw, r35.xyzw
add r35.xyzw, r35.xyzw, cb0[32].xyzw
div r35.yzw, r35.xxyz, r35.wwww
mul r36.w, r32.y, r34.w
mad r33.x, r32.x, r36.w, r33.x
mul r7.xyzw, v1.yyyy, cb0[30].xyzw
mad r7.xyzw, r33.xxxx, cb0[29].xyzw, r7.xyzw
mad r7.xyzw, r0.xxxx, cb0[31].xyzw, r7.xyzw
add r7.xyzw, r7.xyzw, cb0[32].xyzw
div r0.yzw, r7.xxyz, r7.wwww
add r7.xyz, -r35.yzwy, cb0[11].xyzx
dp3 r3.w, r7.xyzx, r7.xyzx
rsq r3.w, r3.w
mul r8.xyz, r3.wwww, r7.xyzx
add r4.w, r2.w, r2.w
mad r3.xy, r3.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
add r9.xyz, -|r3.xyxx|, l(1.000000, 1.000000, 1.000000, 0.000000)
add r10.z, -|r3.y|, r9.x
ge r5.w, r10.z, l(0.000000)
ge r9.xw, r3.xxxy, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r9.xw, r9.xxxw, l(1.000000,0,0,1.000000), l(-1.000000,0,0,-1.000000)
mul r9.xy, r9.xwxx, r9.yzyy
movc r10.xy, r5.wwww, r3.xyxx, r9.xyxx
dp3 r3.x, r10.xyzx, r10.xyzx
rsq r3.x, r3.x
mul r9.xyz, r3.xxxx, r10.xyzx
mul r10.xyz, r9.yyyy, cb0[26].xyzx
mad r9.xyw, r9.xxxx, cb0[25].xyxz, r10.xyxz
mad r9.xyz, r9.zzzz, cb0[27].xyzx, r9.xywx
mul r3.x, r3.z, l(65535.000000)
ftou r3.x, r3.x
ushr r3.x, r3.x, l(8)
utof r3.x, r3.x
mul r3.y, r3.x, l(0.00392156886)
mad r3.x, r3.x, l(0.00392156886), l(1.000000)

add r10.xyz, -r35.yzwy, cb0[19].xyzx
max r11.xyz, r1.xyzx, l(0.000100, 0.000100, 0.000100, 0.000000)
min r11.xyz, r11.xyzx, l(0.999900, 0.999900, 0.999900, 0.000000)
log r11.xyz, r11.xyzx
mul r11.xyz, r11.xyzx, l(0.693147182, 0.693147182, 0.693147182, 0.000000)
max r5.yw, r5.yyyz, l(0.000000, 0.000100, 0.000000, 0.000000)
div r11.xyz, -r11.xyzx, r5.yyyy
mul r11.xyz, r5.wwww, -r11.xyzx
mul r11.xyz, r11.xyzx, l(1.442695, 1.442695, 1.442695, 0.000000)
exp r11.xyz, r11.xyzx
dp3 r3.z, r9.xyzx, r8.xyzx
mov_sat r5.y, r3.z
add r5.w, r1.w, r5.y
mad r5.w, r5.w, r5.w, r1.w
add_sat r5.w, r5.w, l(-1.000000)
movc r6.z, cb0[12].z, l(1.000000), r6.z
dp3 r12.x, r9.xyzx, -cb0[0].xyzx
lt r6.w, r12.x, l(0.000000)
lt r7.w, l(1.000000), r3.x
and r6.w, r6.w, r7.w
add r8.w, r12.x, r12.x
mad r13.yzw, r9.xxyz, r8.wwww, cb0[0].xxyz
mov r13.x, -r12.x
mul r14.xyz, r11.xyzx, cb0[4].xyzx
mad r15.xyz, r7.xyzx, r3.wwww, -r13.yzwy
dp3 r8.w, r15.xyzx, r15.xyzx
rsq r8.w, r8.w
mul r15.xyz, r8.wwww, r15.xyzx
dp3 r8.w, r8.xyzx, r15.xyzx
lt r9.w, l(0.000000), r8.w
log r10.w, r8.w
mul r10.w, r10.w, cb0[14].z
exp r10.w, r10.w
movc r9.w, r9.w, r10.w, r8.w
mad r9.w, r9.w, cb0[14].w, l(0.500000)
round_z r9.w, r9.w
div r9.w, r9.w, cb0[14].w
movc_sat r8.w, cb0[12].z, r9.w, r8.w
add r15.xyz, -r2.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
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 r16.xyz, r15.xyzx, r8.wwww, r2.xyzx
add r17.xyz, -r16.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
add r3.x, -r3.x, l(2.000000)
mul r18.xyz, r3.xxxx, r17.xyzx
mad r16.xyz, r17.xyzx, r3.xxxx, r16.xyzx
add r16.xyz, -r16.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r17.xyz, r3.yyyy, r18.xyzx
movc r16.xyz, r6.wwww, r16.yzxy, l(-1.000000,-1.000000,-1.000000,0)
movc r17.xyz, r6.wwww, r17.xyzx, l(-1.000000,-1.000000,-1.000000,0)
movc r14.xyz, r6.wwww, r14.xyzx, cb0[4].xyzx
mov r12.yzw, cb0[0].xxyz
movc r13.xyzw, r6.wwww, r13.xyzw, r12.xyzw
mad r13.yzw, r7.xxyz, r3.wwww, -r13.yyzw
dp3 r6.w, r13.yzwy, r13.yzwy
rsq r6.w, r6.w
mul r13.yzw, r6.wwww, r13.yyzw
dp3 r6.w, r8.xyzx, r13.yzwy
ge r8.w, r16.z, l(0.000000)
lt r9.w, l(0.000000), r6.w
log r10.w, r6.w
mul r10.w, r10.w, cb0[14].z
exp r10.w, r10.w
movc r9.w, r9.w, r10.w, r6.w
mad r9.w, r9.w, cb0[14].w, l(0.500000)
round_z r9.w, r9.w
div r9.w, r9.w, cb0[14].w
movc_sat r9.w, cb0[12].z, r9.w, r6.w
add r9.w, -r9.w, l(1.000000)
mul r10.w, r9.w, r9.w
mul r10.w, r10.w, r10.w
mul r9.w, r9.w, r10.w
mad r18.xyz, r15.xyzx, r9.wwww, r2.xyzx
movc r18.xyz, r8.wwww, r16.zxyz, r18.xyzx
mul r4.w, r4.w, r4.w
mul r9.w, r4.w, r4.w
dp3 r10.w, r9.xyzx, r13.yzwy
mul r11.w, r9.w, r9.w
mul r10.w, r10.w, r10.w
mad r12.z, r9.w, r9.w, l(-1.000000)
mad r10.w, r10.w, r12.z, l(1.000000)
max r10.w, r10.w, l(0.000100)
mul r10.w, r10.w, r10.w
mul r10.w, r10.w, l(4.000000)
div r10.w, r11.w, r10.w
mul r12.w, r9.w, l(0.500000)
mad r9.w, -r9.w, l(0.500000), l(1.000000)
mad r6.w, r6.w, r9.w, r12.w
mul r6.w, r6.w, r6.w
div r6.w, l(1.000000, 1.000000, 1.000000, 1.000000), r6.w
mul r6.w, r6.w, r10.w
mul r13.yzw, r6.wwww, r18.xxyz
mul r13.yzw, r14.xxyz, r13.yyzw
mov_sat r13.x, r13.x
mul r18.xy, cb0[8].xxxx, cb0[12].yxyy
movc r6.w, cb0[12].z, cb0[14].z, l(1.000000)
mul r18.zw, r6.wwww, r18.xxxy
mad r18.xy, -r18.xyxx, r6.wwww, l(1.000000, 1.000000, 0.000000, 0.000000)
mad r10.w, r5.w, r18.z, r18.x
mul r10.w, r10.w, r13.x
mul r13.yzw, r10.wwww, r13.yyzw
mul r14.xyz, r13.xxxx, r14.xyzx
mul r19.xyz, r3.xxxx, r15.xyzx
movc r20.xyz, r8.wwww, r17.xyzx, r19.xyzx
mul r14.xyz, r14.xyzx, r20.xyzx
mad r8.w, r1.w, r18.w, r18.y
mul r14.xyz, r8.wwww, r14.xyzx
mul r14.xyz, r6.zzzz, r14.xyzx
mul r13.xyz, r6.zzzz, r13.yzwy
ilt r8.w, l(0), cb0[10].x
if_nz r8.w
  dp3 r18.x, r9.xyzx, -cb0[1].xyzx
  lt r8.w, r18.x, l(0.000000)
  and r8.w, r7.w, r8.w
  add r10.w, r18.x, r18.x
  mad r20.yzw, r9.xxyz, r10.wwww, cb0[1].xxyz
  mov r20.x, -r18.x
  mul r21.xyz, r11.xyzx, cb0[5].xyzx
  mad r22.xyz, r7.xyzx, r3.wwww, -r20.yzwy
  dp3 r10.w, r22.xyzx, r22.xyzx
  rsq r10.w, r10.w
  mul r22.xyz, r10.wwww, r22.xyzx
  dp3 r10.w, r8.xyzx, r22.xyzx
  lt r13.w, l(0.000000), r10.w
  log r14.w, r10.w
  mul r14.w, r14.w, cb0[14].z
  exp r14.w, r14.w
  movc r13.w, r13.w, r14.w, r10.w
  mad r13.w, r13.w, cb0[14].w, l(0.500000)
  round_z r13.w, r13.w
  div r13.w, r13.w, cb0[14].w
  movc_sat r10.w, cb0[12].z, r13.w, r10.w
  add r10.w, -r10.w, l(1.000000)
  mul r13.w, r10.w, r10.w
  mul r13.w, r13.w, r13.w
  mul r10.w, r10.w, r13.w
  mad r22.xyz, r15.xyzx, r10.wwww, r2.xyzx
  add r23.xyz, -r22.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  mul r24.xyz, r3.xxxx, r23.xyzx
  mad r22.xyz, r23.xyzx, r3.xxxx, r22.xyzx
  add r22.xyz, -r22.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  mul r23.xyz, r3.yyyy, r24.xyzx
  mov r16.w, l(-1.000000)
  movc r16.xyz, r8.wwww, r22.yzxy, r16.xywx
  movc r17.xyz, r8.wwww, r23.xyzx, r17.xyzx
  movc r21.xyz, r8.wwww, r21.xyzx, cb0[5].xyzx
  mov r18.yzw, cb0[1].xxyz
  movc r18.xyzw, r8.wwww, r20.xyzw, r18.xyzw
  mad r18.yzw, r7.xxyz, r3.wwww, -r18.yyzw
  dp3 r8.w, r18.yzwy, r18.yzwy
  rsq r8.w, r8.w
  mul r18.yzw, r8.wwww, r18.yyzw
  dp3 r8.w, r8.xyzx, r18.yzwy
  ge r10.w, r16.z, l(0.000000)
  lt r13.w, l(0.000000), r8.w
  log r14.w, r8.w
  mul r14.w, r14.w, cb0[14].z
  exp r14.w, r14.w
  movc r13.w, r13.w, r14.w, r8.w
  mad r13.w, r13.w, cb0[14].w, l(0.500000)
  round_z r13.w, r13.w
  div r13.w, r13.w, cb0[14].w
  movc_sat r13.w, cb0[12].z, r13.w, r8.w
  add r13.w, -r13.w, l(1.000000)
  mul r14.w, r13.w, r13.w
  mul r14.w, r14.w, r14.w
  mul r13.w, r13.w, r14.w
  mad r20.xyz, r15.xyzx, r13.wwww, r2.xyzx
  movc r20.xyz, r10.wwww, r16.zxyz, r20.xyzx
  dp3 r13.w, r9.xyzx, r18.yzwy
  mul r13.w, r13.w, r13.w
  mad r13.w, r13.w, r12.z, l(1.000000)
  max r13.w, r13.w, l(0.000100)
  mul r13.w, r13.w, r13.w
  mul r13.w, r13.w, l(4.000000)
  div r13.w, r11.w, r13.w
  mad r8.w, r8.w, r9.w, r12.w
  mul r8.w, r8.w, r8.w
  div r8.w, l(1.000000, 1.000000, 1.000000, 1.000000), r8.w
  mul r8.w, r8.w, r13.w
  mul r18.yzw, r8.wwww, r20.xxyz
  mul r18.yzw, r21.xxyz, r18.yyzw
  mov_sat r18.x, r18.x
  mul r20.xy, cb0[8].yyyy, cb0[12].yxyy
  mul r20.zw, r6.wwww, r20.xxxy
  mad r20.xy, -r20.xyxx, r6.wwww, l(1.000000, 1.000000, 0.000000, 0.000000)
  mad r8.w, r5.w, r20.z, r20.x
  mul r8.w, r8.w, r18.x
  mad r13.xyz, r18.yzwy, r8.wwww, r13.xyzx
  mul r18.xyz, r18.xxxx, r21.xyzx
  movc r21.xyz, r10.wwww, r17.xyzx, r19.xyzx
  mul r18.xyz, r18.xyzx, r21.xyzx
  mad r8.w, r1.w, r20.w, r20.y
  mad r14.xyz, r18.xyzx, r8.wwww, r14.xyzx
  ilt r8.w, l(1), cb0[10].x
  if_nz r8.w
    dp3 r18.x, r9.xyzx, -cb0[2].xyzx
    lt r8.w, r18.x, l(0.000000)
    and r8.w, r7.w, r8.w
    add r10.w, r18.x, r18.x
    mad r20.yzw, r9.xxyz, r10.wwww, cb0[2].xxyz
    mov r20.x, -r18.x
    mul r21.xyz, r11.xyzx, cb0[6].xyzx
    mad r22.xyz, r7.xyzx, r3.wwww, -r20.yzwy
    dp3 r10.w, r22.xyzx, r22.xyzx
    rsq r10.w, r10.w
    mul r22.xyz, r10.wwww, r22.xyzx
    dp3 r10.w, r8.xyzx, r22.xyzx
    lt r13.w, l(0.000000), r10.w
    log r14.w, r10.w
    mul r14.w, r14.w, cb0[14].z
    exp r14.w, r14.w
    movc r13.w, r13.w, r14.w, r10.w
    mad r13.w, r13.w, cb0[14].w, l(0.500000)
    round_z r13.w, r13.w
    div r13.w, r13.w, cb0[14].w
    movc_sat r10.w, cb0[12].z, r13.w, r10.w
    add r10.w, -r10.w, l(1.000000)
    mul r13.w, r10.w, r10.w
    mul r13.w, r13.w, r13.w
    mul r10.w, r10.w, r13.w
    mad r22.xyz, r15.xyzx, r10.wwww, r2.xyzx
    add r23.xyz, -r22.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    mul r24.xyz, r3.xxxx, r23.xyzx
    mad r22.xyz, r23.xyzx, r3.xxxx, r22.xyzx
    add r22.xyz, -r22.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    mul r23.xyz, r3.yyyy, r24.xyzx
    mov r16.w, l(-1.000000)
    movc r16.xyz, r8.wwww, r22.yzxy, r16.xywx
    movc r17.xyz, r8.wwww, r23.xyzx, r17.xyzx
    movc r21.xyz, r8.wwww, r21.xyzx, cb0[6].xyzx
    mov r18.yzw, cb0[2].xxyz
    movc r18.xyzw, r8.wwww, r20.xyzw, r18.xyzw
    mad r18.yzw, r7.xxyz, r3.wwww, -r18.yyzw
    dp3 r8.w, r18.yzwy, r18.yzwy
    rsq r8.w, r8.w
    mul r18.yzw, r8.wwww, r18.yyzw
    dp3 r8.w, r8.xyzx, r18.yzwy
    ge r10.w, r16.z, l(0.000000)
    lt r13.w, l(0.000000), r8.w
    log r14.w, r8.w
    mul r14.w, r14.w, cb0[14].z
    exp r14.w, r14.w
    movc r13.w, r13.w, r14.w, r8.w
    mad r13.w, r13.w, cb0[14].w, l(0.500000)
    round_z r13.w, r13.w
    div r13.w, r13.w, cb0[14].w
    movc_sat r13.w, cb0[12].z, r13.w, r8.w
    add r13.w, -r13.w, l(1.000000)
    mul r14.w, r13.w, r13.w
    mul r14.w, r14.w, r14.w
    mul r13.w, r13.w, r14.w
    mad r20.xyz, r15.xyzx, r13.wwww, r2.xyzx
    movc r20.xyz, r10.wwww, r16.zxyz, r20.xyzx
    dp3 r13.w, r9.xyzx, r18.yzwy
    mul r13.w, r13.w, r13.w
    mad r13.w, r13.w, r12.z, l(1.000000)
    max r13.w, r13.w, l(0.000100)
    mul r13.w, r13.w, r13.w
    mul r13.w, r13.w, l(4.000000)
    div r13.w, r11.w, r13.w
    mad r8.w, r8.w, r9.w, r12.w
    mul r8.w, r8.w, r8.w
    div r8.w, l(1.000000, 1.000000, 1.000000, 1.000000), r8.w
    mul r8.w, r8.w, r13.w
    mul r18.yzw, r8.wwww, r20.xxyz
    mul r18.yzw, r21.xxyz, r18.yyzw
    mov_sat r18.x, r18.x
    mul r20.xy, cb0[8].zzzz, cb0[12].yxyy
    mul r20.zw, r6.wwww, r20.xxxy
    mad r20.xy, -r20.xyxx, r6.wwww, l(1.000000, 1.000000, 0.000000, 0.000000)
    mad r8.w, r5.w, r20.z, r20.x
    mul r8.w, r8.w, r18.x
    mad r13.xyz, r18.yzwy, r8.wwww, r13.xyzx
    mul r18.xyz, r18.xxxx, r21.xyzx
    movc r21.xyz, r10.wwww, r17.xyzx, r19.xyzx
    mul r18.xyz, r18.xyzx, r21.xyzx
    mad r8.w, r1.w, r20.w, r20.y
    mad r14.xyz, r18.xyzx, r8.wwww, r14.xyzx
    ilt r8.w, l(2), cb0[10].x
    if_nz r8.w
      dp3 r18.x, r9.xyzx, -cb0[3].xyzx
      lt r8.w, r18.x, l(0.000000)
      and r8.w, r7.w, r8.w
      add r10.w, r18.x, r18.x
      mad r20.yzw, r9.xxyz, r10.wwww, cb0[3].xxyz
      mov r20.x, -r18.x
      mul r21.xyz, r11.xyzx, cb0[7].xyzx
      mad r22.xyz, r7.xyzx, r3.wwww, -r20.yzwy
      dp3 r10.w, r22.xyzx, r22.xyzx
      rsq r10.w, r10.w
      mul r22.xyz, r10.wwww, r22.xyzx
      dp3 r10.w, r8.xyzx, r22.xyzx
      lt r13.w, l(0.000000), r10.w
      log r14.w, r10.w
      mul r14.w, r14.w, cb0[14].z
      exp r14.w, r14.w
      movc r13.w, r13.w, r14.w, r10.w
      mad r13.w, r13.w, cb0[14].w, l(0.500000)
      round_z r13.w, r13.w
      div r13.w, r13.w, cb0[14].w
      movc_sat r10.w, cb0[12].z, r13.w, r10.w
      add r10.w, -r10.w, l(1.000000)
      mul r13.w, r10.w, r10.w
      mul r13.w, r13.w, r13.w
      mul r10.w, r10.w, r13.w
      mad r22.xyz, r15.xyzx, r10.wwww, r2.xyzx
      add r23.xyz, -r22.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      mul r24.xyz, r3.xxxx, r23.xyzx
      mad r22.xyz, r23.xyzx, r3.xxxx, r22.xyzx
      add r22.xyz, -r22.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      mul r23.xyz, r3.yyyy, r24.xyzx
      mov r16.w, l(-1.000000)
      movc r16.xyz, r8.wwww, r22.yzxy, r16.xywx
      movc r17.xyz, r8.wwww, r23.xyzx, r17.xyzx
      movc r21.xyz, r8.wwww, r21.xyzx, cb0[7].xyzx
      mov r18.yzw, cb0[3].xxyz
      movc r18.xyzw, r8.wwww, r20.xyzw, r18.xyzw
      mad r18.yzw, r7.xxyz, r3.wwww, -r18.yyzw
      dp3 r8.w, r18.yzwy, r18.yzwy
      rsq r8.w, r8.w
      mul r18.yzw, r8.wwww, r18.yyzw
      dp3 r8.w, r8.xyzx, r18.yzwy
      ge r10.w, r16.z, l(0.000000)
      lt r13.w, l(0.000000), r8.w
      log r14.w, r8.w
      mul r14.w, r14.w, cb0[14].z
      exp r14.w, r14.w
      movc r13.w, r13.w, r14.w, r8.w
      mad r13.w, r13.w, cb0[14].w, l(0.500000)
      round_z r13.w, r13.w
      div r13.w, r13.w, cb0[14].w
      movc_sat r13.w, cb0[12].z, r13.w, r8.w
      add r13.w, -r13.w, l(1.000000)
      mul r14.w, r13.w, r13.w
      mul r14.w, r14.w, r14.w
      mul r13.w, r13.w, r14.w
      mad r20.xyz, r15.xyzx, r13.wwww, r2.xyzx
      movc r20.xyz, r10.wwww, r16.zxyz, r20.xyzx
      dp3 r13.w, r9.xyzx, r18.yzwy
      mul r13.w, r13.w, r13.w
      mad r13.w, r13.w, r12.z, l(1.000000)
      max r13.w, r13.w, l(0.000100)
      mul r13.w, r13.w, r13.w
      mul r13.w, r13.w, l(4.000000)
      div r13.w, r11.w, r13.w
      mad r8.w, r8.w, r9.w, r12.w
      mul r8.w, r8.w, r8.w
      div r8.w, l(1.000000, 1.000000, 1.000000, 1.000000), r8.w
      mul r8.w, r8.w, r13.w
      mul r18.yzw, r8.wwww, r20.xxyz
      mul r18.yzw, r21.xxyz, r18.yyzw
      mov_sat r18.x, r18.x
      mul r16.zw, cb0[8].wwww, cb0[12].yyyx
      mul r20.xy, r6.wwww, r16.zwzz
      mad r16.zw, -r16.zzzw, r6.wwww, l(0.000000, 0.000000, 1.000000, 1.000000)
      mad r8.w, r5.w, r20.x, r16.z
      mul r8.w, r8.w, r18.x
      mad r13.xyz, r18.yzwy, r8.wwww, r13.xyzx
      mul r18.xyz, r18.xxxx, r21.xyzx
      movc r20.xzw, r10.wwww, r17.xxyz, r19.xxyz
      mul r18.xyz, r18.xyzx, r20.xzwx
      mad r8.w, r1.w, r20.y, r16.w
      mad r14.xyz, r18.xyzx, r8.wwww, r14.xyzx
    endif
  endif
endif
mad r0.x, r0.x, cb0[16].x, cb0[16].y
log r8.w, r0.x
mad r8.w, r8.w, cb0[16].z, cb0[16].w
max r8.w, r8.w, l(0.000000)
ftou r8.w, r8.w
ult r10.w, r8.w, l(16)
if_nz r10.w
  mul r16.zw, v0.xxxy, l(0.000000, 0.000000, 0.015625, 0.015625)
  ftou r16.zw, r16.zzzw
  imul null, r10.w, r16.w, cb0[17].x
  imad r8.w, cb0[18].x, r8.w, r10.w
  iadd r8.w, r16.z, r8.w
  div r0.x, l(-1.000000), r0.x
  add r10.w, -cb0[18].w, cb0[18].z
  add r0.x, r0.x, -cb0[18].w
  div r10.w, l(1.000000, 1.000000, 1.000000, 1.000000), r10.w
  mul_sat r0.x, r0.x, r10.w
  mad r10.w, r0.x, l(-2.000000), l(3.000000)
  mul r0.x, r0.x, r0.x
  mul r0.x, r0.x, r10.w
  ishl r10.w, r8.w, l(2)
  ld_indexable(buffer)(uint,uint,uint,uint) r10.w, r10.wwww, t16.yzwx
  bfi r18.xyz, l(30, 30, 30, 0), l(2, 2, 2, 0), r8.wwww, l(1, 2, 3, 0)
  ld_indexable(buffer)(uint,uint,uint,uint) r8.w, r18.xxxx, t16.yzwx
  ishl r8.w, r8.w, l(16)
  or r8.w, r8.w, r10.w
  ld_indexable(buffer)(uint,uint,uint,uint) r10.w, r18.yyyy, t16.yzwx
  ld_indexable(buffer)(uint,uint,uint,uint) r13.w, r18.zzzz, t16.yzwx
  mov r18.x, l(1.000000)
  mov r20.x, l(-1.000000)
  mov r21.xyz, r14.xyzx
  mov r22.xyz, r17.xyzx
  mov r23.xyz, r13.xyzx
  mov r24.xy, r16.xyxx
  mov r14.w, cb0[12].z
  mov r15.w, l(0)
  loop
    uge r16.z, r15.w, r10.w
    breakc_nz r16.z
    iadd r16.z, r8.w, r15.w
    ld_indexable(buffer)(uint,uint,uint,uint) r16.z, r16.zzzz, t16.yzxw
    ld_indexable(buffer)(float,float,float,float) r25.xyzw, r16.zzzz, t17.xyzw
    mul r16.w, r25.w, r25.w
    add r25.xyz, -r0.yzwy, r25.xyzx
    dp3 r18.z, r25.xyzx, r25.xyzx
    lt r17.w, r18.z, r16.w
    if_nz r17.w
      imul null, r17.w, r16.z, l(3)
      ld_indexable(buffer)(float,float,float,float) r26.xyz, r17.wwww, t18.xyzw
      imad r18.w, l(3), r16.z, l(1)
      ld_indexable(buffer)(float,float,float,float) r27.xyz, r18.wwww, t18.xyzw
      mul r26.xyz, r0.xxxx, r26.xyzx
      ld_indexable(buffer)(uint,uint,uint,uint) r18.w, r18.wwww, t19.yzwx
      utof r18.w, r18.w
      ld_indexable(buffer)(uint,uint,uint,uint) r17.w, r17.wwww, t19.yzwx
      rsq r19.w, r18.z
      mul r28.xyz, r19.wwww, -r25.xyzx
      ieq r20.w, r17.w, l(3)
      if_nz r20.w
        imad r16.z, l(3), r16.z, l(2)
        ld_indexable(buffer)(uint,uint,uint,uint) r20.w, r16.zzzz, t19.yzwx
        ld_indexable(buffer)(float,float,float,float) r29.xyz, r16.zzzz, t18.xyzw
        dp3 r16.z, -r25.xyzx, -r25.xyzx
        rsq r16.z, r16.z
        mul r25.xyz, r16.zzzz, -r25.xyzx
        dp3 r16.z, r25.xyzx, r29.xyzx
        mad r30.x, r16.z, l(-0.500000), l(0.500000)
        dp3 r21.w, r25.xyzx, r27.xyzx
        mad r16.z, -r16.z, r16.z, l(1.000000)
        rsq r16.z, r16.z
        mul r16.z, r16.z, r21.w
        mul r31.xyz, r27.zxyz, r29.yzxy
        mad r29.xyz, r27.yzxy, r29.zxyz, -r31.xyzx
        dp3 r21.w, r29.xyzx, r25.xyzx
        ge r21.w, r21.w, l(0.000000)
        mad r25.xy, r16.zzzz, l(-0.250000, 0.250000, 0.000000, 0.000000), l(0.250000, 0.750000, 0.000000, 0.000000)
        movc r30.y, r21.w, r25.x, r25.y
        utof r30.z, r20.w
        sample_l_indexable(texture2darray)(float,float,float,float) r16.z, r30.xyzx, t0.yzxw, s0, l(0.000000)
        mul r16.z, r16.w, r16.z
        div r16.z, r16.z, r18.z
        div r16.w, r18.z, r16.w
        add r16.w, -r16.w, l(1.000000)
        max r16.w, r16.w, l(0.000000)
        mul r16.z, r16.w, r16.z
      else
        ieq r16.w, r17.w, l(2)
        mul r17.w, -r18.z, r27.x
        mul r17.w, r17.w, l(1.442695)
        exp r17.w, r17.w
        mul_sat r17.w, r17.w, r27.y
        mul r18.y, r18.z, r19.w
        dp3 r18.y, r27.xyzx, r18.xyzx
        div r18.y, l(1.000000, 1.000000, 1.000000, 1.000000), r18.y
        movc r16.z, r16.w, r17.w, r18.y
      endif
      mul r25.xyz, r26.xyzx, r16.zzzz
      dp3 r16.z, r9.xyzx, -r28.xyzx
      lt r16.w, r16.z, l(0.000000)
      and r16.w, r7.w, r16.w
      if_nz r16.w
        add r16.w, r16.z, r16.z
        mad r28.xyz, r9.xyzx, r16.wwww, r28.xyzx
        mul r25.xyz, r11.xyzx, r25.xyzx
        mad r26.xyz, r7.xyzx, r3.wwww, -r28.xyzx
        dp3 r16.w, r26.xyzx, r26.xyzx
        rsq r16.w, r16.w
        mul r26.xyz, r16.wwww, r26.xyzx
        dp3 r16.w, r8.xyzx, r26.xyzx
        lt r17.w, l(0.000000), r16.w
        log r18.y, r16.w
        mul r18.y, r18.y, cb0[14].z
        exp r18.y, r18.y
        movc r17.w, r17.w, r18.y, r16.w
        mad r17.w, r17.w, cb0[14].w, l(0.500000)
        round_z r17.w, r17.w
        div r17.w, r17.w, cb0[14].w
        movc_sat r16.w, r14.w, r17.w, r16.w
        add r16.w, -r16.w, l(1.000000)
        mul r17.w, r16.w, r16.w
        mul r17.w, r17.w, r17.w
        mul r16.w, r16.w, r17.w
        mad r26.xyz, r15.xyzx, r16.wwww, r2.xyzx
        add r27.xyz, -r26.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        mul r29.xyz, r3.xxxx, r27.xyzx
        mad r26.xyz, r27.xyzx, r3.xxxx, r26.xyzx
        add r24.xyz, -r26.yzxy, l(1.000000, 1.000000, 1.000000, 0.000000)
        mul r22.xyz, r3.yyyy, r29.xyzx
        mov r16.z, -r16.z
      else
        mov r20.yz, r24.xxyx
        mov r24.xyz, r20.yzxy
      endif
      mad r20.yzw, r7.xxyz, r3.wwww, -r28.xxyz
      dp3 r16.w, r20.yzwy, r20.yzwy
      rsq r16.w, r16.w
      mul r20.yzw, r16.wwww, r20.yyzw
      dp3 r16.w, r8.xyzx, r20.yzwy
      ge r17.w, r24.z, l(0.000000)
      if_nz r17.w
        mov r26.xyz, r24.zxyz
      else
        lt r18.y, l(0.000000), r16.w
        log r18.z, r16.w
        mul r18.z, r18.z, cb0[14].z
        exp r18.z, r18.z
        movc r18.y, r18.y, r18.z, r16.w
        mad r18.y, r18.y, cb0[14].w, l(0.500000)
        round_z r18.y, r18.y
        div r18.y, r18.y, cb0[14].w
        movc_sat r18.y, r14.w, r18.y, r16.w
        add r18.y, -r18.y, l(1.000000)
        mul r18.z, r18.y, r18.y
        mul r18.z, r18.z, r18.z
        mul r18.y, r18.z, r18.y
        mad r26.xyz, r15.xyzx, r18.yyyy, r2.xyzx
      endif
      dp3 r18.y, r9.xyzx, r20.yzwy
      mul r18.y, r18.y, r18.y
      mad r18.y, r18.y, r12.z, l(1.000000)
      max r18.y, r18.y, l(0.000100)
      mul r18.y, r18.y, r18.y
      mul r18.yw, r18.yyyw, l(0.000000, 4.000000, 0.000000, 0.00392156886)
      div r18.y, r11.w, r18.y
      mad r16.w, r16.w, r9.w, r12.w
      mul r16.w, r16.w, r16.w
      div r16.w, l(1.000000, 1.000000, 1.000000, 1.000000), r16.w
      mul r16.w, r16.w, r18.y
      mul r20.yzw, r16.wwww, r26.xxyz
      mul r20.yzw, r25.xxyz, r20.yyzw
      mov_sat r16.z, r16.z
      mul r18.yz, r18.wwww, cb0[12].yyxy
      movc r16.w, r14.w, cb0[14].z, l(1.000000)
      mul r24.zw, r16.wwww, r18.yyyz
      mad r18.yz, -r18.yyzy, r16.wwww, l(0.000000, 1.000000, 1.000000, 0.000000)
      mad r16.w, r5.w, r24.z, r18.y
      mul r16.w, r16.w, r16.z
      mad r23.xyz, r20.yzwy, r16.wwww, r23.xyzx
      mul r20.yzw, r16.zzzz, r25.xxyz
      movc r25.xyz, r17.wwww, r22.xyzx, r19.xyzx
      mul r20.yzw, r20.yyzw, r25.xxyz
      mad r16.z, r1.w, r24.w, r18.z
      mad r21.xyz, r20.yzwy, r16.zzzz, r21.xyzx
    endif
    iadd r15.w, r15.w, l(1)
  endloop
  iadd r8.w, r8.w, r10.w
  mov r16.x, l(1.000000)
  mov r17.x, l(-1.000000)
  mov r14.xyz, r21.xyzx
  mov r18.xyz, r22.xyzx
  mov r13.xyz, r23.xyzx
  mov r20.xy, r24.xyxx
  mov r10.w, cb0[12].z
  mov r14.w, l(0)
  loop
    uge r15.w, r14.w, r13.w
    breakc_nz r15.w
    iadd r15.w, r8.w, r14.w
    ld_indexable(buffer)(uint,uint,uint,uint) r15.w, r15.wwww, t16.yzwx
    imul null, r16.w, r15.w, l(5)
    ld_indexable(buffer)(float,float,float,float) r25.xyz, r16.wwww, t20.xyzw
    imad r16.w, l(5), r15.w, l(4)
    ld_indexable(buffer)(float,float,float,float) r26.xyz, r16.wwww, t20.xyzw
    add r25.xyz, -r0.yzwy, r25.xyzx
    dp3 r16.z, r25.xyzx, r25.xyzx
    lt r16.w, r16.z, r26.x
    if_nz r16.w
      imad r16.w, l(5), r15.w, l(1)
      ld_indexable(buffer)(float,float,float,float) r27.xyz, r16.wwww, t20.xyzw
      rsq r16.w, r16.z
      mul r28.xyz, r16.wwww, -r25.xyzx
      dp3 r17.w, -r28.xyzx, r27.xyzx
      mad_sat r17.w, r17.w, r26.z, r26.y
      lt r18.w, l(0.000000), r17.w
      if_nz r18.w
        imad r24.zw, l(0, 0, 5, 5), r15.wwww, l(0, 0, 2, 3)
        ld_indexable(buffer)(float,float,float,float) r26.yzw, r24.zzzz, t20.wxyz
        ld_indexable(buffer)(float,float,float,float) r29.xyz, r24.wwww, t20.xyzw
        mul r26.yzw, r0.xxxx, r26.yyzw
        imul null, r18.w, r15.w, l(3)
        imad r19.w, l(3), r15.w, l(1)
        ld_indexable(buffer)(uint,uint,uint,uint) r19.w, r19.wwww, t21.yzwx
        utof r19.w, r19.w
        mul r19.w, r19.w, l(0.00392156886)
        ld_indexable(buffer)(uint,uint,uint,uint) r18.w, r18.wwww, t21.yzwx
        ieq r20.w, r18.w, l(3)
        if_nz r20.w
          imad r15.w, l(3), r15.w, l(2)
          ld_indexable(buffer)(uint,uint,uint,uint) r15.w, r15.wwww, t21.yzwx
          dp3 r20.w, -r25.xyzx, -r25.xyzx
          rsq r20.w, r20.w
          mul r25.xyz, r20.wwww, -r25.xyzx
          dp3 r20.w, r25.xyzx, r27.xyzx
          mad r30.x, r20.w, l(-0.500000), l(0.500000)
          dp3 r21.w, r25.xyzx, r29.xyzx
          mad r20.w, -r20.w, r20.w, l(1.000000)
          rsq r20.w, r20.w
          mul r20.w, r20.w, r21.w
          mul r31.xyz, r27.yzxy, r29.zxyz
          mad r27.xyz, r29.yzxy, r27.zxyz, -r31.xyzx
          dp3 r21.w, r27.xyzx, r25.xyzx
          ge r21.w, r21.w, l(0.000000)
          mad r24.zw, r20.wwww, l(0.000000, 0.000000, -0.250000, 0.250000), l(0.000000, 0.000000, 0.250000, 0.750000)
          movc r30.y, r21.w, r24.z, r24.w
          utof r30.z, r15.w
          sample_l_indexable(texture2darray)(float,float,float,float) r15.w, r30.xyzx, t0.yzwx, s0, l(0.000000)
          mul r15.w, r26.x, r15.w
          div r15.w, r15.w, r16.z
          div r20.w, r16.z, r26.x
          add_sat r20.w, -r20.w, l(1.000000)
          mul r15.w, r15.w, r20.w
          mul r15.w, r17.w, r15.w
        else
          ieq r18.w, r18.w, l(2)
          mul r20.w, -r16.z, r29.x
          mul r20.w, r20.w, l(1.442695)
          exp r20.w, r20.w
          mul_sat r20.w, r20.w, r29.y
          mul r20.w, r17.w, r20.w
          mul r16.y, r16.w, r16.z
          dp3 r16.y, r16.xyzx, r29.xyzx
          div r16.y, r17.w, r16.y
          movc r15.w, r18.w, r20.w, r16.y
        endif
        mul r16.yzw, r26.yyzw, r15.wwww
        dp3 r15.w, r9.xyzx, -r28.xyzx
        lt r17.w, r15.w, l(0.000000)
        and r17.w, r7.w, r17.w
        if_nz r17.w
          add r17.w, r15.w, r15.w
          mad r28.xyz, r9.xyzx, r17.wwww, r28.xyzx
          mul r16.yzw, r11.xxyz, r16.yyzw
          mad r25.xyz, r7.xyzx, r3.wwww, -r28.xyzx
          dp3 r17.w, r25.xyzx, r25.xyzx
          rsq r17.w, r17.w
          mul r25.xyz, r17.wwww, r25.xyzx
          dp3 r17.w, r8.xyzx, r25.xyzx
          lt r18.w, l(0.000000), r17.w
          log r20.w, r17.w
          mul r20.w, r20.w, cb0[14].z
          exp r20.w, r20.w
          movc r18.w, r18.w, r20.w, r17.w
          mad r18.w, r18.w, cb0[14].w, l(0.500000)
          round_z r18.w, r18.w
          div r18.w, r18.w, cb0[14].w
          movc_sat r17.w, r10.w, r18.w, r17.w
          add r17.w, -r17.w, l(1.000000)
          mul r18.w, r17.w, r17.w
          mul r18.w, r18.w, r18.w
          mul r17.w, r17.w, r18.w
          mad r25.xyz, r15.xyzx, r17.wwww, r2.xyzx
          add r26.xyz, -r25.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
          mul r27.xyz, r3.xxxx, r26.xyzx
          mad r25.xyz, r26.xyzx, r3.xxxx, r25.xyzx
          add r20.xyz, -r25.yzxy, l(1.000000, 1.000000, 1.000000, 0.000000)
          mul r18.xyz, r3.yyyy, r27.xyzx
          mov r15.w, -r15.w
        else
          mov r17.yz, r20.xxyx
          mov r20.xyz, r17.yzxy
        endif
        mad r17.yzw, r7.xxyz, r3.wwww, -r28.xxyz
        dp3 r18.w, r17.yzwy, r17.yzwy
        rsq r18.w, r18.w
        mul r17.yzw, r17.yyzw, r18.wwww
        dp3 r18.w, r8.xyzx, r17.yzwy
        ge r20.w, r20.z, l(0.000000)
        if_nz r20.w
          mov r25.xyz, r20.zxyz
        else
          lt r20.z, l(0.000000), r18.w
          log r21.w, r18.w
          mul r21.w, r21.w, cb0[14].z
          exp r21.w, r21.w
          movc r20.z, r20.z, r21.w, r18.w
          mad r20.z, r20.z, cb0[14].w, l(0.500000)
          round_z r20.z, r20.z
          div r20.z, r20.z, cb0[14].w
          movc_sat r20.z, r10.w, r20.z, r18.w
          add r20.z, -r20.z, l(1.000000)
          mul r21.w, r20.z, r20.z
          mul r21.w, r21.w, r21.w
          mul r20.z, r20.z, r21.w
          mad r25.xyz, r15.xyzx, r20.zzzz, r2.xyzx
        endif
        dp3 r17.y, r9.xyzx, r17.yzwy
        mul r17.y, r17.y, r17.y
        mad r17.y, r17.y, r12.z, l(1.000000)
        max r17.y, r17.y, l(0.000100)
        mul r17.y, r17.y, r17.y
        mul r17.y, r17.y, l(4.000000)
        div r17.y, r11.w, r17.y
        mad r17.z, r18.w, r9.w, r12.w
        mul r17.z, r17.z, r17.z
        div r17.z, l(1.000000, 1.000000, 1.000000, 1.000000), r17.z
        mul r17.y, r17.z, r17.y
        mul r17.yzw, r17.yyyy, r25.xxyz
        mul r17.yzw, r16.yyzw, r17.yyzw
        mov_sat r15.w, r15.w
        mul r24.zw, r19.wwww, cb0[12].yyyx
        movc r18.w, r10.w, cb0[14].z, l(1.000000)
        mul r25.xy, r18.wwww, r24.zwzz
        mad r24.zw, -r24.zzzw, r18.wwww, l(0.000000, 0.000000, 1.000000, 1.000000)
        mad r18.w, r5.w, r25.x, r24.z
        mul r18.w, r15.w, r18.w
        mad r13.xyz, r17.yzwy, r18.wwww, r13.xyzx
        mul r16.yzw, r15.wwww, r16.yyzw
        movc r17.yzw, r20.wwww, r18.xxyz, r19.xxyz
        mul r16.yzw, r16.yyzw, r17.yyzw
        mad r15.w, r1.w, r25.y, r24.w
        mad r14.xyz, r16.yzwy, r15.wwww, r14.xyzx
      endif
    endif
    iadd r14.w, r14.w, l(1)
  endloop
endif
ne r0.x, cb0[33].x, l(0.000000)
dp3 r3.y, -r8.xyzx, r9.xyzx
add r3.y, r3.y, r3.y
mad r8.xyz, r9.xyzx, -r3.yyyy, -r8.xyzx
mov r7.x, -r9.y
mov r7.y, -r8.y
mov_sat r7.xy, r7.xyxx
dp3_sat r12.y, r8.xyzx, -cb0[0].xyzx
mov_sat r12.x, r12.x
add r3.yw, r7.xxxy, r12.xxxy
mul_sat r3.yw, r3.yyyw, cb0[33].xxxx
add r6.z, r6.z, l(-1.000000)
mad r3.yw, r3.yyyw, r6.zzzz, l(0.000000, 1.000000, 0.000000, 1.000000)
movc r3.yw, r0.xxxx, r3.yyyw, l(0,1.000000,0,1.000000)
sample_l_indexable(texturecube)(float,float,float,float) r7.xyz, r9.xyzx, t3.xyzw, s3, l(6.000000)
mul r7.xyz, r3.yyyy, r7.xyzx
mad r7.xyz, r7.xyzx, cb0[34].xyzx, cb0[9].xyzx
add r0.x, -cb0[34].w, l(1.000000)
mad r0.x, r1.w, cb0[34].w, r0.x
add r0.x, r0.x, l(-1.000000)
mad r0.x, r6.w, r0.x, l(1.000000)
add r6.xy, -r6.yxyy, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r3.y, r0.x, r6.x
mul r7.xyz, r3.yyyy, r7.xyzx
mad r7.xyz, r7.xyzx, r19.xyzx, r14.xyzx
mul r3.y, r4.w, l(6.000000)
max r8.w, |r8.y|, l(0.008749)
sample_l_indexable(texturecube)(float,float,float,float) r8.xyz, r8.xwzx, t3.xyzw, s3, r3.y
mul r8.xyz, r3.wwww, r8.xyzx
if_nz cb0[12].z
  add r12.x, -r5.y, l(1.000000)
  itof r3.y, cb0[12].z
  add r3.y, r3.y, l(-0.500000)
  itof r3.w, cb0[35].x
  div r12.y, r3.y, r3.w
  sample_l_indexable(texture2d)(float,float,float,float) r12.xyz, r12.xyxx, t5.xyzw, s5, l(0.000000)
  mad r12.xyz, r12.xyzx, cb0[15].yyyy, -r8.xyzx
  mad r8.xyz, cb0[15].xxxx, r12.xyzx, r8.xyzx
endif
mul r8.xyz, r8.xyzx, cb0[36].xyzx
lt r3.y, l(0.000000), r3.z
log r3.w, r3.z
mul r3.w, r3.w, cb0[14].z
exp r3.w, r3.w
movc r3.y, r3.y, r3.w, r3.z
mad r3.y, r3.y, cb0[14].w, l(0.500000)
round_z r3.y, r3.y
div r3.y, r3.y, cb0[14].w
movc r3.y, cb0[12].z, r3.y, r3.z
mov r3.z, r2.w
sample_indexable(texture2d)(float,float,float,float) r3.zw, r3.yzyy, t2.zwxy, s2
mad r12.xyz, r2.xyzx, r3.zzzz, r3.wwww
mul r8.xyz, r8.xyzx, r12.xyzx
add r2.w, -cb0[36].w, l(1.000000)
mad r1.w, r1.w, cb0[36].w, r2.w
add r2.w, -r1.w, l(1.000000)
mad r2.w, r5.w, r2.w, r1.w
mad r1.w, r1.w, r2.w, l(-1.000000)
mad r1.w, r6.w, r1.w, l(1.000000)
mul r2.w, r6.y, r1.w
mad r6.xyz, r8.xyzx, r2.wwww, r13.xyzx
div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r5.x
dp3 r3.z, r10.xyzx, r10.xyzx
rsq r3.z, r3.z
mul r8.xyz, r3.zzzz, r10.xyzx
dp3_sat r3.z, r9.xyzx, r8.xyzx
mad r3.z, -r3.z, r3.z, l(1.000000)
sqrt r3.z, r3.z
mad r3.z, r3.z, r2.w, -r3.z
add r9.xyz, r9.xyzx, l(-0.000000, -1.000000, -0.000000, 0.000000)
mul r8.xyz, r2.wwww, r8.xyzx
mad r8.xyz, r3.zzzz, r9.xyzx, -r8.xyzx
dp3 r2.w, r8.xyzx, r8.xyzx
rsq r2.w, r2.w
mul r8.xyz, r2.wwww, r8.xyzx
mad r8.xyz, r8.xyzx, r5.zzzz, r0.yzwy
mov r8.w, l(1.000000)
dp4 r9.x, r8.xyzw, cb0[22].xyzw
dp4 r9.y, r8.xyzw, cb0[23].xyzw
dp4 r0.y, r8.xyzw, cb0[24].xyzw

//Haloing fix. Related to water PS.
add r32.w, r0.y, -r32.y
mul r32.w, r32.w, l(0.5)
mad r9.x, r32.x, r32.w, r9.x

div r0.yz, r9.xxyx, r0.yyyy
sample_indexable(texture2d)(float,float,float,float) r0.w, r0.yzyy, t1.yzwx, s1
if_nz r7.w
  div r3.zw, v1.xxxy, v1.wwww
  mad r3.zw, r3.zzzw, l(0.000000, 0.000000, 0.500000, -0.500000), l(0.000000, 0.000000, 0.500000, 0.500000)
  dp3 r2.w, -r10.xyzx, cb0[20].xyzx
  mov_sat r3.y, r3.y
  add r3.y, -r3.y, l(1.000000)
  mul r4.w, r3.y, r3.y
  mul r4.w, r4.w, r4.w
  mul r3.y, r3.y, r4.w
  mad r2.xyz, r15.xyzx, r3.yyyy, r2.xyzx
  add r5.xzw, -r2.xxyz, l(1.000000, 0.000000, 1.000000, 1.000000)
  mad r2.xyz, r5.xzwx, r3.xxxx, r2.xyzx
  add r2.xyz, -r2.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  mul r5.xzw, r3.xxxx, r2.xxyz
  mad_sat r0.w, cb0[21].y, r0.w, cb0[21].x
  div r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r0.w
  lt r0.w, r0.w, r2.w
  movc r0.yz, r0.wwww, r3.zzwz, r0.yyzy
  mad r0.yz, r0.yyzy, cb0[37].zzwz, cb0[37].xxyx
  sample_l_indexable(texture2d)(float,float,float,float) r3.xyz, r0.yzyy, t4.xyzw, s4, l(16.000000)
  mul r3.xyz, r3.xyzx, cb0[34].xyzx
  mul r3.xyz, r0.xxxx, r3.xyzx
  mul r3.xyz, r5.xzwx, r3.xyzx
  mad r7.xyz, r3.xyzx, r11.xyzx, r7.xyzx
  sample_l_indexable(texture2d)(float,float,float,float) r0.xyz, r0.yzyy, t4.xyzw, s4, l(0.000000)
  if_nz cb0[12].z
    add r3.x, -r5.y, l(1.000000)
    itof r0.w, cb0[12].z
    add r0.w, r0.w, l(-0.500000)
    itof r2.w, cb0[35].x
    div r3.y, r0.w, r2.w
    sample_l_indexable(texture2d)(float,float,float,float) r3.xyz, r3.xyxx, t5.xyzw, s5, l(0.000000)
    mad r3.xyz, r3.xyzx, cb0[15].yyyy, -r0.xyzx
    mad r0.xyz, cb0[15].xxxx, r3.xyzx, r0.xyzx
  endif
  mul r0.xyz, r0.xyzx, cb0[36].xyzx
  mul r0.xyz, r1.wwww, r0.xyzx
  mul r0.xyz, r2.xyzx, r0.xyzx
  mad r6.xyz, r0.xyzx, r11.xyzx, r6.xyzx
endif
mad r0.xyz, r7.xyzx, r1.xyzx, r4.xyzx
add o0.xyz, r6.xyzx, r0.xyzx
mov o0.w, l(1.000000)
ret
// Approximately 892 instruction slots used
