// asmtool.py -i --fix-fcprimal-camera-pos dbf56d186058ba85-ps.txt
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.31 on Wed Mar 02 08:07:22 2016
//
//
// Buffer Definitions: 
//
// cbuffer CViewportShaderParameterProvider
// {
//
//   float4x4 InvProjectionMatrix;      // Offset:    0 Size:    64
//   float4x4 InvViewMatrix;            // Offset:   64 Size:    64 [unused]
//   float4x4 ProjectionMatrix;         // Offset:  128 Size:    64 [unused]
//   float4x4 ViewMatrix;               // Offset:  192 Size:    64 [unused]
//   float4x4 ViewProjectionMatrix;     // Offset:  256 Size:    64 [unused]
//   float4x4 ViewRotProjectionMatrix;  // Offset:  320 Size:    64 [unused]
//   float4x4 ViewRotProjectionMatrix_Previous;// Offset:  384 Size:    64 [unused]
//   float4 AmbientSHR;                 // Offset:  448 Size:    16 [unused]
//   float4 AmbientSHG;                 // Offset:  464 Size:    16 [unused]
//   float4 AmbientSHB;                 // Offset:  480 Size:    16 [unused]
//   float4 CameraDistances;            // Offset:  496 Size:    16 [unused]
//   float4 CameraNearPlaneSize;        // Offset:  512 Size:    16 [unused]
//   float4 DepthScale;                 // Offset:  528 Size:    16 [unused]
//   float4 DepthTextureScaleOffset;    // Offset:  544 Size:    16 [unused]
//   float4 FogParams;                  // Offset:  560 Size:    16
//   float4 FogSHB;                     // Offset:  576 Size:    16 [unused]
//   float4 FogSHG;                     // Offset:  592 Size:    16 [unused]
//   float4 FogSHR;                     // Offset:  608 Size:    16 [unused]
//   float4 HeightFogParams;            // Offset:  624 Size:    16
//   float4 ViewportSize;               // Offset:  640 Size:    16
//   float3 ViewPoint;                  // Offset:  656 Size:    12 [unused]
//   float3 CameraPosition;             // Offset:  672 Size:    12
//   float3 CameraPosition_Previous;    // Offset:  688 Size:    12 [unused]
//   float3 CameraPositionFractions;    // Offset:  704 Size:    12 [unused]
//   float3 CameraPositionFractions_Previous;// Offset:  720 Size:    12 [unused]
//   float3 CameraRight;                // Offset:  736 Size:    12 [unused]
//   float3 CameraUp;                   // Offset:  752 Size:    12 [unused]
//   float3 CameraDirection;            // Offset:  768 Size:    12
//   float3 EnvironmentMapColorOffset;  // Offset:  784 Size:    12 [unused]
//   float3 EnvironmentMapColorScale;   // Offset:  800 Size:    12 [unused]
//   float3 AmbientOcclusionRanges;     // Offset:  816 Size:    12 [unused]
//   float3 DepthTextureRcpSize;        // Offset:  832 Size:    12 [unused]
//   float2 MotionVectorOffsets;        // Offset:  848 Size:     8 [unused]
//   float2 DepthRangeCompression;      // Offset:  856 Size:     8 [unused]
//   float ShadowProjDepthMinValue;     // Offset:  864 Size:     4 [unused]
//   float DistanceScale;               // Offset:  868 Size:     4 [unused]
//   float WorldSpaceZOffset;           // Offset:  872 Size:     4 [unused]
//   float WorldSpaceZOffset_Previous;  // Offset:  876 Size:     4 [unused]
//   float CameraFOVDeg;                // Offset:  880 Size:     4 [unused]
//   float EffectsEmissiveEVBias;       // Offset:  884 Size:     4 [unused]
//   float ShadowCSMLastSliceIndex;     // Offset:  888 Size:     4 [unused]
//   float UseNormalization;            // Offset:  892 Size:     4 [unused]
//   float FogUndergroundColorScale;    // Offset:  896 Size:     4 [unused]
//
// }
//
// cbuffer CSceneTerrainSkyOcclusionAtlasPrivateData
// {
//
//   float4 SectorOcclusion_OffsetScale;// Offset:    0 Size:    16
//   float3 SectorOcclusion_DistanceFade;// Offset:   16 Size:    12
//   float2 SectorOcclusion_HeightOffsetScale;// Offset:   32 Size:     8
//
// }
//
// cbuffer CAmbientProvider
// {
//
//   float4 CascadeDistanceScales[5];   // Offset:    0 Size:    80 [unused]
//   float4 CascadeNearFarSnappedOffsetCamera[5];// Offset:   80 Size:    80 [unused]
//   float4 CascadeNearFarRcpUVSize[5]; // Offset:  160 Size:    80 [unused]
//   float4 UndergroundSHR;             // Offset:  240 Size:    16
//   float4 UndergroundSHG;             // Offset:  256 Size:    16
//   float4 UndergroundSHB;             // Offset:  272 Size:    16
//   float InvUndergroundBlendEndHeight;// Offset:  288 Size:     4
//   float IndirectLightingScale;       // Offset:  292 Size:     4 [unused]
//
// }
//
// cbuffer CWaterParameterProvider
// {
//
//   float4 BorderAlphaMask;            // Offset:    0 Size:    16 [unused]
//   float ReflectionInvSquareFadeDistance;// Offset:   16 Size:     4 [unused]
//   float ReflectionSquareFadeDistance;// Offset:   20 Size:     4 [unused]
//   float SunLightScale;               // Offset:   24 Size:     4
//
// }
//
// cbuffer CWaterWaveParameterProvider
// {
//
//   float4 WaterWave_CameraCenter_FrontVector;// Offset:    0 Size:    16
//   float4 WaterWave_CameraRightVector_;// Offset:   16 Size:    16
//   float4 WaterWave_CameraTanFOVx_2_Near_Far;// Offset:   32 Size:    16
//
// }
//
// cbuffer Water
// {
//
//   float4 Extinctions;                // Offset:    0 Size:    16
//   float4 MaterialPickingID;          // Offset:   16 Size:    16 [unused]
//   float4 RefractionWaveInfo;         // Offset:   32 Size:    16 [unused]
//   float4 Specular;                   // Offset:   48 Size:    16
//   float4 WaterColor;                 // Offset:   64 Size:    16
//   float4 WaterColorModulation;       // Offset:   80 Size:    16
//   float2 BaseTiling;                 // Offset:   96 Size:     8 [unused]
//   float2 DiffuseTiling;              // Offset:  104 Size:     8 [unused]
//   float2 Dir1;                       // Offset:  112 Size:     8 [unused]
//   float2 Dir2;                       // Offset:  120 Size:     8 [unused]
//   float2 Dir3;                       // Offset:  128 Size:     8 [unused]
//   float2 Tiling1;                    // Offset:  136 Size:     8 [unused]
//   float2 Tiling2;                    // Offset:  144 Size:     8 [unused]
//   float2 Tiling3;                    // Offset:  152 Size:     8 [unused]
//   float CausticsIntensity;           // Offset:  160 Size:     4 [unused]
//   float CausticsScale;               // Offset:  164 Size:     4 [unused]
//   float DiffuseSpeedFactor;          // Offset:  168 Size:     4 [unused]
//   float NormalModifier;              // Offset:  172 Size:     4
//   float NormalOffsetScale;           // Offset:  176 Size:     4
//   float NormalTexture3Blend;         // Offset:  180 Size:     4
//   float ReflectionAnisotropicDistanceOffset;// Offset:  184 Size:     4 [unused]
//   float ReflectionAnisotropicDistanceScale;// Offset:  188 Size:     4 [unused]
//   float ReflectionColorOffset;       // Offset:  192 Size:     4
//   float ReflectionColorScale;        // Offset:  196 Size:     4
//   float ReflectionNormalOffsetScale; // Offset:  200 Size:     4 [unused]
//
// }
//
// cbuffer CVolumetricFogBlendedProvider
// {
//
//   float4 VFDepthDistribution;        // Offset:    0 Size:    16
//   float4 VFDepthParams;              // Offset:   16 Size:    16 [unused]
//   int4 VFCellParams;                 // Offset:   32 Size:    16
//
// }
//
// cbuffer CTileLightingBlendedParameterProvider
// {
//
//   float4 CSMSlice0_0;                // Offset:    0 Size:    16 [unused]
//   float4 CSMSlice0_1;                // Offset:   16 Size:    16 [unused]
//   float4 CSMSlice0_2;                // Offset:   32 Size:    16 [unused]
//   float4 CSMSlice1_0;                // Offset:   48 Size:    16 [unused]
//   float4 CSMSlice1_1;                // Offset:   64 Size:    16 [unused]
//   float4 CSMSlice1_2;                // Offset:   80 Size:    16 [unused]
//   float4 CSMSlice2_0;                // Offset:   96 Size:    16 [unused]
//   float4 CSMSlice2_1;                // Offset:  112 Size:    16 [unused]
//   float4 CSMSlice2_2;                // Offset:  128 Size:    16 [unused]
//   float4 CSMSliceFade;               // Offset:  144 Size:    16 [unused]
//   float4 ShadowMapSize;              // Offset:  160 Size:    16 [unused]
//   float4 SunColor;                   // Offset:  176 Size:    16
//   float4 SunDirection;               // Offset:  192 Size:    16
//   int2 NumTiles;                     // Offset:  208 Size:     8
//   int LightCount;                    // Offset:  216 Size:     4 [unused]
//   int ParticlesSmallBufferFactor;    // Offset:  220 Size:     4 [unused]
//
// }
//
// Resource bind info for ExposureBuffer
// {
//
//   float4 $Element;                   // Offset:    0 Size:    16
//
// }
//
// Resource bind info for SHOccGlobalProbe
// {
//
//   float4 $Element;                   // Offset:    0 Size:    16
//
// }
//
// Resource bind info for SkyParamBuffer
// {
//
//   struct ComputedSkyParameters
//   {
//       
//       float r[9];                    // Offset:    0
//       float g[9];                    // Offset:   36
//       float b[9];                    // Offset:   72
//       float3 sunColor;               // Offset:  108
//       float3 moonColor;              // Offset:  120
//
//   } $Element;                        // Offset:    0 Size:   132
//
// }
//
// Resource bind info for LightsLightingData
// {
//
//   struct LightingData
//   {
//       
//       float4 pos;                    // Offset:    0
//       float4 color;                  // Offset:   16
//       float4 direction;              // Offset:   32
//       float attenuation;             // Offset:   48
//       float2 spotFactors;            // Offset:   52
//       uint flags;                    // Offset:   60
//       float4 clippingInfo;           // Offset:   64
//       float4 clipPlanes[3];          // Offset:   80
//
//   } $Element;                        // Offset:    0 Size:   128
//
// }
//
// Resource bind info for ShadowData
// {
//
//   struct ShadowProjTextureData
//   {
//       
//       float4 shadowMapSize;          // Offset:    0
//       float4x4 shadowProjectionMatrix;// Offset:   16
//       float4 spotScaleOffsetUVs;     // Offset:   80
//
//   } $Element;                        // Offset:    0 Size:    96
//
// }
//
// Resource bind info for LightIndicesPerTileForBlended
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
// Resource bind info for LightOutputPerTileForBlended
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// DepthVPSampler__SampObj__         sampler      NA          NA    0        1
// EnvironmentMapBRDFTexture__SampObj__    sampler      NA          NA    1        1
// SectorHemiMapSamplerStateLinear    sampler      NA          NA    2        1
// WaterWaveTexture__SampObj__       sampler      NA          NA    3        1
// NormalTexture__SampObj__          sampler      NA          NA    4        1
// NormalTexture3__SampObj__         sampler      NA          NA    5        1
// ReflectionCubeTexture__SampObj__    sampler      NA          NA    6        1
// ColorClamp3D                      sampler      NA          NA    7        1
// ProjectedTexture0__SampObj__      sampler      NA          NA    8        1
// DepthVPSampler__TexObj__          texture  float4          2d    0        1
// EnvironmentMapBRDFTexture__TexObj__    texture  float4          2d    1        1
// ExposureBuffer                    texture  struct         r/o    2        1
// SHOccGlobalProbe                  texture  struct         r/o    3        1
// SkyParamBuffer                    texture  struct         r/o    4        1
// SectorOcclusion_HeightTexture__TexObj__    texture  float4          2d    5        1
// WaterWaveTexture__TexObj__        texture  float4          2d    6        1
// NormalTexture__TexObj__           texture  float4          2d    7        1
// NormalTexture3__TexObj__          texture  float4          2d    8        1
// ReflectionCubeTexture__TexObj__    texture  float4        cube    9        1
// VFVolumeTextureRGB                texture  float4          3d   10        1
// VFVolumeTextureAlpha              texture  float4          3d   11        1
// ProjectedTexture0__TexObj__       texture  float4          2d   12        1
// LightsLightingData                texture  struct         r/o   13        1
// ShadowData                        texture  struct         r/o   14        1
// LightIndicesPerTileForBlended     texture  struct         r/o   15        1
// LightOutputPerTileForBlended      texture  struct         r/o   16        1
// CViewportShaderParameterProvider    cbuffer      NA          NA    0        1
// CSceneTerrainSkyOcclusionAtlasPrivateData    cbuffer      NA          NA    1        1
// CAmbientProvider                  cbuffer      NA          NA    2        1
// CWaterParameterProvider           cbuffer      NA          NA    3        1
// CWaterWaveParameterProvider       cbuffer      NA          NA    4        1
// Water                             cbuffer      NA          NA    5        1
// CVolumetricFogBlendedProvider     cbuffer      NA          NA    6        1
// CTileLightingBlendedParameterProvider    cbuffer      NA          NA    7        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy  
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyz         3     NONE   float   xyz 
// TEXCOORD                 3   xyz         4     NONE   float   xyz 
// TEXCOORD                 4   xyz         5     NONE   float   xyz 
// TEXCOORD                 5   xy          6     NONE   float   xy  
// SV_IsFrontFace           0   x           7    FFACE    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 cb0[49], immediateIndexed
dcl_constantbuffer cb1[3], immediateIndexed
dcl_constantbuffer cb2[19], immediateIndexed
dcl_constantbuffer cb3[2], immediateIndexed
dcl_constantbuffer cb4[3], immediateIndexed
dcl_constantbuffer cb5[13], immediateIndexed
dcl_constantbuffer cb6[3], immediateIndexed
dcl_constantbuffer cb7[14], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_sampler s7, mode_default
dcl_sampler s8, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_structured t2, 16 
dcl_resource_structured t3, 16 
dcl_resource_structured t4, 132 
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_texturecube (float,float,float,float) t9
dcl_resource_texture3d (float,float,float,float) t10
dcl_resource_texture3d (float,float,float,float) t11
dcl_resource_texture2d (float,float,float,float) t12
dcl_resource_structured t13, 128 
dcl_resource_structured t14, 96 
dcl_resource_structured t15, 4 
dcl_resource_structured t16, 4 
dcl_input_ps_siv linear noperspective centroid v0.xy, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear centroid v2.xyzw
dcl_input_ps linear v3.xyz
dcl_input_ps linear v4.xyz
dcl_input_ps linear v5.xyz
dcl_input_ps linear v6.xy
dcl_output o0.xyzw
dcl_temps 24

// 3DMigoto StereoParams:
dcl_resource_texture2d (float,float,float,float) t125

ld_indexable(texture2d)(float,float,float,float) r21.xyzw, l(0, 0, 0, 0), t125.xyzw


// Camera Position (environment reflections, etc) adjustment inserted with DarkStarSword's asmtool.py:
// asmtool.py -i --fix-fcprimal-camera-pos dbf56d186058ba85-ps.txt
mul r22.x, r21.x, r21.y
mul r22.x, r22.x, cb0[0].x
mov r22.yzw, l(0.0)
dp4 r23.x, r22.xyzw, cb0[4].xyzw
dp4 r23.y, r22.xyzw, cb0[5].xyzw
dp4 r23.z, r22.xyzw, cb0[6].xyzw
mov r22.xyzw, cb0[42].xyzw
add r22.xyz, r22.xyz, r23.xyz

dp3 r0.x, v3.xyzx, v3.xyzx
sqrt r0.x, r0.x
add r0.yzw, -v4.xxzy, r22.xxzy
dp3 r1.x, r0.yzwy, r0.yzwy
rsq r1.x, r1.x
mul r1.yzw, r0.yyzw, r1.xxxx
sample_indexable(texture2d)(float,float,float,float) r2.xyz, v1.yxyy, t7.xywz, s4
mad r2.yz, r2.zzyz, l(0.000000, 2.007874, 2.007874, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
mul r2.yw, r2.yyyz, cb5[10].wwww
dp2 r3.x, r2.ywyy, r2.ywyy
min r3.x, r3.x, l(1.000000)
mad r3.x, -r3.x, l(0.999000), l(1.000000)
sqrt r2.z, r3.x
sample_indexable(texture2d)(float,float,float,float) r3.xyz, v1.wzww, t7.xywz, s4
mul r3.x, r3.x, l(0.500000)
mad r3.yz, r3.zzyz, l(0.000000, 2.007874, 2.007874, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
mul r3.yw, r3.yyyz, cb5[10].wwww
dp2 r4.x, r3.ywyy, r3.ywyy
min r4.x, r4.x, l(1.000000)
mad r4.x, -r4.x, l(0.999000), l(1.000000)
sqrt r3.z, r4.x
sample_indexable(texture2d)(float,float,float,float) r4.xyz, v6.yxyy, t8.xywz, s5
mad r4.yz, r4.zzyz, l(0.000000, 2.007874, 2.007874, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
mul r4.yw, r4.yyyz, cb5[10].wwww
dp2 r5.x, r4.ywyy, r4.ywyy
min r5.x, r5.x, l(1.000000)
mad r5.x, -r5.x, l(0.999000), l(1.000000)
sqrt r4.z, r5.x
add r2.yzw, r2.yyzw, r3.yyzw
add r3.yzw, -r2.yyzw, r4.yyzw
mad r2.yzw, cb5[11].yyyy, r3.yyzw, r2.yyzw
dp3 r3.y, r2.yzwy, r2.yzwy
rsq r3.y, r3.y
mad r2.x, r2.x, l(0.500000), r3.x
add r3.x, -r2.x, r4.x
mad r2.x, cb5[11].y, r3.x, r2.x
mov_sat r3.x, cb5[10].w
add r2.x, r2.x, l(-1.000000)
mad r2.x, r3.x, r2.x, l(1.000000)
mul r2.x, r2.x, cb5[3].x
mul r4.x, r0.x, l(0.010000)
add r3.xz, v4.xxyx, -cb4[0].xxyx
dp2 r3.x, cb4[0].zwzz, r3.xzxx
mul r3.z, cb4[2].z, cb4[2].y
div r3.x, l(1.000000, 1.000000, 1.000000, 1.000000), r3.x
mad r3.x, r3.z, r3.x, -cb4[2].z
add r3.w, -cb4[2].z, cb4[2].y
div r3.x, r3.x, r3.w
mov r5.x, -r4.x
mov r5.y, l(0)
add r5.xy, r5.xyxx, v4.xyxx
add r5.xy, r5.xyxx, -cb4[0].xyxx
dp2 r4.w, cb4[0].zwzz, r5.xyxx
dp2 r5.x, cb4[1].xyxx, r5.xyxx
div r5.y, l(1.000000, 1.000000, 1.000000, 1.000000), r4.w
mad r5.y, r3.z, r5.y, -cb4[2].z
div r6.y, r5.y, r3.w
mul r4.w, r4.w, cb4[2].x
div r4.w, r5.x, r4.w
mad r6.x, r4.w, l(0.500000), l(0.500000)
mov r4.y, l(0)
add r5.xyzw, r4.xyyx, v4.xyxy
add r5.xyzw, r5.xyzw, -cb4[0].xyxy
dp2 r4.w, cb4[0].zwzz, r5.xyxx
dp2 r5.x, cb4[1].xyxx, r5.xyxx
div r5.y, l(1.000000, 1.000000, 1.000000, 1.000000), r4.w
mad r5.y, r3.z, r5.y, -cb4[2].z
div r7.y, r5.y, r3.w
mul r4.w, r4.w, cb4[2].x
div r4.w, r5.x, r4.w
mad r7.x, r4.w, l(0.500000), l(0.500000)
mov r4.z, -r4.x
add r4.yz, r4.yyzy, v4.xxyx
add r4.yz, r4.yyzy, -cb4[0].xxyx
dp2 r4.w, cb4[0].zwzz, r4.yzyy
dp2 r4.y, cb4[1].xyxx, r4.yzyy
div r4.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.w
mad r4.z, r3.z, r4.z, -cb4[2].z
div r5.y, r4.z, r3.w
mul r4.z, r4.w, cb4[2].x
div r4.y, r4.y, r4.z
mad r5.x, r4.y, l(0.500000), l(0.500000)
dp2 r4.y, cb4[0].zwzz, r5.zwzz
dp2 r4.z, cb4[1].xyxx, r5.zwzz
div r4.w, l(1.000000, 1.000000, 1.000000, 1.000000), r4.y
mad r3.z, r3.z, r4.w, -cb4[2].z
div r8.y, r3.z, r3.w
mul r3.z, r4.y, cb4[2].x
div r3.z, r4.z, r3.z
mad r8.x, r3.z, l(0.500000), l(0.500000)
sample_indexable(texture2d)(float,float,float,float) r3.z, r6.xyxx, t6.yzxw, s3
sample_indexable(texture2d)(float,float,float,float) r3.w, r7.xyxx, t6.yzwx, s3
sample_indexable(texture2d)(float,float,float,float) r4.y, r5.xyxx, t6.yxzw, s3
sample_indexable(texture2d)(float,float,float,float) r4.z, r8.xyxx, t6.yzxw, s3
add r5.w, -r3.z, r3.w
add r5.y, -r4.y, r4.z
div r3.zw, r5.yyyw, r4.xxxx
add r3.x, r3.x, l(-0.900000)
mul_sat r3.x, r3.x, l(10.000000)
mad r3.x, r3.x, l(-0.050000), l(0.050000)
mul r4.yw, r3.xxxx, r3.zzzw
mov r4.z, l(0)
mad r2.yzw, r2.yyzw, r3.yyyy, r4.yyzw
dp3 r3.x, r2.yzwy, r2.yzwy
rsq r3.x, r3.x
mul r3.yzw, r2.yyzw, r3.xxxx
mad r4.xy, r3.wyww, cb5[11].xxxx, v4.xyxx
mul r2.y, |cb0[48].z|, l(0.100000)
dp3 r2.z, r3.wzyw, r1.yzwy
mov_sat r2.w, r2.z
mad r5.x, r2.w, l(0.968750), l(0.015625)
mad r5.y, r2.x, l(0.968750), l(0.015625)
sample_l_indexable(texture2d)(float,float,float,float) r5.xy, r5.xyxx, t1.xyzw, s1, l(0.000000)
mad_sat r2.y, r2.y, r5.y, r5.x
mov r3.x, l(1.000000)
mul r5.xyzw, r3.xyzw, l(0.282094806, 0.488602519, 0.488602519, 0.488602519)
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r6.xyzw, l(0), l(0), t3.xyzw
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r7.xyzw, l(1), l(0), t3.xyzw
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r8.xyzw, l(2), l(0), t3.xyzw
dp4 r6.x, r6.xyzw, r5.xyzw
dp4 r6.y, r7.xyzw, r5.xyzw
dp4 r6.z, r8.xyzw, r5.xyzw
max r6.xyz, r6.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r7.xyzw, l(0), l(108), t4.xywz
dp3 r3.x, r7.xywx, l(0.212600, 0.715200, 0.072200, 0.000000)
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r7.xy, l(0), l(124), t4.xyxx
dp3 r6.w, r7.zxyz, l(0.212600, 0.715200, 0.072200, 0.000000)
max r3.x, r3.x, r6.w
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r6.w, l(0), l(0), t4.xxxx
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r7.x, l(0), l(36), t4.xxxx
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r7.y, l(0), l(72), t4.xxxx
max r7.x, r7.y, r7.x
max r6.w, r6.w, r7.x
add r3.x, r3.x, r6.w
mul r7.xyz, r3.xxxx, r6.xyzx
dp4 r8.x, cb2[15].xyzw, r5.xyzw
dp4 r8.y, cb2[16].xyzw, r5.xyzw
dp4 r8.z, cb2[17].xyzw, r5.xyzw
max r5.xyz, r8.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mad r8.xy, v4.yxyy, cb1[0].yxyy, cb1[0].wzww
sample_l_indexable(texture2d)(float,float,float,float) r5.w, r8.xyxx, t5.xzwy, s2, l(0.000000)
mad r5.w, r5.w, cb1[2].x, cb1[2].y
add r5.w, -r5.w, v4.z
mul_sat r5.w, -r5.w, cb2[18].x
sqrt r5.w, r5.w
add r8.xy, v4.xyxx, -r22.xyxx
dp2 r6.w, r8.xyxx, r8.xyxx
mad r6.w, cb1[1].x, r6.w, cb1[1].y
mul_sat r6.w, r6.w, l(3.000000)
mul r5.w, r5.w, r6.w
mad r5.xyz, -r6.xyzx, r3.xxxx, r5.xyzx
mad r5.xyz, r5.wwww, r5.xyzx, r7.xyzx
div r6.xy, v5.xyxx, v5.zzzz
sample_l_indexable(texture2d)(float,float,float,float) r6.z, r6.xyxx, t0.yzxw, s0, l(0.000000)
mov r6.w, l(1.000000)
dp4 r3.x, r6.xyzw, cb0[2].xyzw
dp4 r5.w, r6.xyzw, cb0[3].xyzw
div r3.x, -r3.x, r5.w
mul r3.x, r0.x, -r3.x
div r3.x, r3.x, v3.z
mad r6.xy, -r2.xxxx, l(0.990000, 6.000000, 0.000000, 0.000000), l(1.000000, 6.000000, 0.000000, 0.000000)
mul r2.x, r6.x, r6.x
max r2.x, r2.x, l(0.001000)
ftou r6.xz, v0.xxyx
ushr r7.xy, r6.xzxx, l(3, 3, 0, 0)
imad r5.w, r7.y, cb7[13].x, r7.x
mul r7.xyz, cb3[1].zzzz, cb7[11].xyzx
mad r8.xyz, r0.ywzy, r1.xxxx, -cb7[12].xyzx
dp3 r6.w, r8.xyzx, r8.xyzx
rsq r6.w, r6.w
mul r8.xyz, r6.wwww, r8.xyzx
dp3 r6.w, r8.xzyx, r1.yzwy
add r6.w, -r6.w, l(1.000000)
mul r7.w, r6.w, r6.w
mul r7.w, r7.w, r7.w
mul r6.w, r6.w, r7.w
mad r6.w, r6.w, l(0.980000), l(0.020000)
dp3_sat r7.w, -cb7[12].yzxy, r3.yzwy
mul r8.w, r2.w, r2.w
mul r9.x, r2.x, r2.x
mad r9.y, -r2.x, r2.x, l(1.000000)
mad r8.w, r8.w, r9.y, r9.x
sqrt r8.w, r8.w
mul r9.z, r7.w, r7.w
mad r9.z, r9.z, r9.y, r9.x
sqrt r9.z, r9.z
mul r9.z, r2.w, r9.z
mad r9.z, r7.w, r8.w, r9.z
add r9.z, r9.z, r9.z
max r9.z, r9.z, l(0.000100)
div r9.z, l(1.000000, 1.000000, 1.000000, 1.000000), r9.z
dp3_sat r8.x, r8.yzxy, r3.yzwy
mad r8.y, r2.x, r2.x, l(-1.000000)
mul r8.x, r8.x, r8.x
mad r8.x, r8.x, r8.y, l(1.000000)
div r8.x, r2.x, r8.x
mul r8.x, r8.x, r8.x
mul r10.xyz, r7.xyzx, r8.xxxx
mul r10.xyz, r7.wwww, r10.xyzx
mul r10.xyz, r9.zzzz, r10.xyzx
mul r10.xyz, r6.wwww, r10.xyzx
mul r7.xyz, r7.xyzx, r7.wwww
ishl r6.w, r5.w, l(1)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r6.w, r6.w, l(0), t15.xxxx
countbits r7.w, r6.w
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r8.x, r5.w, l(0), t16.xxxx
and r8.x, r8.x, l(0x60000000)
ine r8.x, r8.x, l(0)
mov r4.z, v4.z
mov r4.w, l(1.000000)
mov r11.xyz, r7.xyzx
mov r12.xyz, r10.xyzx
mov r8.z, r6.w
mov r9.z, l(0)
loop 
  uge r9.w, r9.z, r7.w
  breakc_nz r9.w
  firstbit_lo r9.w, r8.z
  ishl r10.w, l(1), r9.w
  not r10.w, r10.w
  and r8.z, r8.z, r10.w
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r13.xyzw, r9.w, l(0), t13.xyzw
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r14.xyz, r9.w, l(16), t13.xyzx
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r15.xyz, r9.w, l(32), t13.xyzx
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r16.xyzw, r9.w, l(48), t13.xyzw
  and r17.xyzw, r16.wwww, l(32, 16, 1, 4)
  ult r17.xyzw, l(0, 0, 0, 0), r17.xyzw
  ushr r9.w, r16.w, l(5)
  and r9.w, r9.w, l(2)
  or r10.w, r17.y, r17.x
  and r10.w, r8.x, r10.w
  if_nz r10.w
    ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r18.xyzw, r9.w, l(16), t14.xyzw
    ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r19.xyzw, r9.w, l(32), t14.xyzw
  else 
    mov r18.xyzw, l(0,0,0,0)
    mov r19.xyzw, l(0,0,0,0)
  endif 
  add r13.xyz, -r13.xyzx, v4.xyzx
  dp3 r10.w, r13.xyzx, r13.xyzx
  max r11.w, r10.w, l(0.000010)
  div r12.w, l(1.000000, 1.000000, 1.000000, 1.000000), r11.w
  min r12.w, r12.w, r13.w
  mul r11.w, r11.w, r11.w
  mad_sat r11.w, -r11.w, r16.x, l(1.000000)
  mul r11.w, r11.w, r11.w
  mul r11.w, r11.w, r12.w
  mul r14.xyz, r11.wwww, r14.xyzx
  rsq r10.w, r10.w
  mul r20.xyz, r10.wwww, r13.xyzx
  dp3 r10.w, r20.xyzx, r15.xyzx
  mad_sat r10.w, r10.w, r16.y, r16.z
  mul r10.w, r10.w, r10.w
  mul r15.xyz, r14.xyzx, r10.wwww
  movc r14.xyz, r17.zzzz, r15.xyzx, r14.xyzx
  mad r15.xyz, r0.ywzy, r1.xxxx, -r13.xyzx
  dp3 r10.w, r15.xyzx, r15.xyzx
  rsq r10.w, r10.w
  mul r15.xyz, r10.wwww, r15.xyzx
  dp3 r10.w, r15.xzyx, r1.yzwy
  add r10.w, -r10.w, l(1.000000)
  mul r11.w, r10.w, r10.w
  mul r11.w, r11.w, r11.w
  mul r10.w, r10.w, r11.w
  mad r10.w, r10.w, l(0.980000), l(0.020000)
  and r11.w, r17.x, r17.z
  if_z r9.w
    dp4 r16.x, r4.xyzw, r18.xyzw
    dp4 r16.y, r4.xyzw, r19.xyzw
    sample_l_indexable(texture2d)(float,float,float,float) r16.xyz, r16.xyxx, t12.xyzw, s8, l(0.000000)
    mul r16.xyz, r14.xyzx, r16.xyzx
  else 
    mov r16.xyz, r14.xyzx
  endif 
  movc r14.xyz, r11.wwww, r16.xyzx, r14.xyzx
  dp3_sat r9.w, -r13.yzxy, r3.yzwy
  mul r11.w, r9.w, r9.w
  mad r11.w, r11.w, r9.y, r9.x
  sqrt r11.w, r11.w
  mul r11.w, r2.w, r11.w
  mad r11.w, r9.w, r8.w, r11.w
  add r11.w, r11.w, r11.w
  max r11.w, r11.w, l(0.000100)
  div r11.w, l(1.000000, 1.000000, 1.000000, 1.000000), r11.w
  movc r12.w, r17.w, l(0.001500), l(0.050000)
  dp3_sat r13.x, r15.yzxy, r3.yzwy
  mul r13.x, r13.x, r13.x
  mad r13.x, r13.x, r8.y, l(1.000000)
  div r13.x, r2.x, r13.x
  mul r13.x, r13.x, r13.x
  mul r13.xyz, r13.xxxx, r14.xyzx
  mul r13.xyz, r9.wwww, r13.xyzx
  mul r13.xyz, r11.wwww, r13.xyzx
  mul r13.xyz, r12.wwww, r13.xyzx
  mad r12.xyz, r13.xyzx, r10.wwww, r12.xyzx
  mad r11.xyz, r9.wwww, r14.xyzx, r11.xyzx
  iadd r9.z, r9.z, l(1)
endloop 
bfi r5.w, l(31), l(1), r5.w, l(1)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r5.w, r5.w, l(0), t15.xxxx
countbits r6.w, r5.w
mov r4.z, v4.z
mov r4.w, l(1.000000)
mov r7.xyz, r11.xyzx
mov r10.xyz, r12.xyzx
mov r7.w, r5.w
mov r8.z, l(0)
loop 
  uge r9.z, r8.z, r6.w
  breakc_nz r9.z
  firstbit_lo r9.z, r7.w
  ishl r9.w, l(1), r9.z
  not r9.w, r9.w
  and r7.w, r7.w, r9.w
  iadd r9.z, l(32), r9.z
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r13.xyzw, r9.z, l(0), t13.xyzw
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r14.xyz, r9.z, l(16), t13.xyzx
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r15.xyz, r9.z, l(32), t13.xyzx
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r16.xyzw, r9.z, l(48), t13.xyzw
  and r17.xyzw, r16.wwww, l(32, 16, 1, 4)
  ult r17.xyzw, l(0, 0, 0, 0), r17.xyzw
  ushr r9.z, r16.w, l(5)
  and r9.z, r9.z, l(2)
  or r9.w, r17.y, r17.x
  and r9.w, r8.x, r9.w
  if_nz r9.w
    ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r18.xyzw, r9.z, l(16), t14.xyzw
    ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r19.xyzw, r9.z, l(32), t14.xyzw
  else 
    mov r18.xyzw, l(0,0,0,0)
    mov r19.xyzw, l(0,0,0,0)
  endif 
  add r13.xyz, -r13.xyzx, v4.xyzx
  dp3 r9.w, r13.xyzx, r13.xyzx
  max r10.w, r9.w, l(0.000010)
  div r11.w, l(1.000000, 1.000000, 1.000000, 1.000000), r10.w
  min r11.w, r11.w, r13.w
  mul r10.w, r10.w, r10.w
  mad_sat r10.w, -r10.w, r16.x, l(1.000000)
  mul r10.w, r10.w, r10.w
  mul r10.w, r10.w, r11.w
  mul r14.xyz, r10.wwww, r14.xyzx
  rsq r9.w, r9.w
  mul r20.xyz, r9.wwww, r13.xyzx
  dp3 r9.w, r20.xyzx, r15.xyzx
  mad_sat r9.w, r9.w, r16.y, r16.z
  mul r9.w, r9.w, r9.w
  mul r15.xyz, r14.xyzx, r9.wwww
  movc r14.xyz, r17.zzzz, r15.xyzx, r14.xyzx
  mad r15.xyz, r0.ywzy, r1.xxxx, -r13.xyzx
  dp3 r9.w, r15.xyzx, r15.xyzx
  rsq r9.w, r9.w
  mul r15.xyz, r9.wwww, r15.xyzx
  dp3 r9.w, r15.xzyx, r1.yzwy
  add r9.w, -r9.w, l(1.000000)
  mul r10.w, r9.w, r9.w
  mul r10.w, r10.w, r10.w
  mul r9.w, r9.w, r10.w
  mad r9.w, r9.w, l(0.980000), l(0.020000)
  and r10.w, r17.x, r17.z
  if_z r9.z
    dp4 r16.x, r4.xyzw, r18.xyzw
    dp4 r16.y, r4.xyzw, r19.xyzw
    sample_l_indexable(texture2d)(float,float,float,float) r16.xyz, r16.xyxx, t12.xyzw, s8, l(0.000000)
    mul r16.xyz, r14.xyzx, r16.xyzx
  else 
    mov r16.xyz, r14.xyzx
  endif 
  movc r14.xyz, r10.wwww, r16.xyzx, r14.xyzx
  dp3_sat r9.z, -r13.yzxy, r3.yzwy
  mul r10.w, r9.z, r9.z
  mad r10.w, r10.w, r9.y, r9.x
  sqrt r10.w, r10.w
  mul r10.w, r2.w, r10.w
  mad r10.w, r9.z, r8.w, r10.w
  add r10.w, r10.w, r10.w
  max r10.w, r10.w, l(0.000100)
  div r10.w, l(1.000000, 1.000000, 1.000000, 1.000000), r10.w
  movc r11.w, r17.w, l(0.001500), l(0.050000)
  dp3_sat r12.w, r15.yzxy, r3.yzwy
  mul r12.w, r12.w, r12.w
  mad r12.w, r12.w, r8.y, l(1.000000)
  div r12.w, r2.x, r12.w
  mul r12.w, r12.w, r12.w
  mul r13.xyz, r12.wwww, r14.xyzx
  mul r13.xyz, r9.zzzz, r13.xyzx
  mul r13.xyz, r10.wwww, r13.xyzx
  mul r13.xyz, r11.wwww, r13.xyzx
  mad r10.xyz, r13.xyzx, r9.wwww, r10.xyzx
  mad r7.xyz, r9.zzzz, r14.xyzx, r7.xyzx
  iadd r8.z, r8.z, l(1)
endloop 
dp3 r0.y, r5.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
add_sat r4.xyz, cb5[5].xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
add r0.z, r2.z, r2.z
mad r1.xyz, r3.wzyw, -r0.zzzz, r1.yzwy
mul r0.yzw, r0.yyyy, r4.xxyz
mov r1.xyz, -r1.xyzx
sample_l_indexable(texturecube)(float,float,float,float) r1.xyz, r1.xyzx, t9.xyzw, s6, r6.y
mul r0.yzw, r0.yyzw, r1.xxyz
mad r0.yzw, r0.yyzw, cb5[12].yyyy, cb5[12].xxxx
add r0.x, -r0.x, r3.x
mul r0.x, r0.x, -cb5[0].x
exp r0.x, r0.x
add r0.x, -r0.x, l(1.000000)
max r0.x, r0.x, l(0.000000)
add r1.xyz, r5.xyzx, r7.xyzx
mul r1.xyz, r1.xyzx, l(0.980000, 0.980000, 0.980000, 0.000000)
mad r0.yzw, r0.yyzw, r2.yyyy, r10.xxyz
mul r2.xyz, r4.xyzx, cb5[4].xyzx
mul r0.yzw, r0.xxxx, r0.yyzw
mad r0.yzw, r1.xxyz, r2.xxyz, r0.yyzw
lt r1.xy, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[39].zwzz
and r1.x, r1.y, r1.x
if_nz r1.x
  add r1.xyz, v4.xyzx, -r22.xyzx
  dp3 r1.x, r1.xyzx, r1.xyzx
  sqrt r1.x, r1.x
  utof r1.yz, r6.xxzx
  mul r2.xy, r1.yzyy, cb0[40].zwzz
  add r1.x, r1.x, -cb6[0].w
  div r1.x, r1.x, cb6[0].z
  log r1.x, r1.x
  mul r1.x, r1.x, l(0.250000)
  ushr r1.y, cb6[2].z, l(1)
  utof r1.y, r1.y
  mul r1.x, r1.y, r1.x
  iadd r1.y, cb6[2].z, l(-1)
  itof r1.y, r1.y
  div r2.z, r1.x, r1.y
  sample_l_indexable(texture3d)(float,float,float,float) r1.xyz, r2.xyzx, t10.xyzw, s7, l(0.000000)
  sample_l_indexable(texture3d)(float,float,float,float) r1.w, r2.xyzx, t11.yzwx, s7, l(0.000000)
  ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r2.x, l(0), l(12), t2.xxxx
  mul r1.xyz, r1.xyzx, r2.xxxx
else 
  add r2.xyz, v4.xyzx, -r22.xyzx
  dp3 r2.x, r2.xyzx, r2.xyzx
  sqrt r2.x, r2.x
  mad_sat r2.x, r2.x, cb0[35].y, cb0[35].x
  mul r2.y, r2.z, cb0[39].y
  max r2.y, r2.y, l(-125.000000)
  lt r2.z, l(0.000001), |r2.y|
  exp r2.w, -r2.y
  add r2.w, -r2.w, l(1.000000)
  div r2.y, r2.w, r2.y
  movc r2.y, r2.z, r2.y, l(1.000000)
  mad r2.y, r2.y, cb0[39].x, cb0[35].w
  mul r2.x, r2.y, r2.x
  mul r2.x, r2.x, -cb0[35].z
  exp r1.w, r2.x
  mad r1.xyz, -v2.xyzx, r1.wwww, v2.xyzx
endif 
mad r0.yzw, r0.yyzw, r1.wwww, r1.xxyz
mul r1.xyz, r0.xxxx, r0.yzwy
mov r1.w, -r0.x
mad r0.xyzw, v2.wwww, r1.xyzw, l(0.000000, 0.000000, 0.000000, 1.000000)
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r1.x, l(0), l(0), t2.xxxx
mul r0.xyz, r0.xyzx, r1.xxxx
max r0.xyz, r0.xyzx, l(0.0000610351999, 0.0000610351999, 0.0000610351999, 0.000000)
min o0.xyz, r0.xyzx, l(8192.000000, 8192.000000, 8192.000000, 0.000000)
mov o0.w, r0.w
ret 
// Approximately 462 instruction slots used