#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 M_PI;
double sqrt(double);
double el_circumference_accurate(double semiMajor, double semiMinor) {
  double abOverAb = (semiMajor - semiMinor) / (semiMajor + semiMinor);
  double abOverAbSquare3 = 3.0 * abOverAb * abOverAb;
  return M_PI * (semiMajor + semiMinor) *
         (1.0 + abOverAbSquare3 / (10.0 + sqrt(4.0 - abOverAbSquare3)));
}


x86 assembly (clang, -O0):
<el_circumference_accurate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xed1(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0x2e8b(%rip),%rax
movsd  (%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe8a(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  -0x30(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x28(%rbp),%xmm0
movsd  0xe63(%rip),%xmm1
addsd  %xmm3,%xmm1
divsd  %xmm1,%xmm2
movsd  0xe4b(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<el_circumference_accurate>:
sub    $0x18,%rsp
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm0
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
movsd  0xed4(%rip),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
mov    0x2ead(%rip),%rax
mulsd  (%rax),%xmm2
movsd  0xec1(%rip),%xmm0
subsd  %xmm3,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     115b <el_circumference_accurate+0x4b>
sqrtsd %xmm0,%xmm0
jmp    1178 <el_circumference_accurate+0x68>
movsd  %xmm2,0x10(%rsp)
movsd  %xmm3,0x8(%rsp)
call   1030 <sqrt@plt>
movsd  0x8(%rsp),%xmm3
movsd  0x10(%rsp),%xmm2
addsd  0xe90(%rip),%xmm0
divsd  %xmm0,%xmm3
addsd  0xe8c(%rip),%xmm3
mulsd  %xmm3,%xmm2
movapd %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @el_circumference_accurate(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fsub double %7, %8
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fadd double %10, %11
%13 = fdiv double %9, %12
store double %13, double* %5
%14 = load double, double* %5
%15 = fmul double 3.000000e+00, %14
%16 = load double, double* %5
%17 = fmul double %15, %16
store double %17, double* %6
%18 = load double, double* @M_PI
%19 = load double, double* %3
%20 = load double, double* %4
%21 = fadd double %19, %20
%22 = fmul double %18, %21
%23 = load double, double* %6
%24 = load double, double* %6
%25 = fsub double 4.000000e+00, %24
%26 = call double @sqrt(double %25)
%27 = fadd double 1.000000e+01, %26
%28 = fdiv double %23, %27
%29 = fadd double 1.000000e+00, %28
%30 = fmul double %22, %29
ret double %30
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @el_circumference_accurate(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fadd double %0, %1
%5 = fdiv double %3, %4
%6 = fmul double %5, 3.000000e+00
%7 = fmul double %5, %6
%8 = load double, double* @M_PI
%9 = fmul double %4, %8
%10 = fsub double 4.000000e+00, %7
%11 = tail call double @sqrt(double %10)
%12 = fadd double %11, 1.000000e+01
%13 = fdiv double %7, %12
%14 = fadd double %13, 1.000000e+00
%15 = fmul double %9, %14
ret double %15
}