#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 *, unsigned int);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int /*<<< orphan*/ system(char *);
int main() {
  unsigned int x, contador = 1, acumulador = 0;
  while (contador <= 10) {
    printf("\nDigite o %dº número: ", contador);
    scanf("%d", &x);
    acumulador = acumulador + x;
    contador++;
  }
  printf("\nA média dos números digitados é %d.\n\n", (acumulador / 10));
  system("pause");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0xc(%rbp)
ja     118d <main+0x5d>
mov    -0xc(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x1d>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%esi
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
lea    0xec6(%rip),%r12
lea    0x4(%rsp),%r15
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
add    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
add    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
add    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
add    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    $0x6,%esi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
add    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
add    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
add    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    $0x9,%esi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
add    0x4(%rsp),%ebx
mov    %r14,%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
add    0x4(%rsp),%ebx
mov    $0xcccccccd,%esi
imul   %rbx,%rsi
shr    $0x23,%rsi
lea    0xda5(%rip),%rdi
call   1040 <printf@plt>
lea    0xdc3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0ADigite o %d\C2\BA n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [42 x i8] c"\0AA m\C3\A9dia dos n\C3\BAmeros digitados \C3\A9 %d.\0A\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %3
%7 = icmp ule i32 %6, 10
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = add i32 %12, %13
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = add i32 %15, 1
store i32 %16, i32* %3
br label %5
17: ; preds = %5
%18 = load i32, i32* %4
%19 = udiv i32 %18, 10
%20 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0ADigite o %d\C2\BA n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [42 x i8] c"\0AA m\C3\A9dia dos n\C3\BAmeros digitados \C3\A9 %d.\0A\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 2)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = add i32 %8, %5
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 3)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = add i32 %12, %9
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 4)
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%16 = load i32, i32* %1
%17 = add i32 %16, %13
%18 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 5)
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%20 = load i32, i32* %1
%21 = add i32 %20, %17
%22 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 6)
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%24 = load i32, i32* %1
%25 = add i32 %24, %21
%26 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 7)
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%28 = load i32, i32* %1
%29 = add i32 %28, %25
%30 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 8)
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%32 = load i32, i32* %1
%33 = add i32 %32, %29
%34 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 9)
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%36 = load i32, i32* %1
%37 = add i32 %36, %33
%38 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 10)
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%40 = load i32, i32* %1
%41 = add i32 %40, %37
%42 = udiv i32 %41, 10
%43 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}