#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 *);
int main(void) {
  double listA[8], listB[8];
  int i, j;
  printf("Enter 8 double numbers:\n");
  for (i = 0; i < 8; i++) {
    printf("Number#%d: ", i + 1);
    scanf("%lf", &listA[i]);
  }
  listB[0] = listA[0];
  for (i = 1; i < 8; i++)
    listB[i] = listB[i - 1] + listA[i];
  for (i = 0; i < 8; i++)
    printf("%5g  ", listA[i]);
  printf("\n");
  for (i = 0; i < 8; i++)
    printf("%5g  ", listB[i]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x8,-0x94(%rbp)
jge    11a0 <main+0x80>
mov    -0x94(%rbp),%esi
add    $0x1,%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x94(%rbp),%rax
lea    -0x50(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe9e(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    114a <main+0x2a>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x1,-0x94(%rbp)
cmpl   $0x8,-0x94(%rbp)
jge    1209 <main+0xe9>
mov    -0x94(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
movslq -0x94(%rbp),%rax
addsd  -0x50(%rbp,%rax,8),%xmm0
movslq -0x94(%rbp),%rax
movsd  %xmm0,-0x90(%rbp,%rax,8)
ff ff
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    11b7 <main+0x97>
movl   $0x0,-0x94(%rbp)
cmpl   $0x8,-0x94(%rbp)
jge    124f <main+0x12f>
movslq -0x94(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm0
lea    0xdf5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1213 <main+0xf3>
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x8,-0x94(%rbp)
jge    12a6 <main+0x186>
movslq -0x94(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
lea    0xd9e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1267 <main+0x147>
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
lea    0xec5(%rip),%rdi
call   1040 <puts@plt>
lea    0xea3(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe99(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x38(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x50(%rsp)
movapd %xmm1,%xmm0
movsd  %xmm1,0x48(%rsp)
movsd  0x10(%rsp),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x58(%rsp)
movsd  0x18(%rsp),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x60(%rsp)
movsd  0x20(%rsp),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x68(%rsp)
movsd  0x28(%rsp),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x70(%rsp)
movsd  0x30(%rsp),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x78(%rsp)
movsd  0x38(%rsp),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x80(%rsp)
lea    0xd45(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x20(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x28(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x30(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x38(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
movsd  0x48(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
movsd  0x50(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
movsd  0x58(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
movsd  0x60(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
movsd  0x68(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
movsd  0x70(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
movsd  0x78(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
movsd  0x80(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter 8 double numbers:\0A\00"
@.str.1 = [12 x i8] c"Number#%d: \00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [6 x i8] c"%5g \00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x double]
%3 = alloca [8 x double]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %7
7: ; preds = %18, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 %15
%17 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %7
21: ; preds = %7
%22 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 0
%23 = load double, double* %22
%24 = getelementptr inbounds [8 x double], [8 x double]* %3, i64 0, i64 0
store double %23, double* %24
store i32 1, i32* %4
br label %25
25: ; preds = %42, %21
%26 = load i32, i32* %4
%27 = icmp slt i32 %26, 8
br i1 %27, label %28, label %45
28: ; preds = %25
%29 = load i32, i32* %4
%30 = sub nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [8 x double], [8 x double]* %3, i64 0, i64 %31
%33 = load double, double* %32
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 %35
%37 = load double, double* %36
%38 = fadd double %33, %37
%39 = load i32, i32* %4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [8 x double], [8 x double]* %3, i64 0, i64 %40
store double %38, double* %41
br label %42
42: ; preds = %28
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 1
store i32 %44, i32* %4
br label %25
45: ; preds = %25
store i32 0, i32* %4
br label %46
46: ; preds = %55, %45
%47 = load i32, i32* %4
%48 = icmp slt i32 %47, 8
br i1 %48, label %49, label %58
49: ; preds = %46
%50 = load i32, i32* %4
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 %51
%53 = load double, double* %52
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %53)
br label %55
55: ; preds = %49
%56 = load i32, i32* %4
%57 = add nsw i32 %56, 1
store i32 %57, i32* %4
br label %46
58: ; preds = %46
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %4
br label %60
60: ; preds = %69, %58
%61 = load i32, i32* %4
%62 = icmp slt i32 %61, 8
br i1 %62, label %63, label %72
63: ; preds = %60
%64 = load i32, i32* %4
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [8 x double], [8 x double]* %3, i64 0, i64 %65
%67 = load double, double* %66
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %67)
br label %69
69: ; preds = %63
%70 = load i32, i32* %4
%71 = add nsw i32 %70, 1
store i32 %71, i32* %4
br label %60
72: ; preds = %60
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"Number#%d: \00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [6 x i8] c"%5g \00"
@str = [24 x i8] c"Enter 8 double numbers:\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 2)
%8 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 1
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 3)
%11 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 2
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 4)
%14 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 3
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 5)
%17 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 4
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %17)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 6)
%20 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 5
%21 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %20)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 7)
%23 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 6
%24 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %23)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 8)
%26 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 7
%27 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %26)
%28 = load double, double* %5
%29 = load double, double* %8
%30 = fadd double %28, %29
%31 = load double, double* %11
%32 = fadd double %30, %31
%33 = load double, double* %14
%34 = fadd double %32, %33
%35 = load double, double* %17
%36 = fadd double %34, %35
%37 = load double, double* %20
%38 = fadd double %36, %37
%39 = load double, double* %23
%40 = fadd double %38, %39
%41 = load double, double* %26
%42 = fadd double %40, %41
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %28)
%44 = load double, double* %8
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %44)
%46 = load double, double* %11
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %46)
%48 = load double, double* %14
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %48)
%50 = load double, double* %17
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %50)
%52 = load double, double* %20
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %52)
%54 = load double, double* %23
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %54)
%56 = load double, double* %26
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %56)
%58 = call i32 @putchar(i32 10)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %28)
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %30)
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %32)
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %34)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %36)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %38)
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %40)
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %42)
%67 = call i32 @putchar(i32 10)
ret i32 0
}