// HALOS around smoke
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//   using 3Dmigoto v1.3.14 on Sat Mar 23 00:27:50 2019
//
//
// Buffer Definitions:
//
// cbuffer DSCommonBuffer
// {
//
//   float4x4 _unused_g_ds_viewProjectionMatrix;// Offset:    0 Size:    64 [unused]
//   float4x4 g_ds_viewMatrix;          // Offset:   64 Size:    64
//   float4x4 g_ds_projectionMatrix;    // Offset:  128 Size:    64
//   float4x4 _unused_g_ds_worldViewProjectionMatrix;// Offset:  192 Size:    64 [unused]
//   float g_ds_fogStartZ;              // Offset:  256 Size:     4
//   float g_ds_recFogEndZ;             // Offset:  260 Size:     4
//   uint g_ds_envCbIndex;              // Offset:  268 Size:     4 [unused]
//   float _unused_g_ds_nearFar;        // Offset:  336 Size:     4 [unused]
//   float _unused_g_ds_nearFarDistance;// Offset:  340 Size:     4 [unused]
//   float _unused_g_ds_far;            // Offset:  344 Size:     4 [unused]
//   float g_ds_near;                   // Offset:  348 Size:     4
//   float3 g_ds_eye;                   // Offset:  352 Size:    12
//   float g_ds_fadeNearStart;          // Offset:  368 Size:     4
//   float g_ds_fadeNearDist;           // Offset:  372 Size:     4
//   float g_ds_fadeFarStart;           // Offset:  376 Size:     4
//   float g_ds_fadeFarDist;            // Offset:  380 Size:     4
//   float3 g_ds_cameraPos;             // Offset:  384 Size:    12
//   float3 g_ds_cameraUp;              // Offset:  400 Size:    12 [unused]
//   float4 g_ds_softSpriteParam;       // Offset:  416 Size:    16 [unused]
//   float2 g_ds_softSpriteScaleOffset; // Offset:  432 Size:     8
//   float2 g_ds_softSpriteScaleOffsetDummy;// Offset:  440 Size:     8 [unused]
//   float4x4 g_ds_irradianceVolumeInvMatA;// Offset:  448 Size:    64
//   float4x4 g_ds_irradianceVolumeInvMatB;// Offset:  512 Size:    64
//   float g_ds_irradianceVolumeInterpRatio;// Offset:  576 Size:     4
//   int g_ds_bEnableLighting;          // Offset:  580 Size:     4
//   float g_ds_irradianceVolumeDiffuseColorScaleA;// Offset:  584 Size:     4
//   float g_ds_irradianceVolumeDiffuseColorScaleB;// Offset:  588 Size:     4
//   float g_ds_irradianceVolumeEnableA;// Offset:  592 Size:     4
//   float g_ds_irradianceVolumeEnableB;// Offset:  596 Size:     4
//   int g_ds_isIVUpper;                // Offset:  600 Size:     4
//   float4 g_ds_irradianceVolumeSamplingParamA;// Offset:  608 Size:    16
//   float4 g_ds_irradianceVolumeSamplingParamB;// Offset:  624 Size:    16
//   float4 g_ds_envCbColScale;         // Offset:  640 Size:    16 [unused]
//
//   struct TileBasedLightingParam
//   {
//
//       float4 screenSize;             // Offset:  656
//       float frustumNear;             // Offset:  672
//       float frustumSliceScale;       // Offset:  676
//       float frustumSliceBias;        // Offset:  680
//       uint isDynamicLightEnable;     // Offset:  684
//       uint lightTile_Width;          // Offset:  688
//       uint lightTile_NumCellX;       // Offset:  692
//       uint padding[2];               // Offset:  704
//
//   } g_ds_tileBasedLightingParam;     // Offset:  656 Size:    68
//
// }
//
// Resource bind info for g_LightIndices
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
// Resource bind info for g_LightLookupBuffer
// {
//
//   uint3 $Element;                    // Offset:    0 Size:    12
//
// }
//
// Resource bind info for g_LightBuffer
// {
//
//   struct PointLight
//   {
//
//       float4 PositionAndRadius;      // Offset:    0
//       float4 DiffColor;              // Offset:   16
//       float4 SpecColor;              // Offset:   32
//       float4 TransLightParam;        // Offset:   48
//       float LightType;               // Offset:   64
//       float3 Pad;                    // Offset:   68
//       float4 ProjParam;              // Offset:   80
//       float4 ShadowCenterPos;        // Offset:   96
//       float4 ViewportScaleOffset[6]; // Offset:  112
//
//   } $Element;                        // Offset:    0 Size:   208
//
// }
//
// Resource bind info for g_SpotLightBuffer
// {
//
//   struct SpotLight
//   {
//
//       float4 PositionAndRange;       // Offset:    0
//       float4 DiffColor;              // Offset:   16
//       float4 SpecColor;              // Offset:   32
//       float3 TransLightParam;        // Offset:   48
//       float ShadingMode;             // Offset:   60
//       float4x4 ViewToLightSpaceMatrix;// Offset:   64
//       float LightType;               // Offset:  128
//       float MinDist;                 // Offset:  132
//       float MaxDist;                 // Offset:  136
//       float Pad;                     // Offset:  140
//       float4 CullPositionAndRange;   // Offset:  144
//       float4 ShadowParam;            // Offset:  160
//       float4 ViewportScaleOffset;    // Offset:  176
//
//   } $Element;                        // Offset:    0 Size:   192
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_ClampLinearSampler              sampler      NA          NA    9        1
// g_IrradianceVolumeY               texture  float4          3d    9        1
// g_IrradianceVolumeW               texture  float4          3d   11        1
// g_IrradianceVolume2Y              texture  float4          3d   13        1
// g_IrradianceVolume2W              texture  float4          3d   15        1
// g_LightIndices                    texture  struct         r/o   59        1
// g_LightLookupBuffer               texture  struct         r/o   60        1
// g_LightBuffer                     texture  struct         r/o   61        1
// g_SpotLightBuffer                 texture  struct         r/o   62        1
// DSCommonBuffer                    cbuffer      NA          NA    0        1
//
//
//
// Patch Constant signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TESSFACTOR            0   x           0 QUADEDGE   float
// SV_TESSFACTOR            1   x           1 QUADEDGE   float
// SV_TESSFACTOR            2   x           2 QUADEDGE   float
// SV_TESSFACTOR            3   x           3 QUADEDGE   float
// SV_INSIDETESSFACTOR      0   x           4  QUADINT   float
// SV_INSIDETESSFACTOR      1   x           5  QUADINT   float
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// COLOR                    0   xyzw        1     NONE   float   xyzw
// COLOR                    1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xyzw        3     NONE   float   xyzw
// TEXCOORD                 1   xyzw        4     NONE   float   xyz
// TEXCOORD                 2   xy          5     NONE   float   xy
// TEXCOORD                 3   xyzw        6     NONE   float   xyzw
// TEXCOORD                 4   xyzw        7     NONE   float   xyzw
// TEXCOORD                 5   xyzw        8     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR                    0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xyz         1     NONE   float   xyz
// TEXCOORD                 1   xyz         2     NONE   float   xyz
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
// TEXCOORD                 3   xyzw        4     NONE   float   xyzw
// TEXCOORD                 4   xyzw        5     NONE   float   xyzw
// TEXCOORD                 5   xy          6     NONE   float   xy
// TEXCOORD                 6   xyz         7     NONE   float   xyz
// SV_POSITION              0   xyzw        8      POS   float   xyzw
//
// Tessellation Domain   # of control points
// -------------------- --------------------
// Quadrilateral                           1
//
ds_5_0
dcl_input_control_point_count 1
dcl_tessellator_domain domain_quad
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[44], immediateIndexed
dcl_sampler s9, mode_default
dcl_resource_texture3d (float,float,float,float) t9
dcl_resource_texture3d (float,float,float,float) t11
dcl_resource_texture3d (float,float,float,float) t13
dcl_resource_texture3d (float,float,float,float) t15
dcl_resource_structured t59, 4
dcl_resource_structured t60, 12
dcl_resource_structured t61, 208
dcl_resource_structured t62, 192
dcl_input vDomain.xy
dcl_input vicp[1][0].xyzw
dcl_input vicp[1][1].xyzw
dcl_input vicp[1][2].xyzw
dcl_input vicp[1][3].xyzw
dcl_input vicp[1][4].xyz
dcl_input vicp[1][5].xy
dcl_input vicp[1][6].xyzw
dcl_input vicp[1][7].xyzw
dcl_input vicp[1][8].xyzw
dcl_output o0.xyzw
dcl_output o1.xyz
dcl_output o2.xyz
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xy
dcl_output o7.xyz
dcl_output_siv o8.xyzw, position

dcl_temps 15
dcl_resource_texture2d (float,float,float,float) t125

dcl_indexableTemp x0[3], 4
dcl_indexableTemp x1[3], 4
add r0.xy, vDomain.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
mov r1.xw, l(1.000000,0,0,-1.000000)
mov r1.yz, vicp[0][4].yyxy
mul r0.xy, r0.xyxx, r1.xyxx
mad o1.xy, r0.xyxx, r1.zwzz, vicp[0][3].xyxx
mad o2.xy, r0.xyxx, r1.zwzz, vicp[0][3].zwzz
add r0.xy, vDomain.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
mov r0.zw, l(0,0,0,0)
add r0.xyzw, r0.xyzw, vicp[0][0].xyzw
dp4 r1.x, r0.xyzw, vicp[0][6].xyzw
dp4 r1.y, r0.xyzw, vicp[0][7].xyzw
dp4 r1.z, r0.xyzw, vicp[0][8].xyzw
mov r1.w, l(1.000000)
dp4 r0.x, r1.xyzw, cb0[4].xyzw
dp4 r0.y, r1.xyzw, cb0[5].xyzw
dp4 r0.z, r1.xyzw, cb0[6].xyzw
dp4 r0.w, r1.xyzw, cb0[7].xyzw
dp4 r2.x, r0.xyzw, cb0[8].xyzw
dp4 r2.y, r0.xyzw, cb0[9].xyzw
dp4 r2.w, r0.xyzw, cb0[11].xyzw
mul r3.x, cb0[27].x, vicp[0][5].y
mul r3.y, r3.x, l(0.500000)
mad r3.x, r3.x, l(0.500000), cb0[27].y
add r3.x, r2.w, -r3.x
add r3.z, l(1.000000), cb0[21].w
lt r3.w, r3.x, r3.z
add r3.z, -r3.x, r3.z
min r3.z, r3.z, l(1.000000)
add r4.x, r2.w, -r3.x
mad r3.z, r3.z, r4.x, r3.x
movc r4.x, r3.w, r3.z, r3.x
div r3.xz, r2.xxyx, r2.wwww
mad o3.xy, r3.xzxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
div r3.x, r2.w, r4.x
mov r4.y, l(1.000000)
dp2 r3.z, r4.xyxx, cb0[10].zwzz
mul r2.z, r3.z, r3.x
mad o3.w, cb0[27].y, l(2.000000), r3.y
add o5.xyz, -r1.xyzx, cb0[22].xyzx
add r3.x, r2.w, -cb0[16].x
mul_sat o1.z, r3.x, cb0[16].y
mul r3.xyzw, vicp[0][1].xyzw, vicp[0][2].xyzw
add r4.yzw, -r1.xxyz, cb0[24].xxyz
dp3 r4.y, r4.yzwy, r4.yzwy
sqrt r4.y, r4.y
ge r4.zw, l(0.000000, 0.000000, 0.000100, 0.000100), cb0[23].yyyw
and r5.x, r4.w, r4.z
add r5.yz, r4.yyyy, -cb0[23].zzxz
div_sat r5.y, r5.y, cb0[23].w
div_sat r5.z, r5.z, -cb0[23].y
add r5.yz, -r5.yyzy, l(0.000000, 1.000000, 1.000000, 0.000000)
movc r5.y, r4.z, r5.y, r5.z
or r4.z, r4.w, r4.z
movc r4.w, r5.x, l(1.000000), r5.y
div r5.x, l(-1.000000), cb0[23].y
div r5.y, l(1.000000, 1.000000, 1.000000, 1.000000), cb0[23].w
add r5.zw, r4.yyyy, -cb0[23].xxxz
mul_sat r5.xy, r5.xyxx, r5.zwzz
add r5.xy, -r5.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r4.y, r5.y, r5.x
movc r4.y, r4.z, r4.w, r4.y
mul_sat o0.w, r3.w, r4.y
ilt r3.w, l(0), cb0[36].y
if_nz r3.w
  if_nz cb0[37].z
    mov x0[0].yw, l(0,0,0,0)
    mov x0[1].yw, l(0,0,0,0)
    mov x0[2].yw, l(0,0,0,0)
    mov x1[0].yw, l(0,0,0,0)
    mov x1[1].yw, l(0,0,0,0)
    mov x1[2].yw, l(0,0,0,0)
    lt r4.yz, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[37].xxyx
    if_nz r4.y
      dp4 r5.x, r1.xyzw, cb0[28].xyzw
      dp4 r5.y, r1.xyzw, cb0[29].xyzw
      dp4 r5.z, r1.xyzw, cb0[30].xyzw
      add r6.xyz, r5.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      add r7.xyzw, r1.xyzw, l(0.000000, 1.000000, 0.000000, 0.000000)
      dp4 r8.x, r7.xyzw, cb0[28].xyzw
      dp4 r8.y, r7.xyzw, cb0[29].xyzw
      dp4 r8.z, r7.xyzw, cb0[30].xyzw
      add r5.xyz, -r5.xyzx, r8.xyzx
      dp3 r3.w, r5.xyzx, r5.xyzx
      rsq r3.w, r3.w
      mul r5.xyz, r3.wwww, r5.xyzx
      div r5.xyz, r5.xyzx, cb0[38].xyzx
      mad r5.xyz, r6.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), r5.xyzx
      sample_l_indexable(texture3d)(float,float,float,float) r6.xyzw, r5.xyzx, t9.xyzw, s9, l(0.000000)
      sample_l_indexable(texture3d)(float,float,float,float) r5.xyzw, r5.xyzx, t11.xyzw, s9, l(0.000000)
      add r6.xyzw, r6.xyzw, l(-0.500000, -0.500000, -0.500000, -0.500000)
      mul r3.w, r6.w, l(20.000000)
      exp r3.w, r3.w
      add r3.w, r3.w, r3.w
      mul r6.xyz, r3.wwww, r6.xyzx
      add r5.xyzw, r5.xyzw, l(-0.500000, -0.500000, -0.500000, -0.500000)
      mul r3.w, r5.w, l(20.000000)
      exp r3.w, r3.w
      add r3.w, r3.w, r3.w
      mul r5.xyz, r3.wwww, r5.xzyx
      mov r6.w, r5.x
      mov x0[0].yw, r6.xxxw
      mov r5.xw, r6.zzzy
      mov x0[1].yw, r5.wwwz
      mov x0[2].yw, r5.xxxy
    endif
    if_nz r4.z
      dp4 r5.x, r1.xyzw, cb0[32].xyzw
      dp4 r5.y, r1.xyzw, cb0[33].xyzw
      dp4 r5.z, r1.xyzw, cb0[34].xyzw
      add r4.yzw, r5.xxyz, l(0.000000, 1.000000, 1.000000, 1.000000)
      add r6.xyzw, r1.xyzw, l(0.000000, 1.000000, 0.000000, 0.000000)
      dp4 r7.x, r6.xyzw, cb0[32].xyzw
      dp4 r7.y, r6.xyzw, cb0[33].xyzw
      dp4 r7.z, r6.xyzw, cb0[34].xyzw
      add r5.xyz, -r5.xyzx, r7.xyzx
      dp3 r3.w, r5.xyzx, r5.xyzx
      rsq r3.w, r3.w
      mul r5.xyz, r3.wwww, r5.xyzx
      div r5.xyz, r5.xyzx, cb0[39].xyzx
      mad r4.yzw, r4.yyzw, l(0.000000, 0.500000, 0.500000, 0.500000), r5.xxyz
      sample_l_indexable(texture3d)(float,float,float,float) r5.xyzw, r4.yzwy, t13.xyzw, s9, l(0.000000)
      sample_l_indexable(texture3d)(float,float,float,float) r6.xyzw, r4.yzwy, t15.xyzw, s9, l(0.000000)
      add r5.xyzw, r5.xyzw, l(-0.500000, -0.500000, -0.500000, -0.500000)
      mul r3.w, r5.w, l(20.000000)
      exp r3.w, r3.w
      add r3.w, r3.w, r3.w
      mul r5.xyz, r3.wwww, r5.xyzx
      add r6.xyzw, r6.xyzw, l(-0.500000, -0.500000, -0.500000, -0.500000)
      mul r3.w, r6.w, l(20.000000)
      exp r3.w, r3.w
      add r3.w, r3.w, r3.w
      mul r6.xyz, r3.wwww, r6.xzyx
      mov r5.w, r6.x
      mov x1[0].yw, r5.xxxw
      mov r6.xw, r5.zzzy
      mov x1[1].yw, r6.wwwz
      mov x1[2].yw, r6.xxxy
    endif
    mov r4.yz, x0[0].yywy
    mul r4.yz, r4.yyzy, cb0[36].zzzz
    mov r5.xy, x0[1].ywyy
    mov r5.zw, x0[2].yyyw
    mul r5.xyzw, r5.xyzw, cb0[36].zzzz
    mov r6.xy, x1[0].ywyy
    mov r6.zw, x1[1].yyyw
    mov r7.xy, x1[2].ywyy
    mad r6.xy, r6.xyxx, cb0[36].wwww, -r4.yzyy
    mad r4.yz, cb0[36].xxxx, r6.xxyx, r4.yyzy
    mad r6.xy, r6.zwzz, cb0[36].wwww, -r5.xyxx
    mad r5.xy, cb0[36].xxxx, r6.xyxx, r5.xyxx
    mad r6.xy, r7.xyxx, cb0[36].wwww, -r5.zwzz
    mad r5.zw, cb0[36].xxxx, r6.xxxy, r5.zzzw
    dp2 r6.x, l(1.000000, 1.000000, 0.000000, 0.000000), r4.yzyy
    dp2 r6.y, l(1.000000, 1.000000, 0.000000, 0.000000), r5.xyxx
    dp2 r6.z, l(1.000000, 1.000000, 0.000000, 0.000000), r5.zwzz
    max r4.yzw, r6.xxyz, l(0.000000, 0.000000, 0.000000, 0.000000)
  else
    lt r5.xy, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[37].xyxx
    if_nz r5.x
      dp4 r6.x, r1.xyzw, cb0[28].xyzw
      dp4 r6.y, r1.xyzw, cb0[29].xyzw
      dp4 r6.z, r1.xyzw, cb0[30].xyzw
      add r5.xzw, r6.xxyz, l(1.000000, 0.000000, 1.000000, 1.000000)
      mul r5.xzw, r5.xxzw, l(0.500000, 0.000000, 0.500000, 0.500000)
      sample_l_indexable(texture3d)(float,float,float,float) r6.xyzw, r5.xzwx, t11.xyzw, s9, l(0.000000)
      add r6.xyzw, r6.xyzw, l(-0.500000, -0.500000, -0.500000, -0.500000)
      mul r3.w, r6.w, l(20.000000)
      exp r3.w, r3.w
      add r3.w, r3.w, r3.w
      mul r5.xzw, r3.wwww, r6.xxyz
      max r5.xzw, r5.xxzw, l(0.000000, 0.000000, 0.000000, 0.000000)
      mul r5.xzw, r5.xxzw, cb0[36].zzzz
    else
      mov r5.xzw, l(0,0,0,0)
    endif
    if_nz r5.y
      dp4 r6.x, r1.xyzw, cb0[32].xyzw
      dp4 r6.y, r1.xyzw, cb0[33].xyzw
      dp4 r6.z, r1.xyzw, cb0[34].xyzw
      add r1.xyz, r6.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      mul r1.xyz, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
      sample_l_indexable(texture3d)(float,float,float,float) r1.xyzw, r1.xyzx, t15.xyzw, s9, l(0.000000)
      add r1.xyzw, r1.xyzw, l(-0.500000, -0.500000, -0.500000, -0.500000)
      mul r1.w, r1.w, l(20.000000)
      exp r1.w, r1.w
      add r1.w, r1.w, r1.w
      mul r1.xyz, r1.wwww, r1.xyzx
      max r1.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
      mul r1.xyz, r1.xyzx, cb0[36].wwww
    else
      mov r1.xyz, l(0,0,0,0)
    endif
    add r1.xyz, -r5.xzwx, r1.xyzx
    mad r4.yzw, cb0[36].xxxx, r1.xxyz, r5.xxzw
  endif
  if_nz cb0[42].w
    div r0.xyz, r0.xyzx, r0.wwww
    mul r1.xyz, l(0.500000, -0.500000, 0.500000, 0.000000), cb0[41].xyyx
    lt r1.w, l(0.000000), r2.z
    if_nz r1.w
      div r5.xyz, r2.xywx, r2.wwww
      dp2 r6.x, r5.xzxx, r1.xxxx
      dp2 r6.y, r5.yzyy, r1.yzyy
      add r1.xy, l(-1.000000, -1.000000, 0.000000, 0.000000), cb0[41].xyxx
      max r1.zw, r6.xxxy, l(0.000000, 0.000000, 0.000000, 0.000000)
      min r1.xy, r1.xyxx, r1.zwzz
      ftou r1.xy, r1.xyxx
      udiv r1.xy, null, r1.xyxx, cb0[43].xxxx
      utof r1.xy, r1.xyxx
      utof r1.z, cb0[43].y
      mad r1.x, r1.y, r1.z, r1.x
      add r1.y, r0.z, -cb0[42].x
      log r1.y, r1.y
      add r1.y, r1.y, -cb0[42].z
      div r1.y, r1.y, cb0[42].y
      max r1.y, r1.y, l(0.000000)
      min r1.y, r1.y, l(14.000000)
      ftou r1.xy, r1.xyxx
      ishl r1.y, l(1), r1.y
      ld_structured_indexable(structured_buffer, stride=12)(mixed,mixed,mixed,mixed) r1.zw, r1.x, l(0), t60.xxxy
      and r1.w, r1.w, l(0x0000ffff)
      if_nz r1.w
        mov r3.w, r1.z
        mov r5.xyzw, l(0,0,0,0)
        loop
          uge r6.x, r5.w, r1.w
          breakc_nz r6.x
          ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r6.x, r3.w, l(0), t59.xxxx
          ushr r6.y, r6.x, l(16)
          iadd r6.z, r3.w, l(1)
          and r6.y, r1.y, r6.y
          if_z r6.y
            iadd r6.y, r5.w, l(1)
            mov r3.w, r6.z
            mov r5.w, r6.y
            continue
          endif
          and r6.x, r6.x, l(0x0000ffff)
          ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r7.xyzw, r6.x, l(0), t61.xyzw
          ld_structured_indexable(structured_buffer, stride=208)(mixed,mixed,mixed,mixed) r8.xyzw, r6.x, l(16), t61.xyzw
          add r6.xyw, r0.xyxz, -r7.xyxz
          dp3 r6.x, r6.xywx, r6.xywx
          sqrt r6.y, r6.x
          mad_sat r6.x, -r6.x, r7.w, l(1.000000)
          mul r6.w, r8.w, r6.y
          mul r6.w, r6.w, r6.w
          mad r6.w, r6.w, l(0.700000), l(1.000000)
          div r6.x, r6.x, r6.w
          mad r6.y, r6.y, r8.w, l(1.400000)
          div r6.y, l(1.400000), r6.y
          mul r6.y, r6.y, r6.y
          mad r6.y, r6.y, l(0.750000), l(0.250000)
          mul r6.x, r6.x, r6.y
          mad r5.xyz, r6.xxxx, r8.xyzx, r5.xyzx
          iadd r5.w, r5.w, l(1)
          mov r3.w, r6.z
        endloop
        mov r1.z, r3.w
      else
        mov r5.xyz, l(0,0,0,0)
      endif
      ld_structured_indexable(structured_buffer, stride=12)(mixed,mixed,mixed,mixed) r1.x, r1.x, l(4), t60.xxxx
      ushr r1.x, r1.x, l(16)
      if_nz r1.x
        mov r0.w, l(1.000000)
        mov r6.xyz, r5.xyzx
        mov r1.w, r1.z
        mov r3.w, l(0)
        loop
          uge r5.w, r3.w, r1.x
          breakc_nz r5.w
          ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r5.w, r1.w, l(0), t59.xxxx
          ushr r6.w, r5.w, l(16)
          iadd r7.x, r1.w, l(1)
          and r6.w, r1.y, r6.w
          if_z r6.w
            iadd r6.w, r3.w, l(1)
            mov r1.w, r7.x
            mov r3.w, r6.w
            continue
          endif
          and r5.w, r5.w, l(0x0000ffff)
          ld_structured_indexable(structured_buffer, stride=192)(mixed,mixed,mixed,mixed) r8.xyzw, r5.w, l(96), t62.xyzw
          dp4 r6.w, r0.xyzw, r8.xyzw
          ge r6.w, l(0.000000), r6.w
          if_nz r6.w
            mov r7.yzw, l(0,0,0,0)
          endif
          if_z r6.w
            ld_structured_indexable(structured_buffer, stride=192)(mixed,mixed,mixed,mixed) r8.xyzw, r5.w, l(0), t62.xyzw
            ld_structured_indexable(structured_buffer, stride=192)(mixed,mixed,mixed,mixed) r9.xyzw, r5.w, l(16), t62.xyzw
            ld_structured_indexable(structured_buffer, stride=192)(mixed,mixed,mixed,mixed) r10.xyzw, r5.w, l(64), t62.xyzw
            ld_structured_indexable(structured_buffer, stride=192)(mixed,mixed,mixed,mixed) r11.xyzw, r5.w, l(80), t62.xyzw
            ld_structured_indexable(structured_buffer, stride=192)(mixed,mixed,mixed,mixed) r12.xyzw, r5.w, l(112), t62.xyzw
            dp4 r10.x, r0.xyzw, r10.xyzw
            dp4 r10.y, r0.xyzw, r11.xyzw
            dp4 r5.w, r0.xyzw, r12.xyzw
            div r10.xy, r10.xyxx, r5.wwww
            add r8.xyz, r0.xyzx, -r8.xyzx
            dp3 r5.w, r8.xyzx, r8.xyzx
            dp2 r6.w, r10.xyxx, r10.xyxx
            add r6.w, -r6.w, l(1.000000)
            max r6.w, r6.w, l(0.000000)
            mul r8.x, r8.w, r8.w
            div r8.x, l(1.000000, 1.000000, 1.000000, 1.000000), r8.x
            sqrt r8.y, r5.w
            mad r5.w, -r5.w, r8.x, l(1.000000)
            max r5.w, r5.w, l(0.000000)
            mul r8.x, r9.w, r8.y
            mul r8.x, r8.x, r8.x
            mad r8.x, r8.x, l(0.700000), l(1.000000)
            div r5.w, r5.w, r8.x
            mad r8.x, r8.y, r9.w, l(1.400000)
            div r8.x, l(1.400000), r8.x
            mul r8.x, r8.x, r8.x
            mad r8.x, r8.x, l(0.750000), l(0.250000)
            mul r5.w, r5.w, r8.x
            mul r5.w, r6.w, r5.w
            mul r7.yzw, r9.xxyz, r5.wwww
          endif
          add r6.xyz, r6.xyzx, r7.yzwy
          iadd r3.w, r3.w, l(1)
          mov r1.w, r7.x
        endloop
        mov r5.xyz, r6.xyzx
      endif
    else
      mov r5.xyz, l(0,0,0,0)
    endif
    add o7.xyz, r4.yzwy, r5.xyzx
  else
    mov o7.xyz, r4.yzwy
  endif
else
  mov o7.xyz, l(0,0,0,0)
endif
mov o0.xyz, r3.xyzx
mov o3.z, r4.x

//ORIG
mov o8.xyzw, r2.xyzw
mov o4.xyzw, r2.xyzw

// UNCORRECT THIS ONE
ld_indexable(texture2d)(float,float,float,float) r6.xyzw, l(0, 0, 0, 0), t125.xyzw
add r6.w, r2.w, -r6.y
mul r6.w, r6.w, r6.x
add o4.x, r2.x, r6.w


mov o5.w, l(0)
mov o2.z, vicp[0][4].z
mov o6.xy, vicp[0][5].xyxx
ret
// Approximately 344 instruction slots used

