#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 cos(int);
double exp(int);
double log(int);
double pow(int, double);
int /*<<< orphan*/ printf(char *, double);
double sqrt(int);
int main(int argc, char *argv[]) {
  printf("cos(7) : %f \n", cos(7));
  printf("exp(2) : %f \n", exp(2));
  printf("log(2) : %f \n", log(2));
  printf("3**2.7 : %f \n", pow(3, 2.7));
  printf("sqrt(2): %f \n", sqrt(2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x7,%edi
call   1050 <cos@plt>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exp@plt>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1060 <log@plt>
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
movsd  0xe3b(%rip),%xmm0
call   1070 <pow@plt>
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1080 <sqrt@plt>
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1050 <cos@plt>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exp@plt>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1060 <log@plt>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe55(%rip),%xmm0
mov    $0x3,%edi
call   1070 <pow@plt>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1080 <sqrt@plt>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"cos(7) : %f \0A\00"
@.str.1 = [14 x i8] c"exp(2) : %f \0A\00"
@.str.2 = [14 x i8] c"log(2) : %f \0A\00"
@.str.3 = [14 x i8] c"3**2.7 : %f \0A\00"
@.str.4 = [14 x i8] c"sqrt(2): %f \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call double @cos(i32 7)
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call double @exp(i32 2)
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %8)
%10 = call double @log(i32 2)
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %10)
%12 = call double @pow(i32 3, double 2.700000e+00)
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %12)
%14 = call double @sqrt(i32 2)
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"cos(7) : %f \0A\00"
@.str.1 = [14 x i8] c"exp(2) : %f \0A\00"
@.str.2 = [14 x i8] c"log(2) : %f \0A\00"
@.str.3 = [14 x i8] c"3**2.7 : %f \0A\00"
@.str.4 = [14 x i8] c"sqrt(2): %f \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @cos(i32 7)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %3)
%5 = tail call double @exp(i32 2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %5)
%7 = tail call double @log(i32 2)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %7)
%9 = tail call double @pow(i32 3, double 2.700000e+00)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %9)
%11 = tail call double @sqrt(i32 2)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %11)
ret i32 0
}