#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 acos(double);
double cbrt(double);
double cos(double);
int quadratic_roots(double *, double *);
int sqrt(double);
extern int cubic_roots(double *a, double *r) {
  int i, num;
  if ((((a[3]) > -1e-30) && ((a[3]) < 1e-30)))
    return quadratic_roots(a, r);
  double A = a[2] / a[3], B = a[1] / a[3], C = a[0] / a[3];
  double A2 = A * A, A3 = A * A2, p = (-A2 / 3 + B) / 3,
         q = (2 / 27.0 * A3 - A * B / 3 + C) / 2;
  double p3 = p * p * p, D = q * q + p3;
  if ((((D) > -1e-30) && ((D) < 1e-30))) {
    if ((((q) > -1e-30) && ((q) < 1e-30))) {
      r[0] = 0;
      num = 1;
    } else {
      double u = cbrt(-q);
      r[0] = 2 * u;
      r[1] = -u;
      num = 2;
    }
  } else if (D < 0) {
    double phi = acos(-q / sqrt(-p3)) / 3, t = 2 * sqrt(-p);
    r[0] = t * cos(phi);
    r[1] = -t * cos(phi + 3.14159265358979323846 / 3);
    r[2] = -t * cos(phi - 3.14159265358979323846 / 3);
    num = 3;
  } else {
    double sD = sqrt(D), u = cbrt(sD - q), v = -cbrt(sD + q);
    r[0] = u + v;
    num = 1;
  }
  double sub = A / 3;
  for (i = 0; i < num; ++i)
    r[i] -= sub;
  return num;
}


x86 assembly (clang, -O0):
<cubic_roots>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  0xe8c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11aa <cubic_roots+0x5a>
mov    -0x10(%rbp),%rax
movsd  0xe7e(%rip),%xmm0
ucomisd 0x18(%rax),%xmm0
jbe    11aa <cubic_roots+0x5a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <quadratic_roots@plt>
mov    %eax,-0x4(%rbp)
jmp    160c <cubic_roots+0x4bc>
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xdf0(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  0xddf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movsd  0xdbf(%rip),%xmm2
divsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xd94(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  0xd77(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0xd21(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13a9 <cubic_roots+0x259>
movsd  0xd17(%rip),%xmm0
ucomisd -0x68(%rbp),%xmm0
jbe    13a9 <cubic_roots+0x259>
movsd  -0x58(%rbp),%xmm0
movsd  0xcf7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    133d <cubic_roots+0x1ed>
movsd  0xced(%rip),%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    133d <cubic_roots+0x1ed>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x1,-0x20(%rbp)
jmp    13a4 <cubic_roots+0x254>
movsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <cbrt@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  0xca5(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movl   $0x2,-0x20(%rbp)
jmp    15ae <cubic_roots+0x45e>
xorps  %xmm0,%xmm0
ucomisd -0x68(%rbp),%xmm0
jbe    1529 <cubic_roots+0x3d9>
movsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1060 <sqrt@plt>
movsd  -0xc0(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
call   1030 <acos@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1060 <sqrt@plt>
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x80(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xb7f(%rip),%xmm0
addsd  -0x78(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x80(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  0xb2c(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movl   $0x3,-0x20(%rbp)
jmp    15a9 <cubic_roots+0x459>
movsd  -0x68(%rbp),%xmm0
call   1060 <sqrt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
subsd  -0x58(%rbp),%xmm0
call   1040 <cbrt@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
addsd  -0x58(%rbp),%xmm0
call   1040 <cbrt@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
addsd  -0x98(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x20(%rbp)
jmp    15ae <cubic_roots+0x45e>
movsd  -0x28(%rbp),%xmm0
movsd  0xa65(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1606 <cubic_roots+0x4b6>
movsd  -0xa0(%rbp),%xmm1
ff
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    15ce <cubic_roots+0x47e>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic_roots>:
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%rbx
movsd  0x18(%rdi),%xmm0
ucomisd 0xe9b(%rip),%xmm0
jbe    1182 <cubic_roots+0x32>
movsd  0xe99(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1182 <cubic_roots+0x32>
mov    %rbx,%rsi
add    $0x40,%rsp
pop    %rbx
jmp    1070 <quadratic_roots@plt>
movsd  0x10(%rdi),%xmm3
divsd  %xmm0,%xmm3
movsd  (%rdi),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm3,%xmm2
mulsd  %xmm3,%xmm2
movapd %xmm3,%xmm4
mulsd  %xmm2,%xmm4
movsd  0x8(%rdi),%xmm5
unpcklpd %xmm2,%xmm5
shufpd $0x2,0xe8b(%rip),%xmm0
divpd  %xmm0,%xmm5
movapd %xmm5,%xmm0
unpckhpd %xmm5,%xmm0
movapd %xmm3,%xmm2
mulsd  %xmm5,%xmm2
subsd  %xmm0,%xmm5
divsd  0xe3b(%rip),%xmm5
divsd  0xe3b(%rip),%xmm2
mulsd  0xe3b(%rip),%xmm4
addsd  %xmm2,%xmm4
addsd  %xmm1,%xmm4
mulsd  0xe33(%rip),%xmm4
movapd %xmm5,%xmm0
mulsd  %xmm5,%xmm0
mulsd  %xmm5,%xmm0
movapd %xmm4,%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
ucomisd 0xdeb(%rip),%xmm1
jbe    1252 <cubic_roots+0x102>
movsd  0xde9(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    1252 <cubic_roots+0x102>
ucomisd 0xdd3(%rip),%xmm4
jbe    134f <cubic_roots+0x1ff>
ucomisd %xmm4,%xmm2
jbe    134f <cubic_roots+0x1ff>
movq   $0x0,(%rbx)
mov    $0x1,%eax
mov    $0x1,%dl
xor    %ecx,%ecx
jmp    13eb <cubic_roots+0x29b>
movsd  %xmm3,0x28(%rsp)
xorpd  %xmm2,%xmm2
ucomisd %xmm1,%xmm2
jbe    1390 <cubic_roots+0x240>
movapd 0xde2(%rip),%xmm1
xorpd  %xmm1,%xmm4
movapd %xmm4,0x10(%rsp)
xorpd  %xmm1,%xmm0
movapd %xmm5,0x30(%rsp)
call   1060 <sqrt@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movapd 0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
call   1030 <acos@plt>
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
movaps 0x30(%rsp),%xmm0
xorps  0xd84(%rip),%xmm0
call   1060 <sqrt@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <cos@plt>
movapd 0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx)
xorpd  0xd4f(%rip),%xmm1
movapd %xmm1,0x10(%rsp)
movsd  0xd21(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
call   1050 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rbx)
movsd  0x8(%rsp),%xmm0
addsd  0xd05(%rip),%xmm0
call   1050 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rbx)
mov    $0x3,%eax
xor    %edx,%edx
jmp    13e3 <cubic_roots+0x293>
xorpd  0xcf9(%rip),%xmm4
movapd %xmm4,%xmm0
movsd  %xmm3,0x28(%rsp)
call   1040 <cbrt@plt>
movsd  0x28(%rsp),%xmm3
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
xorpd  0xcd0(%rip),%xmm0
movlpd %xmm0,0x8(%rbx)
mov    $0x2,%eax
mov    $0x1,%cl
xor    %edx,%edx
jmp    13eb <cubic_roots+0x29b>
movapd %xmm1,%xmm0
movapd %xmm4,0x10(%rsp)
call   1060 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x30(%rsp)
subsd  0x10(%rsp),%xmm0
call   1040 <cbrt@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
call   1040 <cbrt@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
mov    $0x1,%eax
mov    $0x1,%dl
xor    %ecx,%ecx
movsd  0x28(%rsp),%xmm3
divsd  0xc1d(%rip),%xmm3
movsd  (%rbx),%xmm0
subsd  %xmm3,%xmm0
movsd  %xmm0,(%rbx)
test   %dl,%dl
jne    1423 <cubic_roots+0x2d3>
movsd  0x8(%rbx),%xmm0
subsd  %xmm3,%xmm0
movsd  %xmm0,0x8(%rbx)
test   %cl,%cl
jne    1423 <cubic_roots+0x2d3>
movsd  0x10(%rbx),%xmm0
subsd  %xmm3,%xmm0
movsd  %xmm0,0x10(%rbx)
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cubic_roots(double* %0, double* %1) {
%3 = getelementptr inbounds double, double* %0, i64 3
%4 = load double, double* %3
%5 = fcmp ogt double %4, -1.000000e-30
%6 = fcmp olt double %4, 1.000000e-30
%7 = and i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @quadratic_roots(double* %0, double* %1)
br label %100
10: ; preds = %2
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = fdiv double %12, %4
%14 = getelementptr inbounds double, double* %0, i64 1
%15 = load double, double* %14
%16 = load double, double* %0
%17 = fdiv double %16, %4
%18 = fmul double %13, %13
%19 = fmul double %13, %18
%20 = insertelement <2 x double> poison, double %15, i64 0
%21 = insertelement <2 x double> %20, double %18, i64 1
%22 = insertelement <2 x double> <double poison, double 3.000000e+00>, double %4, i64 0
%23 = fdiv <2 x double> %21, %22
%24 = extractelement <2 x double> %23, i64 0
%25 = shufflevector <2 x double> %23, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%26 = fsub <2 x double> %23, %25
%27 = extractelement <2 x double> %26, i64 0
%28 = fdiv double %27, 3.000000e+00
%29 = fmul double %13, %24
%30 = fdiv double %29, -3.000000e+00
%31 = tail call double @llvm.fmuladd.f64(double %19, double 0x3FB2F684BDA12F68, double %30)
%32 = fadd double %17, %31
%33 = fmul double %32, 5.000000e-01
%34 = fmul double %28, %28
%35 = fmul double %28, %34
%36 = tail call double @llvm.fmuladd.f64(double %33, double %33, double %35)
%37 = fcmp ogt double %36, -1.000000e-30
%38 = fcmp olt double %36, 1.000000e-30
%39 = and i1 %37, %38
br i1 %39, label %40, label %51
40: ; preds = %10
%41 = fcmp ogt double %33, -1.000000e-30
%42 = fcmp olt double %33, 1.000000e-30
%43 = and i1 %41, %42
br i1 %43, label %44, label %45
44: ; preds = %40
store double 0.000000e+00, double* %1
br label %85
45: ; preds = %40
%46 = fneg double %33
%47 = tail call double @cbrt(double %46)
%48 = fmul double %47, 2.000000e+00
store double %48, double* %1
%49 = fneg double %47
%50 = getelementptr inbounds double, double* %1, i64 1
store double %49, double* %50
br label %85
51: ; preds = %10
%52 = fcmp olt double %36, 0.000000e+00
br i1 %52, label %53, label %77
53: ; preds = %51
%54 = fneg double %33
%55 = fneg double %35
%56 = tail call i32 @sqrt(double %55)
%57 = sitofp i32 %56 to double
%58 = fdiv double %54, %57
%59 = tail call i32 @acos(double %58)
%60 = sdiv i32 %59, 3
%61 = sitofp i32 %60 to double
%62 = fneg double %28
%63 = tail call i32 @sqrt(double %62)
%64 = shl nsw i32 %63, 1
%65 = sitofp i32 %64 to double
%66 = tail call double @cos(double %61)
%67 = fmul double %66, %65
store double %67, double* %1
%68 = fneg double %65
%69 = fadd double %61, 0x3FF0C152382D7365
%70 = tail call double @cos(double %69)
%71 = fmul double %70, %68
%72 = getelementptr inbounds double, double* %1, i64 1
store double %71, double* %72
%73 = fadd double %61, 0xBFF0C152382D7365
%74 = tail call double @cos(double %73)
%75 = fmul double %74, %68
%76 = getelementptr inbounds double, double* %1, i64 2
store double %75, double* %76
br label %85
77: ; preds = %51
%78 = tail call i32 @sqrt(double %36)
%79 = sitofp i32 %78 to double
%80 = fsub double %79, %33
%81 = tail call double @cbrt(double %80)
%82 = fadd double %33, %79
%83 = tail call double @cbrt(double %82)
%84 = fsub double %81, %83
store double %84, double* %1
br label %85
85: ; preds = %53, %77, %44, %45
%86 = phi i1 [ false, %53 ], [ true, %77 ], [ true, %44 ], [ false, %45 ]
%87 = phi i1 [ false, %53 ], [ false, %77 ], [ false, %44 ], [ true, %45 ]
%88 = phi i32 [ 3, %53 ], [ 1, %77 ], [ 1, %44 ], [ 2, %45 ]
%89 = fdiv double %13, 3.000000e+00
%90 = load double, double* %1
%91 = fsub double %90, %89
store double %91, double* %1
br i1 %86, label %100, label %92
92: ; preds = %85
%93 = getelementptr inbounds double, double* %1, i64 1
%94 = load double, double* %93
%95 = fsub double %94, %89
store double %95, double* %93
br i1 %87, label %100, label %96
96: ; preds = %92
%97 = getelementptr inbounds double, double* %1, i64 2
%98 = load double, double* %97
%99 = fsub double %98, %89
store double %99, double* %97
br label %100
100: ; preds = %85, %92, %96, %8
%101 = phi i32 [ %9, %8 ], [ %88, %96 ], [ %88, %92 ], [ %88, %85 ]
ret i32 %101
}