//1418708c23b706a6-ps.txt
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.17672
//
//   using 3Dmigoto v1.2.27 on Sun Feb 07 01:11:59 2016
//
//
// Buffer Definitions: 
//
// cbuffer cbTiledLighting
// {
//
//   uint g_uNumNonDirectionalLights;   // Offset:    0 Size:     4
//   uint g_uNumDirectionalLights;      // Offset:    4 Size:     4 [unused]
//   uint g_uNumTilesX;                 // Offset:    8 Size:     4
//   uint g_uNumTilesY;                 // Offset:   12 Size:     4
//   row_major float4x4 g_mProjection;  // Offset:   16 Size:    64 [unused]
//   row_major float4x4 g_mInvProjection;// Offset:   80 Size:    64 [unused]
//
// }
//
// cbuffer WorldBuffer
// {
//
//   struct WorldStruct
//   {
//       
//       row_major float4x4 ViewProject;// Offset:    0
//       
//       struct WorldStruct_PerInstanceData
//       {
//           
//           row_major float4x4 World;  // Offset:   64
//           row_major float4x4 WorldViewProject;// Offset:  128
//
//       } PerInstance[256];            // Offset:   64
//
//   } WorldParameters;                 // Offset:    0 Size: 32832
//
// }
//
// 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 [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
//   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 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
// ------------------------------ ---------- ------- ----------- ---- --------
// SamplerGenericPointClamp          sampler      NA          NA   10        1
// SamplerGenericTrilinearWrap       sampler      NA          NA   11        1
// SamplerGenericBilinearClamp       sampler      NA          NA   13        1
// p_default_Material_n169_n189_n197_661830C016465534_cp0_Param_texture    texture  float4          2d    0        1
// p_default_Setup_8CD6AD409878073_cp6_Param_texture    texture  float4          2d    1        1
// p_default_Setup_n4_n65_Texture_texture    texture  float4          2d    2        1
// p_default_Setup_n5_n69_Texture_texture    texture  float4          2d    4        1
// p_default_Material_n173_NormalBufferTexture_texture    texture  float4          2d    5        1
// p_default_Setup_n4_n69_Texture_texture    texture  float4          2d    6        1
// p_default_Setup_n9_n65_Texture_texture    texture  float4          2d    7        1
// p_default_Setup_n9_n127_Texture_texture    texture  float4          2d    8        1
// p_default_Setup_n5_n65_Texture_texture    texture  float4          2d    9        1
// p_default_Setup_n3_n69_Texture_texture    texture  float4          2d   10        1
// p_default_Setup_n9_n69_Texture_texture    texture  float4          2d   11        1
// p_default_Setup_n3_n65_Texture_texture    texture  float4          2d   12        1
// p_default_Setup_n4_9075B4F026705685_cp2_Param_texture    texture  float4          2d   13        1
// p_default_Setup_n9_9075B4F026705685_cp2_Param_texture    texture  float4          2d   14        1
// p_default_Setup_n5_9075B4F026705685_cp2_Param_texture    texture  float4          2d   15        1
// AttenuationSampler_texture        texture  float4          2d   44        1
// LightAccumulation_texture         texture  float4          2d   51        1
// SpecularAccumulation_texture      texture  float4          2d   52        1
// AmbientAccumulation_texture       texture  float4          2d   53        1
// LightDataBuffer                   texture  struct         r/o   54        1
// LightIndexBuffer                  texture   uint4         buf   55        1
// ReflCubeMaps                      texture  float4   cubearray   57        1
// WorldBuffer                       cbuffer      NA          NA    0        1
// SceneBuffer                       cbuffer      NA          NA    2        1
// MaterialBuffer                    cbuffer      NA          NA    3        1
// IrradianceBuffer                  cbuffer      NA          NA    6        1
// cbTiledLighting                   cbuffer      NA          NA    7        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy w
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 2   xyz         2     NONE   float   xyz 
// PSIZE                    0   x           3     NONE    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 cb0[2045], dynamicIndexed
dcl_constantbuffer cb2[95], immediateIndexed
dcl_constantbuffer cb3[24], immediateIndexed
dcl_constantbuffer cb6[8], immediateIndexed
dcl_sampler s10, mode_default
dcl_sampler s11, mode_default
dcl_sampler s13, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) 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) t8
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texture2d (float,float,float,float) t10
dcl_resource_texture2d (float,float,float,float) t11
dcl_resource_texture2d (float,float,float,float) t12
dcl_resource_texture2d (float,float,float,float) t13
dcl_resource_texture2d (float,float,float,float) t14
dcl_resource_texture2d (float,float,float,float) t15
dcl_resource_texture2d (float,float,float,float) t44
dcl_resource_texture2d (float,float,float,float) t51
dcl_resource_texture2d (float,float,float,float) t52
dcl_resource_texture2d (float,float,float,float) t53
dcl_resource_structured t54, 384 
dcl_resource_buffer (uint,uint,uint,uint) t55
dcl_resource_texturecubearray (float,float,float,float) t57
dcl_input_ps_siv linear noperspective v0.xyw, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyz
dcl_input_ps constant v3.x
dcl_output o0.xyzw
dcl_output o1.x
// dcl_temps 31
dcl_temps 33
dcl_resource_texture2d (float,float,float,float) t125
dp3 r0.x, v2.xyzx, v2.xyzx
rsq r0.x, r0.x
mul r0.xyz, r0.xxxx, v2.xyzx
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) r32.xyzw, l(0, 0, 0, 0), t125.xyzw
add r32.w, v0.w, -r32.y
mul r32.w, r32.w, r32.x
mul r32.w, r32.w, cb2[81].x
add r2.x, r2.x, -r32.w


dp3 r0.w, -r2.xyzx, -r2.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, -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
mul r1.zw, v1.zzzw, cb3[21].xxxy
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r1.zwzz, t1.xyzw, s11
ishl r0.w, v3.x, l(3)
dp3 r0.w, cb0[r0.w + 4].xyzx, cb0[r0.w + 4].xyzx
sqrt r0.w, r0.w
mul r1.zw, r0.wwww, v1.xxxy
mul r5.xy, r1.zwzz, cb3[15].zwzz
mul r5.zw, r1.zzzw, cb3[16].zzzw
sample_indexable(texture2d)(float,float,float,float) r5.zw, r5.zwzz, t10.zwxy, s11
sample_indexable(texture2d)(float,float,float,float) r6.xyz, r5.xyxx, t12.xyzw, s11
mul r5.xyz, r5.zzzz, cb3[8].xyzx
mul r6.xyz, r6.xyzx, cb3[0].xyzx
add r2.w, cb3[21].w, -cb3[22].x
mad r2.w, r5.w, r2.w, cb3[22].x
add_sat r3.w, cb3[14].w, cb3[21].z
mul r7.xyz, r3.wwww, cb3[6].xyzx
mul r5.xyz, r5.xyzx, r3.wwww
add r2.w, r2.w, l(-1.000000)
mad r2.w, r3.w, r2.w, l(1.000000)
mul r6.xyz, r6.xyzx, r3.wwww
mul r8.xyzw, v1.xyxy, cb3[19].xyzw
mul r8.xy, r0.wwww, r8.xyxx
mul r9.xy, r1.zwzz, cb3[20].xyxx
sample_indexable(texture2d)(float,float,float,float) r10.y, r8.xyxx, t13.yxzw, s11
mul r11.xyzw, r1.zwzw, cb3[18].xyzw
sample_indexable(texture2d)(float,float,float,float) r8.xy, r11.xyxx, t6.xyzw, s11
sample_indexable(texture2d)(float,float,float,float) r9.xyz, r9.xyxx, t2.xyzw, s11
add r4.w, cb3[7].w, -cb3[22].z
mad r4.w, r8.y, r4.w, cb3[22].z
mad_sat r10.x, r3.x, cb3[8].w, cb3[10].w
mov r10.z, l(1.000000)
dp3_sat r3.x, cb3[10].xyzx, r10.xyzx
mad r10.xyz, -r3.wwww, cb3[6].xyzx, cb3[4].xyzx
mad r7.xyz, r3.xxxx, r10.xyzx, r7.xyzx
mad r10.xyz, cb3[12].xyzx, r8.xxxx, -r5.xyzx
mad r5.xyz, r3.xxxx, r10.xyzx, r5.xyzx
add r3.w, -r2.w, r4.w
mad r2.w, r3.x, r3.w, r2.w
mad r9.xyz, r9.xyzx, cb3[1].xyzx, -r6.xyzx
mad r6.xyz, r3.xxxx, r9.xyzx, r6.xyzx
mul r3.xw, v1.xxxy, cb3[17].zzzw
mul r3.xw, r0.wwww, r3.xxxw
mul r1.zw, r1.zzzw, cb3[17].xxxy
sample_indexable(texture2d)(float,float,float,float) r9.y, r3.xwxx, t15.yxzw, s11
sample_indexable(texture2d)(float,float,float,float) r3.xw, r11.zwzz, t4.xzwy, s11
sample_indexable(texture2d)(float,float,float,float) r10.xyz, r1.zwzz, t9.xyzw, s11
add r0.w, cb3[9].w, -cb3[12].w
mad r0.w, r3.w, r0.w, cb3[12].w
mad_sat r9.x, r3.y, cb3[22].y, cb3[13].w
mov r9.z, l(1.000000)
dp3_sat r1.z, cb3[11].xyzx, r9.xyzx
add r9.xyz, -r7.xyzx, cb3[14].xyzx
mad r7.xyz, r1.zzzz, r9.xyzx, r7.xyzx
mad r3.xyw, cb3[13].xyxz, r3.xxxx, -r5.xyxz
mad r3.xyw, r1.zzzz, r3.xyxw, r5.xyxz
add r0.w, -r2.w, r0.w
mad r0.w, r1.z, r0.w, r2.w
mad r5.xyz, r10.xyzx, cb3[3].xyzx, -r6.xyzx
mad r5.xyz, r1.zzzz, r5.xyzx, r6.xyzx
add_sat r1.z, -cb3[11].w, l(1.000000)
mul r6.xy, v1.xyxx, cb3[15].xyxx
mul r6.zw, v1.xxxy, cb3[20].zzzw
sample_indexable(texture2d)(float,float,float,float) r9.y, r6.xyxx, t14.yxzw, s11
mul r6.xy, v1.xyxx, cb3[16].xyxx
sample_indexable(texture2d)(float,float,float,float) r1.w, r6.xyxx, t11.yzwx, s11
sample_indexable(texture2d)(float,float,float,float) r2.w, r8.zwzz, t8.yzwx, s11
sample_indexable(texture2d)(float,float,float,float) r6.xyz, r6.zwzz, t7.xyzw, s11
mad_sat r1.z, r2.w, cb3[11].w, r1.z
mad_sat r9.x, r3.z, cb3[5].w, cb3[6].w
mov r9.z, l(1.000000)
dp3_sat r2.w, cb3[7].xyzx, r9.xyzx
add r3.z, -r0.w, cb3[4].w
mad r0.w, r2.w, r3.z, r0.w
add r8.xyz, -r7.xyzx, cb3[9].xyzx
mad r7.xyz, r2.wwww, r8.xyzx, r7.xyzx
mad r8.xyz, cb3[5].xyzx, r1.wwww, -r3.xywx
mad r3.xyz, r2.wwww, r8.xyzx, r3.xywx
mad r6.xyz, r6.xyzx, cb3[2].xyzx, -r5.xyzx
mad r5.xyz, r2.wwww, r6.xyzx, r5.xyzx
add r1.z, r1.z, l(-1.000000)
mad r1.z, r2.w, r1.z, l(1.000000)
sample_indexable(texture2d)(float,float,float,float) r6.xyz, r1.xyxx, t51.xyzw, s13
sample_indexable(texture2d)(float,float,float,float) r8.xyz, r1.xyxx, t52.xyzw, s13
sample_indexable(texture2d)(float,float,float,float) r1.xyw, r1.xyxx, t5.xywz, s10
add r2.w, r0.w, l(2.000000)
mul r2.w, r2.w, l(0.010000)
mul r9.xyz, r2.wwww, r3.xyzx
add r6.xyz, r7.xyzx, r6.xyzx
ftoi r7.xy, v0.xyxx
mov r7.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r2.w, r7.xyww, t0.yzwx
add r3.w, cb3[22].w, cb3[23].x
add_sat r3.w, -r3.w, l(1.000000)
mul r4.w, r2.w, r2.w
mad r2.w, cb3[22].w, r2.w, r3.w
mad_sat r2.w, r4.w, cb3[23].x, r2.w
add r10.xyz, -cb2[94].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mad_sat r10.xyz, r2.wwww, r10.xyzx, cb2[94].xyzx
mul r8.xyz, r8.xyzx, r10.xyzx
ld_indexable(texture2d)(float,float,float,float) r7.xyz, r7.xyzw, t53.xyzw
mad r6.xyz, r7.xyzx, r1.zzzz, r6.xyzx
mul r6.xyz, r6.xyzx, r10.xyzx
mul r1.z, r1.z, r10.x
dp3 r2.w, r4.xyzx, r1.xywx
mul r1.xyw, r1.xyxw, r2.wwww
mad r4.xyz, r1.xywx, l(2.000000, 2.000000, 2.000000, 0.000000), -r4.xyzx
mul r7.xyzw, r4.yzzz, r4.xxyz
mul r1.x, r4.y, r4.y
mad r4.w, r4.x, r4.x, -r1.x
dp4 r10.x, r7.xyzw, cb6[0].xyzw
dp4 r10.y, r7.xyzw, cb6[2].xyzw
dp4 r10.z, r7.xyzw, cb6[4].xyzw
dp4 r7.x, r4.xyzw, cb6[1].xyzw
dp4 r7.y, r4.xyzw, cb6[3].xyzw
dp4 r7.z, r4.xyzw, cb6[5].xyzw
add r1.xyw, r7.xyxz, r10.xyxz
add r1.xyw, r1.xyxw, cb6[6].xyxz
max r1.xyw, r1.xyxw, l(0.000000, 0.000000, 0.000000, 0.000000)
mad r2.w, r4.z, l(0.500000), l(0.500000)
add r7.xyz, cb2[27].xyzx, -cb2[38].xyzx
mad r7.xyz, r2.wwww, r7.xyzx, cb2[38].xyzx
add r1.xyw, r1.xyxw, r7.xyxz
dp3 r0.x, r4.xyzx, r0.xyzx
mad_sat r0.x, cb3[23].y, r0.x, l(1.000000)
mul r0.x, r0.x, r0.x
mul r0.x, r0.x, r1.z
mul r0.x, r0.x, l(0.020000)
ieq r0.y, cb7[0].x, l(0)
ult r0.z, l(1024), cb7[0].x
or r0.y, r0.z, r0.y
if_z r0.y
  mul r0.y, r0.w, l(0.250000)
  log r0.y, r0.y
  mad_sat r0.y, -r0.y, l(0.0909090936), l(1.000000)
  mul r0.y, r0.y, l(4.000000)
  mul r0.z, cb6[7].x, l(3.14159274)
  mul r7.xy, v0.xyxx, l(0.062500, 0.062500, 0.000000, 0.000000)
  round_ni r7.xy, r7.xyxx
  utof r0.w, cb7[0].z
  mad r0.w, r7.y, r0.w, r7.x
  ftou r0.w, r0.w
  imul null, r1.z, cb7[0].w, cb7[0].z
  ishl r1.z, r1.z, l(1)
  ishl r0.w, r0.w, l(1)
  iadd r0.w, r0.w, r1.z
  mov r7.xyz, r4.xyzx
  mov r10.w, l(1.000000)
  mov r11.w, l(1.000000)
  mov r12.xyz, l(0,0,0,0)
  mov r13.xyz, l(0,0,0,0)
  mov r14.xy, l(0,0,0,0)
  mov r1.z, l(0)
  mov r2.w, l(0)
  mov r3.w, l(1.000000)
  mov r5.w, l(0)
  loop 
    uge r6.w, r5.w, l(2)
    breakc_nz r6.w
    iadd r6.w, r0.w, r5.w
    ld_indexable(buffer)(uint,uint,uint,uint) r15.xyzw, r6.wwww, t55.xyzw
    ushr r16.xyzw, r15.xyzw, l(30, 30, 30, 30)
    iadd r6.w, r16.y, r16.x
    iadd r6.w, r16.z, r6.w
    iadd r6.w, r16.w, r6.w
    mov r16.xyz, r12.xyzx
    mov r17.xyz, r13.xyzx
    mov r18.xw, r14.yyyx
    mov r18.y, r1.z
    mov r18.z, r2.w
    mov r8.w, r3.w
    mov r9.w, l(0)
    loop 
      uge r12.w, r9.w, r6.w
      breakc_nz r12.w
      ult r19.xyz, r9.wwww, l(3, 6, 9, 0)
      iadd r20.xyz, r9.wwww, l(-3, -6, -9, 0)
      movc r12.w, r19.z, r20.y, r20.z
      movc r12.w, r19.y, r20.x, r12.w
      movc r12.w, r19.x, r9.w, r12.w
      movc r13.w, r19.z, r15.z, r15.w
      movc r13.w, r19.y, r15.y, r13.w
      movc r13.w, r19.x, r15.x, r13.w
      imul null, r12.w, r12.w, l(10)
      ushr r12.w, r13.w, r12.w
      and r12.w, r12.w, l(1023)
      ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r13.w, r12.w, l(140), t54.xxxx
      mov r19.xyz, r16.xyzx
      mov r20.xyz, r17.xyzx
      mov r21.xyzw, r18.xyzw
      mov r14.z, r8.w
      mov r14.w, r9.w
      mov r22.x, r12.w
      mov r22.y, r13.w
      loop 
        ult r22.z, r14.w, r6.w
        ieq r23.xy, r22.yyyy, l(0, 1, 0, 0)
        or r22.w, r23.y, r23.x
        and r22.z, r22.w, r22.z
        breakc_z r22.z
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r24.xyzw, r22.x, l(0), t54.xyzw
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r23.xzw, r22.x, l(16), t54.xxyz
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r22.z, r22.x, l(32), t54.xxxx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r25.yz, r22.x, l(40), t54.xxyx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r26.xyzw, r22.x, l(60), t54.xyzw
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r27.xy, r22.x, l(100), t54.xyxx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r22.w, r22.x, l(332), t54.xxxx
        and r22.w, r22.w, l(3)
        add r24.xyz, r2.xyzx, -r24.xyzx
        dp3 r25.w, r24.xyzx, r23.xzwx
        max r25.w, r25.w, l(0.000000)
        min r24.w, r24.w, r25.w
        mad r23.xzw, -r24.wwww, r23.xxzw, r24.xxyz
        movc r23.xyz, r23.yyyy, r23.xzwx, r24.xyzx
        dp3 r23.x, r23.xyzx, r23.xyzx
        sqrt r23.x, r23.x
        mad_sat r25.x, r23.x, r22.z, r25.y
        sample_l_indexable(texture2d)(float,float,float,float) r22.z, r25.xzxx, t44.xyzw, s13, l(0.000000)
        ine r23.x, r27.y, l(1)
        movc r22.z, r23.x, l(0), r22.z
        ine r23.x, r22.w, l(2)
        if_nz r23.x
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r23.x, r22.x, l(372), t54.xxxx
          mul r23.y, r22.z, r22.z
          mul r23.x, r23.x, r23.y
          ieq r23.yz, r22.wwww, l(0, 1, 3, 0)
          mul r22.w, r0.z, r26.x
          itof r7.w, r27.x
          sample_l_indexable(texturecubearray)(float,float,float,float) r24.xyz, r7.xyzw, t57.xyzw, s11, r0.y
          mul r24.xyz, r22.wwww, r24.xyzx
          mul r10.xyz, r26.yzwy, r24.xyzx
          mov r20.w, r21.z
          mad r24.xyzw, r23.xxxx, r10.wxyz, r20.wxyz
          max r25.w, r21.w, r23.x
          mov r19.w, r21.x
          mad r27.xyzw, r23.xxxx, r10.xyzw, r19.xyzw
          max r28.x, r21.y, r23.x
          mov r25.x, r19.w
          mov r25.z, r24.x
          mov r21.x, r27.w
          mov r21.z, r20.w
          movc r29.xzw, r23.yyyy, r25.xxzw, r21.xxzw
          mov r24.x, r21.y
          mov r28.yzw, r20.xxyz
          movc r28.xyzw, r23.yyyy, r24.xyzw, r28.xyzw
          or r7.w, r23.z, r23.y
          movc r19.xyz, r7.wwww, r19.xyzx, r27.xyzx
          movc r20.xyz, r23.zzzz, r20.xyzx, r28.yzwy
          mov r21.x, r25.x
          mov r21.y, r24.x
          mov r29.y, r28.x
          movc r21.xyzw, r23.zzzz, r21.xyzw, r29.xyzw
        else 
          add_sat r7.w, -r22.z, l(1.000000)
          mul r7.w, r7.w, r7.w
          add r10.x, -r26.x, l(1.000000)
          mad r7.w, r7.w, r10.x, r26.x
          mul r14.z, r7.w, r14.z
        endif 
        iadd r7.w, r14.w, l(1)
        ult r10.x, r7.w, r6.w
        if_nz r10.x
          ult r10.xyz, r7.wwww, l(3, 6, 9, 0)
          iadd r23.xyz, r14.wwww, l(-2, -5, -8, 0)
          movc r19.w, r10.z, r23.y, r23.z
          movc r19.w, r10.y, r23.x, r19.w
          movc r19.w, r10.x, r7.w, r19.w
          movc r10.z, r10.z, r15.z, r15.w
          movc r10.y, r10.y, r15.y, r10.z
          movc r10.x, r10.x, r15.x, r10.y
          imul null, r10.y, r19.w, l(10)
          ushr r10.x, r10.x, r10.y
          and r22.x, r10.x, l(1023)
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r22.y, r22.x, l(140), t54.xxxx
        endif 
        mov r14.w, r7.w
      endloop 
      mov r16.xyz, r19.xyzx
      mov r17.xyz, r20.xyzx
      mov r18.xyzw, r21.xyzw
      mov r8.w, r14.z
      mov r7.w, r14.w
      mov r10.xy, r22.xyxx
      loop 
        ult r10.z, r7.w, r6.w
        ieq r12.w, r10.y, l(4)
        and r10.z, r10.z, r12.w
        breakc_z r10.z
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r23.xyz, r10.x, l(0), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r24.xyz, r10.x, l(16), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r25.y, r10.x, l(44), t54.xxxx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r26.xyzw, r10.x, l(60), t54.xyzw
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r22.zw, r10.x, l(100), t54.xxxy
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r27.xyz, r10.x, l(128), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r28.xyz, r10.x, l(144), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r29.xyz, r10.x, l(160), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r30.xyz, r10.x, l(176), t54.xyzx
        ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r10.z, r10.x, l(332), t54.xxxx
        and r10.z, r10.z, l(3)
        add r23.xyz, r2.xyzx, -r23.xyzx
        dp3 r27.y, r23.xyzx, r27.xyzx
        dp3 r27.z, r23.xyzx, r24.xyzx
        dp3 r27.w, r23.xyzx, r28.xyzx
        mul r23.xyz, r29.xyzx, r30.xyzx
        mad r24.xyz, r30.xyzx, r29.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r24.xyz, r30.xyzx, r24.xyzx
        mul r24.xyz, r24.xyzx, r27.yzwy
        max r24.xyz, r24.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        min r24.xyz, r24.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        mul r27.yzw, r24.xxyz, r24.xxyz
        mad r12.w, -r24.x, r24.x, l(1.000000)
        mad r12.w, r27.w, r12.w, r27.y
        add r13.w, -r12.w, l(1.000000)
        mad_sat r12.w, r27.z, r13.w, r12.w
        sqrt r12.w, r12.w
        max r27.x, r27.y, l(0.000010)
        dp3 r13.w, r23.xyzx, r27.xzwx
        mad r19.w, r24.y, r24.y, r27.x
        mad r19.w, r24.z, r24.z, r19.w
        div r13.w, r13.w, r19.w
        add r19.w, r13.w, l(1.000000)
        mad_sat r25.x, r12.w, r19.w, -r13.w
        sample_l_indexable(texture2d)(float,float,float,float) r12.w, r25.xyxx, t44.xywz, s13, l(0.000000)
        ine r13.w, r22.w, l(1)
        movc r12.w, r13.w, l(0), r12.w
        ine r13.w, r10.z, l(2)
        if_nz r13.w
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r13.w, r10.x, l(372), t54.xxxx
          mul r19.w, r12.w, r12.w
          mul r13.w, r13.w, r19.w
          ieq r23.xy, r10.zzzz, l(1, 3, 0, 0)
          mul r10.z, r0.z, r26.x
          itof r4.w, r22.z
          sample_l_indexable(texturecubearray)(float,float,float,float) r24.xyz, r4.xyzw, t57.xyzw, s11, r0.y
          mul r24.xyz, r10.zzzz, r24.xyzx
          mul r11.xyz, r26.yzwy, r24.xyzx
          mov r17.w, r18.z
          mad r24.xyzw, r13.wwww, r11.wxyz, r17.wxyz
          max r25.w, r13.w, r18.w
          mov r16.w, r18.x
          mad r27.xyzw, r13.wwww, r11.xyzw, r16.xyzw
          max r28.x, r13.w, r18.y
          mov r25.x, r16.w
          mov r25.z, r24.x
          mov r18.x, r27.w
          mov r18.z, r17.w
          movc r29.xzw, r23.xxxx, r25.xxzw, r18.xxzw
          mov r24.x, r18.y
          mov r28.yzw, r17.xxyz
          movc r28.xyzw, r23.xxxx, r24.xyzw, r28.xyzw
          or r4.w, r23.y, r23.x
          movc r16.xyz, r4.wwww, r16.xyzx, r27.xyzx
          movc r17.xyz, r23.yyyy, r17.xyzx, r28.yzwy
          mov r18.x, r25.x
          mov r18.y, r24.x
          mov r29.y, r28.x
          movc r18.xyzw, r23.yyyy, r18.xyzw, r29.xyzw
        else 
          add_sat r4.w, -r12.w, l(1.000000)
          mul r4.w, r4.w, r4.w
          add r10.z, -r26.x, l(1.000000)
          mad r4.w, r4.w, r10.z, r26.x
          mul r8.w, r4.w, r8.w
        endif 
        iadd r4.w, r7.w, l(1)
        ult r10.z, r4.w, r6.w
        if_nz r10.z
          ult r11.xyz, r4.wwww, l(3, 6, 9, 0)
          iadd r23.xyz, r7.wwww, l(-2, -5, -8, 0)
          movc r10.z, r11.z, r23.y, r23.z
          movc r10.z, r11.y, r23.x, r10.z
          movc r10.z, r11.x, r4.w, r10.z
          movc r11.z, r11.z, r15.z, r15.w
          movc r11.y, r11.y, r15.y, r11.z
          movc r11.x, r11.x, r15.x, r11.y
          imul null, r10.z, r10.z, l(10)
          ushr r10.z, r11.x, r10.z
          and r10.x, r10.z, l(1023)
          ld_structured_indexable(structured_buffer, stride=384)(mixed,mixed,mixed,mixed) r10.y, r10.x, l(140), t54.xxxx
        endif 
        mov r7.w, r4.w
      endloop 
      ine r11.xyz, r10.yyyy, l(0, 4, 1, 0)
      and r4.w, r11.y, r11.x
      and r4.w, r11.z, r4.w
      iadd r9.w, -r4.w, r7.w
    endloop 
    ult r4.w, r6.w, l(12)
    if_nz r4.w
      mov r12.xyz, r16.xyzx
      mov r13.xyz, r17.xyzx
      mov r14.xy, r18.wxww
      mov r1.z, r18.y
      mov r2.w, r18.z
      mov r3.w, r8.w
      break 
    endif 
    iadd r5.w, r5.w, l(1)
    mov r12.xyz, r16.xyzx
    mov r13.xyz, r17.xyzx
    mov r14.xy, r18.wxww
    mov r1.z, r18.y
    mov r2.w, r18.z
    mov r3.w, r8.w
  endloop 
  max r0.y, r2.w, l(1.192092896E-007)
  div r0.yzw, r13.xxyz, r0.yyyy
  mov_sat r14.x, r14.x
  add r0.yzw, -r1.xxyw, r0.yyzw
  mad r0.yzw, r14.xxxx, r0.yyzw, r1.xxyw
  max r2.x, r14.y, l(1.192092896E-007)
  div r2.xyz, r12.xyzx, r2.xxxx
  mov_sat r1.z, r1.z
  add r2.xyz, -r0.yzwy, r2.xyzx
  mad r1.xyw, r1.zzzz, r2.xyxz, r0.yzyw
else 
  mov r3.w, l(1.000000)
endif 
mul r0.yzw, r1.xxyw, r3.wwww
mul r0.yzw, r3.xxyz, r0.yyzw
mul r0.xyz, r0.xxxx, r0.yzwy
mad r0.xyz, r8.xyzx, r9.xyzx, r0.xyzx
mad r0.xyz, r6.xyzx, r5.xyzx, r0.xyzx
max o0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mov o0.w, l(1.000000)
mov o1.x, l(0)
ret 
// Approximately 439 instruction slots used
