#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 log(int);
double ellec(double k) {
  double m1, a1, a2, a3, a4, b1, b2, b3, b4, ee1, ee2;
  m1 = 1. - k * k;
  a1 = 0.44325141463;
  a2 = 0.06260601220;
  a3 = 0.04757383546;
  a4 = 0.01736506451;
  b1 = 0.24998368310;
  b2 = 0.09200180037;
  b3 = 0.04069697526;
  b4 = 0.00526449639;
  ee1 = 1. + m1 * (a1 + m1 * (a2 + m1 * (a3 + m1 * a4)));
  ee2 = m1 * (b1 + m1 * (b2 + m1 * (b3 + m1 * b4))) * log(1. / m1);
  return ee1 + ee2;
}


x86 assembly (clang, -O0):
<ellec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xea6(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe91(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe7c(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe67(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe52(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm4
movsd  -0x10(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm6
movsd  -0x10(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm7
mulsd  %xmm7,%xmm5
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdf9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm4
movsd  -0x10(%rbp),%xmm3
movsd  -0x48(%rbp),%xmm6
movsd  -0x10(%rbp),%xmm5
movsd  -0x50(%rbp),%xmm7
mulsd  %xmm7,%xmm5
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xd9f(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ellec>:
sub    $0x18,%rsp
mulsd  %xmm0,%xmm0
movsd  0xee0(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
movsd  0xed8(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xed4(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xed0(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xecc(%rip),%xmm0
movsd  0xecc(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  0xec8(%rip),%xmm3
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm3
addsd  0xec0(%rip),%xmm3
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
mulsd  %xmm2,%xmm3
addsd  0xeb2(%rip),%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,0x8(%rsp)
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <log@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ellec(double %0) {
%2 = alloca double
%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* %2
%14 = load double, double* %2
%15 = load double, double* %2
%16 = fneg double %14
%17 = call double @llvm.fmuladd.f64(double %16, double %15, double 1.000000e+00)
store double %17, double* %3
store double 0x3FDC5E3B2E6F7625, double* %4
store double 0x3FB006F296EE960C, double* %5
store double 0x3FA85B9906E45829, double* %6
store double 0x3F91C825C0A74D28, double* %7
store double 0x3FCFFF771FB95C41, double* %8
store double 0x3FB78D6E13C3242C, double* %9
store double 0x3FA4D63BE3935D49, double* %10
store double 0x3F7590397D330952, double* %11
%18 = load double, double* %3
%19 = load double, double* %4
%20 = load double, double* %3
%21 = load double, double* %5
%22 = load double, double* %3
%23 = load double, double* %6
%24 = load double, double* %3
%25 = load double, double* %7
%26 = call double @llvm.fmuladd.f64(double %24, double %25, double %23)
%27 = call double @llvm.fmuladd.f64(double %22, double %26, double %21)
%28 = call double @llvm.fmuladd.f64(double %20, double %27, double %19)
%29 = call double @llvm.fmuladd.f64(double %18, double %28, double 1.000000e+00)
store double %29, double* %12
%30 = load double, double* %3
%31 = load double, double* %8
%32 = load double, double* %3
%33 = load double, double* %9
%34 = load double, double* %3
%35 = load double, double* %10
%36 = load double, double* %3
%37 = load double, double* %11
%38 = call double @llvm.fmuladd.f64(double %36, double %37, double %35)
%39 = call double @llvm.fmuladd.f64(double %34, double %38, double %33)
%40 = call double @llvm.fmuladd.f64(double %32, double %39, double %31)
%41 = fmul double %30, %40
%42 = load double, double* %3
%43 = fdiv double 1.000000e+00, %42
%44 = fptosi double %43 to i32
%45 = call double @log(i32 %44)
%46 = fmul double %41, %45
store double %46, double* %13
%47 = load double, double* %12
%48 = load double, double* %13
%49 = fadd double %47, %48
ret double %49
}

LLVM IR (-O2):
define double @ellec(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = tail call double @llvm.fmuladd.f64(double %3, double 0x3F91C825C0A74D28, double 0x3FA85B9906E45829)
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double 0x3FB006F296EE960C)
%6 = tail call double @llvm.fmuladd.f64(double %3, double %5, double 0x3FDC5E3B2E6F7625)
%7 = tail call double @llvm.fmuladd.f64(double %3, double %6, double 1.000000e+00)
%8 = tail call double @llvm.fmuladd.f64(double %3, double 0x3F7590397D330952, double 0x3FA4D63BE3935D49)
%9 = tail call double @llvm.fmuladd.f64(double %3, double %8, double 0x3FB78D6E13C3242C)
%10 = tail call double @llvm.fmuladd.f64(double %3, double %9, double 0x3FCFFF771FB95C41)
%11 = fmul double %3, %10
%12 = fdiv double 1.000000e+00, %3
%13 = fptosi double %12 to i32
%14 = tail call double @log(i32 %13)
%15 = fmul double %11, %14
%16 = fadd double %7, %15
ret double %16
}