// MANUALLY DUMPED [ShaderRegex_LightingPS1] Crystals fix 1.
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Sat Feb 06 12:38:59 2021
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float4 litDir[4];                  // Index:    0 1 2 3          Components:    16
//   float4 litCol[4];                  // Index:    4 5 6 7          Components:    16
//   int nDirLit;                       // Index:    8.x              Components:     1
//   float4 vEye;                       // Index:    9.xyzw           Components:     4
//   int3 vSplsNumSS;                   // Index:   10.xyz            Components:     3
//   float4 vSubCbW2S[16];              // Index:   11-26             Components:    64
//   int3 vSslsNumSS;                   // Index:   27.xyz            Components:     3
//   row_major float4x4 mSubSptW2S[8];  // Index:   28-59             Components:   128
//   float4 vClstZPrm;                  // Index:   60.xyzw           Components:     4
//   int nClstPtch[2];                  // Index:   61-62.x           Components:     5
//   float fClstScl;                    // Index:   62.y              Components:     1 [unused]
//   float2 vFadeDist;                  // Index:   62.zw             Components:     2
//   row_major float4x4 mW2S[3];        // Index:   63-74             Components:    48
//   float4 vSMOf[3];                   // Index:   75 76 77          Components:    12
//   float4 vS2VZ;                      // Index:   78.xyzw           Components:     4
//   float4 vSMDF;                      // Index:   79.xyzw           Components:     4
//   float4 scSM;                       // Index:   80.xyzw           Components:     4
//   float4 scSM2;                      // Index:   81.xyzw           Components:     4
//   float4 sdplane;                    // Index:   82.xyzw           Components:     4
//   float3 vCameraPos;                 // Index:   83.xyz            Components:     3
//   float3 vCameraDir;                 // Index:   84.xyz            Components:     3
//   float3 vCameraViewY;               // Index:   85.xyz            Components:     3
//   float2 vD2Z;                       // Index:   86.xy             Components:     2
//   float4 mRrW2T[3];                  // Index:   87 88 89          Components:    12
//   row_major float4x4 mV2W;           // Index:   90 91 92 93       Components:    16
//   row_major float4x4 mP2W;           // Index:   94 95 96 97       Components:    16
//   float fAmbMapsDORate;              // Index:   98.x              Components:     1
//      = 0x00000000
//   float4 vAmbDifScl;                 // Index:   99.xyzw           Components:     4
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
//   row_major float4x4 mP2V;           // Index:  100 101 102 103    Components:    16
//   float4 vAmbSpcScl;                 // Index:  104.xyzw           Components:     4
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// __smpsShadow                      sampler      NA          NA    0        1
// __smpsIES                         sampler      NA          NA    1        1
// __smpsDepthMap                    sampler      NA          NA    2        1
// __smpsSplShadow                 sampler_c      NA          NA    3        1
// __smpsSslShadow                 sampler_c      NA          NA    4        1
// __smpsAmbSpc                      sampler      NA          NA    5        1
// __smpsTrnsSpc                     sampler      NA          NA    6        1
// __smpsTrnsDpt                     sampler      NA          NA    7        1
// sShadow                           texture  float4          2d    0        1
// sIES                              texture  float4     2darray    1        1
// sDepthMap                         texture  float4          2d    2        1
// sSplShadow                        texture  float4   cubearray    3        1
// sSslShadow                        texture  float4     2darray    4        1
// sAmbSpc                           texture  float4        cube    5        1
// sTrnsSpc                          texture  float4          2d    6        1
// sTrnsDpt                          texture  float4          2d    7        1
// sDepth                            texture  float4          2d    8        1
// sGBuf0                            texture  float4          2d    9        1
// sGBuf1                            texture  float4          2d   10        1
// sGBuf2                            texture  float4          2d   11        1
// sGBuf3                            texture  float4          2d   12        1
// sGBuf4                            texture  float4          2d   13        1
// sGBuf5                            texture  float4          2d   14        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
// tMaterialTable                    texture    uint         buf   30        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[105], dynamicIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_comparison
dcl_sampler s4, mode_comparison
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_sampler s7, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2darray (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texturecubearray (float,float,float,float) t3
dcl_resource_texture2darray (float,float,float,float) t4
dcl_resource_texturecube (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_resource_texture2d (float,float,float,float) t9
dcl_resource_texture2d (float,float,float,float) t10
dcl_resource_texture2d (float,float,float,float) t11
dcl_resource_texture2d (float,float,float,float) t12
dcl_resource_texture2d (float,float,float,float) t13
dcl_resource_texture2d (float,float,float,float) t14
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_resource_buffer (uint,uint,uint,uint) t30
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyw
dcl_output o0.xyzw
dcl_temps 42
dcl_resource_texture2d (float,float,float,float) t125
ftoi r0.xy, v0.xyxx
mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.xyww, t10.xyzw
mul r1.xyz, r1.zxyz, l(255.000000, 0.996337, 0.996337, 0.000000)
mad r1.w, r1.w, l(255.000000), l(0.500000)
ftoi r1.w, r1.w
ld_indexable(buffer)(uint,uint,uint,uint) r1.w, r1.wwww, t30.yzwx
ld_indexable(texture2d)(float,float,float,float) r2.xyzw, r0.xyww, t9.xyzw
ld_indexable(texture2d)(float,float,float,float) r3.xyzw, r0.xyww, t11.xyzw
ld_indexable(texture2d)(float,float,float,float) r4.xy, r0.xyww, t12.xwyz
ld_indexable(texture2d)(float,float,float,float) r5.xyz, r0.xyww, t13.xyzw
ld_indexable(texture2d)(float,float,float,float) r6.xyz, r0.xyww, t14.xyzw
ld_indexable(texture2d)(float,float,float,float) r0.x, r0.xyzw, t8.xyzw
ld_indexable(texture2d)(float,float,float,float) r26.xyzw, l(0, 0, 0, 0), t125.xyzw
mov r27.x, v1.x
mul r28.xyzw, v1.yyyy, cb0[95].xyzw
mad r28.xyzw, r27.xxxx, cb0[94].xyzw, r28.xyzw
mad r28.xyzw, r0.xxxx, cb0[96].xyzw, r28.xyzw
add r28.xyzw, r28.xyzw, cb0[97].xyzw
add r27.x, -r26.x, r27.x
mul r29.xyzw, v1.yyyy, cb0[95].xyzw
mad r29.xyzw, r27.xxxx, cb0[94].xyzw, r29.xyzw
mad r29.xyzw, r0.xxxx, cb0[96].xyzw, r29.xyzw
add r29.xyzw, r29.xyzw, cb0[97].xyzw
div r29.xyzw, r29.xyzw, r29.wwww
mul r30.w, r26.y, r28.w
mad r27.x, r26.x, r30.w, r27.x
mul r7.xyzw, v1.yyyy, cb0[95].xyzw
mad r7.xyzw, r27.xxxx, cb0[94].xyzw, r7.xyzw
mad r7.xyzw, r0.xxxx, cb0[96].xyzw, r7.xyzw
add r7.xyzw, r7.xyzw, cb0[97].xyzw
div r7.xyzw, r7.xyzw, r7.wwww

div r28.xyzw, r28.xyzw, r28.wwww

add r0.yzw, -r29.xxyz, cb0[9].xxyz
dp3 r4.z, r0.yzwy, r0.yzwy
rsq r4.w, r4.z
mul r8.xyz, r0.yzwy, r4.wwww
add r3.w, r3.w, r3.w
ftou r1.x, r1.x
and r5.w, r1.x, l(15)
utof r5.w, r5.w
mad r9.x, r5.w, l(0.000244200259), r1.y
ushr r1.x, r1.x, l(4)
utof r1.x, r1.x
mad r9.y, r1.x, l(0.000244200259), r1.z
mad r1.xy, r9.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
add r9.xyz, -|r1.xyxx|, l(1.000000, 1.000000, 1.000000, 0.000000)
add r10.z, -|r1.y|, r9.x
ge r1.z, r10.z, l(0.000000)
ge r9.xw, r1.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, r1.zzzz, r1.xyxx, r9.xyxx
dp3 r1.x, r10.xyzx, r10.xyzx
rsq r1.x, r1.x
mul r1.xyz, r1.xxxx, r10.xyzx
mul r9.xyz, r1.yyyy, cb0[91].xyzx
mad r9.xyz, r1.xxxx, cb0[90].xyzx, r9.xyzx
mad r1.xyz, r1.zzzz, cb0[92].xyzx, r9.xyzx
add r4.x, r4.x, l(1.000000)
and r9.xy, r1.wwww, l(1, 2, 0, 0)
movc r6.xyz, r9.xxxx, r6.xyzx, l(0,0,0,0)

mov r41.xyw, v1.xyxw
mad r41.x, -r26.x, r41.w, r41.x

div r39.xz, r41.xxyx, v1.wwww

div r9.xz, v1.xxyx, v1.wwww

add r10.xyz, -r29.xyzx, cb0[83].xyzx

dp3_sat r1.w, r1.xyzx, r8.xyzx
add r5.w, r2.w, r1.w
mad r5.w, r5.w, r5.w, r2.w
add_sat r5.w, r5.w, l(-1.000000)
mul r11.xyzw, r7.yyyy, cb0[64].xyzw
mad r11.xyzw, r7.xxxx, cb0[63].xyzw, r11.xyzw
mad r11.xyzw, r7.zzzz, cb0[65].xyzw, r11.xyzw
mad r11.xyzw, r7.wwww, cb0[66].xyzw, r11.xyzw
mul r12.xyz, r7.yyyy, cb0[68].xyzx
mad r12.xyz, r7.xxxx, cb0[67].xyzx, r12.xyzx
mad r12.xyz, r7.zzzz, cb0[69].xyzx, r12.xyzx
mad r12.xyz, r7.wwww, cb0[70].xyzx, r12.xyzx
mul r13.xyz, r7.yyyy, cb0[72].xyzx
mad r13.xyz, r7.xxxx, cb0[71].xyzx, r13.xyzx
mad r13.xyz, r7.zzzz, cb0[73].xyzx, r13.xyzx
mad r13.xyz, r7.wwww, cb0[74].xyzx, r13.xyzx
dp4 r6.w, r11.xyzw, cb0[78].xyzw
lt r8.w, l(0.000000), r6.w
movc r12.xyz, r8.wwww, r12.xyzx, r11.xyzx
movc r14.xyzw, r8.wwww, cb0[76].xyzw, cb0[75].xyzw
add r6.w, r6.w, -cb0[79].x
lt r6.w, l(0.000000), r6.w
movc r12.xyz, r6.wwww, r13.zxyz, r12.zxyz
movc r13.xyzw, r6.wwww, cb0[77].xyzw, r14.xyzw
add r14.xz, r12.zzyz, cb0[81].yyxy
mov_sat r12.x, r12.x
mov_sat r12.yz, r14.zzxz
mad r12.yz, r12.yyzy, r13.xxyx, r13.zzwz
mad r15.xy, r12.yzyy, cb0[80].zwzz, l(-0.500000, -0.500000, 0.000000, 0.000000)
frc r15.xy, r15.xyxx
add r15.zw, -r15.xxxy, l(0.000000, 0.000000, 0.500000, 0.500000)
mad r12.yz, r15.zzwz, cb0[80].xxyx, r12.yyzy
gather4_indexable(texture2d)(float,float,float,float) r16.xyzw, r12.yzyy, t0.xyzw, s0.x
lt r16.xyzw, r16.wxyz, r12.xxxx
and r17.xyzw, r16.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r16.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r17.wwzw
mad r12.yz, r15.xxxx, r12.yyzy, r17.xxyx
add r6.w, -r12.y, r12.z
mad r6.w, r15.y, r6.w, r12.y
add r14.yw, r14.xxxz, cb0[80].yyyx
mov_sat r15.xyzw, r14.wxzy
mad r15.xyzw, r15.xyzw, r13.xyxy, r13.zwzw
mad r16.xyzw, r15.xyzw, cb0[80].zwzw, l(-0.500000, -0.500000, -0.500000, -0.500000)
frc r16.xyzw, r16.xyzw
add r17.xyzw, -r16.xyzw, l(0.500000, 0.500000, 0.500000, 0.500000)
mad r15.xyzw, r17.xyzw, cb0[80].xyxy, r15.xyzw
gather4_indexable(texture2d)(float,float,float,float) r17.xyzw, r15.xyxx, t0.xyzw, s0.x
lt r17.xyzw, r17.wxyz, r12.xxxx
and r18.xyzw, r17.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r17.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r18.wwzw
mad r12.yz, r16.xxxx, r12.yyzy, r18.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r16.y, r8.w, r12.y
add r6.w, r6.w, r8.w
add r17.xz, r14.wwyw, cb0[80].xxyx
mov r17.yw, r14.xxxy
mov_sat r18.xyzw, r17.xyxw
mad r18.xyzw, r18.xyzw, r13.xyxy, r13.zwzw
mad r19.xyzw, r18.xyzw, cb0[80].zwzw, l(-0.500000, -0.500000, -0.500000, -0.500000)
frc r19.xyzw, r19.xyzw
add r20.xyzw, -r19.xyzw, l(0.500000, 0.500000, 0.500000, 0.500000)
mad r18.xyzw, r20.xyzw, cb0[80].xyxy, r18.xyzw
gather4_indexable(texture2d)(float,float,float,float) r20.xyzw, r18.xyxx, t0.xyzw, s0.x
lt r20.xyzw, r20.wxyz, r12.xxxx
and r21.xyzw, r20.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r20.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r21.wwzw
mad r12.yz, r19.xxxx, r12.yyzy, r21.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r19.y, r8.w, r12.y
add r6.w, r6.w, r8.w
add r20.xy, r17.xzxx, cb0[80].xyxx
mov r20.zw, r17.yyyw
mov_sat r21.xyzw, r20.xzxw
mad r21.xyzw, r21.xyzw, r13.xyxy, r13.zwzw
mad r22.xyzw, r21.xyzw, cb0[80].zwzw, l(-0.500000, -0.500000, -0.500000, -0.500000)
frc r22.xyzw, r22.xyzw
add r23.xyzw, -r22.xyzw, l(0.500000, 0.500000, 0.500000, 0.500000)
mad r21.xyzw, r23.xyzw, cb0[80].xyxy, r21.xyzw
gather4_indexable(texture2d)(float,float,float,float) r23.xyzw, r21.xyxx, t0.xyzw, s0.x
lt r23.xyzw, r23.wxyz, r12.xxxx
and r24.xyzw, r23.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r23.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r24.wwzw
mad r12.yz, r22.xxxx, r12.yyzy, r24.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r22.y, r8.w, r12.y
add r6.w, r6.w, r8.w
gather4_indexable(texture2d)(float,float,float,float) r15.xyzw, r15.zwzz, t0.xyzw, s0.x
lt r15.xyzw, r15.wxyz, r12.xxxx
and r23.xyzw, r15.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r15.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r23.wwzw
mad r12.yz, r16.zzzz, r12.yyzy, r23.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r16.w, r8.w, r12.y
add r6.w, r6.w, r8.w
mov_sat r12.yz, r14.wwyw
mad r12.yz, r12.yyzy, r13.xxyx, r13.zzwz
mad r15.xy, r12.yzyy, cb0[80].zwzz, l(-0.500000, -0.500000, 0.000000, 0.000000)
frc r15.xy, r15.xyxx
add r15.zw, -r15.xxxy, l(0.000000, 0.000000, 0.500000, 0.500000)
mad r12.yz, r15.zzwz, cb0[80].xxyx, r12.yyzy
gather4_indexable(texture2d)(float,float,float,float) r16.xyzw, r12.yzyy, t0.xyzw, s0.x
lt r16.xyzw, r16.wxyz, r12.xxxx
and r23.xyzw, r16.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r16.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r23.wwzw
mad r12.yz, r15.xxxx, r12.yyzy, r23.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r15.y, r8.w, r12.y
add r6.w, r6.w, r8.w
gather4_indexable(texture2d)(float,float,float,float) r15.xyzw, r18.zwzz, t0.xyzw, s0.x
lt r15.xyzw, r15.wxyz, r12.xxxx
and r16.xyzw, r15.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r15.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r16.wwzw
mad r12.yz, r19.zzzz, r12.yyzy, r16.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r19.w, r8.w, r12.y
add r6.w, r6.w, r8.w
gather4_indexable(texture2d)(float,float,float,float) r15.xyzw, r21.zwzz, t0.xyzw, s0.x
lt r15.xyzw, r15.wxyz, r12.xxxx
and r16.xyzw, r15.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r15.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r16.wwzw
mad r12.yz, r22.zzzz, r12.yyzy, r16.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r22.w, r8.w, r12.y
add r6.w, r6.w, r8.w
mov r14.y, r17.z
mov_sat r15.xyzw, r14.zywy
mad r15.xyzw, r15.xyzw, r13.xyxy, r13.zwzw
mad r16.xyzw, r15.xyzw, cb0[80].zwzw, l(-0.500000, -0.500000, -0.500000, -0.500000)
frc r16.xyzw, r16.xyzw
add r18.xyzw, -r16.xyzw, l(0.500000, 0.500000, 0.500000, 0.500000)
mad r15.xyzw, r18.xyzw, cb0[80].xyxy, r15.xyzw
gather4_indexable(texture2d)(float,float,float,float) r18.xyzw, r15.xyxx, t0.xyzw, s0.x
lt r18.xyzw, r18.wxyz, r12.xxxx
and r19.xyzw, r18.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r18.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r19.wwzw
mad r12.yz, r16.xxxx, r12.yyzy, r19.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r16.y, r8.w, r12.y
add r6.w, r6.w, r8.w
gather4_indexable(texture2d)(float,float,float,float) r15.xyzw, r15.zwzz, t0.xyzw, s0.x
lt r15.xyzw, r15.wxyz, r12.xxxx
and r18.xyzw, r15.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r15.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r18.wwzw
mad r12.yz, r16.zzzz, r12.yyzy, r18.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r16.w, r8.w, r12.y
add r6.w, r6.w, r8.w
mov_sat r12.yz, r17.xxzx
mad r12.yz, r12.yyzy, r13.xxyx, r13.zzwz
mad r15.xy, r12.yzyy, cb0[80].zwzz, l(-0.500000, -0.500000, 0.000000, 0.000000)
frc r15.xy, r15.xyxx
add r15.zw, -r15.xxxy, l(0.000000, 0.000000, 0.500000, 0.500000)
mad r12.yz, r15.zzwz, cb0[80].xxyx, r12.yyzy
gather4_indexable(texture2d)(float,float,float,float) r16.xyzw, r12.yzyy, t0.xyzw, s0.x
lt r16.xyzw, r16.wxyz, r12.xxxx
and r18.xyzw, r16.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r16.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r18.wwzw
mad r12.yz, r15.xxxx, r12.yyzy, r18.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r15.y, r8.w, r12.y
add r6.w, r6.w, r8.w
mov r14.x, r20.x
mov_sat r14.xy, r14.xyxx
mad r12.yz, r14.xxyx, r13.xxyx, r13.zzwz
mad r14.xy, r12.yzyy, cb0[80].zwzz, l(-0.500000, -0.500000, 0.000000, 0.000000)
frc r14.xy, r14.xyxx
add r15.xy, -r14.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
mad r12.yz, r15.xxyx, cb0[80].xxyx, r12.yyzy
gather4_indexable(texture2d)(float,float,float,float) r15.xyzw, r12.yzyy, t0.xyzw, s0.x
lt r15.xyzw, r15.wxyz, r12.xxxx
and r16.xyzw, r15.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r15.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r16.wwzw
mad r12.yz, r14.xxxx, r12.yyzy, r16.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r14.y, r8.w, r12.y
add r6.w, r6.w, r8.w
mov r17.zw, r14.zzzw
mov r17.y, r20.y
mov_sat r14.xyzw, r17.zywy
mad r14.xyzw, r14.xyzw, r13.xyxy, r13.zwzw
mad r15.xyzw, r14.xyzw, cb0[80].zwzw, l(-0.500000, -0.500000, -0.500000, -0.500000)
frc r15.xyzw, r15.xyzw
add r16.xyzw, -r15.xyzw, l(0.500000, 0.500000, 0.500000, 0.500000)
mad r14.xyzw, r16.xyzw, cb0[80].xyxy, r14.xyzw
gather4_indexable(texture2d)(float,float,float,float) r16.xyzw, r14.xyxx, t0.xyzw, s0.x
lt r16.xyzw, r16.wxyz, r12.xxxx
and r18.xyzw, r16.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r16.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r18.wwzw
mad r12.yz, r15.xxxx, r12.yyzy, r18.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r15.y, r8.w, r12.y
add r6.w, r6.w, r8.w
gather4_indexable(texture2d)(float,float,float,float) r14.xyzw, r14.zwzz, t0.xyzw, s0.x
lt r14.xyzw, r14.wxyz, r12.xxxx
and r16.xyzw, r14.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r14.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r16.wwzw
mad r12.yz, r15.zzzz, r12.yyzy, r16.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r15.w, r8.w, r12.y
add r6.w, r6.w, r8.w
mov_sat r17.xy, r17.xyxx
mad r12.yz, r17.xxyx, r13.xxyx, r13.zzwz
mad r14.xy, r12.yzyy, cb0[80].zwzz, l(-0.500000, -0.500000, 0.000000, 0.000000)
frc r14.xy, r14.xyxx
add r14.zw, -r14.xxxy, l(0.000000, 0.000000, 0.500000, 0.500000)
mad r12.yz, r14.zzwz, cb0[80].xxyx, r12.yyzy
gather4_indexable(texture2d)(float,float,float,float) r15.xyzw, r12.yzyy, t0.xyzw, s0.x
lt r15.xyzw, r15.wxyz, r12.xxxx
and r16.xyzw, r15.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.yz, r15.xxyx, l(0,-1.000000,-1.000000,0), l(0,-0.000000,-0.000000,0)
add r12.yz, r12.yyzy, r16.wwzw
mad r12.yz, r14.xxxx, r12.yyzy, r16.xxyx
add r8.w, -r12.y, r12.z
mad r8.w, r14.y, r8.w, r12.y
add r6.w, r6.w, r8.w
mov_sat r20.xy, r20.xyxx
mad r12.yz, r20.xxyx, r13.xxyx, r13.zzwz
mad r13.xy, r12.yzyy, cb0[80].zwzz, l(-0.500000, -0.500000, 0.000000, 0.000000)
frc r13.xy, r13.xyxx
add r13.zw, -r13.xxxy, l(0.000000, 0.000000, 0.500000, 0.500000)
mad r12.yz, r13.zzwz, cb0[80].xxyx, r12.yyzy
gather4_indexable(texture2d)(float,float,float,float) r14.xyzw, r12.yzyy, t0.xyzw, s0.x
lt r12.xyzw, r14.wxyz, r12.xxxx
and r14.xyzw, r12.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
movc r12.xy, r12.xyxx, l(-1.000000,-1.000000,0,0), l(-0.000000,-0.000000,0,0)
add r12.xy, r12.xyxx, r14.wzww
mad r12.xy, r13.xxxx, r12.xyxx, r14.xyxx
add r8.w, -r12.x, r12.y
mad r8.w, r13.y, r8.w, r12.x
add r6.w, r6.w, r8.w
mul r6.w, r6.w, l(0.062500)
dp4_sat r8.w, cb0[82].xyzw, r11.xyzw
mad r6.w, -r6.w, r8.w, l(1.000000)
min r4.y, r4.y, r6.w
dp3_sat r6.w, r1.xyzx, -cb0[0].xyzx
mad r11.xyz, r0.yzwy, r4.wwww, -cb0[0].xyzx
dp3 r8.w, r11.xyzx, r11.xyzx
rsq r8.w, r8.w
mul r11.xyz, r8.wwww, r11.xyzx
dp3 r8.w, r8.xyzx, r11.xyzx
add r12.xyz, -r3.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mov_sat r9.w, r8.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 r13.xyz, r12.xyzx, r9.wwww, r3.xyzx
mul r3.w, r3.w, r3.w
mul r3.w, r3.w, r3.w
dp3 r9.w, r1.xyzx, r11.xyzx
mul r10.w, r3.w, r3.w
mul r9.w, r9.w, r9.w
mad r11.x, r3.w, r3.w, l(-1.000000)
mad r9.w, r9.w, r11.x, l(1.000000)
max r9.w, r9.w, l(0.000100)
mul r9.w, r9.w, r9.w
mul r9.w, r9.w, l(4.000000)
div r9.w, r10.w, r9.w
mul r11.y, r3.w, l(0.500000)
mad r11.z, -r3.w, l(0.500000), l(1.000000)
mad r8.w, r8.w, r11.z, r11.y
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, r9.w
mul r13.xyz, r8.wwww, r13.xyzx
mul r13.xyz, r13.xyzx, cb0[4].xyzx
mul r8.w, r5.w, r6.w
mul r13.xyz, r8.wwww, r13.xyzx
mul r14.xyz, r6.wwww, cb0[4].xyzx
mul r14.xyz, r12.xyzx, r14.xyzx
mul r14.xyz, r2.wwww, r14.xyzx
mul r14.xyz, r4.yyyy, r14.xyzx
mul r13.xyz, r4.yyyy, r13.xyzx
ilt r8.w, l(0), cb0[8].x
if_nz r8.w
  dp3_sat r8.w, r1.xyzx, -cb0[1].xyzx
  mad r15.xyz, r0.yzwy, r4.wwww, -cb0[1].xyzx
  dp3 r9.w, r15.xyzx, r15.xyzx
  rsq r9.w, r9.w
  mul r15.xyz, r9.wwww, r15.xyzx
  dp3 r9.w, r8.xyzx, r15.xyzx
  mov_sat r11.w, r9.w
  add r11.w, -r11.w, l(1.000000)
  mul r12.w, r11.w, r11.w
  mul r12.w, r12.w, r12.w
  mul r11.w, r11.w, r12.w
  mad r16.xyz, r12.xyzx, r11.wwww, r3.xyzx
  dp3 r11.w, r1.xyzx, r15.xyzx
  mul r11.w, r11.w, r11.w
  mad r11.w, r11.w, r11.x, l(1.000000)
  max r11.w, r11.w, l(0.000100)
  mul r11.w, r11.w, r11.w
  mul r11.w, r11.w, l(4.000000)
  div r11.w, r10.w, r11.w
  mad r9.w, r9.w, r11.z, r11.y
  mul r9.w, r9.w, r9.w
  div r9.w, l(1.000000, 1.000000, 1.000000, 1.000000), r9.w
  mul r9.w, r9.w, r11.w
  mul r15.xyz, r9.wwww, r16.xyzx
  mul r15.xyz, r15.xyzx, cb0[5].xyzx
  mul r9.w, r5.w, r8.w
  mad r13.xyz, r15.xyzx, r9.wwww, r13.xyzx
  mul r15.xyz, r8.wwww, cb0[5].xyzx
  mul r15.xyz, r12.xyzx, r15.xyzx
  mad r14.xyz, r15.xyzx, r2.wwww, r14.xyzx
  ilt r8.w, l(1), cb0[8].x
  if_nz r8.w
    dp3_sat r8.w, r1.xyzx, -cb0[2].xyzx
    mad r15.xyz, r0.yzwy, r4.wwww, -cb0[2].xyzx
    dp3 r9.w, r15.xyzx, r15.xyzx
    rsq r9.w, r9.w
    mul r15.xyz, r9.wwww, r15.xyzx
    dp3 r9.w, r8.xyzx, r15.xyzx
    mov_sat r11.w, r9.w
    add r11.w, -r11.w, l(1.000000)
    mul r12.w, r11.w, r11.w
    mul r12.w, r12.w, r12.w
    mul r11.w, r11.w, r12.w
    mad r16.xyz, r12.xyzx, r11.wwww, r3.xyzx
    dp3 r11.w, r1.xyzx, r15.xyzx
    mul r11.w, r11.w, r11.w
    mad r11.w, r11.w, r11.x, l(1.000000)
    max r11.w, r11.w, l(0.000100)
    mul r11.w, r11.w, r11.w
    mul r11.w, r11.w, l(4.000000)
    div r11.w, r10.w, r11.w
    mad r9.w, r9.w, r11.z, r11.y
    mul r9.w, r9.w, r9.w
    div r9.w, l(1.000000, 1.000000, 1.000000, 1.000000), r9.w
    mul r9.w, r9.w, r11.w
    mul r15.xyz, r9.wwww, r16.xyzx
    mul r15.xyz, r15.xyzx, cb0[6].xyzx
    mul r9.w, r5.w, r8.w
    mad r13.xyz, r15.xyzx, r9.wwww, r13.xyzx
    mul r15.xyz, r8.wwww, cb0[6].xyzx
    mul r15.xyz, r12.xyzx, r15.xyzx
    mad r14.xyz, r15.xyzx, r2.wwww, r14.xyzx
    ilt r8.w, l(2), cb0[8].x
    if_nz r8.w
      dp3_sat r8.w, r1.xyzx, -cb0[3].xyzx
      mad r15.xyz, r0.yzwy, r4.wwww, -cb0[3].xyzx
      dp3 r9.w, r15.xyzx, r15.xyzx
      rsq r9.w, r9.w
      mul r15.xyz, r9.wwww, r15.xyzx
      dp3 r9.w, r8.xyzx, r15.xyzx
      mov_sat r11.w, r9.w
      add r11.w, -r11.w, l(1.000000)
      mul r12.w, r11.w, r11.w
      mul r12.w, r12.w, r12.w
      mul r11.w, r11.w, r12.w
      mad r16.xyz, r12.xyzx, r11.wwww, r3.xyzx
      dp3 r11.w, r1.xyzx, r15.xyzx
      mul r11.w, r11.w, r11.w
      mad r11.w, r11.w, r11.x, l(1.000000)
      max r11.w, r11.w, l(0.000100)
      mul r11.w, r11.w, r11.w
      mul r11.w, r11.w, l(4.000000)
      div r11.w, r10.w, r11.w
      mad r9.w, r9.w, r11.z, r11.y
      mul r9.w, r9.w, r9.w
      div r9.w, l(1.000000, 1.000000, 1.000000, 1.000000), r9.w
      mul r9.w, r9.w, r11.w
      mul r15.xyz, r9.wwww, r16.xyzx
      mul r15.xyz, r15.xyzx, cb0[7].xyzx
      mul r9.w, r5.w, r8.w
      mad r13.xyz, r15.xyzx, r9.wwww, r13.xyzx
      mul r15.xyz, r8.wwww, cb0[7].xyzx
      mul r15.xyz, r12.xyzx, r15.xyzx
      mad r14.xyz, r15.xyzx, r2.wwww, r14.xyzx
    endif
  endif
endif
mad r0.x, r0.x, cb0[60].x, cb0[60].y
log r8.w, r0.x
mad r8.w, r8.w, cb0[60].z, cb0[60].w
max r8.w, r8.w, l(0.000000)
ftou r8.w, r8.w
ult r9.w, r8.w, l(16)
if_nz r9.w
  mul r15.xy, v0.xyxx, l(0.015625, 0.015625, 0.000000, 0.000000)
  ftou r15.xy, r15.xyxx
  imul null, r9.w, r15.y, cb0[61].x
  imad r8.w, cb0[62].x, r8.w, r9.w
  iadd r8.w, r15.x, r8.w
  div r0.x, l(-1.000000), r0.x
  add r9.w, -cb0[62].w, cb0[62].z
  add r0.x, r0.x, -cb0[62].w
  div r9.w, l(1.000000, 1.000000, 1.000000, 1.000000), r9.w
  mul_sat r0.x, r0.x, r9.w
  mad r9.w, r0.x, l(-2.000000), l(3.000000)
  mul r0.x, r0.x, r0.x
  mul r0.x, r0.x, r9.w
  ishl r9.w, r8.w, l(2)
  ld_indexable(buffer)(uint,uint,uint,uint) r9.w, r9.wwww, t16.yzwx
  bfi r15.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, r15.xxxx, t16.yzwx
  ishl r8.w, r8.w, l(16)
  or r8.w, r8.w, r9.w
  ld_indexable(buffer)(uint,uint,uint,uint) r9.w, r15.yyyy, t16.yzwx
  ld_indexable(buffer)(uint,uint,uint,uint) r11.w, r15.zzzz, t16.yzwx
  mov r15.x, l(1.000000)
  mov r16.xyz, r14.xyzx
  mov r17.xyz, r13.xyzx
  mov r12.w, cb0[10].x
  mov r13.w, l(0)
  loop
    uge r14.w, r13.w, r9.w
    breakc_nz r14.w
    iadd r14.w, r8.w, r13.w
    ld_indexable(buffer)(uint,uint,uint,uint) r14.w, r14.wwww, t16.yzwx
    ld_indexable(buffer)(float,float,float,float) r18.xyzw, r14.wwww, t17.xyzw
    mul r15.w, r18.w, r18.w
    add r18.xyz, -r7.xyzx, r18.xyzx
    dp3 r15.z, r18.xyzx, r18.xyzx
    div r16.w, r15.z, r15.w
    mad_sat r17.w, r16.w, l(-16.000000), l(16.000000)
    lt r18.w, l(0.000000), r17.w
    if_nz r18.w
      imul null, r18.w, r14.w, l(3)
      ld_indexable(buffer)(float,float,float,float) r19.xyz, r18.wwww, t18.xyzw
      mul r19.xyz, r0.xxxx, r19.xyzx
      ult r19.w, r14.w, r12.w
      if_nz r19.w
        ishl r19.w, r14.w, l(1)
        bfi r20.x, l(31), l(1), r14.w, l(1)
        add r20.yzw, r7.xxyz, cb0[r19.w + 11].xxyz
        mul r21.xyw, r20.yzyw, cb0[r19.w + 11].wwww
        mov r21.z, -r21.w
        dp3 r19.w, r21.xyzx, r21.xyzx
        sqrt r19.w, r19.w
        add_sat r19.w, r19.w, cb0[r20.x + 11].x
        utof r21.w, r14.w
        sample_c_lz_indexable(texturecubearray)(float,float,float,float) r19.w, r21.xyzw, t3.xxxx, s3, r19.w
        ne r20.x, r19.w, l(0.000000)
        not r20.y, r20.x
        mul r21.xyz, r19.wwww, r19.xyzx
        movc r19.xyz, r20.xxxx, r21.xyzx, r19.xyzx
      else
        mov r20.y, l(0)
      endif
      if_z r20.y
        imad r19.w, l(3), r14.w, l(1)
        ld_indexable(buffer)(float,float,float,float) r20.xyz, r19.wwww, t18.xyzw
        uge r19.w, r14.w, r12.w
        and r20.w, r19.w, l(0x3f800000)
        ld_indexable(buffer)(uint,uint,uint,uint) r18.w, r18.wwww, t19.yzwx
        rsq r21.x, r15.z
        mul r21.yzw, -r18.xxyz, r21.xxxx
        ieq r22.x, r18.w, l(3)
        if_nz r22.x
          imad r14.w, l(3), r14.w, l(2)
          ld_indexable(buffer)(uint,uint,uint,uint) r22.x, r14.wwww, t19.xyzw
          ld_indexable(buffer)(float,float,float,float) r22.yzw, r14.wwww, t18.wxyz
          dp3 r14.w, -r18.xyzx, -r18.xyzx
          rsq r14.w, r14.w
          mul r18.xyz, r14.wwww, -r18.xyzx
          dp3 r14.w, r18.xyzx, r22.yzwy
          mad r23.x, r14.w, l(-0.500000), l(0.500000)
          dp3 r23.w, r18.xyzx, r20.xyzx
          mad r14.w, -r14.w, r14.w, l(1.000000)
          rsq r14.w, r14.w
          mul r14.w, r14.w, r23.w
          mul r24.xyz, r20.zxyz, r22.zwyz
          mad r22.yzw, r20.yyzx, r22.wwyz, -r24.xxyz
          dp3 r18.x, r22.yzwy, r18.xyzx
          ge r18.x, r18.x, l(0.000000)
          mad r18.yz, r14.wwww, l(0.000000, -0.250000, 0.250000, 0.000000), l(0.000000, 0.250000, 0.750000, 0.000000)
          movc r23.y, r18.x, r18.y, r18.z
          utof r23.z, r22.x
          sample_l_indexable(texture2darray)(float,float,float,float) r14.w, r23.xyzx, t1.yzwx, s1, l(0.000000)
          mul r14.w, r15.w, r14.w
          div r14.w, r14.w, r15.z
          add r15.w, -r16.w, l(1.000000)
          max r15.w, r15.w, l(0.000000)
          mul r14.w, r14.w, r15.w
        else
          ieq r15.w, r18.w, l(2)
          mul r16.w, -r15.z, r20.x
          mul r16.w, r16.w, l(1.442695)
          exp r16.w, r16.w
          mul_sat r16.w, r16.w, r20.y
          mul r15.y, r15.z, r21.x
          dp3 r15.y, r20.xyzx, r15.xyzx
          div r15.y, l(1.000000, 1.000000, 1.000000, 1.000000), r15.y
          movc r14.w, r15.w, r16.w, r15.y
        endif
        mul r14.w, r17.w, r14.w
        mul r15.yzw, r19.xxyz, r14.wwww
        dp3_sat r14.w, r1.xyzx, -r21.yzwy
        mad r18.xyz, r0.yzwy, r4.wwww, -r21.yzwy
        dp3 r16.w, r18.xyzx, r18.xyzx
        rsq r16.w, r16.w
        mul r18.xyz, r16.wwww, r18.xyzx
        dp3 r16.w, r8.xyzx, r18.xyzx
        mov_sat r17.w, r16.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 r19.xyz, r12.xyzx, r17.wwww, r3.xyzx
        dp3 r17.w, r1.xyzx, r18.xyzx
        mul r17.w, r17.w, r17.w
        mad r17.w, r17.w, r11.x, l(1.000000)
        max r17.w, r17.w, l(0.000100)
        mul r17.w, r17.w, r17.w
        mul r17.w, r17.w, l(4.000000)
        div r17.w, r10.w, r17.w
        mad r16.w, r16.w, r11.z, r11.y
        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, r17.w
        mul r18.xyz, r16.wwww, r19.xyzx
        mul r18.xyz, r15.yzwy, r18.xyzx
        movc r16.w, r19.w, l(0), l(1.000000)
        mad r17.w, r5.w, r20.w, r16.w
        mul r17.w, r14.w, r17.w
        mad r17.xyz, r18.xyzx, r17.wwww, r17.xyzx
        mul r15.yzw, r14.wwww, r15.yyzw
        mul r15.yzw, r12.xxyz, r15.yyzw
        mad r14.w, r2.w, r20.w, r16.w
        mad r16.xyz, r15.yzwy, r14.wwww, r16.xyzx
      endif
    endif
    iadd r13.w, r13.w, l(1)
  endloop
  iadd r8.w, r8.w, r9.w
  mov r15.x, l(1.000000)
  mov r14.xyz, r16.xyzx
  mov r13.xyz, r17.xyzx
  mov r9.w, cb0[27].x
  mov r12.w, l(0)
  loop
    uge r13.w, r12.w, r11.w
    breakc_nz r13.w
    iadd r13.w, r8.w, r12.w
    ld_indexable(buffer)(uint,uint,uint,uint) r13.w, r13.wwww, t16.yzwx
    imul null, r14.w, r13.w, l(5)
    ld_indexable(buffer)(float,float,float,float) r18.xyz, r14.wwww, t20.xyzw
    imad r14.w, l(5), r13.w, l(4)
    ld_indexable(buffer)(float,float,float,float) r19.xyz, r14.wwww, t20.xyzw
    add r18.xyz, -r7.xyzx, r18.xyzx
    dp3 r15.z, r18.xyzx, r18.xyzx
    div r14.w, r15.z, r19.x
    mad_sat r15.w, r14.w, l(-16.000000), l(16.000000)
    lt r16.w, l(0.000000), r15.w
    if_nz r16.w
      imad r16.w, l(5), r13.w, l(2)
      ld_indexable(buffer)(float,float,float,float) r20.xyz, r16.wwww, t20.xyzw
      mul r20.xyz, r0.xxxx, r20.xyzx
      ult r16.w, r13.w, r9.w
      if_nz r16.w
        ishl r16.w, r13.w, l(2)
        mul r21.xyzw, r7.yyyy, cb0[r16.w + 29].xyzw
        mad r21.xyzw, r7.xxxx, cb0[r16.w + 28].xyzw, r21.xyzw
        mad r21.xyzw, r7.zzzz, cb0[r16.w + 30].xyzw, r21.xyzw
        mad r21.xyzw, r7.wwww, cb0[r16.w + 31].xyzw, r21.xyzw
        div r21.xyz, r21.xyzx, r21.wwww
        utof r21.w, r13.w
        sample_c_lz_indexable(texture2darray)(float,float,float,float) r16.w, r21.xywx, t4.xxxx, s4, r21.z
        ne r17.w, r16.w, l(0.000000)
        not r18.w, r17.w
        mul r21.xyz, r16.wwww, r20.xyzx
        movc r20.xyz, r17.wwww, r21.xyzx, r20.xyzx
      else
        mov r18.w, l(0)
      endif
      if_z r18.w
        imad r21.xy, l(5, 5, 0, 0), r13.wwww, l(1, 3, 0, 0)
        ld_indexable(buffer)(float,float,float,float) r21.xzw, r21.xxxx, t20.xwyz
        ld_indexable(buffer)(float,float,float,float) r22.xyz, r21.yyyy, t20.xyzw
        uge r16.w, r13.w, r9.w
        and r17.w, r16.w, l(0x3f800000)
        imul null, r18.w, r13.w, l(3)
        ld_indexable(buffer)(uint,uint,uint,uint) r18.w, r18.wwww, t21.yzwx
        rsq r19.w, r15.z
        mul r23.xyz, -r18.xyzx, r19.wwww
        dp3 r20.w, -r23.xyzx, r21.xzwx
        mad_sat r19.y, r20.w, r19.z, r19.y
        ieq r19.z, r18.w, l(3)
        if_nz r19.z
          imad r13.w, l(3), r13.w, l(2)
          ld_indexable(buffer)(uint,uint,uint,uint) r13.w, r13.wwww, t21.yzwx
          dp3 r19.z, -r18.xyzx, -r18.xyzx
          rsq r19.z, r19.z
          mul r18.xyz, -r18.xyzx, r19.zzzz
          dp3 r19.z, r18.xyzx, r21.xzwx
          mad r24.x, r19.z, l(-0.500000), l(0.500000)
          dp3 r20.w, r18.xyzx, r22.xyzx
          mad r19.z, -r19.z, r19.z, l(1.000000)
          rsq r19.z, r19.z
          mul r19.z, r19.z, r20.w
          mul r25.xyz, r21.zwxz, r22.zxyz
          mad r21.xyz, r22.yzxy, r21.wxzw, -r25.xyzx
          dp3 r18.x, r21.xyzx, r18.xyzx
          ge r18.x, r18.x, l(0.000000)
          mad r18.yz, r19.zzzz, l(0.000000, -0.250000, 0.250000, 0.000000), l(0.000000, 0.250000, 0.750000, 0.000000)
          movc r24.y, r18.x, r18.y, r18.z
          utof r24.z, r13.w
          sample_l_indexable(texture2darray)(float,float,float,float) r13.w, r24.xyzx, t1.yzwx, s1, l(0.000000)
          mul r13.w, r19.x, r13.w
          div r13.w, r13.w, r15.z
          add_sat r14.w, -r14.w, l(1.000000)
          mul r13.w, r13.w, r14.w
          mul r13.w, r19.y, r13.w
        else
          ieq r14.w, r18.w, l(2)
          mul r18.x, -r15.z, r22.x
          mul r18.x, r18.x, l(1.442695)
          exp r18.x, r18.x
          mul_sat r18.x, r18.x, r22.y
          mul r18.x, r18.x, r19.y
          mul r15.y, r15.z, r19.w
          dp3 r15.y, r15.xyzx, r22.xyzx
          div r15.y, r19.y, r15.y
          movc r13.w, r14.w, r18.x, r15.y
        endif
        mul r13.w, r15.w, r13.w
        mul r15.yzw, r20.xxyz, r13.wwww
        dp3_sat r13.w, r1.xyzx, -r23.xyzx
        mad r18.xyz, r0.yzwy, r4.wwww, -r23.xyzx
        dp3 r14.w, r18.xyzx, r18.xyzx
        rsq r14.w, r14.w
        mul r18.xyz, r14.wwww, r18.xyzx
        dp3 r14.w, r8.xyzx, r18.xyzx
        mov_sat r18.w, r14.w
        add r18.w, -r18.w, l(1.000000)
        mul r19.x, r18.w, r18.w
        mul r19.x, r19.x, r19.x
        mul r18.w, r18.w, r19.x
        mad r19.xyz, r12.xyzx, r18.wwww, r3.xyzx
        dp3 r18.x, r1.xyzx, r18.xyzx
        mul r18.x, r18.x, r18.x
        mad r18.x, r18.x, r11.x, l(1.000000)
        max r18.x, r18.x, l(0.000100)
        mul r18.x, r18.x, r18.x
        mul r18.x, r18.x, l(4.000000)
        div r18.x, r10.w, r18.x
        mad r14.w, r14.w, r11.z, r11.y
        mul r14.w, r14.w, r14.w
        div r14.w, l(1.000000, 1.000000, 1.000000, 1.000000), r14.w
        mul r14.w, r14.w, r18.x
        mul r18.xyz, r14.wwww, r19.xyzx
        mul r18.xyz, r15.yzwy, r18.xyzx
        movc r14.w, r16.w, l(0), l(1.000000)
        mad r16.w, r5.w, r17.w, r14.w
        mul r16.w, r13.w, r16.w
        mad r13.xyz, r18.xyzx, r16.wwww, r13.xyzx
        mul r15.yzw, r13.wwww, r15.yyzw
        mul r15.yzw, r12.xxyz, r15.yyzw
        mad r13.w, r2.w, r17.w, r14.w
        mad r14.xyz, r15.yzwy, r13.wwww, r14.xyzx
      endif
    endif
    iadd r12.w, r12.w, l(1)
  endloop
endif
ne r0.x, cb0[98].x, l(0.000000)
mov_sat r0.y, -r1.y
add r0.y, r6.w, r0.y
mul_sat r0.y, r0.y, cb0[98].x
add r0.z, r4.y, l(-1.000000)
mad r0.y, r0.y, r0.z, l(1.000000)
movc r0.x, r0.x, r0.y, l(1.000000)
sample_l_indexable(texturecube)(float,float,float,float) r0.yzw, r1.xyzx, t5.wxyz, s5, l(6.000000)
mul r0.xyz, r0.xxxx, r0.yzwy
mul r0.xyz, r0.xyzx, cb0[99].xyzx
add r0.w, -cb0[99].w, l(1.000000)
mad r0.w, r2.w, cb0[99].w, r0.w
add r0.w, r0.w, l(-1.000000)
add r0.w, r0.w, l(1.000000)
mul r0.xyz, r0.wwww, r0.xyzx
add r4.y, -r4.x, l(2.000000)
mul r8.xyz, r4.yyyy, r12.xyzx
mad r0.xyz, r0.xyzx, r8.xyzx, r14.xyzx
lt r4.x, l(1.000000), r4.x
div r4.w, l(1.000000, 1.000000, 1.000000, 1.000000), r5.x
dp3 r5.x, r10.xyzx, r10.xyzx
rsq r5.x, r5.x
mul r8.xyz, r5.xxxx, r10.xyzx
dp3_sat r6.w, r1.xyzx, r8.xyzx
mad r6.w, -r6.w, r6.w, l(1.000000)
sqrt r6.w, r6.w
mad r6.w, r6.w, r4.w, -r6.w
add r11.xyz, r1.xyzx, l(-0.000000, -1.000000, -0.000000, 0.000000)
mul r14.xyz, r4.wwww, r8.xyzx
mad r11.xyz, r6.wwww, r11.xyzx, -r14.xyzx
dp3 r6.w, -r8.xyzx, r1.xyzx
mul r7.w, r4.w, r4.w
mad r8.w, -r6.w, r6.w, l(1.000000)
mad r7.w, -r7.w, r8.w, l(1.000000)
sqrt r8.w, r7.w
mad r8.w, r4.w, r6.w, r8.w
ge r7.w, r7.w, l(0.000000)
mul r14.xyz, r1.xyzx, r8.wwww
mad r14.xyz, r4.wwww, -r8.xyzx, -r14.xyzx
and r14.xyz, r7.wwww, r14.xyzx
dp3 r4.w, r14.xyzx, r14.xyzx
eq r4.w, r4.w, l(0.000000)
add r6.w, r6.w, r6.w
mad r1.xyz, r1.xyzx, -r6.wwww, -r8.xyzx
movc r1.xyz, r4.wwww, r1.xyzx, r14.xyzx
movc r1.xyz, r9.yyyy, r11.xyzx, r1.xyzx
dp3 r4.w, r1.xyzx, r1.xyzx
rsq r4.w, r4.w
mul r11.xyz, r1.xyzx, r4.wwww
mad r1.xyz, r1.xyzx, r4.wwww, r8.xyzx
mul r14.xyz, -r8.zxyz, cb0[85].yzxy
mad r14.xyz, -r8.yzxy, cb0[85].zxyz, -r14.xyzx
dp3 r4.w, r14.xyzx, r14.xyzx
rsq r4.w, r4.w
mul r14.xyz, r4.wwww, r14.xyzx
mul r15.xyz, -r8.yzxy, r14.zxyz
mad r8.xyz, r14.yzxy, -r8.zxyz, -r15.xyzx
dp3 r4.w, r8.xyzx, r8.xyzx
rsq r4.w, r4.w
mul r8.xyz, r4.wwww, r8.xyzx
lt r15.xy, l(0.000000, 0.000000, 0.000000, 0.000000), r39.xzxx
movc r14.xyz, r15.xxxx, r14.xyzx, -r14.xyzx
movc r8.xyz, r15.yyyy, r8.xyzx, -r8.xyzx
dp3_sat r4.w, r1.xyzx, r14.xyzx
mul r4.w, |r39.x|, r4.w
mad r1.xyz, -r14.xyzx, r4.wwww, r1.xyzx
dp3_sat r4.w, r1.xyzx, r8.xyzx
mul r4.w, |r9.z|, r4.w
mad r1.xyz, -r8.xyzx, r4.wwww, r1.xyzx
mad r1.xyz, -r10.xyzx, r5.xxxx, r1.xyzx
dp3 r4.w, r1.xyzx, r1.xyzx
rsq r4.w, r4.w
mul r1.xyz, r1.xyzx, r4.wwww
movc r1.xyz, r9.yyyy, r11.xyzx, r1.xyzx
mad r7.xyz, r1.xyzx, r5.zzzz, r7.xyzx
mov r7.w, l(1.000000)
dp4 r1.x, r7.xyzw, cb0[87].xyzw
dp4 r1.y, r7.xyzw, cb0[88].xyzw
dp4 r1.z, r7.xyzw, cb0[89].xyzw

add r26.w, r1.z, -r26.y
mul r26.w, r26.w, l(0.5)
mad r1.x, r26.x, r26.w, r1.x

div r1.xy, r1.xyxx, r1.zzzz
sample_indexable(texture2d)(float,float,float,float) r1.z, r1.xyxx, t2.yzxw, s2
if_nz r4.x
  mad r4.xw, r9.xxxz, l(0.500000, 0.000000, 0.000000, -0.500000), l(0.500000, 0.000000, 0.000000, 0.500000)
  dp3 r5.x, -r10.xyzx, cb0[84].xyzx
  max r7.xyz, r2.xyzx, l(0.000100, 0.000100, 0.000100, 0.000000)
  min r7.xyz, r7.xyzx, l(0.999900, 0.999900, 0.999900, 0.000000)
  log r7.xyz, r7.xyzx
  mul r7.xyz, r7.xyzx, l(0.693147182, 0.693147182, 0.693147182, 0.000000)
  max r5.yz, r5.yyzy, l(0.000000, 0.000100, 0.000000, 0.000000)
  div r7.xyz, -r7.xyzx, r5.yyyy
  mul r7.xyz, r5.zzzz, -r7.xyzx
  mul r7.xyz, r7.xyzx, l(1.442695, 1.442695, 1.442695, 0.000000)
  exp r7.xyz, r7.xyzx
  add r1.w, -r1.w, l(1.000000)
  mul r5.y, r1.w, r1.w
  mul r5.y, r5.y, r5.y
  mul r1.w, r1.w, r5.y
  mad r3.xyz, r12.xyzx, r1.wwww, r3.xyzx
  add r8.xyz, -r3.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  mad r3.xyz, r8.xyzx, r4.yyyy, r3.xyzx
  add r3.xyz, -r3.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  mul r8.xyz, r4.yyyy, r3.xyzx
  mad_sat r1.z, cb0[86].y, r1.z, cb0[86].x
  div r1.z, l(1.000000, 1.000000, 1.000000, 1.000000), r1.z
  lt r1.z, r1.z, r5.x
  movc r1.xy, r1.zzzz, r4.xwxx, r1.xyxx
  sample_l_indexable(texture2d)(float,float,float,float) r4.xyw, r1.xyxx, t6.xywz, s6, l(16.000000)
  mul r4.xyw, r4.xyxw, cb0[99].xyxz
  mul r4.xyw, r0.wwww, r4.xyxw
  mul r4.xyw, r8.xyxz, r4.xyxw
  mad r0.xyz, r4.xywx, r7.xyzx, r0.xyzx
  sample_l_indexable(texture2d)(float,float,float,float) r0.w, r1.xyxx, t7.yzwx, s7, l(0.000000)
  mul r8.xyzw, r9.zzzz, cb0[101].xyzw
  mad r8.xyzw, r9.xxxx, cb0[100].xyzw, r8.xyzw
  mad r8.xyzw, r0.wwww, cb0[102].xyzw, r8.xyzw
  add r8.xyzw, r8.xyzw, cb0[103].xyzw
  
  //add r26.w, r8.w, -r26.y
  //mad r8.x, r26.x, r26.y, r8.x
  
  div r4.xyw, r8.xyxz, r8.wwww
  dp3 r0.w, r4.xywx, r4.xywx
  sqrt r0.w, r0.w
  sqrt r1.z, r4.z
  add r1.z, r0.w, -r1.z
  div r0.w, r1.z, r0.w
  mul r0.w, r3.w, r0.w
  max r0.w, r0.w, l(0.000000)
  min r0.w, r3.w, r0.w
  sqrt r0.w, r0.w
  mul r0.w, r0.w, l(6.000000)
  sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t6.xyzw, s6, r0.w
  mul r1.xyz, r1.xyzx, cb0[104].xyzx
  add r0.w, -cb0[104].w, l(1.000000)
  mad r0.w, r2.w, cb0[104].w, r0.w
  add r1.w, -r0.w, l(1.000000)
  mad r1.w, r5.w, r1.w, r0.w
  mad r0.w, r0.w, r1.w, l(-1.000000)
  add r0.w, r0.w, l(1.000000)
  mul r1.xyz, r0.wwww, r1.xyzx
  mul r1.xyz, r3.xyzx, r1.xyzx
  mad r13.xyz, r1.xyzx, r7.xyzx, r13.xyzx
endif
mad r0.xyz, r0.xyzx, r2.xyzx, r6.xyzx
add o0.xyz, r13.xyzx, r0.xyzx
mov o0.w, l(1.000000)
ret
// Approximately 862 instruction slots used
