//1a41d4604cc055ec-ps.txt
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.17672
//
//   using 3Dmigoto v1.2.27 on Thu Feb 04 21:55:56 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
//   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
//   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_n86_n127_661830C016465534_cp0_Param_texture    texture  float4          2d    0        1
// p_default_Material_n88_n97_Texture_texture    texture  float4          2d    1        1
// p_default_Setup_n29_Texture_texture    texture  float4          2d    2        1
// p_default_Setup_n5_n47_Texture_texture    texture  float4          2d    3        1
// p_default_Setup_n13_Texture_texture    texture  float4          2d    5        1
// p_default_Setup_n0_Texture_texture    texture  float4          2d    6        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[95], immediateIndexed
dcl_constantbuffer cb3[7], 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) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
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 26
dcl_temps 28
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
mad r1.xy, v0.xyxx, cb2[45].zwzz, cb2[45].xyxx
deriv_rty_fine r2.xy, v2.xyxx
deriv_rtx_fine r1.zw, v2.xxxy
mul r3.xy, r1.xyxx, v0.wwww
mov r3.z, v0.w
mov r3.w, l(1.000000)
dp4 r0.w, cb2[15].xyzw, r3.xyzw
dp4 r2.w, cb2[16].xyzw, r3.xyzw
dp4 r4.x, cb2[17].xyzw, r3.xyzw
deriv_rty_fine r5.x, r0.w
deriv_rty_fine r5.y, r2.w
deriv_rty_fine r5.z, r4.x
deriv_rtx_fine r6.z, r0.w
deriv_rtx_fine r6.x, r2.w
deriv_rtx_fine r6.y, r4.x
sample_indexable(texture2d)(float,float,float,float) r0.w, v2.xyxx, t6.yzwx, s11
mul r4.xy, v2.xyxx, cb3[4].xyxx
sample_indexable(texture2d)(float,float,float,float) r4.xy, r4.xyxx, t5.xyzw, s11
mad r4.xy, r4.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r2.w, r4.xyxx, r4.xyxx
add r2.w, -r2.w, l(1.000000)
max r2.w, r2.w, l(0.000000)
sqrt r7.z, r2.w
movc r8.xyz, v5.xxxx, cb3[1].xyzx, cb3[0].xyzx
mul r9.xyzw, v2.xyxy, cb3[3].xyzw
sample_indexable(texture2d)(float,float,float,float) r10.xyzw, r9.xyxx, t3.xyzw, s11
mul r8.xyz, r8.xyzx, r10.xyzx
mad r4.zw, cb2[24].xxxx, cb3[2].xxxy, r9.zzzw
mul r8.xyz, r8.xyzx, v1.xyzx
mul r7.xy, r4.xyxx, cb3[4].wwww
sample_indexable(texture2d)(float,float,float,float) r4.xy, r4.zwzz, t2.xyzw, s11
mad r4.xy, r4.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp3 r2.w, r6.zxyz, r0.xyzx
mad r6.xyz, -r2.wwww, r0.yzxy, r6.xyzx
dp3 r2.w, r5.xyzx, r0.xyzx
mad r5.xyz, -r2.wwww, r0.xyzx, r5.xyzx
mul r2.x, r2.x, r1.w
mad r1.z, r1.z, r2.y, -r2.x
lt r2.x, r1.z, l(0.000000)
movc r2.x, r2.x, l(-1.000000), l(1.000000)
mov r2.z, -r1.w
mul r2.yz, r2.yyzy, r2.xxxx
mul r9.xyz, r2.zzzz, r5.xyzx
mad r2.yzw, r6.zzxy, r2.yyyy, r9.xxyz
lt r1.z, l(0.000000), |r1.z|
dp3 r1.w, r2.yzwy, r2.yzwy
rsq r1.w, r1.w
mul r9.xyz, r1.wwww, r2.yzwy
movc r2.yzw, r1.zzzz, r9.xxyz, r2.yyzw
mul r9.xyz, r0.zxyz, r2.zwyz
mad r9.xyz, r0.yzxy, r2.wyzw, -r9.xyzx
mul r10.xyz, r0.zxyz, r6.xyzx
mad r6.xyz, r0.yzxy, r6.yzxy, -r10.xyzx
dp3 r1.z, r5.xyzx, r6.xyzx
lt r1.z, r1.z, l(0.000000)
movc r1.z, r1.z, l(-1.000000), l(1.000000)
mul r1.z, r1.z, r2.x
mul r5.xyz, r1.zzzz, r9.xyzx
mul r4.xy, r4.xyxx, cb3[4].zzzz
mov r4.z, l(0)
add r4.xyz, r4.xyzx, r7.xyzx
dp3 r1.z, r4.xyzx, r4.xyzx
rsq r1.z, r1.z
mul r4.xyz, r1.zzzz, r4.xyzx
mul r5.xyz, r5.xyzx, r4.yyyy
mad r2.xyz, r4.xxxx, r2.yzwy, r5.xyzx
mad r2.xyz, r4.zzzz, r0.xyzx, r2.xyzx
dp3 r1.z, r2.xyzx, r2.xyzx
rsq r1.z, r1.z
mul r2.xyz, r1.zzzz, r2.xyzx
mad r1.zw, r1.xxxy, cb2[18].xxxy, cb2[18].zzzw
mul r3.xy, r1.zwzz, v0.wwww

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


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