#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 *, long long *);
int main(void) {
  long long num, temp, sum = 0, i;
  scanf("%lld\n", &num);
  for (i = 0; i < num; i++) {
    scanf("%lld", &temp);
    sum += temp;
  }
  printf("%lld\n", sum / num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    118a <main+0x6a>
lea    0xea2(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    114f <main+0x2f>
mov    -0x20(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,%rsi
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xece(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%rcx
test   %rcx,%rcx
jle    1180 <main+0x60>
xor    %ebx,%ebx
lea    0xeb7(%rip),%r14
lea    0x10(%rsp),%r15
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
add    0x10(%rsp),%r12
add    $0x1,%rbx
mov    0x8(%rsp),%rcx
cmp    %rcx,%rbx
jl     1160 <main+0x40>
jmp    1183 <main+0x63>
xor    %r12d,%r12d
mov    %r12,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1199 <main+0x79>
mov    %r12,%rax
cqto
idiv   %rcx
jmp    11a0 <main+0x80>
mov    %r12d,%eax
xor    %edx,%edx
div    %ecx
lea    0xe59(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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