#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);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int temp, sum = 0;
  int i;
  for (i = 1; i <= 10; i++) {
    scanf("%d", &temp);
    sum = sum + temp;
  }
  printf("%d", sum / 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jg     116e <main+0x4e>
lea    0xeb2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%r14
lea    0xc(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    0xc(%rsp),%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    0xc(%rsp),%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    0xc(%rsp),%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    0xc(%rsp),%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    0xc(%rsp),%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    0xc(%rsp),%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    0xc(%rsp),%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    0xc(%rsp),%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    0xc(%rsp),%ebp
movslq %ebp,%rax
imul   $0x66666667,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x22,%rsi
add    %eax,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, %4
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = add nsw i32 %9, %7
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = add nsw i32 %12, %10
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%15 = load i32, i32* %1
%16 = add nsw i32 %15, %13
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%18 = load i32, i32* %1
%19 = add nsw i32 %18, %16
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%21 = load i32, i32* %1
%22 = add nsw i32 %21, %19
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%24 = load i32, i32* %1
%25 = add nsw i32 %24, %22
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%27 = load i32, i32* %1
%28 = add nsw i32 %27, %25
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%30 = load i32, i32* %1
%31 = add nsw i32 %30, %28
%32 = sdiv i32 %31, 10
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %32)
ret i32 0
}