#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 mlaf(float, float, float);
int signf(float);
__attribute__((visibility("default"))) const float xatanf(float s) {
  float t, u;
  int q = 0;
  if (signf(s) == -1) {
    s = -s;
    q = 2;
  }
  if (s > 1) {
    s = 1.0f / s;
    q |= 1;
  }
  t = s * s;
  float t2 = t * t, t4 = t2 * t2;
  u = mlaf(t4,
           mlaf(t2,
                mlaf(t, (0.00282363896258175373077393f),
                     (-0.0159569028764963150024414f)),
                mlaf(t, (0.0425049886107444763183594f),
                     (-0.0748900920152664184570312f))),
           mlaf(t2,
                mlaf(t, (0.106347933411598205566406f),
                     (-0.142027363181114196777344f)),
                mlaf(t, (0.199926957488059997558594f),
                     (-0.333331018686294555664062f))));
  t = s + s * (t * u);
  if ((q & 1) != 0)
    t = 1.570796326794896557998982f - t;
  if ((q & 2) != 0)
    t = -t;
  return t;
}


x86 assembly (clang, -O0):
<xatanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <signf@plt>
cmp    $0xffffffff,%eax
jne    1165 <xatanf+0x45>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movl   $0x2,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xe8e(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1196 <xatanf+0x76>
movss  0xe7d(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
mov    -0x10(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xe38(%rip),%xmm1
movss  0xe34(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0x30(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xe11(%rip),%xmm1
movss  0xe0d(%rip),%xmm2
call   1030 <mlaf@plt>
movss  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x2c(%rbp),%xmm0
call   1030 <mlaf@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xdce(%rip),%xmm1
movss  0xdca(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xda7(%rip),%xmm1
movss  0xda3(%rip),%xmm2
call   1030 <mlaf@plt>
movss  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x24(%rbp),%xmm0
call   1030 <mlaf@plt>
movss  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x1c(%rbp),%xmm0
call   1030 <mlaf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
mulss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x10(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     12d5 <xatanf+0x1b5>
movss  0xd59(%rip),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x10(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     12fb <xatanf+0x1db>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xatanf>:
push   %rbx
sub    $0x60,%rsp
movaps %xmm0,0x10(%rsp)
call   1040 <signf@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     113d <xatanf+0x1d>
movaps 0x10(%rsp),%xmm1
jmp    1149 <xatanf+0x29>
movaps 0x10(%rsp),%xmm1
xorps  0xeb7(%rip),%xmm1
movaps %xmm1,0x10(%rsp)
movss  0xeba(%rip),%xmm2
movaps %xmm2,%xmm0
divss  %xmm1,%xmm0
cmpltss %xmm1,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm0,%xmm2
movaps %xmm2,0x50(%rsp)
movaps %xmm2,%xmm0
mulss  %xmm2,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,0x30(%rsp)
mulss  %xmm1,%xmm1
movaps %xmm1,0x40(%rsp)
movss  0xe7b(%rip),%xmm1
movss  0xe77(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,0x8(%rsp)
movss  0xe68(%rip),%xmm1
movss  0xe64(%rip),%xmm2
movaps 0x20(%rsp),%xmm0
call   1030 <mlaf@plt>
movaps %xmm0,%xmm2
movaps 0x30(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
call   1030 <mlaf@plt>
movss  %xmm0,0x8(%rsp)
movss  0xe3d(%rip),%xmm1
movss  0xe39(%rip),%xmm2
movaps 0x20(%rsp),%xmm0
call   1030 <mlaf@plt>
movss  %xmm0,0xc(%rsp)
movss  0xe25(%rip),%xmm1
movss  0xe21(%rip),%xmm2
movaps 0x20(%rsp),%xmm0
call   1030 <mlaf@plt>
movaps %xmm0,%xmm2
movaps 0x30(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1030 <mlaf@plt>
movaps %xmm0,%xmm2
movaps 0x40(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
call   1030 <mlaf@plt>
movaps 0x10(%rsp),%xmm1
ucomiss 0xdc5(%rip),%xmm1
mulss  0x20(%rsp),%xmm0
movaps 0x50(%rsp),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
jbe    126f <xatanf+0x14f>
movss  0xdcc(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
cmp    $0xffffffff,%ebx
jne    127b <xatanf+0x15b>
xorps  0xd85(%rip),%xmm0
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @xatanf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca float
%7 = alloca float
store float %0, float* %2
store i32 0, i32* %5
%8 = load float, float* %2
%9 = call i32 @signf(float %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load float, float* %2
%13 = fneg float %12
store float %13, float* %2
store i32 2, i32* %5
br label %14
14: ; preds = %11, %1
%15 = load float, float* %2
%16 = fcmp ogt float %15, 1.000000e+00
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load float, float* %2
%19 = fdiv float 1.000000e+00, %18
store float %19, float* %2
%20 = load i32, i32* %5
%21 = or i32 %20, 1
store i32 %21, i32* %5
br label %22
22: ; preds = %17, %14
%23 = load float, float* %2
%24 = load float, float* %2
%25 = fmul float %23, %24
store float %25, float* %3
%26 = load float, float* %3
%27 = load float, float* %3
%28 = fmul float %26, %27
store float %28, float* %6
%29 = load float, float* %6
%30 = load float, float* %6
%31 = fmul float %29, %30
store float %31, float* %7
%32 = load float, float* %7
%33 = load float, float* %6
%34 = load float, float* %3
%35 = call float @mlaf(float %34, float 0x3F672199A0000000, float 0xBF905701A0000000)
%36 = load float, float* %3
%37 = call float @mlaf(float %36, float 0x3FA5C336C0000000, float 0xBFB32BFF40000000)
%38 = call float @mlaf(float %33, float %35, float %37)
%39 = load float, float* %6
%40 = load float, float* %3
%41 = call float @mlaf(float %40, float 0x3FBB399E40000000, float 0xBFC22DF3E0000000)
%42 = load float, float* %3
%43 = call float @mlaf(float %42, float 0x3FC99734E0000000, float 0xBFD5554BA0000000)
%44 = call float @mlaf(float %39, float %41, float %43)
%45 = call float @mlaf(float %32, float %38, float %44)
store float %45, float* %4
%46 = load float, float* %2
%47 = load float, float* %2
%48 = load float, float* %3
%49 = load float, float* %4
%50 = fmul float %48, %49
%51 = call float @llvm.fmuladd.f32(float %47, float %50, float %46)
store float %51, float* %3
%52 = load i32, i32* %5
%53 = and i32 %52, 1
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %22
%56 = load float, float* %3
%57 = fsub float 0x3FF921FB60000000, %56
store float %57, float* %3
br label %58
58: ; preds = %55, %22
%59 = load i32, i32* %5
%60 = and i32 %59, 2
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %58
%63 = load float, float* %3
%64 = fneg float %63
store float %64, float* %3
br label %65
65: ; preds = %62, %58
%66 = load float, float* %3
ret float %66
}

LLVM IR (-O2):
define float @xatanf(float %0) {
%2 = tail call i32 @signf(float %0)
%3 = icmp eq i32 %2, -1
%4 = fneg float %0
%5 = select i1 %3, float %4, float %0
%6 = fcmp ogt float %5, 1.000000e+00
%7 = fdiv float 1.000000e+00, %5
%8 = select i1 %6, float %7, float %5
%9 = fmul float %8, %8
%10 = fmul float %9, %9
%11 = fmul float %10, %10
%12 = tail call float @mlaf(float %9, float 0x3F672199A0000000, float 0xBF905701A0000000)
%13 = tail call float @mlaf(float %9, float 0x3FA5C336C0000000, float 0xBFB32BFF40000000)
%14 = tail call float @mlaf(float %10, float %12, float %13)
%15 = tail call float @mlaf(float %9, float 0x3FBB399E40000000, float 0xBFC22DF3E0000000)
%16 = tail call float @mlaf(float %9, float 0x3FC99734E0000000, float 0xBFD5554BA0000000)
%17 = tail call float @mlaf(float %10, float %15, float %16)
%18 = tail call float @mlaf(float %11, float %14, float %17)
%19 = fmul float %9, %18
%20 = tail call float @llvm.fmuladd.f32(float %8, float %19, float %8)
%21 = fsub float 0x3FF921FB60000000, %20
%22 = select i1 %6, float %21, float %20
%23 = fneg float %22
%24 = select i1 %3, float %23, float %22
ret float %24
}