#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 lcubic(double *coef, double *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):
<lcubic>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1385 <lcubic+0x215>
jp     1385 <lcubic+0x215>
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11f7 <lcubic+0x87>
jp     11f7 <lcubic+0x87>
jmp    1325 <lcubic+0x1b5>
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  0xdde(%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  0xd8e(%rip),%xmm2
mulsd  -0x28(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %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  0xd4e(%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  0xcfe(%rip),%xmm2
mulsd  -0x28(%rbp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movq   $0x2,-0x8(%rbp)
jmp    18ac <lcubic+0x73c>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1342 <lcubic+0x1d2>
jp     1342 <lcubic+0x1d2>
jmp    1378 <lcubic+0x208>
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movq   $0x1,-0x8(%rbp)
jmp    18ac <lcubic+0x73c>
movq   $0x0,-0x8(%rbp)
jmp    18ac <lcubic+0x73c>
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  0xc0b(%rip),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xbd1(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  0xbd2(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  0xbab(%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    1629 <lcubic+0x4b9>
movsd  -0x40(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xb86(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  0xb64(%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  0xb17(%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  0xa98(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xa9c(%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
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movq   $0x1,-0x8(%rbp)
jmp    18ac <lcubic+0x73c>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    189f <lcubic+0x72f>
movsd  0x9f5(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  0x9d3(%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  0x987(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     17c5 <lcubic+0x655>
movsd  0x98d(%rip),%xmm0
ucomisd -0x58(%rbp),%xmm0
jb     17c5 <lcubic+0x655>
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  0x955(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0x28(%rbp),%xmm1
movsd  0x90c(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %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  0x8c9(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0x8c7(%rip),%xmm0
addsd  -0x50(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0x28(%rbp),%xmm1
movsd  0x87d(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movq   $0x3,-0x8(%rbp)
jmp    18ac <lcubic+0x73c>
movsd  -0x58(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,-0xd4(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x83d(%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  0x81e(%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  0x7a2(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movq   $0x1,-0x8(%rbp)
jmp    18ac <lcubic+0x73c>
jmp    18a4 <lcubic+0x734>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcubic>:
push   %rbp
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm3
movsd  0x10(%rdi),%xmm5
movsd  0x18(%rdi),%xmm4
xorpd  %xmm6,%xmm6
ucomisd %xmm6,%xmm1
jne    119c <lcubic+0x2c>
jnp    1354 <lcubic+0x1e4>
divsd  %xmm1,%xmm4
xorpd  0xe58(%rip),%xmm1
divsd  %xmm1,%xmm3
divsd  %xmm1,%xmm5
movsd  0xe60(%rip),%xmm1
mulsd  %xmm5,%xmm1
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm3,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm3,%xmm1
movsd  0xe44(%rip),%xmm2
mulsd  %xmm3,%xmm2
mulsd  %xmm5,%xmm2
mulsd  %xmm3,%xmm1
mulsd  0xe38(%rip),%xmm4
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm4
ucomisd %xmm0,%xmm6
jbe    1412 <lcubic+0x2a2>
movsd  %xmm3,0x8(%rsp)
movapd %xmm4,0x10(%rsp)
call   1030 <fabs@plt>
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movsd  %xmm2,0x20(%rsp)
movapd 0x10(%rsp),%xmm0
mulsd  0xe02(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
movsd  0xdfc(%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  0xda8(%rip),%xmm0
call   1090 <sqrt@plt>
add    %eax,%ebp
mov    %ebp,%edi
call   1070 <log@plt>
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
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  0xd17(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
call   1060 <exp@plt>
movsd  %xmm0,0x10(%rsp)
movapd 0x30(%rsp),%xmm0
xorpd  0xcdc(%rip),%xmm0
call   1060 <exp@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x20(%rsp),%xmm0
mulsd  0xcef(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
jmp    1618 <lcubic+0x4a8>
ucomisd %xmm6,%xmm3
jne    1360 <lcubic+0x1f0>
jnp    154e <lcubic+0x3de>
movapd 0xc98(%rip),%xmm0
xorpd  %xmm5,%xmm0
movapd %xmm0,0x10(%rsp)
movsd  0xc96(%rip),%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm4,%xmm1
movapd %xmm5,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,0x20(%rsp)
movsd  %xmm3,0x8(%rsp)
movapd %xmm5,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
movsd  %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
movsd  %xmm1,0x8(%rbx)
mov    $0x2,%eax
jmp    161d <lcubic+0x4ad>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    156f <lcubic+0x3ff>
movsd  %xmm3,0x8(%rsp)
mulsd  0xc02(%rip),%xmm4
movapd %xmm4,0x10(%rsp)
movsd  0xbfc(%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 0xbb5(%rip),%xmm0
movsd  %xmm1,0x10(%rsp)
jb     1576 <lcubic+0x406>
movsd  0xba9(%rip),%xmm2
ucomisd %xmm0,%xmm2
jb     1576 <lcubic+0x406>
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  0xb7f(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <sin@plt>
movsd  0x8(%rsp),%xmm1
divsd  0xb28(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
mulsd  0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx)
movsd  0x20(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rbx)
movsd  0x20(%rsp),%xmm0
addsd  0xb32(%rip),%xmm0
call   1040 <sin@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rbx)
mov    $0x3,%eax
jmp    161d <lcubic+0x4ad>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm5
jne    155a <lcubic+0x3ea>
jnp    156f <lcubic+0x3ff>
xorpd  0xa9e(%rip),%xmm4
divsd  %xmm5,%xmm4
movsd  %xmm4,(%rbx)
jmp    1618 <lcubic+0x4a8>
xor    %eax,%eax
jmp    161d <lcubic+0x4ad>
call   1030 <fabs@plt>
mov    %eax,%ebp
movsd  0x20(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  0xab1(%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  0xa82(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
call   1060 <exp@plt>
movsd  %xmm0,0x20(%rsp)
movapd 0x30(%rsp),%xmm0
xorpd  0xa0f(%rip),%xmm0
call   1060 <exp@plt>
addsd  0x20(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  0xa0e(%rip),%xmm1
mulsd  0x10(%rsp),%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
mov    $0x1,%eax
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

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

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