// Ambient Lighting (environment=high)
// PS 1201619760848612 551a826bfb659595 c146fc4db7b97968 ff8ee214288e8819

//
// 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 [unused]
//   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
//   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 [unused]
//   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 [unused]
//   float4 ViewportSize;               // Offset:  640 Size:    16 [unused]
//   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 [unused]
//   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
//   float4 CascadeNearFarSnappedOffsetCamera[5];// Offset:   80 Size:    80
//   float4 CascadeNearFarRcpUVSize[5]; // Offset:  160 Size:    80
//   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
//
// }
//
// cbuffer CCommonDeferredAmbientProvider
// {
//
//   float4x4 InvViewRotProjectionMatrix;// Offset:    0 Size:    64
//   float4 GlobalSHB;                  // Offset:   64 Size:    16 [unused]
//   float4 GlobalSHG;                  // Offset:   80 Size:    16 [unused]
//   float4 GlobalSHR;                  // Offset:   96 Size:    16 [unused]
//   float4 LerpDistance_RCP;           // Offset:  112 Size:    16 [unused]
//   float3 SnappedCameraC0;            // Offset:  128 Size:    12 [unused]
//   float3 SnappedCameraC1;            // Offset:  144 Size:    12 [unused]
//   float3 SnappedCameraC2;            // Offset:  160 Size:    12 [unused]
//   float3 UVScale;                    // Offset:  176 Size:    12 [unused]
//
// }
//
// Resource bind info for ExposureBuffer
// {
//
//   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
// ------------------------------ ---------- ------- ----------- ---- --------
// LinearVolumeSamplerState          sampler      NA          NA    0        1
// SectorOcclusion_HeightTexture__SampObj__    sampler      NA          NA    1        1
// SectorOcclusion_OcclusionTexture__SampObj__    sampler      NA          NA    2        1
// SectorOcclusion_NoiseTexture__SampObj__    sampler      NA          NA    3        1
// SectorHemiMapSamplerStateLinear    sampler      NA          NA    4        1
// DownsampledDepthTexture__SampObj__    sampler      NA          NA    5        1
// NormalWSTexture_Point__SampObj__    sampler      NA          NA    6        1
// SHTextureR                        texture  float4          3d    0        1
// SHTextureG                        texture  float4          3d    1        1
// SHTextureB                        texture  float4          3d    2        1
// ExposureBuffer                    texture  struct         r/o    3        1
// SkyParamBuffer                    texture  struct         r/o    4        1
// SectorOcclusion_HeightTexture__TexObj__    texture  float4          2d    5        1
// SectorOcclusion_OcclusionTexture__TexObj__    texture  float4          2d    6        1
// SectorOcclusion_NoiseTexture__TexObj__    texture  float4          2d    7        1
// DownsampledDepthTexture__TexObj__    texture  float4          2d    8        1
// NormalWSTexture_Point__TexObj__    texture  float4          2d    9        1
// CViewportShaderParameterProvider    cbuffer      NA          NA    0        1
// CSceneTerrainSkyOcclusionAtlasPrivateData    cbuffer      NA          NA    1        1
// CAmbientProvider                  cbuffer      NA          NA    2        1
// CCommonDeferredAmbientProvider    cbuffer      NA          NA    3        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float       
// TEXCOORD                 0   xy          1     NONE   float   xy  
// TEXCOORD                 1     zw        1     NONE   float     zw
// SV_IsFrontFace           0   x           2    FFACE    uint       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xyzw        1   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[43], immediateIndexed
dcl_constantbuffer cb1[3], immediateIndexed
dcl_constantbuffer cb2[19], dynamicIndexed
dcl_constantbuffer cb3[4], 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_resource_texture3d (float,float,float,float) t0
dcl_resource_texture3d (float,float,float,float) t1
dcl_resource_texture3d (float,float,float,float) t2
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_texture2d (float,float,float,float) t9
dcl_input_ps linear v1.xy
dcl_input_ps linear v1.zw
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_temps 20
dcl_resource_texture2d (float,float,float,float) t125

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

sample_indexable(texture2d)(float,float,float,float) r0.xyzw, v1.zwzz, t9.xyzw, s6
mul r0.w, r0.w, l(3.000000)
mad r0.xyz, r0.xyzx, l(1.41421354, 1.41421354, 1.41421354, 0.000000), l(-0.707106769, -0.707106769, -0.707106769, 0.000000)
ftou r0.w, r0.w
dp3 r1.x, r0.xyzx, r0.xyzx
min r1.x, r1.x, l(1.000000)
add r1.x, -r1.x, l(1.000000)
sqrt r1.x, r1.x
swapc r0.x, r2.x, r0.w, r0.x, r1.x
ieq r1.yz, r0.wwww, l(0, 1, 2, 0)
movc r3.xy, r1.yzyy, r1.xxxx, r0.yzyy
movc r0.x, r1.y, r0.y, r0.x
movc r3.z, r1.z, r0.z, r0.x
mov r0.z, r2.x
mov r0.yw, l(0,2.000000,0,2.000000)
mul r0.xyz, r2.xxxx, r0.yzwy
mov r3.w, l(-2.000000)
mad r0.xyz, r0.xyzx, r3.zwyz, l(0.000000, 1.000000, 0.000000, 0.000000)
mov r1.zw, r3.xxxz
mul r2.xyz, r3.xxxx, r3.ywwy
mov r1.y, l(2.000000)
mad r0.yzw, r2.xxyz, r1.yyzw, r0.xxyz
mov r0.x, l(1.000000)
mul r1.xyzw, r0.xyzw, l(0.282094806, 0.488602519, 0.488602519, 0.488602519)
dp4 r2.x, cb2[15].xyzw, r1.xyzw
dp4 r2.y, cb2[16].xyzw, r1.xyzw
dp4 r2.z, cb2[17].xyzw, r1.xyzw
max r1.xyz, r2.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r0.x, v1.xyxx, t8.xyzw, s5
mul r0.x, |r0.x|, cb0[31].z

// Depth (DownsampledDepthTexture__TexObj__ * CameraDistances.z):
mov r18.w, r0.x

mul r1.w, cb0[31].y, cb0[31].x
div r0.x, r1.w, r0.x
add r0.x, -r0.x, cb0[31].y
mad r2.z, -r0.x, cb0[31].w, l(1.000000)
mad r2.xy, v1.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
mov r2.w, l(1.000000)
dp4 r3.w, r2.xyzw, cb3[0].xyzw
dp4 r3.y, r2.xyzw, cb3[1].xyzw
dp4 r3.z, r2.xyzw, cb3[2].xyzw
dp4 r0.x, r2.xyzw, cb3[3].xyzw
div r2.xyz, r3.yzwy, r0.xxxx

// Correction:
add r17.w, r18.w, -r17.y
mul r18.x, r17.w, r17.x
mov r18.yzw, l(0.0)

// InvProjectionMatrix:
dp4 r19.x, r18.xyzw, cb0[0].xyzw
dp4 r19.y, r18.xyzw, cb0[1].xyzw
dp4 r19.z, r18.xyzw, cb0[2].xyzw
dp4 r19.w, r18.xyzw, cb0[3].xyzw
// InvViewMatrix, use output components with order matching above so the below
// add is slightly less brainfuck:
dp4 r18.x, r19.xyzw, cb0[4].xyzw
dp4 r18.y, r19.xyzw, cb0[5].xyzw
dp4 r18.z, r19.xyzw, cb0[6].xyzw

// Adjust coord (swizzle is brainfuck):
add r2.xyz, r2.xyzw, -r18.yzxw

add r3.xyz, r2.zxyz, cb0[42].xyzx
mad r4.xy, r3.yxyy, cb1[0].yxyy, cb1[0].wzww
sample_l_indexable(texture2d)(float,float,float,float) r4.zw, r4.xyxx, t5.zwxy, s1, l(0.000000)
mad r4.zw, r4.zzzw, cb1[2].xxxx, cb1[2].yyyy
add r0.x, r3.z, -r4.w
add r1.w, -r4.w, r4.z
max r1.w, r1.w, l(1.000000)
add r1.w, r1.w, l(-0.300000)
add r0.x, r0.x, l(-0.300000)
max r0.x, r0.x, l(0.000000)
div r0.x, r0.x, r1.w
min r0.x, r0.x, l(1.000000)
mul r0.x, r0.x, r0.x
mul r0.x, r0.x, r0.x
mul r4.zw, r3.xxxy, l(0.000000, 0.000000, 3.125000, 3.125000)
sample_l_indexable(texture2d)(float,float,float,float) r1.w, r4.zwzz, t7.xywz, s3, l(0.000000)
mad r1.w, r1.w, l(0.150000), l(1.075000)
sample_l_indexable(texture2d)(float,float,float,float) r5.xyzw, r4.xyxx, t6.xyzw, s2, l(0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r2.w, r4.xyxx, t5.xzwy, s4, l(0.000000)
mad r2.w, r2.w, cb1[2].x, cb1[2].y
add r2.w, -r2.w, r3.z
mul_sat r2.w, -r2.w, cb2[18].x
sqrt r2.w, r2.w
mad r4.xyzw, r5.xyzw, l(4.000000, 4.000000, 4.000000, 4.000000), l(-2.000000, -2.000000, -2.000000, -2.000000)
mul r4.x, r1.w, r4.x
add r5.xyzw, -r4.xyzw, l(1.77245390, 0.000000, 1.53499007, 0.000000)
mad r4.xyzw, r0.xxxx, r5.xyzw, r4.xyzw
dp2 r0.x, cb1[1].zzzz, cb1[1].zzzz
add r0.x, r0.x, l(-1.000000)
add r0.x, -r0.x, l(1.000000)
mul r5.z, r0.x, l(0.767495036)
mad r5.x, cb1[1].z, l(-1.77245390), l(1.77245390)
mov r5.yw, l(0,0,0,0)
add r4.xyzw, r4.xyzw, -r5.xwzw
dp2 r0.x, r2.xzxx, r2.xzxx
mad r1.w, cb1[1].x, r0.x, cb1[1].y
sqrt r0.x, r0.x
mov_sat r3.z, r1.w
mul_sat r1.w, r1.w, l(3.000000)
mul r1.w, r2.w, r1.w
mad r4.xyzw, r3.zzzz, r4.xyzw, r5.xyzw
dp3 r2.w, r4.yzwy, r4.yzwy
rsq r2.w, r2.w
mul r5.xyz, r2.wwww, r4.yzwy
mad_sat r2.w, -r4.x, l(0.564189613), l(1.000000)
mad r0.yzw, r5.xxyz, r2.wwww, r0.yyzw
dp3 r2.w, r0.yzwy, r0.yzwy
rsq r2.w, r2.w
mul r5.yzw, r0.yyzw, r2.wwww
mov r5.x, l(1.000000)
mul r6.xyzw, r5.xyzw, l(0.282094806, 0.488602519, 0.488602519, 0.488602519)
lt r0.y, r0.x, cb2[2].y
movc r0.y, r0.y, l(2), l(3)
lt r0.z, r0.x, cb2[1].y
movc r0.y, r0.z, l(1), r0.y
lt r0.z, r0.x, cb2[0].y
movc r0.y, r0.z, l(0), r0.y
mad_sat r0.x, r0.x, cb2[r0.y + 0].z, cb2[r0.y + 0].w
add r3.xyzw, r3.xyxy, -cb2[r0.y + 5].xyzw
mul r3.xyzw, r3.zwxy, cb2[r0.y + 10].yyxx
utof r0.y, r0.y
add r0.yz, r0.yyyy, l(0.000000, 0.500000, 1.500000, 0.000000)
mul r7.xy, r0.yzyy, l(0.200000, 0.200000, 0.000000, 0.000000)
mov r7.zw, r3.zzzw
sample_l_indexable(texture3d)(float,float,float,float) r8.xyzw, r7.zwxz, t0.xyzw, s0, l(0.000000)
mov r3.z, r7.y
sample_l_indexable(texture3d)(float,float,float,float) r9.xyzw, r3.xyzx, t0.xyzw, s0, l(0.000000)
add r9.xyzw, -r8.xyzw, r9.xyzw
mad r8.xyzw, r0.xxxx, r9.xyzw, r8.xyzw
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r9.xy, l(0), l(124), t4.xyxx
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r10.xyzw, l(0), l(108), t4.xyzw
mov r9.z, r10.w
dp3 r0.y, r10.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
dp3 r0.z, r9.zxyz, l(0.212600, 0.715200, 0.072200, 0.000000)
max r0.y, r0.z, r0.y
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r0.z, l(0), l(0), t4.xxxx
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r9.xy, l(0), l(32), t4.xyxx
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r9.zw, l(0), l(68), t4.xxxy
max r0.w, r9.w, r9.y
max r0.z, r0.w, r0.z
add r0.y, r0.z, r0.y
mul r8.xyzw, r0.yyyy, r8.xyzw
dp4 r10.x, r8.xyzw, r6.xyzw
sample_l_indexable(texture3d)(float,float,float,float) r11.xyzw, r7.zwxz, t1.xyzw, s0, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r7.xyzw, r7.zwxz, t2.xyzw, s0, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r12.xyzw, r3.xyzx, t1.xyzw, s0, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r3.xyzw, r3.xyzx, t2.xyzw, s0, l(0.000000)
add r3.xyzw, -r7.xyzw, r3.xyzw
mad r3.xyzw, r0.xxxx, r3.xyzw, r7.xyzw
mul r3.xyzw, r0.yyyy, r3.xyzw
add r7.xyzw, -r11.xyzw, r12.xyzw
mad r7.xyzw, r0.xxxx, r7.xyzw, r11.xyzw
mul r0.xyzw, r0.yyyy, r7.xyzw
dp4 r10.y, r0.xyzw, r6.xyzw
dp4 r10.z, r3.xyzw, r6.xyzw
max r6.xyz, r10.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r6.xyz, r6.xyzx, cb2[18].yyyy
mul r7.xyzw, r5.wyzw, l(1.09254849, 1.02332675, 1.02332675, 1.02332675)
mov r10.yzw, r7.yyzw
mov r10.x, l(0.886226952)
dp4 r2.w, r4.xyzw, r10.xyzw
mul_sat r2.w, r2.w, l(0.318309873)
mul r7.yzw, r5.yyzy, r5.zzzy
mad r5.x, r5.w, r5.w, -r7.w
mul r5.x, r5.x, l(0.429042757)
mul r7.xw, r5.yyyz, r7.xxxx
mad r6.w, r7.z, l(3.000000), l(-1.000000)
mul r7.xyw, r7.xyxw, l(0.785398185, 0.858085513, 0.000000, 0.785398185)
mul r6.w, r6.w, l(0.247707963)
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r11.xyzw, l(0), l(0), t4.xyzw
mul r7.z, r10.y, r11.y
mad r7.z, r11.x, l(0.886226952), r7.z
mad r7.z, r11.z, r10.z, r7.z
mad r7.z, r11.w, r10.w, r7.z
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r12.xyzw, l(0), l(16), t4.xyzw
mad r7.z, r12.x, r7.x, r7.z
mad r7.z, r12.y, r7.y, r7.z
mad r7.z, r12.z, r6.w, r7.z
mad r7.z, r12.w, r7.w, r7.z
mad r13.x, r9.x, r5.x, r7.z
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r14.xyzw, l(0), l(36), t4.xyzw
mul r7.z, r10.y, r14.y
mad r7.z, r14.x, l(0.886226952), r7.z
mad r7.z, r14.z, r10.z, r7.z
mad r7.z, r14.w, r10.w, r7.z
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r15.xyzw, l(0), l(52), t4.xyzw
mad r7.z, r15.x, r7.x, r7.z
mad r7.z, r15.y, r7.y, r7.z
mad r7.z, r15.z, r6.w, r7.z
mad r7.z, r15.w, r7.w, r7.z
mad r13.y, r9.z, r5.x, r7.z
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r16.xyzw, l(0), l(72), t4.xyzw
mul r7.z, r10.y, r16.y
mad r7.z, r16.x, l(0.886226952), r7.z
mad r7.z, r16.z, r10.z, r7.z
mad r7.z, r16.w, r10.w, r7.z
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r10.xyzw, l(0), l(88), t4.xyzw
mad r7.x, r10.x, r7.x, r7.z
mad r7.x, r10.y, r7.y, r7.x
mad r6.w, r10.z, r6.w, r7.x
mad r6.w, r10.w, r7.w, r6.w
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r7.x, l(0), l(104), t4.xxxx
mad r13.z, r7.x, r5.x, r6.w
max r7.yzw, r13.xxyz, l(0.000000, 0.000000, 0.000000, 0.000000)
mad r6.xyz, r7.yzwy, r2.wwww, r6.xyzx
add r1.xyz, r1.xyzx, -r6.xyzx
mad r1.xyz, r1.wwww, r1.xyzx, r6.xyzx
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r2.w, l(0), l(0), t3.xxxx
mul o0.xyz, r1.xyzx, r2.wwww
mov o0.w, l(1.000000)
dp3 r1.x, r2.xyzx, r2.xyzx
rsq r1.x, r1.x
mul r1.xyz, r1.xxxx, r2.xyzx
dp3 r2.x, r1.xyzx, r5.yzwy
add r2.x, r2.x, r2.x
mad r5.yzw, r5.yyzw, -r2.xxxx, r1.xxyz
mul r1.xyz, r5.yzyy, r5.zzyz
mad r1.z, r5.w, r5.w, -r1.z
mad r1.y, r1.y, l(3.000000), l(-1.000000)
mul r1.xyz, r1.xyzx, l(0.858085513, 0.247707963, 0.429042757, 0.000000)
mul r6.xyzw, r5.wyzw, l(1.09254849, 1.02332675, 1.02332675, 1.02332675)
mul r2.x, r6.y, r11.y
mad r2.x, r11.x, l(0.886226952), r2.x
mad r2.x, r11.z, r6.z, r2.x
mad r2.x, r11.w, r6.w, r2.x
mul r2.yz, r5.yyzy, r6.xxxx
mul r2.yz, r2.yyzy, l(0.000000, 0.785398185, 0.785398185, 0.000000)
mad r2.x, r12.x, r2.y, r2.x
mad r2.x, r12.y, r1.x, r2.x
mad r2.x, r12.z, r1.y, r2.x
mad r2.x, r12.w, r2.z, r2.x
mad r11.x, r9.x, r1.z, r2.x
mul r2.x, r6.y, r14.y
mad r2.x, r14.x, l(0.886226952), r2.x
mad r2.x, r14.z, r6.z, r2.x
mad r2.x, r14.w, r6.w, r2.x
mad r2.x, r15.x, r2.y, r2.x
mad r2.x, r15.y, r1.x, r2.x
mad r2.x, r15.z, r1.y, r2.x
mad r2.x, r15.w, r2.z, r2.x
mad r11.y, r9.z, r1.z, r2.x
mul r2.x, r6.y, r16.y
mad r2.x, r16.x, l(0.886226952), r2.x
mad r2.x, r16.z, r6.z, r2.x
mad r2.x, r16.w, r6.w, r2.x
mad r2.x, r10.x, r2.y, r2.x
mad r1.x, r10.y, r1.x, r2.x
mad r1.x, r10.z, r1.y, r1.x
mad r1.x, r10.w, r2.z, r1.x
mad r11.z, r7.x, r1.z, r1.x
max r1.xyz, r11.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mov r5.x, l(1.000000)
mul r5.xyzw, r5.xyzw, l(0.282094806, 0.488602519, 0.488602519, 0.488602519)
dp4 r2.x, r8.xyzw, r5.xyzw
dp4 r2.y, r0.xyzw, r5.xyzw
dp4 r2.z, r3.xyzw, r5.xyzw
max r0.xyz, r2.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r0.xyz, r0.xyzx, cb2[18].yyyy
mov r6.x, l(0.886226952)
dp4 r0.w, r4.xyzw, r6.xyzw
mul_sat r0.w, r0.w, l(0.318309873)
mad r0.xyz, r1.xyzx, r0.wwww, r0.xyzx
dp4 r1.x, cb2[15].xyzw, r5.xyzw
dp4 r1.y, cb2[16].xyzw, r5.xyzw
dp4 r1.z, cb2[17].xyzw, r5.xyzw
max r1.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
add r1.xyz, -r0.xyzx, r1.xyzx
mad r0.xyz, r1.wwww, r1.xyzx, r0.xyzx
mul o1.xyz, r2.wwww, r0.xyzx
mov o1.w, l(0)
ret 
// Approximately 252 instruction slots used