#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 */
int M_PI;
double atan2k(double y, double x) {
  double s, t, u;
  int q = 0;
  if (x < 0) {
    x = -x;
    q = -2;
  }
  if (y > x) {
    t = x;
    x = y;
    y = -t;
    q += 1;
  }
  s = y / x;
  t = s * s;
  u = -1.88796008463073496563746e-05;
  u = u * t + (0.000209850076645816976906797);
  u = u * t + (-0.00110611831486672482563471);
  u = u * t + (0.00370026744188713119232403);
  u = u * t + (-0.00889896195887655491740809);
  u = u * t + (0.016599329773529201970117);
  u = u * t + (-0.0254517624932312641616861);
  u = u * t + (0.0337852580001353069993897);
  u = u * t + (-0.0407629191276836500001934);
  u = u * t + (0.0466667150077840625632675);
  u = u * t + (-0.0523674852303482457616113);
  u = u * t + (0.0587666392926673580854313);
  u = u * t + (-0.0666573579361080525984562);
  u = u * t + (0.0769219538311769618355029);
  u = u * t + (-0.090908995008245008229153);
  u = u * t + (0.111111105648261418443745);
  u = u * t + (-0.14285714266771329383765);
  u = u * t + (0.199999999996591265594148);
  u = u * t + (-0.333333333333311110369124);
  t = u * t * s + s;
  t = q * (M_PI / 2) + t;
  return t;
}


x86 assembly (clang, -O0):
<atan2k>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movl   $0x0,-0x2c(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114b <atan2k+0x4b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0xfffffffe,-0x2c(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1199 <atan2k+0x99>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeae(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe87(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe60(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe39(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe12(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdeb(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdc4(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd9d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd76(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd4f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd28(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd01(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcda(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcb3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc8c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc65(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc3e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc17(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    0x2bc8(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan2k>:
xorpd  %xmm4,%xmm4
xor    %eax,%eax
ucomisd %xmm1,%xmm4
setbe  %al
movapd 0xeeb(%rip),%xmm2
movapd %xmm1,%xmm5
xorpd  %xmm2,%xmm5
movapd %xmm1,%xmm3
cmpltsd %xmm4,%xmm3
andpd  %xmm3,%xmm5
andnpd %xmm1,%xmm3
orpd   %xmm5,%xmm3
xor    %ecx,%ecx
ucomisd %xmm3,%xmm0
seta   %dl
movapd %xmm0,%xmm1
maxsd  %xmm3,%xmm1
jbe    114d <atan2k+0x4d>
xorpd  %xmm2,%xmm3
movapd %xmm3,%xmm0
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xeab(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xea7(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xea3(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe9f(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe9b(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe97(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe93(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe8f(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe8b(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe87(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe83(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe7f(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe7b(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe77(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe73(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe6f(%rip),%xmm1
mov    %dl,%cl
mulsd  %xmm2,%xmm1
addsd  0xe69(%rip),%xmm1
lea    -0x2(%rcx,%rax,2),%eax
mulsd  %xmm2,%xmm1
addsd  0xe61(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm0,%xmm1
mov    0x2d96(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
imul   %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
@M_PI = global i32 0
define double @atan2k(double %0, double %1) {
%3 = fcmp olt double %1, 0.000000e+00
%4 = fneg double %1
%5 = select i1 %3, double %4, double %1
%6 = select i1 %3, i32 -2, i32 0
%7 = fcmp olt double %5, %0
%8 = fneg double %5
%9 = select i1 %7, double %0, double %5
%10 = select i1 %7, double %8, double %0
%11 = zext i1 %7 to i32
%12 = or i32 %6, %11
%13 = fdiv double %10, %9
%14 = fmul double %13, %13
%15 = tail call double @llvm.fmuladd.f64(double %14, double 0xBEF3CBF44A88555F, double 0x3F2B81666EB938AF)
%16 = tail call double @llvm.fmuladd.f64(double %15, double %14, double 0xBF521F657F3915DA)
%17 = tail call double @llvm.fmuladd.f64(double %16, double %14, double 0x3F6E5005F4C78C20)
%18 = tail call double @llvm.fmuladd.f64(double %17, double %14, double 0xBF82399E74A75E56)
%19 = tail call double @llvm.fmuladd.f64(double %18, double %14, double 0x3F90FF6A2A0D2286)
%20 = tail call double @llvm.fmuladd.f64(double %19, double %14, double 0xBF9A1006DE22CDAC)
%21 = tail call double @llvm.fmuladd.f64(double %20, double %14, double 0x3FA14C4D24651F2E)
%22 = tail call double @llvm.fmuladd.f64(double %21, double %14, double 0xBFA4DEE09915F638)
%23 = tail call double @llvm.fmuladd.f64(double %22, double %14, double 0x3FA7E4B31D8A55AE)
%24 = tail call double @llvm.fmuladd.f64(double %23, double %14, double 0xBFAACFE938E04FCA)
%25 = tail call double @llvm.fmuladd.f64(double %24, double %14, double 0x3FAE16A933B73622)
%26 = tail call double @llvm.fmuladd.f64(double %25, double %14, double 0xBFB11074E45F93E0)
%27 = tail call double @llvm.fmuladd.f64(double %26, double %14, double 0x3FB3B1283C0CA0B1)
%28 = tail call double @llvm.fmuladd.f64(double %27, double %14, double 0xBFB745CFD878FEE8)
%29 = tail call double @llvm.fmuladd.f64(double %28, double %14, double 0x3FBC71C704FB4F9F)
%30 = tail call double @llvm.fmuladd.f64(double %29, double %14, double 0xBFC2492491E100BB)
%31 = tail call double @llvm.fmuladd.f64(double %30, double %14, double 0x3FC999999997B9DD)
%32 = tail call double @llvm.fmuladd.f64(double %31, double %14, double 0xBFD55555555553C5)
%33 = fmul double %14, %32
%34 = tail call double @llvm.fmuladd.f64(double %33, double %13, double %13)
%35 = load i32, i32* @M_PI
%36 = sdiv i32 %35, 2
%37 = mul nsw i32 %36, %12
%38 = sitofp i32 %37 to double
%39 = fadd double %34, %38
ret double %39
}