#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 DBL_EPSILON;
double eigenerf2(double, double, double, double, double);
double log(double);
double logerf(double, double);
double pow(double, double);
double sqrt(double);
double logerf2(double g1, double g2, double A11, double A12, double A22) {
  double ctheta;
  double stheta;
  double val_i;
  double val_j;
  double origi, origj;
  double xveci, xvecj;
  double yveci, yvecj;
  double u, v;
  double a;
  double s, t;
  double TINY = pow(DBL_EPSILON, 2.0 / 3.0);
  u = (g1 > 0.0) ? 1.0 / (A11 + g1 * g1) : (A11 + g1 * g1) / (A11 * A11);
  v = (g2 > 0.0) ? 1.0 / (A22 + g2 * g2) : (A22 + g2 * g2) / (A22 * A22);
  if (A12 * A12 * u * v <= DBL_EPSILON)
    return logerf(g1, A11) + logerf(g2, A22);
  if (A11 >= A22) {
    t = (A11 - A22) / 2.0;
    t += sqrt(t * t + A12 * A12);
    s = sqrt(t * t + A12 * A12);
    val_i = t + A22;
    ctheta = t / s;
    stheta = A12 / s;
  } else {
    t = (A22 - A11) / 2.0;
    t += sqrt(t * t + A12 * A12);
    s = sqrt(t * t + A12 * A12);
    val_i = t + A11;
    ctheta = A12 / s;
    stheta = t / s;
  }
  val_j = (A11 * A22 - A12 * A12) / val_i;
  if (val_j < TINY * sqrt(A11 * A22))
    val_j = TINY * sqrt(A11 * A22);
  val_i = sqrt(val_i);
  val_j = sqrt(val_j);
  origi = (g1 * ctheta + g2 * stheta) / val_i;
  origj = (-g1 * stheta + g2 * ctheta) / val_j;
  xveci = val_i * ctheta;
  xvecj = -val_j * stheta;
  yveci = val_i * stheta;
  yvecj = val_j * ctheta;
  a = sqrt(origi * origi + origj * origj);
  if (a > 0.0) {
    origi /= a;
    origj /= a;
  }
  s = eigenerf2(a, origi * xveci + origj * xvecj,
                -origj * xveci + origi * xvecj, origi * yveci + origj * yvecj,
                -origj * yveci + origi * yvecj);
  s = s + a * a / 2.0 - log(val_i * val_j);
  return s;
}


x86 assembly (clang, -O0):
<logerf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
mov    0x2e6d(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe79(%rip),%xmm1
call   1050 <pow@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11d6 <logerf2+0x86>
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe43(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    1203 <logerf2+0xb3>
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1255 <logerf2+0x105>
movsd  -0x30(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xdc4(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
jmp    1282 <logerf2+0x132>
movsd  -0x30(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x88(%rbp),%xmm1
ff
mulsd  -0x90(%rbp),%xmm1
ff
mov    0x2d35(%rip),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1300 <logerf2+0x1b0>
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <logerf@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
call   1030 <logerf@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    17a0 <logerf2+0x650>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x30(%rbp),%xmm0
jb     13d2 <logerf2+0x282>
movsd  -0x20(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  0xcee(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
addsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
divsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
divsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
jmp    148f <logerf2+0x33f>
movsd  -0x30(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  0xc2c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
addsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
divsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x38(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
divsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  -0xd8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xd0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    154c <logerf2+0x3fc>
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    168a <logerf2+0x53a>
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0x58(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0x60(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm3
movsd  -0x60(%rbp),%xmm2
mulsd  -0x70(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x60(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  -0x68(%rbp),%xmm4
movsd  -0x58(%rbp),%xmm3
mulsd  -0x70(%rbp),%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
movsd  -0x58(%rbp),%xmm3
movsd  -0x78(%rbp),%xmm5
movsd  -0x60(%rbp),%xmm4
mulsd  -0x80(%rbp),%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
movsd  -0x60(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
movsd  -0x78(%rbp),%xmm6
movsd  -0x58(%rbp),%xmm5
mulsd  -0x80(%rbp),%xmm5
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
call   1070 <eigenerf2@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
mulsd  -0x98(%rbp),%xmm1
ff
movsd  0x8b3(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0xe8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logerf2>:
push   %rbx
sub    $0x80,%rsp
movsd  %xmm4,0x10(%rsp)
movaps %xmm3,(%rsp)
movsd  %xmm2,0x30(%rsp)
movaps %xmm1,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
mov    0x2e6f(%rip),%rbx
movsd  (%rbx),%xmm0
movsd  0xe7b(%rip),%xmm1
call   1050 <pow@plt>
movsd  0x30(%rsp),%xmm1
xorpd  %xmm2,%xmm2
movapd 0x50(%rsp),%xmm3
ucomisd %xmm2,%xmm3
movapd %xmm3,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
jbe    11ba <logerf2+0x6a>
movsd  0xe54(%rip),%xmm5
divsd  %xmm2,%xmm5
jmp    11ca <logerf2+0x7a>
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
divsd  %xmm3,%xmm2
movapd %xmm2,%xmm5
movapd (%rsp),%xmm3
movsd  0x10(%rsp),%xmm6
xorpd  %xmm4,%xmm4
movapd 0x60(%rsp),%xmm2
ucomisd %xmm4,%xmm2
movapd %xmm2,%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm6,%xmm4
jbe    11ff <logerf2+0xaf>
movsd  0xe0f(%rip),%xmm2
divsd  %xmm4,%xmm2
jmp    120f <logerf2+0xbf>
movapd %xmm6,%xmm2
mulsd  %xmm6,%xmm2
divsd  %xmm2,%xmm4
movapd %xmm4,%xmm2
movapd %xmm3,%xmm4
mulsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm5
mulsd  %xmm2,%xmm5
movsd  (%rbx),%xmm2
ucomisd %xmm5,%xmm2
jae    1263 <logerf2+0x113>
ucomisd %xmm6,%xmm1
movsd  %xmm0,0x48(%rsp)
movapd %xmm4,0x70(%rsp)
jae    1291 <logerf2+0x141>
subsd  %xmm1,%xmm6
mulsd  0xdc9(%rip),%xmm6
movapd %xmm6,%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm4,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     12bd <logerf2+0x16d>
sqrtsd %xmm0,%xmm0
jmp    12d8 <logerf2+0x188>
movaps 0x50(%rsp),%xmm0
call   1030 <logerf@plt>
movsd  %xmm0,(%rsp)
movapd 0x60(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <logerf@plt>
movapd %xmm0,%xmm1
addsd  (%rsp),%xmm1
jmp    1625 <logerf2+0x4d5>
movapd %xmm1,%xmm5
subsd  %xmm6,%xmm5
mulsd  0xd6f(%rip),%xmm5
movapd %xmm5,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm4,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     12f4 <logerf2+0x1a4>
sqrtsd %xmm0,%xmm0
jmp    130f <logerf2+0x1bf>
movapd %xmm6,0x20(%rsp)
call   1060 <sqrt@plt>
xorpd  %xmm2,%xmm2
movapd 0x20(%rsp),%xmm6
movapd 0x70(%rsp),%xmm4
addsd  %xmm0,%xmm6
movapd %xmm6,%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm4,%xmm0
ucomisd %xmm2,%xmm0
jb     132b <logerf2+0x1db>
sqrtsd %xmm0,%xmm0
jmp    1342 <logerf2+0x1f2>
movapd %xmm5,0x20(%rsp)
call   1060 <sqrt@plt>
xorpd  %xmm2,%xmm2
movapd 0x20(%rsp),%xmm5
movapd 0x70(%rsp),%xmm4
addsd  %xmm0,%xmm5
movapd %xmm5,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm4,%xmm0
ucomisd %xmm2,%xmm0
jb     136d <logerf2+0x21d>
sqrtsd %xmm0,%xmm0
jmp    1384 <logerf2+0x234>
movapd %xmm6,0x20(%rsp)
call   1060 <sqrt@plt>
movapd 0x20(%rsp),%xmm6
movapd 0x70(%rsp),%xmm4
movapd (%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
movapd %xmm6,%xmm5
addsd  %xmm2,%xmm5
unpcklpd %xmm1,%xmm6
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm6
movapd %xmm6,%xmm1
jmp    13a5 <logerf2+0x255>
movapd %xmm5,0x20(%rsp)
call   1060 <sqrt@plt>
movapd 0x20(%rsp),%xmm5
movapd 0x70(%rsp),%xmm4
movapd (%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
unpcklpd %xmm5,%xmm1
addsd  %xmm3,%xmm5
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm1
mulsd  %xmm3,%xmm2
movapd %xmm2,%xmm3
subsd  %xmm4,%xmm3
divsd  %xmm5,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
movapd %xmm1,(%rsp)
jb     13cd <logerf2+0x27d>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    13fa <logerf2+0x2aa>
movapd %xmm2,%xmm0
movsd  %xmm2,0x30(%rsp)
movapd %xmm5,0x20(%rsp)
movsd  %xmm3,0x10(%rsp)
call   1060 <sqrt@plt>
movsd  0x10(%rsp),%xmm3
movapd 0x20(%rsp),%xmm5
movsd  0x30(%rsp),%xmm2
movsd  0x48(%rsp),%xmm1
mulsd  %xmm1,%xmm0
ucomisd %xmm3,%xmm0
jbe    1440 <logerf2+0x2f0>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     141d <logerf2+0x2cd>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1438 <logerf2+0x2e8>
movapd %xmm2,%xmm0
movapd %xmm5,0x20(%rsp)
call   1060 <sqrt@plt>
movapd 0x20(%rsp),%xmm5
movsd  0x48(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm5
jb     1451 <logerf2+0x301>
sqrtsd %xmm5,%xmm8
jmp    146f <logerf2+0x31f>
movapd %xmm5,%xmm0
movsd  %xmm3,0x10(%rsp)
call   1060 <sqrt@plt>
movsd  0x10(%rsp),%xmm3
movapd %xmm0,%xmm8
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
movapd %xmm8,0x30(%rsp)
jb     1485 <logerf2+0x335>
xorps  %xmm5,%xmm5
sqrtsd %xmm3,%xmm5
jmp    1499 <logerf2+0x349>
movapd %xmm3,%xmm0
call   1060 <sqrt@plt>
movapd 0x30(%rsp),%xmm8
movapd %xmm0,%xmm5
movapd (%rsp),%xmm9
movapd 0xb79(%rip),%xmm2
movapd 0x50(%rsp),%xmm3
movapd %xmm3,%xmm6
xorpd  %xmm2,%xmm6
movapd %xmm9,%xmm4
unpckhpd %xmm9,%xmm4
movapd %xmm9,%xmm0
shufpd $0x1,%xmm9,%xmm0
movapd 0x60(%rsp),%xmm1
unpcklpd %xmm1,%xmm1
mulpd  %xmm0,%xmm1
unpcklpd %xmm3,%xmm6
mulpd  %xmm9,%xmm6
addpd  %xmm1,%xmm6
movapd %xmm5,%xmm0
unpcklpd %xmm8,%xmm0
divpd  %xmm0,%xmm6
xorpd  %xmm5,%xmm2
movapd %xmm6,%xmm1
mulsd  %xmm6,%xmm1
movapd %xmm6,%xmm0
unpckhpd %xmm6,%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movapd %xmm5,0x10(%rsp)
jb     1524 <logerf2+0x3d4>
sqrtsd %xmm0,%xmm0
jmp    1564 <logerf2+0x414>
movapd %xmm2,0x60(%rsp)
movapd %xmm4,0x50(%rsp)
movapd %xmm6,0x20(%rsp)
call   1060 <sqrt@plt>
xorpd  %xmm1,%xmm1
movapd 0x20(%rsp),%xmm6
movapd 0x50(%rsp),%xmm4
movapd 0x60(%rsp),%xmm2
movapd 0x10(%rsp),%xmm5
movapd 0x30(%rsp),%xmm8
movapd (%rsp),%xmm9
movapd %xmm4,%xmm7
mulsd  %xmm8,%xmm7
mulsd  %xmm9,%xmm2
mulsd  %xmm8,%xmm9
mulsd  %xmm5,%xmm4
ucomisd %xmm1,%xmm0
jbe    158d <logerf2+0x43d>
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
divpd  %xmm1,%xmm6
movapd %xmm2,%xmm5
mulsd  %xmm6,%xmm5
movapd %xmm6,%xmm3
unpckhpd %xmm6,%xmm3
movapd %xmm3,%xmm1
mulsd  %xmm7,%xmm1
addsd  %xmm5,%xmm1
mulsd  %xmm3,%xmm2
mulsd  %xmm6,%xmm7
subsd  %xmm7,%xmm2
movapd %xmm4,%xmm5
mulsd  %xmm6,%xmm5
mulsd  %xmm3,%xmm4
mulsd  %xmm9,%xmm3
addsd  %xmm5,%xmm3
mulsd  %xmm9,%xmm6
subsd  %xmm6,%xmm4
movapd %xmm0,(%rsp)
call   1070 <eigenerf2@plt>
movapd (%rsp),%xmm1
mulsd  %xmm1,%xmm1
movapd %xmm1,(%rsp)
movapd (%rsp),%xmm1
mulsd  0xa18(%rip),%xmm1
movapd %xmm1,(%rsp)
movapd (%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
movapd 0x30(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
call   1040 <log@plt>
movapd (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x80,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@DBL_EPSILON = global double 0.000000e+00
define double @logerf2(double %0, double %1, double %2, double %3, double %4) {
%6 = load double, double* @DBL_EPSILON
%7 = tail call double @pow(double %6, double 0x3FE5555555555555)
%8 = fcmp ogt double %0, 0.000000e+00
%9 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %2)
br i1 %8, label %10, label %12
10: ; preds = %5
%11 = fdiv double 1.000000e+00, %9
br label %15
12: ; preds = %5
%13 = fmul double %2, %2
%14 = fdiv double %9, %13
br label %15
15: ; preds = %12, %10
%16 = phi double [ %11, %10 ], [ %14, %12 ]
%17 = fcmp ogt double %1, 0.000000e+00
%18 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %4)
br i1 %17, label %19, label %21
19: ; preds = %15
%20 = fdiv double 1.000000e+00, %18
br label %24
21: ; preds = %15
%22 = fmul double %4, %4
%23 = fdiv double %18, %22
br label %24
24: ; preds = %21, %19
%25 = phi double [ %20, %19 ], [ %23, %21 ]
%26 = fmul double %3, %3
%27 = fmul double %26, %16
%28 = fmul double %27, %25
%29 = load double, double* @DBL_EPSILON
%30 = fcmp ugt double %28, %29
br i1 %30, label %35, label %31
31: ; preds = %24
%32 = tail call double @logerf(double %0, double %2)
%33 = tail call double @logerf(double %1, double %4)
%34 = fadd double %32, %33
br label %130
35: ; preds = %24
%36 = fcmp ult double %2, %4
br i1 %36, label %51, label %37
37: ; preds = %35
%38 = fsub double %2, %4
%39 = fmul double %38, 5.000000e-01
%40 = tail call double @llvm.fmuladd.f64(double %39, double %39, double %26)
%41 = tail call double @sqrt(double %40)
%42 = fadd double %39, %41
%43 = tail call double @llvm.fmuladd.f64(double %42, double %42, double %26)
%44 = tail call double @sqrt(double %43)
%45 = fadd double %42, %4
%46 = insertelement <2 x double> poison, double %3, i64 0
%47 = insertelement <2 x double> %46, double %42, i64 1
%48 = insertelement <2 x double> poison, double %44, i64 0
%49 = shufflevector <2 x double> %48, <2 x double> poison, <2 x i32> zeroinitializer
%50 = fdiv <2 x double> %47, %49
br label %65
51: ; preds = %35
%52 = fsub double %4, %2
%53 = fmul double %52, 5.000000e-01
%54 = tail call double @llvm.fmuladd.f64(double %53, double %53, double %26)
%55 = tail call double @sqrt(double %54)
%56 = fadd double %53, %55
%57 = tail call double @llvm.fmuladd.f64(double %56, double %56, double %26)
%58 = tail call double @sqrt(double %57)
%59 = fadd double %56, %2
%60 = insertelement <2 x double> poison, double %3, i64 1
%61 = insertelement <2 x double> %60, double %56, i64 0
%62 = insertelement <2 x double> poison, double %58, i64 0
%63 = shufflevector <2 x double> %62, <2 x double> poison, <2 x i32> zeroinitializer
%64 = fdiv <2 x double> %61, %63
br label %65
65: ; preds = %51, %37
%66 = phi double [ %45, %37 ], [ %59, %51 ]
%67 = phi <2 x double> [ %50, %37 ], [ %64, %51 ]
%68 = fneg double %26
%69 = tail call double @llvm.fmuladd.f64(double %2, double %4, double %68)
%70 = fdiv double %69, %66
%71 = fmul double %2, %4
%72 = tail call double @sqrt(double %71)
%73 = fmul double %7, %72
%74 = fcmp olt double %70, %73
br i1 %74, label %75, label %78
75: ; preds = %65
%76 = tail call double @sqrt(double %71)
%77 = fmul double %7, %76
br label %78
78: ; preds = %75, %65
%79 = phi double [ %77, %75 ], [ %70, %65 ]
%80 = tail call double @sqrt(double %66)
%81 = tail call double @sqrt(double %79)
%82 = fneg double %0
%83 = extractelement <2 x double> %67, i64 1
%84 = extractelement <2 x double> %67, i64 0
%85 = shufflevector <2 x double> %67, <2 x double> undef, <2 x i32> <i32 1, i32 0>
%86 = insertelement <2 x double> poison, double %1, i64 0
%87 = shufflevector <2 x double> %86, <2 x double> poison, <2 x i32> zeroinitializer
%88 = fmul <2 x double> %85, %87
%89 = insertelement <2 x double> poison, double %0, i64 1
%90 = insertelement <2 x double> %89, double %82, i64 0
%91 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %90, <2 x double> %67, <2 x double> %88)
%92 = insertelement <2 x double> poison, double %81, i64 0
%93 = insertelement <2 x double> %92, double %80, i64 1
%94 = fdiv <2 x double> %91, %93
%95 = fmul double %83, %80
%96 = fneg double %81
%97 = fmul double %84, %96
%98 = fmul double %84, %80
%99 = fmul double %83, %81
%100 = fmul <2 x double> %94, %94
%101 = extractelement <2 x double> %100, i64 0
%102 = extractelement <2 x double> %94, i64 1
%103 = tail call double @llvm.fmuladd.f64(double %102, double %102, double %101)
%104 = tail call double @sqrt(double %103)
%105 = fcmp ogt double %104, 0.000000e+00
br i1 %105, label %106, label %110
106: ; preds = %78
%107 = insertelement <2 x double> poison, double %104, i64 0
%108 = shufflevector <2 x double> %107, <2 x double> poison, <2 x i32> zeroinitializer
%109 = fdiv <2 x double> %94, %108
br label %110
110: ; preds = %106, %78
%111 = phi <2 x double> [ %109, %106 ], [ %94, %78 ]
%112 = extractelement <2 x double> %111, i64 0
%113 = fmul double %97, %112
%114 = extractelement <2 x double> %111, i64 1
%115 = tail call double @llvm.fmuladd.f64(double %114, double %95, double %113)
%116 = fneg double %112
%117 = fmul double %97, %114
%118 = tail call double @llvm.fmuladd.f64(double %116, double %95, double %117)
%119 = fmul double %99, %112
%120 = tail call double @llvm.fmuladd.f64(double %114, double %98, double %119)
%121 = fmul double %99, %114
%122 = tail call double @llvm.fmuladd.f64(double %116, double %98, double %121)
%123 = tail call double @eigenerf2(double %104, double %115, double %118, double %120, double %122)
%124 = fmul double %104, %104
%125 = fmul double %124, 5.000000e-01
%126 = fadd double %125, %123
%127 = fmul double %80, %81
%128 = tail call double @log(double %127)
%129 = fsub double %126, %128
br label %130
130: ; preds = %110, %31
%131 = phi double [ %34, %31 ], [ %129, %110 ]
ret double %131
}