#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 */
float M_PI_4;
double fabs(float);
float fastatan(float x) {
  return M_PI_4 * x - x * (fabs(x) - 1) * (0.2447 + 0.0663 * fabs(x));
}


x86 assembly (clang, -O0):
<fastatan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    0x2ec4(%rip),%rax
movss  (%rax),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  0xeb2(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabs@plt>
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
movsd  0xe76(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe72(%rip),%xmm3
addsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastatan>:
sub    $0x18,%rsp
movaps %xmm0,%xmm1
movss  %xmm0,0xc(%rsp)
mov    0x2ec4(%rip),%rax
movss  (%rax),%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movaps %xmm1,%xmm0
call   1030 <fabs@plt>
addsd  0xeae(%rip),%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <fabs@plt>
mulsd  0xe99(%rip),%xmm0
addsd  0xe99(%rip),%xmm0
mulsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI_4 = global float 0.000000e+00
define float @fastatan(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* @M_PI_4
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = load float, float* %2
%10 = call double @fabs(float %9)
%11 = fsub double %10, 1.000000e+00
%12 = fmul double %8, %11
%13 = load float, float* %2
%14 = call double @fabs(float %13)
%15 = call double @llvm.fmuladd.f64(double 6.630000e-02, double %14, double 2.447000e-01)
%16 = fneg double %12
%17 = call double @llvm.fmuladd.f64(double %16, double %15, double %6)
%18 = fptrunc double %17 to float
ret float %18
}

LLVM IR (-O2):
@M_PI_4 = global float 0.000000e+00
define float @fastatan(float %0) {
%2 = load float, float* @M_PI_4
%3 = fmul float %2, %0
%4 = fpext float %3 to double
%5 = fpext float %0 to double
%6 = tail call double @fabs(float %0)
%7 = fadd double %6, -1.000000e+00
%8 = tail call double @fabs(float %0)
%9 = tail call double @llvm.fmuladd.f64(double %8, double 6.630000e-02, double 2.447000e-01)
%10 = fneg double %7
%11 = fmul double %5, %10
%12 = tail call double @llvm.fmuladd.f64(double %11, double %9, double %4)
%13 = fptrunc double %12 to float
ret float %13
}