#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 */
int /*<<< orphan*/ calibration();
double getAltitude();
scalar_t__ getPressure();
double getTemperature();
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  calibration();
  printf("Temperature\t%0.1f C\n", getTemperature());
  printf("Pressure\t%0.2f hPa\n", (double)getPressure() / 100);
  printf("Altitude\t%0.2f m\n", getAltitude());
  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    $0x0,%al
call   1050 <calibration@plt>
mov    $0x0,%al
call   1060 <getTemperature@plt>
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getPressure@plt>
cvtsi2sd %rax,%xmm0
movsd  0xe6c(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <getAltitude@plt>
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <calibration@plt>
xor    %eax,%eax
call   1060 <getTemperature@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <getPressure@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  0xe7e(%rip),%xmm0
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <getAltitude@plt>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Temperature\09%0.1f C\0A\00"
@.str.1 = [20 x i8] c"Pressure\09%0.2f hPa\0A\00"
@.str.2 = [18 x i8] c"Altitude\09%0.2f m\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 i32 (...) @calibration()
%7 = call double (...) @getTemperature()
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %7)
%9 = call i64 (...) @getPressure()
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+02
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %11)
%13 = call double (...) @getAltitude()
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Temperature\09%0.1f C\0A\00"
@.str.1 = [20 x i8] c"Pressure\09%0.2f hPa\0A\00"
@.str.2 = [18 x i8] c"Altitude\09%0.2f m\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @calibration()
%4 = tail call double (...) @getTemperature()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %4)
%6 = tail call i64 (...) @getPressure()
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+02
%9 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %8)
%10 = tail call double (...) @getAltitude()
%11 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
}