#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 *, int *);
int dez() {
  short cont;
  int vect[10], maior = 0;
  printf("Digite 10 números");
  for (cont = 0; cont < 10; cont++) {
    scanf("%d", &vect[cont]);
    if (vect[cont] > maior)
      maior = vect[cont];
  }
  return maior;
}


x86 assembly (clang, -O0):
<dez>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x34(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    119e <dez+0x7e>
movswq -0x2(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeae(%rip),%rdi
call   1040 <scanf@plt>
movswq -0x2(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
cmp    -0x34(%rbp),%eax
jle    1188 <dez+0x68>
movswq -0x2(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x34(%rbp)
jmp    118d <dez+0x6d>
mov    -0x2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x2(%rbp)
jmp    1141 <dez+0x21>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dez>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%r14
mov    %rsp,%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    (%rsp),%eax
xor    %ebx,%ebx
test   %eax,%eax
cmovns %eax,%ebx
lea    0x4(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    %ebx,%eax
cmovg  %eax,%ebx
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
cmp    %ebx,%eax
cmovg  %eax,%ebx
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %ebx,%eax
cmovg  %eax,%ebx
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
cmp    %ebx,%eax
cmovg  %eax,%ebx
lea    0x14(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    %ebx,%eax
cmovg  %eax,%ebx
lea    0x18(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0x18(%rsp),%eax
cmp    %ebx,%eax
cmovg  %eax,%ebx
lea    0x1c(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0x1c(%rsp),%eax
cmp    %ebx,%eax
cmovg  %eax,%ebx
lea    0x20(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0x20(%rsp),%eax
cmp    %ebx,%eax
cmovg  %eax,%ebx
lea    0x24(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0x24(%rsp),%eax
cmp    %ebx,%eax
cmovg  %eax,%ebx
mov    %ebx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Digite 10 n\C3\BAmeros\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @dez() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
%8 = select i1 %7, i32 %6, i32 0
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = load i32, i32* %9
%12 = icmp sgt i32 %11, %8
%13 = select i1 %12, i32 %11, i32 %8
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = load i32, i32* %14
%17 = icmp sgt i32 %16, %13
%18 = select i1 %17, i32 %16, i32 %13
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %19)
%21 = load i32, i32* %19
%22 = icmp sgt i32 %21, %18
%23 = select i1 %22, i32 %21, i32 %18
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %24)
%26 = load i32, i32* %24
%27 = icmp sgt i32 %26, %23
%28 = select i1 %27, i32 %26, i32 %23
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %29)
%31 = load i32, i32* %29
%32 = icmp sgt i32 %31, %28
%33 = select i1 %32, i32 %31, i32 %28
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %34)
%36 = load i32, i32* %34
%37 = icmp sgt i32 %36, %33
%38 = select i1 %37, i32 %36, i32 %33
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %39)
%41 = load i32, i32* %39
%42 = icmp sgt i32 %41, %38
%43 = select i1 %42, i32 %41, i32 %38
%44 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %44)
%46 = load i32, i32* %44
%47 = icmp sgt i32 %46, %43
%48 = select i1 %47, i32 %46, i32 %43
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%50 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %49)
%51 = load i32, i32* %49
%52 = icmp sgt i32 %51, %48
%53 = select i1 %52, i32 %51, i32 %48
ret i32 %53
}