#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 atan2(double, double);
double cos(double);
double sin(double);
double argapf(double x, double a) {
  double omg;
  omg = 3.141592653589793 * x;
  return (x +
          2.0 * atan2(a * sin(omg), 1.0 - a * cos(omg)) / 3.141592653589793);
}


x86 assembly (clang, -O0):
<argapf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeb6(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <cos@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe49(%rip),%xmm2
addsd  %xmm2,%xmm1
call   1030 <atan2@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xe28(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe14(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argapf>:
sub    $0x28,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x20(%rsp)
mulsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1040 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0xe90(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0x18(%rsp),%xmm0
call   1030 <atan2@plt>
addsd  %xmm0,%xmm0
divsd  0xe6d(%rip),%xmm0
addsd  0x20(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @argapf(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fmul double 0x400921FB54442D18, %6
store double %7, double* %5
%8 = load double, double* %3
%9 = load double, double* %4
%10 = load double, double* %5
%11 = call double @sin(double %10)
%12 = fmul double %9, %11
%13 = load double, double* %4
%14 = load double, double* %5
%15 = call double @cos(double %14)
%16 = fneg double %13
%17 = call double @llvm.fmuladd.f64(double %16, double %15, double 1.000000e+00)
%18 = call double @atan2(double %12, double %17)
%19 = fmul double 2.000000e+00, %18
%20 = fdiv double %19, 0x400921FB54442D18
%21 = fadd double %8, %20
ret double %21
}

LLVM IR (-O2):
define double @argapf(double %0, double %1) {
%3 = fmul double %0, 0x400921FB54442D18
%4 = tail call double @sin(double %3)
%5 = fmul double %4, %1
%6 = tail call double @cos(double %3)
%7 = fneg double %1
%8 = tail call double @llvm.fmuladd.f64(double %7, double %6, double 1.000000e+00)
%9 = tail call double @atan2(double %5, double %8)
%10 = fmul double %9, 2.000000e+00
%11 = fdiv double %10, 0x400921FB54442D18
%12 = fadd double %11, %0
ret double %12
}