//3ba7ca837c12e186-ps.txt
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.17672
//
//   using 3Dmigoto v1.2.27 on Fri Jan 29 08:59:24 2016
//
//
// Buffer Definitions: 
//
// 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 [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
//   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 [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
//   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 MaterialBuffer
// {
//
//   float4 MaterialParams[512];        // Offset:    0 Size:  8192
//
// }
//
// cbuffer LightBuffer
// {
//
//   struct Light
//   {
//       
//       float4 position;               // Offset:    0
//       float3 direction;              // Offset:   16
//       float4 attParams;              // Offset:   32
//       float4 spotParams;             // Offset:   48
//       float4 diffuseColor;           // Offset:   64
//       float4 shadowFadeParams;       // Offset:   80
//
//   } ShadowLights[3];                 // Offset:    0 Size:   288 [unused]
//   
//   struct Light
//   {
//       
//       float4 position;               // Offset:  288
//       float3 direction;              // Offset:  304
//       float4 attParams;              // Offset:  320
//       float4 spotParams;             // Offset:  336
//       float4 diffuseColor;           // Offset:  352
//       float4 shadowFadeParams;       // Offset:  368
//
//   } NonShadowLights[3];              // Offset:  288 Size:   288 [unused]
//   
//   struct Light
//   {
//       
//       float4 position;               // Offset:  576
//       float3 direction;              // Offset:  592
//       float4 attParams;              // Offset:  608
//       float4 spotParams;             // Offset:  624
//       float4 diffuseColor;           // Offset:  640
//       float4 shadowFadeParams;       // Offset:  656
//
//   } SunLight;                        // Offset:  576 Size:    96 [unused]
//   row_major float4x4 WorldToShadowMap[3];// Offset:  672 Size:   192 [unused]
//   row_major float3x4 WorldToModulationMapSpot[2];// Offset:  864 Size:    96 [unused]
//   row_major float2x4 WorldToModulationMapSun;// Offset:  960 Size:    32 [unused]
//   bool ShadowLightEnabled[3];        // Offset:  992 Size:    36 [unused]
//   bool NonShadowLightEnabled[3];     // Offset: 1040 Size:    36 [unused]
//   bool SunLightEnabled;              // Offset: 1088 Size:     4 [unused]
//   float4 LightAndProbeSet[24];       // Offset: 1104 Size:   384
//   float4 LightSetInfo;               // Offset: 1488 Size:    16 [unused]
//   float4 ProbeSetInfo;               // Offset: 1504 Size:    16
//
// }
//
// 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
//
// }
//
// 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
// ------------------------------ ---------- ------- ----------- ---- --------
// SamplerGenericTrilinearWrap       sampler      NA          NA   11        1
// SamplerGenericBilinearWrap        sampler      NA          NA   12        1
// SamplerGenericBilinearClamp       sampler      NA          NA   13        1
// p_default_Material_n127_n141_19B9FD0C15847118_Param_texture    texture  float4          2d    0        1
// p_default_Material_n127_n153_Texture_texture    texture  float4        cube    1        1
// p_default_Setup_n6_n71_Texture_texture    texture  float4          2d    2        1
// p_default_Setup_n6_n60_Texture_texture    texture  float4          2d    3        1
// p_default_Setup_n6_n61_Texture_texture    texture  float4          2d    4        1
// p_default_Setup_n6_n66_Texture_texture    texture  float4          2d    5        1
// p_default_Setup_n6_n67_Texture_texture    texture  float4          2d    6        1
// p_default_Setup_n8_n51_Texture_texture    texture  float4          2d    7        1
// AttenuationSampler_texture        texture  float4          2d   44        1
// LightDataBuffer                   texture  struct         r/o   54        1
// ReflCubeMaps                      texture  float4   cubearray   57        1
// DrawableBuffer                    cbuffer      NA          NA    1        1
// SceneBuffer                       cbuffer      NA          NA    2        1
// MaterialBuffer                    cbuffer      NA          NA    3        1
// LightBuffer                       cbuffer      NA          NA    4        1
// IrradianceBuffer                  cbuffer      NA          NA    6        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy w
// TEXCOORD                 0   xyzw        1     NONE   float   xy  
// TEXCOORD                 2   xyz         2     NONE   float   xyz 
// TEXCOORD                 3   xyz         3     NONE   float   xyz 
// TEXCOORD                 4   xyz         4     NONE   float   xyz 
// PSIZE                    0   x           5     NONE    uint       
//
//
// 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 cb1[3], immediateIndexed
// dcl_constantbuffer cb2[46], immediateIndexed
dcl_constantbuffer cb2[82], immediateIndexed
dcl_constantbuffer cb3[9], immediateIndexed
dcl_constantbuffer cb4[95], dynamicIndexed
dcl_constantbuffer cb6[8], immediateIndexed
dcl_sampler s11, mode_default
dcl_sampler s12, mode_default
dcl_sampler s13, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texturecube (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) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2d (float,float,float,float) t44
dcl_resource_structured t54, 384 
dcl_resource_texturecubearray (float,float,float,float) t57
dcl_input_ps_siv linear noperspective v0.xyw, position
dcl_input_ps linear v1.xy
dcl_input_ps linear v2.xyz
dcl_input_ps linear v3.xyz
dcl_input_ps linear v4.xyz
dcl_output o0.xyzw
// dcl_temps 25
dcl_temps 27
dcl_resource_texture2d (float,float,float,float) t125
dp3 r0.x, v2.xyzx, v2.xyzx
rsq r0.x, r0.x
mul r0.yzw, r0.xxxx, v2.xxyz
mad r1.xy, v0.xyxx, cb2[45].zwzz, cb2[45].xyxx
mad r1.zw, r1.xxxy, cb2[18].xxxy, cb2[18].zzzw
mul r2.xy, r1.zwzz, v0.wwww
mov r2.z, v0.w

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


dp3 r1.z, -r2.xyzx, -r2.xyzx
rsq r1.z, r1.z
mul r3.xyz, r1.zzzz, -r2.xyzx
dp3 r4.x, r3.xyzx, cb2[0].xyzx
dp3 r4.y, r3.xyzx, cb2[1].xyzx
dp3 r4.z, r3.xyzx, cb2[2].xyzx
deriv_rty_fine r3.xy, v1.xyxx
deriv_rtx_fine r1.zw, v1.xxxy
mul r5.xy, r1.xyxx, v0.wwww
mov r5.z, v0.w
mov r5.w, l(1.000000)
dp4 r2.w, cb2[15].xyzw, r5.xyzw
dp4 r3.w, cb2[16].xyzw, r5.xyzw
dp4 r4.w, cb2[17].xyzw, r5.xyzw
deriv_rty_fine r6.x, r2.w
deriv_rty_fine r6.y, r3.w
deriv_rty_fine r6.z, r4.w
deriv_rtx_fine r7.z, r2.w
deriv_rtx_fine r7.x, r3.w
deriv_rtx_fine r7.y, r4.w
dp3 r2.w, r7.zxyz, r0.yzwy
mad r7.xyz, -r2.wwww, r0.zwyz, r7.xyzx
dp3 r2.w, r6.xyzx, r0.yzwy
mad r6.xyz, -r2.wwww, r0.yzwy, r6.xyzx
mul r2.w, r3.x, r1.w
mad r1.z, r1.z, r3.y, -r2.w
lt r2.w, r1.z, l(0.000000)
movc r2.w, r2.w, l(-1.000000), l(1.000000)
mov r3.z, -r1.w
mul r3.xy, r2.wwww, r3.yzyy
mul r3.yzw, r3.yyyy, r6.xxyz
mad r3.xyz, r7.zxyz, r3.xxxx, r3.yzwy
lt r1.z, l(0.000000), |r1.z|
dp3 r1.w, r3.xyzx, r3.xyzx
rsq r1.w, r1.w
mul r8.xyz, r1.wwww, r3.xyzx
movc r3.xyz, r1.zzzz, r8.xyzx, r3.xyzx
mul r8.xyz, r0.wyzw, r3.yzxy
mad r8.xyz, r0.zwyz, r3.zxyz, -r8.xyzx
mul r9.xyz, r0.wyzw, r7.xyzx
mad r7.xyz, r0.zwyz, r7.yzxy, -r9.xyzx
dp3 r1.z, r6.xyzx, r7.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.w
mul r6.xyz, r1.zzzz, r8.xyzx
add r7.xy, v1.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
mul r1.w, r7.x, r7.x
mad r1.w, cb3[5].x, cb3[5].x, -r1.w
mad r1.w, -r7.y, r7.y, r1.w
lt r2.w, l(0.000000), r1.w
sqrt r1.w, r1.w
and r7.z, r1.w, r2.w
mul r1.w, cb3[5].x, cb3[8].y
lt r1.w, r7.z, r1.w
if_nz r1.w
  mov r9.xy, v1.xyxx
  mov r1.w, l(1.000000)
else 
  mul r5.xy, r1.xyxx, v0.wwww
  dp4 r10.x, cb2[15].xyzw, r5.xyzw
  dp4 r10.y, cb2[16].xyzw, r5.xyzw
  dp4 r10.z, cb2[17].xyzw, r5.xyzw
  add r5.xyz, r10.xyzx, -cb2[10].xyzx
  dp3 r2.w, r5.xyzx, r5.xyzx
  rsq r2.w, r2.w
  mul r5.xyz, r2.wwww, r5.xyzx
  ne r2.w, cb3[8].z, l(0.000000)
  div r3.w, l(1.000000, 1.000000, 1.000000, 1.000000), cb3[8].z
  and r2.w, r2.w, r3.w
  add r7.xy, v1.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
  dp3 r3.w, r7.xyzx, r7.xyzx
  rsq r3.w, r3.w
  mul r10.xyz, r3.wwww, r7.xyzx
  mul r11.xyz, r10.yzxy, l(0.000000, 0.000000, 1.000000, 0.000000)
  mad r11.xyz, r10.zxyz, l(1.000000, 0.000000, 0.000000, 0.000000), -r11.xyzx
  dp2 r3.w, r11.xzxx, r11.xzxx
  rsq r3.w, r3.w
  mul r11.xyz, r3.wwww, r11.xyzx
  mul r12.xyz, r10.zxyz, r11.yzxy
  mad r12.xyz, r10.yzxy, r11.zxyz, -r12.xyzx
  dp3 r3.w, r12.xyzx, r12.xyzx
  rsq r3.w, r3.w
  mul r12.xyz, r3.wwww, r12.xyzx
  mul r13.xyz, r3.xxxx, r11.xyzx
  mad r13.xyz, r10.xyzx, r0.yyyy, r13.xyzx
  mad r13.xyz, r12.xyzx, r6.xxxx, r13.xyzx
  mul r14.xyz, r3.yyyy, r11.xyzx
  mad r14.xyz, r10.xyzx, r0.zzzz, r14.xyzx
  mad r14.xyz, r12.xyzx, r6.yyyy, r14.xyzx
  mul r11.xyz, r3.zzzz, r11.xyzx
  mad r11.xyz, r10.xyzx, r0.wwww, r11.xyzx
  mad r11.xyz, r12.xzyx, r6.zzzz, r11.xzyx
  mul r12.xyz, r5.yyyy, r14.xyzx
  mad r5.xyw, r13.xyxz, r5.xxxx, r12.xyxz
  mad r5.xyz, r11.xzyx, r5.zzzz, r5.xywx
  dp3 r3.w, r5.xyzx, r10.xyzx
  mul r4.w, r2.w, r2.w
  mad r5.w, -r3.w, r3.w, l(1.000000)
  mad r4.w, -r4.w, r5.w, l(1.000000)
  sqrt r5.w, r4.w
  mad r3.w, r2.w, r3.w, r5.w
  ge r4.w, r4.w, l(0.000000)
  mul r12.xyz, r10.xyzx, r3.wwww
  mad r5.xyz, r2.wwww, r5.xyzx, -r12.xyzx
  and r5.xyz, r4.wwww, r5.xyzx
  dp3 r2.w, r10.xyzx, r5.xyzx
  ge r2.w, l(0.000000), r2.w
  if_nz r2.w
    ge r2.w, |r5.z|, l(0.000100)
    mad r3.w, cb3[8].y, cb3[5].x, -r7.z
    div r3.w, r3.w, r5.z
    mad r5.xyz, r3.wwww, r5.xyzx, r7.xyzx
    and r5.xyz, r2.wwww, r5.xyzx
    dp3 r2.w, r5.xyzx, r5.xyzx
    sqrt r2.w, r2.w
    lt r3.w, cb3[5].x, r2.w
    movc r1.w, r3.w, l(0), l(1.000000)
    eq r2.w, r2.w, l(0.000000)
    lt r4.w, r5.z, l(0.000000)
    add r5.xy, r5.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
    mad r5.z, -cb3[8].y, cb3[5].x, r7.z
    div r5.z, r5.z, cb3[5].x
    lt r5.w, r5.z, cb3[4].w
    div r5.z, r5.z, cb3[4].w
    mov r7.x, r13.z
    mov r7.y, r14.z
    mov r7.z, r11.y
    mad r10.xyz, -v2.xyzx, r0.xxxx, r7.xyzx
    mad r10.xyz, r5.zzzz, r10.xyzx, r0.yzwy
    mov r12.x, r13.x
    mov r12.y, r14.x
    mov r12.z, r11.x
    add r13.xzw, -r3.xxyz, r12.xxyz
    mad r13.xzw, r5.zzzz, r13.xxzw, r3.xxyz
    mov r11.x, r13.y
    mov r11.y, r14.y
    mad r8.xyz, -r8.xyzx, r1.zzzz, r11.xyzx
    mad r8.xyz, r5.zzzz, r8.xyzx, r6.xyzx
    movc r7.xyz, r5.wwww, r10.xyzx, r7.xyzx
    movc r10.xyz, r5.wwww, r13.xzwx, r12.xyzx
    movc r8.xyz, r5.wwww, r8.xyzx, r11.xyzx
    movc r5.xy, r4.wwww, l(0,1.000000,0,0), r5.xyxx
    or r0.x, r2.w, r4.w
    movc r5.xy, r2.wwww, l(1.000000,0,0,0), r5.xyxx
    or r0.x, r3.w, r0.x
    movc r0.yzw, r0.xxxx, r0.yyzw, r7.xxyz
    movc r3.xyz, r0.xxxx, r3.xyzx, r10.xyzx
    movc r6.xyz, r0.xxxx, r6.xyzx, r8.xyzx
    movc r9.xy, r3.wwww, l(0,0,0,0), r5.xyxx
  else 
    mov r9.xy, l(1.000000,0,0,0)
    mov r1.w, l(1.000000)
  endif 
endif 
mul r5.xyzw, r9.xyxy, cb3[2].zwxy
sample_indexable(texture2d)(float,float,float,float) r7.xyz, r5.xyxx, t7.xyzw, s11
dp3 r0.x, l(0.300000, 0.590000, 0.110000, 0.000000), r7.xyzx
mul r1.z, r0.x, cb3[4].x
add r2.w, -cb3[4].z, cb3[4].y
mad r2.w, r0.x, r2.w, cb3[4].z
add r3.w, r2.w, l(2.000000)
mul r3.w, r3.w, l(0.010000)
mul r3.w, r3.w, r3.w
mul r7.xyzw, r9.xyxy, cb3[0].zwxy
sample_indexable(texture2d)(float,float,float,float) r5.xy, r7.xyxx, t2.xyzw, s11
mad r8.xy, r5.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r4.w, r8.xyxx, r8.xyxx
add r4.w, -r4.w, l(1.000000)
max r4.w, r4.w, l(0.000000)
sqrt r4.w, r4.w
sample_indexable(texture2d)(float,float,float,float) r5.x, r7.zwzz, t4.xyzw, s11
mul r7.xyzw, r9.xyxy, cb3[1].zwxy
sample_indexable(texture2d)(float,float,float,float) r7.xy, r7.xyxx, t5.xyzw, s11
mad r9.xy, r7.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r5.y, r9.xyxx, r9.xyxx
add r5.y, -r5.y, l(1.000000)
max r5.y, r5.y, l(0.000000)
sqrt r5.y, r5.y
sample_indexable(texture2d)(float,float,float,float) r5.zw, r5.zwzz, t6.zwxy, s11
mad r10.xy, r5.zwzz, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r5.z, r10.xyxx, r10.xyxx
add r5.z, -r5.z, l(1.000000)
max r5.z, r5.z, l(0.000000)
sqrt r11.z, r5.z
sample_indexable(texture2d)(float,float,float,float) r5.z, r7.zwzz, t3.xywz, s11
mul r11.xy, r10.xyxx, cb3[3].zzzz
dp3 r5.w, r11.xyzx, r11.xyzx
rsq r5.w, r5.w
mul r7.xyz, r5.wwww, r11.xyzx
mul r11.xyw, r7.yyyy, v4.xyxz
mad r7.xyw, r7.xxxx, v3.xyxz, r11.xyxw
mad r7.xyz, r7.zzzz, v2.xyzx, r7.xywx
dp3 r5.w, r7.xyzx, r7.xyzx
rsq r5.w, r5.w
mul r7.xyz, r5.wwww, r7.xyzx
add r9.z, -r5.y, l(1.000000)
add r10.z, -r11.z, l(1.000000)
add r8.z, -r4.w, l(1.000000)
mul r10.xyz, r10.xyzx, cb3[3].zzzz
mad r9.xyz, cb3[3].xxxx, r9.xyzx, r10.xyzx
mad r8.xyz, cb3[3].wwww, r8.xyzx, r9.xyzx
add r8.w, -r8.z, l(1.000000)
dp3 r4.w, r8.xywx, r8.xywx
rsq r4.w, r4.w
mul r8.xyz, r4.wwww, r8.xywx
mul r6.xyz, r6.xyzx, r8.yyyy
mad r3.xyz, r8.xxxx, r3.xyzx, r6.xyzx
mad r0.yzw, r8.zzzz, r0.yyzw, r3.xxyz
dp3 r3.x, r0.yzwy, r0.yzwy
rsq r3.x, r3.x
mul r6.xyz, r0.yzwy, r3.xxxx
max r0.y, r2.w, l(2.000000)
log r0.y, r0.y
add r0.y, r0.y, l(-1.000000)
mul r0.y, r0.y, l(0.0833333358)
min o0.w, r0.y, l(1.000000)
mul r0.y, r1.z, r3.w
add r0.x, -r0.x, l(1.000000)
dp3 r0.z, r4.xyzx, r7.xyzx
mul r3.xyz, r7.xyzx, r0.zzzz
mad r3.xyz, r3.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), -r4.xyzx
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t0.xyzw, s11
mul r0.x, r0.x, cb3[7].y
mul r4.xyzw, r6.yzzz, r6.xxyz
mul r0.z, r6.y, r6.y
mad r6.w, r6.x, r6.x, -r0.z
dp4 r7.x, r4.xyzw, cb6[0].xyzw
dp4 r7.y, r4.xyzw, cb6[2].xyzw
dp4 r7.z, r4.xyzw, cb6[4].xyzw
dp4 r4.x, r6.xyzw, cb6[1].xyzw
dp4 r4.y, r6.xyzw, cb6[3].xyzw
dp4 r4.z, r6.xyzw, cb6[5].xyzw
add r4.xyz, r4.xyzx, r7.xyzx
add r4.xyz, r4.xyzx, cb6[6].xyzx
max r4.xyz, r4.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mad r0.z, r6.z, l(0.500000), l(0.500000)
add r7.xyz, cb2[27].xyzx, -cb2[38].xyzx
mad r7.xyz, r0.zzzz, r7.xyzx, cb2[38].xyzx
add r4.xyz, r4.xyzx, r7.xyzx
sample_b_indexable(texturecube)(float,float,float,float) r0.xzw, r3.xyzx, t1.xwyz, s11, r0.x
mul r0.xzw, r0.xxzw, cb3[7].wwww
mul r2.w, cb6[7].x, l(3.14159274)
ftoi r3.x, cb4[94].x
mov r7.w, l(1.000000)
mov r8.w, l(1.000000)
mov r9.xyz, l(0,0,0,0)
mov r10.xyz, l(0,0,0,0)
mov r3.yzw, l(0,0,0,0)
mov r11.xyzw, l(0,0,0,0)
mov r4.w, l(1.000000)
mov r5.y, l(0)
loop 
  uge r5.w, r5.y, r3.x
  breakc_nz r5.w
  ftou r5.w, cb4[r5.y + 69].y
  ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r12.x, r5.w, l(140), t54.xxxx
  mov r13.xyz, r9.xyzx
  mov r14.xyz, r10.xyzx
  mov r12.yzw, r3.yyzw
  mov r15.xyzw, r11.xyzw
  mov r16.x, r4.w
  mov r16.y, r5.y
  mov r16.z, r5.w
  mov r16.w, r12.x
  loop 
    ult r17.x, r16.y, r3.x
    ieq r17.yz, r16.wwww, l(0, 0, 1, 0)
    or r17.y, r17.z, r17.y
    and r17.x, r17.y, r17.x
    breakc_z r17.x
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r18.xyzw, r16.z, l(0), t54.xyzw
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r17.xyw, r16.z, l(16), t54.xyxz
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r19.x, r16.z, l(32), t54.xxxx
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r20.yz, r16.z, l(40), t54.xxyx
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r21.xyzw, r16.z, l(60), t54.xyzw
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r19.yz, r16.z, l(100), t54.xxyx
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r19.w, r16.z, l(332), t54.xxxx
    and r19.w, r19.w, l(3)
    add r18.xyz, r2.xyzx, -r18.xyzx
    dp3 r20.w, r18.xyzx, r17.xywx
    max r20.w, r20.w, l(0.000000)
    min r18.w, r18.w, r20.w
    mad r17.xyw, -r18.wwww, r17.xyxw, r18.xyxz
    movc r17.xyz, r17.zzzz, r17.xywx, r18.xyzx
    dp3 r17.x, r17.xyzx, r17.xyzx
    sqrt r17.x, r17.x
    mad_sat r20.x, r17.x, r19.x, r20.y
    sample_l_indexable(texture2d)(float,float,float,float) r17.x, r20.xzxx, t44.zxyw, s13, l(0.000000)
    ine r17.y, r19.z, l(1)
    movc r17.x, r17.y, l(0), r17.x
    ine r17.y, r19.w, l(2)
    if_nz r17.y
      ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r17.y, r16.z, l(372), t54.xxxx
      mul r17.z, r17.x, r17.x
      mul r17.y, r17.y, r17.z
      ieq r17.zw, r19.wwww, l(0, 0, 1, 3)
      mul r18.x, r2.w, r21.x
      itof r6.w, r19.y
      sample_l_indexable(texturecubearray)(float,float,float,float) r18.yzw, r6.xyzw, t57.wxyz, s12, l(4.000000)
      mul r18.xyz, r18.yzwy, r18.xxxx
      mul r7.xyz, r21.yzwy, r18.xyzx
      mad r18.xyz, r17.yyyy, r7.xyzx, r12.yzwy
      mov r14.w, r15.z
      mad r19.xyzw, r17.yyyy, r7.wxyz, r14.wxyz
      max r20.w, r15.w, r17.y
      mov r13.w, r15.x
      mad r22.xyzw, r17.yyyy, r7.xyzw, r13.xyzw
      max r23.x, r15.y, r17.y
      mov r20.x, r13.w
      mov r20.z, r19.x
      mov r15.x, r22.w
      mov r15.z, r14.w
      movc r24.xzw, r17.zzzz, r20.xxzw, r15.xxzw
      mov r19.x, r15.y
      mov r23.yzw, r14.xxyz
      movc r23.xyzw, r17.zzzz, r19.xyzw, r23.xyzw
      or r7.x, r17.w, r17.z
      movc r13.xyz, r7.xxxx, r13.xyzx, r22.xyzx
      movc r14.xyz, r17.wwww, r14.xyzx, r23.yzwy
      movc r12.yzw, r17.wwww, r18.xxyz, r12.yyzw
      mov r15.x, r20.x
      mov r15.y, r19.x
      mov r24.y, r23.x
      movc r15.xyzw, r17.wwww, r15.xyzw, r24.xyzw
    else 
      add_sat r7.x, -r17.x, l(1.000000)
      mul r7.x, r7.x, r7.x
      add r7.y, -r21.x, l(1.000000)
      mad r7.x, r7.x, r7.y, r21.x
      mul r16.x, r7.x, r16.x
    endif 
    iadd r16.y, r16.y, l(1)
    ult r7.x, r16.y, r3.x
    if_nz r7.x
      ftou r16.z, cb4[r16.y + 69].y
      ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r16.w, r16.z, l(140), t54.xxxx
    endif 
  endloop 
  mov r9.xyz, r13.xyzx
  mov r10.xyz, r14.xyzx
  mov r3.yzw, r12.yyzw
  mov r11.xyzw, r15.xyzw
  mov r4.w, r16.x
  mov r5.w, r16.y
  mov r7.xy, r16.zwzz
  loop 
    ult r7.z, r5.w, r3.x
    ieq r12.x, r7.y, l(4)
    and r7.z, r7.z, r12.x
    breakc_z r7.z
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r17.xyz, r7.x, l(0), t54.xyzx
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r18.xyz, r7.x, l(16), t54.xyzx
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r19.y, r7.x, l(44), t54.xxxx
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r20.xyzw, r7.x, l(60), t54.xyzw
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r19.zw, r7.x, l(100), t54.xxxy
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r21.xyz, r7.x, l(128), t54.xyzx
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r22.xyz, r7.x, l(144), t54.xyzx
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r23.xyz, r7.x, l(160), t54.xyzx
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r24.xyz, r7.x, l(176), t54.xyzx
    ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r7.z, r7.x, l(332), t54.xxxx
    and r7.z, r7.z, l(3)
    add r17.xyz, r2.xyzx, -r17.xyzx
    dp3 r21.y, r17.xyzx, r21.xyzx
    dp3 r21.z, r17.xyzx, r18.xyzx
    dp3 r21.w, r17.xyzx, r22.xyzx
    mul r17.xyz, r23.xyzx, r24.xyzx
    mad r18.xyz, r24.xyzx, r23.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    div r18.xyz, r24.xyzx, r18.xyzx
    mul r18.xyz, r18.xyzx, r21.yzwy
    max r18.xyz, r18.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    min r18.xyz, r18.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    mul r21.yzw, r18.xxyz, r18.xxyz
    mad r12.x, -r18.x, r18.x, l(1.000000)
    mad r12.x, r21.w, r12.x, r21.y
    add r13.w, -r12.x, l(1.000000)
    mad_sat r12.x, r21.z, r13.w, r12.x
    sqrt r12.x, r12.x
    max r21.x, r21.y, l(0.000010)
    dp3 r13.w, r17.xyzx, r21.xzwx
    mad r14.w, r18.y, r18.y, r21.x
    mad r14.w, r18.z, r18.z, r14.w
    div r13.w, r13.w, r14.w
    add r14.w, r13.w, l(1.000000)
    mad_sat r19.x, r12.x, r14.w, -r13.w
    sample_l_indexable(texture2d)(float,float,float,float) r12.x, r19.xyxx, t44.zxyw, s13, l(0.000000)
    ine r13.w, r19.w, l(1)
    movc r12.x, r13.w, l(0), r12.x
    ine r13.w, r7.z, l(2)
    if_nz r13.w
      ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r13.w, r7.x, l(372), t54.xxxx
      mul r14.w, r12.x, r12.x
      mul r13.w, r13.w, r14.w
      ieq r17.xy, r7.zzzz, l(1, 3, 0, 0)
      mul r7.z, r2.w, r20.x
      itof r6.w, r19.z
      sample_l_indexable(texturecubearray)(float,float,float,float) r18.xyz, r6.xyzw, t57.xyzw, s12, l(4.000000)
      mul r18.xyz, r7.zzzz, r18.xyzx
      mul r8.xyz, r20.yzwy, r18.xyzx
      mad r18.xyz, r13.wwww, r8.xyzx, r3.yzwy
      mov r10.w, r11.z
      mad r19.xyzw, r13.wwww, r8.wxyz, r10.wxyz
      max r21.w, r11.w, r13.w
      mov r9.w, r11.x
      mad r22.xyzw, r13.wwww, r8.xyzw, r9.xyzw
      max r23.x, r11.y, r13.w
      mov r21.x, r9.w
      mov r21.z, r19.x
      mov r11.x, r22.w
      mov r11.z, r10.w
      movc r24.xzw, r17.xxxx, r21.xxzw, r11.xxzw
      mov r19.x, r11.y
      mov r23.yzw, r10.xxyz
      movc r23.xyzw, r17.xxxx, r19.xyzw, r23.xyzw
      or r6.w, r17.y, r17.x
      movc r9.xyz, r6.wwww, r9.xyzx, r22.xyzx
      movc r10.xyz, r17.yyyy, r10.xyzx, r23.yzwy
      movc r3.yzw, r17.yyyy, r18.xxyz, r3.yyzw
      mov r11.x, r21.x
      mov r11.y, r19.x
      mov r24.y, r23.x
      movc r11.xyzw, r17.yyyy, r11.xyzw, r24.xyzw
    else 
      add_sat r6.w, -r12.x, l(1.000000)
      mul r6.w, r6.w, r6.w
      add r7.z, -r20.x, l(1.000000)
      mad r6.w, r6.w, r7.z, r20.x
      mul r4.w, r4.w, r6.w
    endif 
    iadd r5.w, r5.w, l(1)
    ult r6.w, r5.w, r3.x
    if_nz r6.w
      ftou r7.x, cb4[r5.w + 69].y
      ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r7.y, r7.x, l(140), t54.xxxx
    endif 
  endloop 
  ine r8.xyz, r7.yyyy, l(0, 4, 1, 0)
  and r6.w, r8.y, r8.x
  and r6.w, r8.z, r6.w
  iadd r5.y, r5.w, -r6.w
endloop 
max r2.xw, r11.zzzx, l(1.192092896E-007, 0.000000, 0.000000, 1.192092896E-007)
div r2.xyz, r10.xyzx, r2.xxxx
mov_sat r11.yw, r11.yyyw
add r2.xyz, -r4.xyzx, r2.xyzx
mad r2.xyz, r11.wwww, r2.xyzx, r4.xyzx
div r4.xyz, r9.xyzx, r2.wwww
add r4.xyz, -r2.xyzx, r4.xyzx
mad r2.xyz, r11.yyyy, r4.xyzx, r2.xyzx
add r2.xyz, r3.yzwy, r2.xyzx
mul r2.xyz, r4.wwww, r2.xyzx
mad r3.xyz, cb3[7].zzzz, r1.xyzx, r2.xyzx
mad r1.xyz, cb3[8].xxxx, r1.xyzx, r2.xyzx
add r1.xyz, -r3.xyzx, r1.xyzx
mad r1.xyz, r5.xxxx, r1.xyzx, r3.xyzx
max r1.x, r1.y, r1.x
max r1.x, r1.z, r1.x
add r1.x, r1.x, cb3[7].x
mul r0.xzw, r0.xxzw, r1.xxxx
mul r0.xyz, r0.yyyy, r0.xzwx
max r0.y, r0.z, r0.y
max r0.x, r0.y, r0.x
lt r0.y, l(0.000000), r0.x
lt r0.z, r0.x, l(1.000000)
and r0.y, r0.z, r0.y
ge r0.z, l(0.000000), r0.x
movc r0.z, r0.z, l(0), l(1.000000)
movc r0.x, r0.y, r0.x, r0.z
add r0.x, -r0.x, l(1.000000)
mad r0.y, -r1.w, r5.z, l(1.000000)
mad r0.x, -r0.x, r0.y, l(1.000000)
add r0.x, r0.x, -cb1[2].x
min r0.x, r0.x, l(0.000000)
lt r0.x, r0.x, l(0.000000)
discard_nz r0.x
mov o0.xyz, r6.xyzx
ret 
// Approximately 484 instruction slots used
