#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(double);
double cos(double);
scalar_t__ fabs(double);
double pow(scalar_t__, double);
double sqrt(double);
int gsl_poly_solve_cubic(double a, double b, double c, double *x0, double *x1,
                         double *x2) {
  double q = (a * a - 3 * b);
  double r = (2 * a * a * a - 9 * a * b + 27 * c);
  double Q = q / 9;
  double R = r / 54;
  double Q3 = Q * Q * Q;
  double R2 = R * R;
  double CR2 = 729 * r * r;
  double CQ3 = 2916 * q * q * q;
  if (R == 0 && Q == 0) {
    *x0 = -a / 3;
    *x1 = -a / 3;
    *x2 = -a / 3;
    return 3;
  } else if (CR2 == CQ3) {
    double sqrtQ = sqrt(Q);
    if (R > 0) {
      *x0 = -2 * sqrtQ - a / 3;
      *x1 = sqrtQ - a / 3;
      *x2 = sqrtQ - a / 3;
    } else {
      *x0 = -sqrtQ - a / 3;
      *x1 = -sqrtQ - a / 3;
      *x2 = 2 * sqrtQ - a / 3;
    }
    return 3;
  } else if (CR2 < CQ3) {
    double sqrtQ = sqrt(Q);
    double sqrtQ3 = sqrtQ * sqrtQ * sqrtQ;
    double theta = acos(R / sqrtQ3);
    double norm = -2 * sqrtQ;
    *x0 = norm * cos(theta / 3) - a / 3;
    *x1 =
        norm * cos((theta + 2.0 * 3.14159265358979323846264338327) / 3) - a / 3;
    *x2 =
        norm * cos((theta - 2.0 * 3.14159265358979323846264338327) / 3) - a / 3;
    if (*x0 > *x1)
      do {
        double tmp = *x1;
        *x1 = *x0;
        *x0 = tmp;
      } while (0);
    if (*x1 > *x2) {
      do {
        double tmp = *x2;
        *x2 = *x1;
        *x1 = tmp;
      } while (0);
      if (*x0 > *x1)
        do {
          double tmp = *x1;
          *x1 = *x0;
          *x0 = tmp;
        } while (0);
    }
    return 3;
  } else {
    double sgnR = (R >= 0 ? 1 : -1);
    double A = -sgnR * pow(fabs(R) + sqrt(R2 - Q3), 1.0 / 3.0);
    double B = Q / A;
    *x0 = A + B - a / 3;
    return 1;
  }
}


x86 assembly (clang, -O0):
<gsl_poly_solve_cubic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xea8(%rip),%xmm1
mulsd  -0x18(%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  0xe6f(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xe48(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  0xe1a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xdf8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xdda(%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
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xd9e(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xd7f(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1361 <gsl_poly_solve_cubic+0x211>
jp     1361 <gsl_poly_solve_cubic+0x211>
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1361 <gsl_poly_solve_cubic+0x211>
jp     1361 <gsl_poly_solve_cubic+0x211>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd47(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd17(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xce7(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x3,-0x4(%rbp)
jmp    1898 <gsl_poly_solve_cubic+0x748>
movsd  -0x70(%rbp),%xmm0
ucomisd -0x78(%rbp),%xmm0
jne    14d9 <gsl_poly_solve_cubic+0x389>
jp     14d9 <gsl_poly_solve_cubic+0x389>
movsd  -0x50(%rbp),%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    141e <gsl_poly_solve_cubic+0x2ce>
movsd  -0x80(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xc86(%rip),%xmm2
divsd  %xmm2,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x80(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xc49(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x80(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xc27(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    14cd <gsl_poly_solve_cubic+0x37d>
movsd  -0x80(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xbe9(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x80(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xbb0(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x80(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xb8e(%rip),%xmm2
divsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x3,-0x4(%rbp)
jmp    1898 <gsl_poly_solve_cubic+0x748>
movsd  -0x70(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    17a5 <gsl_poly_solve_cubic+0x655>
movsd  -0x50(%rbp),%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
divsd  -0x90(%rbp),%xmm0
ff
call   1030 <acos@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xb07(%rip),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xabf(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0xe8(%rbp),%xmm0
ff
movsd  -0x10(%rbp),%xmm1
movsd  0xa9e(%rip),%xmm3
divsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  0xa6b(%rip),%xmm0
addsd  -0x98(%rbp),%xmm0
ff
movsd  0xa4b(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0xe0(%rbp),%xmm0
ff
movsd  -0x10(%rbp),%xmm1
movsd  0xa2a(%rip),%xmm3
divsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  0x9ef(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0x9d3(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0xd8(%rbp),%xmm0
ff
movsd  -0x10(%rbp),%xmm1
movsd  0x9b2(%rip),%xmm3
divsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    16f9 <gsl_poly_solve_cubic+0x5a9>
jmp    16c4 <gsl_poly_solve_cubic+0x574>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xa8(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    16f9 <gsl_poly_solve_cubic+0x5a9>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1799 <gsl_poly_solve_cubic+0x649>
jmp    1714 <gsl_poly_solve_cubic+0x5c4>
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xb0(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1794 <gsl_poly_solve_cubic+0x644>
jmp    175f <gsl_poly_solve_cubic+0x60f>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xb8(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1794 <gsl_poly_solve_cubic+0x644>
jmp    1799 <gsl_poly_solve_cubic+0x649>
movl   $0x3,-0x4(%rbp)
jmp    1898 <gsl_poly_solve_cubic+0x748>
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmovae %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xf8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
movsd  0x805(%rip),%xmm0
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xf0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
divsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
addsd  -0xd0(%rbp),%xmm0
ff
movsd  -0x10(%rbp),%xmm1
movsd  0x7af(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsl_poly_solve_cubic>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
movapd %xmm0,%xmm5
movsd  0xe92(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm0,%xmm0
mulsd  %xmm5,%xmm0
movsd  0xe86(%rip),%xmm4
mulsd  %xmm5,%xmm4
mulsd  %xmm1,%xmm4
mulsd  %xmm5,%xmm0
addsd  %xmm4,%xmm0
unpcklpd %xmm0,%xmm3
movapd %xmm5,%xmm1
unpcklpd %xmm2,%xmm1
movapd 0xeaa(%rip),%xmm4
movsd  %xmm5,%xmm4
mulpd  %xmm1,%xmm4
addpd  %xmm3,%xmm4
movapd %xmm4,%xmm0
divpd  0xea2(%rip),%xmm0
xorpd  %xmm1,%xmm1
cmpeqpd %xmm0,%xmm1
movmskpd %xmm1,%eax
cmp    $0x3,%al
jne    11ef <gsl_poly_solve_cubic+0x9f>
divsd  0xe29(%rip),%xmm5
movsd  %xmm5,(%r14)
movsd  %xmm5,(%rbx)
movsd  %xmm5,(%r15)
mov    $0x3,%eax
jmp    14ce <gsl_poly_solve_cubic+0x37e>
movapd %xmm0,%xmm3
unpckhpd %xmm0,%xmm3
movapd %xmm4,%xmm2
unpckhpd %xmm4,%xmm2
movsd  0xe09(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe01(%rip),%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm4,%xmm2
ucomisd %xmm2,%xmm1
jne    126a <gsl_poly_solve_cubic+0x11a>
jp     126a <gsl_poly_solve_cubic+0x11a>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     128d <gsl_poly_solve_cubic+0x13d>
sqrtsd %xmm0,%xmm0
ucomisd %xmm1,%xmm3
ja     12b2 <gsl_poly_solve_cubic+0x162>
movapd 0xe39(%rip),%xmm1
xorpd  %xmm0,%xmm1
divsd  0xddd(%rip),%xmm5
subsd  %xmm5,%xmm1
movsd  %xmm1,(%r14)
movsd  %xmm1,(%rbx)
addsd  %xmm0,%xmm0
subsd  %xmm5,%xmm0
jmp    12d7 <gsl_poly_solve_cubic+0x187>
ucomisd %xmm1,%xmm2
movapd %xmm5,0x10(%rsp)
jbe    12e6 <gsl_poly_solve_cubic+0x196>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     135c <gsl_poly_solve_cubic+0x20c>
sqrtsd %xmm0,%xmm0
jmp    136b <gsl_poly_solve_cubic+0x21b>
movapd %xmm5,0x10(%rsp)
movapd %xmm3,(%rsp)
call   1070 <sqrt@plt>
xorpd  %xmm1,%xmm1
movapd (%rsp),%xmm3
movapd 0x10(%rsp),%xmm5
ucomisd %xmm1,%xmm3
jbe    123f <gsl_poly_solve_cubic+0xef>
divsd  0xd76(%rip),%xmm5
movsd  0xd66(%rip),%xmm1
mulsd  %xmm0,%xmm1
subsd  %xmm5,%xmm1
movsd  %xmm1,(%r14)
subsd  %xmm5,%xmm0
movsd  %xmm0,(%rbx)
movsd  %xmm0,(%r15)
mov    $0x3,%eax
jmp    14ce <gsl_poly_solve_cubic+0x37e>
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm0,(%rsp)
mulsd  %xmm0,%xmm1
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
subsd  %xmm1,%xmm0
movapd %xmm0,0x30(%rsp)
xorpd  %xmm0,%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm3
setae  %al
lea    0xd53(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
xorps  0xd57(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movapd %xmm3,%xmm0
call   1040 <fabs@plt>
movapd 0x30(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
ucomisd 0xcfb(%rip),%xmm0
jb     1478 <gsl_poly_solve_cubic+0x328>
sqrtsd %xmm0,%xmm0
jmp    1489 <gsl_poly_solve_cubic+0x339>
movapd %xmm3,(%rsp)
call   1070 <sqrt@plt>
movapd (%rsp),%xmm3
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
divsd  %xmm0,%xmm3
movapd %xmm3,%xmm0
call   1030 <acos@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
mulsd  0xc88(%rip),%xmm0
movsd  %xmm0,(%rsp)
divsd  0xc83(%rip),%xmm1
movapd %xmm1,%xmm0
call   1050 <cos@plt>
movapd 0x10(%rsp),%xmm1
divsd  0xc3c(%rip),%xmm1
movapd %xmm1,0x10(%rsp)
mulsd  (%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
movsd  0xc58(%rip),%xmm0
addsd  0x20(%rsp),%xmm0
divsd  0xc42(%rip),%xmm0
call   1050 <cos@plt>
mulsd  (%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x20(%rsp),%xmm0
addsd  0xc30(%rip),%xmm0
divsd  0xc18(%rip),%xmm0
call   1050 <cos@plt>
mulsd  (%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r15)
movsd  (%r14),%xmm2
movsd  (%rbx),%xmm1
ucomisd %xmm1,%xmm2
jbe    144e <gsl_poly_solve_cubic+0x2fe>
movsd  %xmm2,(%rbx)
movsd  %xmm1,(%r14)
movsd  (%rbx),%xmm1
movsd  (%r15),%xmm0
mov    $0x3,%eax
ucomisd %xmm0,%xmm1
jbe    14ce <gsl_poly_solve_cubic+0x37e>
movsd  %xmm1,(%r15)
movsd  %xmm0,(%rbx)
movsd  (%r14),%xmm1
ucomisd %xmm0,%xmm1
jbe    14ce <gsl_poly_solve_cubic+0x37e>
movsd  %xmm1,(%rbx)
movsd  %xmm0,(%r14)
jmp    14ce <gsl_poly_solve_cubic+0x37e>
movsd  %xmm1,0x30(%rsp)
call   1070 <sqrt@plt>
movsd  0x30(%rsp),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
movsd  0xb86(%rip),%xmm0
call   1060 <pow@plt>
mulsd  0x20(%rsp),%xmm0
movapd (%rsp),%xmm2
divsd  %xmm0,%xmm2
movapd 0x10(%rsp),%xmm1
divsd  0xb44(%rip),%xmm1
addsd  %xmm0,%xmm2
addsd  %xmm2,%xmm1
movsd  %xmm1,(%r14)
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @gsl_poly_solve_cubic(double %0, double %1, double %2, double* %3, double* %4, double* %5) {
%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
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double* %3, double** %11
store double* %4, double** %12
store double* %5, double** %13
%33 = load double, double* %8
%34 = load double, double* %8
%35 = load double, double* %9
%36 = fmul double 3.000000e+00, %35
%37 = fneg double %36
%38 = call double @llvm.fmuladd.f64(double %33, double %34, double %37)
store double %38, double* %14
%39 = load double, double* %8
%40 = fmul double 2.000000e+00, %39
%41 = load double, double* %8
%42 = fmul double %40, %41
%43 = load double, double* %8
%44 = load double, double* %8
%45 = fmul double 9.000000e+00, %44
%46 = load double, double* %9
%47 = fmul double %45, %46
%48 = fneg double %47
%49 = call double @llvm.fmuladd.f64(double %42, double %43, double %48)
%50 = load double, double* %10
%51 = call double @llvm.fmuladd.f64(double 2.700000e+01, double %50, double %49)
store double %51, double* %15
%52 = load double, double* %14
%53 = fdiv double %52, 9.000000e+00
store double %53, double* %16
%54 = load double, double* %15
%55 = fdiv double %54, 5.400000e+01
store double %55, double* %17
%56 = load double, double* %16
%57 = load double, double* %16
%58 = fmul double %56, %57
%59 = load double, double* %16
%60 = fmul double %58, %59
store double %60, double* %18
%61 = load double, double* %17
%62 = load double, double* %17
%63 = fmul double %61, %62
store double %63, double* %19
%64 = load double, double* %15
%65 = fmul double 7.290000e+02, %64
%66 = load double, double* %15
%67 = fmul double %65, %66
store double %67, double* %20
%68 = load double, double* %14
%69 = fmul double 2.916000e+03, %68
%70 = load double, double* %14
%71 = fmul double %69, %70
%72 = load double, double* %14
%73 = fmul double %71, %72
store double %73, double* %21
%74 = load double, double* %17
%75 = fcmp oeq double %74, 0.000000e+00
br i1 %75, label %76, label %92
76: ; preds = %6
%77 = load double, double* %16
%78 = fcmp oeq double %77, 0.000000e+00
br i1 %78, label %79, label %92
79: ; preds = %76
%80 = load double, double* %8
%81 = fneg double %80
%82 = fdiv double %81, 3.000000e+00
%83 = load double*, double** %11
store double %82, double* %83
%84 = load double, double* %8
%85 = fneg double %84
%86 = fdiv double %85, 3.000000e+00
%87 = load double*, double** %12
store double %86, double* %87
%88 = load double, double* %8
%89 = fneg double %88
%90 = fdiv double %89, 3.000000e+00
%91 = load double*, double** %13
store double %90, double* %91
store i32 3, i32* %7
br label %262
92: ; preds = %76, %6
%93 = load double, double* %20
%94 = load double, double* %21
%95 = fcmp oeq double %93, %94
br i1 %95, label %96, label %138
96: ; preds = %92
%97 = load double, double* %16
%98 = call double @sqrt(double %97)
store double %98, double* %22
%99 = load double, double* %17
%100 = fcmp ogt double %99, 0.000000e+00
br i1 %100, label %101, label %118
101: ; preds = %96
%102 = load double, double* %22
%103 = load double, double* %8
%104 = fdiv double %103, 3.000000e+00
%105 = fneg double %104
%106 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %102, double %105)
%107 = load double*, double** %11
store double %106, double* %107
%108 = load double, double* %22
%109 = load double, double* %8
%110 = fdiv double %109, 3.000000e+00
%111 = fsub double %108, %110
%112 = load double*, double** %12
store double %111, double* %112
%113 = load double, double* %22
%114 = load double, double* %8
%115 = fdiv double %114, 3.000000e+00
%116 = fsub double %113, %115
%117 = load double*, double** %13
store double %116, double* %117
br label %137
118: ; preds = %96
%119 = load double, double* %22
%120 = fneg double %119
%121 = load double, double* %8
%122 = fdiv double %121, 3.000000e+00
%123 = fsub double %120, %122
%124 = load double*, double** %11
store double %123, double* %124
%125 = load double, double* %22
%126 = fneg double %125
%127 = load double, double* %8
%128 = fdiv double %127, 3.000000e+00
%129 = fsub double %126, %128
%130 = load double*, double** %12
store double %129, double* %130
%131 = load double, double* %22
%132 = load double, double* %8
%133 = fdiv double %132, 3.000000e+00
%134 = fneg double %133
%135 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %131, double %134)
%136 = load double*, double** %13
store double %135, double* %136
br label %137
137: ; preds = %118, %101
store i32 3, i32* %7
br label %262
138: ; preds = %92
%139 = load double, double* %20
%140 = load double, double* %21
%141 = fcmp olt double %139, %140
br i1 %141, label %142, label %233
142: ; preds = %138
%143 = load double, double* %16
%144 = call double @sqrt(double %143)
store double %144, double* %23
%145 = load double, double* %23
%146 = load double, double* %23
%147 = fmul double %145, %146
%148 = load double, double* %23
%149 = fmul double %147, %148
store double %149, double* %24
%150 = load double, double* %17
%151 = load double, double* %24
%152 = fdiv double %150, %151
%153 = call double @acos(double %152)
store double %153, double* %25
%154 = load double, double* %23
%155 = fmul double -2.000000e+00, %154
store double %155, double* %26
%156 = load double, double* %26
%157 = load double, double* %25
%158 = fdiv double %157, 3.000000e+00
%159 = call double @cos(double %158)
%160 = load double, double* %8
%161 = fdiv double %160, 3.000000e+00
%162 = fneg double %161
%163 = call double @llvm.fmuladd.f64(double %156, double %159, double %162)
%164 = load double*, double** %11
store double %163, double* %164
%165 = load double, double* %26
%166 = load double, double* %25
%167 = fadd double %166, 0x401921FB54442D18
%168 = fdiv double %167, 3.000000e+00
%169 = call double @cos(double %168)
%170 = load double, double* %8
%171 = fdiv double %170, 3.000000e+00
%172 = fneg double %171
%173 = call double @llvm.fmuladd.f64(double %165, double %169, double %172)
%174 = load double*, double** %12
store double %173, double* %174
%175 = load double, double* %26
%176 = load double, double* %25
%177 = fsub double %176, 0x401921FB54442D18
%178 = fdiv double %177, 3.000000e+00
%179 = call double @cos(double %178)
%180 = load double, double* %8
%181 = fdiv double %180, 3.000000e+00
%182 = fneg double %181
%183 = call double @llvm.fmuladd.f64(double %175, double %179, double %182)
%184 = load double*, double** %13
store double %183, double* %184
%185 = load double*, double** %11
%186 = load double, double* %185
%187 = load double*, double** %12
%188 = load double, double* %187
%189 = fcmp ogt double %186, %188
br i1 %189, label %190, label %200
190: ; preds = %142
br label %191
191: ; preds = %190
%192 = load double*, double** %12
%193 = load double, double* %192
store double %193, double* %27
%194 = load double*, double** %11
%195 = load double, double* %194
%196 = load double*, double** %12
store double %195, double* %196
%197 = load double, double* %27
%198 = load double*, double** %11
store double %197, double* %198
br label %199
199: ; preds = %191
br label %200
200: ; preds = %199, %142
%201 = load double*, double** %12
%202 = load double, double* %201
%203 = load double*, double** %13
%204 = load double, double* %203
%205 = fcmp ogt double %202, %204
br i1 %205, label %206, label %232
206: ; preds = %200
br label %207
207: ; preds = %206
%208 = load double*, double** %13
%209 = load double, double* %208
store double %209, double* %28
%210 = load double*, double** %12
%211 = load double, double* %210
%212 = load double*, double** %13
store double %211, double* %212
%213 = load double, double* %28
%214 = load double*, double** %12
store double %213, double* %214
br label %215
215: ; preds = %207
%216 = load double*, double** %11
%217 = load double, double* %216
%218 = load double*, double** %12
%219 = load double, double* %218
%220 = fcmp ogt double %217, %219
br i1 %220, label %221, label %231
221: ; preds = %215
br label %222
222: ; preds = %221
%223 = load double*, double** %12
%224 = load double, double* %223
store double %224, double* %29
%225 = load double*, double** %11
%226 = load double, double* %225
%227 = load double*, double** %12
store double %226, double* %227
%228 = load double, double* %29
%229 = load double*, double** %11
store double %228, double* %229
br label %230
230: ; preds = %222
br label %231
231: ; preds = %230, %215
br label %232
232: ; preds = %231, %200
store i32 3, i32* %7
br label %262
233: ; preds = %138
%234 = load double, double* %17
%235 = fcmp oge double %234, 0.000000e+00
%236 = zext i1 %235 to i64
%237 = select i1 %235, i32 1, i32 -1
%238 = sitofp i32 %237 to double
store double %238, double* %30
%239 = load double, double* %30
%240 = fneg double %239
%241 = load double, double* %17
%242 = call i64 @fabs(double %241)
%243 = sitofp i64 %242 to double
%244 = load double, double* %19
%245 = load double, double* %18
%246 = fsub double %244, %245
%247 = call double @sqrt(double %246)
%248 = fadd double %243, %247
%249 = fptosi double %248 to i64
%250 = call double @pow(i64 %249, double 0x3FD5555555555555)
%251 = fmul double %240, %250
store double %251, double* %31
%252 = load double, double* %16
%253 = load double, double* %31
%254 = fdiv double %252, %253
store double %254, double* %32
%255 = load double, double* %31
%256 = load double, double* %32
%257 = fadd double %255, %256
%258 = load double, double* %8
%259 = fdiv double %258, 3.000000e+00
%260 = fsub double %257, %259
%261 = load double*, double** %11
store double %260, double* %261
store i32 1, i32* %7
br label %262
262: ; preds = %233, %232, %137, %79
%263 = load i32, i32* %7
ret i32 %263
}

LLVM IR (-O2):
define i32 @gsl_poly_solve_cubic(double %0, double %1, double %2, double* nocapture %3, double* nocapture %4, double* nocapture %5) {
%7 = fmul double %1, -3.000000e+00
%8 = fmul double %0, 2.000000e+00
%9 = fmul double %8, %0
%10 = fmul double %0, -9.000000e+00
%11 = fmul double %10, %1
%12 = tail call double @llvm.fmuladd.f64(double %9, double %0, double %11)
%13 = insertelement <2 x double> poison, double %0, i64 0
%14 = insertelement <2 x double> %13, double %2, i64 1
%15 = insertelement <2 x double> <double poison, double 2.700000e+01>, double %0, i64 0
%16 = insertelement <2 x double> poison, double %7, i64 0
%17 = insertelement <2 x double> %16, double %12, i64 1
%18 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %15, <2 x double> %17)
%19 = fdiv <2 x double> %18, <double 9.000000e+00, double 5.400000e+01>
%20 = extractelement <2 x double> %19, i64 0
%21 = fmul <2 x double> %19, %19
%22 = fmul <2 x double> %19, %21
%23 = extractelement <2 x double> %22, i64 0
%24 = extractelement <2 x double> %19, i64 1
%25 = fmul double %24, %24
%26 = extractelement <2 x double> %18, i64 1
%27 = fmul double %26, 7.290000e+02
%28 = fmul double %26, %27
%29 = extractelement <2 x double> %18, i64 0
%30 = fmul double %29, 2.916000e+03
%31 = fmul double %29, %30
%32 = fmul double %29, %31
%33 = fcmp oeq <2 x double> %19, zeroinitializer
%34 = extractelement <2 x i1> %33, i64 0
%35 = extractelement <2 x i1> %33, i64 1
%36 = select i1 %35, i1 %34, i1 false
br i1 %36, label %37, label %39
37: ; preds = %6
%38 = fdiv double %0, -3.000000e+00
store double %38, double* %3
store double %38, double* %4
store double %38, double* %5
br label %108
39: ; preds = %6
%40 = fcmp oeq double %28, %32
br i1 %40, label %41, label %57
41: ; preds = %39
%42 = tail call double @sqrt(double %20)
%43 = fcmp ogt double %24, 0.000000e+00
br i1 %43, label %44, label %49
44: ; preds = %41
%45 = fdiv double %0, 3.000000e+00
%46 = fneg double %45
%47 = tail call double @llvm.fmuladd.f64(double %42, double -2.000000e+00, double %46)
store double %47, double* %3
%48 = fsub double %42, %45
store double %48, double* %4
br label %55
49: ; preds = %41
%50 = fneg double %42
%51 = fdiv double %0, 3.000000e+00
%52 = fsub double %50, %51
store double %52, double* %3
store double %52, double* %4
%53 = fneg double %51
%54 = tail call double @llvm.fmuladd.f64(double %42, double 2.000000e+00, double %53)
br label %55
55: ; preds = %49, %44
%56 = phi double [ %54, %49 ], [ %48, %44 ]
store double %56, double* %5
br label %108
57: ; preds = %39
%58 = fcmp olt double %28, %32
br i1 %58, label %59, label %92
59: ; preds = %57
%60 = tail call double @sqrt(double %20)
%61 = fmul double %60, %60
%62 = fmul double %60, %61
%63 = fdiv double %24, %62
%64 = tail call double @acos(double %63)
%65 = fmul double %60, -2.000000e+00
%66 = fdiv double %64, 3.000000e+00
%67 = tail call double @cos(double %66)
%68 = fdiv double %0, -3.000000e+00
%69 = tail call double @llvm.fmuladd.f64(double %65, double %67, double %68)
store double %69, double* %3
%70 = fadd double %64, 0x401921FB54442D18
%71 = fdiv double %70, 3.000000e+00
%72 = tail call double @cos(double %71)
%73 = tail call double @llvm.fmuladd.f64(double %65, double %72, double %68)
store double %73, double* %4
%74 = fadd double %64, 0xC01921FB54442D18
%75 = fdiv double %74, 3.000000e+00
%76 = tail call double @cos(double %75)
%77 = tail call double @llvm.fmuladd.f64(double %65, double %76, double %68)
store double %77, double* %5
%78 = load double, double* %3
%79 = load double, double* %4
%80 = fcmp ogt double %78, %79
br i1 %80, label %81, label %84
81: ; preds = %59
store double %78, double* %4
store double %79, double* %3
%82 = load double, double* %4
%83 = load double, double* %5
br label %84
84: ; preds = %81, %59
%85 = phi double [ %83, %81 ], [ %77, %59 ]
%86 = phi double [ %82, %81 ], [ %79, %59 ]
%87 = fcmp ogt double %86, %85
br i1 %87, label %88, label %108
88: ; preds = %84
store double %86, double* %5
store double %85, double* %4
%89 = load double, double* %3
%90 = fcmp ogt double %89, %85
br i1 %90, label %91, label %108
91: ; preds = %88
store double %89, double* %4
store double %85, double* %3
br label %108
92: ; preds = %57
%93 = fcmp oge double %24, 0.000000e+00
%94 = select i1 %93, double 1.000000e+00, double -1.000000e+00
%95 = fneg double %94
%96 = tail call i64 @fabs(double %24)
%97 = sitofp i64 %96 to double
%98 = fsub double %25, %23
%99 = tail call double @sqrt(double %98)
%100 = fadd double %99, %97
%101 = fptosi double %100 to i64
%102 = tail call double @pow(i64 %101, double 0x3FD5555555555555)
%103 = fmul double %102, %95
%104 = fdiv double %20, %103
%105 = fadd double %103, %104
%106 = fdiv double %0, 3.000000e+00
%107 = fsub double %105, %106
store double %107, double* %3
br label %108
108: ; preds = %84, %91, %88, %92, %55, %37
%109 = phi i32 [ 3, %37 ], [ 3, %55 ], [ 1, %92 ], [ 3, %88 ], [ 3, %91 ], [ 3, %84 ]
ret i32 %109
}