#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 _pspFpuAtanMain(float);
float _atanf(float x) {
  if (x < 0.19890f) {
    return _pspFpuAtanMain(x);
  }
  if (x < 0.668106f) {
    return (float)(3.14159265358979323846 / 8) +
           _pspFpuAtanMain((x - (float)(1.41421356237309504880 - 1)) /
                           (1.0f + ((float)(1.41421356237309504880 - 1) * x)));
  }
  return ((float)3.14159265358979323846 / 4) +
         _pspFpuAtanMain((x - 1.0f) / (x + 1.0f));
}


x86 assembly (clang, -O0):
<_atanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1143 <_atanf+0x33>
movss  -0x8(%rbp),%xmm0
call   1030 <_pspFpuAtanMain@plt>
movss  %xmm0,-0x4(%rbp)
jmp    11e0 <_atanf+0xd0>
movss  0xeb9(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11a5 <_atanf+0x95>
movss  -0x8(%rbp),%xmm0
movss  0xeb2(%rip),%xmm1
subss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xea1(%rip),%xmm2
mulss  %xmm2,%xmm1
movss  0xe8d(%rip),%xmm2
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
call   1030 <_pspFpuAtanMain@plt>
movaps %xmm0,%xmm1
movss  0xe79(%rip),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11e0 <_atanf+0xd0>
movss  -0x8(%rbp),%xmm0
movss  0xe5a(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xe4e(%rip),%xmm1
addss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1030 <_pspFpuAtanMain@plt>
movaps %xmm0,%xmm1
movss  0xe31(%rip),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_atanf>:
push   %rax
movss  0xee7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1124 <_atanf+0x14>
pop    %rax
jmp    1030 <_pspFpuAtanMain@plt>
movss  0xed8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1163 <_atanf+0x53>
movss  0xedb(%rip),%xmm1
addss  %xmm0,%xmm1
mulss  0xed3(%rip),%xmm0
addss  0xebf(%rip),%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1030 <_pspFpuAtanMain@plt>
addss  0xebb(%rip),%xmm0
pop    %rax
ret
movss  0xe9d(%rip),%xmm1
addss  %xmm0,%xmm1
addss  0xe95(%rip),%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1030 <_pspFpuAtanMain@plt>
addss  0xe85(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @_atanf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0x3FC9758E20000000
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = call float @_pspFpuAtanMain(float %7)
store float %8, float* %2
br label %28
9: ; preds = %1
%10 = load float, float* %3
%11 = fcmp olt float %10, 0x3FE5611FE0000000
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load float, float* %3
%14 = fsub float %13, 0x3FDA8279A0000000
%15 = load float, float* %3
%16 = call float @llvm.fmuladd.f32(float 0x3FDA8279A0000000, float %15, float 1.000000e+00)
%17 = fdiv float %14, %16
%18 = call float @_pspFpuAtanMain(float %17)
%19 = fadd float 0x3FD921FB60000000, %18
store float %19, float* %2
br label %28
20: ; preds = %9
%21 = load float, float* %3
%22 = fsub float %21, 1.000000e+00
%23 = load float, float* %3
%24 = fadd float %23, 1.000000e+00
%25 = fdiv float %22, %24
%26 = call float @_pspFpuAtanMain(float %25)
%27 = fadd float 0x3FE921FB60000000, %26
store float %27, float* %2
br label %28
28: ; preds = %20, %12, %6
%29 = load float, float* %2
ret float %29
}

LLVM IR (-O2):
define float @_atanf(float %0) {
%2 = fcmp olt float %0, 0x3FC9758E20000000
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call float @_pspFpuAtanMain(float %0)
br label %19
5: ; preds = %1
%6 = fcmp olt float %0, 0x3FE5611FE0000000
br i1 %6, label %7, label %13
7: ; preds = %5
%8 = fadd float %0, 0xBFDA8279A0000000
%9 = tail call float @llvm.fmuladd.f32(float %0, float 0x3FDA8279A0000000, float 1.000000e+00)
%10 = fdiv float %8, %9
%11 = tail call float @_pspFpuAtanMain(float %10)
%12 = fadd float %11, 0x3FD921FB60000000
br label %19
13: ; preds = %5
%14 = fadd float %0, -1.000000e+00
%15 = fadd float %0, 1.000000e+00
%16 = fdiv float %14, %15
%17 = tail call float @_pspFpuAtanMain(float %16)
%18 = fadd float %17, 0x3FE921FB60000000
br label %19
19: ; preds = %13, %7, %3
%20 = phi float [ %4, %3 ], [ %12, %7 ], [ %18, %13 ]
ret float %20
}