#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 *, double *, double *, double *, double *,
                         double *);
int main() {
  double a;
  double b;
  double c;
  double d;
  double e;
  printf("Please enter five numbers, separeted by space:\n");
  scanf("%lf %lf %lf %lf %lf", &a, &b, &c, &d, &e);
  double sum = a + b + c + d + e;
  printf("Sum: %.2lf\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x30(%rbp),%r9
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xebd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %rsp,%r9
call   1050 <scanf@plt>
movsd  0x20(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
lea    0xe8d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Please enter five numbers, separeted by space:\0A\00"
@.str.1 = [20 x i8] c"%lf %lf %lf %lf %lf\00"
@.str.2 = [12 x i8] c"Sum: %.2lf\0A\00"
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
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3, double* %4, double* %5, double* %6)
%10 = load double, double* %2
%11 = load double, double* %3
%12 = fadd double %10, %11
%13 = load double, double* %4
%14 = fadd double %12, %13
%15 = load double, double* %5
%16 = fadd double %14, %15
%17 = load double, double* %6
%18 = fadd double %16, %17
store double %18, double* %7
%19 = load double, double* %7
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %19)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"%lf %lf %lf %lf %lf\00"
@.str.2 = [12 x i8] c"Sum: %.2lf\0A\00"
@str = [47 x i8] c"Please enter five numbers, separeted by space:\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %1 to i8*
%7 = bitcast double* %2 to i8*
%8 = bitcast double* %3 to i8*
%9 = bitcast double* %4 to i8*
%10 = bitcast double* %5 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3, double* %4, double* %5)
%13 = load double, double* %1
%14 = load double, double* %2
%15 = fadd double %13, %14
%16 = load double, double* %3
%17 = fadd double %15, %16
%18 = load double, double* %4
%19 = fadd double %17, %18
%20 = load double, double* %5
%21 = fadd double %19, %20
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %21)
ret i32 0
}