//798f95a30c1e4674-ps.txt
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.2.27 on Fri Jan 29 08:58:48 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 [unused]
//   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 [unused]
//   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 cbCubeAmbi
// {
//
//   int g_iWidthFullRT;                // Offset:    0 Size:     4
//   int g_iHeightFullRT;               // Offset:    4 Size:     4
//   int g_iBla0;                       // Offset:    8 Size:     4 [unused]
//   int g_iBla1;                       // Offset:   12 Size:     4 [unused]
//   float3 g_vJunk;                    // Offset:   16 Size:    12 [unused]
//   uint g_bJunk;                      // Offset:   28 Size:     4 [unused]
//   row_major float4x4 g_mProj;        // Offset:   32 Size:    64 [unused]
//
// }
//
// 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
// SamplerGenericBilinearWrap        sampler      NA          NA   12        1
// SamplerGenericBilinearClamp       sampler      NA          NA   13        1
// depthBuffer_texture               texture  float4          2d    0        1
// normBuffer_texture                texture  float4          2d    1        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
// cbCubeAmbi                        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[39], immediateIndexed
dcl_constantbuffer cb2[82], immediateIndexed
dcl_constantbuffer cb6[8], immediateIndexed
dcl_constantbuffer cb5[1], immediateIndexed
dcl_sampler s10, mode_default
dcl_sampler s12, 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) 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 34
dcl_temps 36
dcl_resource_texture2d (float,float,float,float) t125
round_ni r0.xy, v0.xyxx
itof r0.zw, cb5[0].xxxy
mad r1.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
div r1.xy, r1.xyxx, r0.zwzz
sample_l_indexable(texture2d)(float,float,float,float) r2.xyz, r1.xyxx, t1.xyzw, s10, l(0.000000)
mul r3.xyzw, r2.yzzz, r2.xxyz
mul r1.z, r2.y, r2.y
mad r2.w, r2.x, r2.x, -r1.z
dp4 r4.x, r3.xyzw, cb6[0].xyzw
dp4 r4.y, r3.xyzw, cb6[2].xyzw
dp4 r4.z, r3.xyzw, cb6[4].xyzw
dp4 r3.x, r2.xyzw, cb6[1].xyzw
dp4 r3.y, r2.xyzw, cb6[3].xyzw
dp4 r3.z, r2.xyzw, cb6[5].xyzw
add r3.xyz, r3.xyzx, r4.xyzx
add r3.xyz, r3.xyzx, cb6[6].xyzx
max r3.xyz, r3.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mad r1.z, r2.z, l(0.500000), l(0.500000)
add r4.xyz, cb2[27].xyzx, -cb2[38].xyzx
mad r4.xyz, r1.zzzz, r4.xyzx, cb2[38].xyzx
add r3.xyz, r3.xyzx, r4.xyzx
ieq r1.z, cb7[0].x, l(0)
ult r1.w, l(1024), cb7[0].x
or r1.z, r1.w, r1.z
if_z r1.z
  add r1.zw, r0.xxxy, l(0.000000, 0.000000, 0.500000, 0.500000)
  mul r0.zw, r0.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000)
  div r0.xy, r0.xyxx, r0.zwzz
  sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t0.xyzw, s10
  mad r0.x, r0.x, cb2[20].x, cb2[20].y
  div r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
  mad r1.xy, r1.xyxx, cb2[18].xyxx, cb2[18].zwzz
  mul r0.xy, r0.zzzz, r1.xyxx

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


  mul r4.xyz, r2.yyyy, cb2[1].xyzx
  mad r4.xyz, r2.xxxx, cb2[0].xyzx, r4.xyzx
  mad r4.xyz, r2.zzzz, cb2[2].xyzx, r4.xyzx
  mul r0.w, cb6[7].x, l(3.14159274)
  mul r1.xy, r1.zwzz, l(0.125000, 0.125000, 0.000000, 0.000000)
  round_ni r1.xy, r1.xyxx
  utof r1.z, cb7[0].z
  mad r1.x, r1.y, r1.z, r1.x
  ftou r1.x, r1.x
  imul null, r1.y, cb7[0].w, cb7[0].z
  ishl r1.xy, r1.xyxx, l(1, 1, 0, 0)
  iadd r1.x, r1.x, r1.y
  mov r5.w, l(1.000000)
  mov r6.w, l(1.000000)
  mov r1.yzw, l(0,0,0,0)
  mov r9.xy, l(0,0,0,0)
  mov r3.w, l(0)
  mov r4.w, l(0)
  mov r7.xyzw, l(0,0,0,1.000000)
  mov r8.xyzw, l(0,0,0,0)
  loop 
    uge r9.z, r8.w, l(2)
    breakc_nz r9.z
    iadd r9.z, r1.x, r8.w
    ld_indexable(buffer)(uint,uint,uint,uint) r10.xyzw, r9.zzzz, t55.xyzw
    ushr r11.xyzw, r10.xyzw, l(30, 30, 30, 30)
    iadd r9.z, r11.y, r11.x
    iadd r9.z, r11.z, r9.z
    iadd r9.z, r11.w, r9.z
    mov r11.xyz, r1.yzwy
    mov r12.xyz, r7.xyzx
    mov r13.xyz, r8.xyzx
    mov r14.xw, r9.yyyx
    mov r14.y, r3.w
    mov r14.z, r4.w
    mov r9.w, r7.w
    mov r13.w, l(0)
    loop 
      uge r15.x, r13.w, r9.z
      breakc_nz r15.x
      ult r15.xyz, r13.wwww, l(3, 6, 9, 0)
      iadd r16.xyz, r13.wwww, l(-3, -6, -9, 0)
      movc r15.w, r15.z, r16.y, r16.z
      movc r15.w, r15.y, r16.x, r15.w
      movc r15.w, r15.x, r13.w, r15.w
      movc r15.z, r15.z, r10.z, r10.w
      movc r15.y, r15.y, r10.y, r15.z
      movc r15.x, r15.x, r10.x, r15.y
      imul null, r15.y, r15.w, l(10)
      ushr r15.x, r15.x, r15.y
      and r15.x, r15.x, l(1023)
      ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r15.y, r15.x, l(140), t54.xxxx
      mov r16.xyz, r11.xyzx
      mov r17.xyz, r12.xyzx
      mov r18.xyz, r13.xyzx
      mov r19.xyzw, r14.xyzw
      mov r15.z, r9.w
      mov r15.w, r13.w
      mov r18.w, r15.x
      mov r20.x, r15.y
      loop 
        ult r20.y, r15.w, r9.z
        ieq r20.zw, r20.xxxx, l(0, 0, 0, 1)
        or r20.z, r20.w, r20.z
        and r20.y, r20.z, r20.y
        breakc_z r20.y
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r21.xyzw, r18.w, l(0), t54.xyzw
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r22.xyz, r18.w, l(16), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r20.y, r18.w, l(32), t54.xxxx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r23.yz, r18.w, l(40), t54.xxyx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r24.xyzw, r18.w, l(60), t54.xyzw
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r25.xy, r18.w, l(100), t54.xyxx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r20.z, r18.w, l(332), t54.xxxx
        and r20.z, r20.z, l(3)
        add r21.xyz, r0.xyzx, -r21.xyzx
        dp3 r22.w, r21.xyzx, r22.xyzx
        max r22.w, r22.w, l(0.000000)
        min r21.w, r21.w, r22.w
        mad r22.xyz, -r21.wwww, r22.xyzx, r21.xyzx
        movc r21.xyz, r20.wwww, r22.xyzx, r21.xyzx
        dp3 r20.w, r21.xyzx, r21.xyzx
        sqrt r20.w, r20.w
        mad_sat r23.x, r20.w, r20.y, r23.y
        sample_l_indexable(texture2d)(float,float,float,float) r20.y, r23.xzxx, t44.xzyw, s13, l(0.000000)
        ine r20.w, r25.y, l(1)
        movc r20.y, r20.w, l(0), r20.y
        ine r20.w, r20.z, l(2)
        if_nz r20.w
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r20.w, r18.w, l(372), t54.xxxx
          mul r21.x, r20.y, r20.y
          mul r20.w, r20.w, r21.x
          ieq r21.xy, r20.zzzz, l(1, 3, 0, 0)
          mul r20.z, r0.w, r24.x
          itof r2.w, r25.x
          sample_l_indexable(texturecubearray)(float,float,float,float) r22.xyz, r2.xyzw, t57.xyzw, s12, l(4.000000)
          mul r22.xyz, r20.zzzz, r22.xyzx
          mul r5.xyz, r24.yzwy, r22.xyzx
          mad r22.xyz, r20.wwww, r5.xyzx, r18.xyzx
          mov r17.w, r19.z
          mad r23.xyzw, r20.wwww, r5.wxyz, r17.wxyz
          max r25.w, r19.w, r20.w
          mov r16.w, r19.x
          mad r26.xyzw, r20.wwww, r5.xyzw, r16.xyzw
          max r27.x, r19.y, r20.w
          mov r25.x, r16.w
          mov r25.z, r23.x
          mov r19.x, r26.w
          mov r19.z, r17.w
          movc r28.xzw, r21.xxxx, r25.xxzw, r19.xxzw
          mov r23.x, r19.y
          mov r27.yzw, r17.xxyz
          movc r27.xyzw, r21.xxxx, r23.xyzw, r27.xyzw
          or r2.w, r21.y, r21.x
          movc r16.xyz, r2.wwww, r16.xyzx, r26.xyzx
          movc r17.xyz, r21.yyyy, r17.xyzx, r27.yzwy
          movc r18.xyz, r21.yyyy, r22.xyzx, r18.xyzx
          mov r19.x, r25.x
          mov r19.y, r23.x
          mov r28.y, r27.x
          movc r19.xyzw, r21.yyyy, r19.xyzw, r28.xyzw
        else 
          add_sat r2.w, -r20.y, l(1.000000)
          mul r2.w, r2.w, r2.w
          add r5.x, -r24.x, l(1.000000)
          mad r2.w, r2.w, r5.x, r24.x
          mul r15.z, r2.w, r15.z
        endif 
        iadd r2.w, r15.w, l(1)
        ult r5.x, r2.w, r9.z
        if_nz r5.x
          ult r5.xyz, r2.wwww, l(3, 6, 9, 0)
          iadd r20.yzw, r15.wwww, l(0, -2, -5, -8)
          movc r16.w, r5.z, r20.z, r20.w
          movc r16.w, r5.y, r20.y, r16.w
          movc r16.w, r5.x, r2.w, r16.w
          movc r5.z, r5.z, r10.z, r10.w
          movc r5.y, r5.y, r10.y, r5.z
          movc r5.x, r5.x, r10.x, r5.y
          imul null, r5.y, r16.w, l(10)
          ushr r5.x, r5.x, r5.y
          and r18.w, r5.x, l(1023)
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r20.x, r18.w, l(140), t54.xxxx
        endif 
        mov r15.w, r2.w
      endloop 
      mov r11.xyz, r16.xyzx
      mov r12.xyz, r17.xyzx
      mov r13.xyz, r18.xyzx
      mov r14.xyzw, r19.xyzw
      mov r9.w, r15.z
      mov r2.w, r15.w
      mov r5.x, r18.w
      mov r5.y, r20.x
      loop 
        ult r5.z, r2.w, r9.z
        ieq r15.x, r5.y, l(4)
        and r5.z, r5.z, r15.x
        breakc_z r5.z
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r20.yzw, r5.x, l(0), t54.xxyz
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r21.xyz, r5.x, l(16), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r15.y, r5.x, l(44), t54.xxxx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r22.xyzw, r5.x, l(60), t54.xyzw
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r23.xyz, r5.x, l(96), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r24.xyz, r5.x, l(128), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r25.xyz, r5.x, l(144), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r26.xyz, r5.x, l(160), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r27.xyz, r5.x, l(176), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r28.xyzw, r5.x, l(320), t54.xyzw
        and r5.z, r28.w, l(3)
        add r20.yzw, r0.xxyz, -r20.yyzw
        dp3 r29.x, r20.yzwy, r24.xyzx
        dp3 r29.y, r20.yzwy, r21.xyzx
        dp3 r29.z, r20.yzwy, r25.xyzx
        mul r20.yzw, r26.xxyz, r27.xxyz
        mad r26.xyz, r27.xyzx, r26.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r26.xyz, r27.xyzx, r26.xyzx
        mul r27.xyz, r26.xyzx, r29.xyzx
        max r27.xyz, r27.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        min r27.xyz, r27.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        mul r30.yzw, r27.xxyz, r27.xxyz
        mad r16.w, -r27.x, r27.x, l(1.000000)
        mad r16.w, r30.w, r16.w, r30.y
        add r17.w, -r16.w, l(1.000000)
        mad_sat r16.w, r30.z, r17.w, r16.w
        sqrt r16.w, r16.w
        max r30.x, r30.y, l(0.000010)
        dp3 r17.w, r20.yzwy, r30.xzwx
        mad r20.y, r27.y, r27.y, r30.x
        mad r20.y, r27.z, r27.z, r20.y
        div r17.w, r17.w, r20.y
        add r20.y, r17.w, l(1.000000)
        mad_sat r15.x, r16.w, r20.y, -r17.w
        sample_l_indexable(texture2d)(float,float,float,float) r15.x, r15.xyxx, t44.zxyw, s13, l(0.000000)
        ine r15.y, r23.z, l(1)
        movc r15.x, r15.y, l(0), r15.x
        ine r15.y, r5.z, l(2)
        if_nz r15.y
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r20.yzw, r5.x, l(336), t54.xxyz
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r15.y, r5.x, l(372), t54.xxxx
          mul r16.w, r15.x, r15.x
          mul r15.y, r15.y, r16.w
          ieq r23.zw, r5.zzzz, l(0, 0, 1, 3)
          and r5.z, r28.w, l(4)
          add r27.xyz, -r20.yzwy, r29.xyzx
          mul r29.xyz, r28.xyzx, r27.xyzx
          dp3 r30.x, r4.xyzx, r24.xyzx
          dp3 r30.y, r4.xyzx, r21.xyzx
          dp3 r30.z, r4.xyzx, r25.xyzx
          mul r30.xyz, r28.xyzx, r30.xyzx
          ushr r31.xy, r23.xxxx, l(10, 20, 0, 0)
          and r31.zw, r23.xxxx, l(0, 0, 511, 512)
          ubfe r32.xy, l(9, 11, 0, 0), l(10, 20, 0, 0), r23.xxxx
          utof r33.x, r31.z
          utof r33.yz, r32.xxyx
          mul r32.xyz, r33.xyzx, l(0.00195694715, 0.00195694715, 0.000488519785, 0.000000)
          and r31.xy, r31.xyxx, l(512, 2048, 0, 0)
          movc r33.xyz, r31.wxyw, l(-1.000000,-1.000000,-1.000000,0), l(1.000000,1.000000,1.000000,0)
          mul r31.xyz, r32.xyzx, r33.xyzx
          div r26.xyz, r31.xyzx, r26.xyzx
          add r20.yzw, -r20.yyzw, r26.xxyz
          lt r26.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r30.xyzx
          lt r31.xyz, r30.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
          iadd r26.xyz, -r26.xyzx, r31.xyzx
          itof r26.xyz, r26.xyzx
          mad r26.xyz, -r27.xyzx, r28.xyzx, r26.xyzx
          div r26.xyz, r26.xyzx, r30.xyzx
          min r16.w, r26.z, r26.y
          min r16.w, r16.w, r26.x
          mad r26.xyz, r30.xyzx, r16.wwww, r29.xyzx
          mad r20.yzw, -r20.yyzw, r28.xxyz, r26.xxyz
          div r20.yzw, r20.yyzw, r28.xxyz
          mul r21.xyz, r20.zzzz, r21.xyzx
          mad r21.xyz, r24.xyzx, r20.yyyy, r21.xyzx
          mad r20.yzw, r25.xxyz, r20.wwww, r21.xxyz
          dp3 r21.x, r20.yzwy, cb2[0].xyzx
          dp3 r21.y, r20.yzwy, cb2[1].xyzx
          dp3 r21.z, r20.yzwy, cb2[2].xyzx
          movc r21.xyz, r5.zzzz, r21.xyzx, r2.xyzx
          mul r5.z, r0.w, r22.x
          itof r21.w, r23.y
          sample_l_indexable(texturecubearray)(float,float,float,float) r20.yzw, r21.xyzw, t57.wxyz, s12, l(4.000000)
          mul r20.yzw, r5.zzzz, r20.yyzw
          mul r6.xyz, r22.yzwy, r20.yzwy
          mad r20.yzw, r15.yyyy, r6.xxyz, r13.xxyz
          mov r12.w, r14.z
          mad r21.xyzw, r15.yyyy, r6.wxyz, r12.wxyz
          max r24.w, r14.w, r15.y
          mov r11.w, r14.x
          mad r25.xyzw, r15.yyyy, r6.xyzw, r11.xyzw
          max r26.x, r14.y, r15.y
          mov r24.x, r11.w
          mov r24.z, r21.x
          mov r14.x, r25.w
          mov r14.z, r12.w
          movc r27.xzw, r23.zzzz, r24.xxzw, r14.xxzw
          mov r21.x, r14.y
          mov r26.yzw, r12.xxyz
          movc r26.xyzw, r23.zzzz, r21.xyzw, r26.xyzw
          or r5.z, r23.w, r23.z
          movc r11.xyz, r5.zzzz, r11.xyzx, r25.xyzx
          movc r12.xyz, r23.wwww, r12.xyzx, r26.yzwy
          movc r13.xyz, r23.wwww, r20.yzwy, r13.xyzx
          mov r14.x, r24.x
          mov r14.y, r21.x
          mov r27.y, r26.x
          movc r14.xyzw, r23.wwww, r14.xyzw, r27.xyzw
        else 
          add_sat r5.z, -r15.x, l(1.000000)
          mul r5.z, r5.z, r5.z
          add r6.x, -r22.x, l(1.000000)
          mad r5.z, r5.z, r6.x, r22.x
          mul r9.w, r5.z, r9.w
        endif 
        iadd r5.z, r2.w, l(1)
        ult r6.x, r5.z, r9.z
        if_nz r6.x
          ult r6.xyz, r5.zzzz, l(3, 6, 9, 0)
          iadd r20.yzw, r2.wwww, l(0, -2, -5, -8)
          movc r11.w, r6.z, r20.z, r20.w
          movc r11.w, r6.y, r20.y, r11.w
          movc r11.w, r6.x, r5.z, r11.w
          movc r6.z, r6.z, r10.z, r10.w
          movc r6.y, r6.y, r10.y, r6.z
          movc r6.x, r6.x, r10.x, r6.y
          imul null, r6.y, r11.w, l(10)
          ushr r6.x, r6.x, r6.y
          and r5.x, r6.x, l(1023)
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r5.y, r5.x, l(140), t54.xxxx
        endif 
        mov r2.w, r5.z
      endloop 
      ine r6.xyz, r5.yyyy, l(0, 4, 1, 0)
      and r5.x, r6.y, r6.x
      and r5.x, r6.z, r5.x
      iadd r13.w, r2.w, -r5.x
    endloop 
    ult r5.x, r9.z, l(12)
    if_nz r5.x
      mov r1.yzw, r11.xxyz
      mov r7.xyz, r12.xyzx
      mov r8.xyz, r13.xyzx
      mov r9.xy, r14.wxww
      mov r3.w, r14.y
      mov r4.w, r14.z
      mov r7.w, r9.w
      break 
    endif 
    iadd r8.w, r8.w, l(1)
    mov r1.yzw, r11.xxyz
    mov r7.xyz, r12.xyzx
    mov r8.xyz, r13.xyzx
    mov r9.xy, r14.wxww
    mov r3.w, r14.y
    mov r4.w, r14.z
    mov r7.w, r9.w
  endloop 
  max r0.x, r4.w, l(1.192092896E-007)
  div r0.xyz, r7.xyzx, r0.xxxx
  mov_sat r9.x, r9.x
  add r0.xyz, -r3.xyzx, r0.xyzx
  mad r0.xyz, r9.xxxx, r0.xyzx, r3.xyzx
  max r0.w, r9.y, l(1.192092896E-007)
  div r1.xyz, r1.yzwy, r0.wwww
  mov_sat r3.w, r3.w
  add r1.xyz, -r0.xyzx, r1.xyzx
  mad r0.xyz, r3.wwww, r1.xyzx, r0.xyzx
  add r3.xyz, r8.xyzx, r0.xyzx
else 
  mov r7.w, l(1.000000)
endif 
mul o0.xyz, r3.xyzx, r7.wwww
mov o0.w, l(1.000000)
ret 
// Approximately 366 instruction slots used
