#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 atan(double);
double atan2(double, int);
float atan2f(float, float);
long double atan2l(long double, long double);
float atanf(float);
long double atanl(long double);
double exp(double);
float expf(float);
long double expl(long double);
double log(double);
float logf(float);
long double logl(long double);
void test_builtins(double d, float f, long double ld) {
  double atan_ = atan(d);
  long double atanl_ = atanl(ld);
  float atanf_ = atanf(f);
  double atan2_ = atan2(d, 2);
  long double atan2l_ = atan2l(ld, ld);
  float atan2f_ = atan2f(f, f);
  double exp_ = exp(d);
  long double expl_ = expl(ld);
  float expf_ = expf(f);
  double log_ = log(d);
  long double logl_ = logl(ld);
  float logf_ = logf(f);
}


x86 assembly (clang, -O0):
<test_builtins>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
fldt   0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
fstpt  -0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   10a0 <atan@plt>
movsd  %xmm0,-0x28(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1060 <atanl@plt>
fstpt  -0x40(%rbp)
movss  -0xc(%rbp),%xmm0
call   1070 <atanf@plt>
movss  %xmm0,-0x44(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <atan2@plt>
movsd  %xmm0,-0x50(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fld    %st(0)
fstpt  0x10(%rax)
fstpt  (%rax)
call   10d0 <atan2l@plt>
fstpt  -0x60(%rbp)
movss  -0xc(%rbp),%xmm1
movaps %xmm1,%xmm0
call   10e0 <atan2f@plt>
movss  %xmm0,-0x64(%rbp)
movsd  -0x8(%rbp),%xmm0
call   10b0 <exp@plt>
movsd  %xmm0,-0x70(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1090 <expl@plt>
fstpt  -0x80(%rbp)
movss  -0xc(%rbp),%xmm0
call   1080 <expf@plt>
movss  %xmm0,-0x84(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
call   10c0 <log@plt>
movsd  %xmm0,-0x90(%rbp)
ff
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <logl@plt>
fstpt  -0xa0(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <logf@plt>
movss  %xmm0,-0xa4(%rbp)
ff
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtins>:
sub    $0x48,%rsp
movss  %xmm1,0x2c(%rsp)
movsd  %xmm0,0x30(%rsp)
fldt   0x50(%rsp)
fstpt  0x3c(%rsp)
call   10a0 <atan@plt>
fldt   0x3c(%rsp)
fstpt  (%rsp)
call   1060 <atanl@plt>
fstp   %st(0)
movss  0x2c(%rsp),%xmm0
call   1070 <atanf@plt>
movsd  0x30(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <atan2@plt>
fldt   0x3c(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   10d0 <atan2l@plt>
fstp   %st(0)
movss  0x2c(%rsp),%xmm0
movapd %xmm0,%xmm1
call   10e0 <atan2f@plt>
movsd  0x30(%rsp),%xmm2
ucomisd 0xdc9(%rip),%xmm2
ja     129b <test_builtins+0xdb>
movsd  0xdc7(%rip),%xmm0
ucomisd %xmm2,%xmm0
ja     129b <test_builtins+0xdb>
flds   0xdc3(%rip)
fldt   0x3c(%rsp)
fucomi %st(1),%st
fstp   %st(1)
ja     12ac <test_builtins+0xec>
flds   0xdb7(%rip)
fucomip %st(1),%st
ja     12ac <test_builtins+0xec>
movss  0x2c(%rsp),%xmm0
ucomiss 0xdaa(%rip),%xmm0
ja     12c2 <test_builtins+0x102>
movss  0xda4(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     12c2 <test_builtins+0x102>
xorps  %xmm1,%xmm1
ucomisd %xmm2,%xmm1
jae    12db <test_builtins+0x11b>
fldz
fucomip %st(1),%st
jae    12f2 <test_builtins+0x132>
fstp   %st(0)
xorps  %xmm1,%xmm1
add    $0x48,%rsp
ucomiss %xmm0,%xmm1
jae    1306 <test_builtins+0x146>
ret
movapd %xmm2,%xmm0
call   10b0 <exp@plt>
movsd  0x30(%rsp),%xmm2
jmp    1247 <test_builtins+0x87>
fstpt  (%rsp)
call   1090 <expl@plt>
fstp   %st(0)
movsd  0x30(%rsp),%xmm2
fldt   0x3c(%rsp)
jmp    1261 <test_builtins+0xa1>
fstp   %st(0)
call   1080 <expf@plt>
movsd  0x30(%rsp),%xmm2
fldt   0x3c(%rsp)
movss  0x2c(%rsp),%xmm0
jmp    127d <test_builtins+0xbd>
fstp   %st(0)
movapd %xmm2,%xmm0
call   10c0 <log@plt>
fldt   0x3c(%rsp)
movss  0x2c(%rsp),%xmm0
jmp    1286 <test_builtins+0xc6>
fstpt  (%rsp)
call   1050 <logl@plt>
fstp   %st(0)
movss  0x2c(%rsp),%xmm0
fldz
jmp    128c <test_builtins+0xcc>
jmp    1030 <logf@plt>

LLVM IR (-O0):
define void @test_builtins(double %0, float %1, x86_fp80 %2) {
%4 = alloca double
%5 = alloca float
%6 = alloca x86_fp80
%7 = alloca double
%8 = alloca x86_fp80
%9 = alloca float
%10 = alloca double
%11 = alloca x86_fp80
%12 = alloca float
%13 = alloca double
%14 = alloca x86_fp80
%15 = alloca float
%16 = alloca double
%17 = alloca x86_fp80
%18 = alloca float
store double %0, double* %4
store float %1, float* %5
store x86_fp80 %2, x86_fp80* %6
%19 = load double, double* %4
%20 = call double @atan(double %19)
store double %20, double* %7
%21 = load x86_fp80, x86_fp80* %6
%22 = call x86_fp80 @atanl(x86_fp80 %21)
store x86_fp80 %22, x86_fp80* %8
%23 = load float, float* %5
%24 = call float @atanf(float %23)
store float %24, float* %9
%25 = load double, double* %4
%26 = call double @atan2(double %25, i32 2)
store double %26, double* %10
%27 = load x86_fp80, x86_fp80* %6
%28 = load x86_fp80, x86_fp80* %6
%29 = call x86_fp80 @atan2l(x86_fp80 %27, x86_fp80 %28)
store x86_fp80 %29, x86_fp80* %11
%30 = load float, float* %5
%31 = load float, float* %5
%32 = call float @atan2f(float %30, float %31)
store float %32, float* %12
%33 = load double, double* %4
%34 = call double @exp(double %33)
store double %34, double* %13
%35 = load x86_fp80, x86_fp80* %6
%36 = call x86_fp80 @expl(x86_fp80 %35)
store x86_fp80 %36, x86_fp80* %14
%37 = load float, float* %5
%38 = call float @expf(float %37)
store float %38, float* %15
%39 = load double, double* %4
%40 = call double @log(double %39)
store double %40, double* %16
%41 = load x86_fp80, x86_fp80* %6
%42 = call x86_fp80 @logl(x86_fp80 %41)
store x86_fp80 %42, x86_fp80* %17
%43 = load float, float* %5
%44 = call float @logf(float %43)
store float %44, float* %18
ret void
}

LLVM IR (-O2):
define void @test_builtins(double %0, float %1, x86_fp80 %2) {
%4 = tail call double @atan(double %0)
%5 = tail call x86_fp80 @atanl(x86_fp80 %2)
%6 = tail call float @atanf(float %1)
%7 = tail call double @atan2(double %0, i32 2)
%8 = tail call x86_fp80 @atan2l(x86_fp80 %2, x86_fp80 %2)
%9 = tail call float @atan2f(float %1, float %1)
%10 = fcmp olt double %0, -7.450000e+02
%11 = fcmp ogt double %0, 7.090000e+02
%12 = or i1 %11, %10
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = tail call double @exp(double %0)
br label %15
15: ; preds = %3, %13
%16 = fcmp olt x86_fp80 %2, 0xKC00CB21C000000000000
%17 = fcmp ogt x86_fp80 %2, 0xK400CB170000000000000
%18 = or i1 %17, %16
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = tail call x86_fp80 @expl(x86_fp80 %2)
br label %21
21: ; preds = %15, %19
%22 = fcmp olt float %1, -1.030000e+02
%23 = fcmp ogt float %1, 8.800000e+01
%24 = or i1 %23, %22
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = tail call float @expf(float %1)
br label %27
27: ; preds = %21, %25
%28 = fcmp ugt double %0, 0.000000e+00
br i1 %28, label %31, label %29
29: ; preds = %27
%30 = tail call double @log(double %0)
br label %31
31: ; preds = %27, %29
%32 = fcmp ugt x86_fp80 %2, 0xK00000000000000000000
br i1 %32, label %35, label %33
33: ; preds = %31
%34 = tail call x86_fp80 @logl(x86_fp80 %2)
br label %35
35: ; preds = %31, %33
%36 = fcmp ugt float %1, 0.000000e+00
br i1 %36, label %39, label %37
37: ; preds = %35
%38 = tail call float @logf(float %1)
br label %39
39: ; preds = %35, %37
ret void
}