long double atan2d(long double y, long double x) {
  long double f, g;
  long double num, den;
  long double result;
  int n;
  static const long double a[4] = {
      0, (long double)(0.52359877559829887307710723054658L),
      (long double)(1.5707963267948966192313216916398L),
      (long double)(1.0471975511965977461542144610932L)};
  if (x == 0.0) {
    if (y == 0.0) {
      result = 0.0;
      return result;
    }
    result = (long double)(1.5707963267948966192313216916398L);
    if (y > 0.0) {
      return result;
    }
    if (y < 0.0) {
      result = -result;
      return result;
    }
  }
  n = 0;
  num = y;
  den = x;
  if (num < 0.0) {
    num = -num;
  }
  if (den < 0.0) {
    den = -den;
  }
  if (num > den) {
    f = den;
    den = num;
    num = f;
    n = 2;
  }
  f = ((long double)(num) / (long double)(den));
  if (f > (0.26794919243112270647255365849413L)) {
    num = ((long double)((0.73205080756887729352744634150587L)) *
           (long double)(f));
    num = ((long double)(num) - (long double)(0.5));
    num = ((long double)(num) - (long double)(0.5));
    num = ((long double)(num) + (long double)(f));
    den = ((long double)((1.7320508075688772935274463415059L)) +
           (long double)(f));
    f = ((long double)(num) / (long double)(den));
    n = n + 1;
  }
  g = f;
  if (g < 0.0) {
    g = -g;
  }
  if (g < (+1.490116119385e-8L)) {
    result = f;
  } else {
    g = ((long double)(f) * (long double)(f));
    num = ((long double)((-8.3758299368150059274e-1L)) * (long double)(g));
    num = ((long double)(num) + (long double)((-8.4946240351320683534L)));
    num = ((long double)(num) * (long double)(g));
    num = ((long double)(num) + (long double)((-2.0505855195861651981e1L)));
    num = ((long double)(num) * (long double)(g));
    num = ((long double)(num) + (long double)((-1.3688768894191926929e1L)));
    num = ((long double)(num) * (long double)(g));
    den = ((long double)(g) + (long double)((+1.5024001160028576121e1L)));
    den = ((long double)(den) * (long double)(g));
    den = ((long double)(den) + (long double)((+5.9578436142597344465e1L)));
    den = ((long double)(den) * (long double)(g));
    den = ((long double)(den) + (long double)((+8.6157349597130242515e1L)));
    den = ((long double)(den) * (long double)(g));
    den = ((long double)(den) + (long double)((+4.1066306682575781263e1L)));
    result = ((long double)(num) / (long double)(den));
    result = ((long double)(result) * (long double)(f));
    result = ((long double)(result) + (long double)(f));
  }
  if (n > 1) {
    result = -result;
  }
  result = ((long double)(a[n]) + (long double)(result));
  if (x < 0.0) {
    result = ((long double)((3.1415926535897932384626433832795L)) -
              (long double)(result));
  }
  if (y < 0.0) {
    result = -result;
  }
  return result;
}


x86 assembly (clang, -O0):
<atan2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    11b2 <atan2d+0xb2>
jp     11b2 <atan2d+0xb2>
jmp    1130 <atan2d+0x30>
fldt   -0x20(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    115c <atan2d+0x5c>
jp     115c <atan2d+0x5c>
jmp    114c <atan2d+0x4c>
fldz
fstpt  -0x80(%rbp)
fldt   -0x80(%rbp)
fstpt  -0x10(%rbp)
jmp    1447 <atan2d+0x347>
fldt   0xe9e(%rip)
fstpt  -0x80(%rbp)
fldt   -0x20(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    1186 <atan2d+0x86>
jmp    117b <atan2d+0x7b>
fldt   -0x80(%rbp)
fstpt  -0x10(%rbp)
jmp    1447 <atan2d+0x347>
fldt   -0x20(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    11ad <atan2d+0xad>
jmp    119a <atan2d+0x9a>
fldt   -0x80(%rbp)
fchs
fstpt  -0x80(%rbp)
fldt   -0x80(%rbp)
fstpt  -0x10(%rbp)
jmp    1447 <atan2d+0x347>
jmp    11b2 <atan2d+0xb2>
movl   $0x0,-0x84(%rbp)
fldt   -0x20(%rbp)
fstpt  -0x60(%rbp)
fldt   -0x30(%rbp)
fstpt  -0x70(%rbp)
fldt   -0x60(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    11e4 <atan2d+0xe4>
jmp    11dc <atan2d+0xdc>
fldt   -0x60(%rbp)
fchs
fstpt  -0x60(%rbp)
fldt   -0x70(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    1200 <atan2d+0x100>
jmp    11f8 <atan2d+0xf8>
fldt   -0x70(%rbp)
fchs
fstpt  -0x70(%rbp)
fldt   -0x60(%rbp)
fldt   -0x70(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    1233 <atan2d+0x133>
jmp    1217 <atan2d+0x117>
fldt   -0x70(%rbp)
fstpt  -0x40(%rbp)
fldt   -0x60(%rbp)
fstpt  -0x70(%rbp)
fldt   -0x40(%rbp)
fstpt  -0x60(%rbp)
movl   $0x2,-0x84(%rbp)
fldt   -0x60(%rbp)
fldt   -0x70(%rbp)
fdivrp %st,%st(1)
fstpt  -0x40(%rbp)
fldt   -0x40(%rbp)
fldt   0xdc9(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    12b1 <atan2d+0x1b1>
jmp    1258 <atan2d+0x158>
fldt   -0x40(%rbp)
fldt   0xdbf(%rip)
fmulp  %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x60(%rbp)
flds   0xe71(%rip)
fsubr  %st,%st(1)
fxch   %st(1)
fstpt  -0x60(%rbp)
fldt   -0x60(%rbp)
fsubp  %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x60(%rbp)
fldt   -0x40(%rbp)
faddp  %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x40(%rbp)
fldt   0xd9e(%rip)
faddp  %st,%st(1)
fstpt  -0x70(%rbp)
fldt   -0x60(%rbp)
fldt   -0x70(%rbp)
fdivrp %st,%st(1)
fstpt  -0x40(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
fldt   -0x40(%rbp)
fstpt  -0x50(%rbp)
fldt   -0x50(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    12d3 <atan2d+0x1d3>
jmp    12cb <atan2d+0x1cb>
fldt   -0x50(%rbp)
fchs
fstpt  -0x50(%rbp)
fldt   -0x50(%rbp)
fldt   0xd64(%rip)
fucomip %st(1),%st
fstp   %st(0)
jbe    12f6 <atan2d+0x1f6>
jmp    12eb <atan2d+0x1eb>
fldt   -0x40(%rbp)
fstpt  -0x80(%rbp)
jmp    13d1 <atan2d+0x2d1>
fldt   -0x40(%rbp)
fmul   %st,%st(0)
fstpt  -0x50(%rbp)
fldt   -0x50(%rbp)
fldt   0xd49(%rip)
fmulp  %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x60(%rbp)
fldt   0xd4b(%rip)
faddp  %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x60(%rbp)
fldt   -0x50(%rbp)
fmulp  %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x60(%rbp)
fldt   0xd42(%rip)
faddp  %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x60(%rbp)
fldt   -0x50(%rbp)
fmulp  %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x60(%rbp)
fldt   0xd39(%rip)
faddp  %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x60(%rbp)
fldt   -0x50(%rbp)
fmulp  %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x50(%rbp)
fldt   0xd30(%rip)
faddp  %st,%st(1)
fstpt  -0x70(%rbp)
fldt   -0x70(%rbp)
fldt   -0x50(%rbp)
fmulp  %st,%st(1)
fstpt  -0x70(%rbp)
fldt   -0x70(%rbp)
fldt   0xd27(%rip)
faddp  %st,%st(1)
fstpt  -0x70(%rbp)
fldt   -0x70(%rbp)
fldt   -0x50(%rbp)
fmulp  %st,%st(1)
fstpt  -0x70(%rbp)
fldt   -0x70(%rbp)
fldt   0xd1e(%rip)
faddp  %st,%st(1)
fstpt  -0x70(%rbp)
fldt   -0x70(%rbp)
fldt   -0x50(%rbp)
fmulp  %st,%st(1)
fstpt  -0x70(%rbp)
fldt   -0x70(%rbp)
fldt   0xd15(%rip)
faddp  %st,%st(1)
fstpt  -0x70(%rbp)
fldt   -0x60(%rbp)
fldt   -0x70(%rbp)
fdivrp %st,%st(1)
fstpt  -0x80(%rbp)
fldt   -0x80(%rbp)
fldt   -0x40(%rbp)
fmulp  %st,%st(1)
fstpt  -0x80(%rbp)
fldt   -0x80(%rbp)
fldt   -0x40(%rbp)
faddp  %st,%st(1)
fstpt  -0x80(%rbp)
cmpl   $0x1,-0x84(%rbp)
jle    13e6 <atan2d+0x2e6>
fldt   -0x80(%rbp)
fchs
fstpt  -0x80(%rbp)
movslq -0x84(%rbp),%rax
shl    $0x4,%rax
lea    0xcf8(%rip),%rcx
fldt   (%rax,%rcx,1)
fldt   -0x80(%rbp)
faddp  %st,%st(1)
fstpt  -0x80(%rbp)
fldt   -0x30(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    1425 <atan2d+0x325>
jmp    1417 <atan2d+0x317>
fldt   -0x80(%rbp)
fldt   0xcb0(%rip)
fsubp  %st,%st(1)
fstpt  -0x80(%rbp)
fldt   -0x20(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    1441 <atan2d+0x341>
jmp    1439 <atan2d+0x339>
fldt   -0x80(%rbp)
fchs
fstpt  -0x80(%rbp)
fldt   -0x80(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan2d>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fldz
fxch   %st(2)
fucomi %st(2),%st
fldz
fldz
jne    1155 <atan2d+0x55>
jp     1155 <atan2d+0x55>
fstp   %st(1)
fstp   %st(0)
fxch   %st(1)
fucomi %st(2),%st
jne    112b <atan2d+0x2b>
jp     112b <atan2d+0x2b>
fstp   %st(0)
fstp   %st(0)
jmp    1277 <atan2d+0x177>
fldt   0xecf(%rip)
fldz
fxch   %st(2)
fucomi %st(2),%st
fxch   %st(3)
fxch   %st(2)
ja     128d <atan2d+0x18d>
fstp   %st(1)
fldt   0xec7(%rip)
fxch   %st(1)
fucomip %st(3),%st
fldz
ja     128d <atan2d+0x18d>
fstp   %st(1)
fstp   %st(0)
fxch   %st(2)
fucomi %st(1),%st
fld    %st(1)
fchs
fld    %st(2)
fcmovnbe %st(1),%st
fstp   %st(1)
fxch   %st(1)
fucomi %st(3),%st
fld    %st(3)
fchs
fld    %st(4)
fcmovnbe %st(1),%st
fstp   %st(1)
xor    %eax,%eax
fxch   %st(2)
fucomi %st(2),%st
seta   %al
fld    %st(0)
fcmovnbe %st(3),%st
fxch   %st(3)
fcmovnbe %st(1),%st
fstp   %st(1)
fdivrp %st,%st(2)
add    %eax,%eax
fldt   0xe8e(%rip)
fxch   %st(2)
fucomi %st(2),%st
fstp   %st(2)
jbe    11bb <atan2d+0xbb>
fldt   0xe90(%rip)
fmul   %st(2),%st
flds   0xf48(%rip)
fadd   %st,%st(1)
faddp  %st,%st(1)
fadd   %st(2),%st
fldt   0xe8c(%rip)
faddp  %st,%st(3)
fdivp  %st,%st(2)
or     $0x1,%eax
fucomi %st(1),%st
fld    %st(1)
fchs
fld    %st(2)
fcmovnbe %st(1),%st
fldt   0xe85(%rip)
fucomip %st(1),%st
fstp   %st(0)
ja     1235 <atan2d+0x135>
fstp   %st(0)
fld    %st(1)
fmul   %st(2),%st
fldt   0xe83(%rip)
fmul   %st(1),%st
fldt   0xe8b(%rip)
faddp  %st,%st(1)
fmul   %st(1),%st
fldt   0xe91(%rip)
faddp  %st,%st(1)
fmul   %st(1),%st
fldt   0xe97(%rip)
faddp  %st,%st(1)
fmul   %st(1),%st
fstpt  -0xc(%rsp)
fldt   0xe99(%rip)
fadd   %st(1),%st
fmul   %st(1),%st
fldt   0xe9f(%rip)
faddp  %st,%st(1)
fmul   %st(1),%st
fldt   0xea5(%rip)
faddp  %st,%st(1)
fmulp  %st,%st(1)
fldt   0xeab(%rip)
faddp  %st,%st(1)
fldt   -0xc(%rsp)
fdivp  %st,%st(1)
fmul   %st(2),%st
faddp  %st,%st(2)
fld    %st(1)
fchs
cmp    $0x2,%eax
setge  %cl
test   %cl,%cl
fxch   %st(2)
fcmovne %st(2),%st
fstp   %st(2)
mov    %eax,%eax
shl    $0x4,%rax
fucomi %st(3),%st
fstp   %st(3)
lea    0xeac(%rip),%rcx
fldt   (%rax,%rcx,1)
faddp  %st,%st(1)
fldt   0xe81(%rip)
fsub   %st(1),%st
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
fxch   %st(2)
fucomip %st(1),%st
fstp   %st(0)
fld    %st(0)
fchs
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
fldz
fldz
fldz
fldz
fxch   %st(3)
fxch   %st(4)
fxch   %st(2)
fxch   %st(3)
fxch   %st(1)
fxch   %st(2)
fxch   %st(1)
fstp   %st(4)
fstp   %st(2)
fstp   %st(0)
fstp   %st(1)
ret

LLVM IR (-O0):
@atan2d.a = internal constant [4 x x86_fp80] [x86_fp80 0xK00000000000000000000, x86_fp80 0xK3FFE860A91C16B9B2C23, x86_fp80 0xK3FFFC90FDAA22168C235, x86_fp80 0xK3FFF860A91C16B9B2C23]
define x86_fp80 @atan2d(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = alloca x86_fp80
%8 = alloca x86_fp80
%9 = alloca x86_fp80
%10 = alloca x86_fp80
%11 = alloca i32
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
%12 = load x86_fp80, x86_fp80* %5
%13 = fcmp oeq x86_fp80 %12, 0xK00000000000000000000
br i1 %13, label %14, label %32
14: ; preds = %2
%15 = load x86_fp80, x86_fp80* %4
%16 = fcmp oeq x86_fp80 %15, 0xK00000000000000000000
br i1 %16, label %17, label %19
17: ; preds = %14
store x86_fp80 0xK00000000000000000000, x86_fp80* %10
%18 = load x86_fp80, x86_fp80* %10
store x86_fp80 %18, x86_fp80* %3
br label %162
19: ; preds = %14
store x86_fp80 0xK3FFFC90FDAA22168C235, x86_fp80* %10
%20 = load x86_fp80, x86_fp80* %4
%21 = fcmp ogt x86_fp80 %20, 0xK00000000000000000000
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = load x86_fp80, x86_fp80* %10
store x86_fp80 %23, x86_fp80* %3
br label %162
24: ; preds = %19
%25 = load x86_fp80, x86_fp80* %4
%26 = fcmp olt x86_fp80 %25, 0xK00000000000000000000
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = load x86_fp80, x86_fp80* %10
%29 = fneg x86_fp80 %28
store x86_fp80 %29, x86_fp80* %10
%30 = load x86_fp80, x86_fp80* %10
store x86_fp80 %30, x86_fp80* %3
br label %162
31: ; preds = %24
br label %32
32: ; preds = %31, %2
store i32 0, i32* %11
%33 = load x86_fp80, x86_fp80* %4
store x86_fp80 %33, x86_fp80* %8
%34 = load x86_fp80, x86_fp80* %5
store x86_fp80 %34, x86_fp80* %9
%35 = load x86_fp80, x86_fp80* %8
%36 = fcmp olt x86_fp80 %35, 0xK00000000000000000000
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = load x86_fp80, x86_fp80* %8
%39 = fneg x86_fp80 %38
store x86_fp80 %39, x86_fp80* %8
br label %40
40: ; preds = %37, %32
%41 = load x86_fp80, x86_fp80* %9
%42 = fcmp olt x86_fp80 %41, 0xK00000000000000000000
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = load x86_fp80, x86_fp80* %9
%45 = fneg x86_fp80 %44
store x86_fp80 %45, x86_fp80* %9
br label %46
46: ; preds = %43, %40
%47 = load x86_fp80, x86_fp80* %8
%48 = load x86_fp80, x86_fp80* %9
%49 = fcmp ogt x86_fp80 %47, %48
br i1 %49, label %50, label %54
50: ; preds = %46
%51 = load x86_fp80, x86_fp80* %9
store x86_fp80 %51, x86_fp80* %6
%52 = load x86_fp80, x86_fp80* %8
store x86_fp80 %52, x86_fp80* %9
%53 = load x86_fp80, x86_fp80* %6
store x86_fp80 %53, x86_fp80* %8
store i32 2, i32* %11
br label %54
54: ; preds = %50, %46
%55 = load x86_fp80, x86_fp80* %8
%56 = load x86_fp80, x86_fp80* %9
%57 = fdiv x86_fp80 %55, %56
store x86_fp80 %57, x86_fp80* %6
%58 = load x86_fp80, x86_fp80* %6
%59 = fcmp ogt x86_fp80 %58, 0xK3FFD8930A2F4F66AB18A
br i1 %59, label %60, label %77
60: ; preds = %54
%61 = load x86_fp80, x86_fp80* %6
%62 = fmul x86_fp80 0xK3FFEBB67AE8584CAA73B, %61
store x86_fp80 %62, x86_fp80* %8
%63 = load x86_fp80, x86_fp80* %8
%64 = fsub x86_fp80 %63, 0xK3FFE8000000000000000
store x86_fp80 %64, x86_fp80* %8
%65 = load x86_fp80, x86_fp80* %8
%66 = fsub x86_fp80 %65, 0xK3FFE8000000000000000
store x86_fp80 %66, x86_fp80* %8
%67 = load x86_fp80, x86_fp80* %8
%68 = load x86_fp80, x86_fp80* %6
%69 = fadd x86_fp80 %67, %68
store x86_fp80 %69, x86_fp80* %8
%70 = load x86_fp80, x86_fp80* %6
%71 = fadd x86_fp80 0xK3FFFDDB3D742C265539E, %70
store x86_fp80 %71, x86_fp80* %9
%72 = load x86_fp80, x86_fp80* %8
%73 = load x86_fp80, x86_fp80* %9
%74 = fdiv x86_fp80 %72, %73
store x86_fp80 %74, x86_fp80* %6
%75 = load i32, i32* %11
%76 = add nsw i32 %75, 1
store i32 %76, i32* %11
br label %77
77: ; preds = %60, %54
%78 = load x86_fp80, x86_fp80* %6
store x86_fp80 %78, x86_fp80* %7
%79 = load x86_fp80, x86_fp80* %7
%80 = fcmp olt x86_fp80 %79, 0xK00000000000000000000
br i1 %80, label %81, label %84
81: ; preds = %77
%82 = load x86_fp80, x86_fp80* %7
%83 = fneg x86_fp80 %82
store x86_fp80 %83, x86_fp80* %7
br label %84
84: ; preds = %81, %77
%85 = load x86_fp80, x86_fp80* %7
%86 = fcmp olt x86_fp80 %85, 0xK3FE580000000001622D7
br i1 %86, label %87, label %89
87: ; preds = %84
%88 = load x86_fp80, x86_fp80* %6
store x86_fp80 %88, x86_fp80* %10
br label %136
89: ; preds = %84
%90 = load x86_fp80, x86_fp80* %6
%91 = load x86_fp80, x86_fp80* %6
%92 = fmul x86_fp80 %90, %91
store x86_fp80 %92, x86_fp80* %7
%93 = load x86_fp80, x86_fp80* %7
%94 = fmul x86_fp80 0xKBFFED66BD6CD8C3DE934, %93
store x86_fp80 %94, x86_fp80* %8
%95 = load x86_fp80, x86_fp80* %8
%96 = fadd x86_fp80 %95, 0xKC00287E9FAE46B531A29
store x86_fp80 %96, x86_fp80* %8
%97 = load x86_fp80, x86_fp80* %8
%98 = load x86_fp80, x86_fp80* %7
%99 = fmul x86_fp80 %97, %98
store x86_fp80 %99, x86_fp80* %8
%100 = load x86_fp80, x86_fp80* %8
%101 = fadd x86_fp80 %100, 0xKC003A40BFDCF15E65691
store x86_fp80 %101, x86_fp80* %8
%102 = load x86_fp80, x86_fp80* %8
%103 = load x86_fp80, x86_fp80* %7
%104 = fmul x86_fp80 %102, %103
store x86_fp80 %104, x86_fp80* %8
%105 = load x86_fp80, x86_fp80* %8
%106 = fadd x86_fp80 %105, 0xKC002DB05328830E70EB4
store x86_fp80 %106, x86_fp80* %8
%107 = load x86_fp80, x86_fp80* %8
%108 = load x86_fp80, x86_fp80* %7
%109 = fmul x86_fp80 %107, %108
store x86_fp80 %109, x86_fp80* %8
%110 = load x86_fp80, x86_fp80* %7
%111 = fadd x86_fp80 %110, 0xK4002F0624F0A56388310
store x86_fp80 %111, x86_fp80* %9
%112 = load x86_fp80, x86_fp80* %9
%113 = load x86_fp80, x86_fp80* %7
%114 = fmul x86_fp80 %112, %113
store x86_fp80 %114, x86_fp80* %9
%115 = load x86_fp80, x86_fp80* %9
%116 = fadd x86_fp80 %115, 0xK4004EE5051906D1EB4E8
store x86_fp80 %116, x86_fp80* %9
%117 = load x86_fp80, x86_fp80* %9
%118 = load x86_fp80, x86_fp80* %7
%119 = fmul x86_fp80 %117, %118
store x86_fp80 %119, x86_fp80* %9
%120 = load x86_fp80, x86_fp80* %9
%121 = fadd x86_fp80 %120, 0xK4005AC5090205B6D243B
store x86_fp80 %121, x86_fp80* %9
%122 = load x86_fp80, x86_fp80* %9
%123 = load x86_fp80, x86_fp80* %7
%124 = fmul x86_fp80 %122, %123
store x86_fp80 %124, x86_fp80* %9
%125 = load x86_fp80, x86_fp80* %9
%126 = fadd x86_fp80 %125, 0xK4004A443E5E624AD4B90
store x86_fp80 %126, x86_fp80* %9
%127 = load x86_fp80, x86_fp80* %8
%128 = load x86_fp80, x86_fp80* %9
%129 = fdiv x86_fp80 %127, %128
store x86_fp80 %129, x86_fp80* %10
%130 = load x86_fp80, x86_fp80* %10
%131 = load x86_fp80, x86_fp80* %6
%132 = fmul x86_fp80 %130, %131
store x86_fp80 %132, x86_fp80* %10
%133 = load x86_fp80, x86_fp80* %10
%134 = load x86_fp80, x86_fp80* %6
%135 = fadd x86_fp80 %133, %134
store x86_fp80 %135, x86_fp80* %10
br label %136
136: ; preds = %89, %87
%137 = load i32, i32* %11
%138 = icmp sgt i32 %137, 1
br i1 %138, label %139, label %142
139: ; preds = %136
%140 = load x86_fp80, x86_fp80* %10
%141 = fneg x86_fp80 %140
store x86_fp80 %141, x86_fp80* %10
br label %142
142: ; preds = %139, %136
%143 = load i32, i32* %11
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds [4 x x86_fp80], [4 x x86_fp80]* @atan2d.a, i64 0, i64 %144
%146 = load x86_fp80, x86_fp80* %145
%147 = load x86_fp80, x86_fp80* %10
%148 = fadd x86_fp80 %146, %147
store x86_fp80 %148, x86_fp80* %10
%149 = load x86_fp80, x86_fp80* %5
%150 = fcmp olt x86_fp80 %149, 0xK00000000000000000000
br i1 %150, label %151, label %154
151: ; preds = %142
%152 = load x86_fp80, x86_fp80* %10
%153 = fsub x86_fp80 0xK4000C90FDAA22168C235, %152
store x86_fp80 %153, x86_fp80* %10
br label %154
154: ; preds = %151, %142
%155 = load x86_fp80, x86_fp80* %4
%156 = fcmp olt x86_fp80 %155, 0xK00000000000000000000
br i1 %156, label %157, label %160
157: ; preds = %154
%158 = load x86_fp80, x86_fp80* %10
%159 = fneg x86_fp80 %158
store x86_fp80 %159, x86_fp80* %10
br label %160
160: ; preds = %157, %154
%161 = load x86_fp80, x86_fp80* %10
store x86_fp80 %161, x86_fp80* %3
br label %162
162: ; preds = %160, %27, %22, %17
%163 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %163
}

LLVM IR (-O2):
@atan2d.a = internal unnamed_addr constant [4 x x86_fp80] [x86_fp80 0xK00000000000000000000, x86_fp80 0xK3FFE860A91C16B9B2C23, x86_fp80 0xK3FFFC90FDAA22168C235, x86_fp80 0xK3FFF860A91C16B9B2C23]
define x86_fp80 @atan2d(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp oeq x86_fp80 %1, 0xK00000000000000000000
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = fcmp oeq x86_fp80 %0, 0xK00000000000000000000
br i1 %5, label %71, label %6
6: ; preds = %4
%7 = fcmp ogt x86_fp80 %0, 0xK00000000000000000000
br i1 %7, label %71, label %8
8: ; preds = %6
%9 = fcmp olt x86_fp80 %0, 0xK00000000000000000000
br i1 %9, label %71, label %10
10: ; preds = %8, %2
%11 = fcmp olt x86_fp80 %0, 0xK00000000000000000000
%12 = fneg x86_fp80 %0
%13 = select i1 %11, x86_fp80 %12, x86_fp80 %0
%14 = fcmp olt x86_fp80 %1, 0xK00000000000000000000
%15 = fneg x86_fp80 %1
%16 = select i1 %14, x86_fp80 %15, x86_fp80 %1
%17 = fcmp ogt x86_fp80 %13, %16
%18 = select i1 %17, x86_fp80 %16, x86_fp80 %13
%19 = select i1 %17, x86_fp80 %13, x86_fp80 %16
%20 = select i1 %17, i32 2, i32 0
%21 = fdiv x86_fp80 %18, %19
%22 = fcmp ogt x86_fp80 %21, 0xK3FFD8930A2F4F66AB18A
br i1 %22, label %23, label %31
23: ; preds = %10
%24 = fmul x86_fp80 %21, 0xK3FFEBB67AE8584CAA73B
%25 = fadd x86_fp80 %24, 0xKBFFE8000000000000000
%26 = fadd x86_fp80 %25, 0xKBFFE8000000000000000
%27 = fadd x86_fp80 %21, %26
%28 = fadd x86_fp80 %21, 0xK3FFFDDB3D742C265539E
%29 = fdiv x86_fp80 %27, %28
%30 = or i32 %20, 1
br label %31
31: ; preds = %23, %10
%32 = phi x86_fp80 [ %29, %23 ], [ %21, %10 ]
%33 = phi i32 [ %30, %23 ], [ %20, %10 ]
%34 = fcmp olt x86_fp80 %32, 0xK00000000000000000000
%35 = fneg x86_fp80 %32
%36 = select i1 %34, x86_fp80 %35, x86_fp80 %32
%37 = fcmp olt x86_fp80 %36, 0xK3FE580000000001622D7
br i1 %37, label %58, label %38
38: ; preds = %31
%39 = fmul x86_fp80 %32, %32
%40 = fmul x86_fp80 %39, 0xK3FFED66BD6CD8C3DE934
%41 = fsub x86_fp80 0xKC00287E9FAE46B531A29, %40
%42 = fmul x86_fp80 %39, %41
%43 = fadd x86_fp80 %42, 0xKC003A40BFDCF15E65691
%44 = fmul x86_fp80 %39, %43
%45 = fadd x86_fp80 %44, 0xKC002DB05328830E70EB4
%46 = fmul x86_fp80 %39, %45
%47 = fadd x86_fp80 %39, 0xK4002F0624F0A56388310
%48 = fmul x86_fp80 %39, %47
%49 = fadd x86_fp80 %48, 0xK4004EE5051906D1EB4E8
%50 = fmul x86_fp80 %39, %49
%51 = fadd x86_fp80 %50, 0xK4005AC5090205B6D243B
%52 = fmul x86_fp80 %39, %51
%53 = fadd x86_fp80 %52, 0xK4004A443E5E624AD4B90
%54 = fdiv x86_fp80 %46, %53
%55 = fmul x86_fp80 %32, %54
%56 = fadd x86_fp80 %32, %55
%57 = fneg x86_fp80 %56
br label %58
58: ; preds = %31, %38
%59 = phi x86_fp80 [ %35, %31 ], [ %57, %38 ]
%60 = phi x86_fp80 [ %32, %31 ], [ %56, %38 ]
%61 = icmp sgt i32 %33, 1
%62 = select i1 %61, x86_fp80 %59, x86_fp80 %60
%63 = sext i32 %33 to i64
%64 = getelementptr inbounds [4 x x86_fp80], [4 x x86_fp80]* @atan2d.a, i64 0, i64 %63
%65 = load x86_fp80, x86_fp80* %64
%66 = fadd x86_fp80 %65, %62
%67 = fsub x86_fp80 0xK4000C90FDAA22168C235, %66
%68 = select i1 %14, x86_fp80 %67, x86_fp80 %66
%69 = fneg x86_fp80 %68
%70 = select i1 %11, x86_fp80 %69, x86_fp80 %68
br label %71
71: ; preds = %8, %6, %4, %58
%72 = phi x86_fp80 [ %70, %58 ], [ 0xK00000000000000000000, %4 ], [ 0xK3FFFC90FDAA22168C235, %6 ], [ 0xKBFFFC90FDAA22168C235, %8 ]
ret x86_fp80 %72
}