#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 asin(double);
double exp(double);
int fabs(double);
int log(int);
double pow(double, double);
double sin(double);
int sqrt(double);
long cubic(float *coef, float *roots) {
  double a, b, c, d, n, o, s, sc, t;
  long neg = 0;
  a = coef[0];
  b = coef[1];
  c = coef[2];
  d = coef[3];
  if (!a) {
    if (b) {
      roots[0] = -c + sqrt(fabs(c * c - 4 * b * d)) / (2 * b);
      roots[1] = -c - sqrt(fabs(c * c - 4 * b * d)) / (2 * b);
      return (2);
    }
    if (c) {
      roots[0] = -d / c;
      return (1);
    }
    return (0);
  }
  b /= -a;
  c /= -a;
  d /= -a;
  n = b * b + 3 * c;
  o = -(2 * b * b * b + 9 * b * c + 27 * d);
  if (n < 0) {
    n = fabs(n);
    sc = 0.5 * o * pow(n, -1.5);
    t = 2 * sqrt(n) / 3;
    s = log(fabs(sc) + sqrt(sc * sc + 1)) * ((sc > 0) - (sc < 0)) / 3;
    roots[0] = b / 3 - t * 0.5 * (exp(s) - exp(-s));
    return (1);
  } else if (n > 0) {
    sc = 0.5 * o * pow(n, -1.5);
    t = 2 * sqrt(n) / 3;
    if (sc >= -1 && sc <= 1) {
      s = asin(sc) / 3;
      roots[0] =
          t * sin(s - 2 * 3.14159265358979323846264338327950 / 3) + b / 3;
      roots[1] = t * sin(s) + b / 3;
      roots[2] =
          t * sin(s + 2 * 3.14159265358979323846264338327950 / 3) + b / 3;
      return (3);
    } else {
      s = log(fabs(sc) + sqrt(sc * sc - 1)) / 3;
      roots[0] = t * 0.5 * (exp(s) + exp(-s)) + b / 3;
      return (1);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<cubic>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13a1 <cubic+0x231>
jp     13a1 <cubic+0x231>
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1207 <cubic+0x97>
jp     1207 <cubic+0x97>
jmp    133d <cubic+0x1cd>
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  0xdce(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
call   1090 <sqrt@plt>
movsd  -0x78(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
movsd  0xd7e(%rip),%xmm2
mulsd  -0x28(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  0xd3a(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
call   1090 <sqrt@plt>
movsd  -0x70(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
movsd  0xcea(%rip),%xmm2
mulsd  -0x28(%rbp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
movq   $0x2,-0x8(%rbp)
jmp    18dc <cubic+0x76c>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    135a <cubic+0x1ea>
jp     135a <cubic+0x1ea>
jmp    1394 <cubic+0x224>
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movq   $0x1,-0x8(%rbp)
jmp    18dc <cubic+0x76c>
movq   $0x0,-0x8(%rbp)
jmp    18dc <cubic+0x76c>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  0xbef(%rip),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xbb5(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  0xbb6(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  0xb8f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    1649 <cubic+0x4d9>
movsd  -0x40(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xb6a(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  0xb48(%rip),%xmm1
call   1080 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1090 <sqrt@plt>
shl    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,-0x94(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xafb(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1090 <sqrt@plt>
mov    -0x94(%rbp),%edi
add    %eax,%edi
call   1070 <log@plt>
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
seta   %dl
and    $0x1,%dl
movzbl %dl,%edx
sub    %edx,%ecx
imul   %ecx,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xa7c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xa80(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1060 <exp@plt>
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x88(%rbp),%xmm1
ff
movaps %xmm0,%xmm3
movsd  -0x80(%rbp),%xmm0
subsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movq   $0x1,-0x8(%rbp)
jmp    18dc <cubic+0x76c>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    18cf <cubic+0x75f>
movsd  0x9d5(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  0x9b3(%rip),%xmm1
call   1080 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1090 <sqrt@plt>
shl    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  0x967(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     17f1 <cubic+0x681>
movsd  0x96d(%rip),%xmm0
ucomisd -0x58(%rbp),%xmm0
jb     17f1 <cubic+0x681>
movsd  -0x58(%rbp),%xmm0
call   1050 <asin@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  0x935(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0x28(%rbp),%xmm1
movsd  0x8ec(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0xb8(%rbp),%xmm0
ff
movsd  -0x28(%rbp),%xmm1
movsd  0x8a5(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0x89f(%rip),%xmm0
addsd  -0x50(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0x28(%rbp),%xmm1
movsd  0x855(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
movq   $0x3,-0x8(%rbp)
jmp    18dc <cubic+0x76c>
movsd  -0x58(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,-0xd4(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x811(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1090 <sqrt@plt>
mov    -0xd4(%rbp),%edi
add    %eax,%edi
call   1070 <log@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0x7f2(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1060 <exp@plt>
movsd  -0xd0(%rbp),%xmm2
ff
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm2
movsd  -0x28(%rbp),%xmm1
movsd  0x776(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movq   $0x1,-0x8(%rbp)
jmp    18dc <cubic+0x76c>
jmp    18d4 <cubic+0x764>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic>:
push   %rbp
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm2
cvtss2sd %xmm2,%xmm4
movss  0x8(%rdi),%xmm0
cvtss2sd %xmm0,%xmm6
movss  0xc(%rdi),%xmm3
cvtss2sd %xmm3,%xmm5
xorps  %xmm3,%xmm3
ucomiss %xmm3,%xmm1
jne    11a6 <cubic+0x36>
jnp    1369 <cubic+0x1f9>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
divsd  %xmm0,%xmm5
xorpd  0xe47(%rip),%xmm0
divsd  %xmm0,%xmm4
divsd  %xmm0,%xmm6
movsd  0xe4f(%rip),%xmm1
mulsd  %xmm6,%xmm1
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm4,%xmm2
addsd  %xmm4,%xmm2
mulsd  %xmm4,%xmm2
movsd  0xe33(%rip),%xmm1
mulsd  %xmm4,%xmm1
mulsd  %xmm6,%xmm1
mulsd  %xmm4,%xmm2
addsd  %xmm1,%xmm2
mulsd  0xe23(%rip),%xmm5
addsd  %xmm2,%xmm5
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    142d <cubic+0x2bd>
movsd  %xmm4,0x8(%rsp)
movapd %xmm5,0x10(%rsp)
call   1030 <fabs@plt>
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movsd  %xmm2,0x20(%rsp)
movapd 0x10(%rsp),%xmm0
mulsd  0xded(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
movsd  0xde7(%rip),%xmm1
movapd %xmm2,%xmm0
call   1080 <pow@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
call   1090 <sqrt@plt>
add    %eax,%eax
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,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ebp
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  0xd93(%rip),%xmm0
call   1090 <sqrt@plt>
add    %eax,%ebp
mov    %ebp,%edi
call   1070 <log@plt>
xor    %ecx,%ecx
xorpd  %xmm0,%xmm0
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %cl
xor    %edx,%edx
ucomisd %xmm1,%xmm0
seta   %dl
sub    %edx,%ecx
imul   %eax,%ecx
movslq %ecx,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movapd %xmm1,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
divsd  0xd02(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
call   1060 <exp@plt>
movsd  %xmm0,0x10(%rsp)
movapd 0x30(%rsp),%xmm0
xorpd  0xcc7(%rip),%xmm0
call   1060 <exp@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x20(%rsp),%xmm0
mulsd  0xcda(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x8(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    163e <cubic+0x4ce>
ucomiss %xmm3,%xmm2
jne    1374 <cubic+0x204>
jnp    1571 <cubic+0x401>
movaps 0xc85(%rip),%xmm0
xorps  %xmm6,%xmm0
movaps %xmm0,0x10(%rsp)
movsd  0xc85(%rip),%xmm1
mulsd  %xmm4,%xmm1
mulsd  %xmm5,%xmm1
movapd %xmm6,%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,0x20(%rsp)
movsd  %xmm4,0x8(%rsp)
movaps %xmm6,0x30(%rsp)
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1090 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x8(%rsp)
divsd  %xmm1,%xmm0
subsd  0x30(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rbx)
movaps 0x20(%rsp),%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
call   1090 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0x8(%rsp),%xmm0
movapd 0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0x4(%rbx)
mov    $0x2,%eax
jmp    1647 <cubic+0x4d7>
ucomisd %xmm1,%xmm0
jbe    1592 <cubic+0x422>
movsd  %xmm4,0x8(%rsp)
mulsd  0xbeb(%rip),%xmm5
movapd %xmm5,0x10(%rsp)
movsd  0xbe5(%rip),%xmm1
movsd  %xmm0,0x30(%rsp)
call   1080 <pow@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x30(%rsp),%xmm0
call   1090 <sqrt@plt>
movsd  0x20(%rsp),%xmm0
add    %eax,%eax
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
ucomisd 0xb9e(%rip),%xmm0
movsd  %xmm1,0x10(%rsp)
jb     1599 <cubic+0x429>
movsd  0xb92(%rip),%xmm2
ucomisd %xmm0,%xmm2
jb     1599 <cubic+0x429>
call   1050 <asin@plt>
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0xb68(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <sin@plt>
movsd  0x8(%rsp),%xmm1
divsd  0xb11(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
mulsd  0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rbx)
movsd  0x20(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rbx)
movsd  0x20(%rsp),%xmm0
addsd  0xb13(%rip),%xmm0
call   1040 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rbx)
mov    $0x3,%eax
jmp    1647 <cubic+0x4d7>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    157b <cubic+0x40b>
jnp    1592 <cubic+0x422>
xorps  0xa7e(%rip),%xmm5
divsd  %xmm6,%xmm5
xorps  %xmm0,%xmm0
cvtsd2ss %xmm5,%xmm0
jmp    163e <cubic+0x4ce>
xor    %eax,%eax
jmp    1647 <cubic+0x4d7>
call   1030 <fabs@plt>
mov    %eax,%ebp
movsd  0x20(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  0xa8e(%rip),%xmm0
call   1090 <sqrt@plt>
add    %eax,%ebp
mov    %ebp,%edi
call   1070 <log@plt>
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movapd %xmm1,0x30(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xa5f(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
call   1060 <exp@plt>
movsd  %xmm0,0x20(%rsp)
movapd 0x30(%rsp),%xmm0
xorpd  0x9ec(%rip),%xmm0
call   1060 <exp@plt>
addsd  0x20(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  0x9e5(%rip),%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,(%rbx)
mov    $0x1,%eax
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @cubic(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = fpext float %5 to double
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = getelementptr inbounds float, float* %0, i64 3
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = fcmp une float %3, 0.000000e+00
br i1 %13, label %43, label %14
14: ; preds = %2
%15 = fcmp une float %5, 0.000000e+00
br i1 %15, label %16, label %37
16: ; preds = %14
%17 = fneg double %9
%18 = fmul double %6, -4.000000e+00
%19 = fmul double %18, %12
%20 = tail call double @llvm.fmuladd.f64(double %9, double %9, double %19)
%21 = tail call i32 @fabs(double %20)
%22 = sitofp i32 %21 to double
%23 = tail call i32 @sqrt(double %22)
%24 = sitofp i32 %23 to double
%25 = fmul double %6, 2.000000e+00
%26 = fdiv double %24, %25
%27 = fsub double %26, %9
%28 = fptrunc double %27 to float
store float %28, float* %1
%29 = tail call i32 @fabs(double %20)
%30 = sitofp i32 %29 to double
%31 = tail call i32 @sqrt(double %30)
%32 = sitofp i32 %31 to double
%33 = fdiv double %32, %25
%34 = fsub double %17, %33
%35 = fptrunc double %34 to float
%36 = getelementptr inbounds float, float* %1, i64 1
store float %35, float* %36
br label %136
37: ; preds = %14
%38 = fcmp une float %8, 0.000000e+00
br i1 %38, label %39, label %136
39: ; preds = %37
%40 = fneg double %12
%41 = fdiv double %40, %9
%42 = fptrunc double %41 to float
store float %42, float* %1
br label %136
43: ; preds = %2
%44 = fpext float %3 to double
%45 = fneg double %44
%46 = fdiv double %6, %45
%47 = fdiv double %9, %45
%48 = fdiv double %12, %45
%49 = fmul double %47, 3.000000e+00
%50 = tail call double @llvm.fmuladd.f64(double %46, double %46, double %49)
%51 = fmul double %46, 2.000000e+00
%52 = fmul double %46, %51
%53 = fmul double %46, 9.000000e+00
%54 = fmul double %53, %47
%55 = tail call double @llvm.fmuladd.f64(double %52, double %46, double %54)
%56 = tail call double @llvm.fmuladd.f64(double %48, double 2.700000e+01, double %55)
%57 = fcmp olt double %50, 0.000000e+00
br i1 %57, label %58, label %89
58: ; preds = %43
%59 = tail call i32 @fabs(double %50)
%60 = sitofp i32 %59 to double
%61 = fmul double %56, -5.000000e-01
%62 = tail call double @pow(double %60, double -1.500000e+00)
%63 = fmul double %61, %62
%64 = tail call i32 @sqrt(double %60)
%65 = shl nsw i32 %64, 1
%66 = sdiv i32 %65, 3
%67 = sitofp i32 %66 to double
%68 = tail call i32 @fabs(double %63)
%69 = tail call double @llvm.fmuladd.f64(double %63, double %63, double 1.000000e+00)
%70 = tail call i32 @sqrt(double %69)
%71 = add nsw i32 %70, %68
%72 = tail call i32 @log(i32 %71)
%73 = fcmp ogt double %63, 0.000000e+00
%74 = zext i1 %73 to i32
%75 = fcmp olt double %63, 0.000000e+00
%76 = sext i1 %75 to i32
%77 = add nsw i32 %76, %74
%78 = mul nsw i32 %72, %77
%79 = sdiv i32 %78, 3
%80 = sitofp i32 %79 to double
%81 = fdiv double %46, 3.000000e+00
%82 = tail call double @exp(double %80)
%83 = fneg double %80
%84 = tail call double @exp(double %83)
%85 = fsub double %82, %84
%86 = fmul double %67, -5.000000e-01
%87 = tail call double @llvm.fmuladd.f64(double %86, double %85, double %81)
%88 = fptrunc double %87 to float
store float %88, float* %1
br label %136
89: ; preds = %43
%90 = fcmp ogt double %50, 0.000000e+00
br i1 %90, label %91, label %136
91: ; preds = %89
%92 = fmul double %56, -5.000000e-01
%93 = tail call double @pow(double %50, double -1.500000e+00)
%94 = fmul double %92, %93
%95 = tail call i32 @sqrt(double %50)
%96 = shl nsw i32 %95, 1
%97 = sdiv i32 %96, 3
%98 = sitofp i32 %97 to double
%99 = fcmp oge double %94, -1.000000e+00
%100 = fcmp ole double %94, 1.000000e+00
%101 = and i1 %99, %100
br i1 %101, label %102, label %120
102: ; preds = %91
%103 = tail call i32 @asin(double %94)
%104 = sdiv i32 %103, 3
%105 = sitofp i32 %104 to double
%106 = fadd double %105, 0xC000C152382D7365
%107 = tail call double @sin(double %106)
%108 = fdiv double %46, 3.000000e+00
%109 = tail call double @llvm.fmuladd.f64(double %98, double %107, double %108)
%110 = fptrunc double %109 to float
store float %110, float* %1
%111 = tail call double @sin(double %105)
%112 = tail call double @llvm.fmuladd.f64(double %98, double %111, double %108)
%113 = fptrunc double %112 to float
%114 = getelementptr inbounds float, float* %1, i64 1
store float %113, float* %114
%115 = fadd double %105, 0x4000C152382D7365
%116 = tail call double @sin(double %115)
%117 = tail call double @llvm.fmuladd.f64(double %98, double %116, double %108)
%118 = fptrunc double %117 to float
%119 = getelementptr inbounds float, float* %1, i64 2
store float %118, float* %119
br label %136
120: ; preds = %91
%121 = tail call i32 @fabs(double %94)
%122 = tail call double @llvm.fmuladd.f64(double %94, double %94, double -1.000000e+00)
%123 = tail call i32 @sqrt(double %122)
%124 = add nsw i32 %123, %121
%125 = tail call i32 @log(i32 %124)
%126 = sdiv i32 %125, 3
%127 = sitofp i32 %126 to double
%128 = fmul double %98, 5.000000e-01
%129 = tail call double @exp(double %127)
%130 = fneg double %127
%131 = tail call double @exp(double %130)
%132 = fadd double %129, %131
%133 = fdiv double %46, 3.000000e+00
%134 = tail call double @llvm.fmuladd.f64(double %128, double %132, double %133)
%135 = fptrunc double %134 to float
store float %135, float* %1
br label %136
136: ; preds = %89, %37, %120, %102, %58, %39, %16
%137 = phi i64 [ 1, %58 ], [ 3, %102 ], [ 1, %120 ], [ 2, %16 ], [ 1, %39 ], [ 0, %37 ], [ 0, %89 ]
ret i64 %137
}