#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, double);
double read_double(char *);
double velocity(double, double, double);
int main() {
  double v, v0;
  double a;
  double t;
  v0 = read_double("Enter the initial velocity");
  a = read_double("Enter the acceleration");
  t = read_double("Enter the time");
  v = velocity(v0, a, t);
  printf("The final velocity is %.2f\n", v);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1050 <read_double@plt>
movsd  %xmm0,-0x18(%rbp)
lea    0xec4(%rip),%rdi
call   1050 <read_double@plt>
movsd  %xmm0,-0x20(%rbp)
lea    0xeca(%rip),%rdi
call   1050 <read_double@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <velocity@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e3d(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
call   1050 <read_double@plt>
movsd  %xmm0,0x10(%rsp)
lea    0xece(%rip),%rdi
call   1050 <read_double@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xed3(%rip),%rdi
call   1050 <read_double@plt>
movaps %xmm0,%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <velocity@plt>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter the initial velocity\00"
@.str.1 = [23 x i8] c"Enter the acceleration\00"
@.str.2 = [15 x i8] c"Enter the time\00"
@.str.3 = [28 x i8] c"The final velocity is %.2f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
%6 = call double @read_double(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store double %6, double* %3
%7 = call double @read_double(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store double %7, double* %4
%8 = call double @read_double(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
store double %8, double* %5
%9 = load double, double* %3
%10 = load double, double* %4
%11 = load double, double* %5
%12 = call double @velocity(double %9, double %10, double %11)
store double %12, double* %2
%13 = load double, double* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter the initial velocity\00"
@.str.1 = [23 x i8] c"Enter the acceleration\00"
@.str.2 = [15 x i8] c"Enter the time\00"
@.str.3 = [28 x i8] c"The final velocity is %.2f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call double @read_double(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call double @read_double(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call double @read_double(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call double @velocity(double %1, double %2, double %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), double %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}