#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 atan(double);
double log(double);
double pow(double, double);
double sqrt(double);
double f4a(double x) {
  double k = 2.0;
  double m = 0.25;
  return ((-k * atan(1.0 - pow(k, m) * x) + k * atan(1.0 + pow(k, m) * x) -
           log(k - k * pow(k, m) * x + sqrt(k) * x * x) +
           log(k + k * pow(k, m) * x + sqrt(k) * x * x)) /
          (8.0 * pow(k, m)));
}


x86 assembly (clang, -O0):
<f4a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1050 <pow@plt>
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe46(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <atan@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1050 <pow@plt>
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe0e(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <atan@plt>
movsd  -0x78(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1050 <pow@plt>
movsd  -0x60(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm0
movsd  -0x8(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  -0x50(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1050 <pow@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm2,%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  -0x30(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1050 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xcaa(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4a>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
movsd  0xeca(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xec6(%rip),%xmm0
call   1030 <atan@plt>
movsd  %xmm0,(%rsp)
movsd  0xebc(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0xea6(%rip),%xmm0
call   1030 <atan@plt>
addsd  %xmm0,%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe93(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
addsd  0xe89(%rip),%xmm0
movsd  0xe89(%rip),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
addsd  %xmm2,%xmm0
call   1040 <log@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe5e(%rip),%xmm0
addsd  0xe46(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
call   1040 <log@plt>
addsd  (%rsp),%xmm0
divsd  0xe46(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f4a(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 2.000000e+00, double* %3
store double 2.500000e-01, double* %4
%5 = load double, double* %3
%6 = fneg double %5
%7 = load double, double* %3
%8 = load double, double* %4
%9 = call double @pow(double %7, double %8)
%10 = load double, double* %2
%11 = fneg double %9
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double 1.000000e+00)
%13 = call double @atan(double %12)
%14 = load double, double* %3
%15 = load double, double* %3
%16 = load double, double* %4
%17 = call double @pow(double %15, double %16)
%18 = load double, double* %2
%19 = call double @llvm.fmuladd.f64(double %17, double %18, double 1.000000e+00)
%20 = call double @atan(double %19)
%21 = fmul double %14, %20
%22 = call double @llvm.fmuladd.f64(double %6, double %13, double %21)
%23 = load double, double* %3
%24 = load double, double* %3
%25 = load double, double* %3
%26 = load double, double* %4
%27 = call double @pow(double %25, double %26)
%28 = fmul double %24, %27
%29 = load double, double* %2
%30 = fneg double %28
%31 = call double @llvm.fmuladd.f64(double %30, double %29, double %23)
%32 = load double, double* %3
%33 = call double @sqrt(double %32)
%34 = load double, double* %2
%35 = fmul double %33, %34
%36 = load double, double* %2
%37 = call double @llvm.fmuladd.f64(double %35, double %36, double %31)
%38 = call double @log(double %37)
%39 = fsub double %22, %38
%40 = load double, double* %3
%41 = load double, double* %3
%42 = load double, double* %3
%43 = load double, double* %4
%44 = call double @pow(double %42, double %43)
%45 = fmul double %41, %44
%46 = load double, double* %2
%47 = call double @llvm.fmuladd.f64(double %45, double %46, double %40)
%48 = load double, double* %3
%49 = call double @sqrt(double %48)
%50 = load double, double* %2
%51 = fmul double %49, %50
%52 = load double, double* %2
%53 = call double @llvm.fmuladd.f64(double %51, double %52, double %47)
%54 = call double @log(double %53)
%55 = fadd double %39, %54
%56 = load double, double* %3
%57 = load double, double* %4
%58 = call double @pow(double %56, double %57)
%59 = fmul double 8.000000e+00, %58
%60 = fdiv double %55, %59
ret double %60
}

LLVM IR (-O2):
define double @f4a(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0xBFF306FE0A31B715, double 1.000000e+00)
%3 = tail call double @atan(double %2)
%4 = tail call double @llvm.fmuladd.f64(double %0, double 0x3FF306FE0A31B715, double 1.000000e+00)
%5 = tail call double @atan(double %4)
%6 = fmul double %5, 2.000000e+00
%7 = tail call double @llvm.fmuladd.f64(double %3, double -2.000000e+00, double %6)
%8 = tail call double @llvm.fmuladd.f64(double %0, double 0xC00306FE0A31B715, double 2.000000e+00)
%9 = fmul double %0, 0x3FF6A09E667F3BCD
%10 = tail call double @llvm.fmuladd.f64(double %9, double %0, double %8)
%11 = tail call double @log(double %10)
%12 = fsub double %7, %11
%13 = tail call double @llvm.fmuladd.f64(double %0, double 0x400306FE0A31B715, double 2.000000e+00)
%14 = tail call double @llvm.fmuladd.f64(double %9, double %0, double %13)
%15 = tail call double @log(double %14)
%16 = fadd double %15, %12
%17 = fdiv double %16, 0x402306FE0A31B715
ret double %17
}