#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ solve_cubic(int, float, float, float *);
int solve_quadratic_2(int, float, float, float *);
float sqrt(float);
int solve_quartic_2(float p, float q, float r, float s, float t[4]) {
  float a = q - p * p * 3 / 8;
  float b = p * p * p / 8 - p * q / 2 + r;
  float c = p * p * p * p * (-3.0 / 256.0) + p * p * q / 16 - p * r / 4 + s;
  if (b == 0.0) {
    float z[2];
    int count = solve_quadratic_2(1, a, c, z);
    if (count == 0)
      return 0;
    assert(count == 2);
    int solutions = 0;
    if (z[0] >= 0) {
      float x1 = sqrt(z[0]);
      float x2 = -x1;
      t[0] = x1 - p / 4;
      t[1] = x2 - p / 4;
      solutions += 2;
    }
    if (z[1] >= 0) {
      float x1 = sqrt(z[1]);
      float x2 = -x1;
      t[solutions + 0] = x1 - p / 4;
      t[solutions + 1] = x2 - p / 4;
      solutions += 2;
    }
    return solutions;
  }
  float t3[4];
  solve_cubic(2 * a, a * a - 4 * c, -b * b, t3);
  float z = t3[0];
  float alpha = sqrt(z);
  float rho = -b / alpha;
  float beta = (a + z + rho) / 2;
  float delta = (a + z - rho) / 2;
  float t1[2] = {-1, -1}, t2[2] = {-1, -1};
  int n1 = solve_quadratic_2(1, alpha, beta, t1);
  int n2 = solve_quadratic_2(1, -alpha, delta, t2);
  t[0] = t1[0] - p / 4;
  t[1] = t1[1] - p / 4;
  t[n1 + 0] = t2[0] - p / 4;
  t[n1 + 1] = t2[1] - p / 4;
  return n1 + n2;
}


x86 assembly (clang, -O0):
<solve_quartic_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
mov    %rdi,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  0xe96(%rip),%xmm2
mulss  %xmm2,%xmm1
movss  0xe86(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xe62(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
movss  0xe48(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
movss  0xe03(%rip),%xmm2
divss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe07(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movss  0xdd5(%rip),%xmm2
divss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13da <solve_quartic_2+0x29a>
jp     13da <solve_quartic_2+0x29a>
movss  -0x24(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm1
lea    -0x34(%rbp),%rsi
mov    $0x1,%edi
call   1040 <solve_quadratic_2@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jne    129a <solve_quartic_2+0x15a>
movl   $0x0,-0x4(%rbp)
jmp    15c6 <solve_quartic_2+0x486>
cmpl   $0x2,-0x38(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movl   $0x0,-0x3c(%rbp)
movss  -0x34(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1337 <solve_quartic_2+0x1f7>
movss  -0x34(%rbp),%xmm0
call   1060 <sqrt@plt>
movss  %xmm0,-0x40(%rbp)
movss  -0x40(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x40(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xd05(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x44(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xce3(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x3c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x3c(%rbp)
movss  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     13cf <solve_quartic_2+0x28f>
movss  -0x30(%rbp),%xmm0
call   1060 <sqrt@plt>
movss  %xmm0,-0x48(%rbp)
movss  -0x48(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x48(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xc80(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x4c(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xc54(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x3c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    15c6 <solve_quartic_2+0x486>
movss  0xc26(%rip),%xmm0
mulss  -0x24(%rbp),%xmm0
cvttss2si %xmm0,%edi
movss  -0x24(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movss  0xc03(%rip),%xmm1
mulss  -0x2c(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x28(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  -0x28(%rbp),%xmm1
lea    -0x60(%rbp),%rsi
call   1030 <solve_cubic@plt>
movss  -0x60(%rbp),%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0x64(%rbp),%xmm0
call   1060 <sqrt@plt>
movss  %xmm0,-0x68(%rbp)
movss  -0x28(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
divss  -0x68(%rbp),%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0x24(%rbp),%xmm0
addss  -0x64(%rbp),%xmm0
addss  -0x6c(%rbp),%xmm0
movss  0xb85(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x24(%rbp),%xmm0
addss  -0x64(%rbp),%xmm0
subss  -0x6c(%rbp),%xmm0
movss  0xb65(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x74(%rbp)
mov    0xb6d(%rip),%rax
mov    %rax,-0x7c(%rbp)
mov    0xb62(%rip),%rax
mov    %rax,-0x84(%rbp)
movss  -0x68(%rbp),%xmm0
movss  -0x70(%rbp),%xmm1
lea    -0x7c(%rbp),%rsi
mov    $0x1,%edi
call   1040 <solve_quadratic_2@plt>
mov    %eax,-0x88(%rbp)
movss  -0x68(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x74(%rbp),%xmm1
lea    -0x84(%rbp),%rsi
mov    $0x1,%edi
call   1040 <solve_quadratic_2@plt>
mov    %eax,-0x8c(%rbp)
movss  -0x7c(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xadd(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x78(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xabb(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x84(%rbp),%xmm0
ff
movss  -0x8(%rbp),%xmm1
movss  0xa95(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x88(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x80(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xa66(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x88(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x88(%rbp),%eax
add    -0x8c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_quartic_2>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%r14
movaps %xmm0,%xmm7
mulss  %xmm0,%xmm7
movss  0xea6(%rip),%xmm8
mulss  %xmm7,%xmm8
mulss  0xe9c(%rip),%xmm8
movaps %xmm0,%xmm4
shufps $0x0,%xmm0,%xmm4
movaps %xmm7,%xmm5
unpcklps %xmm1,%xmm5
mulps  %xmm4,%xmm5
movaps 0xea1(%rip),%xmm4
mulps  %xmm5,%xmm4
movaps %xmm4,%xmm6
shufps $0x55,%xmm4,%xmm6
subss  %xmm6,%xmm4
addss  %xmm2,%xmm4
mulss  %xmm0,%xmm5
cvtss2sd %xmm5,%xmm5
mulss  %xmm1,%xmm7
mulss  0xe63(%rip),%xmm7
xorps  %xmm6,%xmm6
cvtss2sd %xmm7,%xmm6
mulsd  0xe8c(%rip),%xmm5
addsd  %xmm6,%xmm5
movaps %xmm0,0x40(%rsp)
mulss  %xmm0,%xmm2
mulss  0xe43(%rip),%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
addsd  %xmm5,%xmm0
xorps  %xmm2,%xmm2
cvtss2sd %xmm3,%xmm2
addsd  %xmm0,%xmm2
cvtsd2ss %xmm2,%xmm2
addss  %xmm1,%xmm8
xorpd  %xmm0,%xmm0
ucomiss %xmm0,%xmm4
jne    1242 <solve_quartic_2+0x102>
jp     1242 <solve_quartic_2+0x102>
lea    0x20(%rsp),%rsi
mov    $0x1,%edi
movaps %xmm8,%xmm0
movaps %xmm2,%xmm1
call   1040 <solve_quadratic_2@plt>
test   %eax,%eax
je     12ab <solve_quartic_2+0x16b>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1050 <assert@plt>
movss  0x20(%rsp),%xmm0
xor    %ebx,%ebx
xorps  %xmm3,%xmm3
ucomiss %xmm3,%xmm0
jb     13ca <solve_quartic_2+0x28a>
jb     1392 <solve_quartic_2+0x252>
sqrtss %xmm0,%xmm0
jmp    139a <solve_quartic_2+0x25a>
movaps %xmm8,%xmm0
addss  %xmm8,%xmm0
cvttss2si %xmm0,%edi
movabs $0xbf800000bf800000,%rbx
mulss  0xdaf(%rip),%xmm2
movss  %xmm8,0xc(%rsp)
mulss  %xmm8,%xmm8
addss  %xmm2,%xmm8
movaps 0xdb7(%rip),%xmm1
xorps  %xmm4,%xmm1
movaps %xmm1,0x50(%rsp)
mulss  %xmm4,%xmm1
lea    0x20(%rsp),%rsi
movaps %xmm8,%xmm0
call   1030 <solve_cubic@plt>
movss  0x20(%rsp),%xmm1
ucomiss 0xd7c(%rip),%xmm1
jb     12b2 <solve_quartic_2+0x172>
xorps  %xmm0,%xmm0
sqrtss %xmm1,%xmm0
jmp    12c6 <solve_quartic_2+0x186>
xor    %ebx,%ebx
jmp    141d <solve_quartic_2+0x2dd>
movaps %xmm1,%xmm0
movss  %xmm1,0x30(%rsp)
call   1060 <sqrt@plt>
movss  0x30(%rsp),%xmm1
movaps 0x50(%rsp),%xmm2
divss  %xmm0,%xmm2
movss  0xc(%rsp),%xmm3
addss  %xmm1,%xmm3
movaps %xmm3,%xmm1
addss  %xmm2,%xmm1
movaps %xmm0,0x30(%rsp)
movss  0xd27(%rip),%xmm4
mulss  %xmm4,%xmm1
subss  %xmm2,%xmm3
mulss  %xmm4,%xmm3
movss  %xmm3,0xc(%rsp)
mov    %rbx,0x18(%rsp)
mov    %rbx,0x10(%rsp)
lea    0x18(%rsp),%rsi
mov    $0x1,%edi
call   1040 <solve_quadratic_2@plt>
mov    %eax,%ebx
movaps 0x30(%rsp),%xmm0
xorps  0xd0a(%rip),%xmm0
lea    0x10(%rsp),%rsi
mov    $0x1,%edi
movss  0xc(%rsp),%xmm1
call   1040 <solve_quadratic_2@plt>
movss  0x18(%rsp),%xmm0
movaps 0x40(%rsp),%xmm1
mulss  0xcca(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,(%r14)
movss  0x1c(%rsp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x4(%r14)
movss  0x10(%rsp),%xmm0
subss  %xmm1,%xmm0
movslq %ebx,%rbx
movss  %xmm0,(%r14,%rbx,4)
movss  0x14(%rsp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x4(%r14,%rbx,4)
add    %eax,%ebx
jmp    141d <solve_quartic_2+0x2dd>
call   1060 <sqrt@plt>
xorps  %xmm3,%xmm3
movaps 0xc8f(%rip),%xmm1
xorps  %xmm0,%xmm1
movss  0xc6c(%rip),%xmm2
mulss  0x40(%rsp),%xmm2
subss  %xmm2,%xmm0
movss  %xmm0,(%r14)
subss  %xmm2,%xmm1
movss  %xmm1,0x4(%r14)
mov    $0x2,%ebx
movss  0x24(%rsp),%xmm0
ucomiss %xmm3,%xmm0
jb     141d <solve_quartic_2+0x2dd>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     13e3 <solve_quartic_2+0x2a3>
sqrtss %xmm0,%xmm0
jmp    13e8 <solve_quartic_2+0x2a8>
call   1060 <sqrt@plt>
movaps 0xc41(%rip),%xmm1
movaps 0x40(%rsp),%xmm2
mulss  0xc1c(%rip),%xmm2
xorps  %xmm0,%xmm1
subss  %xmm2,%xmm0
mov    %ebx,%eax
movss  %xmm0,(%r14,%rax,4)
subss  %xmm2,%xmm1
mov    %ebx,%eax
or     $0x1,%eax
movss  %xmm1,(%r14,%rax,4)
add    $0x2,%ebx
mov    %ebx,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.solve_quartic_2.t1 = [2 x float] [float -1.000000e+00, float -1.000000e+00]
@__const.solve_quartic_2.t2 = [2 x float] [float -1.000000e+00, float -1.000000e+00]
define i32 @solve_quartic_2(float %0, float %1, float %2, float %3, float* %4) {
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float*
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca [2 x float]
%16 = alloca i32
%17 = alloca i32
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca [4 x float]
%23 = alloca float
%24 = alloca float
%25 = alloca float
%26 = alloca float
%27 = alloca float
%28 = alloca [2 x float]
%29 = alloca [2 x float]
%30 = alloca i32
%31 = alloca i32
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float* %4, float** %11
%32 = load float, float* %8
%33 = load float, float* %7
%34 = load float, float* %7
%35 = fmul float %33, %34
%36 = fmul float %35, 3.000000e+00
%37 = fdiv float %36, 8.000000e+00
%38 = fsub float %32, %37
store float %38, float* %12
%39 = load float, float* %7
%40 = load float, float* %7
%41 = fmul float %39, %40
%42 = load float, float* %7
%43 = fmul float %41, %42
%44 = fdiv float %43, 8.000000e+00
%45 = load float, float* %7
%46 = load float, float* %8
%47 = fmul float %45, %46
%48 = fdiv float %47, 2.000000e+00
%49 = fsub float %44, %48
%50 = load float, float* %9
%51 = fadd float %49, %50
store float %51, float* %13
%52 = load float, float* %7
%53 = load float, float* %7
%54 = fmul float %52, %53
%55 = load float, float* %7
%56 = fmul float %54, %55
%57 = load float, float* %7
%58 = fmul float %56, %57
%59 = fpext float %58 to double
%60 = load float, float* %7
%61 = load float, float* %7
%62 = fmul float %60, %61
%63 = load float, float* %8
%64 = fmul float %62, %63
%65 = fdiv float %64, 1.600000e+01
%66 = fpext float %65 to double
%67 = call double @llvm.fmuladd.f64(double %59, double 0xBF88000000000000, double %66)
%68 = load float, float* %7
%69 = load float, float* %9
%70 = fmul float %68, %69
%71 = fdiv float %70, 4.000000e+00
%72 = fpext float %71 to double
%73 = fsub double %67, %72
%74 = load float, float* %10
%75 = fpext float %74 to double
%76 = fadd double %73, %75
%77 = fptrunc double %76 to float
store float %77, float* %14
%78 = load float, float* %13
%79 = fpext float %78 to double
%80 = fcmp oeq double %79, 0.000000e+00
br i1 %80, label %81, label %149
81: ; preds = %5
%82 = load float, float* %12
%83 = load float, float* %14
%84 = getelementptr inbounds [2 x float], [2 x float]* %15, i64 0, i64 0
%85 = call i32 @solve_quadratic_2(i32 1, float %82, float %83, float* %84)
store i32 %85, i32* %16
%86 = load i32, i32* %16
%87 = icmp eq i32 %86, 0
br i1 %87, label %88, label %89
88: ; preds = %81
store i32 0, i32* %6
br label %233
89: ; preds = %81
%90 = load i32, i32* %16
%91 = icmp eq i32 %90, 2
%92 = zext i1 %91 to i32
%93 = call i32 @assert(i32 %92)
store i32 0, i32* %17
%94 = getelementptr inbounds [2 x float], [2 x float]* %15, i64 0, i64 0
%95 = load float, float* %94
%96 = fcmp oge float %95, 0.000000e+00
br i1 %96, label %97, label %117
97: ; preds = %89
%98 = getelementptr inbounds [2 x float], [2 x float]* %15, i64 0, i64 0
%99 = load float, float* %98
%100 = call float @sqrt(float %99)
store float %100, float* %18
%101 = load float, float* %18
%102 = fneg float %101
store float %102, float* %19
%103 = load float, float* %18
%104 = load float, float* %7
%105 = fdiv float %104, 4.000000e+00
%106 = fsub float %103, %105
%107 = load float*, float** %11
%108 = getelementptr inbounds float, float* %107, i64 0
store float %106, float* %108
%109 = load float, float* %19
%110 = load float, float* %7
%111 = fdiv float %110, 4.000000e+00
%112 = fsub float %109, %111
%113 = load float*, float** %11
%114 = getelementptr inbounds float, float* %113, i64 1
store float %112, float* %114
%115 = load i32, i32* %17
%116 = add nsw i32 %115, 2
store i32 %116, i32* %17
br label %117
117: ; preds = %97, %89
%118 = getelementptr inbounds [2 x float], [2 x float]* %15, i64 0, i64 1
%119 = load float, float* %118
%120 = fcmp oge float %119, 0.000000e+00
br i1 %120, label %121, label %147
121: ; preds = %117
%122 = getelementptr inbounds [2 x float], [2 x float]* %15, i64 0, i64 1
%123 = load float, float* %122
%124 = call float @sqrt(float %123)
store float %124, float* %20
%125 = load float, float* %20
%126 = fneg float %125
store float %126, float* %21
%127 = load float, float* %20
%128 = load float, float* %7
%129 = fdiv float %128, 4.000000e+00
%130 = fsub float %127, %129
%131 = load float*, float** %11
%132 = load i32, i32* %17
%133 = add nsw i32 %132, 0
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds float, float* %131, i64 %134
store float %130, float* %135
%136 = load float, float* %21
%137 = load float, float* %7
%138 = fdiv float %137, 4.000000e+00
%139 = fsub float %136, %138
%140 = load float*, float** %11
%141 = load i32, i32* %17
%142 = add nsw i32 %141, 1
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds float, float* %140, i64 %143
store float %139, float* %144
%145 = load i32, i32* %17
%146 = add nsw i32 %145, 2
store i32 %146, i32* %17
br label %147
147: ; preds = %121, %117
%148 = load i32, i32* %17
store i32 %148, i32* %6
br label %233
149: ; preds = %5
%150 = load float, float* %12
%151 = fmul float 2.000000e+00, %150
%152 = fptosi float %151 to i32
%153 = load float, float* %12
%154 = load float, float* %12
%155 = load float, float* %14
%156 = fmul float 4.000000e+00, %155
%157 = fneg float %156
%158 = call float @llvm.fmuladd.f32(float %153, float %154, float %157)
%159 = load float, float* %13
%160 = fneg float %159
%161 = load float, float* %13
%162 = fmul float %160, %161
%163 = getelementptr inbounds [4 x float], [4 x float]* %22, i64 0, i64 0
%164 = call i32 @solve_cubic(i32 %152, float %158, float %162, float* %163)
%165 = getelementptr inbounds [4 x float], [4 x float]* %22, i64 0, i64 0
%166 = load float, float* %165
store float %166, float* %23
%167 = load float, float* %23
%168 = call float @sqrt(float %167)
store float %168, float* %24
%169 = load float, float* %13
%170 = fneg float %169
%171 = load float, float* %24
%172 = fdiv float %170, %171
store float %172, float* %25
%173 = load float, float* %12
%174 = load float, float* %23
%175 = fadd float %173, %174
%176 = load float, float* %25
%177 = fadd float %175, %176
%178 = fdiv float %177, 2.000000e+00
store float %178, float* %26
%179 = load float, float* %12
%180 = load float, float* %23
%181 = fadd float %179, %180
%182 = load float, float* %25
%183 = fsub float %181, %182
%184 = fdiv float %183, 2.000000e+00
store float %184, float* %27
%185 = bitcast [2 x float]* %28 to i8*
%186 = bitcast [2 x float]* %29 to i8*
%187 = load float, float* %24
%188 = load float, float* %26
%189 = getelementptr inbounds [2 x float], [2 x float]* %28, i64 0, i64 0
%190 = call i32 @solve_quadratic_2(i32 1, float %187, float %188, float* %189)
store i32 %190, i32* %30
%191 = load float, float* %24
%192 = fneg float %191
%193 = load float, float* %27
%194 = getelementptr inbounds [2 x float], [2 x float]* %29, i64 0, i64 0
%195 = call i32 @solve_quadratic_2(i32 1, float %192, float %193, float* %194)
store i32 %195, i32* %31
%196 = getelementptr inbounds [2 x float], [2 x float]* %28, i64 0, i64 0
%197 = load float, float* %196
%198 = load float, float* %7
%199 = fdiv float %198, 4.000000e+00
%200 = fsub float %197, %199
%201 = load float*, float** %11
%202 = getelementptr inbounds float, float* %201, i64 0
store float %200, float* %202
%203 = getelementptr inbounds [2 x float], [2 x float]* %28, i64 0, i64 1
%204 = load float, float* %203
%205 = load float, float* %7
%206 = fdiv float %205, 4.000000e+00
%207 = fsub float %204, %206
%208 = load float*, float** %11
%209 = getelementptr inbounds float, float* %208, i64 1
store float %207, float* %209
%210 = getelementptr inbounds [2 x float], [2 x float]* %29, i64 0, i64 0
%211 = load float, float* %210
%212 = load float, float* %7
%213 = fdiv float %212, 4.000000e+00
%214 = fsub float %211, %213
%215 = load float*, float** %11
%216 = load i32, i32* %30
%217 = add nsw i32 %216, 0
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds float, float* %215, i64 %218
store float %214, float* %219
%220 = getelementptr inbounds [2 x float], [2 x float]* %29, i64 0, i64 1
%221 = load float, float* %220
%222 = load float, float* %7
%223 = fdiv float %222, 4.000000e+00
%224 = fsub float %221, %223
%225 = load float*, float** %11
%226 = load i32, i32* %30
%227 = add nsw i32 %226, 1
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds float, float* %225, i64 %228
store float %224, float* %229
%230 = load i32, i32* %30
%231 = load i32, i32* %31
%232 = add nsw i32 %230, %231
store i32 %232, i32* %6
br label %233
233: ; preds = %149, %147, %88
%234 = load i32, i32* %6
ret i32 %234
}

LLVM IR (-O2):
define i32 @solve_quartic_2(float %0, float %1, float %2, float %3, float* nocapture writeonly %4) {
%6 = alloca [2 x float]
%7 = alloca [4 x float]
%8 = alloca i64
%9 = alloca i64
%10 = fmul float %0, %0
%11 = fmul float %10, 3.000000e+00
%12 = fmul float %11, 1.250000e-01
%13 = fsub float %1, %12
%14 = insertelement <2 x float> poison, float %0, i64 0
%15 = shufflevector <2 x float> %14, <2 x float> poison, <2 x i32> zeroinitializer
%16 = insertelement <2 x float> poison, float %1, i64 1
%17 = insertelement <2 x float> %16, float %10, i64 0
%18 = fmul <2 x float> %15, %17
%19 = fmul <2 x float> %18, <float 1.250000e-01, float 5.000000e-01>
%20 = shufflevector <2 x float> %19, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%21 = fsub <2 x float> %19, %20
%22 = extractelement <2 x float> %21, i64 0
%23 = fadd float %22, %2
%24 = extractelement <2 x float> %18, i64 0
%25 = fmul float %24, %0
%26 = fpext float %25 to double
%27 = fmul float %10, %1
%28 = fmul float %27, 6.250000e-02
%29 = fpext float %28 to double
%30 = tail call double @llvm.fmuladd.f64(double %26, double 0xBF88000000000000, double %29)
%31 = fmul float %0, %2
%32 = fmul float %31, 2.500000e-01
%33 = fpext float %32 to double
%34 = fsub double %30, %33
%35 = fpext float %3 to double
%36 = fadd double %34, %35
%37 = fptrunc double %36 to float
%38 = fcmp oeq float %23, 0.000000e+00
br i1 %38, label %39, label %76
39: ; preds = %5
%40 = bitcast [2 x float]* %6 to i8*
%41 = getelementptr inbounds [2 x float], [2 x float]* %6, i64 0, i64 0
%42 = call i32 @solve_quadratic_2(i32 1, float %13, float %37, float* %41)
%43 = icmp eq i32 %42, 0
br i1 %43, label %74, label %44
44: ; preds = %39
%45 = icmp eq i32 %42, 2
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = load float, float* %41
%49 = fcmp ult float %48, 0.000000e+00
br i1 %49, label %57, label %50
50: ; preds = %44
%51 = call float @sqrt(float %48)
%52 = fneg float %51
%53 = fmul float %0, 2.500000e-01
%54 = fsub float %51, %53
store float %54, float* %4
%55 = fsub float %52, %53
%56 = getelementptr inbounds float, float* %4, i64 1
store float %55, float* %56
br label %57
57: ; preds = %50, %44
%58 = phi i32 [ 2, %50 ], [ 0, %44 ]
%59 = getelementptr inbounds [2 x float], [2 x float]* %6, i64 0, i64 1
%60 = load float, float* %59
%61 = fcmp ult float %60, 0.000000e+00
br i1 %61, label %74, label %62
62: ; preds = %57
%63 = call float @sqrt(float %60)
%64 = fneg float %63
%65 = fmul float %0, 2.500000e-01
%66 = fsub float %63, %65
%67 = zext i32 %58 to i64
%68 = getelementptr inbounds float, float* %4, i64 %67
store float %66, float* %68
%69 = fsub float %64, %65
%70 = or i32 %58, 1
%71 = zext i32 %70 to i64
%72 = getelementptr inbounds float, float* %4, i64 %71
store float %69, float* %72
%73 = add nuw nsw i32 %58, 2
br label %74
74: ; preds = %57, %62, %39
%75 = phi i32 [ 0, %39 ], [ %73, %62 ], [ %58, %57 ]
br label %121
76: ; preds = %5
%77 = bitcast i64* %9 to [2 x float]*
%78 = bitcast i64* %8 to [2 x float]*
%79 = bitcast [4 x float]* %7 to i8*
%80 = fmul float %13, 2.000000e+00
%81 = fptosi float %80 to i32
%82 = fmul float %37, -4.000000e+00
%83 = tail call float @llvm.fmuladd.f32(float %13, float %13, float %82)
%84 = fneg float %23
%85 = fmul float %23, %84
%86 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
%87 = call i32 @solve_cubic(i32 %81, float %83, float %85, float* %86)
%88 = load float, float* %86
%89 = call float @sqrt(float %88)
%90 = fdiv float %84, %89
%91 = fadd float %13, %88
%92 = fadd float %91, %90
%93 = fmul float %92, 5.000000e-01
%94 = fsub float %91, %90
%95 = fmul float %94, 5.000000e-01
%96 = bitcast i64* %8 to i8*
store i64 -4647714812233515008, i64* %8
%97 = bitcast i64* %9 to i8*
store i64 -4647714812233515008, i64* %9
%98 = bitcast i64* %8 to float*
%99 = call i32 @solve_quadratic_2(i32 1, float %89, float %93, float* %98)
%100 = fneg float %89
%101 = bitcast i64* %9 to float*
%102 = call i32 @solve_quadratic_2(i32 1, float %100, float %95, float* %101)
%103 = load float, float* %98
%104 = fmul float %0, 2.500000e-01
%105 = fsub float %103, %104
store float %105, float* %4
%106 = getelementptr inbounds [2 x float], [2 x float]* %78, i64 0, i64 1
%107 = load float, float* %106
%108 = fsub float %107, %104
%109 = getelementptr inbounds float, float* %4, i64 1
store float %108, float* %109
%110 = load float, float* %101
%111 = fsub float %110, %104
%112 = sext i32 %99 to i64
%113 = getelementptr inbounds float, float* %4, i64 %112
store float %111, float* %113
%114 = getelementptr inbounds [2 x float], [2 x float]* %77, i64 0, i64 1
%115 = load float, float* %114
%116 = fsub float %115, %104
%117 = add nsw i32 %99, 1
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds float, float* %4, i64 %118
store float %116, float* %119
%120 = add nsw i32 %102, %99
br label %121
121: ; preds = %76, %74
%122 = phi i32 [ %75, %74 ], [ %120, %76 ]
ret i32 %122
}