// asmtool.py -i --fix-fcprimal-camera-pos 11c8ffe392825278-ps.txt
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.31 on Wed Mar 02 08:06:26 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 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 WaterRiver
// {
//
//   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
//   float3 LayerBlendCff;              // Offset:   96 Size:    12 [unused]
//   float CausticsIntensity;           // Offset:  108 Size:     4 [unused]
//   float3 LayerSpeed;                 // Offset:  112 Size:    12 [unused]
//   float CausticsScale;               // Offset:  124 Size:     4 [unused]
//   float2 BaseTiling;                 // Offset:  128 Size:     8 [unused]
//   float2 CenterDir;                  // Offset:  136 Size:     8 [unused]
//   float2 CenterTiling1;              // Offset:  144 Size:     8 [unused]
//   float2 DiffuseTiling;              // Offset:  152 Size:     8 [unused]
//   float DiffuseSpeedFactor;          // Offset:  160 Size:     4 [unused]
//   float NormalModifier;              // Offset:  164 Size:     4
//   float NormalOffsetScale;           // Offset:  168 Size:     4
//   float ReflectionColorOffset;       // Offset:  172 Size:     4
//   float ReflectionColorScale;        // Offset:  176 Size:     4
//   float ReflectionNormalOffsetScale; // Offset:  180 Size:     4 [unused]
//
// }
//
// cbuffer CVolumetricFogBlendedProvider
// {
//
//   float4 VFDepthDistribution;        // Offset:    0 Size:    16
//   float4 VFDepthParams;              // Offset:   16 Size:    16 [unused]
//   int4 VFCellParams;                 // Offset:   32 Size:    16
//
// }
//
// 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 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
// ReflectionCubeTexture__SampObj__    sampler      NA          NA    5        1
// DiffuseTexture__SampObj__         sampler      NA          NA    6        1
// ColorClamp3D                      sampler      NA          NA    7        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
// ReflectionCubeTexture__TexObj__    texture  float4        cube    8        1
// DiffuseTexture__TexObj__          texture  float4          2d    9        1
// VFVolumeTextureRGB                texture  float4          3d   10        1
// VFVolumeTextureAlpha              texture  float4          3d   11        1
// CViewportShaderParameterProvider    cbuffer      NA          NA    0        1
// CSceneTerrainSkyOcclusionAtlasPrivateData    cbuffer      NA          NA    1        1
// CAmbientProvider                  cbuffer      NA          NA    2        1
// CWaterWaveParameterProvider       cbuffer      NA          NA    3        1
// WaterRiver                        cbuffer      NA          NA    4        1
// CVolumetricFogBlendedProvider     cbuffer      NA          NA    5        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   xyz         6     NONE   float   xyz 
// TEXCOORD                 6   xyzw        7     NONE   float     zw
// SV_IsFrontFace           0   x           8    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[3], immediateIndexed
dcl_constantbuffer cb4[12], immediateIndexed
dcl_constantbuffer cb5[3], 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_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_texturecube (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texture3d (float,float,float,float) t10
dcl_resource_texture3d (float,float,float,float) t11
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.xyz
dcl_input_ps linear v7.zw
dcl_output o0.xyzw
dcl_temps 11

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

ld_indexable(texture2d)(float,float,float,float) r8.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 11c8ffe392825278-ps.txt
mul r9.x, r8.x, r8.y
mul r9.x, r9.x, cb0[0].x
mov r9.yzw, l(0.0)
dp4 r10.x, r9.xyzw, cb0[4].xyzw
dp4 r10.y, r9.xyzw, cb0[5].xyzw
dp4 r10.z, r9.xyzw, cb0[6].xyzw
mov r9.xyzw, cb0[42].xyzw
add r9.xyz, r9.xyz, r10.xyz

mov_sat r0.x, v2.w
dp3 r0.y, v3.xyzx, v3.xyzx
sqrt r0.y, r0.y
add r1.xyz, -v5.xzyx, r9.xzyx
dp3 r0.z, r1.xyzx, r1.xyzx
rsq r0.z, r0.z
mul r1.xyz, r0.zzzz, r1.xyzx
sample_indexable(texture2d)(float,float,float,float) r2.xzw, v1.wxww, t7.yzwx, s4
mad r3.xy, r2.zxzz, l(2.007874, 2.007874, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.z, r3.xyxx, r3.xyxx
min r0.z, r0.z, l(1.000000)
add r0.z, -r0.z, l(1.000000)
sqrt r3.z, r0.z
sample_indexable(texture2d)(float,float,float,float) r4.xzw, v1.wyww, t7.yzwx, s4
mad r5.xy, r4.zxzz, l(2.007874, 2.007874, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.z, r5.xyxx, r5.xyxx
min r0.z, r0.z, l(1.000000)
add r0.z, -r0.z, l(1.000000)
sqrt r5.z, r0.z
sample_indexable(texture2d)(float,float,float,float) r6.xzw, v1.wzww, t7.yzwx, s4
mad r7.xy, r6.zxzz, l(2.007874, 2.007874, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.z, r7.xyxx, r7.xyxx
min r0.z, r0.z, l(1.000000)
add r0.z, -r0.z, l(1.000000)
sqrt r7.z, r0.z
mul r2.xyz, r3.xyzx, v4.xxxx
mul r4.xyz, r5.xyzx, v4.yyyy
mul r6.xyz, r7.xyzx, v4.zzzz
add r2.xyzw, r2.xyzw, r4.xyzw
add r2.xyzw, r2.xyzw, r6.xyzw
mul r3.yw, r2.yyyx, cb4[10].yyyy
mov r3.z, r2.z
dp3 r0.z, r3.yzwy, r3.yzwy
rsq r0.z, r0.z
mul r0.w, r2.w, cb4[3].x
mul r2.x, r0.y, l(0.010000)
add r4.xy, v5.xyxx, -cb3[0].xyxx
dp2 r1.w, cb3[0].zwzz, r4.xyxx
mul r2.w, cb3[2].z, cb3[2].y
div r1.w, l(1.000000, 1.000000, 1.000000, 1.000000), r1.w
mad r1.w, r2.w, r1.w, -cb3[2].z
add r3.x, -cb3[2].z, cb3[2].y
div r1.w, r1.w, r3.x
mov r4.x, -r2.x
mov r4.y, l(0)
add r4.xy, r4.xyxx, v5.xyxx
add r4.xy, r4.xyxx, -cb3[0].xyxx
dp2 r4.z, cb3[0].zwzz, r4.xyxx
dp2 r4.x, cb3[1].xyxx, r4.xyxx
div r4.y, l(1.000000, 1.000000, 1.000000, 1.000000), r4.z
mad r4.y, r2.w, r4.y, -cb3[2].z
div r5.y, r4.y, r3.x
mul r4.y, r4.z, cb3[2].x
div r4.x, r4.x, r4.y
mad r5.x, r4.x, l(0.500000), l(0.500000)
mov r2.y, l(0)
add r4.xyzw, r2.xyyx, v5.xyxy
add r4.xyzw, r4.xyzw, -cb3[0].xyxy
dp2 r5.z, cb3[0].zwzz, r4.xyxx
dp2 r4.x, cb3[1].xyxx, r4.xyxx
div r4.y, l(1.000000, 1.000000, 1.000000, 1.000000), r5.z
mad r4.y, r2.w, r4.y, -cb3[2].z
div r6.y, r4.y, r3.x
mul r4.y, r5.z, cb3[2].x
div r4.x, r4.x, r4.y
mad r6.x, r4.x, l(0.500000), l(0.500000)
mov r2.z, -r2.x
add r2.yz, r2.yyzy, v5.xxyx
add r2.yz, r2.yyzy, -cb3[0].xxyx
dp2 r4.x, cb3[0].zwzz, r2.yzyy
dp2 r2.y, cb3[1].xyxx, r2.yzyy
div r2.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.x
mad r2.z, r2.w, r2.z, -cb3[2].z
div r7.y, r2.z, r3.x
mul r2.z, r4.x, cb3[2].x
div r2.y, r2.y, r2.z
mad r7.x, r2.y, l(0.500000), l(0.500000)
dp2 r2.y, cb3[0].zwzz, r4.zwzz
dp2 r2.z, cb3[1].xyxx, r4.zwzz
div r4.x, l(1.000000, 1.000000, 1.000000, 1.000000), r2.y
mad r2.w, r2.w, r4.x, -cb3[2].z
div r4.y, r2.w, r3.x
mul r2.y, r2.y, cb3[2].x
div r2.y, r2.z, r2.y
mad r4.x, r2.y, l(0.500000), l(0.500000)
sample_indexable(texture2d)(float,float,float,float) r2.y, r5.xyxx, t6.yxzw, s3
sample_indexable(texture2d)(float,float,float,float) r2.z, r6.xyxx, t6.yzxw, s3
sample_indexable(texture2d)(float,float,float,float) r2.w, r7.xyxx, t6.yzwx, s3
sample_indexable(texture2d)(float,float,float,float) r3.x, r4.xyxx, t6.xyzw, s3
add r4.w, -r2.y, r2.z
add r4.y, -r2.w, r3.x
div r2.xy, r4.ywyy, r2.xxxx
add r1.w, r1.w, l(-0.900000)
mul_sat r1.w, r1.w, l(10.000000)
mad r1.w, r1.w, l(-0.050000), l(0.050000)
mul r2.yw, r1.wwww, r2.xxxy
mov r2.z, l(0)
mad r2.xyz, r3.yzwy, r0.zzzz, r2.yzwy
dp3 r0.z, r2.xyzx, r2.xyzx
rsq r0.z, r0.z
mul r2.yzw, r0.zzzz, r2.xxyz
mad r3.xy, r2.wyww, cb4[10].zzzz, v7.zwzz
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.xyxx, t9.xyzw, s6
mul r0.z, |cb0[48].z|, l(0.100000)
dp3 r1.w, r2.wzyw, r1.xyzx
mov_sat r4.x, r1.w
mad r4.x, r4.x, l(0.968750), l(0.015625)
mad r4.y, r0.w, l(0.322916657), l(0.015625)
sample_l_indexable(texture2d)(float,float,float,float) r4.xy, r4.xyxx, t1.xyzw, s1, l(0.000000)
mad_sat r0.z, r0.z, r4.y, r4.x
mov r2.x, l(1.000000)
mul r4.xyzw, r2.xyzw, l(0.282094806, 0.488602519, 0.488602519, 0.488602519)
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r5.xyzw, l(0), l(0), t3.xyzw
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r6.xyzw, l(1), l(0), t3.xyzw
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r7.xyzw, l(2), l(0), t3.xyzw
dp4 r5.x, r5.xyzw, r4.xyzw
dp4 r5.y, r6.xyzw, r4.xyzw
dp4 r5.z, r7.xyzw, r4.xyzw
max r5.xyz, r5.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r6.xyzw, l(0), l(108), t4.xywz
dp3 r2.x, r6.xywx, l(0.212600, 0.715200, 0.072200, 0.000000)
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r6.xy, l(0), l(124), t4.xyxx
dp3 r5.w, r6.zxyz, l(0.212600, 0.715200, 0.072200, 0.000000)
max r2.x, r2.x, r5.w
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r5.w, l(0), l(0), t4.xxxx
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r6.x, l(0), l(36), t4.xxxx
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r6.y, l(0), l(72), t4.xxxx
max r6.x, r6.y, r6.x
max r5.w, r5.w, r6.x
add r2.x, r2.x, r5.w
mul r6.xyz, r2.xxxx, r5.xyzx
dp4 r7.x, cb2[15].xyzw, r4.xyzw
dp4 r7.y, cb2[16].xyzw, r4.xyzw
dp4 r7.z, cb2[17].xyzw, r4.xyzw
max r4.xyz, r7.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mad r7.xy, v5.yxyy, cb1[0].yxyy, cb1[0].wzww
sample_l_indexable(texture2d)(float,float,float,float) r4.w, r7.xyxx, t5.xzwy, s2, l(0.000000)
mad r4.w, r4.w, cb1[2].x, cb1[2].y
add r4.w, -r4.w, v5.z
mul_sat r4.w, -r4.w, cb2[18].x
sqrt r4.w, r4.w
add r7.xy, v5.xyxx, -r9.xyxx
dp2 r5.w, r7.xyxx, r7.xyxx
mad r5.w, cb1[1].x, r5.w, cb1[1].y
mul_sat r5.w, r5.w, l(3.000000)
mul r4.w, r4.w, r5.w
mad r4.xyz, -r5.xyzx, r2.xxxx, r4.xyzx
mad r4.xyz, r4.wwww, r4.xyzx, r6.xyzx
div r5.xy, v6.xyxx, v6.zzzz
sample_l_indexable(texture2d)(float,float,float,float) r5.z, r5.xyxx, t0.yzxw, s0, l(0.000000)
mov r5.w, l(1.000000)
dp4 r2.x, r5.xyzw, cb0[2].xyzw
dp4 r4.w, r5.xyzw, cb0[3].xyzw
div r2.x, -r2.x, r4.w
mul r2.x, r0.y, -r2.x
div r2.x, r2.x, v3.z
dp3 r4.w, r4.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
add_sat r5.xyz, cb4[5].xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
add r1.w, r1.w, r1.w
mad r1.xyz, r2.wzyw, -r1.wwww, r1.xyzx
mul r2.yzw, r4.wwww, r5.xxyz
mov r1.xyz, -r1.xyzx
mad r0.w, -r0.w, l(2.000000), l(6.000000)
sample_l_indexable(texturecube)(float,float,float,float) r1.xyz, r1.xyzx, t8.xyzw, s5, r0.w
mul r1.xyz, r1.xyzx, r2.yzwy
mad r1.xyz, r1.xyzx, cb4[11].xxxx, cb4[10].wwww
add r0.y, -r0.y, r2.x
mul r0.y, r0.y, -cb4[0].x
exp r0.y, r0.y
add r0.y, -r0.y, l(1.000000)
max r0.y, r0.y, l(0.000000)
mul r2.xyz, r4.xyzx, l(0.980000, 0.980000, 0.980000, 0.000000)
mul r1.xyz, r0.zzzz, r1.xyzx
add r3.xyz, r3.xyzx, -cb4[4].xyzx
mad r3.xyz, r3.wwww, r3.xyzx, cb4[4].xyzx
mul r3.xyz, r5.xyzx, r3.xyzx
mul r1.xyz, r0.yyyy, r1.xyzx
mad r1.xyz, r2.xyzx, r3.xyzx, r1.xyzx
lt r0.zw, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[39].zzzw
and r0.z, r0.w, r0.z
if_nz r0.z
  ftou r0.zw, v0.xxxy
  add r2.xyz, v5.xyzx, -r9.xyzx
  dp3 r1.w, r2.xyzx, r2.xyzx
  sqrt r1.w, r1.w
  utof r0.zw, r0.zzzw
  mul r2.xy, r0.zwzz, cb0[40].zwzz
  add r0.z, r1.w, -cb5[0].w
  div r0.z, r0.z, cb5[0].z
  log r0.z, r0.z
  mul r0.z, r0.z, l(0.250000)
  ushr r0.w, cb5[2].z, l(1)
  utof r0.w, r0.w
  mul r0.z, r0.w, r0.z
  iadd r0.w, cb5[2].z, l(-1)
  itof r0.w, r0.w
  div r2.z, r0.z, r0.w
  sample_l_indexable(texture3d)(float,float,float,float) r3.xyz, r2.xyzx, t10.xyzw, s7, l(0.000000)
  sample_l_indexable(texture3d)(float,float,float,float) r0.z, r2.xyzx, t11.yzxw, s7, l(0.000000)
  ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r0.w, l(0), l(12), t2.xxxx
  mul r2.xyz, r0.wwww, r3.xyzx
else 
  add r3.xyz, v5.xyzx, -r9.xyzx
  dp3 r0.w, r3.xyzx, r3.xyzx
  sqrt r0.w, r0.w
  mad_sat r0.w, r0.w, cb0[35].y, cb0[35].x
  mul r1.w, r3.z, cb0[39].y
  max r1.w, r1.w, l(-125.000000)
  lt r2.w, l(0.000001), |r1.w|
  exp r3.x, -r1.w
  add r3.x, -r3.x, l(1.000000)
  div r1.w, r3.x, r1.w
  movc r1.w, r2.w, r1.w, l(1.000000)
  mad r1.w, r1.w, cb0[39].x, cb0[35].w
  mul r0.w, r0.w, r1.w
  mul r0.w, r0.w, -cb0[35].z
  exp r0.z, r0.w
  mad r2.xyz, -v2.xyzx, r0.zzzz, v2.xyzx
endif 
mad r1.xyz, r1.xyzx, r0.zzzz, r2.xyzx
mul r1.xyz, r0.yyyy, r1.xyzx
mov r1.w, -r0.y
mad r0.xyzw, r0.xxxx, 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 229 instruction slots used