#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
double scanf(char *, double *, double *, double *, double *, double *);
int /*<<< orphan*/ stderr;
int main() {
  double num1, num2, num3, num4, num5, sum;
  printf("Enter 5 numbers in  a  single  line: ");
  if ((scanf("%lf%lf%lf%lf%lf", &num1, &num2, &num3, &num4, &num5) != 5.0)) {
    fprintf(stderr, "Wrong or missing argument!");
    exit(1);
  } else {
    sum = num1 + num2 + num3 + num4 + num5;
  }
  printf("Sum of the number is %.2lf", sum);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x30(%rbp),%r9
call   1050 <scanf@plt>
movsd  0xe7b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    119a <main+0x5a>
jp     119a <main+0x5a>
jmp    11b9 <main+0x79>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@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    0xe76(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%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>
ucomisd 0xe83(%rip),%xmm0
jne    11ba <main+0x7a>
jp     11ba <main+0x7a>
movsd  0x20(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
lea    0xeb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e25(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
ret
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
lea    0xe74(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Enter 5 numbers in a single line: \00"
@.str.1 = [16 x i8] c"%lf%lf%lf%lf%lf\00"
@stderr = global i32 0
@.str.2 = [27 x i8] c"Wrong or missing argument!\00"
@.str.3 = [27 x i8] c"Sum of the number is %.2lf\00"
@EXIT_SUCCESS = global i32 0
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 ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%9 = call double @scanf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3, double* %4, double* %5, double* %6)
%10 = fcmp une double %9, 5.000000e+00
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %0
%16 = load double, double* %2
%17 = load double, double* %3
%18 = fadd double %16, %17
%19 = load double, double* %4
%20 = fadd double %18, %19
%21 = load double, double* %5
%22 = fadd double %20, %21
%23 = load double, double* %6
%24 = fadd double %22, %23
store double %24, double* %7
br label %25
25: ; preds = %15
%26 = load double, double* %7
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), double %26)
%28 = load i32, i32* @EXIT_SUCCESS
ret i32 %28
}

LLVM IR (-O2):
@.str = [38 x i8] c"Enter 5 numbers in a single line: \00"
@.str.1 = [16 x i8] c"%lf%lf%lf%lf%lf\00"
@stderr = global i32 0
@.str.2 = [27 x i8] c"Wrong or missing argument!\00"
@.str.3 = [27 x i8] c"Sum of the number is %.2lf\00"
@EXIT_SUCCESS = global i32 0
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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%12 = call double @scanf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3, double* %4, double* %5)
%13 = fcmp une double %12, 5.000000e+00
br i1 %13, label %14, label %18
14: ; preds = %0
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %0
%19 = load double, double* %1
%20 = load double, double* %2
%21 = fadd double %19, %20
%22 = load double, double* %3
%23 = fadd double %21, %22
%24 = load double, double* %4
%25 = fadd double %23, %24
%26 = load double, double* %5
%27 = fadd double %25, %26
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), double %27)
%29 = load i32, i32* @EXIT_SUCCESS
ret i32 %29
}