#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 ceil(double);
double exp(int);
double fabs(int);
double floor(double);
double log(int);
double log10(int);
double log2(int);
double pow(int, int);
int /*<<< orphan*/ printf(char *, double);
double sin(int);
int main() {
  printf("sin(1) = %f\n", sin(1));
  printf("exp(10) = %f\n", exp(10));
  printf("log(10) = %f\n", log(10));
  printf("log10(1000) = %f\n", log10(1000));
  printf("log2(1024) = %f\n", log2(1024));
  printf("pow(2, 10) = %f\n", pow(2, 10));
  printf("ceil(3.1415926) = %f\n", ceil(3.1415926));
  printf("floor(3.1415926) = %f\n", floor(3.1415926));
  printf("fabs(23) = %f\n", fabs(23));
  printf("fabs(-23) = %f\n", fabs(-23));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1060 <sin@plt>
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1070 <exp@plt>
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1080 <log@plt>
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3e8,%edi
call   10a0 <log10@plt>
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
mov    $0x400,%edi
call   1030 <log2@plt>
lea    0xe53(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
mov    $0xa,%esi
call   1090 <pow@plt>
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
movsd  0xde8(%rip),%xmm0
lea    0xe46(%rip),%rdi
call   1040 <printf@plt>
movsd  0xdcc(%rip),%xmm0
lea    0xe48(%rip),%rdi
call   1040 <printf@plt>
mov    $0x17,%edi
call   1050 <fabs@plt>
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffe9,%edi
call   1050 <fabs@plt>
lea    0xe42(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1060 <sin@plt>
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1070 <exp@plt>
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1080 <log@plt>
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3e8,%edi
call   10a0 <log10@plt>
lea    0xe65(%rip),%rdi
call   1040 <printf@plt>
mov    $0x400,%edi
call   1030 <log2@plt>
lea    0xe61(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
mov    $0xa,%esi
call   1090 <pow@plt>
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
lea    0xe5c(%rip),%rdi
movsd  0xde7(%rip),%xmm0
call   1040 <printf@plt>
lea    0xe5e(%rip),%rdi
movsd  0xddb(%rip),%xmm0
call   1040 <printf@plt>
mov    $0x17,%edi
call   1050 <fabs@plt>
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffe9,%edi
call   1050 <fabs@plt>
lea    0xe50(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"sin(1) = %f\0A\00"
@.str.1 = [14 x i8] c"exp(10) = %f\0A\00"
@.str.2 = [14 x i8] c"log(10) = %f\0A\00"
@.str.3 = [18 x i8] c"log10(1000) = %f\0A\00"
@.str.4 = [17 x i8] c"log2(1024) = %f\0A\00"
@.str.5 = [17 x i8] c"pow(2, 10) = %f\0A\00"
@.str.6 = [22 x i8] c"ceil(3.1415926) = %f\0A\00"
@.str.7 = [23 x i8] c"floor(3.1415926) = %f\0A\00"
@.str.8 = [15 x i8] c"fabs(23) = %f\0A\00"
@.str.9 = [16 x i8] c"fabs(-23) = %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @sin(i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @exp(i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call double @log(i32 10)
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %6)
%8 = call double @log10(i32 1000)
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), double %8)
%10 = call double @log2(i32 1024)
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %10)
%12 = call double @pow(i32 2, i32 10)
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %12)
%14 = call double @llvm.ceil.f64(double 0x400921FB4D12D84A)
%15 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %14)
%16 = call double @llvm.floor.f64(double 0x400921FB4D12D84A)
%17 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), double %16)
%18 = call double @fabs(i32 23)
%19 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), double %18)
%20 = call double @fabs(i32 -23)
%21 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"sin(1) = %f\0A\00"
@.str.1 = [14 x i8] c"exp(10) = %f\0A\00"
@.str.2 = [14 x i8] c"log(10) = %f\0A\00"
@.str.3 = [18 x i8] c"log10(1000) = %f\0A\00"
@.str.4 = [17 x i8] c"log2(1024) = %f\0A\00"
@.str.5 = [17 x i8] c"pow(2, 10) = %f\0A\00"
@.str.6 = [22 x i8] c"ceil(3.1415926) = %f\0A\00"
@.str.7 = [23 x i8] c"floor(3.1415926) = %f\0A\00"
@.str.8 = [15 x i8] c"fabs(23) = %f\0A\00"
@.str.9 = [16 x i8] c"fabs(-23) = %f\0A\00"
define i32 @main() {
%1 = tail call double @sin(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @exp(i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double @log(i32 10)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %5)
%7 = tail call double @log10(i32 1000)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), double %7)
%9 = tail call double @log2(i32 1024)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %9)
%11 = tail call double @pow(i32 2, i32 10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %11)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double 4.000000e+00)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), double 3.000000e+00)
%15 = tail call double @fabs(i32 23)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), double %15)
%17 = tail call double @fabs(i32 -23)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %17)
ret i32 0
}