#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 main() {
  int num, n, maior, i;
  printf("entre com o tamanho da sequencia: ");
  scanf("%d", &num);
  printf("entre com o 1º inteiro: ");
  scanf("%d", &n);
  maior = n;
  if (num > 1) {
    for (i = 1; i < num; i++) {
      printf("entre com o %dº inteiro: ", i + 1);
      scanf("%d", &n);
      if (n > maior) {
        maior = n;
      }
    }
  }
  printf("o maior dos numeros digitados é %d\n", maior);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11dc <main+0xbc>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d7 <main+0xb7>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7a(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11c4 <main+0xa4>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11c9 <main+0xa9>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1182 <main+0x62>
jmp    11dc <main+0xbc>
mov    -0x10(%rbp),%esi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%ebx
cmpl   $0x2,0xc(%rsp)
jl     11b9 <main+0x99>
mov    $0x1,%ebp
lea    0xec0(%rip),%r14
lea    0xe9c(%rip),%r15
lea    0x8(%rsp),%r12
nopl   0x0(%rax)
add    $0x1,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
cmp    %ebx,%eax
cmovg  %eax,%ebx
cmp    0xc(%rsp),%ebp
jl     1190 <main+0x70>
lea    0xe9b(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"entre com o tamanho da sequencia: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"entre com o 1\C2\BA inteiro: \00"
@.str.3 = [27 x i8] c"entre com o %d\C2\BA inteiro: \00"
@.str.4 = [37 x i8] c"o maior dos numeros digitados \C3\A9 %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %33
13: ; preds = %0
store i32 1, i32* %5
br label %14
14: ; preds = %29, %13
%15 = load i32, i32* %5
%16 = load i32, i32* %2
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %32
18: ; preds = %14
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = icmp sgt i32 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %18
%27 = load i32, i32* %3
store i32 %27, i32* %4
br label %28
28: ; preds = %26, %18
br label %29
29: ; preds = %28
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %14
32: ; preds = %14
br label %33
33: ; preds = %32, %0
%34 = load i32, i32* %4
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
@.str = [35 x i8] c"entre com o tamanho da sequencia: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"entre com o 1\C2\BA inteiro: \00"
@.str.3 = [27 x i8] c"entre com o %d\C2\BA inteiro: \00"
@.str.4 = [37 x i8] c"o maior dos numeros digitados \C3\A9 %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %23
12: ; preds = %0, %12
%13 = phi i32 [ %15, %12 ], [ 1, %0 ]
%14 = phi i32 [ %20, %12 ], [ %9, %0 ]
%15 = add nuw nsw i32 %13, 1
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, %14
%20 = select i1 %19, i32 %18, i32 %14
%21 = load i32, i32* %1
%22 = icmp slt i32 %15, %21
br i1 %22, label %12, label %23
23: ; preds = %12, %0
%24 = phi i32 [ %9, %0 ], [ %20, %12 ]
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i32 %24)
ret i32 0
}