//be88c40aec27004c-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  float4          2d    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_texture2d (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
add r0.zw, r0.xxxy, l(0.000000, 0.000000, 0.500000, 0.500000)
itof r1.xy, cb5[3].xyxx
div r1.zw, r0.zzzw, r1.xxxy
sample_l_indexable(texture2d)(float,float,float,float) r2.x, r1.zwzz, t2.xyzw, s10, l(0.000000)
dp2 r2.x, r2.xxxx, r2.xxxx
lt r2.y, r2.x, cb2[24].w
if_nz r2.y
  mov o0.xyzw, l(0,0,0,1.000000)
  ret 
endif 
ftoi r0.xy, r0.xyxx
ishr r3.xy, r0.xyxx, l(1, 1, 0, 0)
mov r3.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r0.x, r3.xyzw, t0.xyzw
mad r0.x, r0.x, cb2[20].x, cb2[20].y
rcp r3.z, r0.x
sample_l_indexable(texture2d)(float,float,float,float) r4.xyzw, r1.zwzz, t1.xyzw, s10, l(0.000000)
min r0.x, |r4.w|, l(1.000000)
mad r0.x, r0.x, l(12.000000), l(1.000000)
exp r0.x, r0.x
mul r0.x, r0.x, l(0.250000)
mul r2.yzw, r4.yyyy, cb2[1].xxyz
mad r2.yzw, r4.xxxx, cb2[0].xxyz, r2.yyzw
mad r2.yzw, r4.zzzz, cb2[2].xxyz, r2.yyzw
mul r0.y, r0.x, cb5[2].w
mul r0.y, r0.y, l(-0.0144269504)
exp r0.y, r0.y
add r0.y, -r0.y, l(0.835270226)
mul_sat r0.y, r0.y, l(1.31932139)
mad r4.xy, r1.zwzz, cb2[18].xyxx, cb2[18].zwzz
mul r3.xy, r3.zzzz, r4.xyxx

//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, r3.z, -r36.y
mul r36.w, r36.w, r36.x
mul r36.w, r36.w, cb2[81].x
add r3.x, r3.x, -r36.w


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

//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, r4.z, -r36.y
mul r36.w, r36.w, r36.x
mul r36.w, r36.w, cb2[81].x
add r4.x, r4.x, -r36.w


    mad r0.xz, r3.xxyx, cb2[18].xxyx, cb2[18].zzwz
    mul r5.xy, r5.zzzz, r0.xzxx

//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


    add r0.xzw, r4.xxyz, -r5.xxyz
    dp3 r0.x, r0.xzwx, r0.xzwx
    max r0.zw, r1.zzzw, r3.xxxy
    min r1.zw, r1.zzzw, r3.xxxy
    add r0.zw, -r0.zzzw, l(0.000000, 0.000000, 1.000000, 1.000000)
    mul_sat r1.zw, r1.zzzw, l(0.000000, 0.000000, 10.000000, 10.000000)
    mul_sat r0.zw, r0.zzzw, l(0.000000, 0.000000, 10.000000, 10.000000)
    mul r0.z, r0.z, r1.z
    mul r0.z, r1.w, r0.z
    mul r0.z, r0.w, r0.z
    mul r0.w, r2.y, l(-0.00721347518)
    exp r0.w, r0.w
    mad r0.w, r0.w, l(-9999.990234), l(10000.000000)
    lt r0.x, r0.x, r0.w
    if_nz r0.x
      mul_sat r0.x, r2.y, l(0.000625)
      mul r0.x, r0.x, r0.x
      mul r0.x, r0.x, r0.x
      mul r0.x, r0.x, r0.x
      mul r0.x, r0.x, l(-14.426950)
      exp r0.x, r0.x
      mul r0.x, r0.y, r0.x
      mul r0.w, r0.x, r0.z
      mul r1.xy, r1.xyxx, r3.xyxx
      mul r1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
      round_ni r1.xy, r1.xyxx
      add r1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
      ishr r1.zw, cb5[3].xxxy, l(0, 0, 1, 1)
      itof r1.zw, r1.zzzw
      div r1.xy, r1.xyxx, r1.zwzz
      sample_l_indexable(texture2d)(float,float,float,float) r0.xyz, r1.xyxx, t3.xyzw, s13, l(0.000000)
    else 
      mov r0.xyzw, l(0,0,0,0)
    endif 
  else 
    mov r0.xyzw, l(0,0,0,0)
  endif 
else 
  mov r0.xyzw, l(0,0,0,0)
endif 
movc r0.xyzw, cb2[100].xxxx, r0.xyzw, l(0,0,0,0)
mad r0.xyz, r0.xyzx, r3.wwww, -r6.xyzx
mad r0.xyz, r0.wwww, r0.xyzx, r6.xyzx
mul r0.xyz, r0.xyzx, r6.wwww
mul r1.xyz, r2.xxxx, cb5[1].xyzx
mul o0.xyz, r0.xyzx, r1.xyzx
mov o0.w, l(1.000000)
ret 
// Approximately 660 instruction slots used
