#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 acos(long double);
int atan(int);
double cos(double);
scalar_t__ fabs(long double);
double pow(scalar_t__, int);
double sqrt(double);
void SolveCubic(double a, double b, double c, double d, int *solutions,
                double *x) {
  long double a1 = b / a, a2 = c / a, a3 = d / a;
  long double Q = (a1 * a1 - 3.0 * a2) / 9.0;
  long double R = (2.0 * a1 * a1 * a1 - 9.0 * a1 * a2 + 27.0 * a3) / 54.0;
  double R2_Q3 = R * R - Q * Q * Q;
  double theta;
  if (R2_Q3 <= 0) {
    *solutions = 3;
    theta = acos(R / sqrt(Q * Q * Q));
    x[0] = -2.0 * sqrt(Q) * cos(theta / 3.0) - a1 / 3.0;
    x[1] = -2.0 * sqrt(Q) * cos((theta + 2.0 * (4 * atan(1))) / 3.0) - a1 / 3.0;
    x[2] = -2.0 * sqrt(Q) * cos((theta + 4.0 * (4 * atan(1))) / 3.0) - a1 / 3.0;
  } else {
    *solutions = 1;
    x[0] = pow(sqrt(R2_Q3) + fabs(R), 1 / 3.0);
    x[0] += Q / x[0];
    x[0] *= (R < 0.0) ? 1 : -1;
    x[0] -= a1 / 3.0;
  }
}


x86 assembly (clang, -O0):
<SolveCubic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
fldl   -0x98(%rbp)
fstpt  -0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
fldl   -0xa0(%rbp)
fstpt  -0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
fldl   -0xa8(%rbp)
fstpt  -0x60(%rbp)
fldt   -0x40(%rbp)
fldt   -0x50(%rbp)
flds   0xe10(%rip)
fmulp  %st,%st(1)
fxch   %st(1)
fmul   %st,%st(0)
faddp  %st,%st(1)
flds   0xe06(%rip)
fdivr  %st,%st(1)
fxch   %st(1)
fstpt  -0x70(%rbp)
fldt   -0x40(%rbp)
fld    %st(0)
fadd   %st(1),%st
fmul   %st(1),%st
fxch   %st(2)
fmul   %st(1),%st
fldt   -0x50(%rbp)
fmulp  %st,%st(1)
fxch   %st(2)
fmulp  %st,%st(1)
fsubp  %st,%st(1)
fldt   -0x60(%rbp)
flds   0xde2(%rip)
fmulp  %st,%st(1)
faddp  %st,%st(1)
flds   0xddc(%rip)
fdivrp %st,%st(1)
fstpt  -0x80(%rbp)
fldt   -0x80(%rbp)
fldt   -0x70(%rbp)
fld    %st(0)
fmul   %st(1),%st
fmulp  %st,%st(1)
fxch   %st(1)
fmul   %st,%st(0)
fsubp  %st,%st(1)
fstpl  -0xb0(%rbp)
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x88(%rbp),%xmm0
ff
jb     14ae <SolveCubic+0x34e>
mov    -0x28(%rbp),%rax
movl   $0x3,(%rax)
fldt   -0x80(%rbp)
fstpt  -0x15c(%rbp)
fldt   -0x70(%rbp)
fld    %st(0)
fmul   %st(1),%st
fmulp  %st,%st(1)
fstpl  -0xc0(%rbp)
movsd  -0xc0(%rbp),%xmm0
ff
call   1080 <sqrt@plt>
fldt   -0x15c(%rbp)
movsd  %xmm0,-0xc8(%rbp)
ff
fldl   -0xc8(%rbp)
fdivrp %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <acos@plt>
movsd  %xmm0,-0x90(%rbp)
ff
fldt   -0x70(%rbp)
fstpl  -0xd0(%rbp)
movsd  -0xd0(%rbp),%xmm0
ff
call   1080 <sqrt@plt>
movsd  0xd35(%rip),%xmm1
movsd  %xmm1,-0x138(%rbp)
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  0xd19(%rip),%xmm1
movsd  %xmm1,-0x120(%rbp)
ff
divsd  %xmm1,%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x150(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
fldl   -0xd8(%rbp)
fldt   -0x40(%rbp)
flds   0xcd2(%rip)
fld    %st(0)
fstpt  -0x114(%rbp)
fdivrp %st,%st(1)
fsubrp %st,%st(1)
mov    -0x30(%rbp),%rax
fstpl  (%rax)
fldt   -0x70(%rbp)
fstpl  -0xe0(%rbp)
movsd  -0xe0(%rbp),%xmm0
ff
call   1080 <sqrt@plt>
movsd  -0x138(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x148(%rbp)
ff
mov    $0x1,%edi
mov    %edi,-0x12c(%rbp)
call   1050 <atan@plt>
movsd  -0x148(%rbp),%xmm2
ff
movsd  -0x120(%rbp),%xmm1
ff
shl    $0x2,%eax
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
call   1060 <cos@plt>
fldt   -0x114(%rbp)
movaps %xmm0,%xmm1
movsd  -0x140(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
fldl   -0xe8(%rbp)
fldt   -0x40(%rbp)
fdivp  %st,%st(2)
fsubp  %st,%st(1)
mov    -0x30(%rbp),%rax
fstpl  0x8(%rax)
fldt   -0x70(%rbp)
fstpl  -0xf0(%rbp)
movsd  -0xf0(%rbp),%xmm0
ff
call   1080 <sqrt@plt>
movsd  -0x138(%rbp),%xmm1
ff
mov    -0x12c(%rbp),%edi
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x128(%rbp)
ff
call   1050 <atan@plt>
movsd  -0x128(%rbp),%xmm2
ff
movsd  -0x120(%rbp),%xmm1
ff
shl    $0x2,%eax
cvtsi2sd %eax,%xmm0
movsd  0xbd1(%rip),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
call   1060 <cos@plt>
fldt   -0x114(%rbp)
movaps %xmm0,%xmm1
movsd  -0x108(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
fldl   -0xf8(%rbp)
fldt   -0x40(%rbp)
fdivp  %st,%st(2)
fsubp  %st,%st(1)
fstpl  -0x100(%rbp)
movsd  -0x100(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x10(%rax)
jmp    155c <SolveCubic+0x3fc>
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
movsd  -0x88(%rbp),%xmm0
ff
call   1080 <sqrt@plt>
movsd  %xmm0,-0x168(%rbp)
ff
fldt   -0x80(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <fabs@plt>
movsd  -0x168(%rbp),%xmm0
ff
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
xor    %esi,%esi
call   1070 <pow@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
fldt   -0x70(%rbp)
mov    -0x30(%rbp),%rax
fldl   (%rax)
fdivr  %st,%st(1)
faddp  %st,%st(1)
fstpl  (%rax)
fldt   -0x80(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
seta   %al
movzbl %al,%ecx
mov    %ecx,%eax
lea    -0x1(%rax,%rax,1),%eax
cvtsi2sd %eax,%xmm1
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
fldt   -0x40(%rbp)
flds   0xac0(%rip)
fdivrp %st,%st(1)
mov    -0x30(%rbp),%rax
fldl   (%rax)
faddp  %st,%st(1)
fstpl  -0xb8(%rbp)
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,(%rax)
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SolveCubic>:
push   %rbx
sub    $0xc0,%rsp
mov    %rsi,%rbx
divsd  %xmm0,%xmm1
movsd  %xmm1,0xb8(%rsp)
fldl   0xb8(%rsp)
divsd  %xmm0,%xmm2
movsd  %xmm2,0xb0(%rsp)
fldl   0xb0(%rsp)
divsd  %xmm0,%xmm3
movsd  %xmm3,0xa8(%rsp)
fldl   0xa8(%rsp)
fld    %st(1)
fmuls  0xe51(%rip)
fld    %st(3)
fmul   %st(4),%st
faddp  %st,%st(1)
fdivs  0xe49(%rip)
fld    %st(3)
fadd   %st(4),%st
fmul   %st(4),%st
fld    %st(4)
fmuls  0xe3f(%rip)
fmulp  %st,%st(4)
fld    %st(4)
fstpt  0x44(%rsp)
fmulp  %st,%st(4)
fxch   %st(3)
faddp  %st,%st(2)
fmuls  0xe2f(%rip)
faddp  %st,%st(1)
fdivs  0xe2b(%rip)
fld    %st(1)
fmul   %st(2),%st
fld    %st(2)
fstpt  0x28(%rsp)
fmulp  %st,%st(2)
fld    %st(0)
fmul   %st(1),%st
fsub   %st(2),%st
fstpl  0xa0(%rsp)
movsd  0xa0(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    122b <SolveCubic+0xcb>
fstp   %st(1)
movl   $0x1,(%rdi)
ucomisd %xmm1,%xmm0
fld    %st(0)
fstpt  0x18(%rsp)
jb     1256 <SolveCubic+0xf6>
sqrtsd %xmm0,%xmm0
jmp    1261 <SolveCubic+0x101>
movl   $0x3,(%rdi)
fxch   %st(1)
fstpl  0x98(%rsp)
movsd  0x98(%rsp),%xmm0
ucomisd %xmm1,%xmm0
jb     12d6 <SolveCubic+0x176>
sqrtsd %xmm0,%xmm0
jmp    12e3 <SolveCubic+0x183>
fstp   %st(0)
call   1080 <sqrt@plt>
fldt   0x18(%rsp)
movsd  %xmm0,0x38(%rsp)
fstpt  (%rsp)
call   1040 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x38(%rsp),%xmm0
cvttsd2si %xmm0,%rdi
xor    %esi,%esi
call   1070 <pow@plt>
movsd  %xmm0,0x68(%rsp)
fldl   0x68(%rsp)
fldt   0x28(%rsp)
fdiv   %st(1),%st
faddp  %st,%st(1)
fstpl  0x60(%rsp)
movsd  0x60(%rsp),%xmm0
fldz
fldt   0x18(%rsp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
ja     12bb <SolveCubic+0x15b>
xorpd  0xd85(%rip),%xmm0
fldt   0x44(%rsp)
fdivs  0xd3b(%rip)
movsd  %xmm0,0x58(%rsp)
faddl  0x58(%rsp)
fstpl  (%rbx)
jmp    1472 <SolveCubic+0x312>
fstpt  0x18(%rsp)
call   1080 <sqrt@plt>
fldt   0x18(%rsp)
movsd  %xmm0,0x90(%rsp)
fdivl  0x90(%rsp)
fstpt  (%rsp)
call   1030 <acos@plt>
movsd  %xmm0,0x38(%rsp)
fldt   0x28(%rsp)
fstpl  0x88(%rsp)
movsd  0x88(%rsp),%xmm1
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
xorpd  %xmm2,%xmm2
movsd  %xmm1,0x18(%rsp)
ucomisd %xmm2,%xmm1
movsd  %xmm0,0x28(%rsp)
jae    133d <SolveCubic+0x1dd>
movsd  0x18(%rsp),%xmm0
call   1080 <sqrt@plt>
mulsd  0xcd3(%rip),%xmm0
movsd  %xmm0,0x50(%rsp)
movsd  0x38(%rsp),%xmm0
divsd  0xcc7(%rip),%xmm0
call   1060 <cos@plt>
mulsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp)
fldt   0x44(%rsp)
fdivs  0xc9d(%rip)
fld    %st(0)
fstpt  0x44(%rsp)
fsubrl 0x80(%rsp)
fstpl  (%rbx)
movsd  0x18(%rsp),%xmm0
ucomisd 0xc9c(%rip),%xmm0
movsd  0x28(%rsp),%xmm0
jae    13a7 <SolveCubic+0x247>
movsd  0x18(%rsp),%xmm0
call   1080 <sqrt@plt>
mulsd  0xc69(%rip),%xmm0
movsd  %xmm0,0x50(%rsp)
mov    $0x1,%edi
call   1050 <atan@plt>
shl    $0x2,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
addsd  0x38(%rsp),%xmm0
divsd  0xc45(%rip),%xmm0
call   1060 <cos@plt>
mulsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x78(%rsp)
fldt   0x44(%rsp)
fsubrl 0x78(%rsp)
fstpl  0x8(%rbx)
xorpd  %xmm0,%xmm0
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jae    1418 <SolveCubic+0x2b8>
movsd  0x18(%rsp),%xmm0
call   1080 <sqrt@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x28(%rsp),%xmm0
mulsd  0xbf2(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
mov    $0x1,%edi
call   1050 <atan@plt>
shl    $0x2,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xbe0(%rip),%xmm0
addsd  0x38(%rsp),%xmm0
divsd  0xbca(%rip),%xmm0
call   1060 <cos@plt>
mulsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x70(%rsp)
fldt   0x44(%rsp)
fsubrl 0x70(%rsp)
fstpl  0x10(%rbx)
add    $0xc0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @SolveCubic(double %0, double %1, double %2, double %3, i32* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32*
%12 = alloca double*
%13 = alloca x86_fp80
%14 = alloca x86_fp80
%15 = alloca x86_fp80
%16 = alloca x86_fp80
%17 = alloca x86_fp80
%18 = alloca double
%19 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store i32* %4, i32** %11
store double* %5, double** %12
%20 = load double, double* %8
%21 = load double, double* %7
%22 = fdiv double %20, %21
%23 = fpext double %22 to x86_fp80
store x86_fp80 %23, x86_fp80* %13
%24 = load double, double* %9
%25 = load double, double* %7
%26 = fdiv double %24, %25
%27 = fpext double %26 to x86_fp80
store x86_fp80 %27, x86_fp80* %14
%28 = load double, double* %10
%29 = load double, double* %7
%30 = fdiv double %28, %29
%31 = fpext double %30 to x86_fp80
store x86_fp80 %31, x86_fp80* %15
%32 = load x86_fp80, x86_fp80* %13
%33 = load x86_fp80, x86_fp80* %13
%34 = load x86_fp80, x86_fp80* %14
%35 = fmul x86_fp80 0xK4000C000000000000000, %34
%36 = fneg x86_fp80 %35
%37 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %32, x86_fp80 %33, x86_fp80 %36)
%38 = fdiv x86_fp80 %37, 0xK40029000000000000000
store x86_fp80 %38, x86_fp80* %16
%39 = load x86_fp80, x86_fp80* %13
%40 = fmul x86_fp80 0xK40008000000000000000, %39
%41 = load x86_fp80, x86_fp80* %13
%42 = fmul x86_fp80 %40, %41
%43 = load x86_fp80, x86_fp80* %13
%44 = load x86_fp80, x86_fp80* %13
%45 = fmul x86_fp80 0xK40029000000000000000, %44
%46 = load x86_fp80, x86_fp80* %14
%47 = fmul x86_fp80 %45, %46
%48 = fneg x86_fp80 %47
%49 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %42, x86_fp80 %43, x86_fp80 %48)
%50 = load x86_fp80, x86_fp80* %15
%51 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 0xK4003D800000000000000, x86_fp80 %50, x86_fp80 %49)
%52 = fdiv x86_fp80 %51, 0xK4004D800000000000000
store x86_fp80 %52, x86_fp80* %17
%53 = load x86_fp80, x86_fp80* %17
%54 = load x86_fp80, x86_fp80* %17
%55 = load x86_fp80, x86_fp80* %16
%56 = load x86_fp80, x86_fp80* %16
%57 = fmul x86_fp80 %55, %56
%58 = load x86_fp80, x86_fp80* %16
%59 = fmul x86_fp80 %57, %58
%60 = fneg x86_fp80 %59
%61 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %53, x86_fp80 %54, x86_fp80 %60)
%62 = fptrunc x86_fp80 %61 to double
store double %62, double* %18
%63 = load double, double* %18
%64 = fcmp ole double %63, 0.000000e+00
br i1 %64, label %65, label %131
65: ; preds = %6
%66 = load i32*, i32** %11
store i32 3, i32* %66
%67 = load x86_fp80, x86_fp80* %17
%68 = load x86_fp80, x86_fp80* %16
%69 = load x86_fp80, x86_fp80* %16
%70 = fmul x86_fp80 %68, %69
%71 = load x86_fp80, x86_fp80* %16
%72 = fmul x86_fp80 %70, %71
%73 = fptrunc x86_fp80 %72 to double
%74 = call double @sqrt(double %73)
%75 = fpext double %74 to x86_fp80
%76 = fdiv x86_fp80 %67, %75
%77 = call double @acos(x86_fp80 %76)
store double %77, double* %19
%78 = load x86_fp80, x86_fp80* %16
%79 = fptrunc x86_fp80 %78 to double
%80 = call double @sqrt(double %79)
%81 = fmul double -2.000000e+00, %80
%82 = load double, double* %19
%83 = fdiv double %82, 3.000000e+00
%84 = call double @cos(double %83)
%85 = fmul double %81, %84
%86 = fpext double %85 to x86_fp80
%87 = load x86_fp80, x86_fp80* %13
%88 = fdiv x86_fp80 %87, 0xK4000C000000000000000
%89 = fsub x86_fp80 %86, %88
%90 = fptrunc x86_fp80 %89 to double
%91 = load double*, double** %12
%92 = getelementptr inbounds double, double* %91, i64 0
store double %90, double* %92
%93 = load x86_fp80, x86_fp80* %16
%94 = fptrunc x86_fp80 %93 to double
%95 = call double @sqrt(double %94)
%96 = fmul double -2.000000e+00, %95
%97 = load double, double* %19
%98 = call i32 @atan(i32 1)
%99 = mul nsw i32 4, %98
%100 = sitofp i32 %99 to double
%101 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %100, double %97)
%102 = fdiv double %101, 3.000000e+00
%103 = call double @cos(double %102)
%104 = fmul double %96, %103
%105 = fpext double %104 to x86_fp80
%106 = load x86_fp80, x86_fp80* %13
%107 = fdiv x86_fp80 %106, 0xK4000C000000000000000
%108 = fsub x86_fp80 %105, %107
%109 = fptrunc x86_fp80 %108 to double
%110 = load double*, double** %12
%111 = getelementptr inbounds double, double* %110, i64 1
store double %109, double* %111
%112 = load x86_fp80, x86_fp80* %16
%113 = fptrunc x86_fp80 %112 to double
%114 = call double @sqrt(double %113)
%115 = fmul double -2.000000e+00, %114
%116 = load double, double* %19
%117 = call i32 @atan(i32 1)
%118 = mul nsw i32 4, %117
%119 = sitofp i32 %118 to double
%120 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %119, double %116)
%121 = fdiv double %120, 3.000000e+00
%122 = call double @cos(double %121)
%123 = fmul double %115, %122
%124 = fpext double %123 to x86_fp80
%125 = load x86_fp80, x86_fp80* %13
%126 = fdiv x86_fp80 %125, 0xK4000C000000000000000
%127 = fsub x86_fp80 %124, %126
%128 = fptrunc x86_fp80 %127 to double
%129 = load double*, double** %12
%130 = getelementptr inbounds double, double* %129, i64 2
store double %128, double* %130
br label %172
131: ; preds = %6
%132 = load i32*, i32** %11
store i32 1, i32* %132
%133 = load double, double* %18
%134 = call double @sqrt(double %133)
%135 = load x86_fp80, x86_fp80* %17
%136 = call i64 @fabs(x86_fp80 %135)
%137 = sitofp i64 %136 to double
%138 = fadd double %134, %137
%139 = fptosi double %138 to i64
%140 = call double @pow(i64 %139, i32 0)
%141 = load double*, double** %12
%142 = getelementptr inbounds double, double* %141, i64 0
store double %140, double* %142
%143 = load x86_fp80, x86_fp80* %16
%144 = load double*, double** %12
%145 = getelementptr inbounds double, double* %144, i64 0
%146 = load double, double* %145
%147 = fpext double %146 to x86_fp80
%148 = fdiv x86_fp80 %143, %147
%149 = load double*, double** %12
%150 = getelementptr inbounds double, double* %149, i64 0
%151 = load double, double* %150
%152 = fpext double %151 to x86_fp80
%153 = fadd x86_fp80 %152, %148
%154 = fptrunc x86_fp80 %153 to double
store double %154, double* %150
%155 = load x86_fp80, x86_fp80* %17
%156 = fcmp olt x86_fp80 %155, 0xK00000000000000000000
%157 = zext i1 %156 to i64
%158 = select i1 %156, i32 1, i32 -1
%159 = sitofp i32 %158 to double
%160 = load double*, double** %12
%161 = getelementptr inbounds double, double* %160, i64 0
%162 = load double, double* %161
%163 = fmul double %162, %159
store double %163, double* %161
%164 = load x86_fp80, x86_fp80* %13
%165 = fdiv x86_fp80 %164, 0xK4000C000000000000000
%166 = load double*, double** %12
%167 = getelementptr inbounds double, double* %166, i64 0
%168 = load double, double* %167
%169 = fpext double %168 to x86_fp80
%170 = fsub x86_fp80 %169, %165
%171 = fptrunc x86_fp80 %170 to double
store double %171, double* %167
br label %172
172: ; preds = %131, %65
ret void
}

LLVM IR (-O2):
define void @SolveCubic(double %0, double %1, double %2, double %3, i32* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = fdiv double %1, %0
%8 = fpext double %7 to x86_fp80
%9 = fdiv double %2, %0
%10 = fpext double %9 to x86_fp80
%11 = fdiv double %3, %0
%12 = fpext double %11 to x86_fp80
%13 = fmul x86_fp80 %10, 0xKC000C000000000000000
%14 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %8, x86_fp80 %8, x86_fp80 %13)
%15 = fdiv x86_fp80 %14, 0xK40029000000000000000
%16 = fmul x86_fp80 %8, 0xK40008000000000000000
%17 = fmul x86_fp80 %16, %8
%18 = fmul x86_fp80 %8, 0xKC0029000000000000000
%19 = fmul x86_fp80 %18, %10
%20 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %17, x86_fp80 %8, x86_fp80 %19)
%21 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %12, x86_fp80 0xK4003D800000000000000, x86_fp80 %20)
%22 = fdiv x86_fp80 %21, 0xK4004D800000000000000
%23 = fmul x86_fp80 %15, %15
%24 = fmul x86_fp80 %15, %23
%25 = fneg x86_fp80 %24
%26 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %22, x86_fp80 %22, x86_fp80 %25)
%27 = fptrunc x86_fp80 %26 to double
%28 = fcmp ugt double %27, 0.000000e+00
br i1 %28, label %71, label %29
29: ; preds = %6
store i32 3, i32* %4
%30 = fptrunc x86_fp80 %24 to double
%31 = tail call double @sqrt(double %30)
%32 = fpext double %31 to x86_fp80
%33 = fdiv x86_fp80 %22, %32
%34 = tail call double @acos(x86_fp80 %33)
%35 = fptrunc x86_fp80 %15 to double
%36 = tail call double @sqrt(double %35)
%37 = fmul double %36, -2.000000e+00
%38 = fdiv double %34, 3.000000e+00
%39 = tail call double @cos(double %38)
%40 = fmul double %37, %39
%41 = fpext double %40 to x86_fp80
%42 = fdiv x86_fp80 %8, 0xK4000C000000000000000
%43 = fsub x86_fp80 %41, %42
%44 = fptrunc x86_fp80 %43 to double
store double %44, double* %5
%45 = tail call double @sqrt(double %35)
%46 = fmul double %45, -2.000000e+00
%47 = tail call i32 @atan(i32 1)
%48 = shl nsw i32 %47, 2
%49 = sitofp i32 %48 to double
%50 = tail call double @llvm.fmuladd.f64(double %49, double 2.000000e+00, double %34)
%51 = fdiv double %50, 3.000000e+00
%52 = tail call double @cos(double %51)
%53 = fmul double %46, %52
%54 = fpext double %53 to x86_fp80
%55 = fsub x86_fp80 %54, %42
%56 = fptrunc x86_fp80 %55 to double
%57 = getelementptr inbounds double, double* %5, i64 1
store double %56, double* %57
%58 = tail call double @sqrt(double %35)
%59 = fmul double %58, -2.000000e+00
%60 = tail call i32 @atan(i32 1)
%61 = shl nsw i32 %60, 2
%62 = sitofp i32 %61 to double
%63 = tail call double @llvm.fmuladd.f64(double %62, double 4.000000e+00, double %34)
%64 = fdiv double %63, 3.000000e+00
%65 = tail call double @cos(double %64)
%66 = fmul double %59, %65
%67 = fpext double %66 to x86_fp80
%68 = fsub x86_fp80 %67, %42
%69 = fptrunc x86_fp80 %68 to double
%70 = getelementptr inbounds double, double* %5, i64 2
store double %69, double* %70
br label %89
71: ; preds = %6
store i32 1, i32* %4
%72 = tail call double @sqrt(double %27)
%73 = tail call i64 @fabs(x86_fp80 %22)
%74 = sitofp i64 %73 to double
%75 = fadd double %72, %74
%76 = fptosi double %75 to i64
%77 = tail call double @pow(i64 %76, i32 0)
%78 = fpext double %77 to x86_fp80
%79 = fdiv x86_fp80 %15, %78
%80 = fadd x86_fp80 %79, %78
%81 = fptrunc x86_fp80 %80 to double
%82 = fcmp olt x86_fp80 %22, 0xK00000000000000000000
%83 = fneg double %81
%84 = select i1 %82, double %81, double %83
%85 = fdiv x86_fp80 %8, 0xK4000C000000000000000
%86 = fpext double %84 to x86_fp80
%87 = fsub x86_fp80 %86, %85
%88 = fptrunc x86_fp80 %87 to double
store double %88, double* %5
br label %89
89: ; preds = %71, %29
ret void
}