//73b755011bf01460-ps.txt
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.17672
//
//   using 3Dmigoto v1.2.27 on Thu Feb 04 21:50:06 2016
//
//
// Buffer Definitions: 
//
// cbuffer cbTiledLighting
// {
//
//   uint g_uNumNonDirectionalLights;   // Offset:    0 Size:     4
//   uint g_uNumDirectionalLights;      // Offset:    4 Size:     4
//   uint g_uNumTilesX;                 // Offset:    8 Size:     4
//   uint g_uNumTilesY;                 // Offset:   12 Size:     4 [unused]
//   row_major float4x4 g_mProjection;  // Offset:   16 Size:    64 [unused]
//   row_major float4x4 g_mInvProjection;// Offset:   80 Size:    64 [unused]
//
// }
//
// cbuffer DrawableBuffer
// {
//
//   float4 FogColor;                   // Offset:    0 Size:    16 [unused]
//   float4 DebugColor;                 // Offset:   16 Size:    16 [unused]
//   float AlphaThreshold;              // Offset:   32 Size:     4
//   float4 __InstancedMaterialOpacity[256];// Offset:   48 Size:  4096
//
// }
//
// 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 [unused]
//   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 [unused]
//   float __padding8;                  // Offset:  444 Size:     4 [unused]
//   float4 GlobalParams[16];           // Offset:  448 Size:   256 [unused]
//   float4 ViewToFogH;                 // Offset:  704 Size:    16 [unused]
//   float4 ScreenExtents;              // Offset:  720 Size:    16
//   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
//   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
//   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 MaterialBuffer
// {
//
//   float4 MaterialParams[512];        // Offset:    0 Size:  8192
//
// }
//
// 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
// SamplerGenericBilinearWrap        sampler      NA          NA   12        1
// SamplerGenericBilinearClamp       sampler      NA          NA   13        1
// SamplerGenericShadowCompare     sampler_c      NA          NA   14        1
// p_default_Material_n71_n112_661830C016465534_cp0_Param_texture    texture  float4          2d    0        1
// p_default_Material_n73_n82_Texture_texture    texture  float4          2d    1        1
// p_default_Setup_n5_n33_Texture_texture    texture  float4          2d    4        1
// GlobalModulationMapTextures[0]    texture  float4          2d   40        1
// ShadowMapSampler_texture          texture  float4          2d   43        1
// AttenuationSampler_texture        texture  float4          2d   44        1
// AmbientAccumulation_texture       texture  float4          2d   53        1
// LightDataBuffer                   texture  struct         r/o   54        1
// LightIndexBuffer                  texture   uint4         buf   55        1
// ModulationMaps                    texture  float4     2darray   56        1
// DirectionalShadow_texture         texture  float4          2d   58        1
// DrawableBuffer                    cbuffer      NA          NA    1        1
// SceneBuffer                       cbuffer      NA          NA    2        1
// MaterialBuffer                    cbuffer      NA          NA    3        1
// cbTiledLighting                   cbuffer      NA          NA    7        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy w
// COLOR                    0   xyzw        1     NONE   float   xyz 
// TEXCOORD                 0   xyzw        2     NONE   float   xy  
// TEXCOORD                 2   xyz         3     NONE   float   xyz 
// PSIZE                    0   x           4     NONE    uint   x   
// SV_IsFrontFace           0   x           5    FFACE    uint   x   
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
// SV_TARGET                1   x           1   TARGET   float   x   
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb7[1], immediateIndexed
dcl_constantbuffer cb1[259], dynamicIndexed
// dcl_constantbuffer cb2[72], immediateIndexed
dcl_constantbuffer cb2[82], immediateIndexed
dcl_constantbuffer cb3[6], immediateIndexed
dcl_sampler s10, mode_default
dcl_sampler s11, mode_default
dcl_sampler s12, mode_default
dcl_sampler s13, mode_default
dcl_sampler s14, mode_comparison
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t40
dcl_resource_texture2d (float,float,float,float) t43
dcl_resource_texture2d (float,float,float,float) t44
dcl_resource_texture2d (float,float,float,float) t53
dcl_resource_structured t54, 384 
dcl_resource_buffer (uint,uint,uint,uint) t55
dcl_resource_texture2darray (float,float,float,float) t56
dcl_resource_texture2d (float,float,float,float) t58
dcl_input_ps_siv linear noperspective v0.xyw, position
dcl_input_ps linear v1.xyz
dcl_input_ps linear v2.xy
dcl_input_ps linear v3.xyz
dcl_input_ps constant v4.x
dcl_input_ps_sgv v5.x, is_front_face
dcl_output o0.xyzw
dcl_output o1.x
// dcl_temps 22
dcl_temps 24
dcl_resource_texture2d (float,float,float,float) t125
movc r0.xyz, v5.xxxx, v3.xyzx, -v3.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
movc r1.xyz, v5.xxxx, cb3[1].xyzx, cb3[0].xyzx
mul r2.xy, v2.xyxx, cb3[3].zwzz
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.xyxx, t4.xyzw, s11
mul r1.xyz, r1.xyzx, r2.xyzx
mul r1.xyz, r1.xyzx, v1.xyzx
mad r2.xy, v0.xyxx, cb2[45].zwzz, cb2[45].xyxx
mad r3.xy, r2.xyxx, cb2[18].xyxx, cb2[18].zwzz
mul r3.xy, r3.xyxx, v0.wwww

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


sample_l_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t58.yzwx, s13, l(0.000000)
mov r3.z, v0.w
mov r3.w, l(1.000000)
mov r4.xy, r3.xyxx
mov r4.z, v0.w
mov r4.w, l(1.000000)
mov r5.xyz, l(0,0,0,0)
mov r1.w, l(0)
loop 
  uge r2.z, r1.w, cb7[0].y
  breakc_nz r2.z
  iadd r2.z, r1.w, cb7[0].x
  ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r6.xyz, r2.z, l(16), t54.xyzx
  ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r7.xyz, r2.z, l(64), t54.xyzx
  ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r5.w, r2.z, l(156), t54.xxxx
  ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r6.w, r2.z, l(172), t54.xxxx
  ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r8.xyzw, r2.z, l(252), t54.yzwx
  dp3 r9.x, -r6.xyzx, cb2[0].xyzx
  dp3 r9.y, -r6.xyzx, cb2[1].xyzx
  dp3 r9.z, -r6.xyzx, cb2[2].xyzx
  if_nz r5.w
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r10.x, r2.z, l(204), t54.xxxx
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r10.y, r2.z, l(220), t54.xxxx
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r10.z, r2.z, l(236), t54.xxxx
    mov r10.w, r8.w
    dp4 r5.w, r3.xyzw, r10.xyzw
    add r5.w, -r5.w, cb2[53].x
    lt r5.w, l(0.000000), r5.w
    movc r5.w, r5.w, r0.w, l(1.000000)
  else 
    mov r5.w, l(1.000000)
  endif 
  if_nz r6.w
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r6.xyzw, r2.z, l(268), t54.yzwx
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r10.xyzw, r2.z, l(284), t54.xyzw
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r11.w, r2.z, l(300), t54.xxxx
    mov r8.w, r6.w
    dp4 r2.z, r8.xyzw, r4.xyzw
    mov r6.w, r10.x
    dp4 r6.x, r6.xyzw, r4.xyzw
    mov r11.xyz, r10.yzwy
    dp4 r6.y, r11.xyzw, r4.xyzw
    div r8.x, r2.z, r6.y
    div r8.y, r6.x, r6.y
    sample_l_indexable(texture2d)(float,float,float,float) r6.xyz, r8.xyxx, t40.xyzw, s12, l(0.000000)
  else 
    mov r6.xyz, l(1.000000,1.000000,1.000000,0)
  endif 
  dp3 r2.z, r9.xyzx, r0.xyzx
  mov_sat r6.w, r2.z
  mul r7.xyz, r7.xyzx, r5.wwww
  mul r7.xyz, r6.wwww, r7.xyzx
  mul_sat r2.z, r2.z, l(4.000000)
  mul r7.xyz, r2.zzzz, r7.xyzx
  mad r5.xyz, r7.xyzx, r6.xyzx, r5.xyzx
  iadd r1.w, r1.w, l(1)
endloop 
if_nz cb7[0].x
  mul r3.xy, v0.xyxx, l(0.062500, 0.062500, 0.000000, 0.000000)
  round_ni r3.xy, r3.xyxx
  utof r0.w, cb7[0].z
  mad r0.w, r3.y, r0.w, r3.x
  ftou r0.w, r0.w
  ishl r0.w, r0.w, l(1)
  mov r4.z, v0.w
  dp3 r1.w, r4.xyzx, r4.xyzx
  sqrt r1.w, r1.w
  mov r4.w, l(1.000000)
  mov r3.xyz, r4.xyzx
  mov r3.w, l(1.000000)
  mov r6.xyz, r5.xyzx
  mov r2.z, l(0)
  loop 
    uge r5.w, r2.z, l(2)
    breakc_nz r5.w
    iadd r5.w, r0.w, r2.z
    ld_indexable(buffer)(uint,uint,uint,uint) r7.xyzw, r5.wwww, t55.xyzw
    ushr r8.xyzw, r7.xyzw, l(30, 30, 30, 30)
    iadd r5.w, r8.y, r8.x
    iadd r5.w, r8.z, r5.w
    iadd r5.w, r8.w, r5.w
    mov r8.xyz, r6.xyzx
    mov r6.w, l(0)
    loop 
      uge r8.w, r6.w, r5.w
      breakc_nz r8.w
      ult r9.xyz, r6.wwww, l(3, 6, 9, 0)
      iadd r10.xyz, r6.wwww, l(-3, -6, -9, 0)
      movc r8.w, r9.z, r10.y, r10.z
      movc r8.w, r9.y, r10.x, r8.w
      movc r8.w, r9.x, r6.w, r8.w
      movc r9.z, r9.z, r7.z, r7.w
      movc r9.y, r9.y, r7.y, r9.z
      movc r9.x, r9.x, r7.x, r9.y
      imul null, r8.w, r8.w, l(10)
      ushr r8.w, r9.x, r8.w
      and r8.w, r8.w, l(1023)
      ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r9.x, r8.w, l(140), t54.xxxx
      mov r9.yzw, r8.xxyz
      mov r10.x, r6.w
      mov r10.y, r8.w
      mov r10.z, r9.x
      loop 
        ult r10.w, r10.x, r5.w
        ieq r11.xy, r10.zzzz, l(0, 1, 0, 0)
        or r11.x, r11.y, r11.x
        and r10.w, r10.w, r11.x
        breakc_z r10.w
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r11.xzw, r10.y, l(0), t54.xxyz
        if_nz r11.y
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r12.xyzw, r10.y, l(12), t54.xyzw
          add r13.xyz, r3.xyzx, -r11.xzwx
          dp3 r10.w, r13.xyzx, r12.yzwy
          max r10.w, r10.w, l(0.000000)
          min r10.w, r12.x, r10.w
          mad r11.xzw, r10.wwww, r12.yyzw, r11.xxzw
        endif 
        add r11.xyz, -r4.xyzx, r11.xzwx
        dp3 r10.w, r11.xyzx, r11.xyzx
        sqrt r10.w, r10.w
        div r11.xyz, r11.xyzx, r10.wwww
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r12.xyz, r10.y, l(64), t54.xyzx
        dp3 r13.x, r11.xyzx, cb2[0].xyzx
        dp3 r13.y, r11.xyzx, cb2[1].xyzx
        dp3 r13.z, r11.xyzx, cb2[2].xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r11.x, r10.y, l(32), t54.xxxx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r14.yz, r10.y, l(40), t54.xxyx
        mad_sat r14.x, r10.w, r11.x, r14.y
        sample_l_indexable(texture2d)(float,float,float,float) r10.w, r14.xzxx, t44.xywz, s13, l(0.000000)
        dp3 r11.x, r13.xyzx, r0.xyzx
        mov_sat r11.y, r11.x
        mul r12.xyz, r12.xyzx, r10.wwww
        mul r11.yzw, r11.yyyy, r12.xxyz
        mul_sat r10.w, r11.x, l(4.000000)
        mad r9.yzw, r11.yyzw, r10.wwww, r9.yyzw
        iadd r10.w, r10.x, l(1)
        ult r11.x, r10.w, r5.w
        if_nz r11.x
          ult r11.xyz, r10.wwww, l(3, 6, 9, 0)
          iadd r12.xyz, r10.xxxx, l(-2, -5, -8, 0)
          movc r11.w, r11.z, r12.y, r12.z
          movc r11.w, r11.y, r12.x, r11.w
          movc r11.w, r11.x, r10.w, r11.w
          movc r11.z, r11.z, r7.z, r7.w
          movc r11.y, r11.y, r7.y, r11.z
          movc r11.x, r11.x, r7.x, r11.y
          imul null, r11.y, r11.w, l(10)
          ushr r11.x, r11.x, r11.y
          and r10.y, r11.x, l(1023)
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r10.z, r10.y, l(140), t54.xxxx
        endif 
        mov r10.xyz, r10.wyzw
      endloop 
      mov r11.xyz, r9.yzwy
      mov r8.w, r10.x
      mov r9.x, r10.y
      mov r10.w, r10.z
      loop 
        ult r11.w, r8.w, r5.w
        ieq r12.xy, r10.wwww, l(2, 3, 0, 0)
        or r12.x, r12.y, r12.x
        and r11.w, r11.w, r12.x
        breakc_z r11.w
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r12.xzw, r9.x, l(16), t54.xxyz
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r13.xyz, r9.x, l(0), t54.xyzx
        if_nz r12.y
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r14.xyz, r9.x, l(128), t54.xyzx
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r11.w, r9.x, l(12), t54.xxxx
          add r15.xyz, r3.xyzx, -r13.xyzx
          dp3 r12.y, r15.xyzx, r14.xyzx
          max r12.y, r12.y, l(0.000000)
          min r11.w, r11.w, r12.y
          mad r13.xyz, r11.wwww, r14.xyzx, r13.xyzx
        endif 
        add r13.xyz, -r4.xyzx, r13.xyzx
        dp3 r11.w, r13.xyzx, r13.xyzx
        sqrt r11.w, r11.w
        div r13.xyz, r13.xyzx, r11.wwww
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r14.xyz, r9.x, l(64), t54.xyzx
        dp3 r15.x, r13.xyzx, cb2[0].xyzx
        dp3 r15.y, r13.xyzx, cb2[1].xyzx
        dp3 r15.z, r13.xyzx, cb2[2].xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r16.xyz, r9.x, l(32), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r17.xyzw, r9.x, l(44), t54.xyzw
        mov r16.w, r17.x
        mad r16.xy, r11.wwww, r16.xyxx, r16.zwzz
        dp3 r12.x, r13.xyzx, -r12.xzwx
        mad_sat r12.y, r12.x, r17.y, r17.z
        mul r12.z, r12.y, r12.y
        mad r12.y, -r12.y, l(2.000000), l(3.000000)
        mul r12.y, r12.y, r12.z
        mul r12.y, r12.y, r12.y
        mul r11.w, r11.w, r12.x
        lt r11.w, r11.w, r17.w
        movc r11.w, r11.w, l(0), r12.y
        sample_l_indexable(texture2d)(float,float,float,float) r12.x, r16.xyxx, t44.zxyw, s13, l(0.000000)
        mul r11.w, r11.w, r12.x
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r12.x, r9.x, l(172), t54.xxxx
        if_nz r12.x
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r12.x, r9.x, l(188), t54.xxxx
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r13.xyzw, r9.x, l(256), t54.xyzw
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r16.xyzw, r9.x, l(272), t54.xyzw
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r17.xyzw, r9.x, l(288), t54.xyzw
          dp4 r12.y, r13.xyzw, r4.xyzw
          dp4 r12.z, r16.xyzw, r4.xyzw
          dp4 r12.w, r17.xyzw, r4.xyzw
          div r13.xy, r12.yzyy, r12.wwww
          utof r13.z, r12.x
          sample_l_indexable(texture2darray)(float,float,float,float) r12.xyz, r13.xyzx, t56.xyzw, s12, l(0.000000)
        else 
          mov r12.xyz, l(1.000000,1.000000,1.000000,0)
        endif 
        dp3 r12.w, r12.xyzx, r12.xyzx
        mul r12.w, r11.w, r12.w
        lt r12.w, cb2[24].w, r12.w
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r13.x, r9.x, l(156), t54.xxxx
        ine r13.x, r13.x, l(0)
        and r12.w, r12.w, r13.x
        if_nz r12.w
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r13.xyzw, r9.x, l(192), t54.xyzw
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r16.xyzw, r9.x, l(208), t54.xyzw
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r17.xyzw, r9.x, l(224), t54.xyzw
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r18.xyzw, r9.x, l(240), t54.xyzw
          mov r19.x, r13.x
          mov r19.y, r16.x
          mov r19.z, r17.x
          mov r19.w, r18.x
          dp4 r19.x, r3.xyzw, r19.xyzw
          mov r20.x, r13.y
          mov r20.y, r16.y
          mov r20.z, r17.y
          mov r20.w, r18.y
          dp4 r19.y, r3.xyzw, r20.xyzw
          mov r20.x, r13.z
          mov r20.y, r16.z
          mov r20.z, r17.z
          mov r20.w, r18.z
          dp4 r12.w, r3.xyzw, r20.xyzw
          mov r18.x, r13.w
          mov r18.y, r16.w
          mov r18.z, r17.w
          dp4 r13.x, r3.xyzw, r18.xyzw
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r16.xyzw, r9.x, l(80), t54.xyzw
          mad_sat r13.yz, r1.wwww, r16.xxyx, r16.zzwz
          div r16.xyzw, r19.xyxy, r13.xxxx
          mad r17.xyzw, cb2[71].zwzw, l(-0.500000, 0.500000, 0.500000, 0.500000), r16.zwzw
          sample_c_lz_indexable(texture2d)(float,float,float,float) r13.x, r17.xyxx, t43.xxxx, s14, r12.w
          sample_c_lz_indexable(texture2d)(float,float,float,float) r13.w, r17.zwzz, t43.xxxx, s14, r12.w
          add r13.x, r13.w, r13.x
          mad r16.xyzw, cb2[71].zwzw, l(-0.500000, -0.500000, 0.500000, -0.500000), r16.xyzw
          sample_c_lz_indexable(texture2d)(float,float,float,float) r13.w, r16.xyxx, t43.xxxx, s14, r12.w
          add r13.x, r13.w, r13.x
          sample_c_lz_indexable(texture2d)(float,float,float,float) r12.w, r16.zwzz, t43.xxxx, s14, r12.w
          add r12.w, r12.w, r13.x
          mul r12.w, r12.w, l(0.250000)
          mad r12.w, r12.w, r13.y, r13.z
        else 
          mov r12.w, l(1.000000)
        endif 
        dp3 r13.x, r15.xyzx, r0.xyzx
        mov_sat r13.y, r13.x
        mul r11.w, r11.w, r12.w
        mul r14.xyz, r14.xyzx, r11.wwww
        mul r13.yzw, r13.yyyy, r14.xxyz
        mul_sat r11.w, r13.x, l(4.000000)
        mul r13.xyz, r11.wwww, r13.yzwy
        mad r11.xyz, r13.xyzx, r12.xyzx, r11.xyzx
        iadd r11.w, r8.w, l(1)
        ult r12.x, r11.w, r5.w
        if_nz r12.x
          ult r12.xyz, r11.wwww, l(3, 6, 9, 0)
          iadd r13.xyz, r8.wwww, l(-2, -5, -8, 0)
          movc r12.w, r12.z, r13.y, r13.z
          movc r12.w, r12.y, r13.x, r12.w
          movc r12.w, r12.x, r11.w, r12.w
          movc r12.z, r12.z, r7.z, r7.w
          movc r12.y, r12.y, r7.y, r12.z
          movc r12.x, r12.x, r7.x, r12.y
          imul null, r12.y, r12.w, l(10)
          ushr r12.x, r12.x, r12.y
          and r9.x, r12.x, l(1023)
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r10.w, r9.x, l(140), t54.xxxx
        endif 
        mov r8.w, r11.w
      endloop 
      mov r8.xyz, r11.xyzx
      mov r11.w, r8.w
      mov r12.x, r9.x
      mov r12.y, r10.w
      loop 
        ult r12.z, r11.w, r5.w
        ieq r12.w, r12.y, l(4)
        and r12.z, r12.w, r12.z
        breakc_z r12.z
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r13.xyz, r12.x, l(0), t54.xyzx
        add r13.xyz, -r4.xyzx, r13.xyzx
        dp3 r12.z, r13.xyzx, r13.xyzx
        sqrt r12.z, r12.z
        div r14.xyz, r13.xyzx, r12.zzzz
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r15.xyz, r12.x, l(64), t54.xyzx
        dp3 r16.x, r14.xyzx, cb2[0].xyzx
        dp3 r16.y, r14.xyzx, cb2[1].xyzx
        dp3 r16.z, r14.xyzx, cb2[2].xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r14.xyz, r12.x, l(16), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r17.y, r12.x, l(44), t54.xxxx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r18.xyz, r12.x, l(128), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r19.xyz, r12.x, l(144), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r20.xyz, r12.x, l(160), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r21.xyz, r12.x, l(176), t54.xyzx
        dp3 r18.x, r13.xyzx, r18.xyzx
        dp3 r18.y, r13.xyzx, r14.xyzx
        dp3 r18.z, r13.xyzx, r19.xyzx
        add r13.xyz, -r20.xyzx, |r18.xyzx|
        mul_sat r13.xyz, r21.xyzx, r13.xyzx
        max r12.z, r13.y, r13.x
        max r17.x, r13.z, r12.z
        sample_l_indexable(texture2d)(float,float,float,float) r12.z, r17.xyxx, t44.xyzw, s13, l(0.000000)
        dp3 r12.w, r16.xyzx, r0.xyzx
        mov_sat r13.x, r12.w
        mul r13.yzw, r15.xxyz, r12.zzzz
        mul r13.xyz, r13.yzwy, r13.xxxx
        mul_sat r12.z, r12.w, l(4.000000)
        mad r8.xyz, r13.xyzx, r12.zzzz, r8.xyzx
        iadd r12.z, r11.w, l(1)
        ult r12.w, r12.z, r5.w
        if_nz r12.w
          ult r13.xyz, r12.zzzz, l(3, 6, 9, 0)
          iadd r14.xyz, r11.wwww, l(-2, -5, -8, 0)
          movc r12.w, r13.z, r14.y, r14.z
          movc r12.w, r13.y, r14.x, r12.w
          movc r12.w, r13.x, r12.z, r12.w
          movc r13.z, r13.z, r7.z, r7.w
          movc r13.y, r13.y, r7.y, r13.z
          movc r13.x, r13.x, r7.x, r13.y
          imul null, r12.w, r12.w, l(10)
          ushr r12.w, r13.x, r12.w
          and r12.x, r12.w, l(1023)
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r12.y, r12.x, l(140), t54.xxxx
        endif 
        mov r11.w, r12.z
      endloop 
      uge r12.x, r12.y, l(5)
      iadd r6.w, r11.w, -r12.x
    endloop 
    ult r5.w, r5.w, l(12)
    if_nz r5.w
      mov r6.xyz, r8.xyzx
      break 
    endif 
    iadd r2.z, r2.z, l(1)
    mov r6.xyz, r8.xyzx
  endloop 
  mov r5.xyz, r6.xyzx
endif 
mul r0.xy, v0.xyxx, l(0.250000, 0.250000, 0.000000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t1.xyzw, s11
mov r0.y, v4.x
mad r0.x, r0.x, cb1[r0.y + 3].y, cb1[r0.y + 3].z
sample_indexable(texture2d)(float,float,float,float) r0.y, r2.xyxx, t0.yxzw, s10
add r0.z, cb3[4].w, cb3[5].x
add_sat r0.z, -r0.z, l(1.000000)
mul r0.w, r0.y, r0.y
mad r0.y, cb3[4].w, r0.y, r0.z
mad_sat r0.y, r0.w, cb3[5].x, r0.y
add r2.xyz, -cb3[2].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mad_sat r0.yzw, r0.yyyy, r2.xxyz, cb3[2].xxyz
ftoi r3.xy, v0.xyxx
mov r3.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r2.xyz, r3.xyzw, t53.xyzw
add r2.xyz, r5.xyzx, r2.xyzx
mul r0.yzw, r0.yyzw, r2.xxyz
mul o0.xyz, r1.xyzx, r0.yzwy
add r0.y, r2.w, -cb1[2].x
min r0.x, r0.x, r0.y
lt r0.x, r0.x, l(0.000000)
discard_nz r0.x
mov o0.w, r2.w
mov o1.x, l(0)
ret 
// Approximately 391 instruction slots used
