#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float va1, va2, va3, va4, va5, sum, avg;
  printf("What is the first value?\n");
  scanf("%f", &va1);
  printf("What is the second value?\n");
  scanf("%f", &va2);
  printf("What is the third value?\n");
  scanf("%f", &va3);
  printf("What is the fourth value?\n");
  scanf("%f", &va4);
  printf("What is the firth value?\n");
  scanf("%f", &va5);
  sum = (va1 + va2 + va3 + va4 + va5);
  avg = sum / 5;
  printf("The first value is: %f\n", va1);
  printf("The second value is: %f\n", va2);
  printf("The third value is: %f\n", va3);
  printf("The fourth value is: %f\n", va4);
  printf("The fifth value is: %f\n", va5);
  printf("The average is: %f\n", avg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe62(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  0xe10(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe82(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe83(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe85(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe86(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe88(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe89(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xf59(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rbx
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf52(%rip),%rdi
call   1030 <puts@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf53(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf53(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf54(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x1c(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
addss  %xmm0,%xmm1
addss  0x10(%rsp),%xmm1
addss  0xc(%rsp),%xmm1
addss  0x8(%rsp),%xmm1
divss  0xe1d(%rip),%xmm1
movss  %xmm1,0x18(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xe13(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe13(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe14(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe14(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe15(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe15(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"What is the first value?\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [27 x i8] c"What is the second value?\0A\00"
@.str.3 = [26 x i8] c"What is the third value?\0A\00"
@.str.4 = [27 x i8] c"What is the fourth value?\0A\00"
@.str.5 = [26 x i8] c"What is the firth value?\0A\00"
@.str.6 = [24 x i8] c"The first value is: %f\0A\00"
@.str.7 = [25 x i8] c"The second value is: %f\0A\00"
@.str.8 = [24 x i8] c"The third value is: %f\0A\00"
@.str.9 = [25 x i8] c"The fourth value is: %f\0A\00"
@.str.10 = [24 x i8] c"The fifth value is: %f\0A\00"
@.str.11 = [20 x i8] c"The average is: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %6)
%19 = load float, float* %2
%20 = load float, float* %3
%21 = fadd float %19, %20
%22 = load float, float* %4
%23 = fadd float %21, %22
%24 = load float, float* %5
%25 = fadd float %23, %24
%26 = load float, float* %6
%27 = fadd float %25, %26
store float %27, float* %7
%28 = load float, float* %7
%29 = fdiv float %28, 5.000000e+00
store float %29, float* %8
%30 = load float, float* %2
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), double %31)
%33 = load float, float* %3
%34 = fpext float %33 to double
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), double %34)
%36 = load float, float* %4
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), double %37)
%39 = load float, float* %5
%40 = fpext float %39 to double
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), double %40)
%42 = load float, float* %6
%43 = fpext float %42 to double
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), double %43)
%45 = load float, float* %8
%46 = fpext float %45 to double
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), double %46)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.6 = [24 x i8] c"The first value is: %f\0A\00"
@.str.7 = [25 x i8] c"The second value is: %f\0A\00"
@.str.8 = [24 x i8] c"The third value is: %f\0A\00"
@.str.9 = [25 x i8] c"The fourth value is: %f\0A\00"
@.str.10 = [24 x i8] c"The fifth value is: %f\0A\00"
@.str.11 = [20 x i8] c"The average is: %f\0A\00"
@str = [25 x i8] c"What is the first value?\00"
@str.12 = [26 x i8] c"What is the second value?\00"
@str.13 = [25 x i8] c"What is the third value?\00"
@str.14 = [26 x i8] c"What is the fourth value?\00"
@str.15 = [25 x i8] c"What is the firth value?\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = bitcast float* %1 to i8*
%7 = bitcast float* %2 to i8*
%8 = bitcast float* %3 to i8*
%9 = bitcast float* %4 to i8*
%10 = bitcast float* %5 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.12, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.13, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.14, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.15, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%21 = load float, float* %1
%22 = load float, float* %2
%23 = fadd float %21, %22
%24 = load float, float* %3
%25 = fadd float %23, %24
%26 = load float, float* %4
%27 = fadd float %25, %26
%28 = load float, float* %5
%29 = fadd float %27, %28
%30 = fdiv float %29, 5.000000e+00
%31 = fpext float %21 to double
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), double %31)
%33 = load float, float* %2
%34 = fpext float %33 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), double %34)
%36 = load float, float* %3
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), double %37)
%39 = load float, float* %4
%40 = fpext float %39 to double
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), double %40)
%42 = load float, float* %5
%43 = fpext float %42 to double
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), double %43)
%45 = fpext float %30 to double
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), double %45)
ret i32 0
}