//2D fire particles to stereoize.
// ---- Created with 3Dmigoto v1.3.16 on Fri Oct  1 18:36:31 2021
//
//cbuffer vblock : register(b0)
//{
//  float4 gpuparticle_image_offset : packoffset(c0);
//  float4 gpuparticlerendervsparm0 : packoffset(c1);
//  float4 globalvieworigin : packoffset(c2);
//  float4 gpuparticlerendervsparm2 : packoffset(c3);
//  float4 viewmatrixz : packoffset(c4);
//  float4 gpuparticlerendervsparm4 : packoffset(c5);
//  float4 mvpmatrixx : packoffset(c6);
//  float4 mvpmatrixy : packoffset(c7);
//  float4 mvpmatrixz : packoffset(c8);
//  float4 mvpmatrixw : packoffset(c9);
//  float4 gpuparticlerendervsparm3 : packoffset(c10);
//  float4 gpuparticlecolor1 : packoffset(c11);
//  float4 gpuparticlerendervsparm5 : packoffset(c12);
//  float4 gpuparticlecolor2 : packoffset(c13);
//  float4 vfxdynamicvpparam0 : packoffset(c14);
//  float4 gpuparticlerendervsparm1 : packoffset(c15);
//}
//
//Texture2D<float4> gpuparticle_position_vertex_buff_samp : register(t0);
//Texture2D<float4> gpuparticle_texcoord0_vertex_buff_samp : register(t1);
//Texture2D<float4> gpuparticle_param0_vertex_buff_samp : register(t2);
//Texture2D<float4> gpuparticle_velocity_vertex_buff_samp : register(t3);
//
//
//// 3Dmigoto declarations
//#define cmp -
//Texture1D<float4> IniParams : register(t120);
//Texture2D<float4> StereoParams : register(t125);
//
//
//void main(
//  uint v0 : SV_VertexID0,
//  out float4 o0 : TEXCOORD0,
//  out float4 o1 : TEXCOORD1,
//  out float4 o2 : TEXCOORD3,
//  out float4 o3 : SV_Position0)
//{
//// Needs manual fix for instruction:
//// unknown dcl_: dcl_input_sgv v0.x, vertex_id
//  float4 r0,r1,r2,r3,r4,r5,r6,r7;
//  uint4 bitmask, uiDest;
//  float4 fDest;
//
//  uiDest.x = (uint)v0.x / 6;
//  r0.x = uiDest.x;
//  r0.y = (uint)gpuparticle_image_offset.x;
//  r0.y = (int)r0.y + (int)r0.x;
//  uiDest.x = (uint)r0.y / 384;
//  r2.x = (uint)r0.y % 384;
//  r1.x = uiDest.x;
//  r2.y = r1.x;
//  r2.zw = float2(0,0);
//  r1.xyzw = gpuparticle_position_vertex_buff_samp.Load(r2.xyw).xyzw;
//  r0.yzw = gpuparticlerendervsparm0.xyz + r1.xyz;
//  r0.yzw = -globalvieworigin.xyz + r0.yzw;
//  r1.x = cmp(gpuparticlerendervsparm2.w != 0.000000);
//  r3.xyz = -r0.yzw;
//  r3.w = 9.99999975e-05 + r3.z;
//  r1.y = dot(r3.xyw, r3.xyw);
//  r1.y = rsqrt(r1.y);
//  r3.xyz = r3.xyw * r1.yyy;
//  r3.xyz = r3.xyz * gpuparticlerendervsparm2.www + r0.yzw;
//  r3.xyz = r1.xxx ? r3.xyz : r0.yzw;
//  r3.w = 1;
//  r0.y = dot(r3.xyzw, viewmatrixz.xyzw);
//  r0.zw = cmp(gpuparticlerendervsparm4.xz >= float2(0,0));
//  r1.xy = cmp(float2(0,0) < gpuparticlerendervsparm4.yw);
//  r0.zw = r0.zw ? r1.xy : 0;
//  r1.x = cmp(gpuparticlerendervsparm4.x >= -r0.y);
//  r1.y = gpuparticlerendervsparm4.x + r0.y;
//  r1.y = r1.y / gpuparticlerendervsparm4.y;
//  r1.x = r1.x ? r1.y : 0;
//  r0.z = r0.z ? r1.x : 0;
//  r1.x = cmp(-r0.y >= gpuparticlerendervsparm4.z);
//  r0.y = -gpuparticlerendervsparm4.z + -r0.y;
//  r0.y = r0.y / gpuparticlerendervsparm4.w;
//  r0.y = r1.x ? r0.y : r0.z;
//  r0.y = saturate(r0.w ? r0.y : r0.z);
//  r0.y = 1 + -r0.y;
//  r0.z = cmp(0 >= r0.y);
//  r0.w = cmp(r1.w == -1.000000);
//  r0.z = (int)r0.w | (int)r0.z;
//  o0.xyzw = float4(0,0,0,0);
//  o1.xyzw = float4(0,0,0,0);
//  o2.xyzw = float4(0,0,0,0);
//  o3.xyzw = float4(1e+09,1e+09,1e+09,0);
//  if (r0.z != 0) return;
//  r0.x = mad((int)r0.x, -6, (int)v0.x);
//  r4.xyzw = gpuparticle_texcoord0_vertex_buff_samp.Load(r2.xyw).xyzw;
//  r5.xyzw = gpuparticle_param0_vertex_buff_samp.Load(r2.xyw).xyzw;
//  r6.xyzw = cmp((int4)r0.xxxx == int4(0,3,2,4));
//  r0.x = (int)r6.y | (int)r6.x;
//  r0.xz = (int2)r6.zw | (int2)r0.xx;
//  r1.xy = r0.xz ? float2(1,1) : 0;
//  r1.yz = r1.xy * float2(2,2) + float2(-1,-1);
//  r0.w = cmp(1.5 < r5.w);
//  r3.w = -3 + r5.w;
//  r3.w = r0.w ? r3.w : r5.w;
//  r3.xyz = r4.xyz * r1.yyy + r3.xyz;
//  r5.xyz = r5.xyz * r1.zzz + r3.xyz;
//  r5.w = 1;
//  r3.x = dot(r5.xyzw, mvpmatrixx.xyzw);
//  r3.y = dot(r5.xyzw, mvpmatrixy.xyzw);
//  o3.z = dot(r5.xyzw, mvpmatrixz.xyzw);
//  r1.y = dot(r5.xyzw, mvpmatrixw.xyzw);
//  r1.z = -gpuparticlerendervsparm3.y + r1.w;
//  r1.z = saturate(r1.z / gpuparticlerendervsparm3.z);
//  r3.z = cmp(0 < gpuparticlerendervsparm0.w);
//  r4.x = saturate(r1.w / gpuparticlerendervsparm3.w);
//  r3.z = r3.z ? r4.x : 1;
//  r6.w = gpuparticlecolor1.w * r3.z;
//  r6.xyz = -r3.www * gpuparticlerendervsparm5.yyy + gpuparticlecolor1.xyz;
//  r4.xyz = -r3.www * gpuparticlerendervsparm5.yyy + gpuparticlecolor2.xyz;
//  r1.z = gpuparticlerendervsparm3.x * r1.z;
//  r7.xyz = r4.xyz + -r6.xyz;
//  r7.w = -gpuparticlecolor1.w * r3.z + gpuparticlecolor2.w;
//  r6.xyzw = r1.zzzz * r7.xyzw + r6.xyzw;
//  r1.z = max(r6.x, r6.y);
//  r1.z = max(r1.z, r6.z);
//  r3.zw = cmp(float2(0,0.899999976) < vfxdynamicvpparam0.yw);
//  r4.x = cmp(vfxdynamicvpparam0.y < 1);
//  r3.z = r3.z ? r4.x : 0;
//  r4.x = cmp(r1.z >= vfxdynamicvpparam0.y);
//  r4.y = 1 + -vfxdynamicvpparam0.y;
//  r4.y = vfxdynamicvpparam0.x / r4.y;
//  r1.z = -vfxdynamicvpparam0.y + r1.z;
//  r1.z = r4.y * r1.z;
//  r1.z = r4.x ? r1.z : 0;
//  r1.z = r3.z ? r1.z : vfxdynamicvpparam0.x;
//  o1.xyz = r6.xyz * r1.zzz;
//  r0.y = r6.w * r0.y;
//  r1.z = cmp(0 >= r0.y);
//  o3.w = r1.z ? 0 : r1.y;
//  r1.z = cmp(0 < r4.w);
//  r0.xz = r0.xz ? float2(0,0) : float2(1,1);
//  r0.x = r1.z ? r0.x : r1.x;
//  o1.w = gpuparticlerendervsparm0.w * r0.y;
//  r0.y = floor(r1.w);
//  r0.y = r0.w ? 0 : r0.y;
//  r0.y = r4.w + r0.y;
//  r0.x = r0.y + r0.x;
//  o0.x = r0.x / gpuparticlerendervsparm1.w;
//  if (r3.w != 0) {
//    r2.xyzw = gpuparticle_velocity_vertex_buff_samp.Load(r2.xyz).xyzw;
//    r0.x = dot(r2.xyz, r2.xyz);
//    r0.x = rsqrt(r0.x);
//    r0.xyw = r2.xyz * r0.xxx;
//    r2.xyz = -r0.xyw * r2.www + r5.xyz;
//    r2.w = 1;
//    r0.x = dot(r2.xyzw, mvpmatrixx.xyzw);
//    r0.y = dot(r2.xyzw, mvpmatrixy.xyzw);
//    r0.w = dot(r2.xyzw, mvpmatrixw.xyzw);
//    r1.xy = r3.xy / r1.yy;
//    r1.xy = r1.xy * float2(0.5,0.5) + float2(0.5,0.5);
//    r0.xy = r0.xy / r0.ww;
//    r2.xy = r0.xy * float2(0.5,0.5) + float2(0.5,0.5);
//    r2.z = 1 + -r2.y;
//    r1.z = 1 + -r1.y;
//    r1.xy = -r2.xz + r1.xz;
//    r1.z = 1;
//  } else {
//    r1.xyz = float3(0,0,0);
//  }
//  o0.y = r0.z;
//  o0.z = 0;
//  o0.w = gpuparticlerendervsparm5.x;
//  o2.xyw = r1.xyz;
//  o2.z = 0;
//  o3.xy = r3.xy;
//  return;
//}
//
///*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Fri Oct  1 18:36:31 2021
//
//
// Buffer Definitions:
//
// cbuffer vblock
// {
//
//   float4 gpuparticle_image_offset;   // Offset:    0 Size:    16
//   float4 gpuparticlerendervsparm0;   // Offset:   16 Size:    16
//   float4 globalvieworigin;           // Offset:   32 Size:    16
//   float4 gpuparticlerendervsparm2;   // Offset:   48 Size:    16
//   float4 viewmatrixz;                // Offset:   64 Size:    16
//   float4 gpuparticlerendervsparm4;   // Offset:   80 Size:    16
//   float4 mvpmatrixx;                 // Offset:   96 Size:    16
//   float4 mvpmatrixy;                 // Offset:  112 Size:    16
//   float4 mvpmatrixz;                 // Offset:  128 Size:    16
//   float4 mvpmatrixw;                 // Offset:  144 Size:    16
//   float4 gpuparticlerendervsparm3;   // Offset:  160 Size:    16
//   float4 gpuparticlecolor1;          // Offset:  176 Size:    16
//   float4 gpuparticlerendervsparm5;   // Offset:  192 Size:    16
//   float4 gpuparticlecolor2;          // Offset:  208 Size:    16
//   float4 vfxdynamicvpparam0;         // Offset:  224 Size:    16
//   float4 gpuparticlerendervsparm1;   // Offset:  240 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// gpuparticle_position_vertex_buff_samp    texture  float4          2d    0        1
// gpuparticle_texcoord0_vertex_buff_samp    texture  float4          2d    1        1
// gpuparticle_param0_vertex_buff_samp    texture  float4          2d    2        1
// gpuparticle_velocity_vertex_buff_samp    texture  float4          2d    3        1
// vblock                            cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_VertexID              0   x           0   VERTID    uint   x
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 1   xyzw        1     NONE   float   xyzw
// TEXCOORD                 3   xyzw        2     NONE   float   xyzw
// SV_Position              0   xyzw        3      POS   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[16], immediateIndexed
dcl_constantbuffer cb12[1], immediateIndexed
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_input_sgv v0.x, vertex_id
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output_siv o3.xyzw, position
dcl_temps 29
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r14.xyzw, l(0, 0, 0, 0), t125.xyzw
udiv r0.x, null, v0.x, l(6)
ftou r0.y, cb0[0].x
iadd r0.y, r0.y, r0.x
udiv r1.x, r2.x, r0.y, l(384)
mov r2.y, r1.x
mov r2.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r1.xyzw, r2.xyww, t0.xyzw
add r0.yzw, r1.xxyz, cb0[1].xxyz
add r0.yzw, r0.yyzw, -cb0[2].xxyz
ne r1.x, cb0[3].w, l(0.000000)
mov r3.xyz, -r0.yzwy
add r3.w, r3.z, l(0.000100)
dp3 r1.y, r3.xywx, r3.xywx
rsq r1.y, r1.y
mul r3.xyz, r1.yyyy, r3.xywx
mad r3.xyz, r3.xyzx, cb0[3].wwww, r0.yzwy
movc r3.xyz, r1.xxxx, r3.xyzx, r0.yzwy
mov r3.w, l(1.000000)
dp4 r0.y, r3.xyzw, cb0[4].xyzw
ge r0.zw, cb0[5].xxxz, l(0.000000, 0.000000, 0.000000, 0.000000)
lt r1.xy, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[5].ywyy
and r0.zw, r0.zzzw, r1.xxxy
ge r1.x, cb0[5].x, -r0.y
add r1.y, r0.y, cb0[5].x
div r1.y, r1.y, cb0[5].y
and r1.x, r1.y, r1.x
and r0.z, r0.z, r1.x
ge r1.x, -r0.y, cb0[5].z
add r0.y, -r0.y, -cb0[5].z
div r0.y, r0.y, cb0[5].w
movc r0.y, r1.x, r0.y, r0.z
movc_sat r0.y, r0.w, r0.y, r0.z
add r0.y, -r0.y, l(1.000000)
ge r0.z, l(0.000000), r0.y
eq r0.w, r1.w, l(-1.000000)
or r0.z, r0.w, r0.z
mov o0.xyzw, l(0,0,0,0)
mov o1.xyzw, l(0,0,0,0)
mov o2.xyzw, l(0,0,0,0)
mov o3.xyzw, l(1000000000.000000,1000000000.000000,1000000000.000000,0)
retc_nz r0.z
imad r0.x, r0.x, l(-6), v0.x
ld_indexable(texture2d)(float,float,float,float) r4.xyzw, r2.xyww, t1.xyzw
ld_indexable(texture2d)(float,float,float,float) r5.xyzw, r2.xyww, t2.xyzw
ieq r6.xyzw, r0.xxxx, l(0, 3, 2, 4)
or r0.x, r6.y, r6.x
or r0.xz, r6.zzwz, r0.xxxx
and r1.xy, r0.xzxx, l(0x3f800000, 0x3f800000, 0, 0)
mad r1.yz, r1.xxyx, l(0.000000, 2.000000, 2.000000, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
lt r0.w, l(1.500000), r5.w
add r3.w, r5.w, l(-3.000000)
movc r3.w, r0.w, r3.w, r5.w
mad r3.xyz, r4.xyzx, r1.yyyy, r3.xyzx
mad r5.xyz, r5.xyzx, r1.zzzz, r3.xyzx
mov r5.w, l(1.000000)
dp4 r3.x, r5.xyzw, cb0[6].xyzw
dp4 r3.y, r5.xyzw, cb0[7].xyzw
dp4 r13.z, r5.xyzw, cb0[8].xyzw
dp4 r1.y, r5.xyzw, cb0[9].xyzw
add r1.z, r1.w, -cb0[10].y
div_sat r1.z, r1.z, cb0[10].z
lt r3.z, l(0.000000), cb0[1].w
div_sat r4.x, r1.w, cb0[10].w
movc r3.z, r3.z, r4.x, l(1.000000)
mul r6.w, r3.z, cb0[11].w
mad r6.xyz, -r3.wwww, cb0[12].yyyy, cb0[11].xyzx
mad r4.xyz, -r3.wwww, cb0[12].yyyy, cb0[13].xyzx
mul r1.z, r1.z, cb0[10].x
add r7.xyz, -r6.xyzx, r4.xyzx
mad r7.w, -cb0[11].w, r3.z, cb0[13].w
mad r6.xyzw, r1.zzzz, r7.xyzw, r6.xyzw
max r1.z, r6.y, r6.x
max r1.z, r6.z, r1.z
lt r3.zw, l(0.000000, 0.000000, 0.000000, 0.900000), cb0[14].yyyw
lt r4.x, cb0[14].y, l(1.000000)
and r3.z, r3.z, r4.x
ge r4.x, r1.z, cb0[14].y
add r4.y, -cb0[14].y, l(1.000000)
div r4.y, cb0[14].x, r4.y
add r1.z, r1.z, -cb0[14].y
mul r1.z, r1.z, r4.y
and r1.z, r1.z, r4.x
movc r1.z, r3.z, r1.z, cb0[14].x
mul o1.xyz, r1.zzzz, r6.xyzx
mul r0.y, r0.y, r6.w
ge r1.z, l(0.000000), r0.y
movc r13.w, r1.z, l(0), r1.y
lt r1.z, l(0.000000), r4.w
movc r0.xz, r0.xxzx, l(0,0,0,0), l(1.000000,0,1.000000,0)
movc r0.x, r1.z, r0.x, r1.x
mul o1.w, r0.y, cb0[1].w
round_ni r0.y, r1.w
movc r0.y, r0.w, l(0), r0.y
add r0.y, r0.y, r4.w
add r0.x, r0.x, r0.y
div o0.x, r0.x, cb0[15].w
if_nz r3.w
  ld_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.xyzw, t3.xyzw
  dp3 r0.x, r2.xyzx, r2.xyzx
  rsq r0.x, r0.x
  mul r0.xyw, r0.xxxx, r2.xyxz
  mad r2.xyz, -r0.xywx, r2.wwww, r5.xyzx
  mov r2.w, l(1.000000)
  dp4 r0.x, r2.xyzw, cb0[6].xyzw
  dp4 r0.y, r2.xyzw, cb0[7].xyzw
  dp4 r0.w, r2.xyzw, cb0[9].xyzw
  div r1.xy, r3.xyxx, r1.yyyy
  mad r1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
  div r0.xy, r0.xyxx, r0.wwww
  mad r2.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
  add r2.z, -r2.y, l(1.000000)
  add r1.z, -r1.y, l(1.000000)
  add r1.xy, r1.xzxx, -r2.xzxx
  mov r1.z, l(1.000000)
else
  mov r1.xyz, l(0,0,0,0)
endif
mov o0.y, r0.z
mov o0.z, l(0)
mov o0.w, cb0[12].x
mov o2.xyw, r1.xyxz
mov o2.z, l(0)
mov r13.xy, r3.xyxx

add r14.w, r13.w, -r14.y
mad r13.x, r14.x, r14.w, r13.x

mov o3.xyzw, r13.xyzw
ret
// Approximately 124 instruction slots used
