#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*/ beginning_program_message();
double calculate_acceleration_m_sec(double, double, double);
double calculate_acceleration_mi_hour(double, double, double);
double calculate_time_to_stop(double, int /*<<< orphan*/, double, double);
int /*<<< orphan*/ display_acceleration_and_time(double, double, double);
double get_final_velocity();
double get_initial_velocity();
double get_time_interval();
int main(void) {
  double initial_velocity = 0.0, final_velocity = 0.0, time_interval = 0.0,
         acceleration_mi_hour = 0.0, acceleration_m_sec = 0.0,
         time_to_stop = 0.0;
  beginning_program_message();
  initial_velocity = get_initial_velocity();
  final_velocity = get_final_velocity();
  time_interval = get_time_interval();
  acceleration_mi_hour = calculate_acceleration_mi_hour(
      initial_velocity, final_velocity, time_interval);
  acceleration_m_sec = calculate_acceleration_m_sec(
      initial_velocity, final_velocity, time_interval);
  time_to_stop = calculate_time_to_stop(final_velocity, 0, acceleration_mi_hour,
                                        time_interval);
  display_acceleration_and_time(acceleration_mi_hour, acceleration_m_sec,
                                time_to_stop);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    $0x0,%al
call   1080 <beginning_program_message@plt>
mov    $0x0,%al
call   10a0 <get_initial_velocity@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <get_final_velocity@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1070 <get_time_interval@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1050 <calculate_acceleration_mi_hour@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1030 <calculate_acceleration_m_sec@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
xor    %edi,%edi
call   1090 <calculate_time_to_stop@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
call   1060 <display_acceleration_and_time@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xor    %eax,%eax
call   1080 <beginning_program_message@plt>
xor    %eax,%eax
call   10a0 <get_initial_velocity@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <get_final_velocity@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1070 <get_time_interval@plt>
movaps %xmm0,%xmm2
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1050 <calculate_acceleration_mi_hour@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1030 <calculate_acceleration_m_sec@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
xor    %edi,%edi
movsd  0x20(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1090 <calculate_time_to_stop@plt>
movaps %xmm0,%xmm2
movsd  0x20(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1060 <display_acceleration_and_time@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
%8 = call i32 (...) @beginning_program_message()
%9 = call double (...) @get_initial_velocity()
store double %9, double* %2
%10 = call double (...) @get_final_velocity()
store double %10, double* %3
%11 = call double (...) @get_time_interval()
store double %11, double* %4
%12 = load double, double* %2
%13 = load double, double* %3
%14 = load double, double* %4
%15 = call double @calculate_acceleration_mi_hour(double %12, double %13, double %14)
store double %15, double* %5
%16 = load double, double* %2
%17 = load double, double* %3
%18 = load double, double* %4
%19 = call double @calculate_acceleration_m_sec(double %16, double %17, double %18)
store double %19, double* %6
%20 = load double, double* %3
%21 = load double, double* %5
%22 = load double, double* %4
%23 = call double @calculate_time_to_stop(double %20, i32 0, double %21, double %22)
store double %23, double* %7
%24 = load double, double* %5
%25 = load double, double* %6
%26 = load double, double* %7
%27 = call i32 @display_acceleration_and_time(double %24, double %25, double %26)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @beginning_program_message()
%2 = tail call double (...) @get_initial_velocity()
%3 = tail call double (...) @get_final_velocity()
%4 = tail call double (...) @get_time_interval()
%5 = tail call double @calculate_acceleration_mi_hour(double %2, double %3, double %4)
%6 = tail call double @calculate_acceleration_m_sec(double %2, double %3, double %4)
%7 = tail call double @calculate_time_to_stop(double %3, i32 0, double %5, double %4)
%8 = tail call i32 @display_acceleration_and_time(double %5, double %6, double %7)
ret i32 0
}