#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 solve_degree_2(double *, double *);
int solve_degree_3(double *, double *);
double sqrt(double);
scalar_t__ zero(double *);
int solve_degree_4(const double *c, double *x) {
  double coeffs[4];
  int num;
  double A = c[3] / c[4];
  double B = c[2] / c[4];
  double C = c[1] / c[4];
  double D = c[0] / c[4];
  double sq_A = A * A;
  double p = -3.0 / 8.0 * sq_A + B;
  double q = 1.0 / 8.0 * sq_A * A - 1.0 / 2.0 * A * B + C;
  double r = -3.0 / 256.0 * sq_A * sq_A + 1.0 / 16.0 * sq_A * B -
             1.0 / 4.0 * A * C + D;
  if (zero(&r)) {
    coeffs[0] = q;
    coeffs[1] = p;
    coeffs[2] = 0.0;
    coeffs[3] = 1.0;
    num = solve_degree_3(coeffs, x);
    x[num++] = 0;
  } else {
    coeffs[0] = 1.0 / 2.0 * r * p - 1.0 / 8.0 * q * q;
    coeffs[1] = -r;
    coeffs[2] = -1.0 / 2.0 * p;
    coeffs[3] = 1.0;
    solve_degree_3(coeffs, x);
    double z = x[0];
    double u = z * z - r;
    double v = 2.0 * z - p;
    zero(&u);
    if (u < 0)
      return 0;
    else if (u > 0)
      u = sqrt(u);
    zero(&v);
    if (v < 0)
      return 0;
    else if (v > 0)
      v = sqrt(v);
    coeffs[0] = z - u;
    coeffs[1] = q < 0.0 ? -v : v;
    coeffs[2] = 1.0;
    num = solve_degree_2(coeffs, x);
    coeffs[0] = z + u;
    coeffs[1] = q < 0.0 ? v : -v;
    coeffs[2] = 1.0;
    num += solve_degree_2(coeffs, x + num);
  }
  double sub = 1.0 / 4.0 * A;
  for (int i = 0; i < num; i++)
    x[i] -= sub;
  return num;
}


x86 assembly (clang, -O0):
<solve_degree_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xe59(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe3c(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  0xe22(%rip),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xddf(%rip),%xmm1
mulsd  -0x70(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movsd  0xdc5(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xda3(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
lea    -0x88(%rbp),%rdi
call   1050 <zero@plt>
cmp    $0x0,%rax
je     1301 <solve_degree_4+0x1c1>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xd63(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <solve_degree_3@plt>
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x44(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x44(%rbp)
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    15ef <solve_degree_4+0x4af>
movsd  0xd0f(%rip),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm2
movsd  0xd02(%rip),%xmm1
mulsd  -0x80(%rbp),%xmm1
mulsd  -0x80(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xcc0(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xca6(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <solve_degree_3@plt>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x88(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
lea    -0x98(%rbp),%rdi
call   1050 <zero@plt>
xorps  %xmm0,%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jbe    1448 <solve_degree_4+0x308>
movl   $0x0,-0x4(%rbp)
jmp    1658 <solve_degree_4+0x518>
movsd  -0x98(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1472 <solve_degree_4+0x332>
movsd  -0x98(%rbp),%xmm0
ff
call   1060 <sqrt@plt>
movsd  %xmm0,-0x98(%rbp)
ff
jmp    1477 <solve_degree_4+0x337>
lea    -0xa0(%rbp),%rdi
call   1050 <zero@plt>
xorps  %xmm0,%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jbe    14a0 <solve_degree_4+0x360>
movl   $0x0,-0x4(%rbp)
jmp    1658 <solve_degree_4+0x518>
movsd  -0xa0(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14ca <solve_degree_4+0x38a>
movsd  -0xa0(%rbp),%xmm0
ff
call   1060 <sqrt@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    14cf <solve_degree_4+0x38f>
movsd  -0x90(%rbp),%xmm0
ff
subsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    151e <solve_degree_4+0x3de>
movsd  -0xa0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    152e <solve_degree_4+0x3ee>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x38(%rbp)
movsd  0xaed(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <solve_degree_2@plt>
mov    %eax,-0x44(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
addsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    1590 <solve_degree_4+0x450>
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
jmp    15b7 <solve_degree_4+0x477>
movsd  -0xa0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x38(%rbp)
movsd  0xa64(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x44(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
call   1040 <solve_degree_2@plt>
add    -0x44(%rbp),%eax
mov    %eax,-0x44(%rbp)
movsd  0xa09(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movl   $0x0,-0xac(%rbp)
mov    -0xac(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    1652 <solve_degree_4+0x512>
movsd  -0xa8(%rbp),%xmm1
ff
mov    -0x18(%rbp),%rax
movslq -0xac(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
jmp    160e <solve_degree_4+0x4ce>
mov    -0x44(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_degree_4>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rsi,%rbx
movsd  0x18(%rdi),%xmm5
movsd  0x20(%rdi),%xmm2
divsd  %xmm2,%xmm5
movsd  0x10(%rdi),%xmm3
divsd  %xmm2,%xmm3
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
divsd  %xmm2,%xmm1
divsd  %xmm2,%xmm0
movapd %xmm5,%xmm2
mulsd  %xmm5,%xmm2
movsd  0xe7c(%rip),%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm3,%xmm4
movsd  %xmm4,0x48(%rsp)
movsd  0xe6e(%rip),%xmm6
mulsd  %xmm2,%xmm6
movsd  0xe6a(%rip),%xmm4
mulsd  %xmm5,%xmm4
mulsd  %xmm3,%xmm4
mulsd  %xmm5,%xmm6
addsd  %xmm4,%xmm6
addsd  %xmm1,%xmm6
movsd  %xmm6,0x8(%rsp)
movsd  0xe50(%rip),%xmm4
mulsd  %xmm2,%xmm4
mulsd  %xmm2,%xmm4
mulsd  0xe48(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm4,%xmm2
mulsd  0xe40(%rip),%xmm5
movapd %xmm5,0x60(%rsp)
mulsd  %xmm5,%xmm1
subsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x50(%rsp)
lea    0x50(%rsp),%rdi
call   1050 <zero@plt>
test   %rax,%rax
je     127a <solve_degree_4+0x13a>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x48(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
xorpd  %xmm0,%xmm0
movhpd 0xdfd(%rip),%xmm0
movapd %xmm0,0x30(%rsp)
lea    0x20(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <solve_degree_3@plt>
mov    %eax,%r14d
cltq
add    $0x1,%r14d
movq   $0x0,(%rbx,%rax,8)
movapd 0x60(%rsp),%xmm5
test   %r14d,%r14d
jle    146b <solve_degree_4+0x32b>
mov    %r14d,%eax
cmp    $0x4,%r14d
jae    1363 <solve_degree_4+0x223>
xor    %ecx,%ecx
jmp    1420 <solve_degree_4+0x2e0>
movsd  0x50(%rsp),%xmm0
movsd  0xdb0(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xdac(%rip),%xmm2
movsd  0x8(%rsp),%xmm3
mulsd  %xmm3,%xmm2
mulsd  %xmm3,%xmm2
movsd  0x48(%rsp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x20(%rsp)
xorpd  0xd92(%rip),%xmm0
movlpd %xmm0,0x28(%rsp)
movsd  0xd44(%rip),%xmm0
mulsd  %xmm3,%xmm0
movsd  %xmm0,0x30(%rsp)
movabs $0x3ff0000000000000,%r14
mov    %r14,0x38(%rsp)
lea    0x20(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <solve_degree_3@plt>
movsd  (%rbx),%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
subsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x58(%rsp)
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
subsd  0x48(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
lea    0x10(%rsp),%rdi
call   1050 <zero@plt>
movsd  0x10(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     1468 <solve_degree_4+0x328>
ucomisd %xmm1,%xmm0
jbe    144e <solve_degree_4+0x30e>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1443 <solve_degree_4+0x303>
sqrtsd %xmm0,%xmm0
jmp    1448 <solve_degree_4+0x308>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
movapd %xmm5,%xmm0
unpcklpd %xmm5,%xmm0
lea    -0x4(%rcx),%rdx
mov    %rdx,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
test   %rdx,%rdx
je     1439 <solve_degree_4+0x2f9>
mov    %rsi,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movupd (%rbx,%rdx,8),%xmm1
movupd 0x10(%rbx,%rdx,8),%xmm2
movupd 0x20(%rbx,%rdx,8),%xmm3
movupd 0x30(%rbx,%rdx,8),%xmm4
subpd  %xmm0,%xmm1
subpd  %xmm0,%xmm2
movupd %xmm1,(%rbx,%rdx,8)
movupd %xmm2,0x10(%rbx,%rdx,8)
subpd  %xmm0,%xmm3
subpd  %xmm0,%xmm4
movupd %xmm3,0x20(%rbx,%rdx,8)
movupd %xmm4,0x30(%rbx,%rdx,8)
add    $0x8,%rdx
add    $0xfffffffffffffffe,%rdi
jne    13a0 <solve_degree_4+0x260>
test   $0x1,%sil
je     140c <solve_degree_4+0x2cc>
movupd (%rbx,%rdx,8),%xmm1
movupd 0x10(%rbx,%rdx,8),%xmm2
subpd  %xmm0,%xmm1
subpd  %xmm0,%xmm2
movupd %xmm1,(%rbx,%rdx,8)
movupd %xmm2,0x10(%rbx,%rdx,8)
cmp    %rax,%rcx
je     146b <solve_degree_4+0x32b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rcx,8),%xmm0
subsd  %xmm5,%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1420 <solve_degree_4+0x2e0>
jmp    146b <solve_degree_4+0x32b>
xor    %edx,%edx
test   $0x1,%sil
jne    13ee <solve_degree_4+0x2ae>
jmp    140c <solve_degree_4+0x2cc>
call   1060 <sqrt@plt>
movsd  %xmm0,0x10(%rsp)
lea    0x18(%rsp),%rdi
call   1050 <zero@plt>
movsd  0x18(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1478 <solve_degree_4+0x338>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
ucomisd %xmm1,%xmm0
jbe    148e <solve_degree_4+0x34e>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1496 <solve_degree_4+0x356>
sqrtsd %xmm0,%xmm0
jmp    149b <solve_degree_4+0x35b>
movsd  0x8(%rsp),%xmm2
jmp    14a7 <solve_degree_4+0x367>
call   1060 <sqrt@plt>
movsd  0x8(%rsp),%xmm2
movsd  %xmm0,0x18(%rsp)
movsd  0x58(%rsp),%xmm1
subsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x20(%rsp)
movapd %xmm0,%xmm1
xorpd  0xb8b(%rip),%xmm1
xorpd  %xmm3,%xmm3
cmpltsd %xmm3,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movlpd %xmm2,0x28(%rsp)
mov    %r14,0x30(%rsp)
lea    0x20(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <solve_degree_2@plt>
xorpd  %xmm0,%xmm0
ucomisd 0x8(%rsp),%xmm0
movsd  0x58(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
ja     1521 <solve_degree_4+0x3e1>
xorpd  0xb2f(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
mov    %r14,0x30(%rsp)
movslq %eax,%r14
lea    (%rbx,%r14,8),%rsi
mov    %r15,%rdi
call   1040 <solve_degree_2@plt>
add    %eax,%r14d
jmp    1257 <solve_degree_4+0x117>

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

LLVM IR (-O2):
define i32 @solve_degree_4(double* nocapture %0, double* %1) {
%3 = alloca [4 x double]
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = bitcast [4 x double]* %3 to i8*
%8 = getelementptr inbounds double, double* %0, i64 3
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %0, i64 4
%11 = load double, double* %10
%12 = fdiv double %9, %11
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = fdiv double %14, %11
%16 = getelementptr inbounds double, double* %0, i64 1
%17 = load double, double* %16
%18 = fdiv double %17, %11
%19 = load double, double* %0
%20 = fdiv double %19, %11
%21 = fmul double %12, %12
%22 = tail call double @llvm.fmuladd.f64(double %21, double -3.750000e-01, double %15)
%23 = fmul double %21, 1.250000e-01
%24 = fmul double %12, -5.000000e-01
%25 = fmul double %24, %15
%26 = tail call double @llvm.fmuladd.f64(double %23, double %12, double %25)
%27 = fadd double %18, %26
%28 = bitcast double* %4 to i8*
%29 = fmul double %21, 0xBF88000000000000
%30 = fmul double %21, 6.250000e-02
%31 = fmul double %15, %30
%32 = tail call double @llvm.fmuladd.f64(double %29, double %21, double %31)
%33 = fmul double %12, 2.500000e-01
%34 = fneg double %33
%35 = tail call double @llvm.fmuladd.f64(double %34, double %18, double %32)
%36 = fadd double %20, %35
store double %36, double* %4
%37 = call i64 @zero(double* %4)
%38 = icmp eq i64 %37, 0
br i1 %38, label %48, label %39
39: ; preds = %2
%40 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
store double %27, double* %40
%41 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 1
store double %22, double* %41
%42 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
%43 = bitcast double* %42 to <2 x double>*
store <2 x double> <double 0.000000e+00, double 1.000000e+00>, <2 x double>* %43
%44 = call i32 @solve_degree_3(double* %40, double* %1)
%45 = add nsw i32 %44, 1
%46 = sext i32 %44 to i64
%47 = getelementptr inbounds double, double* %1, i64 %46
store double 0.000000e+00, double* %47
br label %102
48: ; preds = %2
%49 = load double, double* %4
%50 = fmul double %49, 5.000000e-01
%51 = fmul double %27, -1.250000e-01
%52 = fmul double %27, %51
%53 = call double @llvm.fmuladd.f64(double %50, double %22, double %52)
%54 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
store double %53, double* %54
%55 = fneg double %49
%56 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 1
store double %55, double* %56
%57 = fmul double %22, -5.000000e-01
%58 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
store double %57, double* %58
%59 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 3
store double 1.000000e+00, double* %59
%60 = call i32 @solve_degree_3(double* %54, double* %1)
%61 = load double, double* %1
%62 = bitcast double* %5 to i8*
%63 = load double, double* %4
%64 = fneg double %63
%65 = call double @llvm.fmuladd.f64(double %61, double %61, double %64)
store double %65, double* %5
%66 = bitcast double* %6 to i8*
%67 = fneg double %22
%68 = call double @llvm.fmuladd.f64(double %61, double 2.000000e+00, double %67)
store double %68, double* %6
%69 = call i64 @zero(double* %5)
%70 = load double, double* %5
%71 = fcmp olt double %70, 0.000000e+00
br i1 %71, label %84, label %72
72: ; preds = %48
%73 = fcmp ogt double %70, 0.000000e+00
br i1 %73, label %74, label %76
74: ; preds = %72
%75 = call double @sqrt(double %70)
store double %75, double* %5
br label %76
76: ; preds = %72, %74
%77 = call i64 @zero(double* %6)
%78 = load double, double* %6
%79 = fcmp olt double %78, 0.000000e+00
br i1 %79, label %84, label %80
80: ; preds = %76
%81 = fcmp ogt double %78, 0.000000e+00
br i1 %81, label %82, label %85
82: ; preds = %80
%83 = call double @sqrt(double %78)
store double %83, double* %6
br label %85
84: ; preds = %48, %76
br label %173
85: ; preds = %82, %80
%86 = phi double [ %83, %82 ], [ %78, %80 ]
%87 = load double, double* %5
%88 = fsub double %61, %87
store double %88, double* %54
%89 = fcmp olt double %27, 0.000000e+00
%90 = fneg double %86
%91 = select i1 %89, double %90, double %86
store double %91, double* %56
store double 1.000000e+00, double* %58
%92 = call i32 @solve_degree_2(double* %54, double* %1)
%93 = load double, double* %5
%94 = fadd double %61, %93
store double %94, double* %54
%95 = load double, double* %6
%96 = fneg double %95
%97 = select i1 %89, double %95, double %96
store double %97, double* %56
store double 1.000000e+00, double* %58
%98 = sext i32 %92 to i64
%99 = getelementptr inbounds double, double* %1, i64 %98
%100 = call i32 @solve_degree_2(double* %54, double* %99)
%101 = add nsw i32 %100, %92
br label %102
102: ; preds = %85, %39
%103 = phi i32 [ %45, %39 ], [ %101, %85 ]
%104 = icmp sgt i32 %103, 0
br i1 %104, label %105, label %173
105: ; preds = %102
%106 = zext i32 %103 to i64
%107 = icmp ult i32 %103, 4
br i1 %107, label %164, label %108
108: ; preds = %105
%109 = and i64 %106, 4294967292
%110 = insertelement <2 x double> poison, double %33, i64 0
%111 = shufflevector <2 x double> %110, <2 x double> poison, <2 x i32> zeroinitializer
%112 = insertelement <2 x double> poison, double %33, i64 0
%113 = shufflevector <2 x double> %112, <2 x double> poison, <2 x i32> zeroinitializer
%114 = add nsw i64 %109, -4
%115 = lshr exact i64 %114, 2
%116 = add nuw nsw i64 %115, 1
%117 = and i64 %116, 1
%118 = icmp eq i64 %114, 0
br i1 %118, label %148, label %119
119: ; preds = %108
%120 = and i64 %116, 9223372036854775806
br label %121
121: ; preds = %121, %119
%122 = phi i64 [ 0, %119 ], [ %145, %121 ]
%123 = phi i64 [ 0, %119 ], [ %146, %121 ]
%124 = getelementptr inbounds double, double* %1, i64 %122
%125 = bitcast double* %124 to <2 x double>*
%126 = load <2 x double>, <2 x double>* %125
%127 = getelementptr inbounds double, double* %124, i64 2
%128 = bitcast double* %127 to <2 x double>*
%129 = load <2 x double>, <2 x double>* %128
%130 = fsub <2 x double> %126, %111
%131 = fsub <2 x double> %129, %113
%132 = bitcast double* %124 to <2 x double>*
store <2 x double> %130, <2 x double>* %132
%133 = bitcast double* %127 to <2 x double>*
store <2 x double> %131, <2 x double>* %133
%134 = or i64 %122, 4
%135 = getelementptr inbounds double, double* %1, i64 %134
%136 = bitcast double* %135 to <2 x double>*
%137 = load <2 x double>, <2 x double>* %136
%138 = getelementptr inbounds double, double* %135, i64 2
%139 = bitcast double* %138 to <2 x double>*
%140 = load <2 x double>, <2 x double>* %139
%141 = fsub <2 x double> %137, %111
%142 = fsub <2 x double> %140, %113
%143 = bitcast double* %135 to <2 x double>*
store <2 x double> %141, <2 x double>* %143
%144 = bitcast double* %138 to <2 x double>*
store <2 x double> %142, <2 x double>* %144
%145 = add nuw i64 %122, 8
%146 = add i64 %123, 2
%147 = icmp eq i64 %146, %120
br i1 %147, label %148, label %121
148: ; preds = %121, %108
%149 = phi i64 [ 0, %108 ], [ %145, %121 ]
%150 = icmp eq i64 %117, 0
br i1 %150, label %162, label %151
151: ; preds = %148
%152 = getelementptr inbounds double, double* %1, i64 %149
%153 = bitcast double* %152 to <2 x double>*
%154 = load <2 x double>, <2 x double>* %153
%155 = getelementptr inbounds double, double* %152, i64 2
%156 = bitcast double* %155 to <2 x double>*
%157 = load <2 x double>, <2 x double>* %156
%158 = fsub <2 x double> %154, %111
%159 = fsub <2 x double> %157, %113
%160 = bitcast double* %152 to <2 x double>*
store <2 x double> %158, <2 x double>* %160
%161 = bitcast double* %155 to <2 x double>*
store <2 x double> %159, <2 x double>* %161
br label %162
162: ; preds = %148, %151
%163 = icmp eq i64 %109, %106
br i1 %163, label %173, label %164
164: ; preds = %105, %162
%165 = phi i64 [ 0, %105 ], [ %109, %162 ]
br label %166
166: ; preds = %164, %166
%167 = phi i64 [ %171, %166 ], [ %165, %164 ]
%168 = getelementptr inbounds double, double* %1, i64 %167
%169 = load double, double* %168
%170 = fsub double %169, %33
store double %170, double* %168
%171 = add nuw nsw i64 %167, 1
%172 = icmp eq i64 %171, %106
br i1 %172, label %173, label %166
173: ; preds = %166, %162, %102, %84
%174 = phi i32 [ 0, %84 ], [ %103, %102 ], [ %103, %162 ], [ %103, %166 ]
ret i32 %174
}