#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 mla(double, double, double);
int sign(double);
__attribute__((visibility("default"))) const double xatan(double s) {
  double t, u;
  int q = 0;
  if (sign(s) == -1) {
    s = -s;
    q = 2;
  }
  if (s > 1) {
    s = 1.0 / s;
    q |= 1;
  }
  t = s * s;
  double t2 = t * t, t4 = t2 * t2, t8 = t4 * t4, t16 = t8 * t8;
  u = mla(t16,
          mla(t2, (-1.88796008463073496563746e-05),
              mla(t, (0.000209850076645816976906797),
                  (-0.00110611831486672482563471))),
          mla(t8,
              mla(t4,
                  mla(t2,
                      mla(t, (0.00370026744188713119232403),
                          (-0.00889896195887655491740809)),
                      mla(t, (0.016599329773529201970117),
                          (-0.0254517624932312641616861))),
                  mla(t2,
                      mla(t, (0.0337852580001353069993897),
                          (-0.0407629191276836500001934)),
                      mla(t, (0.0466667150077840625632675),
                          (-0.0523674852303482457616113)))),
              mla(t4,
                  mla(t2,
                      mla(t, (0.0587666392926673580854313),
                          (-0.0666573579361080525984562)),
                      mla(t, (0.0769219538311769618355029),
                          (-0.090908995008245008229153))),
                  mla(t2,
                      mla(t, (0.111111105648261418443745),
                          (-0.14285714266771329383765)),
                      mla(t, (0.199999999996591265594148),
                          (-0.333333333333311110369124))))));
  t = s + s * (t * u);
  if ((q & 1) != 0)
    t = 1.570796326794896557998982 - t;
  if ((q & 2) != 0)
    t = -t;
  return t;
}


x86 assembly (clang, -O0):
<xatan>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sign@plt>
cmp    $0xffffffff,%eax
jne    1172 <xatan+0x52>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movl   $0x2,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe81(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a4 <xatan+0x84>
movsd  0xe6f(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x1c(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  0xe7d(%rip),%xmm1
movsd  0xe7d(%rip),%xmm2
call   1040 <mla@plt>
movaps %xmm0,%xmm2
movsd  -0xc8(%rbp),%xmm0
ff
movsd  0xe55(%rip),%xmm1
call   1040 <mla@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  0xe0a(%rip),%xmm1
movsd  0xe0a(%rip),%xmm2
call   1040 <mla@plt>
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  0xdd8(%rip),%xmm1
movsd  0xdd8(%rip),%xmm2
call   1040 <mla@plt>
movsd  -0xc0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xb8(%rbp),%xmm0
ff
call   1040 <mla@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  0xd81(%rip),%xmm1
movsd  0xd81(%rip),%xmm2
call   1040 <mla@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  0xd4f(%rip),%xmm1
movsd  0xd4f(%rip),%xmm2
call   1040 <mla@plt>
movsd  -0xb0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xa8(%rbp),%xmm0
ff
call   1040 <mla@plt>
movsd  -0xa0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x98(%rbp),%xmm0
ff
call   1040 <mla@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  0xcd9(%rip),%xmm1
movsd  0xcd9(%rip),%xmm2
call   1040 <mla@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  0xca7(%rip),%xmm1
movsd  0xca7(%rip),%xmm2
call   1040 <mla@plt>
movsd  -0x90(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x88(%rbp),%xmm0
ff
call   1040 <mla@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xc56(%rip),%xmm1
movsd  0xc56(%rip),%xmm2
call   1040 <mla@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xc27(%rip),%xmm1
movsd  0xc27(%rip),%xmm2
call   1040 <mla@plt>
movsd  -0x80(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x78(%rbp),%xmm0
call   1040 <mla@plt>
movsd  -0x70(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
call   1040 <mla@plt>
movsd  -0x60(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
call   1040 <mla@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
call   1040 <mla@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     147d <xatan+0x35d>
movsd  0xc2d(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     14ad <xatan+0x38d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xatan>:
push   %rbx
sub    $0x90,%rsp
movaps %xmm0,0x30(%rsp)
call   1030 <sign@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1141 <xatan+0x21>
movapd 0x30(%rsp),%xmm1
jmp    114f <xatan+0x2f>
movapd 0x30(%rsp),%xmm1
xorpd  0xeb1(%rip),%xmm1
movapd %xmm1,0x30(%rsp)
movsd  0xeb3(%rip),%xmm2
movapd %xmm2,%xmm0
divsd  %xmm1,%xmm0
cmpltsd %xmm1,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
movapd %xmm2,0x80(%rsp)
mulsd  %xmm2,%xmm2
movapd %xmm2,%xmm1
movapd %xmm2,%xmm0
movapd %xmm2,0x10(%rsp)
mulsd  %xmm2,%xmm1
movapd %xmm1,0x20(%rsp)
mulsd  %xmm1,%xmm1
movapd %xmm1,0x50(%rsp)
mulsd  %xmm1,%xmm1
movapd %xmm1,0x60(%rsp)
mulsd  %xmm1,%xmm1
movapd %xmm1,0x70(%rsp)
movsd  0xe57(%rip),%xmm1
movsd  0xe57(%rip),%xmm2
call   1040 <mla@plt>
movapd %xmm0,%xmm2
movsd  0xe4e(%rip),%xmm1
movaps 0x20(%rsp),%xmm0
call   1040 <mla@plt>
movsd  %xmm0,0x48(%rsp)
movsd  0xe3e(%rip),%xmm1
movsd  0xe3e(%rip),%xmm2
movaps 0x10(%rsp),%xmm0
call   1040 <mla@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xe2e(%rip),%xmm1
movsd  0xe2e(%rip),%xmm2
movaps 0x10(%rsp),%xmm0
call   1040 <mla@plt>
movaps %xmm0,%xmm2
movaps 0x20(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <mla@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xe0b(%rip),%xmm1
movsd  0xe0b(%rip),%xmm2
movaps 0x10(%rsp),%xmm0
call   1040 <mla@plt>
movsd  %xmm0,(%rsp)
movsd  0xdfc(%rip),%xmm1
movsd  0xdfc(%rip),%xmm2
movaps 0x10(%rsp),%xmm0
call   1040 <mla@plt>
movaps %xmm0,%xmm2
movaps 0x20(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1040 <mla@plt>
movaps %xmm0,%xmm2
movaps 0x50(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <mla@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xdc7(%rip),%xmm1
movsd  0xdc7(%rip),%xmm2
movaps 0x10(%rsp),%xmm0
call   1040 <mla@plt>
movsd  %xmm0,(%rsp)
movsd  0xdb8(%rip),%xmm1
movsd  0xdb8(%rip),%xmm2
movaps 0x10(%rsp),%xmm0
call   1040 <mla@plt>
movaps %xmm0,%xmm2
movaps 0x20(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1040 <mla@plt>
movsd  %xmm0,(%rsp)
movsd  0xd97(%rip),%xmm1
movsd  0xd97(%rip),%xmm2
movaps 0x10(%rsp),%xmm0
call   1040 <mla@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0xd87(%rip),%xmm1
movsd  0xd87(%rip),%xmm2
movaps 0x10(%rsp),%xmm0
call   1040 <mla@plt>
movaps %xmm0,%xmm2
movaps 0x20(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
call   1040 <mla@plt>
movaps %xmm0,%xmm2
movaps 0x50(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1040 <mla@plt>
movaps %xmm0,%xmm2
movaps 0x60(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <mla@plt>
movaps %xmm0,%xmm2
movapd 0x70(%rsp),%xmm0
movsd  0x48(%rsp),%xmm1
call   1040 <mla@plt>
movapd 0x30(%rsp),%xmm1
ucomisd 0xc8b(%rip),%xmm1
mulsd  0x10(%rsp),%xmm0
movapd 0x80(%rsp),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
jbe    13ae <xatan+0x28e>
movsd  0xd0a(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
cmp    $0xffffffff,%ebx
jne    13bb <xatan+0x29b>
xorpd  0xc45(%rip),%xmm0
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @xatan(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %2
store i32 0, i32* %5
%10 = load double, double* %2
%11 = call i32 @sign(double %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load double, double* %2
%15 = fneg double %14
store double %15, double* %2
store i32 2, i32* %5
br label %16
16: ; preds = %13, %1
%17 = load double, double* %2
%18 = fcmp ogt double %17, 1.000000e+00
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load double, double* %2
%21 = fdiv double 1.000000e+00, %20
store double %21, double* %2
%22 = load i32, i32* %5
%23 = or i32 %22, 1
store i32 %23, i32* %5
br label %24
24: ; preds = %19, %16
%25 = load double, double* %2
%26 = load double, double* %2
%27 = fmul double %25, %26
store double %27, double* %3
%28 = load double, double* %3
%29 = load double, double* %3
%30 = fmul double %28, %29
store double %30, double* %6
%31 = load double, double* %6
%32 = load double, double* %6
%33 = fmul double %31, %32
store double %33, double* %7
%34 = load double, double* %7
%35 = load double, double* %7
%36 = fmul double %34, %35
store double %36, double* %8
%37 = load double, double* %8
%38 = load double, double* %8
%39 = fmul double %37, %38
store double %39, double* %9
%40 = load double, double* %9
%41 = load double, double* %6
%42 = load double, double* %3
%43 = call double @mla(double %42, double 0x3F2B81666EB938AF, double 0xBF521F657F3915DA)
%44 = call double @mla(double %41, double 0xBEF3CBF44A88555F, double %43)
%45 = load double, double* %8
%46 = load double, double* %7
%47 = load double, double* %6
%48 = load double, double* %3
%49 = call double @mla(double %48, double 0x3F6E5005F4C78C20, double 0xBF82399E74A75E56)
%50 = load double, double* %3
%51 = call double @mla(double %50, double 0x3F90FF6A2A0D2286, double 0xBF9A1006DE22CDAC)
%52 = call double @mla(double %47, double %49, double %51)
%53 = load double, double* %6
%54 = load double, double* %3
%55 = call double @mla(double %54, double 0x3FA14C4D24651F2E, double 0xBFA4DEE09915F638)
%56 = load double, double* %3
%57 = call double @mla(double %56, double 0x3FA7E4B31D8A55AE, double 0xBFAACFE938E04FCA)
%58 = call double @mla(double %53, double %55, double %57)
%59 = call double @mla(double %46, double %52, double %58)
%60 = load double, double* %7
%61 = load double, double* %6
%62 = load double, double* %3
%63 = call double @mla(double %62, double 0x3FAE16A933B73622, double 0xBFB11074E45F93E0)
%64 = load double, double* %3
%65 = call double @mla(double %64, double 0x3FB3B1283C0CA0B1, double 0xBFB745CFD878FEE8)
%66 = call double @mla(double %61, double %63, double %65)
%67 = load double, double* %6
%68 = load double, double* %3
%69 = call double @mla(double %68, double 0x3FBC71C704FB4F9F, double 0xBFC2492491E100BB)
%70 = load double, double* %3
%71 = call double @mla(double %70, double 0x3FC999999997B9DD, double 0xBFD55555555553C5)
%72 = call double @mla(double %67, double %69, double %71)
%73 = call double @mla(double %60, double %66, double %72)
%74 = call double @mla(double %45, double %59, double %73)
%75 = call double @mla(double %40, double %44, double %74)
store double %75, double* %4
%76 = load double, double* %2
%77 = load double, double* %2
%78 = load double, double* %3
%79 = load double, double* %4
%80 = fmul double %78, %79
%81 = call double @llvm.fmuladd.f64(double %77, double %80, double %76)
store double %81, double* %3
%82 = load i32, i32* %5
%83 = and i32 %82, 1
%84 = icmp ne i32 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %24
%86 = load double, double* %3
%87 = fsub double 0x3FF921FB54442D18, %86
store double %87, double* %3
br label %88
88: ; preds = %85, %24
%89 = load i32, i32* %5
%90 = and i32 %89, 2
%91 = icmp ne i32 %90, 0
br i1 %91, label %92, label %95
92: ; preds = %88
%93 = load double, double* %3
%94 = fneg double %93
store double %94, double* %3
br label %95
95: ; preds = %92, %88
%96 = load double, double* %3
ret double %96
}

LLVM IR (-O2):
define double @xatan(double %0) {
%2 = tail call i32 @sign(double %0)
%3 = icmp eq i32 %2, -1
%4 = fneg double %0
%5 = select i1 %3, double %4, double %0
%6 = fcmp ogt double %5, 1.000000e+00
%7 = fdiv double 1.000000e+00, %5
%8 = select i1 %6, double %7, double %5
%9 = fmul double %8, %8
%10 = fmul double %9, %9
%11 = fmul double %10, %10
%12 = fmul double %11, %11
%13 = fmul double %12, %12
%14 = tail call double @mla(double %9, double 0x3F2B81666EB938AF, double 0xBF521F657F3915DA)
%15 = tail call double @mla(double %10, double 0xBEF3CBF44A88555F, double %14)
%16 = tail call double @mla(double %9, double 0x3F6E5005F4C78C20, double 0xBF82399E74A75E56)
%17 = tail call double @mla(double %9, double 0x3F90FF6A2A0D2286, double 0xBF9A1006DE22CDAC)
%18 = tail call double @mla(double %10, double %16, double %17)
%19 = tail call double @mla(double %9, double 0x3FA14C4D24651F2E, double 0xBFA4DEE09915F638)
%20 = tail call double @mla(double %9, double 0x3FA7E4B31D8A55AE, double 0xBFAACFE938E04FCA)
%21 = tail call double @mla(double %10, double %19, double %20)
%22 = tail call double @mla(double %11, double %18, double %21)
%23 = tail call double @mla(double %9, double 0x3FAE16A933B73622, double 0xBFB11074E45F93E0)
%24 = tail call double @mla(double %9, double 0x3FB3B1283C0CA0B1, double 0xBFB745CFD878FEE8)
%25 = tail call double @mla(double %10, double %23, double %24)
%26 = tail call double @mla(double %9, double 0x3FBC71C704FB4F9F, double 0xBFC2492491E100BB)
%27 = tail call double @mla(double %9, double 0x3FC999999997B9DD, double 0xBFD55555555553C5)
%28 = tail call double @mla(double %10, double %26, double %27)
%29 = tail call double @mla(double %11, double %25, double %28)
%30 = tail call double @mla(double %12, double %22, double %29)
%31 = tail call double @mla(double %13, double %15, double %30)
%32 = fmul double %9, %31
%33 = tail call double @llvm.fmuladd.f64(double %8, double %32, double %8)
%34 = fsub double 0x3FF921FB54442D18, %33
%35 = select i1 %6, double %34, double %33
%36 = fneg double %35
%37 = select i1 %3, double %36, double %35
ret double %37
}