// asmtool.py -i --fix-fcprimal-physical-lighting --only-autofixed -f 7eec6df38890156b-cs.txt
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.31 on Wed Mar 02 08:06:56 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 [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
//   float4 FogSHG;                     // Offset:  592 Size:    16
//   float4 FogSHR;                     // Offset:  608 Size:    16
//   float4 HeightFogParams;            // Offset:  624 Size:    16
//   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
//   float3 EnvironmentMapColorScale;   // Offset:  800 Size:    12
//   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
//   float ShadowCSMLastSliceIndex;     // Offset:  888 Size:     4 [unused]
//   float UseNormalization;            // Offset:  892 Size:     4
//   float FogUndergroundColorScale;    // Offset:  896 Size:     4
//
// }
//
// cbuffer CGlobalShaderParameterProvider
// {
//
//   float4 BurnColor;                  // Offset:    0 Size:    16 [unused]
//   float4 BurnParams;                 // Offset:   16 Size:    16 [unused]
//   float4 BurnParams2;                // Offset:   32 Size:    16 [unused]
//   float4 BurnParams3;                // Offset:   48 Size:    16 [unused]
//   float4 CascadedShadowScaleOffsetTile0;// Offset:   64 Size:    16 [unused]
//   float4 CascadedShadowScaleOffsetTile1;// Offset:   80 Size:    16 [unused]
//   float4 WindSimParamsX;             // Offset:   96 Size:    16 [unused]
//   float4 WindSimParamsY;             // Offset:  112 Size:    16 [unused]
//   float VistaNoiseIntensity;         // Offset:  128 Size:     4 [unused]
//   float Time;                        // Offset:  132 Size:     4 [unused]
//   float WindFactor;                  // Offset:  136 Size:     4 [unused]
//   float FireGlowEV;                  // Offset:  140 Size:     4
//   float BurnSpeedScale;              // Offset:  144 Size:     4 [unused]
//   float BurnlineMaskScale;           // Offset:  148 Size:     4 [unused]
//   float BurnlineMaskInfluence;       // Offset:  152 Size:     4 [unused]
//   float WorldSpaceProgressionMaskScale;// Offset:  156 Size:     4 [unused]
//   float WorldSpaceProgressionMaskInfluence;// Offset:  160 Size:     4 [unused]
//   float MaskTransitionSpeedModifier; // Offset:  164 Size:     4 [unused]
//   float GlowMaskScale;               // Offset:  168 Size:     4 [unused]
//   float FireGlowMaskInfluence;       // Offset:  172 Size:     4 [unused]
//   float CenterBurnlineWidth;         // Offset:  176 Size:     4 [unused]
//   float TransitionToBurnlineWidth;   // Offset:  180 Size:     4 [unused]
//   float DissolveCutoffPoint;         // Offset:  184 Size:     4 [unused]
//   float DissolveBlendDistance;       // Offset:  188 Size:     4 [unused]
//   float EyeGlossinessScale;          // Offset:  192 Size:     4 [unused]
//   float EyeSpecIntensityScale;       // Offset:  196 Size:     4 [unused]
//   float EyeIrisGlossinessScale;      // Offset:  200 Size:     4 [unused]
//   float EyeIrisSpecIntensityScale;   // Offset:  204 Size:     4 [unused]
//   float EyeReflectionBoostScale;     // Offset:  208 Size:     4 [unused]
//   bool EyeReflectionMaskEnable;      // Offset:  212 Size:     4 [unused]
//   float4 BurnParams4;                // Offset:  224 Size:    16 [unused]
//   float4 BurnParams5;                // Offset:  240 Size:    16 [unused]
//
// }
//
// cbuffer CTileLightCullingParameterProvider
// {
//
//   float4x4 InvViewProjection;        // Offset:    0 Size:    64
//   float4 DepthValueScale;            // Offset:   64 Size:    16 [unused]
//   float4 OutputTextureSize;          // Offset:   80 Size:    16
//   int4 NumTiles;                     // Offset:   96 Size:    16
//   int LightCount;                    // Offset:  112 Size:     4 [unused]
//
// }
//
// cbuffer CTileLightingParameterProvider
// {
//
//   float4 DistanceBoostParameters;    // Offset:    0 Size:    16
//   float4 ForceAlbedoOnlyDisableShadows;// Offset:   16 Size:    16
//   float4 LightingOutputTextureSize;  // Offset:   32 Size:    16 [unused]
//   float4 SunColor;                   // Offset:   48 Size:    16 [unused]
//   float4 SunDirection;               // Offset:   64 Size:    16 [unused]
//   float DirectLightOcclusion;        // Offset:   80 Size:     4
//   float LightingDebugLineToUse;      // Offset:   84 Size:     4 [unused]
//   bool ExposureLocalLights;          // Offset:   88 Size:     4
//   float SunExposureFactor;           // Offset:   92 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]
//
// }
//
// 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 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 LightIndicesPerTile
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
// Resource bind info for LightOutputPerTile
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// EnvironmentMapTexture__SampObj__    sampler      NA          NA    0        1
// EnvironmentMapBRDFTexture__SampObj__    sampler      NA          NA    1        1
// SectorHemiMapSamplerStateLinear    sampler      NA          NA    2        1
// SkinDiffusePreIntegrated__SampObj__    sampler      NA          NA    3        1
// DeferredReflectedAmbientTexture__TexObj__    texture  float4          2d    0        1
// EnvironmentMapTexture__TexObj__    texture  float4        cube    1        1
// EnvironmentMapBRDFTexture__TexObj__    texture  float4          2d    2        1
// ExposureBuffer                    texture  struct         r/o    3        1
// SkyParamBuffer                    texture  struct         r/o    4        1
// SectorOcclusion_HeightTexture__TexObj__    texture  float4          2d    5        1
// GBufferT0                         texture  float4          2d    6        1
// GBufferT1                         texture  float4          2d    7        1
// GBufferT2                         texture  float4          2d    8        1
// GBufferT3                         texture  float4          2d    9        1
// Depth                             texture   float          2d   10        1
// LightsLightingData                texture  struct         r/o   11        1
// LightIndicesPerTile               texture  struct         r/o   12        1
// LightOutputPerTile                texture  struct         r/o   13        1
// SkinDiffusePreIntegrated__TexObj__    texture  float4          2d   14        1
// DeferredAmbientTexture__TexObj__    texture  float4          2d   15        1
// OutputTexture                         UAV  float4          2d    0        1
// CViewportShaderParameterProvider    cbuffer      NA          NA    0        1
// CGlobalShaderParameterProvider    cbuffer      NA          NA    1        1
// CTileLightCullingParameterProvider    cbuffer      NA          NA    2        1
// CTileLightingParameterProvider    cbuffer      NA          NA    3        1
// CSceneTerrainSkyOcclusionAtlasPrivateData    cbuffer      NA          NA    4        1
// CAmbientProvider                  cbuffer      NA          NA    5        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Input
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Output
cs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[57], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_constantbuffer cb2[7], immediateIndexed
dcl_constantbuffer cb3[6], immediateIndexed
dcl_constantbuffer cb4[3], immediateIndexed
dcl_constantbuffer cb5[19], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texturecube (float,float,float,float) t1
dcl_resource_texture2d (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_resource_texture2d (float,float,float,float) t10
dcl_resource_structured t11, 128 
dcl_resource_structured t12, 4 
dcl_resource_structured t13, 4 
dcl_resource_texture2d (float,float,float,float) t14
dcl_resource_texture2d (float,float,float,float) t15
dcl_uav_typed_texture2d (float,float,float,float) u0
dcl_input vThreadGroupID.xy
dcl_input vThreadIDInGroup.xy
dcl_temps 36
dcl_thread_group 8, 8, 1

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

ld_indexable(texture2d)(float,float,float,float) r33.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-physical-lighting --only-autofixed -f 7eec6df38890156b-cs.txt
mul r34.x, r33.x, r33.y
mul r34.x, r34.x, cb0[0].x
mov r34.yzw, l(0.0)
dp4 r35.x, r34.xyzw, cb0[4].xyzw
dp4 r35.y, r34.xyzw, cb0[5].xyzw
dp4 r35.z, r34.xyzw, cb0[6].xyzw
mov r34.xyzw, cb0[42].xyzw
add r34.xyz, r34.xyz, r35.xyz

imad r0.xy, vThreadGroupID.xyxx, l(8, 8, 0, 0), vThreadIDInGroup.xyxx
ftou r1.xy, cb2[5].xyxx
ult r1.xy, r0.xyxx, r1.xyxx
and r1.x, r1.y, r1.x
if_nz r1.x
  imad r1.x, vThreadGroupID.y, cb2[6].x, vThreadGroupID.x
  mov r0.zw, l(0,0,0,0)

  ld_indexable(texture2d)(float,float,float,float) r2.z, r0.xyww, t10.yzxw

// Use DepthScale & CameraDistances.z to get world Z:
mad r33.z, r2.z, cb0[33].y, cb0[33].x
div r33.z, l(1.0), r33.z
mul r33.z, r33.z, cb0[31].z

  utof r1.yz, r0.xxyx
  add r3.xy, r1.yzyy, l(0.500000, 0.500000, 0.000000, 0.000000)
  mul r3.xy, r3.xyxx, cb2[5].zwzz
  mad r3.xy, r3.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
  mul r2.xy, r3.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000)
  mov r2.w, l(1.000000)

// Far Cry Primal Physical Lighting Fix inserted with DarkStarSword's asmtool.py:
// asmtool.py -i --fix-fcprimal-physical-lighting --only-autofixed -f 7eec6df38890156b-cs.txt
add r33.w, r33.z, -r33.y
div r33.w, r33.w, r33.z
mad r2.x, r33.w, -r33.x, r2.x

  dp4 r3.x, r2.xyzw, cb2[0].xyzw
  dp4 r3.y, r2.xyzw, cb2[1].xyzw
  dp4 r3.z, r2.xyzw, cb2[2].xyzw
  dp4 r1.w, r2.xyzw, cb2[3].xyzw
  div r2.xyz, r3.xyzx, r1.wwww
  ld_indexable(texture2d)(float,float,float,float) r3.xyzw, r0.xyww, t6.xyzw
  ld_indexable(texture2d)(float,float,float,float) r4.xyzw, r0.xyww, t7.xyzw
  ld_indexable(texture2d)(float,float,float,float) r5.xyzw, r0.xyww, t8.xyzw
  ld_indexable(texture2d)(float,float,float,float) r6.xyzw, r0.xyww, t9.yzwx
  iadd r7.xy, r0.xyxx, l(1, 1, 0, 0)
  add r7.zw, cb2[5].xxxy, l(0.000000, 0.000000, -1.000000, -1.000000)
  ftou r7.zw, r7.zzzw
  ult r7.xy, r7.xyxx, r7.zwzz
  if_nz r7.x
    ld_aoffimmi_indexable(1,0,0)(texture2d)(float,float,float,float) r8.xw, r0.xyww, t6.xzwy
    mov r9.w, r8.x
  else 
    mov r9.w, r3.x
    mov r8.w, r3.y
  endif 
  ult r7.xz, l(1, 0, 1, 0), r0.xxyx
  if_nz r7.x
    ld_aoffimmi_indexable(-1,0,0)(texture2d)(float,float,float,float) r8.xz, r0.xyww, t6.xzyw
    mov r9.z, r8.x
  else 
    mov r9.z, r3.x
    mov r8.z, r3.y
  endif 
  if_nz r7.y
    ld_aoffimmi_indexable(0,1,0)(texture2d)(float,float,float,float) r8.xy, r0.xyww, t6.xyzw
    mov r9.y, r8.x
  else 
    mov r9.y, r3.x
    mov r8.y, r3.y
  endif 
  if_nz r7.z
    ld_aoffimmi_indexable(0,-1,0)(texture2d)(float,float,float,float) r7.xy, r0.xyww, t6.xyzw
    mov r9.x, r7.x
    mov r8.x, r7.y
  else 
    mov r9.x, r3.x
    mov r8.x, r3.y
  endif 
  add r7.xyzw, -r3.xxxx, r9.xyzw
  mad r7.xyzw, |r7.xyzw|, l(10.000000, 10.000000, 10.000000, 10.000000), l(0.100000, 0.100000, 0.100000, 0.100000)
  rcp r7.xyzw, r7.xyzw
  dp4 r1.w, r7.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  rcp r1.w, r1.w
  mul r7.xyzw, r1.wwww, r7.xyzw
  dp4 r7.y, r8.xyzw, r7.xyzw
  ftoi r1.yz, r1.yyzy
  and r1.yz, r1.yyzy, l(0, 1, 1, 0)
  ine r1.y, r1.y, r1.z
  mov r7.xz, r3.xxyx
  movc r7.yz, r1.yyyy, r7.yyzy, r7.zzyz
  add r1.yzw, r7.xxyz, l(0.000000, -0.000000, -0.498039216, -0.498039216)
  add r7.yw, r1.wwwz, r1.yyyy
  add r7.x, -r1.w, r7.w
  add r1.y, -r1.z, r1.y
  add r7.z, -r1.w, r1.y
  mov_sat r7.xyz, r7.xyzx
  mul r1.yzw, r7.xxyz, r7.xxyz
  mul r2.w, r3.w, l(255.000000)
  ftou r2.w, r2.w
  ubfe r3.x, l(1), l(3), r2.w
  and r2.w, r2.w, l(7)
  mul r3.y, r4.w, l(3.000000)
  ftou r3.y, r3.y
  mad r4.xyz, r4.xyzx, l(1.41421354, 1.41421354, 1.41421354, 0.000000), l(-0.707106769, -0.707106769, -0.707106769, 0.000000)
  dp3 r3.w, r4.xyzx, r4.xyzx
  min r3.w, r3.w, l(1.000000)
  add r3.w, -r3.w, l(1.000000)
  sqrt r3.w, r3.w
  swapc r4.x, r8.x, r3.y, r4.x, r3.w
  ieq r8.yz, r3.yyyy, l(0, 1, 2, 0)
  movc r9.xy, r8.yzyy, r3.wwww, r4.yzyy
  movc r3.y, r8.y, r4.y, r4.x
  movc r9.z, r8.z, r4.z, r3.y
  mul r4.xyzw, r9.xxyy, l(-2.000000, 2.000000, -2.000000, 2.000000)
  mov r9.w, r8.x
  mad r8.yzw, r4.xxyy, r9.xxwz, l(0.000000, 1.000000, 0.000000, 0.000000)
  mad r8.yzw, r4.zzzw, r9.yyzw, r8.yyzw
  mad r10.xyz, r4.wzww, r9.xyzx, l(0.000000, 1.000000, 0.000000, 0.000000)
  mul r11.xyz, r8.xxxx, l(2.000000, -2.000000, 2.000000, 0.000000)
  mad r10.xyz, r11.yyzy, r9.zwxz, r10.xyzx
  mad r11.xyz, r11.xyzx, r9.ywzy, l(0.000000, 1.000000, 0.000000, 0.000000)
  mad r4.xyz, r4.xxyx, r9.zxyz, r11.xyzx
  mul r3.yw, r5.xxxy, l(0.000000, 255.000000, 0.000000, 255.000000)
  ftou r3.yw, r3.yyyw
  ushr r9.xy, r3.ywyy, l(4, 2, 0, 0)
  utof r9.xy, r9.xyxx
  and r3.yw, r3.yyyw, l(0, 15, 0, 3)
  utof r3.xyw, r3.xyxw
  mul r9.xy, r9.xyxx, l(0.0666666701, 0.0158730168, 0.000000, 0.000000)
  mul r11.yw, r3.yyyw, l(0.000000, 0.0666666701, 0.000000, 0.333333343)
  mad r12.xyz, r6.xzyx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  dp3 r3.y, r12.xyzx, r12.xyzx
  rsq r3.y, r3.y
  mul r12.xyz, r3.yyyy, r12.xyzx
  ieq r13.xyzw, r2.wwww, l(1, 3, 4, 5)
  mov r6.y, r5.w
  mov r6.xz, l(1.000000,0,0,0)
  movc r14.xw, r13.wwww, r6.xxxy, r6.yyyz
  mov r14.yz, l(0,0,0,0)
  movc r14.xyzw, r13.zzzz, r6.yzwz, r14.xyzw
  or r3.y, r13.y, r13.z
  movc r12.xyz, r3.yyyy, r12.xyzx, r4.xyzx
  movc r15.yzw, r13.yyyy, l(0,0,0,0), r14.yyzw
  mov r14.y, l(0)
  movc r11.xz, r13.yyyy, r6.yywy, r14.xxyx
  movc r6.xyz, r13.xxxx, r4.xyzx, r12.xyzx
  movc r3.yw, r13.xxxx, l(0,0,0,0.150000), r11.xxxy
  mov r9.z, r11.w
  mov r9.w, l(0)
  mov r11.xy, r5.yxyy
  movc r9.yzw, r13.xxxx, r9.yyzw, r11.xxxz
  mov r11.xzw, l(0,0,0,0)
  mov r15.x, r9.x
  movc r11.xyzw, r13.xxxx, r11.xyzw, r15.xyzw
  add r5.xyw, -r2.xzxy, r34.xzxy
  dp3 r4.w, r5.xywx, r5.xywx
  sqrt r4.w, r4.w
  div r5.xyw, r5.xyxw, r4.wwww
  dp3 r6.w, r4.xyzx, r5.xywx
  mad r12.xy, -r3.zzzz, l(0.990000, 6.000000, 0.000000, 0.000000), l(1.000000, 6.000000, 0.000000, 0.000000)
  mad r7.w, -r3.y, l(0.990000), l(1.000000)
  sqrt r7.w, r7.w
  mul r8.x, r12.x, r12.x
  div r9.x, r8.x, r7.w
  max r9.x, r9.x, l(0.001000)
  mul r7.w, r7.w, r8.x
  max r7.w, r7.w, l(0.001000)
  add r10.w, r11.w, r11.w
  dp3 r14.x, r8.ywzy, r5.xywx
  dp3 r14.y, r10.zxyz, r5.xywx
  mov_sat r11.w, r6.w
  movc r12.x, r13.w, |r6.w|, r11.w
  mul r12.zw, r14.xxxy, r14.xxxy
  mul r13.y, r9.x, r9.x
  mul r14.x, r7.w, r7.w
  mul r12.w, r12.w, r14.x
  mad r12.z, r13.y, r12.z, r12.w
  mad r12.x, r12.x, r12.x, r12.z
  sqrt r12.x, r12.x
  mad r3.w, r3.w, l(0.082000), l(0.018000)
  mad r7.xyz, r7.xyzx, r7.xyzx, -r3.wwww
  mad r7.xyz, r11.xxxx, r7.xyzx, r3.wwww
  add r11.x, -r11.x, l(1.000000)
  mul r14.yzw, r1.yyzw, r11.xxxx
  ieq r12.zw, r2.wwww, l(0, 0, 2, 6)
  if_nz r12.z
    ishl r2.w, r1.x, l(1)
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r2.w, l(0), t12.xxxx
    countbits r11.x, r2.w
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r12.z, r1.x, l(0), t13.xxxx
    and r12.z, r12.z, l(0x80000000)
    add r15.xyz, -r7.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    mul r15.w, r8.x, r8.x
    mad r15.w, r15.w, l(4.000000), l(1.000000)
    div r15.w, l(1.000000, 1.000000, 1.000000, 1.000000), r15.w
    mad r16.x, r8.x, r8.x, l(0.000001)
    mov r16.yzw, l(0,0,0,0)
    mov r17.xyz, l(0,0,0,0)
    mov r17.w, r2.w
    mov r18.xyzw, l(0,0,0,0)
    loop 
      uge r19.x, r18.w, r11.x
      breakc_nz r19.x
      firstbit_lo r19.x, r17.w
      ishl r19.y, l(1), r19.x
      not r19.y, r19.y
      and r19.y, r17.w, r19.y
      ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r20.xyzw, r19.x, l(0), t11.xyzw
      ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r21.xyz, r19.x, l(32), t11.xyzx
      ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r22.xyzw, r19.x, l(48), t11.xyzw
      and r19.z, r22.w, l(1)
      ult r19.z, l(0), r19.z
      add r20.xyz, -r2.xyzx, r20.xyzx
      dp3 r19.w, r20.xyzx, r20.xyzx
      max r19.w, r19.w, l(0.000010)
      rsq r21.w, r19.w
      div r23.x, l(1.000000, 1.000000, 1.000000, 1.000000), r19.w
      min r20.w, r20.w, r23.x
      mul r23.xyz, r20.xyzx, r21.wwww
      mul r19.w, r19.w, r19.w
      mad_sat r19.w, -r19.w, r22.x, l(1.000000)
      mul r19.w, r19.w, r19.w
      mul r19.w, r19.w, r20.w
      dp3 r20.w, r23.xyzx, -r21.xyzx
      mad_sat r20.w, r20.w, r22.y, r22.z
      movc r19.z, r19.z, r20.w, l(1.000000)
      mul r19.z, r19.z, r19.z
      mul r19.z, r19.w, r19.z
      if_nz r12.z
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r24.xyzw, r19.x, l(72), t11.xyzw
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r25.xyzw, r19.x, l(88), t11.zwxy
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.xyzw, r19.x, l(104), t11.xyzw
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r27.xy, r19.x, l(120), t11.xyxx
        ftoi r19.w, r24.y
        mov r21.xy, r24.zwzz
        mov r21.z, r25.z
        dp3 r20.w, r21.xyzx, r2.xyzx
        mad_sat r20.w, r20.w, r24.x, -r25.w
        mov r25.z, r26.x
        dp3 r21.x, r25.xyzx, r2.xyzx
        mad_sat r21.x, r21.x, r24.x, -r26.y
        mul r20.w, r20.w, r21.x
        mov r27.zw, r26.zzzw
        dp3 r21.x, r27.zwxz, r2.xyzx
        mad_sat r21.x, r21.x, r24.x, -r27.y
        mul r20.w, r20.w, r21.x
        mul r21.x, r20.w, r20.w
        mad r20.w, -r20.w, l(2.000000), l(3.000000)
        mul r20.w, r20.w, r21.x
        movc r19.w, r19.w, r20.w, l(1.000000)
        mul r19.z, r19.w, r19.z
      endif 
      lt r19.w, r19.z, l(0.000100)
      iadd r20.w, r18.w, -r19.w
      mov r17.w, r19.y
      mov r18.w, r20.w
      continuec_nz r19.w
      ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r21.xyz, r19.x, l(16), t11.xyzx
      and r19.x, r22.w, l(2)
      ult r19.x, l(0), r19.x
      mul r21.xyz, r19.zzzz, r21.xyzx
      dp3_sat r19.z, r6.xzyx, r23.xyzx
      mad r16.yzw, r19.zzzz, r21.xxyz, r16.yyzw
      mad r20.xyz, r20.xyzx, r21.wwww, r5.xwyx
      dp3 r19.w, r20.xyzx, r20.xyzx
      rsq r19.w, r19.w
      mul r20.xyz, r19.wwww, r20.xyzx
      dp3 r19.w, r20.xzyx, r5.xywx
      add r19.w, -r19.w, l(1.000000)
      mul r20.w, r19.w, r19.w
      mul r20.w, r20.w, r20.w
      mul r19.w, r19.w, r20.w
      mad r22.xyz, r15.xyzx, r19.wwww, r7.xyzx
      dp3_sat r19.w, r4.xzyx, r23.xyzx
      add r20.w, r11.w, r19.w
      mad r20.w, -r19.w, r11.w, r20.w
      max r20.w, r20.w, l(0.010000)
      div r20.w, l(1.000000, 1.000000, 1.000000, 1.000000), r20.w
      mul r22.xyz, r20.wwww, r22.xyzx
      mul r22.xyz, r19.wwww, r22.xyzx
      dp3_sat r19.w, r20.xzyx, r4.xyzx
      mul r19.w, r19.w, r19.w
      min r19.w, r19.w, l(0.999999)
      add r20.x, -r19.w, l(1.000000)
      div r19.w, r19.w, r20.x
      mul r20.x, r20.x, r20.x
      div r19.w, -r19.w, r16.x
      mul r19.w, r19.w, l(1.442695)
      exp r19.w, r19.w
      mul r19.w, r19.w, l(4.000000)
      div r19.w, r19.w, r20.x
      add r19.w, r19.w, l(1.000000)
      mul r19.w, r15.w, r19.w
      mul r20.xyz, r19.wwww, r21.xyzx
      mad r17.xyz, r22.xyzx, r20.xyzx, r17.xyzx
      mad r20.xyz, r19.zzzz, r21.xyzx, r18.xyzx
      movc r18.xyz, r19.xxxx, r20.xyzx, r18.xyzx
      iadd r18.w, r18.w, l(1)
      mov r17.w, r19.y
    endloop 
    bfi r2.w, l(31), l(1), r1.x, l(1)
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r2.w, l(0), t12.xxxx
    countbits r11.x, r2.w
    mov r19.xyz, r16.yzwy
    mov r20.xyz, r17.xyzx
    mov r21.xyz, r18.xyzx
    mov r17.w, r2.w
    mov r18.w, l(0)
    loop 
      uge r19.w, r18.w, r11.x
      breakc_nz r19.w
      firstbit_lo r19.w, r17.w
      ishl r20.w, l(1), r19.w
      not r20.w, r20.w
      and r20.w, r17.w, r20.w
      iadd r19.w, l(32), r19.w
      ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r22.xyzw, r19.w, l(0), t11.xyzw
      ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r23.xyz, r19.w, l(32), t11.xyzx
      ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r24.xyzw, r19.w, l(48), t11.xyzw
      and r21.w, r24.w, l(1)
      ult r21.w, l(0), r21.w
      add r22.xyz, -r2.xyzx, r22.xyzx
      dp3 r23.w, r22.xyzx, r22.xyzx
      max r23.w, r23.w, l(0.000010)
      rsq r25.x, r23.w
      div r25.y, l(1.000000, 1.000000, 1.000000, 1.000000), r23.w
      min r22.w, r22.w, r25.y
      mul r25.yzw, r22.xxyz, r25.xxxx
      mul r23.w, r23.w, r23.w
      mad_sat r23.w, -r23.w, r24.x, l(1.000000)
      mul r23.w, r23.w, r23.w
      mul r22.w, r22.w, r23.w
      dp3 r23.x, r25.yzwy, -r23.xyzx
      mad_sat r23.x, r23.x, r24.y, r24.z
      movc r21.w, r21.w, r23.x, l(1.000000)
      mul r21.w, r21.w, r21.w
      mul r21.w, r22.w, r21.w
      if_nz r12.z
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r23.xyzw, r19.w, l(72), t11.xyzw
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.xyzw, r19.w, l(88), t11.zwxy
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r27.xyzw, r19.w, l(104), t11.xyzw
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r28.xy, r19.w, l(120), t11.xyxx
        ftoi r22.w, r23.y
        mov r24.xy, r23.zwzz
        mov r24.z, r26.z
        dp3 r23.y, r24.xyzx, r2.xyzx
        mad_sat r23.y, r23.y, r23.x, -r26.w
        mov r26.z, r27.x
        dp3 r23.z, r26.xyzx, r2.xyzx
        mad_sat r23.z, r23.z, r23.x, -r27.y
        mul r23.y, r23.z, r23.y
        mov r28.zw, r27.zzzw
        dp3 r23.z, r28.zwxz, r2.xyzx
        mad_sat r23.x, r23.z, r23.x, -r28.y
        mul r23.x, r23.x, r23.y
        mul r23.y, r23.x, r23.x
        mad r23.x, -r23.x, l(2.000000), l(3.000000)
        mul r23.x, r23.x, r23.y
        movc r22.w, r22.w, r23.x, l(1.000000)
        mul r21.w, r21.w, r22.w
      endif 
      lt r22.w, r21.w, l(0.000100)
      iadd r23.x, r18.w, -r22.w
      mov r17.w, r20.w
      mov r18.w, r23.x
      continuec_nz r22.w
      ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r23.xyz, r19.w, l(16), t11.xyzx
      and r19.w, r24.w, l(2)
      ult r19.w, l(0), r19.w
      mul r23.xyz, r21.wwww, r23.xyzx
      dp3_sat r21.w, r6.xzyx, r25.yzwy
      mad r19.xyz, r21.wwww, r23.xyzx, r19.xyzx
      mad r22.xyz, r22.xyzx, r25.xxxx, r5.xwyx
      dp3 r22.w, r22.xyzx, r22.xyzx
      rsq r22.w, r22.w
      mul r22.xyz, r22.wwww, r22.xyzx
      dp3 r22.w, r22.xzyx, r5.xywx
      add r22.w, -r22.w, l(1.000000)
      mul r23.w, r22.w, r22.w
      mul r23.w, r23.w, r23.w
      mul r22.w, r22.w, r23.w
      mad r24.xyz, r15.xyzx, r22.wwww, r7.xyzx
      dp3_sat r22.w, r4.xzyx, r25.yzwy
      add r23.w, r11.w, r22.w
      mad r23.w, -r22.w, r11.w, r23.w
      max r23.w, r23.w, l(0.010000)
      div r23.w, l(1.000000, 1.000000, 1.000000, 1.000000), r23.w
      mul r24.xyz, r23.wwww, r24.xyzx
      mul r24.xyz, r22.wwww, r24.xyzx
      dp3_sat r22.x, r22.xzyx, r4.xyzx
      mul r22.x, r22.x, r22.x
      min r22.x, r22.x, l(0.999999)
      add r22.y, -r22.x, l(1.000000)
      div r22.x, r22.x, r22.y
      mul r22.y, r22.y, r22.y
      div r22.x, -r22.x, r16.x
      mul r22.x, r22.x, l(1.442695)
      exp r22.x, r22.x
      mul r22.x, r22.x, l(4.000000)
      div r22.x, r22.x, r22.y
      add r22.x, r22.x, l(1.000000)
      mul r22.x, r15.w, r22.x
      mul r22.xyz, r22.xxxx, r23.xyzx
      mad r20.xyz, r24.xyzx, r22.xyzx, r20.xyzx
      mad r22.xyz, r21.wwww, r23.xyzx, r21.xyzx
      movc r21.xyz, r19.wwww, r22.xyzx, r21.xyzx
      iadd r18.w, r18.w, l(1)
      mov r17.w, r20.w
    endloop 
  else 
    if_nz r13.z
      ishl r2.w, r1.x, l(1)
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r2.w, l(0), t12.xxxx
      countbits r11.x, r2.w
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r12.z, r1.x, l(0), t13.xxxx
      and r12.z, r12.z, l(0x80000000)
      add r15.xyz, -r7.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      mul r15.w, r8.x, r8.x
      mad r16.x, -r8.x, r8.x, l(1.000000)
      add r16.yzw, -r4.xxzy, r6.xxzy
      mad r17.xyz, r16.yzwy, l(0.100000, 0.100000, 0.100000, 0.000000), r4.xzyx
      dp3 r17.w, r17.xyzx, r17.xyzx
      rsq r17.w, r17.w
      mul r17.xyz, r17.wwww, r17.xyzx
      mad r16.yzw, r16.yyzw, l(0.000000, 0.300000, 0.300000, 0.300000), r4.xxzy
      dp3 r17.w, r16.yzwy, r16.yzwy
      rsq r17.w, r17.w
      mul r16.yzw, r16.yyzw, r17.wwww
      mad r17.w, r8.x, r8.x, l(-1.000000)
      mov r18.w, r11.z
      mov r22.xyz, l(0,0,0,0)
      mov r23.xyz, l(0,0,0,0)
      mov r24.xyz, l(0,0,0,0)
      mov r19.w, r2.w
      mov r20.w, l(0)
      loop 
        uge r21.w, r20.w, r11.x
        breakc_nz r21.w
        firstbit_lo r21.w, r19.w
        ishl r22.w, l(1), r21.w
        not r22.w, r22.w
        and r22.w, r19.w, r22.w
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r25.xyzw, r21.w, l(0), t11.xyzw
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.xyz, r21.w, l(32), t11.xyzx
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r27.xyzw, r21.w, l(48), t11.xyzw
        and r23.w, r27.w, l(1)
        ult r23.w, l(0), r23.w
        add r25.xyz, -r2.xyzx, r25.xyzx
        dp3 r24.w, r25.xyzx, r25.xyzx
        max r24.w, r24.w, l(0.000010)
        rsq r26.w, r24.w
        div r28.x, l(1.000000, 1.000000, 1.000000, 1.000000), r24.w
        min r25.w, r25.w, r28.x
        mul r28.xyz, r25.xyzx, r26.wwww
        mul r24.w, r24.w, r24.w
        mad_sat r24.w, -r24.w, r27.x, l(1.000000)
        mul r24.w, r24.w, r24.w
        mul r24.w, r24.w, r25.w
        dp3 r25.w, r28.xyzx, -r26.xyzx
        mad_sat r25.w, r25.w, r27.y, r27.z
        movc r23.w, r23.w, r25.w, l(1.000000)
        mul r23.w, r23.w, r23.w
        mul r23.w, r24.w, r23.w
        if_nz r12.z
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r29.xyzw, r21.w, l(72), t11.xyzw
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r30.xyzw, r21.w, l(88), t11.zwxy
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r31.xyzw, r21.w, l(104), t11.xyzw
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r32.xy, r21.w, l(120), t11.xyxx
          ftoi r24.w, r29.y
          mov r26.xy, r29.zwzz
          mov r26.z, r30.z
          dp3 r25.w, r26.xyzx, r2.xyzx
          mad_sat r25.w, r25.w, r29.x, -r30.w
          mov r30.z, r31.x
          dp3 r26.x, r30.xyzx, r2.xyzx
          mad_sat r26.x, r26.x, r29.x, -r31.y
          mul r25.w, r25.w, r26.x
          mov r32.zw, r31.zzzw
          dp3 r26.x, r32.zwxz, r2.xyzx
          mad_sat r26.x, r26.x, r29.x, -r32.y
          mul r25.w, r25.w, r26.x
          mul r26.x, r25.w, r25.w
          mad r25.w, -r25.w, l(2.000000), l(3.000000)
          mul r25.w, r25.w, r26.x
          movc r24.w, r24.w, r25.w, l(1.000000)
          mul r23.w, r23.w, r24.w
        endif 
        lt r24.w, r23.w, l(0.000100)
        iadd r25.w, r20.w, -r24.w
        mov r19.w, r22.w
        mov r20.w, r25.w
        continuec_nz r24.w
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.xyz, r21.w, l(16), t11.xyzx
        and r21.w, r27.w, l(2)
        ult r21.w, l(0), r21.w
        mad r25.xyz, r25.xyzx, r26.wwww, r5.xwyx
        dp3 r24.w, r25.xyzx, r25.xyzx
        rsq r24.w, r24.w
        mul r25.xyz, r24.wwww, r25.xyzx
        dp3 r24.w, r25.xzyx, r5.xywx
        add r24.w, -r24.w, l(1.000000)
        mul r25.w, r24.w, r24.w
        mul r25.w, r25.w, r25.w
        mul r24.w, r24.w, r25.w
        mad r27.xyz, r15.xyzx, r24.wwww, r7.xyzx
        dp3_sat r24.w, r6.xzyx, r28.xyzx
        mul r25.w, r24.w, r24.w
        mad r25.w, r25.w, r16.x, r15.w
        sqrt r25.w, r25.w
        mul r25.w, r11.w, r25.w
        mad r25.w, r24.w, r12.x, r25.w
        add r25.w, r25.w, r25.w
        max r25.w, r25.w, l(0.000100)
        div r25.w, l(1.000000, 1.000000, 1.000000, 1.000000), r25.w
        dp3 r26.w, r4.xzyx, r28.xyzx
        dp3 r27.w, r17.xyzx, r28.xyzx
        dp3 r28.x, r16.yzwy, r28.xyzx
        mad r18.z, r26.w, l(0.500000), l(0.500000)
        mad r28.yz, r18.zzwz, l(0.000000, 0.984375, 0.984375, 0.000000), l(0.000000, 0.00781250000, 0.00781250000, 0.000000)
        sample_l_indexable(texture2d)(float,float,float,float) r28.y, r28.yzyy, t14.wxyz, s3, l(0.000000)
        mad r18.y, r27.w, l(0.500000), l(0.500000)
        mad r18.yz, r18.yywy, l(0.000000, 0.984375, 0.984375, 0.000000), l(0.000000, 0.00781250000, 0.00781250000, 0.000000)
        sample_l_indexable(texture2d)(float,float,float,float) r28.z, r18.yzyy, t14.wxyz, s3, l(0.000000)
        mad r18.x, r28.x, l(0.500000), l(0.500000)
        mad r18.xy, r18.xwxx, l(0.984375, 0.984375, 0.000000, 0.000000), l(0.00781250000, 0.00781250000, 0.000000, 0.000000)
        sample_l_indexable(texture2d)(float,float,float,float) r28.w, r18.xyxx, t14.wxyz, s3, l(0.000000)
        mul r18.xyz, r23.wwww, r26.xyzx
        mad r22.xyz, r18.xyzx, r28.yzwy, r22.xyzx
        mul r26.xyz, r25.wwww, r27.xyzx
        mul r26.xyz, r24.wwww, r26.xyzx
        dp3_sat r23.w, r25.xzyx, r6.xyzx
        mul r23.w, r23.w, r23.w
        mad r23.w, r23.w, r17.w, l(1.000000)
        div r23.w, r8.x, r23.w
        mul r23.w, r23.w, r23.w
        mul r25.xyz, r18.xyzx, r23.wwww
        mad r23.xyz, r26.xyzx, r25.xyzx, r23.xyzx
        mad r18.xyz, r18.xyzx, r28.yzwy, r24.xyzx
        movc r24.xyz, r21.wwww, r18.xyzx, r24.xyzx
        iadd r20.w, r20.w, l(1)
        mov r19.w, r22.w
      endloop 
      bfi r2.w, l(31), l(1), r1.x, l(1)
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r2.w, l(0), t12.xxxx
      countbits r11.x, r2.w
      mov r18.w, r11.z
      mov r19.xyz, r22.xyzx
      mov r20.xyz, r23.xyzx
      mov r21.xyz, r24.xyzx
      mov r11.z, r2.w
      mov r19.w, l(0)
      loop 
        uge r20.w, r19.w, r11.x
        breakc_nz r20.w
        firstbit_lo r20.w, r11.z
        ishl r21.w, l(1), r20.w
        not r21.w, r21.w
        and r21.w, r11.z, r21.w
        iadd r20.w, l(32), r20.w
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r25.xyzw, r20.w, l(0), t11.xyzw
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.xyz, r20.w, l(32), t11.xyzx
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r27.xyzw, r20.w, l(48), t11.xyzw
        and r22.w, r27.w, l(1)
        ult r22.w, l(0), r22.w
        add r25.xyz, -r2.xyzx, r25.xyzx
        dp3 r23.w, r25.xyzx, r25.xyzx
        max r23.w, r23.w, l(0.000010)
        rsq r24.w, r23.w
        div r26.w, l(1.000000, 1.000000, 1.000000, 1.000000), r23.w
        min r25.w, r25.w, r26.w
        mul r28.xyz, r24.wwww, r25.xyzx
        mul r23.w, r23.w, r23.w
        mad_sat r23.w, -r23.w, r27.x, l(1.000000)
        mul r23.w, r23.w, r23.w
        mul r23.w, r23.w, r25.w
        dp3 r25.w, r28.xyzx, -r26.xyzx
        mad_sat r25.w, r25.w, r27.y, r27.z
        movc r22.w, r22.w, r25.w, l(1.000000)
        mul r22.w, r22.w, r22.w
        mul r22.w, r23.w, r22.w
        if_nz r12.z
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.xyzw, r20.w, l(72), t11.xyzw
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r29.xyzw, r20.w, l(88), t11.zwxy
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r30.xyzw, r20.w, l(104), t11.xyzw
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r31.xy, r20.w, l(120), t11.xyxx
          ftoi r23.w, r26.y
          mov r27.xy, r26.zwzz
          mov r27.z, r29.z
          dp3 r25.w, r27.xyzx, r2.xyzx
          mad_sat r25.w, r25.w, r26.x, -r29.w
          mov r29.z, r30.x
          dp3 r26.y, r29.xyzx, r2.xyzx
          mad_sat r26.y, r26.y, r26.x, -r30.y
          mul r25.w, r25.w, r26.y
          mov r31.zw, r30.zzzw
          dp3 r26.y, r31.zwxz, r2.xyzx
          mad_sat r26.x, r26.y, r26.x, -r31.y
          mul r25.w, r25.w, r26.x
          mul r26.x, r25.w, r25.w
          mad r25.w, -r25.w, l(2.000000), l(3.000000)
          mul r25.w, r25.w, r26.x
          movc r23.w, r23.w, r25.w, l(1.000000)
          mul r22.w, r22.w, r23.w
        endif 
        lt r23.w, r22.w, l(0.000100)
        iadd r25.w, r19.w, -r23.w
        mov r11.z, r21.w
        mov r19.w, r25.w
        continuec_nz r23.w
        ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.xyz, r20.w, l(16), t11.xyzx
        and r20.w, r27.w, l(2)
        ult r20.w, l(0), r20.w
        mad r25.xyz, r25.xyzx, r24.wwww, r5.xwyx
        dp3 r23.w, r25.xyzx, r25.xyzx
        rsq r23.w, r23.w
        mul r25.xyz, r23.wwww, r25.xyzx
        dp3 r23.w, r25.xzyx, r5.xywx
        add r23.w, -r23.w, l(1.000000)
        mul r24.w, r23.w, r23.w
        mul r24.w, r24.w, r24.w
        mul r23.w, r23.w, r24.w
        mad r27.xyz, r15.xyzx, r23.wwww, r7.xyzx
        dp3_sat r23.w, r6.xzyx, r28.xyzx
        mul r24.w, r23.w, r23.w
        mad r24.w, r24.w, r16.x, r15.w
        sqrt r24.w, r24.w
        mul r24.w, r11.w, r24.w
        mad r24.w, r23.w, r12.x, r24.w
        add r24.w, r24.w, r24.w
        max r24.w, r24.w, l(0.000100)
        div r24.w, l(1.000000, 1.000000, 1.000000, 1.000000), r24.w
        dp3 r25.w, r4.xzyx, r28.xyzx
        dp3 r26.w, r17.xyzx, r28.xyzx
        dp3 r27.w, r16.yzwy, r28.xyzx
        mad r18.z, r25.w, l(0.500000), l(0.500000)
        mad r28.xy, r18.zwzz, l(0.984375, 0.984375, 0.000000, 0.000000), l(0.00781250000, 0.00781250000, 0.000000, 0.000000)
        sample_l_indexable(texture2d)(float,float,float,float) r28.x, r28.xyxx, t14.xyzw, s3, l(0.000000)
        mad r18.y, r26.w, l(0.500000), l(0.500000)
        mad r18.yz, r18.yywy, l(0.000000, 0.984375, 0.984375, 0.000000), l(0.000000, 0.00781250000, 0.00781250000, 0.000000)
        sample_l_indexable(texture2d)(float,float,float,float) r28.y, r18.yzyy, t14.xyzw, s3, l(0.000000)
        mad r18.x, r27.w, l(0.500000), l(0.500000)
        mad r18.xy, r18.xwxx, l(0.984375, 0.984375, 0.000000, 0.000000), l(0.00781250000, 0.00781250000, 0.000000, 0.000000)
        sample_l_indexable(texture2d)(float,float,float,float) r28.z, r18.xyxx, t14.xyzw, s3, l(0.000000)
        mul r18.xyz, r22.wwww, r26.xyzx
        mad r19.xyz, r18.xyzx, r28.xyzx, r19.xyzx
        mul r26.xyz, r24.wwww, r27.xyzx
        mul r26.xyz, r23.wwww, r26.xyzx
        dp3_sat r22.w, r25.xzyx, r6.xyzx
        mul r22.w, r22.w, r22.w
        mad r22.w, r22.w, r17.w, l(1.000000)
        div r22.w, r8.x, r22.w
        mul r22.w, r22.w, r22.w
        mul r25.xyz, r18.xyzx, r22.wwww
        mad r20.xyz, r26.xyzx, r25.xyzx, r20.xyzx
        mad r18.xyz, r18.xyzx, r28.xyzx, r21.xyzx
        movc r21.xyz, r20.wwww, r18.xyzx, r21.xyzx
        iadd r19.w, r19.w, l(1)
        mov r11.z, r21.w
      endloop 
    else 
      if_nz r13.w
        ishl r2.w, r1.x, l(1)
        ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r2.w, l(0), t12.xxxx
        countbits r8.x, r2.w
        ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r11.x, r1.x, l(0), t13.xxxx
        and r11.x, r11.x, l(0x80000000)
        add r15.xyz, -r7.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        mul r11.z, r7.w, r9.x
        mul r16.xyz, r10.wwww, r10.zyxz
        mul r16.xyz, r16.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
        mul r17.xyz, r1.yzwy, r3.wwww
        mad r1.yzw, -r3.wwww, r1.yyzw, l(0.000000, 1.000000, 1.000000, 1.000000)
        add r10.w, r9.x, r9.x
        add r12.z, r7.w, r7.w
        mul r13.w, r10.w, r10.w
        mul r15.w, r12.z, r12.z
        mul r10.w, r10.w, r12.z
        mov r18.xyz, l(0,0,0,0)
        mov r22.xyz, l(0,0,0,0)
        mov r23.xyz, l(0,0,0,0)
        mov r12.z, r2.w
        mov r16.w, l(0)
        loop 
          uge r17.w, r16.w, r8.x
          breakc_nz r17.w
          firstbit_lo r17.w, r12.z
          ishl r18.w, l(1), r17.w
          not r18.w, r18.w
          and r18.w, r12.z, r18.w
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r24.xyzw, r17.w, l(0), t11.xyzw
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r25.xyz, r17.w, l(32), t11.xyzx
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.xyzw, r17.w, l(48), t11.xyzw
          and r19.w, r26.w, l(1)
          ult r19.w, l(0), r19.w
          add r24.xyz, -r2.xyzx, r24.xyzx
          dp3 r20.w, r24.xyzx, r24.xyzx
          max r20.w, r20.w, l(0.000010)
          rsq r21.w, r20.w
          div r22.w, l(1.000000, 1.000000, 1.000000, 1.000000), r20.w
          min r22.w, r22.w, r24.w
          mul r27.xyz, r21.wwww, r24.xyzx
          mul r20.w, r20.w, r20.w
          mad_sat r20.w, -r20.w, r26.x, l(1.000000)
          mul r20.w, r20.w, r20.w
          mul r20.w, r20.w, r22.w
          dp3 r22.w, r27.xyzx, -r25.xyzx
          mad_sat r22.w, r22.w, r26.y, r26.z
          movc r19.w, r19.w, r22.w, l(1.000000)
          mul r19.w, r19.w, r19.w
          mul r19.w, r20.w, r19.w
          if_nz r11.x
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r25.xyzw, r17.w, l(72), t11.xyzw
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r28.xyzw, r17.w, l(88), t11.zwxy
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r29.xyzw, r17.w, l(104), t11.xyzw
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r30.xy, r17.w, l(120), t11.xyxx
            ftoi r20.w, r25.y
            mov r26.xy, r25.zwzz
            mov r26.z, r28.z
            dp3 r22.w, r26.xyzx, r2.xyzx
            mad_sat r22.w, r22.w, r25.x, -r28.w
            mov r28.z, r29.x
            dp3 r23.w, r28.xyzx, r2.xyzx
            mad_sat r23.w, r23.w, r25.x, -r29.y
            mul r22.w, r22.w, r23.w
            mov r30.zw, r29.zzzw
            dp3 r23.w, r30.zwxz, r2.xyzx
            mad_sat r23.w, r23.w, r25.x, -r30.y
            mul r22.w, r22.w, r23.w
            mul r23.w, r22.w, r22.w
            mad r22.w, -r22.w, l(2.000000), l(3.000000)
            mul r22.w, r22.w, r23.w
            movc r20.w, r20.w, r22.w, l(1.000000)
            mul r19.w, r19.w, r20.w
          endif 
          lt r20.w, r19.w, l(0.000100)
          iadd r22.w, r16.w, -r20.w
          mov r12.z, r18.w
          mov r16.w, r22.w
          continuec_nz r20.w
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r25.xyz, r17.w, l(16), t11.xyzx
          and r17.w, r26.w, l(2)
          ult r17.w, l(0), r17.w
          mul r25.xyz, r19.wwww, r25.xyzx
          dp3 r19.w, r6.xzyx, r27.xyzx
          mov_sat r20.w, r19.w
          mad r18.xyz, r20.wwww, r25.xyzx, r18.xyzx
          mad r26.xyz, r24.xyzx, r21.wwww, r5.xwyx
          dp3 r22.w, r26.xyzx, r26.xyzx
          rsq r22.w, r22.w
          mul r26.xyz, r22.wwww, r26.xyzx
          dp3 r22.w, r26.xzyx, r5.xywx
          add r22.w, -r22.w, l(1.000000)
          mul r23.w, r22.w, r22.w
          mul r23.w, r23.w, r23.w
          mul r22.w, r22.w, r23.w
          mad r28.xyz, r15.xyzx, r22.wwww, r7.xyzx
          dp3 r29.x, r8.yzwy, r27.xyzx
          dp3 r29.y, r10.zyxz, r27.xyzx
          mov r19.w, |r19.w|
          mul r27.xy, r29.xyxx, r29.xyxx
          mul r22.w, r14.x, r27.y
          mad r22.w, r13.y, r27.x, r22.w
          mad r22.w, r19.w, r19.w, r22.w
          sqrt r22.w, r22.w
          mul r22.w, |r6.w|, r22.w
          mad r19.w, r19.w, r12.x, r22.w
          add r19.w, r19.w, r19.w
          max r19.w, r19.w, l(0.000100)
          div r19.w, l(1.000000, 1.000000, 1.000000, 1.000000), r19.w
          mul r27.xyz, r19.wwww, r28.xyzx
          mul r27.xyz, r20.wwww, r27.xyzx
          dp3 r28.x, r26.xyzx, r8.yzwy
          dp3 r28.y, r26.zyxz, r10.xyzx
          dp3 r22.w, r26.xzyx, r4.xyzx
          mul r26.xy, r28.xyxx, r28.xyxx
          div r23.w, r26.x, r13.y
          mad r23.w, r22.w, r22.w, r23.w
          div r24.w, r26.y, r14.x
          add r23.w, r23.w, r24.w
          mul r23.w, r23.w, r23.w
          mul r23.w, r11.z, r23.w
          div r23.w, l(1.000000, 1.000000, 1.000000, 1.000000), r23.w
          mul r28.xyz, r23.wwww, r25.xyzx
          mul r27.xyz, r27.xyzx, r28.xyzx
          mad r24.xyz, r24.xyzx, r21.wwww, r16.xyzx
          dp3 r21.w, r24.xyzx, r24.xyzx
          rsq r21.w, r21.w
          mad r24.xyz, r24.xyzx, r21.wwww, r5.xwyx
          dp3 r21.w, r24.xyzx, r24.xyzx
          rsq r21.w, r21.w
          mul r24.xyz, r21.wwww, r24.xyzx
          dp3 r21.w, r24.xzyx, r5.xywx
          add r21.w, -r21.w, l(1.000000)
          mul r23.w, r21.w, r21.w
          mul r23.w, r23.w, r23.w
          mul r21.w, r21.w, r23.w
          mad r24.xyz, r1.yzwy, r21.wwww, r17.xyzx
          add r28.xyz, -r24.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
          mul r24.xyz, r19.wwww, r24.xyzx
          mul r24.xyz, r20.wwww, r24.xyzx
          div r19.w, r26.x, r13.w
          mad r19.w, r22.w, r22.w, r19.w
          div r21.w, r26.y, r15.w
          add r19.w, r19.w, r21.w
          mul r19.w, r19.w, r19.w
          mul r19.w, r10.w, r19.w
          div r19.w, l(1.000000, 1.000000, 1.000000, 1.000000), r19.w
          mul r26.xyz, r19.wwww, r25.xyzx
          mul r24.xyz, r24.xyzx, r26.xyzx
          mad r24.xyz, r27.xyzx, r28.xyzx, r24.xyzx
          add r22.xyz, r22.xyzx, r24.xyzx
          mad r24.xyz, r20.wwww, r25.xyzx, r23.xyzx
          movc r23.xyz, r17.wwww, r24.xyzx, r23.xyzx
          iadd r16.w, r16.w, l(1)
          mov r12.z, r18.w
        endloop 
        bfi r2.w, l(31), l(1), r1.x, l(1)
        ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r2.w, l(0), t12.xxxx
        countbits r8.x, r2.w
        mov r19.xyz, r18.xyzx
        mov r20.xyz, r22.xyzx
        mov r21.xyz, r23.xyzx
        mov r12.z, r2.w
        mov r16.w, l(0)
        loop 
          uge r17.w, r16.w, r8.x
          breakc_nz r17.w
          firstbit_lo r17.w, r12.z
          ishl r18.w, l(1), r17.w
          not r18.w, r18.w
          and r18.w, r12.z, r18.w
          iadd r17.w, l(32), r17.w
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r24.xyzw, r17.w, l(0), t11.xyzw
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r25.xyz, r17.w, l(32), t11.xyzx
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.xyzw, r17.w, l(48), t11.xyzw
          and r19.w, r26.w, l(1)
          ult r19.w, l(0), r19.w
          add r24.xyz, -r2.xyzx, r24.xyzx
          dp3 r20.w, r24.xyzx, r24.xyzx
          max r20.w, r20.w, l(0.000010)
          rsq r21.w, r20.w
          div r22.w, l(1.000000, 1.000000, 1.000000, 1.000000), r20.w
          min r22.w, r22.w, r24.w
          mul r27.xyz, r21.wwww, r24.xyzx
          mul r20.w, r20.w, r20.w
          mad_sat r20.w, -r20.w, r26.x, l(1.000000)
          mul r20.w, r20.w, r20.w
          mul r20.w, r20.w, r22.w
          dp3 r22.w, r27.xyzx, -r25.xyzx
          mad_sat r22.w, r22.w, r26.y, r26.z
          movc r19.w, r19.w, r22.w, l(1.000000)
          mul r19.w, r19.w, r19.w
          mul r19.w, r20.w, r19.w
          if_nz r11.x
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r25.xyzw, r17.w, l(72), t11.xyzw
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r28.xyzw, r17.w, l(88), t11.zwxy
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r29.xyzw, r17.w, l(104), t11.xyzw
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r30.xy, r17.w, l(120), t11.xyxx
            ftoi r20.w, r25.y
            mov r26.xy, r25.zwzz
            mov r26.z, r28.z
            dp3 r22.w, r26.xyzx, r2.xyzx
            mad_sat r22.w, r22.w, r25.x, -r28.w
            mov r28.z, r29.x
            dp3 r23.w, r28.xyzx, r2.xyzx
            mad_sat r23.w, r23.w, r25.x, -r29.y
            mul r22.w, r22.w, r23.w
            mov r30.zw, r29.zzzw
            dp3 r23.w, r30.zwxz, r2.xyzx
            mad_sat r23.w, r23.w, r25.x, -r30.y
            mul r22.w, r22.w, r23.w
            mul r23.w, r22.w, r22.w
            mad r22.w, -r22.w, l(2.000000), l(3.000000)
            mul r22.w, r22.w, r23.w
            movc r20.w, r20.w, r22.w, l(1.000000)
            mul r19.w, r19.w, r20.w
          endif 
          lt r20.w, r19.w, l(0.000100)
          iadd r22.w, r16.w, -r20.w
          mov r12.z, r18.w
          mov r16.w, r22.w
          continuec_nz r20.w
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r25.xyz, r17.w, l(16), t11.xyzx
          and r17.w, r26.w, l(2)
          ult r17.w, l(0), r17.w
          mul r25.xyz, r19.wwww, r25.xyzx
          dp3 r19.w, r6.xzyx, r27.xyzx
          mov_sat r20.w, r19.w
          mad r19.xyz, r20.wwww, r25.xyzx, r19.xyzx
          mad r26.xyz, r24.xyzx, r21.wwww, r5.xwyx
          dp3 r22.w, r26.xyzx, r26.xyzx
          rsq r22.w, r22.w
          mul r26.xyz, r22.wwww, r26.xyzx
          dp3 r22.w, r26.xzyx, r5.xywx
          add r22.w, -r22.w, l(1.000000)
          mul r23.w, r22.w, r22.w
          mul r23.w, r23.w, r23.w
          mul r22.w, r22.w, r23.w
          mad r28.xyz, r15.xyzx, r22.wwww, r7.xyzx
          dp3 r29.x, r8.yzwy, r27.xyzx
          dp3 r29.y, r10.zyxz, r27.xyzx
          mov r19.w, |r19.w|
          mul r27.xy, r29.xyxx, r29.xyxx
          mul r22.w, r14.x, r27.y
          mad r22.w, r13.y, r27.x, r22.w
          mad r22.w, r19.w, r19.w, r22.w
          sqrt r22.w, r22.w
          mul r22.w, |r6.w|, r22.w
          mad r19.w, r19.w, r12.x, r22.w
          add r19.w, r19.w, r19.w
          max r19.w, r19.w, l(0.000100)
          div r19.w, l(1.000000, 1.000000, 1.000000, 1.000000), r19.w
          mul r27.xyz, r19.wwww, r28.xyzx
          mul r27.xyz, r20.wwww, r27.xyzx
          dp3 r28.x, r26.xyzx, r8.yzwy
          dp3 r28.y, r26.zyxz, r10.xyzx
          dp3 r22.w, r26.xzyx, r4.xyzx
          mul r26.xy, r28.xyxx, r28.xyxx
          div r23.w, r26.x, r13.y
          mad r23.w, r22.w, r22.w, r23.w
          div r24.w, r26.y, r14.x
          add r23.w, r23.w, r24.w
          mul r23.w, r23.w, r23.w
          mul r23.w, r11.z, r23.w
          div r23.w, l(1.000000, 1.000000, 1.000000, 1.000000), r23.w
          mul r28.xyz, r23.wwww, r25.xyzx
          mul r27.xyz, r27.xyzx, r28.xyzx
          mad r24.xyz, r24.xyzx, r21.wwww, r16.xyzx
          dp3 r21.w, r24.xyzx, r24.xyzx
          rsq r21.w, r21.w
          mad r24.xyz, r24.xyzx, r21.wwww, r5.xwyx
          dp3 r21.w, r24.xyzx, r24.xyzx
          rsq r21.w, r21.w
          mul r24.xyz, r21.wwww, r24.xyzx
          dp3 r21.w, r24.xzyx, r5.xywx
          add r21.w, -r21.w, l(1.000000)
          mul r23.w, r21.w, r21.w
          mul r23.w, r23.w, r23.w
          mul r21.w, r21.w, r23.w
          mad r24.xyz, r1.yzwy, r21.wwww, r17.xyzx
          add r28.xyz, -r24.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
          mul r24.xyz, r19.wwww, r24.xyzx
          mul r24.xyz, r20.wwww, r24.xyzx
          div r19.w, r26.x, r13.w
          mad r19.w, r22.w, r22.w, r19.w
          div r21.w, r26.y, r15.w
          add r19.w, r19.w, r21.w
          mul r19.w, r19.w, r19.w
          mul r19.w, r10.w, r19.w
          div r19.w, l(1.000000, 1.000000, 1.000000, 1.000000), r19.w
          mul r26.xyz, r19.wwww, r25.xyzx
          mul r24.xyz, r24.xyzx, r26.xyzx
          mad r24.xyz, r27.xyzx, r28.xyzx, r24.xyzx
          add r20.xyz, r20.xyzx, r24.xyzx
          mad r24.xyz, r20.wwww, r25.xyzx, r21.xyzx
          movc r21.xyz, r17.wwww, r24.xyzx, r21.xyzx
          iadd r16.w, r16.w, l(1)
          mov r12.z, r18.w
        endloop 
      else 
        ishl r1.y, r1.x, l(1)
        ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.y, r1.y, l(0), t12.xxxx
        countbits r1.z, r1.y
        ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r1.x, l(0), t13.xxxx
        and r1.w, r1.w, l(0x80000000)
        add r15.xyz, -r7.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        mul r2.w, r7.w, r9.x
        mov r16.xyz, l(0,0,0,0)
        mov r17.xyz, l(0,0,0,0)
        mov r18.xyz, l(0,0,0,0)
        mov r7.w, r1.y
        mov r8.x, l(0)
        loop 
          uge r9.x, r8.x, r1.z
          breakc_nz r9.x
          firstbit_lo r9.x, r7.w
          ishl r10.w, l(1), r9.x
          not r10.w, r10.w
          and r10.w, r7.w, r10.w
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r22.xyzw, r9.x, l(0), t11.xyzw
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r23.xyz, r9.x, l(32), t11.xyzx
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r24.xyzw, r9.x, l(48), t11.xyzw
          and r11.x, r24.w, l(1)
          ult r11.x, l(0), r11.x
          add r22.xyz, -r2.xyzx, r22.xyzx
          dp3 r11.z, r22.xyzx, r22.xyzx
          max r11.z, r11.z, l(0.000010)
          rsq r12.z, r11.z
          div r13.w, l(1.000000, 1.000000, 1.000000, 1.000000), r11.z
          min r13.w, r13.w, r22.w
          mul r25.xyz, r12.zzzz, r22.xyzx
          mul r11.z, r11.z, r11.z
          mad_sat r11.z, -r11.z, r24.x, l(1.000000)
          mul r11.z, r11.z, r11.z
          mul r11.z, r11.z, r13.w
          dp3 r13.w, r25.xyzx, -r23.xyzx
          mad_sat r13.w, r13.w, r24.y, r24.z
          movc r11.x, r11.x, r13.w, l(1.000000)
          mul r11.x, r11.x, r11.x
          mul r11.x, r11.z, r11.x
          if_nz r1.w
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r23.xyzw, r9.x, l(72), t11.xyzw
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.xyzw, r9.x, l(88), t11.zwxy
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r27.xyzw, r9.x, l(104), t11.xyzw
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r28.xy, r9.x, l(120), t11.xyxx
            ftoi r11.z, r23.y
            mov r24.xy, r23.zwzz
            mov r24.z, r26.z
            dp3 r13.w, r24.xyzx, r2.xyzx
            mad_sat r13.w, r13.w, r23.x, -r26.w
            mov r26.z, r27.x
            dp3 r15.w, r26.xyzx, r2.xyzx
            mad_sat r15.w, r15.w, r23.x, -r27.y
            mul r13.w, r13.w, r15.w
            mov r28.zw, r27.zzzw
            dp3 r15.w, r28.zwxz, r2.xyzx
            mad_sat r15.w, r15.w, r23.x, -r28.y
            mul r13.w, r13.w, r15.w
            mul r15.w, r13.w, r13.w
            mad r13.w, -r13.w, l(2.000000), l(3.000000)
            mul r13.w, r13.w, r15.w
            movc r11.z, r11.z, r13.w, l(1.000000)
            mul r11.x, r11.z, r11.x
          endif 
          lt r11.z, r11.x, l(0.000100)
          iadd r13.w, r8.x, -r11.z
          mov r7.w, r10.w
          mov r8.x, r13.w
          continuec_nz r11.z
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r23.xyz, r9.x, l(16), t11.xyzx
          and r9.x, r24.w, l(2)
          ult r9.x, l(0), r9.x
          mul r23.xyz, r11.xxxx, r23.xyzx
          dp3_sat r11.x, r6.xzyx, r25.xyzx
          mad r16.xyz, r11.xxxx, r23.xyzx, r16.xyzx
          mad r22.xyz, r22.xyzx, r12.zzzz, r5.xwyx
          dp3 r11.z, r22.xyzx, r22.xyzx
          rsq r11.z, r11.z
          mul r22.xyz, r11.zzzz, r22.xyzx
          dp3 r11.z, r22.xzyx, r5.xywx
          add r11.z, -r11.z, l(1.000000)
          mul r12.z, r11.z, r11.z
          mul r12.z, r12.z, r12.z
          mul r11.z, r11.z, r12.z
          mad r24.xyz, r15.xyzx, r11.zzzz, r7.xyzx
          dp3_sat r11.z, r4.xzyx, r25.xyzx
          dp3 r26.x, r8.yzwy, r25.xyzx
          dp3 r26.y, r10.zyxz, r25.xyzx
          mul r25.xy, r26.xyxx, r26.xyxx
          mul r12.z, r14.x, r25.y
          mad r12.z, r13.y, r25.x, r12.z
          mad r12.z, r11.z, r11.z, r12.z
          sqrt r12.z, r12.z
          mul r12.z, r11.w, r12.z
          mad r12.z, r11.z, r12.x, r12.z
          add r12.z, r12.z, r12.z
          max r12.z, r12.z, l(0.000100)
          div r12.z, l(1.000000, 1.000000, 1.000000, 1.000000), r12.z
          mul r24.xyz, r12.zzzz, r24.xyzx
          mul r24.xyz, r11.zzzz, r24.xyzx
          dp3 r25.x, r22.xyzx, r8.yzwy
          dp3 r25.y, r22.zyxz, r10.xyzx
          dp3 r11.z, r22.xzyx, r4.xyzx
          mul r22.xy, r25.xyxx, r25.xyxx
          div r12.z, r22.x, r13.y
          mad r11.z, r11.z, r11.z, r12.z
          div r12.z, r22.y, r14.x
          add r11.z, r11.z, r12.z
          mul r11.z, r11.z, r11.z
          mul r11.z, r2.w, r11.z
          div r11.z, l(1.000000, 1.000000, 1.000000, 1.000000), r11.z
          mul r22.xyz, r11.zzzz, r23.xyzx
          mad r17.xyz, r24.xyzx, r22.xyzx, r17.xyzx
          mad r22.xyz, r11.xxxx, r23.xyzx, r18.xyzx
          movc r18.xyz, r9.xxxx, r22.xyzx, r18.xyzx
          iadd r8.x, r8.x, l(1)
          mov r7.w, r10.w
        endloop 
        bfi r1.x, l(31), l(1), r1.x, l(1)
        ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r1.x, l(0), t12.xxxx
        countbits r1.y, r1.x
        mov r19.xyz, r16.xyzx
        mov r20.xyz, r17.xyzx
        mov r21.xyz, r18.xyzx
        mov r1.z, r1.x
        mov r7.w, l(0)
        loop 
          uge r8.x, r7.w, r1.y
          breakc_nz r8.x
          firstbit_lo r8.x, r1.z
          ishl r9.x, l(1), r8.x
          not r9.x, r9.x
          and r9.x, r1.z, r9.x
          iadd r8.x, l(32), r8.x
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r22.xyzw, r8.x, l(0), t11.xyzw
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r23.xyz, r8.x, l(32), t11.xyzx
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r24.xyzw, r8.x, l(48), t11.xyzw
          and r10.w, r24.w, l(1)
          ult r10.w, l(0), r10.w
          add r22.xyz, -r2.xyzx, r22.xyzx
          dp3 r11.x, r22.xyzx, r22.xyzx
          max r11.x, r11.x, l(0.000010)
          rsq r11.z, r11.x
          div r12.z, l(1.000000, 1.000000, 1.000000, 1.000000), r11.x
          min r12.z, r12.z, r22.w
          mul r25.xyz, r11.zzzz, r22.xyzx
          mul r11.x, r11.x, r11.x
          mad_sat r11.x, -r11.x, r24.x, l(1.000000)
          mul r11.x, r11.x, r11.x
          mul r11.x, r11.x, r12.z
          dp3 r12.z, r25.xyzx, -r23.xyzx
          mad_sat r12.z, r12.z, r24.y, r24.z
          movc r10.w, r10.w, r12.z, l(1.000000)
          mul r10.w, r10.w, r10.w
          mul r10.w, r11.x, r10.w
          if_nz r1.w
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r23.xyzw, r8.x, l(72), t11.xyzw
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r26.xyzw, r8.x, l(88), t11.zwxy
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r27.xyzw, r8.x, l(104), t11.xyzw
            ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r28.xy, r8.x, l(120), t11.xyxx
            ftoi r11.x, r23.y
            mov r24.xy, r23.zwzz
            mov r24.z, r26.z
            dp3 r12.z, r24.xyzx, r2.xyzx
            mad_sat r12.z, r12.z, r23.x, -r26.w
            mov r26.z, r27.x
            dp3 r13.w, r26.xyzx, r2.xyzx
            mad_sat r13.w, r13.w, r23.x, -r27.y
            mul r12.z, r12.z, r13.w
            mov r28.zw, r27.zzzw
            dp3 r13.w, r28.zwxz, r2.xyzx
            mad_sat r13.w, r13.w, r23.x, -r28.y
            mul r12.z, r12.z, r13.w
            mul r13.w, r12.z, r12.z
            mad r12.z, -r12.z, l(2.000000), l(3.000000)
            mul r12.z, r12.z, r13.w
            movc r11.x, r11.x, r12.z, l(1.000000)
            mul r10.w, r10.w, r11.x
          endif 
          lt r11.x, r10.w, l(0.000100)
          iadd r12.z, r7.w, -r11.x
          mov r1.z, r9.x
          mov r7.w, r12.z
          continuec_nz r11.x
          ld_structured_indexable(structured_buffer, stride=128)(mixed,mixed,mixed,mixed) r23.xyz, r8.x, l(16), t11.xyzx
          and r8.x, r24.w, l(2)
          ult r8.x, l(0), r8.x
          mul r23.xyz, r10.wwww, r23.xyzx
          dp3_sat r10.w, r6.xzyx, r25.xyzx
          mad r19.xyz, r10.wwww, r23.xyzx, r19.xyzx
          mad r22.xyz, r22.xyzx, r11.zzzz, r5.xwyx
          dp3 r11.x, r22.xyzx, r22.xyzx
          rsq r11.x, r11.x
          mul r22.xyz, r11.xxxx, r22.xyzx
          dp3 r11.x, r22.xzyx, r5.xywx
          add r11.x, -r11.x, l(1.000000)
          mul r11.z, r11.x, r11.x
          mul r11.z, r11.z, r11.z
          mul r11.x, r11.x, r11.z
          mad r24.xyz, r15.xyzx, r11.xxxx, r7.xyzx
          dp3_sat r11.x, r4.xzyx, r25.xyzx
          dp3 r26.x, r8.yzwy, r25.xyzx
          dp3 r26.y, r10.zyxz, r25.xyzx
          mul r25.xy, r26.xyxx, r26.xyxx
          mul r11.z, r14.x, r25.y
          mad r11.z, r13.y, r25.x, r11.z
          mad r11.z, r11.x, r11.x, r11.z
          sqrt r11.z, r11.z
          mul r11.z, r11.z, r11.w
          mad r11.z, r11.x, r12.x, r11.z
          add r11.z, r11.z, r11.z
          max r11.z, r11.z, l(0.000100)
          div r11.z, l(1.000000, 1.000000, 1.000000, 1.000000), r11.z
          mul r24.xyz, r11.zzzz, r24.xyzx
          mul r24.xyz, r11.xxxx, r24.xyzx
          dp3 r25.x, r22.xyzx, r8.yzwy
          dp3 r25.y, r22.zyxz, r10.xyzx
          dp3 r11.x, r22.xzyx, r4.xyzx
          mul r22.xy, r25.xyxx, r25.xyxx
          div r11.z, r22.x, r13.y
          mad r11.x, r11.x, r11.x, r11.z
          div r11.z, r22.y, r14.x
          add r11.x, r11.z, r11.x
          mul r11.x, r11.x, r11.x
          mul r11.x, r2.w, r11.x
          div r11.x, l(1.000000, 1.000000, 1.000000, 1.000000), r11.x
          mul r22.xyz, r11.xxxx, r23.xyzx
          mad r20.xyz, r24.xyzx, r22.xyzx, r20.xyzx
          mad r22.xyz, r10.wwww, r23.xyzx, r21.xyzx
          movc r21.xyz, r8.xxxx, r22.xyzx, r21.xyzx
          iadd r7.w, r7.w, l(1)
          mov r1.z, r9.x
        endloop 
      endif 
    endif 
  endif 
  ld_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.xyww, t15.xyzw
  ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r2.x, l(0), l(12), t3.xxxx
  mul r1.xyz, r1.xyzx, r2.xxxx
  ld_indexable(texture2d)(float,float,float,float) r2.yzw, r0.xyzw, t0.wxyz
  mul r8.xyz, r2.xxxx, r2.yzwy
  dp3 r0.z, r8.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
  ge r0.z, r0.z, l(0.000100)
  and r0.z, r0.z, l(0x3f800000)
  mad r2.xyz, r2.yzwy, r2.xxxx, -r1.xyzx
  mad r2.xyz, r0.zzzz, r2.xyzx, r1.xyzx
  mad_sat r0.z, r4.w, cb3[0].x, cb3[0].y
  mul r0.z, r0.z, cb3[0].z
  mul r0.z, r3.x, r0.z
  mad r1.xyz, r1.yyyy, r0.zzzz, r1.xyzx
  and r0.z, r13.x, l(0x3e800000)
  mov r8.yzw, -r5.wwyx
  mul r11.xzw, r4.wwww, r8.wwyz
  mad r15.xyz, r8.wyzw, r4.wwww, r34.xyzx
  mov r8.x, l(1.000000)
  dp4 r16.x, cb0[38].xyzw, r8.xyzw
  dp4 r16.y, cb0[37].xyzw, r8.xyzw
  dp4 r16.z, cb0[36].xyzw, r8.xyzw
  max r16.xyz, r16.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  mad r12.xz, r15.yyxy, cb4[0].yyxy, cb4[0].wwzw
  sample_l_indexable(texture2d)(float,float,float,float) r0.w, r12.xzxx, t5.xzwy, s2, l(0.000000)
  mad r0.w, r0.w, cb4[2].x, cb4[2].y
  add r0.w, -r0.w, r15.z
  mul_sat r0.w, -r0.w, cb5[18].x
  sqrt r0.w, r0.w
  dp2 r2.w, r11.xzxx, r11.xzxx
  mad r2.w, cb4[1].x, r2.w, cb4[1].y
  mul_sat r2.w, r2.w, l(3.000000)
  mul r0.w, r0.w, r2.w
  dp4 r15.x, cb5[15].xyzw, r8.xyzw
  dp4 r15.y, cb5[16].xyzw, r8.xyzw
  dp4 r15.z, cb5[17].xyzw, r8.xyzw
  max r8.xyz, r15.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  mad r8.xyz, r8.xyzx, cb0[56].xxxx, -r16.xyzx
  mad r8.xyz, r0.wwww, r8.xyzx, r16.xyzx
  mad_sat r0.w, r4.w, cb0[35].y, cb0[35].x
  mul r2.w, r11.w, cb0[39].y
  max r2.w, r2.w, l(-125.000000)
  lt r3.x, 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.x, r2.w, l(1.000000)
  mad r2.w, r2.w, cb0[39].x, cb0[35].w
  mul r0.w, r0.w, r2.w
  mul r0.w, r0.w, -cb0[35].z
  exp r0.w, r0.w
  mad r8.xyz, -r8.xyzx, r0.wwww, r8.xyzx
  movc r4.xyz, r13.zzzz, r6.xyzx, r4.xyzx
  mul r6.xyz, r10.xyzx, r5.xywx
  mad r6.xyz, r5.ywxy, r10.zxyz, -r6.xyzx
  mul r11.xzw, r6.xxyz, r10.xxyz
  mad r6.xyz, r10.yzxy, r6.zxyz, -r11.xzwx
  add r6.xyz, -r4.xyzx, r6.xyzx
  mad r4.xyz, r3.yyyy, r6.xyzx, r4.xyzx
  dp3 r2.w, r4.xyzx, r4.xyzx
  rsq r2.w, r2.w
  mul r4.xyz, r2.wwww, r4.xyzx
  dp3 r2.w, r4.xyzx, r5.xywx
  add r2.w, r2.w, r2.w
  mad r4.xyz, -r2.wwww, r4.xyzx, r5.xywx
  mov r4.xyz, -r4.xyzx
  sample_l_indexable(texturecube)(float,float,float,float) r4.xyz, r4.xyzx, t1.xyzw, s0, r12.y
  ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r10.xyzw, l(0), l(108), t4.xywz
  dp3 r2.w, r10.xywx, l(0.212600, 0.715200, 0.072200, 0.000000)
  ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r10.xy, l(0), l(124), t4.xyxx
  dp3 r3.x, r10.zxyz, l(0.212600, 0.715200, 0.072200, 0.000000)
  max r2.w, r2.w, r3.x
  ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r3.x, l(0), l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r3.y, l(0), l(36), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=132)(mixed,mixed,mixed,mixed) r4.w, l(0), l(72), t4.xxxx
  max r3.y, r3.y, r4.w
  max r3.x, r3.y, r3.x
  add r2.w, r2.w, r3.x
  add r2.w, r2.w, l(-1.000000)
  mad r2.w, cb0[55].w, r2.w, l(1.000000)
  mul r4.xyz, r2.wwww, r4.xyzx
  mad r4.xyz, r4.xyzx, cb0[50].xyzx, cb0[49].xyzx
  mad r3.x, |r6.w|, l(0.968750), l(0.015625)
  mad r3.y, r3.z, l(0.968750), l(0.015625)
  sample_l_indexable(texture2d)(float,float,float,float) r3.xy, r3.xyxx, t2.xyzw, s1, l(0.000000)
  mad_sat r3.xyz, r7.xyzx, r3.yyyy, r3.xxxx
  mul r3.xyz, r3.xyzx, r4.xyzx
  movc r2.w, r13.x, l(0.750000), l(1.000000)
  mad_sat r0.z, r1.w, r2.w, r0.z
  mul r1.w, r0.z, r5.z
  movc r2.w, r12.w, l(1.200000), cb3[5].x
  add r4.x, r0.z, l(-1.000000)
  mad_sat r2.w, r2.w, r4.x, l(1.000000)
  mul r1.xyz, r1.wwww, r1.xyzx
  mad r4.xyz, r19.xyzx, r2.wwww, r1.xyzx
  mad r1.xyz, r21.xyzx, r2.wwww, r1.xyzx
  dp3 r1.x, r1.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
  mul r1.yzw, r9.yyyy, r20.xxyz
  dp3 r2.x, r2.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
  mul r2.xyz, r2.xxxx, r3.xyzx
  mul r2.xyz, r9.zzzz, r2.xyzx
  mul r2.xyz, r0.zzzz, r2.xyzx
  mad r0.z, r9.w, l(256.000000), l(1.000000)
  mul r2.xyz, r0.zzzz, r2.xyzx
  add r0.z, -r3.w, l(1.000000)
  mul r3.xyz, r4.xyzx, r14.yzwy
  mul r3.xyz, r0.zzzz, r3.xyzx
  mad r1.yzw, r1.yyzw, r2.wwww, r2.xxyz
  mad r0.z, cb1[8].w, r11.y, cb0[55].y
  exp r0.z, r0.z
  mul r0.z, r0.z, l(0.000183015567)
  mad r2.xyz, r14.yzwy, r0.zzzz, r3.xyzx
  add r1.yzw, r1.yyzw, r2.xxyz
  mad r1.yzw, r1.yyzw, r0.wwww, r8.xxyz
  ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r0.z, l(0), l(0), t3.xxxx
  mul r1.yzw, r0.zzzz, r1.yyzw
  max r1.yzw, r1.yyzw, l(0.000000, 0.0000610351999, 0.0000610351999, 0.0000610351999)
  min r1.yzw, r1.yyzw, l(0.000000, 8192.000000, 8192.000000, 8192.000000)
  lt r0.w, l(0.500000), cb3[1].x
  movc r2.xyz, r0.wwww, r14.yzwy, r1.yzwy
  dp3 r0.w, r4.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
  movc r0.w, cb3[5].z, r0.w, r1.x
  mul r0.z, r0.z, r0.w
  max r0.z, r0.z, l(0.0000610351999)
  min r2.w, r0.z, l(8192.000000)
  store_uav_typed u0.xyzw, r0.xyyy, r2.xyzw
endif 
ret 
// Approximately 1303 instruction slots used