#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 */
typedef int /*<<< orphan*/ mpf_t;
typedef double mp_bitcnt_t;

/* Variables and functions */
int /*<<< orphan*/ fp_arctan2(int /*<<< orphan*/, int /*<<< orphan*/ const,
                              int /*<<< orphan*/, unsigned int);
int /*<<< orphan*/ mpf_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpf_init2(int /*<<< orphan*/, double);
int /*<<< orphan*/ mpf_set_ui(int /*<<< orphan*/, int);
void fp_arctan(mpf_t atn, const mpf_t z, unsigned int prec) {
  mp_bitcnt_t bits = ((double)prec) * 3.322 + 50;
  mpf_t one;
  mpf_init2(one, bits);
  mpf_set_ui(one, 1);
  fp_arctan2(atn, z, one, prec);
  mpf_clear(one);
}


x86 assembly (clang, -O0):
<fp_arctan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xe9f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
call   1060 <mpf_init2@plt>
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1050 <mpf_set_ui@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1030 <fp_arctan2@plt>
mov    -0x1c(%rbp),%edi
call   1040 <mpf_clear@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_arctan>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %edx,%eax
cvtsi2sd %rax,%xmm0
mulsd  0xea6(%rip),%xmm0
addsd  0xea6(%rip),%xmm0
call   1060 <mpf_init2@plt>
mov    $0x1,%esi
call   1050 <mpf_set_ui@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%ecx
call   1030 <fp_arctan2@plt>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <mpf_clear@plt>

LLVM IR (-O0):
define void @fp_arctan(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = uitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 3.322000e+00, double 5.000000e+01)
store double %11, double* %7
%12 = load i32, i32* %8
%13 = load double, double* %7
%14 = call i32 @mpf_init2(i32 %12, double %13)
%15 = load i32, i32* %8
%16 = call i32 @mpf_set_ui(i32 %15, i32 1)
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = load i32, i32* %8
%20 = load i32, i32* %6
%21 = call i32 @fp_arctan2(i32 %17, i32 %18, i32 %19, i32 %20)
%22 = load i32, i32* %8
%23 = call i32 @mpf_clear(i32 %22)
ret void
}

LLVM IR (-O2):
define void @fp_arctan(i32 %0, i32 %1, i32 %2) {
%4 = uitofp i32 %2 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 3.322000e+00, double 5.000000e+01)
%6 = tail call i32 @mpf_init2(i32 undef, double %5)
%7 = tail call i32 @mpf_set_ui(i32 undef, i32 1)
%8 = tail call i32 @fp_arctan2(i32 %0, i32 %1, i32 undef, i32 %2)
%9 = tail call i32 @mpf_clear(i32 undef)
ret void
}