#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);
float xatanf(float s) {
  float t, u;
  int q = 0;
  if (s < 0) {
    s = -s;
    q = 2;
  }
  if (s > 1) {
    s = 1.0f / s;
    q |= 1;
  }
  t = s * s;
  u = 0.00282363896258175373077393f;
  u = mlaf(u, t, -0.0159569028764963150024414f);
  u = mlaf(u, t, 0.0425049886107444763183594f);
  u = mlaf(u, t, -0.0748900920152664184570312f);
  u = mlaf(u, t, 0.106347933411598205566406f);
  u = mlaf(u, t, -0.142027363181114196777344f);
  u = mlaf(u, t, 0.199926957488059997558594f);
  u = mlaf(u, t, -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    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    114f <xatanf+0x3f>
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  0xea4(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1180 <xatanf+0x70>
movss  0xe93(%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  0xe89(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe6e(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe4e(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe2e(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe0e(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xdee(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xdce(%rip),%xmm2
call   1030 <mlaf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xdae(%rip),%xmm2
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     12a2 <xatanf+0x192>
movss  0xd8c(%rip),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x10(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     12c8 <xatanf+0x1b8>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xatanf>:
sub    $0x48,%rsp
movaps %xmm0,%xmm1
xorps  0xee2(%rip),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm3
cmpltss %xmm2,%xmm3
andps  %xmm3,%xmm1
movaps %xmm0,0x30(%rsp)
andnps %xmm0,%xmm3
orps   %xmm1,%xmm3
movaps %xmm3,0x10(%rsp)
movss  0xecc(%rip),%xmm1
movaps %xmm1,%xmm0
divss  %xmm3,%xmm0
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm0
andnps %xmm3,%xmm1
orps   %xmm0,%xmm1
movaps %xmm1,0x20(%rsp)
mulss  %xmm1,%xmm1
movaps %xmm1,(%rsp)
movss  0xea6(%rip),%xmm0
movss  0xea2(%rip),%xmm2
call   1030 <mlaf@plt>
movss  0xe99(%rip),%xmm2
movaps (%rsp),%xmm1
call   1030 <mlaf@plt>
movss  0xe8c(%rip),%xmm2
movaps (%rsp),%xmm1
call   1030 <mlaf@plt>
movss  0xe7f(%rip),%xmm2
movaps (%rsp),%xmm1
call   1030 <mlaf@plt>
movss  0xe72(%rip),%xmm2
movaps (%rsp),%xmm1
call   1030 <mlaf@plt>
movss  0xe65(%rip),%xmm2
movaps (%rsp),%xmm1
call   1030 <mlaf@plt>
movss  0xe58(%rip),%xmm2
movaps (%rsp),%xmm1
call   1030 <mlaf@plt>
movaps 0x10(%rsp),%xmm1
ucomiss 0xe23(%rip),%xmm1
mulss  (%rsp),%xmm0
movaps 0x20(%rsp),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
jbe    1210 <xatanf+0x100>
movss  0xe2b(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss 0x30(%rsp),%xmm1
jbe    1221 <xatanf+0x111>
xorps  0xddf(%rip),%xmm0
add    $0x48,%rsp
ret

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

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