#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 INFINITY;
double M_PI;
int M_PI_2;
double atan(double);
int fabs(double);
int log(int);
double sin(double);
int sqrt(double);
double elliptic_f(double phi, double m) {
  double g, h, k, n, p, r, y, sp;
  sp = sin(phi);
  h = sp * sp;
  k = sqrt(1 - m);
  if (h >= 1 || fabs(phi) == M_PI_2) {
    if (k <= 1e-5)
      return sp < 0 ? -INFINITY : INFINITY;
    m = 1;
    h = m;
    m += k;
    while (fabs(h - k) > 1e-3 * m) {
      k = sqrt(h * k);
      m /= 2;
      h = m;
      m += k;
    }
    return sp < 0 ? -M_PI / m : M_PI / m;
  } else {
    if (k <= 1e-5)
      return log((1 + sp) / (1 - sp)) / 2;
    y = sqrt((1 - h) / h);
    n = 0;
    m = 1;
    p = m * k;
    g = m;
    m += k;
    y -= p / y;
    if (fabs(y) <= 0)
      y = 1e-9 * sqrt(p);
    while (fabs(g - k) > 1e-3 * g) {
      k = 2 * sqrt(p);
      n += n;
      if (y < 0)
        n += 1;
      p = m * k;
      g = m;
      m += k;
      y -= p / y;
      if (fabs(y) <= 0)
        y = 1e-9 * sqrt(p);
    }
    if (y < 0)
      n += 1;
    r = (atan(m / y) + M_PI * n) / m;
    return sp < 0 ? -r : r;
  }
}


x86 assembly (clang, -O0):
<elliptic_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe78(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1070 <sqrt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe58(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    11cb <elliptic_f+0x7b>
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
mov    0x2e15(%rip),%rcx
cmp    (%rcx),%eax
jne    1336 <elliptic_f+0x1e6>
movsd  0xe35(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
jb     1237 <elliptic_f+0xe7>
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    1218 <elliptic_f+0xc8>
mov    0x2df5(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1228 <elliptic_f+0xd8>
mov    0x2dc9(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    15b4 <elliptic_f+0x464>
movsd  0xdc1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xda0(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    12d3 <elliptic_f+0x183>
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1070 <sqrt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xd74(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    125d <elliptic_f+0x10d>
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    1312 <elliptic_f+0x1c2>
mov    0x2cf8(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1327 <elliptic_f+0x1d7>
mov    0x2cc7(%rip),%rax
movsd  (%rax),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    15b4 <elliptic_f+0x464>
movsd  0xcca(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
jb     1386 <elliptic_f+0x236>
movsd  0xcaf(%rip),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  0xca2(%rip),%xmm1
subsd  -0x58(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <log@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    15b4 <elliptic_f+0x464>
movsd  0xc72(%rip),%xmm0
subsd  -0x28(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
call   1070 <sqrt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xc4a(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x40(%rbp),%xmm1
divsd  -0x50(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1030 <fabs@plt>
cmp    $0x0,%eax
jg     142d <elliptic_f+0x2dd>
movsd  -0x40(%rbp),%xmm0
call   1070 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xbec(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1432 <elliptic_f+0x2e2>
movsd  -0x20(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xbcb(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    1518 <elliptic_f+0x3c8>
movsd  -0x40(%rbp),%xmm0
call   1070 <sqrt@plt>
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    14a1 <elliptic_f+0x351>
movsd  0xb69(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x40(%rbp),%xmm1
divsd  -0x50(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1030 <fabs@plt>
cmp    $0x0,%eax
jg     1513 <elliptic_f+0x3c3>
movsd  -0x40(%rbp),%xmm0
call   1070 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xb06(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1432 <elliptic_f+0x2e2>
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    1538 <elliptic_f+0x3e8>
movsd  0xad2(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
call   1050 <atan@plt>
movaps %xmm0,%xmm1
mov    0x2a8f(%rip),%rax
movsd  (%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    15a0 <elliptic_f+0x450>
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    15aa <elliptic_f+0x45a>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elliptic_f>:
push   %rbx
sub    $0x70,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x20(%rsp)
call   1040 <sin@plt>
movapd %xmm0,0x40(%rsp)
mulsd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe83(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
call   1070 <sqrt@plt>
movsd  0xe70(%rip),%xmm0
mov    %eax,%ebx
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm2
ucomisd %xmm0,%xmm2
movsd  %xmm1,0x8(%rsp)
jae    11d2 <elliptic_f+0x82>
movsd  0x20(%rsp),%xmm0
call   1030 <fabs@plt>
movsd  0xe43(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mov    0x2e0e(%rip),%rcx
cmp    (%rcx),%eax
jne    1300 <elliptic_f+0x1b0>
test   %ebx,%ebx
jle    12cd <elliptic_f+0x17d>
movapd %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
movsd  (%rsp),%xmm4
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xe0c(%rip),%xmm1
mulsd  %xmm4,%xmm1
ucomisd %xmm1,%xmm0
jbe    1292 <elliptic_f+0x142>
movsd  0x8(%rsp),%xmm1
movsd  0xde0(%rip),%xmm0
movsd  %xmm4,(%rsp)
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1070 <sqrt@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  (%rsp),%xmm0
mulsd  0xdcc(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
movsd  (%rsp),%xmm4
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm4,%xmm1
mulsd  0xd90(%rip),%xmm1
ucomisd %xmm1,%xmm0
movsd  0x20(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
ja     1220 <elliptic_f+0xd0>
mov    0x2d47(%rip),%rax
movsd  (%rax),%xmm3
movapd 0xd8b(%rip),%xmm1
xorpd  %xmm3,%xmm1
xorpd  %xmm2,%xmm2
movapd 0x40(%rsp),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm3,%xmm0
orpd   %xmm1,%xmm0
divsd  %xmm4,%xmm0
jmp    159a <elliptic_f+0x44a>
mov    0x2d14(%rip),%rax
movsd  (%rax),%xmm3
movapd 0xd50(%rip),%xmm1
xorpd  %xmm3,%xmm1
xorpd  %xmm2,%xmm2
movapd 0x40(%rsp),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm3,%xmm0
jmp    1596 <elliptic_f+0x446>
movsd  0xcf8(%rip),%xmm0
test   %ebx,%ebx
jle    14c1 <elliptic_f+0x371>
movsd  (%rsp),%xmm2
subsd  %xmm2,%xmm0
divsd  %xmm2,%xmm0
call   1070 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
subsd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
call   1030 <fabs@plt>
test   %eax,%eax
jg     1366 <elliptic_f+0x216>
movsd  0x8(%rsp),%xmm0
call   1070 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xca8(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm2
movapd %xmm2,%xmm0
movsd  0xc88(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
call   1030 <fabs@plt>
xorpd  %xmm0,%xmm0
test   %eax,%eax
jle    14f5 <elliptic_f+0x3a5>
movapd %xmm0,0x20(%rsp)
movaps 0x10(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
jmp    1429 <elliptic_f+0x2d9>
nopl   0x0(%rax)
movapd 0x10(%rsp),%xmm1
cmpltsd 0xc61(%rip),%xmm1
movapd %xmm1,%xmm0
andnpd 0x20(%rsp),%xmm0
andpd  0x60(%rsp),%xmm1
orpd   %xmm0,%xmm1
movapd %xmm1,0x20(%rsp)
movsd  (%rsp),%xmm0
movapd %xmm0,%xmm2
movsd  0x58(%rsp),%xmm1
addsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
movsd  0x10(%rsp),%xmm3
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%rsp),%xmm1
mulsd  0xbfb(%rip),%xmm1
ucomisd %xmm1,%xmm0
movaps 0x30(%rsp),%xmm0
movsd  %xmm3,(%rsp)
jbe    150a <elliptic_f+0x3ba>
movaps %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <sqrt@plt>
add    %eax,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movapd 0x20(%rsp),%xmm0
addsd  %xmm0,%xmm0
movapd %xmm0,0x20(%rsp)
addsd  0xba6(%rip),%xmm0
movapd %xmm0,0x60(%rsp)
movsd  (%rsp),%xmm0
movsd  %xmm1,0x58(%rsp)
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm0,%xmm1
divsd  0x10(%rsp),%xmm1
movapd 0x30(%rsp),%xmm0
subsd  %xmm1,%xmm0
movapd %xmm0,0x30(%rsp)
call   1030 <fabs@plt>
test   %eax,%eax
jg     13b0 <elliptic_f+0x260>
movsd  0x8(%rsp),%xmm0
call   1070 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xb52(%rip),%xmm0
movapd %xmm0,0x30(%rsp)
jmp    13b0 <elliptic_f+0x260>
movapd 0x40(%rsp),%xmm2
movapd %xmm2,%xmm1
addsd  %xmm0,%xmm1
subsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1060 <log@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
jmp    159a <elliptic_f+0x44a>
movapd %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm3
movaps 0x10(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
movsd  %xmm3,0x10(%rsp)
movsd  0xae8(%rip),%xmm1
movapd 0x20(%rsp),%xmm2
addsd  %xmm2,%xmm1
movapd %xmm3,%xmm0
movapd 0x30(%rsp),%xmm3
divsd  %xmm3,%xmm0
xorpd  %xmm5,%xmm5
cmpltsd %xmm5,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm2,%xmm3
orpd   %xmm1,%xmm3
movapd %xmm3,0x30(%rsp)
call   1050 <atan@plt>
mov    0x2a89(%rip),%rax
movapd 0x30(%rsp),%xmm1
mulsd  (%rax),%xmm1
addsd  %xmm0,%xmm1
divsd  0x10(%rsp),%xmm1
movapd 0xabd(%rip),%xmm2
xorpd  %xmm1,%xmm2
movapd %xmm1,%xmm3
movapd 0x40(%rsp),%xmm0
cmpltsd 0xa96(%rip),%xmm0
movapd %xmm0,%xmm1
andnpd %xmm3,%xmm1
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI_2 = global i32 0
@INFINITY = global double 0.000000e+00
@M_PI = global double 0.000000e+00
define double @elliptic_f(double %0, double %1) {
%3 = alloca double
%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
store double %0, double* %4
store double %1, double* %5
%14 = load double, double* %4
%15 = call double @sin(double %14)
store double %15, double* %13
%16 = load double, double* %13
%17 = load double, double* %13
%18 = fmul double %16, %17
store double %18, double* %7
%19 = load double, double* %5
%20 = fsub double 1.000000e+00, %19
%21 = call i32 @sqrt(double %20)
%22 = sitofp i32 %21 to double
store double %22, double* %8
%23 = load double, double* %7
%24 = fcmp oge double %23, 1.000000e+00
br i1 %24, label %30, label %25
25: ; preds = %2
%26 = load double, double* %4
%27 = call i32 @fabs(double %26)
%28 = load i32, i32* @M_PI_2
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %83
30: ; preds = %25, %2
%31 = load double, double* %8
%32 = fcmp ole double %31, 1.000000e-05
br i1 %32, label %33, label %43
33: ; preds = %30
%34 = load double, double* %13
%35 = fcmp olt double %34, 0.000000e+00
br i1 %35, label %36, label %39
36: ; preds = %33
%37 = load double, double* @INFINITY
%38 = fneg double %37
br label %41
39: ; preds = %33
%40 = load double, double* @INFINITY
br label %41
41: ; preds = %39, %36
%42 = phi double [ %38, %36 ], [ %40, %39 ]
store double %42, double* %3
br label %193
43: ; preds = %30
store double 1.000000e+00, double* %5
%44 = load double, double* %5
store double %44, double* %7
%45 = load double, double* %8
%46 = load double, double* %5
%47 = fadd double %46, %45
store double %47, double* %5
br label %48
48: ; preds = %57, %43
%49 = load double, double* %7
%50 = load double, double* %8
%51 = fsub double %49, %50
%52 = call i32 @fabs(double %51)
%53 = sitofp i32 %52 to double
%54 = load double, double* %5
%55 = fmul double 1.000000e-03, %54
%56 = fcmp ogt double %53, %55
br i1 %56, label %57, label %69
57: ; preds = %48
%58 = load double, double* %7
%59 = load double, double* %8
%60 = fmul double %58, %59
%61 = call i32 @sqrt(double %60)
%62 = sitofp i32 %61 to double
store double %62, double* %8
%63 = load double, double* %5
%64 = fdiv double %63, 2.000000e+00
store double %64, double* %5
%65 = load double, double* %5
store double %65, double* %7
%66 = load double, double* %8
%67 = load double, double* %5
%68 = fadd double %67, %66
store double %68, double* %5
br label %48
69: ; preds = %48
%70 = load double, double* %13
%71 = fcmp olt double %70, 0.000000e+00
br i1 %71, label %72, label %77
72: ; preds = %69
%73 = load double, double* @M_PI
%74 = fneg double %73
%75 = load double, double* %5
%76 = fdiv double %74, %75
br label %81
77: ; preds = %69
%78 = load double, double* @M_PI
%79 = load double, double* %5
%80 = fdiv double %78, %79
br label %81
81: ; preds = %77, %72
%82 = phi double [ %76, %72 ], [ %80, %77 ]
store double %82, double* %3
br label %193
83: ; preds = %25
%84 = load double, double* %8
%85 = fcmp ole double %84, 1.000000e-05
br i1 %85, label %86, label %96
86: ; preds = %83
%87 = load double, double* %13
%88 = fadd double 1.000000e+00, %87
%89 = load double, double* %13
%90 = fsub double 1.000000e+00, %89
%91 = fdiv double %88, %90
%92 = fptosi double %91 to i32
%93 = call i32 @log(i32 %92)
%94 = sdiv i32 %93, 2
%95 = sitofp i32 %94 to double
store double %95, double* %3
br label %193
96: ; preds = %83
%97 = load double, double* %7
%98 = fsub double 1.000000e+00, %97
%99 = load double, double* %7
%100 = fdiv double %98, %99
%101 = call i32 @sqrt(double %100)
%102 = sitofp i32 %101 to double
store double %102, double* %12
store double 0.000000e+00, double* %9
store double 1.000000e+00, double* %5
%103 = load double, double* %5
%104 = load double, double* %8
%105 = fmul double %103, %104
store double %105, double* %10
%106 = load double, double* %5
store double %106, double* %6
%107 = load double, double* %8
%108 = load double, double* %5
%109 = fadd double %108, %107
store double %109, double* %5
%110 = load double, double* %10
%111 = load double, double* %12
%112 = fdiv double %110, %111
%113 = load double, double* %12
%114 = fsub double %113, %112
store double %114, double* %12
%115 = load double, double* %12
%116 = call i32 @fabs(double %115)
%117 = icmp sle i32 %116, 0
br i1 %117, label %118, label %123
118: ; preds = %96
%119 = load double, double* %10
%120 = call i32 @sqrt(double %119)
%121 = sitofp i32 %120 to double
%122 = fmul double 1.000000e-09, %121
store double %122, double* %12
br label %123
123: ; preds = %118, %96
br label %124
124: ; preds = %167, %123
%125 = load double, double* %6
%126 = load double, double* %8
%127 = fsub double %125, %126
%128 = call i32 @fabs(double %127)
%129 = sitofp i32 %128 to double
%130 = load double, double* %6
%131 = fmul double 1.000000e-03, %130
%132 = fcmp ogt double %129, %131
br i1 %132, label %133, label %168
133: ; preds = %124
%134 = load double, double* %10
%135 = call i32 @sqrt(double %134)
%136 = mul nsw i32 2, %135
%137 = sitofp i32 %136 to double
store double %137, double* %8
%138 = load double, double* %9
%139 = load double, double* %9
%140 = fadd double %139, %138
store double %140, double* %9
%141 = load double, double* %12
%142 = fcmp olt double %141, 0.000000e+00
br i1 %142, label %143, label %146
143: ; preds = %133
%144 = load double, double* %9
%145 = fadd double %144, 1.000000e+00
store double %145, double* %9
br label %146
146: ; preds = %143, %133
%147 = load double, double* %5
%148 = load double, double* %8
%149 = fmul double %147, %148
store double %149, double* %10
%150 = load double, double* %5
store double %150, double* %6
%151 = load double, double* %8
%152 = load double, double* %5
%153 = fadd double %152, %151
store double %153, double* %5
%154 = load double, double* %10
%155 = load double, double* %12
%156 = fdiv double %154, %155
%157 = load double, double* %12
%158 = fsub double %157, %156
store double %158, double* %12
%159 = load double, double* %12
%160 = call i32 @fabs(double %159)
%161 = icmp sle i32 %160, 0
br i1 %161, label %162, label %167
162: ; preds = %146
%163 = load double, double* %10
%164 = call i32 @sqrt(double %163)
%165 = sitofp i32 %164 to double
%166 = fmul double 1.000000e-09, %165
store double %166, double* %12
br label %167
167: ; preds = %162, %146
br label %124
168: ; preds = %124
%169 = load double, double* %12
%170 = fcmp olt double %169, 0.000000e+00
br i1 %170, label %171, label %174
171: ; preds = %168
%172 = load double, double* %9
%173 = fadd double %172, 1.000000e+00
store double %173, double* %9
br label %174
174: ; preds = %171, %168
%175 = load double, double* %5
%176 = load double, double* %12
%177 = fdiv double %175, %176
%178 = call double @atan(double %177)
%179 = load double, double* @M_PI
%180 = load double, double* %9
%181 = call double @llvm.fmuladd.f64(double %179, double %180, double %178)
%182 = load double, double* %5
%183 = fdiv double %181, %182
store double %183, double* %11
%184 = load double, double* %13
%185 = fcmp olt double %184, 0.000000e+00
br i1 %185, label %186, label %189
186: ; preds = %174
%187 = load double, double* %11
%188 = fneg double %187
br label %191
189: ; preds = %174
%190 = load double, double* %11
br label %191
191: ; preds = %189, %186
%192 = phi double [ %188, %186 ], [ %190, %189 ]
store double %192, double* %3
br label %193
193: ; preds = %191, %86, %81, %41
%194 = load double, double* %3
ret double %194
}

LLVM IR (-O2):
@M_PI_2 = global i32 0
@INFINITY = global double 0.000000e+00
@M_PI = global double 0.000000e+00
define double @elliptic_f(double %0, double %1) {
%3 = tail call double @sin(double %0)
%4 = fmul double %3, %3
%5 = fsub double 1.000000e+00, %1
%6 = tail call i32 @sqrt(double %5)
%7 = sitofp i32 %6 to double
%8 = fcmp ult double %4, 1.000000e+00
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = tail call i32 @fabs(double %0)
%11 = load i32, i32* @M_PI_2
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %48
13: ; preds = %9, %2
%14 = icmp slt i32 %6, 1
br i1 %14, label %15, label %20
15: ; preds = %13
%16 = fcmp olt double %3, 0.000000e+00
%17 = load double, double* @INFINITY
%18 = fneg double %17
%19 = select i1 %16, double %18, double %17
br label %121
20: ; preds = %13
%21 = fadd double %7, 1.000000e+00
%22 = fsub double 1.000000e+00, %7
%23 = tail call i32 @fabs(double %22)
%24 = sitofp i32 %23 to double
%25 = fmul double %21, 1.000000e-03
%26 = fcmp olt double %25, %24
br i1 %26, label %27, label %41
27: ; preds = %20, %27
%28 = phi double [ %35, %27 ], [ %21, %20 ]
%29 = phi double [ %33, %27 ], [ %7, %20 ]
%30 = phi double [ %34, %27 ], [ 1.000000e+00, %20 ]
%31 = fmul double %30, %29
%32 = tail call i32 @sqrt(double %31)
%33 = sitofp i32 %32 to double
%34 = fmul double %28, 5.000000e-01
%35 = fadd double %34, %33
%36 = fsub double %34, %33
%37 = tail call i32 @fabs(double %36)
%38 = sitofp i32 %37 to double
%39 = fmul double %35, 1.000000e-03
%40 = fcmp olt double %39, %38
br i1 %40, label %27, label %41
41: ; preds = %27, %20
%42 = phi double [ %21, %20 ], [ %35, %27 ]
%43 = fcmp olt double %3, 0.000000e+00
%44 = load double, double* @M_PI
%45 = fneg double %44
%46 = select i1 %43, double %45, double %44
%47 = fdiv double %46, %42
br label %121
48: ; preds = %9
%49 = icmp slt i32 %6, 1
br i1 %49, label %50, label %58
50: ; preds = %48
%51 = fadd double %3, 1.000000e+00
%52 = fsub double 1.000000e+00, %3
%53 = fdiv double %51, %52
%54 = fptosi double %53 to i32
%55 = tail call i32 @log(i32 %54)
%56 = sdiv i32 %55, 2
%57 = sitofp i32 %56 to double
br label %121
58: ; preds = %48
%59 = fsub double 1.000000e+00, %4
%60 = fdiv double %59, %4
%61 = tail call i32 @sqrt(double %60)
%62 = sitofp i32 %61 to double
%63 = fadd double %7, 1.000000e+00
%64 = fdiv double %7, %62
%65 = fsub double %62, %64
%66 = tail call i32 @fabs(double %65)
%67 = icmp slt i32 %66, 1
br i1 %67, label %68, label %72
68: ; preds = %58
%69 = tail call i32 @sqrt(double %7)
%70 = sitofp i32 %69 to double
%71 = fmul double %70, 1.000000e-09
br label %72
72: ; preds = %68, %58
%73 = phi double [ %71, %68 ], [ %65, %58 ]
%74 = fsub double 1.000000e+00, %7
%75 = tail call i32 @fabs(double %74)
%76 = icmp sgt i32 %75, 0
br i1 %76, label %77, label %106
77: ; preds = %72, %99
%78 = phi double [ %100, %99 ], [ %73, %72 ]
%79 = phi double [ %90, %99 ], [ %63, %72 ]
%80 = phi double [ %89, %99 ], [ %7, %72 ]
%81 = phi double [ %88, %99 ], [ 0.000000e+00, %72 ]
%82 = tail call i32 @sqrt(double %80)
%83 = shl nsw i32 %82, 1
%84 = sitofp i32 %83 to double
%85 = fadd double %81, %81
%86 = fcmp olt double %78, 0.000000e+00
%87 = fadd double %85, 1.000000e+00
%88 = select i1 %86, double %87, double %85
%89 = fmul double %79, %84
%90 = fadd double %79, %84
%91 = fdiv double %89, %78
%92 = fsub double %78, %91
%93 = tail call i32 @fabs(double %92)
%94 = icmp slt i32 %93, 1
br i1 %94, label %95, label %99
95: ; preds = %77
%96 = tail call i32 @sqrt(double %89)
%97 = sitofp i32 %96 to double
%98 = fmul double %97, 1.000000e-09
br label %99
99: ; preds = %95, %77
%100 = phi double [ %98, %95 ], [ %92, %77 ]
%101 = fsub double %79, %84
%102 = tail call i32 @fabs(double %101)
%103 = sitofp i32 %102 to double
%104 = fmul double %79, 1.000000e-03
%105 = fcmp olt double %104, %103
br i1 %105, label %77, label %106
106: ; preds = %99, %72
%107 = phi double [ 0.000000e+00, %72 ], [ %88, %99 ]
%108 = phi double [ %63, %72 ], [ %90, %99 ]
%109 = phi double [ %73, %72 ], [ %100, %99 ]
%110 = fcmp olt double %109, 0.000000e+00
%111 = fadd double %107, 1.000000e+00
%112 = select i1 %110, double %111, double %107
%113 = fdiv double %108, %109
%114 = tail call double @atan(double %113)
%115 = load double, double* @M_PI
%116 = tail call double @llvm.fmuladd.f64(double %115, double %112, double %114)
%117 = fdiv double %116, %108
%118 = fcmp olt double %3, 0.000000e+00
%119 = fneg double %117
%120 = select i1 %118, double %119, double %117
br label %121
121: ; preds = %106, %50, %41, %15
%122 = phi double [ %19, %15 ], [ %47, %41 ], [ %57, %50 ], [ %120, %106 ]
ret double %122
}