//
// 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
//   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
//   float4 FogParams;                  // Offset:  560 Size:    16
//   float4 FogSHB;                     // Offset:  576 Size:    16
//   float4 FogSHG;                     // Offset:  592 Size:    16
//   float4 FogSHR;                     // Offset:  608 Size:    16
//   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
//   float ShadowProjDepthMinValue;     // Offset:  864 Size:     4 [unused]
//   float DistanceScale;               // Offset:  868 Size:     4 [unused]
//   float WorldSpaceZOffset;           // Offset:  872 Size:     4
//   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
//
// }
//
// cbuffer CUserClipPlaneParameterProvider
// {
//
//   float4 UserClipPlane;              // Offset:    0 Size:    16
//
// }
//
// 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 [unused]
//
// }
//
// 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
//
// }
//
// 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 LightIndicesPerTileForBlended
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// LinearVolumeSamplerState          sampler      NA          NA    0        1
// SectorHemiMapSamplerStateLinear    sampler      NA          NA    1        1
// SHOccTextureR                     texture  float4          3d    0        1
// SHOccTextureG                     texture  float4          3d    1        1
// SHOccTextureB                     texture  float4          3d    2        1
// SkyParamBuffer                    texture  struct         r/o    3        1
// SectorOcclusion_HeightTexture__TexObj__    texture  float4          2d    4        1
// LightsLightingData                texture  struct         r/o    5        1
// LightIndicesPerTileForBlended     texture  struct         r/o    6        1
// CViewportShaderParameterProvider    cbuffer      NA          NA    0        1
// CUserClipPlaneParameterProvider    cbuffer      NA          NA    1        1
// CSceneTerrainSkyOcclusionAtlasPrivateData    cbuffer      NA          NA    2        1
// CAmbientProvider                  cbuffer      NA          NA    3        1
// CTileLightingBlendedParameterProvider    cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// position                 0   xyzw        0     NONE   float   xyz 
// color                    0   xyzw        1     NONE   float   xyzw
// texcoord                 0   xy          2     NONE   float   xy  
// texcoord                 1   x           3     NONE   float   x   
// blendweight              0   xyzw        4     NONE   float   xyz 
// normal                   0   xyzw        5     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// SV_ClipDistance          0   x           1  CLIPDST   float   x   
// TEXCOORD                 0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 1   xyzw        3     NONE   float   xyzw
// TEXCOORD                 2   xyzw        4     NONE   float   xyzw
// TEXCOORD                 3   xyzw        5     NONE   float   xyzw
// TEXCOORD                 4   xyzw        6     NONE   float   xyzw
// TEXCOORD                 5   xyz         7     NONE   float   xyz 
// TEXCOORD                 6   xyz         8     NONE   float   xyz 
// TEXCOORD                 7   xyzw        9     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[57], immediateIndexed
dcl_constantbuffer cb1[1], immediateIndexed
dcl_constantbuffer cb2[3], immediateIndexed
dcl_constantbuffer cb3[19], dynamicIndexed
dcl_constantbuffer cb4[14], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, 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, 132 
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_structured t5, 128 
dcl_resource_structured t6, 4 
dcl_input v0.xyz
dcl_input v1.xyzw
dcl_input v2.xy
dcl_input v3.x
dcl_input v4.xyz
dcl_input v5.xyzw
dcl_output_siv o0.xyzw, position
dcl_output_siv o1.x, clip_distance
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyz
dcl_output o8.xyz
dcl_output o9.xyzw
dcl_temps 11

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

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

add r0.xyz, -v0.xyzx, cb0[42].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
sqrt r0.w, r0.w
div r0.xyz, r0.xyzx, r0.wwww
add r0.w, r0.w, l(-2000.000000)
mul_sat r0.w, r0.w, l(0.000333333330)
mul r0.w, r0.w, l(250.000000)
mad r0.xyz, r0.xyzx, r0.wwww, v0.xyzx
add r1.xyz, r0.xyzx, -cb0[42].xyzx
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, r1.xyzx
mad r0.xyz, r1.xyzx, cb0[54].zzzz, r0.xyzx
add r0.xyz, r0.xyzx, -cb0[42].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
sqrt r1.x, r0.w
add r1.y, r1.x, -cb0[53].z
max r1.y, r1.y, l(0.000000)
add r1.x, -r1.y, r1.x
mad r1.x, r1.y, cb0[53].w, r1.x
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
mul r2.xyz, r1.xxxx, r0.xyzx
mad r0.xyz, r0.xyzx, r1.xxxx, cb0[42].xyzx
mov r2.w, l(1.000000)
dp4 r1.x, r2.xyzw, cb0[20].xyzw
dp4 r1.y, r2.xyzw, cb0[21].xyzw
dp4 o0.z, r2.xyzw, cb0[22].xyzw
dp4 r1.w, r2.xyzw, cb0[23].xyzw
mad r3.xyz, v5.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
lt r4.xy, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[39].zwzz
and r1.z, r4.y, r4.x
if_nz r1.z
  mov o2.xyzw, l(0,0,0,0)
else 
  dp3 r1.z, r2.xyzx, r2.xyzx
  rsq r2.w, r1.z
  mul r4.yzw, r2.wwww, r2.yyzx
  mov r4.x, l(1.000000)
  dp4 r5.x, cb0[38].xyzw, r4.xyzw
  dp4 r5.y, cb0[37].xyzw, r4.xyzw
  dp4 r5.z, cb0[36].xyzw, r4.xyzw
  max r5.xyz, r5.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  mad r6.xy, r0.yxyy, cb2[0].yxyy, cb2[0].wzww
  sample_l_indexable(texture2d)(float,float,float,float) r2.w, r6.xyxx, t4.xzwy, s1, l(0.000000)
  mad r2.w, r2.w, cb2[2].x, cb2[2].y
  add r2.w, r0.z, -r2.w
  mul_sat r2.w, -r2.w, cb3[18].x
  sqrt r2.w, r2.w
  dp2 r3.w, r2.xyxx, r2.xyxx
  mad r3.w, cb2[1].x, r3.w, cb2[1].y
  mul_sat r3.w, r3.w, l(3.000000)
  mul r2.w, r2.w, r3.w
  dp4 r6.x, cb3[15].xyzw, r4.xyzw
  dp4 r6.y, cb3[16].xyzw, r4.xyzw
  dp4 r6.z, cb3[17].xyzw, r4.xyzw
  max r4.xyz, r6.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  mad r4.xyz, r4.xyzx, cb0[56].xxxx, -r5.xyzx
  mad r4.xyz, r2.wwww, r4.xyzx, r5.xyzx
  sqrt r1.z, r1.z
  mad_sat r1.z, r1.z, cb0[35].y, cb0[35].x
  mul r2.w, r2.z, cb0[39].y
  max r2.w, r2.w, l(-125.000000)
  lt r3.w, l(0.000001), |r2.w|
  exp r4.w, -r2.w
  add r4.w, -r4.w, l(1.000000)
  div r2.w, r4.w, r2.w
  movc r2.w, r3.w, r2.w, l(1.000000)
  mad r2.w, r2.w, cb0[39].x, cb0[35].w
  mul r1.z, r1.z, r2.w
  mul r1.z, r1.z, -cb0[35].z
  exp r1.z, r1.z
  mad o2.xyz, -r4.xyzx, r1.zzzz, r4.xyzx
  mov o2.w, r1.z
endif 

// Relocated to here with asmtool.py
mov o0.xyw, r1.xyxw

// Automatic vertex shader halo fix inserted with DarkStarSword's asmtool.py:
// asmtool.py -i --auto-fix-vertex-halo --only-autofixed 111b9f3e03d2bd92-vs.txt
ne r10.w, r1.w, l(1.0)
if_nz r10.w
  add r10.w, r1.w, -r10.y
  mad r1.x, r10.w, r10.x, r1.x
endif

mul r4.xyzw, r1.xyww, cb0[34].xyzw
add o5.xy, r4.zwzz, r4.xyxx
dp3 r1.z, cb0[48].xyzx, r2.xyzx
mul o6.w, r1.z, cb0[31].w
mul o3.w, v1.w, v5.w
div r2.zw, r1.xxxy, r1.wwww
mad r2.zw, r2.zzzw, l(0.000000, 0.000000, 1.000000, -1.000000), l(0.000000, 0.000000, 1.000000, 1.000000)
mul r2.zw, r2.zzzw, cb0[40].xxxy
mul r2.zw, r2.zzzw, l(0.000000, 0.000000, 0.250000, 0.250000)
ftou r2.zw, r2.zzzw
imul null, r2.zw, r2.zzzw, cb4[13].wwww
ushr r2.zw, r2.zzzw, l(0, 0, 3, 3)
imad r1.z, r2.w, cb4[13].x, r2.z
dp3 r2.z, r3.xyzx, r3.xyzx
rsq r2.z, r2.z
mul r3.xyz, r2.zzzz, r3.xyzx
dp3_sat r2.z, r3.xyzx, -cb4[12].xyzx
mul r4.xyz, r2.zzzz, cb4[11].xyzx
ishl r2.z, r1.z, l(1)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.z, r2.z, l(0), t6.xxxx
countbits r2.w, r2.z
mov r5.xyz, r4.xyzx
mov r3.w, r2.z
mov r4.w, l(0)
loop 
  uge r5.w, r4.w, r2.w
  breakc_nz r5.w
  firstbit_lo r5.w, r3.w
  ishl r6.x, l(1), r5.w
  not r6.x, r6.x
  and r3.w, r3.w, r6.x
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r6.xyzw, r5.w, l(48), t5.xyzw
  and r6.w, r6.w, l(1)
  ult r6.w, l(0), r6.w
  ieq r7.x, r6.w, l(0)
  or r7.x, r6.w, r7.x
  if_nz r7.x
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r7.xyzw, r5.w, l(0), t5.xyzw
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r8.xyz, r5.w, l(16), t5.xyzx
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r9.xyz, r5.w, l(32), t5.xyzx
    add r7.xyz, r0.xyzx, -r7.xyzx
    dp3 r5.w, r7.xyzx, r7.xyzx
    max r8.w, r5.w, l(0.000010)
    div r9.w, l(1.000000, 1.000000, 1.000000, 1.000000), r8.w
    min r7.w, r7.w, r9.w
    mul r8.w, r8.w, r8.w
    mad_sat r6.x, -r8.w, r6.x, l(1.000000)
    mul r6.x, r6.x, r6.x
    mul r6.x, r6.x, r7.w
    mul r8.xyz, r6.xxxx, r8.xyzx
    rsq r5.w, r5.w
    mul r7.xyz, r5.wwww, r7.xyzx
    dp3 r5.w, r7.xyzx, r9.xyzx
    mad_sat r5.w, r5.w, r6.y, r6.z
    mul r5.w, r5.w, r5.w
    mul r6.xyz, r8.xyzx, r5.wwww
    movc r6.xyz, r6.wwww, r6.xyzx, r8.xyzx
  else 
    mov r7.xyz, l(0,0,1.000000,0)
    mov r6.xyz, l(0,0,0,0)
  endif 
  dp3_sat r5.w, r3.xyzx, -r7.xyzx
  mad r5.xyz, r5.wwww, r6.xyzx, r5.xyzx
  iadd r4.w, r4.w, l(1)
endloop 
bfi r1.z, l(31), l(1), r1.z, l(1)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.z, r1.z, l(0), t6.xxxx
countbits r2.z, r1.z
mov r4.xyz, r5.xyzx
mov r2.w, r1.z
mov r3.w, l(0)
loop 
  uge r4.w, r3.w, r2.z
  breakc_nz r4.w
  firstbit_lo r4.w, r2.w
  ishl r5.w, l(1), r4.w
  not r5.w, r5.w
  and r2.w, r2.w, r5.w
  iadd r4.w, l(32), r4.w
  ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r6.xyzw, r4.w, l(48), t5.xyzw
  and r5.w, r6.w, l(1)
  ult r5.w, l(0), r5.w
  ieq r6.w, r5.w, l(0)
  or r6.w, r5.w, r6.w
  if_nz r6.w
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r7.xyzw, r4.w, l(0), t5.xyzw
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r8.xyz, r4.w, l(16), t5.xyzx
    ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r9.xyz, r4.w, l(32), t5.xyzx
    add r7.xyz, r0.xyzx, -r7.xyzx
    dp3 r4.w, r7.xyzx, r7.xyzx
    max r6.w, r4.w, l(0.000010)
    div r8.w, l(1.000000, 1.000000, 1.000000, 1.000000), r6.w
    min r7.w, r7.w, r8.w
    mul r6.w, r6.w, r6.w
    mad_sat r6.x, -r6.w, r6.x, l(1.000000)
    mul r6.x, r6.x, r6.x
    mul r6.x, r6.x, r7.w
    mul r8.xyz, r6.xxxx, r8.xyzx
    rsq r4.w, r4.w
    mul r7.xyz, r4.wwww, r7.xyzx
    dp3 r4.w, r7.xyzx, r9.xyzx
    mad_sat r4.w, r4.w, r6.y, r6.z
    mul r4.w, r4.w, r4.w
    mul r6.xyz, r8.xyzx, r4.wwww
    movc r6.xyz, r5.wwww, r6.xyzx, r8.xyzx
  else 
    mov r7.xyz, l(0,0,1.000000,0)
    mov r6.xyz, l(0,0,0,0)
  endif 
  dp3_sat r4.w, r3.xyzx, -r7.xyzx
  mad r4.xyz, r4.wwww, r6.xyzx, r4.xyzx
  iadd r3.w, r3.w, l(1)
endloop 
mov o8.xyz, r4.xyzx
dp2 r1.z, r2.xyxx, r2.xyxx
sqrt r2.x, r1.z
lt r2.y, r2.x, cb3[2].y
movc r2.y, r2.y, l(2), l(3)
lt r2.z, r2.x, cb3[1].y
movc r2.y, r2.z, l(1), r2.y
lt r2.z, r2.x, cb3[0].y
movc r2.y, r2.z, l(0), r2.y
add r3.xyzw, r0.xyxy, -cb3[r2.y + 5].xyzw
mul r3.xyzw, r3.xyzw, cb3[r2.y + 10].xxyy
utof r2.z, r2.y
add r2.zw, r2.zzzz, l(0.000000, 0.000000, 0.500000, 1.500000)
mul r4.xz, r2.zzwz, l(0.200000, 0.000000, 0.200000, 0.000000)
mov r4.yw, r3.xxxy
sample_l_indexable(texture3d)(float,float,float,float) r5.xyzw, r4.ywxy, t0.xyzw, s0, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r6.xyzw, r4.ywxy, t1.xyzw, s0, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r7.xyzw, r4.ywxy, t2.xyzw, s0, l(0.000000)
mov r4.xy, r3.zwzz
sample_l_indexable(texture3d)(float,float,float,float) r3.xyzw, r4.xyzx, t0.xyzw, s0, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r8.xyzw, r4.xyzx, t1.xyzw, s0, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r4.xyzw, r4.xyzx, t2.xyzw, s0, l(0.000000)
mad_sat r2.x, r2.x, cb3[r2.y + 0].z, cb3[r2.y + 0].w
add r3.xyzw, -r5.xyzw, r3.xyzw
mad r3.xyzw, r2.xxxx, r3.xyzw, r5.xyzw
add r5.xyzw, -r6.xyzw, r8.xyzw
mad r5.xyzw, r2.xxxx, r5.xyzw, r6.xyzw
add r4.xyzw, -r7.xyzw, r4.xyzw
mad r2.xyzw, r2.xxxx, r4.xyzw, r7.xyzw
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r4.xyzw, l(0), l(108), t3.xywz
dp3 r4.w, r4.xywx, l(0.212600, 0.715200, 0.072200, 0.000000)
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r4.xy, l(0), l(124), t3.xyxx
dp3 r4.x, r4.zxyz, l(0.212600, 0.715200, 0.072200, 0.000000)
max r4.x, r4.x, r4.w
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r4.y, l(0), l(0), t3.xxxx
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r4.z, l(0), l(36), t3.xxxx
ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r4.w, l(0), l(72), t3.xxxx
max r4.z, r4.w, r4.z
max r4.y, r4.z, r4.y
add r4.x, r4.y, r4.x
mul r3.xyzw, r3.xyzw, r4.xxxx
mul r5.xyzw, r4.xxxx, r5.xyzw
mul r2.xyzw, r2.xyzw, r4.xxxx
mov r4.x, l(1.000000)
mad r4.yzw, v5.yyzx, l(0.000000, 2.000000, 2.000000, 2.000000), l(0.000000, -1.000000, -1.000000, -1.000000)
mul r4.xyzw, r4.xyzw, l(0.282094806, 0.488602519, 0.488602519, 0.488602519)
dp4 r3.x, r3.xyzw, r4.xyzw
dp4 r3.y, r5.xyzw, r4.xyzw
dp4 r3.z, r2.xyzw, r4.xyzw
max r2.xyz, r3.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
dp4 r3.x, cb3[15].xyzw, r4.xyzw
dp4 r3.y, cb3[16].xyzw, r4.xyzw
dp4 r3.z, cb3[17].xyzw, r4.xyzw
max r3.xyz, r3.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mad r4.xy, r0.yxyy, cb2[0].yxyy, cb2[0].wzww
sample_l_indexable(texture2d)(float,float,float,float) r2.w, r4.xyxx, t4.xzwy, s1, l(0.000000)
mad r2.w, r2.w, cb2[2].x, cb2[2].y
add r2.w, r0.z, -r2.w
mul_sat r2.w, -r2.w, cb3[18].x
sqrt r2.w, r2.w
mad r1.z, cb2[1].x, r1.z, cb2[1].y
mul_sat r1.z, r1.z, l(3.000000)
mul r1.z, r2.w, r1.z
add r3.xyz, -r2.xyzx, r3.xyzx
mad o7.xyz, r1.zzzz, r3.xyzx, r2.xyzx
mov r0.w, l(1.000000)
dp4 o1.x, cb1[0].xyzw, r0.xyzw

// mov o0.xyw, r1.xyxw // Relocated from here with asmtool.py

mov o3.xyz, v1.xyzx
mov o4.xyz, r0.xyzx
mov o4.w, v3.x
mov o5.z, r1.w
mov o5.w, v4.z
mad o6.xyz, v5.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mov o9.xy, v2.xyxx
mov o9.zw, v4.xxxy
ret 
// Approximately 265 instruction slots used