#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 /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int array[10] = {};
  int i, flag = 0;
  for (i = 0; i < 10; i++) {
    scanf("%d", &array[i]);
  }
  for (i = 1; i < 10; i++) {
    if (array[flag] < array[i])
      flag = i;
  }
  printf("%d", flag);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    1190 <main+0x60>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe83(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    115d <main+0x2d>
movl   $0x1,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11d0 <main+0xa0>
movslq -0x38(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
movslq -0x34(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jge    11bd <main+0x8d>
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    11c2 <main+0x92>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1197 <main+0x67>
mov    -0x38(%rbp),%esi
lea    0xe26(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
lea    0x20(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xeb1(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    (%rsp),%eax
xor    %ecx,%ecx
cmp    0x4(%rsp),%eax
setl   %cl
mov    (%rsp,%rcx,4),%eax
cmp    0x8(%rsp),%eax
mov    $0x2,%eax
cmovge %ecx,%eax
mov    (%rsp,%rax,4),%ecx
cmp    0xc(%rsp),%ecx
mov    $0x3,%ecx
cmovge %eax,%ecx
mov    (%rsp,%rcx,4),%eax
cmp    0x10(%rsp),%eax
mov    $0x4,%eax
cmovge %ecx,%eax
mov    (%rsp,%rax,4),%ecx
cmp    0x14(%rsp),%ecx
mov    $0x5,%ecx
cmovge %eax,%ecx
mov    (%rsp,%rcx,4),%eax
cmp    0x18(%rsp),%eax
mov    $0x6,%eax
cmovge %ecx,%eax
mov    (%rsp,%rax,4),%ecx
cmp    0x1c(%rsp),%ecx
mov    $0x7,%ecx
cmovge %eax,%ecx
mov    (%rsp,%rcx,4),%eax
cmp    0x20(%rsp),%eax
mov    $0x8,%eax
cmovge %ecx,%eax
mov    (%rsp,%rax,4),%ecx
cmp    0x24(%rsp),%ecx
mov    $0x9,%esi
cmovge %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %2 to i8*
store i32 0, i32* %4
store i32 0, i32* %3
br label %6
6: ; preds = %14, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sext i32 %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, i64 0, i64 0), i32* %12)
br label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %6
17: ; preds = %6
store i32 1, i32* %3
br label %18
18: ; preds = %34, %17
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 10
br i1 %20, label %21, label %37
21: ; preds = %18
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = icmp slt i32 %25, %29
br i1 %30, label %31, label %33
31: ; preds = %21
%32 = load i32, i32* %3
store i32 %32, i32* %4
br label %33
33: ; preds = %31, %21
br label %34
34: ; preds = %33
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %18
37: ; preds = %18
%38 = load i32, i32* %4
%39 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %21)
%23 = load i32, i32* %3
%24 = load i32, i32* %5
%25 = icmp slt i32 %23, %24
%26 = zext i1 %25 to i32
%27 = zext i1 %25 to i64
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = load i32, i32* %7
%31 = icmp slt i32 %29, %30
%32 = select i1 %31, i32 2, i32 %26
%33 = zext i32 %32 to i64
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = load i32, i32* %9
%37 = icmp slt i32 %35, %36
%38 = select i1 %37, i32 3, i32 %32
%39 = zext i32 %38 to i64
%40 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = load i32, i32* %11
%43 = icmp slt i32 %41, %42
%44 = select i1 %43, i32 4, i32 %38
%45 = zext i32 %44 to i64
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = load i32, i32* %13
%49 = icmp slt i32 %47, %48
%50 = select i1 %49, i32 5, i32 %44
%51 = zext i32 %50 to i64
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = load i32, i32* %15
%55 = icmp slt i32 %53, %54
%56 = select i1 %55, i32 6, i32 %50
%57 = zext i32 %56 to i64
%58 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %57
%59 = load i32, i32* %58
%60 = load i32, i32* %17
%61 = icmp slt i32 %59, %60
%62 = select i1 %61, i32 7, i32 %56
%63 = zext i32 %62 to i64
%64 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %63
%65 = load i32, i32* %64
%66 = load i32, i32* %19
%67 = icmp slt i32 %65, %66
%68 = select i1 %67, i32 8, i32 %62
%69 = zext i32 %68 to i64
%70 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %69
%71 = load i32, i32* %70
%72 = load i32, i32* %21
%73 = icmp slt i32 %71, %72
%74 = select i1 %73, i32 9, i32 %68
%75 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %74)
ret i32 0
}