#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);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int i, n, maiorNumero, indiceDoMaiorNumero;
  for (i = 1; i < 101; i++) {
    scanf("%d", &n);
    if (i == 1) {
      maiorNumero = n;
      indiceDoMaiorNumero = i;
    } else if (n > maiorNumero) {
      maiorNumero = n;
      indiceDoMaiorNumero = i;
    }
  }
  printf("%d\n%d\n", maiorNumero, indiceDoMaiorNumero);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x65,-0x8(%rbp)
jge    119b <main+0x7b>
lea    0xeb9(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    116b <main+0x4b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1188 <main+0x68>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1183 <main+0x63>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1188 <main+0x68>
jmp    118d <main+0x6d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%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),%r14
lea    0xc(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    $0x2,%ebp
mov    $0x1,%r12d
mov    0xc(%rsp),%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %ebx,%eax
cmovg  %eax,%ebx
cmovg  %ebp,%r12d
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    1160 <main+0x40>
lea    0xe7c(%rip),%rdi
mov    %ebx,%esi
mov    %r12d,%edx
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 = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d\0A%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
store i32 1, i32* %2
br label %6
6: ; preds = %25, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 101
br i1 %8, label %9, label %28
9: ; preds = %6
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %3
store i32 %14, i32* %4
%15 = load i32, i32* %2
store i32 %15, i32* %5
br label %24
16: ; preds = %9
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* %3
store i32 %21, i32* %4
%22 = load i32, i32* %2
store i32 %22, i32* %5
br label %23
23: ; preds = %20, %16
br label %24
24: ; preds = %23, %13
br label %25
25: ; preds = %24
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %6
28: ; preds = %6
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %29, i32 %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d\0A%d\0A\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
br label %5
5: ; preds = %0, %5
%6 = phi i32 [ 1, %0 ], [ %13, %5 ]
%7 = phi i32 [ %4, %0 ], [ %12, %5 ]
%8 = phi i32 [ 2, %0 ], [ %14, %5 ]
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, %7
%12 = select i1 %11, i32 %10, i32 %7
%13 = select i1 %11, i32 %8, i32 %6
%14 = add nuw nsw i32 %8, 1
%15 = icmp eq i32 %14, 101
br i1 %15, label %16, label %5
16: ; preds = %5
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13)
ret i32 0
}