#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 cos(double);
double exp(double);
double floor(double);
double log(double);
double pow(double, double);
int /*<<< orphan*/ printf(char *, double, ...);
double sqrt(double);
int main() {
  double a = 25.5;
  printf("%f is our variable.\n", a);
  printf("cos(%f)=%f\n", a, cos(a));
  printf("exp(%f)=%f\n", a, exp(a));
  printf("log(%f)=%f\n", a, log(a));
  printf("pow(%f,%f)=%f\n", a, a, pow(a, a));
  printf("sqrt(%f)=%f\n", a, sqrt(a));
  printf("ceil(%f)=%f\n", a, ceil(a));
  printf("floor(%f)=%f\n", a, floor(a));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  0xe70(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xe67(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
lea    0xe52(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
lea    0xe34(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
lea    0xe16(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1080 <pow@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
lea    0xde4(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
lea    0xdc9(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
lea    0xdac(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   10a0 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
lea    0xd8f(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf28(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf27(%rip),%rdi
movsd  0xed2(%rip),%xmm1
movsd  0xec2(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
movsd  0xebc(%rip),%xmm1
movsd  0xea4(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
movsd  0xea6(%rip),%xmm1
movsd  0xe86(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
movsd  0xe90(%rip),%xmm2
movsd  0xe68(%rip),%xmm0
movaps %xmm0,%xmm1
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
movsd  0xe77(%rip),%xmm1
movsd  0xe47(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
movsd  0xe61(%rip),%xmm1
movsd  0xe29(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
movsd  0xe4b(%rip),%xmm1
movsd  0xe0b(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%f is our variable.\0A\00"
@.str.1 = [12 x i8] c"cos(%f)=%f\0A\00"
@.str.2 = [12 x i8] c"exp(%f)=%f\0A\00"
@.str.3 = [12 x i8] c"log(%f)=%f\0A\00"
@.str.4 = [15 x i8] c"pow(%f,%f)=%f\0A\00"
@.str.5 = [13 x i8] c"sqrt(%f)=%f\0A\00"
@.str.6 = [13 x i8] c"ceil(%f)=%f\0A\00"
@.str.7 = [14 x i8] c"floor(%f)=%f\0A\00"
define i32 @main() {
%1 = alloca double
store double 2.550000e+01, double* %1
%2 = load double, double* %1
%3 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %2)
%4 = load double, double* %1
%5 = load double, double* %1
%6 = call double @cos(double %5)
%7 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %4, double %6)
%8 = load double, double* %1
%9 = load double, double* %1
%10 = call double @exp(double %9)
%11 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %8, double %10)
%12 = load double, double* %1
%13 = load double, double* %1
%14 = call double @log(double %13)
%15 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), double %12, double %14)
%16 = load double, double* %1
%17 = load double, double* %1
%18 = load double, double* %1
%19 = load double, double* %1
%20 = call double @pow(double %18, double %19)
%21 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %16, double %17, double %20)
%22 = load double, double* %1
%23 = load double, double* %1
%24 = call double @sqrt(double %23)
%25 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), double %22, double %24)
%26 = load double, double* %1
%27 = load double, double* %1
%28 = call double @llvm.ceil.f64(double %27)
%29 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), double %26, double %28)
%30 = load double, double* %1
%31 = load double, double* %1
%32 = call double @llvm.floor.f64(double %31)
%33 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double %30, double %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"%f is our variable.\0A\00"
@.str.1 = [12 x i8] c"cos(%f)=%f\0A\00"
@.str.2 = [12 x i8] c"exp(%f)=%f\0A\00"
@.str.3 = [12 x i8] c"log(%f)=%f\0A\00"
@.str.4 = [15 x i8] c"pow(%f,%f)=%f\0A\00"
@.str.5 = [13 x i8] c"sqrt(%f)=%f\0A\00"
@.str.6 = [13 x i8] c"ceil(%f)=%f\0A\00"
@.str.7 = [14 x i8] c"floor(%f)=%f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double 2.550000e+01)
%2 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double 2.550000e+01, double 0x3FEDDDB7A765AAF8)
%3 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double 2.550000e+01, double 0x423BA4068AAC2B6E)
%4 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), double 2.550000e+01, double 0x4009E8D03F927283)
%5 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double 2.550000e+01, double 2.550000e+01, double 0x4761B6DF5119B896)
%6 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), double 2.550000e+01, double 0x401432F24FB01C7A)
%7 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), double 2.550000e+01, double 2.600000e+01)
%8 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double 2.550000e+01, double 2.500000e+01)
ret i32 0
}