#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 compute_BMI(double, int);
int compute_height(int, int);
int /*<<< orphan*/ display_results(double);
int get_height_feet();
int get_height_inches();
double get_weight();
int main(void) {
  int height_feet = 0, height_inches = 0, height_final = 0;
  double weight = 0.0, result_BMI = 0.0;
  weight = get_weight();
  height_feet = get_height_feet();
  height_inches = get_height_inches();
  height_final = compute_height(height_feet, height_inches);
  result_BMI = compute_BMI(weight, height_final);
  display_results(result_BMI);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <get_weight@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <get_height_feet@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <get_height_inches@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <compute_height@plt>
mov    %eax,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%edi
call   1080 <compute_BMI@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1070 <display_results@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <get_weight@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <get_height_feet@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <get_height_inches@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <compute_height@plt>
movsd  0x8(%rsp),%xmm0
mov    %eax,%edi
call   1080 <compute_BMI@plt>
call   1070 <display_results@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
%7 = call double (...) @get_weight()
store double %7, double* %5
%8 = call i32 (...) @get_height_feet()
store i32 %8, i32* %2
%9 = call i32 (...) @get_height_inches()
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @compute_height(i32 %10, i32 %11)
store i32 %12, i32* %4
%13 = load double, double* %5
%14 = load i32, i32* %4
%15 = call double @compute_BMI(double %13, i32 %14)
store double %15, double* %6
%16 = load double, double* %6
%17 = call i32 @display_results(double %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double (...) @get_weight()
%2 = tail call i32 (...) @get_height_feet()
%3 = tail call i32 (...) @get_height_inches()
%4 = tail call i32 @compute_height(i32 %2, i32 %3)
%5 = tail call double @compute_BMI(double %1, i32 %4)
%6 = tail call i32 @display_results(double %5)
ret i32 0
}