#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 */
double atan2(double, double);
double cos(double);
int pow(double, double);
int solve2(double *, double *);
double sqrt(double);
int solve3(double *coeff, double *roots) {
  double a, b, c, d;
  int rootn, i;
  double p, q, disc, b_over_3a, c_over_a, d_over_a;
  double r, theta, temp, alpha, beta;
  a = coeff[3], b = coeff[2], c = coeff[1], d = coeff[0];
  if ((((a) < 1E-7) && ((a) > -1E-7)))
    return solve2(coeff, roots);
  b_over_3a = b / (3 * a);
  c_over_a = c / a;
  d_over_a = d / a;
  p = b_over_3a * b_over_3a;
  q = 2 * b_over_3a * p - b_over_3a * c_over_a + d_over_a;
  p = c_over_a / 3 - p;
  disc = q * q + 4 * p * p * p;
  if (disc < 0) {
    r = .5 * sqrt(-disc + q * q);
    theta = atan2(sqrt(-disc), -q);
    temp = 2 * ((r < 0) ? (-1 * pow(-r, 1.0 / 3.0)) : pow(r, 1.0 / 3.0));
    roots[0] = temp * cos(theta / 3);
    roots[1] =
        temp *
        cos((theta + 3.14159265358979323846 + 3.14159265358979323846) / 3);
    roots[2] =
        temp *
        cos((theta - 3.14159265358979323846 - 3.14159265358979323846) / 3);
    rootn = 3;
  } else {
    alpha = .5 * (sqrt(disc) - q);
    beta = -q - alpha;
    roots[0] =
        ((alpha < 0) ? (-1 * pow(-alpha, 1.0 / 3.0)) : pow(alpha, 1.0 / 3.0)) +
        ((beta < 0) ? (-1 * pow(-beta, 1.0 / 3.0)) : pow(beta, 1.0 / 3.0));
    if (disc > 0)
      rootn = 1;
    else
      roots[1] = roots[2] = -.5 * roots[0], rootn = 3;
  }
  for (i = 0; i < rootn; i++)
    roots[i] -= b_over_3a;
  return rootn;
}


x86 assembly (clang, -O0):
<solve3>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe5e(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    11d9 <solve3+0x89>
movsd  -0x20(%rbp),%xmm0
movsd  0xe4e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11d9 <solve3+0x89>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1070 <solve2@plt>
mov    %eax,-0x4(%rbp)
jmp    1689 <solve3+0x539>
movsd  -0x28(%rbp),%xmm0
movsd  0xe32(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x38(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xdf7(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0xda5(%rip),%xmm1
divsd  %xmm1,%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  0xd7d(%rip),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    14b1 <solve3+0x361>
movsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xd2d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1060 <sqrt@plt>
movsd  -0x50(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    1393 <solve3+0x243>
movsd  -0x78(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xcb3(%rip),%xmm1
call   1050 <pow@plt>
imul   $0xffffffff,%eax,%eax
mov    %eax,-0x9c(%rbp)
jmp    13ab <solve3+0x25b>
movsd  -0x78(%rbp),%xmm0
movsd  0xc90(%rip),%xmm1
call   1050 <pow@plt>
mov    %eax,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  0xc3b(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xc2b(%rip),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  0xc1e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xbea(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  0xbd4(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xbc8(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xb94(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movl   $0x3,-0x3c(%rbp)
jmp    1647 <solve3+0x4f7>
movsd  -0x58(%rbp),%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
subsd  -0x50(%rbp),%xmm1
movsd  0xb5d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
subsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x90(%rbp),%xmm0
ff
jbe    1551 <solve3+0x401>
movsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xaf5(%rip),%xmm1
call   1050 <pow@plt>
imul   $0xffffffff,%eax,%eax
mov    %eax,-0xbc(%rbp)
jmp    156c <solve3+0x41c>
movsd  -0x90(%rbp),%xmm0
ff
movsd  0xacf(%rip),%xmm1
call   1050 <pow@plt>
mov    %eax,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
mov    %eax,-0xc0(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jbe    15c6 <solve3+0x476>
movsd  -0x98(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xa80(%rip),%xmm1
call   1050 <pow@plt>
imul   $0xffffffff,%eax,%eax
mov    %eax,-0xc4(%rbp)
jmp    15e1 <solve3+0x491>
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xa5a(%rip),%xmm1
call   1050 <pow@plt>
mov    %eax,-0xc4(%rbp)
mov    -0xc0(%rbp),%eax
mov    -0xc4(%rbp),%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1619 <solve3+0x4c9>
movl   $0x1,-0x3c(%rbp)
jmp    1642 <solve3+0x4f2>
mov    -0x18(%rbp),%rax
movsd  0xa13(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movl   $0x3,-0x3c(%rbp)
jmp    1647 <solve3+0x4f7>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    1683 <solve3+0x533>
movsd  -0x60(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    164e <solve3+0x4fe>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve3>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
movsd  0x18(%rdi),%xmm1
movsd  0xe9a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1184 <solve3+0x34>
ucomisd 0xe94(%rip),%xmm1
jbe    1184 <solve3+0x34>
mov    %rbx,%rsi
add    $0x28,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <solve2@plt>
movsd  (%rdi),%xmm2
movsd  0x8(%rdi),%xmm0
movsd  0x10(%rdi),%xmm4
movsd  0xe76(%rip),%xmm5
movapd %xmm1,%xmm3
mulsd  %xmm5,%xmm3
divsd  %xmm3,%xmm4
divsd  %xmm1,%xmm0
divsd  %xmm1,%xmm2
movapd %xmm4,%xmm1
mulsd  %xmm4,%xmm1
movapd %xmm4,%xmm6
addsd  %xmm4,%xmm6
movapd %xmm0,%xmm3
movsd  %xmm4,0x20(%rsp)
mulsd  %xmm4,%xmm3
mulsd  %xmm1,%xmm6
subsd  %xmm3,%xmm6
addsd  %xmm2,%xmm6
divsd  %xmm5,%xmm0
subsd  %xmm1,%xmm0
movsd  0xe30(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm6,%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm2,%xmm1
jbe    1227 <solve3+0xd7>
subsd  %xmm2,%xmm0
xorpd  0xe3a(%rip),%xmm2
ucomisd %xmm1,%xmm0
movapd %xmm6,(%rsp)
jb     123c <solve3+0xec>
sqrtsd %xmm0,%xmm0
jmp    124d <solve3+0xfd>
ucomisd %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
jb     126e <solve3+0x11e>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1281 <solve3+0x131>
movapd %xmm2,0x10(%rsp)
call   1060 <sqrt@plt>
movapd 0x10(%rsp),%xmm2
mulsd  0xdcb(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     12c3 <solve3+0x173>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    12cc <solve3+0x17c>
movapd %xmm2,%xmm0
movapd %xmm6,(%rsp)
call   1060 <sqrt@plt>
movapd (%rsp),%xmm6
subsd  %xmm6,%xmm0
mulsd  0xd93(%rip),%xmm0
xorpd  0xdbb(%rip),%xmm6
subsd  %xmm0,%xmm6
movapd %xmm6,(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    130c <solve3+0x1bc>
xorpd  0xda0(%rip),%xmm0
movsd  0xd70(%rip),%xmm1
call   1050 <pow@plt>
mov    %eax,%ebp
neg    %ebp
jmp    131b <solve3+0x1cb>
movapd %xmm2,%xmm0
call   1060 <sqrt@plt>
movapd (%rsp),%xmm1
xorpd  0xd77(%rip),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,(%rsp)
movapd 0x10(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    134a <solve3+0x1fa>
xorpd  0xd55(%rip),%xmm0
movsd  0xd25(%rip),%xmm1
call   1050 <pow@plt>
neg    %eax
jmp    1357 <solve3+0x207>
movsd  0xd14(%rip),%xmm1
call   1050 <pow@plt>
mov    %eax,%ebp
xorpd  %xmm1,%xmm1
movapd (%rsp),%xmm0
ucomisd %xmm0,%xmm1
jbe    13ec <solve3+0x29c>
xorpd  0xd1a(%rip),%xmm0
movsd  0xcea(%rip),%xmm1
call   1050 <pow@plt>
neg    %eax
jmp    13f9 <solve3+0x2a9>
movsd  0xcd6(%rip),%xmm1
call   1050 <pow@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
movsd  0xc9d(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0xcaa(%rip),%xmm1
movsd  (%rsp),%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
divsd  0xc6d(%rip),%xmm0
call   1040 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rbx)
movsd  0xc85(%rip),%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
addsd  %xmm0,%xmm1
divsd  0xc40(%rip),%xmm1
movapd %xmm1,%xmm0
call   1040 <cos@plt>
mulsd  0x10(%rsp),%xmm0
mov    $0x2,%eax
movsd  0x20(%rsp),%xmm2
jmp    1437 <solve3+0x2e7>
movsd  0xc34(%rip),%xmm1
call   1050 <pow@plt>
add    %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rbx)
xorpd  %xmm1,%xmm1
movapd 0x10(%rsp),%xmm2
ucomisd %xmm1,%xmm2
movsd  0x20(%rsp),%xmm2
jbe    1425 <solve3+0x2d5>
mov    $0x1,%eax
mov    $0x1,%cl
jmp    1443 <solve3+0x2f3>
mulsd  0xc03(%rip),%xmm0
movsd  %xmm0,0x10(%rbx)
mov    $0x1,%eax
movsd  %xmm0,(%rbx,%rax,8)
mov    $0x3,%eax
xor    %ecx,%ecx
movsd  (%rbx),%xmm0
subsd  %xmm2,%xmm0
movsd  %xmm0,(%rbx)
test   %cl,%cl
jne    146f <solve3+0x31f>
movsd  0x8(%rbx),%xmm0
movsd  0x10(%rbx),%xmm1
subsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rbx)
subsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rbx)
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

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

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