//0cad7ffdcac96e92-ps.txt
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.2.27 on Fri Jan 29 08:58:49 2016
//
//
// Buffer Definitions: 
//
// cbuffer cbTiledLighting
// {
//
//   uint g_uNumNonDirectionalLights;   // Offset:    0 Size:     4
//   uint g_uNumDirectionalLights;      // Offset:    4 Size:     4 [unused]
//   uint g_uNumTilesX;                 // Offset:    8 Size:     4
//   uint g_uNumTilesY;                 // Offset:   12 Size:     4
//   row_major float4x4 g_mProjection;  // Offset:   16 Size:    64 [unused]
//   row_major float4x4 g_mInvProjection;// Offset:   80 Size:    64 [unused]
//
// }
//
// cbuffer SceneBuffer
// {
//
//   row_major float4x4 View;           // Offset:    0 Size:    64
//   row_major float4x4 ScreenMatrix;   // Offset:   64 Size:    64 [unused]
//   float2 DepthExportScale;           // Offset:  128 Size:     8 [unused]
//   float2 __padding0;                 // Offset:  136 Size:     8 [unused]
//   float4 FogParams;                  // Offset:  144 Size:    16 [unused]
//   float3 __CameraPosition;           // Offset:  160 Size:    12 [unused]
//   float __padding12;                 // Offset:  172 Size:     4 [unused]
//   float3 CameraDirection;            // Offset:  176 Size:    12 [unused]
//   float __padding9;                  // Offset:  188 Size:     4 [unused]
//   float3 DepthFactors;               // Offset:  192 Size:    12 [unused]
//   float __padding10;                 // Offset:  204 Size:     4 [unused]
//   float3 ShadowDepthBiasAndLightType;// Offset:  208 Size:    12 [unused]
//   float __padding11;                 // Offset:  220 Size:     4 [unused]
//   float4 SubframeViewport;           // Offset:  224 Size:    16 [unused]
//   row_major float3x4 DepthToWorld;   // Offset:  240 Size:    48 [unused]
//   float4 DepthToView;                // Offset:  288 Size:    16
//   float4 OneOverDepthToView;         // Offset:  304 Size:    16 [unused]
//   float4 DepthToW;                   // Offset:  320 Size:    16
//   float4 ClipPlane;                  // Offset:  336 Size:    16 [unused]
//   float2 ViewportDepthScaleOffset;   // Offset:  352 Size:     8 [unused]
//   float2 __padding1;                 // Offset:  360 Size:     8 [unused]
//   float2 ColorDOFDepthScaleOffset;   // Offset:  368 Size:     8 [unused]
//   float2 __padding2;                 // Offset:  376 Size:     8 [unused]
//   float4 TimeVector;                 // Offset:  384 Size:    16
//   float4 FogParams2;                 // Offset:  400 Size:    16 [unused]
//   float4 FogParams3;                 // Offset:  416 Size:    16 [unused]
//   float3 GlobalAmbient;              // Offset:  432 Size:    12
//   float __padding8;                  // Offset:  444 Size:     4 [unused]
//   float4 GlobalParams[16];           // Offset:  448 Size:   256
//   float4 ViewToFogH;                 // Offset:  704 Size:    16 [unused]
//   float4 ScreenExtents;              // Offset:  720 Size:    16 [unused]
//   float2 ScreenResolution;           // Offset:  736 Size:     8 [unused]
//   float2 __padding3;                 // Offset:  744 Size:     8 [unused]
//   float4 PSSMToMap1Lin;              // Offset:  752 Size:    16 [unused]
//   float4 PSSMToMap1Const;            // Offset:  768 Size:    16 [unused]
//   float4 PSSMToMap2Lin;              // Offset:  784 Size:    16 [unused]
//   float4 PSSMToMap2Const;            // Offset:  800 Size:    16 [unused]
//   float4 PSSMToMap3Lin;              // Offset:  816 Size:    16 [unused]
//   float4 PSSMToMap3Const;            // Offset:  832 Size:    16 [unused]
//   float4 PSSMDistances;              // Offset:  848 Size:    16 [unused]
//   row_major float4x4 WorldToPSSM0;   // Offset:  864 Size:    64 [unused]
//   row_major float4x4 PrevViewProject;// Offset:  928 Size:    64 [unused]
//   row_major float4x4 PrevWorld;      // Offset:  992 Size:    64 [unused]
//   row_major float4x4 ViewT;          // Offset: 1056 Size:    64 [unused]
//   float4 PSSMExtents;                // Offset: 1120 Size:    16 [unused]
//   float4 ShadowAtlasResolution;      // Offset: 1136 Size:    16 [unused]
//   float4 UnitRimData[3];             // Offset: 1152 Size:    48 [unused]
//   float3 __CameraPositionForCorrection;// Offset: 1200 Size:    12 [unused]
//   float __padding7;                  // Offset: 1212 Size:     4 [unused]
//   row_major float4x4 CameraViewProject;// Offset: 1216 Size:    64 [unused]
//   float4 BackBufferResolution;       // Offset: 1280 Size:    16 [unused]
//   row_major float4x4 InverseProjection;// Offset: 1296 Size:    64 [unused]
//   float4 StereoOffset;               // Offset: 1360 Size:    16 [unused]
//   row_major float4x4 Projection;     // Offset: 1376 Size:    64 [unused]
//   row_major float4x4 ViewInv;        // Offset: 1440 Size:    64 [unused]
//   float4 ColorSSAO;                  // Offset: 1504 Size:    16 [unused]
//   float4 GlobalFogColor;             // Offset: 1520 Size:    16 [unused]
//   float4 VolumetricLightGlobalParams;// Offset: 1536 Size:    16 [unused]
//   float4 SnowParams01;               // Offset: 1552 Size:    16 [unused]
//   float4 SnowParams02;               // Offset: 1568 Size:    16 [unused]
//   float4 SnowParams03;               // Offset: 1584 Size:    16 [unused]
//   int SSREnabled;                    // Offset: 1600 Size:     4
//   int __padding4;                    // Offset: 1604 Size:     4 [unused]
//   int __padding5;                    // Offset: 1608 Size:     4 [unused]
//   int __padding6;                    // Offset: 1612 Size:     4 [unused]
//
// }
//
// cbuffer IrradianceBuffer
// {
//
//   float4 IrradianceStateRed0;        // Offset:    0 Size:    16
//   float4 IrradianceStateRed1;        // Offset:   16 Size:    16
//   float4 IrradianceStateGreen0;      // Offset:   32 Size:    16
//   float4 IrradianceStateGreen1;      // Offset:   48 Size:    16
//   float4 IrradianceStateBlue0;       // Offset:   64 Size:    16
//   float4 IrradianceStateBlue1;       // Offset:   80 Size:    16
//   float4 IrradianceStateBase;        // Offset:   96 Size:    16
//   float4 IrradianceConstantData;     // Offset:  112 Size:    16
//
// }
//
// cbuffer cbCubeRefl
// {
//
//   float g_fSpecPowMulti;             // Offset:    0 Size:     4
//   float g_fAmbInts;                  // Offset:    4 Size:     4 [unused]
//   int g_iBla0;                       // Offset:    8 Size:     4 [unused]
//   int g_iBla1;                       // Offset:   12 Size:     4 [unused]
//   float3 g_vReflIntensity;           // Offset:   16 Size:    12
//   uint g_bShowNormal;                // Offset:   28 Size:     4 [unused]
//   uint g_bJunk;                      // Offset:   32 Size:     4 [unused]
//   float g_fPad0;                     // Offset:   36 Size:     4 [unused]
//   float g_fUberCubeInfl;             // Offset:   40 Size:     4
//   float g_fSSRBooster;               // Offset:   44 Size:     4
//   int g_iWidthFullRT;                // Offset:   48 Size:     4
//   int g_iHeightFullRT;               // Offset:   52 Size:     4
//   uint g_bShowSpecIntensity;         // Offset:   56 Size:     4 [unused]
//   int g_iPad1;                       // Offset:   60 Size:     4 [unused]
//   row_major float4x4 g_mProj;        // Offset:   64 Size:    64
//
// }
//
// Resource bind info for LightDataBuffer
// {
//
//   struct STiledLightData
//   {
//       
//       float3 vPosition;              // Offset:    0
//       float fSegmentLength;          // Offset:   12
//       float3 vDirection;             // Offset:   16
//       float fMinShadowSpec;          // Offset:   28
//       float4 vAttParams;             // Offset:   32
//       float3 vSpotParams;            // Offset:   48
//       float fIntensity;              // Offset:   60
//       float4 vDiffuseColor;          // Offset:   64
//       float4 vShadowFadeParams;      // Offset:   80
//       uint uRelCen;                  // Offset:   96
//       uint uFxSpecificIdx;           // Offset:  100
//       uint uFxType;                  // Offset:  104
//       float fRadiusSquared;          // Offset:  108
//       float3 vLambertWeights;        // Offset:  112
//       float fSpecularStrength;       // Offset:  124
//       float3 vBoxAxisX;              // Offset:  128
//       uint uLightType;               // Offset:  140
//       float3 vBoxAxisZ;              // Offset:  144
//       uint bShadowEnabled;           // Offset:  156
//       float3 vBoxInnerDistance;      // Offset:  160
//       uint bModulationMapEnabled;    // Offset:  172
//       float3 vBoxInvRange;           // Offset:  176
//       uint uModulationMapIndex;      // Offset:  188
//       row_major float4x4 mViewToShadowMap;// Offset:  192
//       row_major float4x4 mViewToModulationMap;// Offset:  256
//       float3 vRecipOuterColiProxy;   // Offset:  320
//       uint uProbeFlags;              // Offset:  332
//       float3 vColixProxyCen;         // Offset:  336
//       uint bForwardOnly;             // Offset:  348
//       uint uShadowType;              // Offset:  352
//       uint uNumSoftShadowSamples;    // Offset:  356
//       float fSoftShadowRadius;       // Offset:  360
//       float fSoftShadowDepthBias;    // Offset:  364
//       float fSoftShadowExponent;     // Offset:  368
//       float fProbePriority;          // Offset:  372
//       float fUnusedParam[2];         // Offset:  376
//
//   } $Element;                        // Offset:    0 Size:   384
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SamplerGenericPointClamp          sampler      NA          NA   10        1
// SamplerGenericTrilinearWrap       sampler      NA          NA   11        1
// SamplerGenericBilinearClamp       sampler      NA          NA   13        1
// depthBuffer_texture               texture  float4          2d    0        1
// normBuffer_texture                texture  float4          2d    1        1
// PostCompGBuf_texture              texture   float        2dMS    2        1
// TLC0                              texture  float4          2d    3        1
// uberCube                          texture  float4        cube    4        1
// AttenuationSampler_texture        texture  float4          2d   44        1
// LightDataBuffer                   texture  struct         r/o   54        1
// LightIndexBuffer                  texture   uint4         buf   55        1
// ReflCubeMaps                      texture  float4   cubearray   57        1
// SceneBuffer                       cbuffer      NA          NA    2        1
// cbCubeRefl                        cbuffer      NA          NA    5        1
// IrradianceBuffer                  cbuffer      NA          NA    6        1
// cbTiledLighting                   cbuffer      NA          NA    7        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy  
// TEXCOORD                 0   xy          1     NONE   float       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb7[1], immediateIndexed
dcl_constantbuffer cb2[101], immediateIndexed
dcl_constantbuffer cb6[8], immediateIndexed
dcl_constantbuffer cb5[8], immediateIndexed
dcl_sampler s10, mode_default
dcl_sampler s11, mode_default
dcl_sampler s13, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2dms(0) (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texturecube (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t44
dcl_resource_structured t54, 384 
dcl_resource_buffer (uint,uint,uint,uint) t55
dcl_resource_texturecubearray (float,float,float,float) t57
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_output o0.xyzw
// dcl_temps 35
dcl_temps 37
dcl_resource_texture2d (float,float,float,float) t125
round_ni r0.xy, v0.xyxx
mad r0.zw, r0.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, 0.500000, 0.500000)
ftoi r1.xy, r0.zwzz
mov r1.zw, l(0,0,0,0)
ldms_indexable(texture2dms)(float,float,float,float) r1.x, r1.xyzw, t2.xyzw, l(0)
dp2 r1.x, r1.xxxx, r1.xxxx
lt r1.y, r1.x, cb2[24].w
if_nz r1.y
  mov o0.xyzw, l(0,0,0,1.000000)
  ret 
endif 
itof r1.yz, cb5[3].xxyx
div r0.zw, r0.zzzw, r1.yyyz
ftoi r2.xy, r0.xyxx
add r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
mov r2.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r1.y, r2.xyzw, t0.yxzw
mad r1.y, r1.y, cb2[20].x, cb2[20].y
rcp r2.z, r1.y
sample_l_indexable(texture2d)(float,float,float,float) r3.xyzw, r0.zwzz, t1.xyzw, s10, l(0.000000)
min r1.y, |r3.w|, l(1.000000)
mad r1.y, r1.y, l(12.000000), l(1.000000)
exp r1.y, r1.y
mul r1.y, r1.y, l(0.250000)
mul r4.xyz, r3.yyyy, cb2[1].xyzx
mad r3.xyw, r3.xxxx, cb2[0].xyxz, r4.xyxz
mad r3.xyz, r3.zzzz, cb2[2].xyzx, r3.xywx
mul r1.z, r1.y, cb5[2].w
mul r1.z, r1.z, l(-0.0144269504)
exp r1.z, r1.z
add r1.z, -r1.z, l(0.835270226)
mul_sat r1.z, r1.z, l(1.31932139)
mad r0.zw, r0.zzzw, cb2[18].xxxy, cb2[18].zzzw
mul r2.xy, r2.zzzz, r0.zwzz

//View space correction, therefore need the InvProj._m00
ld_indexable(texture2d)(float,float,float,float) r36.xyzw, l(0, 0, 0, 0), t125.xyzw
add r36.w, r2.z, -r36.y
mul r36.w, r36.w, r36.x
mul r36.w, r36.w, cb2[81].x
add r2.x, r2.x, -r36.w


dp3 r0.z, -r2.xyzx, -r2.xyzx
rsq r0.z, r0.z
mul r4.xyz, r0.zzzz, -r2.xyzx
add r5.xyz, r3.xyzx, r3.xyzx
dp3_sat r0.z, r4.xyzx, r3.xyzx
mad r4.xyz, r5.xyzx, r0.zzzz, -r4.xyzx
dp3 r5.x, r4.xyzx, cb2[0].xyzx
dp3 r5.y, r4.xyzx, cb2[1].xyzx
dp3 r5.z, r4.xyzx, cb2[2].xyzx
mul r0.z, r1.y, cb5[0].x
log r0.z, r0.z
mad_sat r0.z, -r0.z, l(0.0909090936), l(1.000000)
mul r0.z, r0.z, l(4.000000)
mul r0.w, cb6[7].x, l(3.14159274)
lt r1.y, l(0.000000), cb5[2].z
if_nz r1.y
  sample_l_indexable(texturecube)(float,float,float,float) r6.xyz, r5.xyzx, t4.xyzw, s11, r0.z
  mul r6.xyz, r0.wwww, r6.xyzx
  mov_sat r1.y, cb5[2].z
  mul r6.xyz, r6.xyzx, r1.yyyy
else 
  mul r7.xyzw, r5.yzzz, r5.xxyz
  mul r1.y, r5.y, r5.y
  mad r5.w, r5.x, r5.x, -r1.y
  dp4 r8.x, r7.xyzw, cb6[0].xyzw
  dp4 r8.y, r7.xyzw, cb6[2].xyzw
  dp4 r8.z, r7.xyzw, cb6[4].xyzw
  dp4 r7.x, r5.xyzw, cb6[1].xyzw
  dp4 r7.y, r5.xyzw, cb6[3].xyzw
  dp4 r7.z, r5.xyzw, cb6[5].xyzw
  add r7.xyz, r7.xyzx, r8.xyzx
  add r7.xyz, r7.xyzx, cb6[6].xyzx
  max r7.xyz, r7.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  mad r1.y, r5.z, l(0.500000), l(0.500000)
  add r8.xyz, cb2[27].xyzx, -cb2[38].xyzx
  mad r8.xyz, r1.yyyy, r8.xyzx, cb2[38].xyzx
  add r6.xyz, r7.xyzx, r8.xyzx
endif 
ieq r1.y, cb7[0].x, l(0)
ult r1.w, l(1024), cb7[0].x
or r1.y, r1.w, r1.y
if_z r1.y
  mul r7.xyz, r5.yyyy, cb2[1].xyzx
  mad r7.xyz, r5.xxxx, cb2[0].xyzx, r7.xyzx
  mad r7.xyz, r5.zzzz, cb2[2].xyzx, r7.xyzx
  mul r1.yw, r0.xxxy, l(0.000000, 0.125000, 0.000000, 0.125000)
  round_ni r1.yw, r1.yyyw
  utof r2.w, cb7[0].z
  mad r1.y, r1.w, r2.w, r1.y
  ftou r1.y, r1.y
  imul null, r1.w, cb7[0].w, cb7[0].z
  ishl r1.yw, r1.yyyw, l(0, 1, 0, 1)
  iadd r1.y, r1.y, r1.w
  mov r8.w, l(1.000000)
  mov r9.w, l(1.000000)
  mov r10.xyz, l(0,0,0,0)
  mov r11.xyz, l(0,0,0,0)
  mov r12.xy, l(0,0,0,0)
  mov r1.w, l(0)
  mov r2.w, l(0)
  mov r3.w, l(1.000000)
  mov r4.w, l(0)
  loop 
    uge r6.w, r4.w, l(2)
    breakc_nz r6.w
    iadd r6.w, r1.y, r4.w
    ld_indexable(buffer)(uint,uint,uint,uint) r13.xyzw, r6.wwww, t55.xyzw
    ushr r14.xyzw, r13.xyzw, l(30, 30, 30, 30)
    iadd r6.w, r14.y, r14.x
    iadd r6.w, r14.z, r6.w
    iadd r6.w, r14.w, r6.w
    mov r14.xyz, r10.xyzx
    mov r15.xyz, r11.xyzx
    mov r16.xw, r12.yyyx
    mov r16.y, r1.w
    mov r16.z, r2.w
    mov r7.w, r3.w
    mov r10.w, l(0)
    loop 
      uge r11.w, r10.w, r6.w
      breakc_nz r11.w
      ult r17.xyz, r10.wwww, l(3, 6, 9, 0)
      iadd r18.xyz, r10.wwww, l(-3, -6, -9, 0)
      movc r11.w, r17.z, r18.y, r18.z
      movc r11.w, r17.y, r18.x, r11.w
      movc r11.w, r17.x, r10.w, r11.w
      movc r12.z, r17.z, r13.z, r13.w
      movc r12.z, r17.y, r13.y, r12.z
      movc r12.z, r17.x, r13.x, r12.z
      imul null, r11.w, r11.w, l(10)
      ushr r11.w, r12.z, r11.w
      and r11.w, r11.w, l(1023)
      ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r12.z, r11.w, l(140), t54.xxxx
      mov r17.xyz, r14.xyzx
      mov r18.xyz, r15.xyzx
      mov r19.xyzw, r16.xyzw
      mov r12.w, r7.w
      mov r20.x, r10.w
      mov r20.y, r11.w
      mov r20.z, r12.z
      loop 
        ult r20.w, r20.x, r6.w
        ieq r21.xy, r20.zzzz, l(0, 1, 0, 0)
        or r21.x, r21.y, r21.x
        and r20.w, r20.w, r21.x
        breakc_z r20.w
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r22.xyzw, r20.y, l(0), t54.xyzw
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r21.xzw, r20.y, l(16), t54.xxyz
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r20.w, r20.y, l(32), t54.xxxx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r23.yz, r20.y, l(40), t54.xxyx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r24.xyzw, r20.y, l(60), t54.xyzw
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r25.xy, r20.y, l(100), t54.xyxx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r23.w, r20.y, l(332), t54.xxxx
        and r23.w, r23.w, l(3)
        add r22.xyz, r2.xyzx, -r22.xyzx
        dp3 r25.z, r22.xyzx, r21.xzwx
        max r25.z, r25.z, l(0.000000)
        min r22.w, r22.w, r25.z
        mad r21.xzw, -r22.wwww, r21.xxzw, r22.xxyz
        movc r21.xyz, r21.yyyy, r21.xzwx, r22.xyzx
        dp3 r21.x, r21.xyzx, r21.xyzx
        sqrt r21.x, r21.x
        mad_sat r23.x, r21.x, r20.w, r23.y
        sample_l_indexable(texture2d)(float,float,float,float) r20.w, r23.xzxx, t44.xywz, s13, l(0.000000)
        ine r21.x, r25.y, l(1)
        movc r20.w, r21.x, l(0), r20.w
        ine r21.x, r23.w, l(2)
        if_nz r21.x
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r21.x, r20.y, l(372), t54.xxxx
          mul r21.y, r20.w, r20.w
          mul r21.x, r21.x, r21.y
          ieq r21.yz, r23.wwww, l(0, 1, 3, 0)
          mul r21.w, r0.w, r24.x
          itof r5.w, r25.x
          sample_l_indexable(texturecubearray)(float,float,float,float) r22.xyz, r5.xyzw, t57.xyzw, s11, r0.z
          mul r22.xyz, r21.wwww, r22.xyzx
          mul r8.xyz, r24.yzwy, r22.xyzx
          mov r18.w, r19.z
          mad r22.xyzw, r21.xxxx, r8.wxyz, r18.wxyz
          max r23.w, r19.w, r21.x
          mov r17.w, r19.x
          mad r25.xyzw, r21.xxxx, r8.xyzw, r17.xyzw
          max r26.x, r19.y, r21.x
          mov r23.x, r17.w
          mov r23.z, r22.x
          mov r19.x, r25.w
          mov r19.z, r18.w
          movc r27.xzw, r21.yyyy, r23.xxzw, r19.xxzw
          mov r22.x, r19.y
          mov r26.yzw, r18.xxyz
          movc r26.xyzw, r21.yyyy, r22.xyzw, r26.xyzw
          or r5.w, r21.z, r21.y
          movc r17.xyz, r5.wwww, r17.xyzx, r25.xyzx
          movc r18.xyz, r21.zzzz, r18.xyzx, r26.yzwy
          mov r19.x, r23.x
          mov r19.y, r22.x
          mov r27.y, r26.x
          movc r19.xyzw, r21.zzzz, r19.xyzw, r27.xyzw
        else 
          add_sat r5.w, -r20.w, l(1.000000)
          mul r5.w, r5.w, r5.w
          add r8.x, -r24.x, l(1.000000)
          mad r5.w, r5.w, r8.x, r24.x
          mul r12.w, r5.w, r12.w
        endif 
        iadd r5.w, r20.x, l(1)
        ult r8.x, r5.w, r6.w
        if_nz r8.x
          ult r8.xyz, r5.wwww, l(3, 6, 9, 0)
          iadd r21.xyz, r20.xxxx, l(-2, -5, -8, 0)
          movc r17.w, r8.z, r21.y, r21.z
          movc r17.w, r8.y, r21.x, r17.w
          movc r17.w, r8.x, r5.w, r17.w
          movc r8.z, r8.z, r13.z, r13.w
          movc r8.y, r8.y, r13.y, r8.z
          movc r8.x, r8.x, r13.x, r8.y
          imul null, r8.y, r17.w, l(10)
          ushr r8.x, r8.x, r8.y
          and r20.y, r8.x, l(1023)
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r20.z, r20.y, l(140), t54.xxxx
        endif 
        mov r20.x, r5.w
      endloop 
      mov r14.xyz, r17.xyzx
      mov r15.xyz, r18.xyzx
      mov r16.xyzw, r19.xyzw
      mov r7.w, r12.w
      mov r5.w, r20.x
      mov r8.xy, r20.yzyy
      loop 
        ult r8.z, r5.w, r6.w
        ieq r11.w, r8.y, l(4)
        and r8.z, r8.z, r11.w
        breakc_z r8.z
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r21.xyz, r8.x, l(0), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r22.xyz, r8.x, l(16), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r23.y, r8.x, l(44), t54.xxxx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r24.xyzw, r8.x, l(60), t54.xyzw
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r25.xyz, r8.x, l(96), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r26.xyz, r8.x, l(128), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r27.xyz, r8.x, l(144), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r28.xyz, r8.x, l(160), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r29.xyz, r8.x, l(176), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r30.xyzw, r8.x, l(320), t54.xyzw
        and r8.z, r30.w, l(3)
        add r21.xyz, r2.xyzx, -r21.xyzx
        dp3 r31.x, r21.xyzx, r26.xyzx
        dp3 r31.y, r21.xyzx, r22.xyzx
        dp3 r31.z, r21.xyzx, r27.xyzx
        mul r21.xyz, r28.xyzx, r29.xyzx
        mad r28.xyz, r29.xyzx, r28.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r28.xyz, r29.xyzx, r28.xyzx
        mul r29.xyz, r28.xyzx, r31.xyzx
        max r29.xyz, r29.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        min r29.xyz, r29.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        mul r32.yzw, r29.xxyz, r29.xxyz
        mad r11.w, -r29.x, r29.x, l(1.000000)
        mad r11.w, r32.w, r11.w, r32.y
        add r12.z, -r11.w, l(1.000000)
        mad_sat r11.w, r32.z, r12.z, r11.w
        sqrt r11.w, r11.w
        max r32.x, r32.y, l(0.000010)
        dp3 r12.z, r21.xyzx, r32.xzwx
        mad r17.w, r29.y, r29.y, r32.x
        mad r17.w, r29.z, r29.z, r17.w
        div r12.z, r12.z, r17.w
        add r17.w, r12.z, l(1.000000)
        mad_sat r23.x, r11.w, r17.w, -r12.z
        sample_l_indexable(texture2d)(float,float,float,float) r11.w, r23.xyxx, t44.xywz, s13, l(0.000000)
        ine r12.z, r25.z, l(1)
        movc r11.w, r12.z, l(0), r11.w
        ine r12.z, r8.z, l(2)
        if_nz r12.z
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r21.xyz, r8.x, l(336), t54.xyzx
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r12.z, r8.x, l(372), t54.xxxx
          mul r17.w, r11.w, r11.w
          mul r12.z, r12.z, r17.w
          ieq r23.xy, r8.zzzz, l(1, 3, 0, 0)
          and r8.z, r30.w, l(4)
          add r29.xyz, -r21.xyzx, r31.xyzx
          mul r31.xyz, r30.xyzx, r29.xyzx
          dp3 r32.x, r7.xyzx, r26.xyzx
          dp3 r32.y, r7.xyzx, r22.xyzx
          dp3 r32.z, r7.xyzx, r27.xyzx
          mul r32.xyz, r30.xyzx, r32.xyzx
          ushr r23.zw, r25.xxxx, l(0, 0, 10, 20)
          and r25.zw, r25.xxxx, l(0, 0, 511, 512)
          ubfe r33.xy, l(9, 11, 0, 0), l(10, 20, 0, 0), r25.xxxx
          utof r34.x, r25.z
          utof r34.yz, r33.xxyx
          mul r33.xyz, r34.xyzx, l(0.00195694715, 0.00195694715, 0.000488519785, 0.000000)
          movc r34.x, r25.w, l(-1.000000), l(1.000000)
          and r23.zw, r23.zzzw, l(0, 0, 512, 2048)
          movc r34.yz, r23.zzwz, l(0,-1.000000,-1.000000,0), l(0,1.000000,1.000000,0)
          mul r25.xzw, r33.xxyz, r34.xxyz
          div r25.xzw, r25.xxzw, r28.xxyz
          add r21.xyz, -r21.xyzx, r25.xzwx
          lt r25.xzw, l(0.000000, 0.000000, 0.000000, 0.000000), r32.xxyz
          lt r28.xyz, r32.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
          iadd r25.xzw, -r25.xxzw, r28.xxyz
          itof r25.xzw, r25.xxzw
          mad r25.xzw, -r29.xxyz, r30.xxyz, r25.xxzw
          div r25.xzw, r25.xxzw, r32.xxyz
          min r17.w, r25.w, r25.z
          min r17.w, r17.w, r25.x
          mad r25.xzw, r32.xxyz, r17.wwww, r31.xxyz
          mad r21.xyz, -r21.xyzx, r30.xyzx, r25.xzwx
          div r21.xyz, r21.xyzx, r30.xyzx
          mul r22.xyz, r21.yyyy, r22.xyzx
          mad r21.xyw, r26.xyxz, r21.xxxx, r22.xyxz
          mad r21.xyz, r27.xyzx, r21.zzzz, r21.xywx
          dp3 r22.x, r21.xyzx, cb2[0].xyzx
          dp3 r22.y, r21.xyzx, cb2[1].xyzx
          dp3 r22.z, r21.xyzx, cb2[2].xyzx
          movc r21.xyz, r8.zzzz, r22.xyzx, r5.xyzx
          mul r8.z, r0.w, r24.x
          itof r21.w, r25.y
          sample_l_indexable(texturecubearray)(float,float,float,float) r21.xyz, r21.xyzw, t57.xyzw, s11, r0.z
          mul r21.xyz, r8.zzzz, r21.xyzx
          mul r9.xyz, r24.yzwy, r21.xyzx
          mov r15.w, r16.z
          mad r21.xyzw, r12.zzzz, r9.wxyz, r15.wxyz
          max r22.w, r12.z, r16.w
          mov r14.w, r16.x
          mad r25.xyzw, r12.zzzz, r9.xyzw, r14.xyzw
          max r26.x, r12.z, r16.y
          mov r22.x, r14.w
          mov r22.z, r21.x
          mov r16.x, r25.w
          mov r16.z, r15.w
          movc r27.xzw, r23.xxxx, r22.xxzw, r16.xxzw
          mov r21.x, r16.y
          mov r26.yzw, r15.xxyz
          movc r26.xyzw, r23.xxxx, r21.xyzw, r26.xyzw
          or r8.z, r23.y, r23.x
          movc r14.xyz, r8.zzzz, r14.xyzx, r25.xyzx
          movc r15.xyz, r23.yyyy, r15.xyzx, r26.yzwy
          mov r16.x, r22.x
          mov r16.y, r21.x
          mov r27.y, r26.x
          movc r16.xyzw, r23.yyyy, r16.xyzw, r27.xyzw
        else 
          add_sat r8.z, -r11.w, l(1.000000)
          mul r8.z, r8.z, r8.z
          add r9.x, -r24.x, l(1.000000)
          mad r8.z, r8.z, r9.x, r24.x
          mul r7.w, r7.w, r8.z
        endif 
        iadd r8.z, r5.w, l(1)
        ult r9.x, r8.z, r6.w
        if_nz r9.x
          ult r9.xyz, r8.zzzz, l(3, 6, 9, 0)
          iadd r21.xyz, r5.wwww, l(-2, -5, -8, 0)
          movc r11.w, r9.z, r21.y, r21.z
          movc r11.w, r9.y, r21.x, r11.w
          movc r11.w, r9.x, r8.z, r11.w
          movc r9.z, r9.z, r13.z, r13.w
          movc r9.y, r9.y, r13.y, r9.z
          movc r9.x, r9.x, r13.x, r9.y
          imul null, r9.y, r11.w, l(10)
          ushr r9.x, r9.x, r9.y
          and r8.x, r9.x, l(1023)
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r8.y, r8.x, l(140), t54.xxxx
        endif 
        mov r5.w, r8.z
      endloop 
      ine r9.xyz, r8.yyyy, l(0, 4, 1, 0)
      and r8.x, r9.y, r9.x
      and r8.x, r9.z, r8.x
      iadd r10.w, r5.w, -r8.x
    endloop 
    ult r6.w, r6.w, l(12)
    if_nz r6.w
      mov r10.xyz, r14.xyzx
      mov r11.xyz, r15.xyzx
      mov r12.xy, r16.wxww
      mov r1.w, r16.y
      mov r2.w, r16.z
      mov r3.w, r7.w
      break 
    endif 
    iadd r4.w, r4.w, l(1)
    mov r10.xyz, r14.xyzx
    mov r11.xyz, r15.xyzx
    mov r12.xy, r16.wxww
    mov r1.w, r16.y
    mov r2.w, r16.z
    mov r3.w, r7.w
  endloop 
  max r0.z, r2.w, l(1.192092896E-007)
  div r5.xyz, r11.xyzx, r0.zzzz
  mov_sat r12.x, r12.x
  add r5.xyz, -r6.xyzx, r5.xyzx
  mad r5.xyz, r12.xxxx, r5.xyzx, r6.xyzx
  max r0.z, r12.y, l(1.192092896E-007)
  div r7.xyz, r10.xyzx, r0.zzzz
  mov_sat r1.w, r1.w
  add r7.xyz, -r5.xyzx, r7.xyzx
  mad r6.xyz, r1.wwww, r7.xyzx, r5.xyzx
else 
  mov r3.w, l(1.000000)
endif 
max r0.z, cb5[1].y, cb5[1].x
max r0.z, r0.z, cb5[1].z
mul r0.z, r1.x, r0.z
lt r0.z, l(0.020000), r0.z
lt r1.y, l(0.010000), r1.z
and r0.z, r0.z, r1.y
if_nz r0.z
  mul r2.xyz, r2.xyzx, l(0.997000, 0.997000, 0.997000, 0.000000)
  dp3 r0.z, r4.xyzx, r3.xyzx
  mul r0.z, r0.z, l(10.000000)
  div r0.z, l(1600.000000), r0.z
  mul r5.xyzw, r4.yyyy, cb5[5].xyzw
  mad r5.xyzw, r4.xxxx, cb5[4].xyzw, r5.xyzw
  mad r4.xyzw, r4.zzzz, cb5[6].xyzw, r5.xyzw
  mul r5.xyzw, r2.yyyy, cb5[5].xyzw
  mad r5.xyzw, r2.xxxx, cb5[4].xyzw, r5.xyzw
  mad r2.xyzw, r2.zzzz, cb5[6].xyzw, r5.xyzw
  add r2.xyzw, r2.xyzw, cb5[7].xyzw
  mul r0.z, r0.z, l(0.594822109)
  div r3.xyz, -r2.xyzx, r4.xyzx
  add r5.xyz, -r2.xyzx, r2.wwww
  add r7.xyz, -r4.xyzx, r4.wwww
  div r5.xyz, -r5.xyzx, r7.xyzx
  lt r7.xyz, r3.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  movc r3.xyz, r7.xyzx, l(10000000.000000,10000000.000000,10000000.000000,0), r3.xyzx
  lt r7.xyz, r5.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  movc r5.xyz, r7.xyzx, l(10000000.000000,10000000.000000,10000000.000000,0), r5.xyzx
  min r3.xyz, r3.xyzx, r5.xyzx
  min r1.y, r3.z, r3.y
  min r1.y, r1.y, r3.x
  mov r1.w, l(0)
  mov r3.x, r0.z
  mov r5.xy, l(0,0,0,0)
  mov r7.xy, l(0,0,0,0)
  mov r3.yz, l(0,0,0,0)
  loop 
    ige r5.z, r3.z, l(10)
    breakc_nz r5.z
    add r5.z, r1.w, r3.x
    min r1.w, r1.y, r5.z
    mad r8.xyzw, r1.wwww, r4.xyzw, r2.xyzw
    mul r3.x, r3.x, l(1.11111116)
    div r8.xyz, r8.xyzx, r8.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.z, r8.xyxx, t0.yzxw, s10, l(0.000000)
    add r5.w, -r5.z, r8.z
    lt r5.w, l(0.000000), r5.w
    if_nz r5.w
      mov r3.y, l(1)
      mov r7.x, r1.w
      mov r7.y, r5.z
      break 
    endif 
    mov r5.x, r1.w
    mov r5.y, r5.z
    iadd r3.z, r3.z, l(1)
    mov r7.x, r1.w
    mov r7.y, r5.z
    mov r3.y, l(0)
  endloop 
  ilt r0.z, l(0), r3.y
  if_nz r0.z
    ishr r1.yw, cb5[3].xxxy, l(0, 1, 0, 1)
    itof r1.yw, r1.yyyw
    div r0.xy, r0.xyxx, r1.ywyy
    add r0.z, r5.x, r7.x
    mul r3.x, r0.z, l(0.500000)
    mad r8.xyzw, r3.xxxx, r4.xyzw, r2.xyzw
    div r8.xyz, r8.xyzx, r8.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r3.y, r8.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r3.y, r8.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r3.xxxy, r5.xxxy
    movc r3.xy, r0.zzzz, r7.xyxx, r3.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    add r0.z, r1.y, r3.x
    mul r5.x, r0.z, l(0.500000)
    mad r7.xyzw, r5.xxxx, r4.xyzw, r2.xyzw
    div r7.xyz, r7.xyzx, r7.wwww
    sample_l_indexable(texture2d)(float,float,float,float) r5.y, r7.xyxx, t0.yxzw, s10, l(0.000000)
    add r0.z, -r5.y, r7.z
    lt r0.z, r0.z, l(0.000000)
    movc r1.yw, r0.zzzz, r5.xxxy, r1.yyyw
    movc r3.xy, r0.zzzz, r3.xyxx, r5.xyxx
    mad r5.xyz, r1.yyyy, r4.xywx, r2.xywx
    mad r2.xyz, r3.xxxx, r4.xywx, r2.xywx
    div r4.xy, r5.xyxx, r5.zzzz
    div r2.xy, r2.xyxx, r2.zzzz
    mad r0.z, r1.w, cb2[20].x, cb2[20].y
    div r5.z, l(1.000000, 1.000000, 1.000000, 1.000000), r0.z
    mad r0.z, r3.y, cb2[20].x, cb2[20].y
    div r7.z, l(1.000000, 1.000000, 1.000000, 1.000000), r0.z
    mad r1.yw, r4.xxxy, cb2[18].xxxy, cb2[18].zzzw
    mul r5.xy, r5.zzzz, r1.ywyy

//View space correction, therefore need the InvProj._m00
ld_indexable(texture2d)(float,float,float,float) r36.xyzw, l(0, 0, 0, 0), t125.xyzw
add r36.w, r5.z, -r36.y
mul r36.w, r36.w, r36.x
mul r36.w, r36.w, cb2[81].x
add r5.x, r5.x, -r36.w


    mad r1.yw, r2.xxxy, cb2[18].xxxy, cb2[18].zzzw
    mul r7.xy, r7.zzzz, r1.ywyy

//View space correction, therefore need the InvProj._m00
ld_indexable(texture2d)(float,float,float,float) r36.xyzw, l(0, 0, 0, 0), t125.xyzw
add r36.w, r7.z, -r36.y
mul r36.w, r36.w, r36.x
mul r36.w, r36.w, cb2[81].x
add r7.x, r7.x, -r36.w


    add r4.xyz, r5.xyzx, -r7.xyzx
    dp3 r0.z, r4.xyzx, r4.xyzx
    max r1.yw, r0.xxxy, r2.xxxy
    min r0.xy, r0.xyxx, r2.xyxx
    add r1.yw, -r1.yyyw, l(0.000000, 1.000000, 0.000000, 1.000000)
    mul_sat r0.xy, r0.xyxx, l(10.000000, 10.000000, 0.000000, 0.000000)
    mul_sat r1.yw, r1.yyyw, l(0.000000, 10.000000, 0.000000, 10.000000)
    mul r0.x, r0.x, r1.y
    mul r0.x, r0.y, r0.x
    mul r0.x, r1.w, r0.x
    mul r0.y, r3.x, l(-0.00721347518)
    exp r0.y, r0.y
    mad r0.y, r0.y, l(-9999.990234), l(10000.000000)
    lt r0.y, r0.z, r0.y
    if_nz r0.y
      mul_sat r0.y, r3.x, l(0.000625)
      mul r0.y, r0.y, r0.y
      mul r0.y, r0.y, r0.y
      mul r0.y, r0.y, r0.y
      mul r0.y, r0.y, l(-14.426950)
      exp r0.y, r0.y
      mul r0.y, r1.z, r0.y
      mul r4.w, r0.y, r0.x
      sample_l_indexable(texture2d)(float,float,float,float) r4.xyz, r2.xyxx, t3.xyzw, s13, l(0.000000)
    else 
      mov r4.xyzw, l(0,0,0,0)
    endif 
  else 
    mov r4.xyzw, l(0,0,0,0)
  endif 
else 
  mov r4.xyzw, l(0,0,0,0)
endif 
movc r2.xyzw, cb2[100].xxxx, r4.xyzw, l(0,0,0,0)
mad r0.xyz, r2.xyzx, r0.wwww, -r6.xyzx
mad r0.xyz, r2.wwww, r0.xyzx, r6.xyzx
mul r0.xyz, r0.xyzx, r3.wwww
mul r1.xyz, r1.xxxx, cb5[1].xyzx
mul o0.xyz, r0.xyzx, r1.xyzx
mov o0.w, l(1.000000)
ret 
// Approximately 657 instruction slots used
