#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() {
  int v[100], m = 0, p = 0, i;
  for (i = 0; i < 100; i++) {
    scanf("%d", &v[i]);
    if (v[i] > m) {
      m = v[i];
      p = i;
    }
  }
  printf("%d\n%d\n", m, p + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1a4(%rbp)
movl   $0x0,-0x1a8(%rbp)
movl   $0x0,-0x1ac(%rbp)
cmpl   $0x64,-0x1ac(%rbp)
jge    11d1 <main+0xb1>
movslq -0x1ac(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe87(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
cmp    -0x1a4(%rbp),%eax
jle    11b8 <main+0x98>
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
mov    %eax,-0x1a4(%rbp)
mov    -0x1ac(%rbp),%eax
mov    %eax,-0x1a8(%rbp)
jmp    11bd <main+0x9d>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    1150 <main+0x30>
mov    -0x1a4(%rbp),%esi
mov    -0x1a8(%rbp),%edx
add    $0x1,%edx
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x190,%rsp
xor    %ebp,%ebp
mov    %rsp,%rbx
lea    0xec5(%rip),%r15
xor    %r14d,%r14d
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    (%rbx),%eax
cmp    %r12d,%eax
cmovg  %eax,%r12d
cmovg  %ebp,%r14d
add    $0x1,%rbp
add    $0x4,%rbx
cmp    $0x64,%rbp
jne    1150 <main+0x30>
add    $0x1,%r14d
lea    0xe82(%rip),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x190,%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 [100 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %27, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 100
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %11
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %12)
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [100 x i32], [100 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 %26
20: ; preds = %9
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %22
%24 = load i32, i32* %23
store i32 %24, i32* %3
%25 = load i32, i32* %5
store i32 %25, i32* %4
br label %26
26: ; preds = %20, %9
br label %27
27: ; preds = %26
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %6
30: ; preds = %6
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
%34 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %31, i32 %33)
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 [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %14, %3 ]
%5 = phi i32 [ 0, %0 ], [ %13, %3 ]
%6 = phi i32 [ 0, %0 ], [ %11, %3 ]
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %4
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = load i32, i32* %7
%10 = icmp sgt i32 %9, %6
%11 = select i1 %10, i32 %9, i32 %6
%12 = trunc i64 %4 to i32
%13 = select i1 %10, i32 %12, i32 %5
%14 = add nuw nsw i64 %4, 1
%15 = icmp eq i64 %14, 100
br i1 %15, label %16, label %3
16: ; preds = %3
%17 = add nsw i32 %13, 1
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %17)
ret i32 0
}