// Smoke
Texture3D<float4> t6 : register(t6);

Texture3D<float4> t5 : register(t5);

Texture3D<float4> t4 : register(t4);

Texture3D<float4> t3 : register(t3);

Texture2D<float4> t2 : register(t2);

Texture2D<float4> t1 : register(t1);

Texture3D<float4> t0 : register(t0);

SamplerState s6_s : register(s6);

SamplerState s5_s : register(s5);

SamplerState s4_s : register(s4);

SamplerState s3_s : register(s3);

SamplerState s2_s : register(s2);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

cbuffer cb2 : register(b2)
{
  float4 cb2[5];
}

cbuffer cb1 : register(b1)
{
  float4 cb1[10];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[158];
}




// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);
#include "matrix.hlsl"

void main( 
  float4 v0 : TEXCOORD10,
  float4 v1 : TEXCOORD11,
  float4 v2 : TEXCOORD2,
  float4 v3 : TEXCOORD3,
  float3 v4 : PARTICLE_LIGHTING_OFFSET0,
  float4 v5 : SV_Position0,
  uint v6 : SV_IsFrontFace0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = v1.zxy * v0.yzx;
  r0.xyz = v1.yzx * v0.zxy + -r0.xyz;
  r0.xyz = v1.www * r0.xyz;
  r1.xy = -cb0[116].xy + v5.xy;
  r1.xy = r1.xy * cb0[117].zw + float2(-0.5,-0.5);
  r1.xy = v5.ww * r1.xy;
  r1.z = v5.w;
  r1.xyw = float3(2,-2,1) * r1.xyz;
  r2.xyzw = cb0[37].xyzw * v5.yyyy;
  r2.xyzw = v5.xxxx * cb0[36].xyzw + r2.xyzw;
  r2.xyzw = v5.zzzz * cb0[38].xyzw + r2.xyzw;
  r2.xyzw = cb0[39].xyzw + r2.xyzw;
  r2.xyz = r2.xyz / r2.www;
  
  // Common SVPositionToTranslatedWorld fix:
float4 s = StereoParams.Load(0);
matrix TranslatedWorldToClip = MATRIX(cb0, 0);
matrix ClipToTranslatedWorld = MATRIX(cb0, 32);
float4 t = mul(r2.xyz, TranslatedWorldToClip);
t.x -= s.x * (t.w - s.y);
r2.xyz = mul(t, ClipToTranslatedWorld);
  
  r2.xyz = -cb0[58].xyz + r2.xyz;
  r3.xyz = cb0[122].www * float3(0,0,1) + cb0[122].xyz;
  r0.w = dot(r3.xyz, r3.xyz);
  r0.w = rsqrt(r0.w);
  r3.xyz = r3.xyz * r0.www;
  r0.xyz = r3.yyy * r0.xyz;
  r0.xyz = r3.xxx * v0.xyz + r0.xyz;
  r0.xyz = r3.zzz * v1.xyz + r0.xyz;
  r0.w = dot(r0.xyz, r0.xyz);
  r0.w = rsqrt(r0.w);
  r0.xyz = r0.xyz * r0.www;
  r3.xyz = v2.xxx * float3(0.799103022,0.806952,0.799103022) + cb2[1].xyz;
  r4.xyz = cb0[126].zzz * float3(-100,100,0) + r2.xyz;
  r4.xyz = float3(0.0199999996,0.0199999996,0.0199999996) * r4.xyz;
  r5.xyz = r4.xyz;
  r2.w = 0;
  r3.w = 1;
  r4.w = 0;
  while (true) {
    r5.w = cmp((uint)r4.w >= 4);
    if (r5.w != 0) break;
    r6.xyz = float3(0.0666666701,0.0666666701,0.0666666701) * r5.xyz;
    r6.xyz = frac(r6.xyz);
    r7.xyz = float3(15,15,15) * r6.xyz;
    r8.xyz = frac(r7.xyz);
    r6.xyz = r6.xyz * float3(15,15,15) + -r8.xyz;
    r9.xyz = r8.xyz * r8.xyz;
    r9.xyz = r9.xyz * r8.xyz;
    r10.xyz = r8.xyz * float3(6,6,6) + float3(-15,-15,-15);
    r8.xyz = r8.xyz * r10.xyz + float3(10,10,10);
    r6.xyz = r9.xyz * r8.xyz + r6.xyz;
    r6.xyz = r6.xyz * float3(0.0625,0.0625,0.0625) + float3(0.03125,0.03125,0.03125);
    r6.xyzw = t0.SampleLevel(s0_s, r6.xyz, 0).xyzw;
    r6.xyzw = r6.xyzw * float4(2.00787401,2.00787401,2.00787401,255) + float4(-1,-1,-1,-127);
    r5.w = dot(r7.xyz, r6.xyz);
    r5.w = r5.w + -r6.w;
    r2.w = r5.w * r3.w + r2.w;
    r5.xyz = r5.xyz + r5.xyz;
    r3.w = 0.5 * r3.w;
    r4.w = (int)r4.w + 1;
  }
  r2.w = r2.w * 0.5 + 0.5;
  r2.w = r2.w * 1.20000005 + -0.200000003;
  r3.w = r2.w * -450 + 500;
  r3.w = max(9.99999975e-006, r3.w);
  r1.xy = r1.xy / r1.ww;
  r1.xy = r1.xy * cb0[54].xy + cb0[54].wz;
  r1.x = t2.SampleLevel(s2_s, r1.xy, 0).x;
  r1.y = r1.x * cb0[53].x + cb0[53].y;
  r1.x = r1.x * cb0[53].z + -cb0[53].w;
  r1.x = 1 / r1.x;
  r1.x = r1.y + r1.x;
  r1.x = -r1.z * 1 + r1.x;
  r1.x = saturate(r1.x / r3.w);
  r1.x = v2.w * r1.x;
  r2.w = saturate(r2.w);
  r1.y = 1 + -r2.w;
  r1.y = r1.y + r1.y;
  r1.z = t1.Sample(s1_s, v3.xy).x;
  r1.z = 1 + -r1.z;
  r1.w = max(9.99999997e-007, abs(r1.z));
  r1.w = r1.w * r1.w;
  r3.w = 0.5 * r1.w;
  r1.w = -r1.w * 0.5 + 1;
  r1.y = -r1.y * r1.w + 1;
  r1.w = dot(r2.ww, r3.ww);
  r2.w = cmp(r2.w >= 0.5);
  r1.y = r2.w ? r1.y : r1.w;
  r1.y = r1.y * r1.z;
  r1.x = r1.x * r1.y;
  r1.yzw = cb0[55].xyz + -r2.xyz;
  r1.y = dot(r1.yzw, r1.yzw);
  r1.y = sqrt(r1.y);
  r1.y = 0.00200000009 * r1.y;
  r1.y = min(1, r1.y);
  r1.w = saturate(r1.x * r1.y);
  r4.xyz = saturate(cb2[4].xyz);
  r4.xyz = r4.xyz * cb0[120].www + cb0[120].xyz;
  r5.xyz = cb0[121].www * float3(0.0399999991,0.0399999991,0.0399999991) + cb0[121].xyz;
  r0.w = 1;
  r6.x = dot(cb0[151].xyzw, r0.xyzw);
  r6.y = dot(cb0[152].xyzw, r0.xyzw);
  r6.z = dot(cb0[153].xyzw, r0.xyzw);
  r7.xyzw = r0.xyzz * r0.yzzx;
  r8.x = dot(cb0[154].xyzw, r7.xyzw);
  r8.y = dot(cb0[155].xyzw, r7.xyzw);
  r8.z = dot(cb0[156].xyzw, r7.xyzw);
  r0.w = r0.y * r0.y;
  r0.w = r0.x * r0.x + -r0.w;
  r6.xyz = r8.xyz + r6.xyz;
  r6.xyz = cb0[157].xyz * r0.www + r6.xyz;
  r6.xyz = max(float3(0,0,0), r6.xyz);
  r6.xyz = cb0[150].xyz * r6.xyz;
  r7.xyz = v4.xyz + r2.xyz;
  r8.xyz = -cb0[131].xyz + r7.xyz;
  r9.xyz = cb0[133].xyz * r8.xyz;
  r7.xyz = -cb0[132].xyz + r7.xyz;
  r7.xyz = cb0[134].xyz * r7.xyz;
  r8.xyz = r8.xyz * cb0[133].xyz + float3(-0.5,-0.5,-0.5);
  r8.xyz = float3(0.5,0.5,0.5) + -abs(r8.xyz);
  r8.xyz = saturate(float3(6,6,6) * r8.xyz);
  r0.w = r8.x * r8.y;
  r0.w = r0.w * r8.z;
  r8.xyz = t3.SampleLevel(s3_s, r9.xyz, 0).xyz;
  r10.xyz = t4.SampleLevel(s4_s, r7.xyz, 0).xyz;
  r8.xyz = -r10.xyz + r8.xyz;
  r8.xyz = r0.www * r8.xyz + r10.xyz;
  r9.xyz = t5.SampleLevel(s5_s, r9.xyz, 0).xyz;
  r7.xyz = t6.SampleLevel(s6_s, r7.xyz, 0).xyz;
  r9.xyz = r9.xyz + -r7.xyz;
  r7.xyz = r0.www * r9.xyz + r7.xyz;
  r0.w = dot(r8.xyz, float3(0.300000012,0.589999974,0.109999999));
  r9.xyz = r8.xyz / r0.www;
  r10.yzw = r9.xxx * r7.xyz;
  r11.yzw = r9.yyy * r7.xyz;
  r7.yzw = r9.zzz * r7.xyz;
  r0.yzw = float3(-1.02332771,1.02332771,-1.02332771) * r0.yzx;
  r10.x = r8.x;
  r0.x = 0.886227548;
  r9.x = dot(r10.xyzw, r0.xyzw);
  r11.x = r8.y;
  r9.y = dot(r11.xyzw, r0.xyzw);
  r7.x = r8.z;
  r9.z = dot(r7.xyzw, r0.xyzw);
  r0.xyz = max(float3(0,0,0), r9.xyz);
  r7.xyz = r4.xyz * r0.xyz;
  r5.xyz = r5.xyz * float3(0.449999988,0.449999988,0.449999988) + r4.xyz;
  r0.xyz = -r4.xyz * r0.xyz + r5.xyz;
  r0.xyz = cb0[128].xxx * r0.xyz + r7.xyz;
  r1.xyz = max(float3(0,0,0), r3.xyz);
  r0.w = cmp(0 < cb0[124].x);
  if (r0.w != 0) {
    r3.xyz = -cb1[8].xyz + r2.xyz;
    r5.xyz = float3(1,1,1) + cb1[9].xyz;
    r3.xyz = cmp(r5.xyz < abs(r3.xyz));
    r0.w = (int)r3.y | (int)r3.x;
    r0.w = (int)r3.z | (int)r0.w;
    r2.x = dot(r2.xyz, float3(0.577000022,0.577000022,0.577000022));
    r2.x = 0.00200000009 * r2.x;
    r2.x = frac(r2.x);
    r2.x = cmp(0.5 < r2.x);
    r2.yzw = r2.xxx ? float3(0,1,1) : float3(1,1,0);
    r2.x = 1;
    r1.xyzw = r0.wwww ? r2.yzwx : r1.xyzw;
  }
  r0.xyz = r6.xyz * r4.xyz + r0.xyz;
  r0.xyz = r0.xyz + r1.xyz;
  o0.xyz = r0.xyz * r1.www;
  o0.w = 0;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.65 on Wed Sep 20 23:24:35 2017
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                10   xyzw        0     NONE   float   xyz 
// TEXCOORD                11   xyzw        1     NONE   float   xyzw
// TEXCOORD                 2   xyzw        2     NONE   float   x  w
// TEXCOORD                 3   xyzw        3     NONE   float   xy  
// PARTICLE_LIGHTING_OFFSET     0   xyz         4     NONE   float   xyz 
// SV_Position              0   xyzw        5      POS   float   xyzw
// SV_IsFrontFace           0   x           6    FFACE    uint       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[158], immediateIndexed
dcl_constantbuffer cb1[10], immediateIndexed
dcl_constantbuffer cb2[5], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_resource_texture3d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture3d (float,float,float,float) t3
dcl_resource_texture3d (float,float,float,float) t4
dcl_resource_texture3d (float,float,float,float) t5
dcl_resource_texture3d (float,float,float,float) t6
dcl_input_ps linear v0.xyz
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xw
dcl_input_ps linear v3.xy
dcl_input_ps linear v4.xyz
dcl_input_ps_siv linear noperspective v5.xyzw, position
dcl_output o0.xyzw
dcl_temps 12
mul r0.xyz, v0.yzxy, v1.zxyz
mad r0.xyz, v1.yzxy, v0.zxyz, -r0.xyzx
mul r0.xyz, r0.xyzx, v1.wwww
add r1.xy, v5.xyxx, -cb0[116].xyxx
mad r1.xy, r1.xyxx, cb0[117].zwzz, l(-0.500000, -0.500000, 0.000000, 0.000000)
mul r1.xy, r1.xyxx, v5.wwww
mov r1.z, v5.w
mul r1.xyw, r1.xyxz, l(2.000000, -2.000000, 0.000000, 1.000000)
mul r2.xyzw, v5.yyyy, cb0[37].xyzw
mad r2.xyzw, v5.xxxx, cb0[36].xyzw, r2.xyzw
mad r2.xyzw, v5.zzzz, cb0[38].xyzw, r2.xyzw
add r2.xyzw, r2.xyzw, cb0[39].xyzw
div r2.xyz, r2.xyzx, r2.wwww
add r2.xyz, r2.xyzx, -cb0[58].xyzx
mad r3.xyz, cb0[122].wwww, l(0.000000, 0.000000, 1.000000, 0.000000), cb0[122].xyzx
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, r3.xyzx
mul r0.xyz, r0.xyzx, r3.yyyy
mad r0.xyz, r3.xxxx, v0.xyzx, r0.xyzx
mad r0.xyz, r3.zzzz, v1.xyzx, r0.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
mad r3.xyz, v2.xxxx, l(0.799103, 0.806952, 0.799103, 0.000000), cb2[1].xyzx
mad r4.xyz, cb0[126].zzzz, l(-100.000000, 100.000000, 0.000000, 0.000000), r2.xyzx
mul r4.xyz, r4.xyzx, l(0.020000, 0.020000, 0.020000, 0.000000)
mov r5.xyz, r4.xyzx
mov r2.w, l(0)
mov r3.w, l(1.000000)
mov r4.w, l(0)
loop 
  uge r5.w, r4.w, l(4)
  breakc_nz r5.w
  mul r6.xyz, r5.xyzx, l(0.0666666701, 0.0666666701, 0.0666666701, 0.000000)
  frc r6.xyz, r6.xyzx
  mul r7.xyz, r6.xyzx, l(15.000000, 15.000000, 15.000000, 0.000000)
  frc r8.xyz, r7.xyzx
  mad r6.xyz, r6.xyzx, l(15.000000, 15.000000, 15.000000, 0.000000), -r8.xyzx
  mul r9.xyz, r8.xyzx, r8.xyzx
  mul r9.xyz, r8.xyzx, r9.xyzx
  mad r10.xyz, r8.xyzx, l(6.000000, 6.000000, 6.000000, 0.000000), l(-15.000000, -15.000000, -15.000000, 0.000000)
  mad r8.xyz, r8.xyzx, r10.xyzx, l(10.000000, 10.000000, 10.000000, 0.000000)
  mad r6.xyz, r9.xyzx, r8.xyzx, r6.xyzx
  mad r6.xyz, r6.xyzx, l(0.062500, 0.062500, 0.062500, 0.000000), l(0.031250, 0.031250, 0.031250, 0.000000)
  sample_l_indexable(texture3d)(float,float,float,float) r6.xyzw, r6.xyzx, t0.xyzw, s0, l(0.000000)
  mad r6.xyzw, r6.xyzw, l(2.007874, 2.007874, 2.007874, 255.000000), l(-1.000000, -1.000000, -1.000000, -127.000000)
  dp3 r5.w, r7.xyzx, r6.xyzx
  add r5.w, -r6.w, r5.w
  mad r2.w, r5.w, r3.w, r2.w
  add r5.xyz, r5.xyzx, r5.xyzx
  mul r3.w, r3.w, l(0.500000)
  iadd r4.w, r4.w, l(1)
endloop 
mad r2.w, r2.w, l(0.500000), l(0.500000)
mad r2.w, r2.w, l(1.200000), l(-0.200000)
mad r3.w, r2.w, l(-450.000000), l(500.000000)
max r3.w, r3.w, l(0.000010)
div r1.xy, r1.xyxx, r1.wwww
mad r1.xy, r1.xyxx, cb0[54].xyxx, cb0[54].wzww
sample_l_indexable(texture2d)(float,float,float,float) r1.x, r1.xyxx, t2.xyzw, s2, l(0.000000)
mad r1.y, r1.x, cb0[53].x, cb0[53].y
mad r1.x, r1.x, cb0[53].z, -cb0[53].w
div r1.x, l(1.000000, 1.000000, 1.000000, 1.000000), r1.x
add r1.x, r1.x, r1.y
mad r1.x, -r1.z, l(1.000000), r1.x
div_sat r1.x, r1.x, r3.w
mul r1.x, r1.x, v2.w
mov_sat r2.w, r2.w
add r1.y, -r2.w, l(1.000000)
add r1.y, r1.y, r1.y
sample_indexable(texture2d)(float,float,float,float) r1.z, v3.xyxx, t1.yzxw, s1
add r1.z, -r1.z, l(1.000000)
max r1.w, |r1.z|, l(0.000001)
mul r1.w, r1.w, r1.w
mul r3.w, r1.w, l(0.500000)
mad r1.w, -r1.w, l(0.500000), l(1.000000)
mad r1.y, -r1.y, r1.w, l(1.000000)
dp2 r1.w, r2.wwww, r3.wwww
ge r2.w, r2.w, l(0.500000)
movc r1.y, r2.w, r1.y, r1.w
mul r1.y, r1.z, r1.y
mul r1.x, r1.y, r1.x
add r1.yzw, -r2.xxyz, cb0[55].xxyz
dp3 r1.y, r1.yzwy, r1.yzwy
sqrt r1.y, r1.y
mul r1.y, r1.y, l(0.002000)
min r1.y, r1.y, l(1.000000)
mul_sat r1.w, r1.y, r1.x
mov_sat r4.xyz, cb2[4].xyzx
mad r4.xyz, r4.xyzx, cb0[120].wwww, cb0[120].xyzx
mad r5.xyz, cb0[121].wwww, l(0.040000, 0.040000, 0.040000, 0.000000), cb0[121].xyzx
mov r0.w, l(1.000000)
dp4 r6.x, cb0[151].xyzw, r0.xyzw
dp4 r6.y, cb0[152].xyzw, r0.xyzw
dp4 r6.z, cb0[153].xyzw, r0.xyzw
mul r7.xyzw, r0.yzzx, r0.xyzz
dp4 r8.x, cb0[154].xyzw, r7.xyzw
dp4 r8.y, cb0[155].xyzw, r7.xyzw
dp4 r8.z, cb0[156].xyzw, r7.xyzw
mul r0.w, r0.y, r0.y
mad r0.w, r0.x, r0.x, -r0.w
add r6.xyz, r6.xyzx, r8.xyzx
mad r6.xyz, cb0[157].xyzx, r0.wwww, r6.xyzx
max r6.xyz, r6.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r6.xyz, r6.xyzx, cb0[150].xyzx
add r7.xyz, r2.xyzx, v4.xyzx
add r8.xyz, r7.xyzx, -cb0[131].xyzx
mul r9.xyz, r8.xyzx, cb0[133].xyzx
add r7.xyz, r7.xyzx, -cb0[132].xyzx
mul r7.xyz, r7.xyzx, cb0[134].xyzx
mad r8.xyz, r8.xyzx, cb0[133].xyzx, l(-0.500000, -0.500000, -0.500000, 0.000000)
add r8.xyz, -|r8.xyzx|, l(0.500000, 0.500000, 0.500000, 0.000000)
mul_sat r8.xyz, r8.xyzx, l(6.000000, 6.000000, 6.000000, 0.000000)
mul r0.w, r8.y, r8.x
mul r0.w, r8.z, r0.w
sample_l_indexable(texture3d)(float,float,float,float) r8.xyz, r9.xyzx, t3.xyzw, s3, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r10.xyz, r7.xyzx, t4.xyzw, s4, l(0.000000)
add r8.xyz, r8.xyzx, -r10.xyzx
mad r8.xyz, r0.wwww, r8.xyzx, r10.xyzx
sample_l_indexable(texture3d)(float,float,float,float) r9.xyz, r9.xyzx, t5.xyzw, s5, l(0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r7.xyz, r7.xyzx, t6.xyzw, s6, l(0.000000)
add r9.xyz, -r7.xyzx, r9.xyzx
mad r7.xyz, r0.wwww, r9.xyzx, r7.xyzx
dp3 r0.w, r8.xyzx, l(0.300000, 0.590000, 0.110000, 0.000000)
div r9.xyz, r8.xyzx, r0.wwww
mul r10.yzw, r7.xxyz, r9.xxxx
mul r11.yzw, r7.xxyz, r9.yyyy
mul r7.yzw, r7.xxyz, r9.zzzz
mul r0.yzw, r0.yyzx, l(0.000000, -1.02332771, 1.02332771, -1.02332771)
mov r10.x, r8.x
mov r0.x, l(0.886227548)
dp4 r9.x, r10.xyzw, r0.xyzw
mov r11.x, r8.y
dp4 r9.y, r11.xyzw, r0.xyzw
mov r7.x, r8.z
dp4 r9.z, r7.xyzw, r0.xyzw
max r0.xyz, r9.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r7.xyz, r0.xyzx, r4.xyzx
mad r5.xyz, r5.xyzx, l(0.450000, 0.450000, 0.450000, 0.000000), r4.xyzx
mad r0.xyz, -r4.xyzx, r0.xyzx, r5.xyzx
mad r0.xyz, cb0[128].xxxx, r0.xyzx, r7.xyzx
max r1.xyz, r3.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
lt r0.w, l(0.000000), cb0[124].x
if_nz r0.w
  add r3.xyz, r2.xyzx, -cb1[8].xyzx
  add r5.xyz, cb1[9].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  lt r3.xyz, r5.xyzx, |r3.xyzx|
  or r0.w, r3.y, r3.x
  or r0.w, r3.z, r0.w
  dp3 r2.x, r2.xyzx, l(0.577000, 0.577000, 0.577000, 0.000000)
  mul r2.x, r2.x, l(0.002000)
  frc r2.x, r2.x
  lt r2.x, l(0.500000), r2.x
  movc r2.yzw, r2.xxxx, l(0,0,1.000000,1.000000), l(0,1.000000,1.000000,0)
  mov r2.x, l(1.000000)
  movc r1.xyzw, r0.wwww, r2.yzwx, r1.xyzw
endif 
mad r0.xyz, r6.xyzx, r4.xyzx, r0.xyzx
add r0.xyz, r1.xyzx, r0.xyzx
mul o0.xyz, r1.wwww, r0.xyzx
mov o0.w, l(0)
ret 
// Approximately 0 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
