#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 *, long long);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n, i;
  long long int a[100], sum = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
    sum = sum + a[i];
  }
  printf("%lld", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x338(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11aa <main+0x8a>
movslq -0xc(%rbp),%rax
lea    -0x330(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x338(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    -0x330(%rbp,%rcx,8),%rax
ff
mov    %rax,-0x338(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <main+0x36>
mov    -0x338(%rbp),%rsi
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x338,%rsp
lea    0xecb(%rip),%rdi
xor    %r14d,%r14d
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1182 <main+0x62>
lea    0x10(%rsp),%rbx
lea    0xeac(%rip),%r15
xor    %r12d,%r12d
xor    %r14d,%r14d
nopl   (%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    (%rbx),%r14
add    $0x1,%r12
movslq 0xc(%rsp),%rax
add    $0x8,%rbx
cmp    %rax,%r12
jl     1160 <main+0x40>
lea    0xe7a(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x338,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%lld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i64]
%5 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %5
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %7
7: ; preds = %22, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %25
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [100 x i64], [100 x i64]* %4, i64 0, i64 %13
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %14)
%16 = load i64, i64* %5
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [100 x i64], [100 x i64]* %4, i64 0, i64 %18
%20 = load i64, i64* %19
%21 = add nsw i64 %16, %20
store i64 %21, i64* %5
br label %22
22: ; preds = %11
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %7
25: ; preds = %7
%26 = load i64, i64* %5
%27 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%lld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i64]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [100 x i64]* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %0, %8
%9 = phi i64 [ %15, %8 ], [ 0, %0 ]
%10 = phi i64 [ %14, %8 ], [ 0, %0 ]
%11 = getelementptr inbounds [100 x i64], [100 x i64]* %2, i64 0, i64 %9
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64* %11)
%13 = load i64, i64* %11
%14 = add nsw i64 %13, %10
%15 = add nuw nsw i64 %9, 1
%16 = load i32, i32* %1
%17 = sext i32 %16 to i64
%18 = icmp slt i64 %15, %17
br i1 %18, label %8, label %19
19: ; preds = %8, %0
%20 = phi i64 [ 0, %0 ], [ %14, %8 ]
%21 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %20)
ret i32 0
}