#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(double);
double ellec(double k) {
  double m1, a1, a2, a3, a4, b1, b2, b3, b4, ee1, ee2, ellec_val;
  m1 = 1.0 - 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.0 + m1 * (a1 + m1 * (a2 + m1 * (a3 + m1 * a4)));
  ee2 = m1 * (b1 + m1 * (b2 + m1 * (b3 + m1 * b4))) * log(1.0 / m1);
  ellec_val = ee1 + ee2;
  return (ellec_val);
}


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,-0x70(%rbp)
movsd  0xd9f(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ellec>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xedc(%rip),%xmm0
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
movsd  0xed4(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xed0(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xecc(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xec8(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xeba(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xeb6(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xeb2(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xeae(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%rsp)
divsd  %xmm2,%xmm0
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
%14 = alloca double
store double %0, double* %2
%15 = load double, double* %2
%16 = load double, double* %2
%17 = fneg double %15
%18 = call double @llvm.fmuladd.f64(double %17, double %16, double 1.000000e+00)
store double %18, 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
%19 = load double, double* %3
%20 = load double, double* %4
%21 = load double, double* %3
%22 = load double, double* %5
%23 = load double, double* %3
%24 = load double, double* %6
%25 = load double, double* %3
%26 = load double, double* %7
%27 = call double @llvm.fmuladd.f64(double %25, double %26, double %24)
%28 = call double @llvm.fmuladd.f64(double %23, double %27, double %22)
%29 = call double @llvm.fmuladd.f64(double %21, double %28, double %20)
%30 = call double @llvm.fmuladd.f64(double %19, double %29, double 1.000000e+00)
store double %30, double* %12
%31 = load double, double* %3
%32 = load double, double* %8
%33 = load double, double* %3
%34 = load double, double* %9
%35 = load double, double* %3
%36 = load double, double* %10
%37 = load double, double* %3
%38 = load double, double* %11
%39 = call double @llvm.fmuladd.f64(double %37, double %38, double %36)
%40 = call double @llvm.fmuladd.f64(double %35, double %39, double %34)
%41 = call double @llvm.fmuladd.f64(double %33, double %40, double %32)
%42 = fmul double %31, %41
%43 = load double, double* %3
%44 = fdiv double 1.000000e+00, %43
%45 = call double @log(double %44)
%46 = fmul double %42, %45
store double %46, double* %13
%47 = load double, double* %12
%48 = load double, double* %13
%49 = fadd double %47, %48
store double %49, double* %14
%50 = load double, double* %14
ret double %50
}

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 = tail call double @log(double %12)
%14 = fmul double %11, %13
%15 = fadd double %7, %14
ret double %15
}