#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() {
  int a, b[120], c, d;
  int i, j;
  scanf("%d", &a);
  for (i = 0; i < a; i++) {
    scanf("%d", &c);
    b[i] = c;
  }
  c = 1;
  d = b[0];
  for (i = 0; i < a; i++) {
    if (b[i] < d) {
      c = i + 1;
      d = b[i];
    }
  }
  printf("%d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x1fc(%rbp)
mov    -0x1fc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1196 <main+0x76>
lea    0xe9e(%rip),%rdi
lea    -0x1f4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x1f4(%rbp),%ecx
movslq -0x1fc(%rbp),%rax
mov    %ecx,-0x1f0(%rbp,%rax,4)
mov    -0x1fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1fc(%rbp)
jmp    114c <main+0x2c>
movl   $0x1,-0x1f4(%rbp)
mov    -0x1f0(%rbp),%eax
mov    %eax,-0x1f8(%rbp)
movl   $0x0,-0x1fc(%rbp)
mov    -0x1fc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121b <main+0xfb>
movslq -0x1fc(%rbp),%rax
mov    -0x1f0(%rbp,%rax,4),%eax
cmp    -0x1f8(%rbp),%eax
jge    1202 <main+0xe2>
mov    -0x1fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f4(%rbp)
movslq -0x1fc(%rbp),%rax
mov    -0x1f0(%rbp,%rax,4),%eax
mov    %eax,-0x1f8(%rbp)
jmp    1207 <main+0xe7>
mov    -0x1fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1fc(%rbp)
jmp    11b6 <main+0x96>
mov    -0x1f4(%rbp),%esi
lea    0xddb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1f0,%rsp
lea    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11cb <main+0xab>
xor    %ebx,%ebx
lea    0xeaf(%rip),%r14
lea    0x8(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
mov    %eax,0x10(%rsp,%rbx,4)
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     1160 <main+0x40>
mov    %eax,%eax
mov    0x10(%rsp),%edx
movl   $0x1,0x8(%rsp)
mov    $0x1,%esi
test   %eax,%eax
jle    11d8 <main+0xb8>
mov    $0x1,%ecx
mov    %edx,%edi
cmp    %edi,%edx
jge    11b8 <main+0x98>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ecx,0x8(%rsp)
mov    %ecx,%esi
mov    %edx,%edi
cmp    %rcx,%rax
je     11d8 <main+0xb8>
mov    0x10(%rsp,%rcx,4),%edx
add    $0x1,%rcx
cmp    %edi,%edx
jl     11b0 <main+0x90>
jmp    11b8 <main+0x98>
movl   $0x1,0x8(%rsp)
mov    $0x1,%esi
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1f0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [120 x i32]
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast [120 x i32]* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %0
store i32 1, i32* %3
br label %42
11: ; preds = %0, %11
%12 = phi i64 [ %16, %11 ], [ 0, %0 ]
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %3
%15 = getelementptr inbounds [120 x i32], [120 x i32]* %2, i64 0, i64 %12
store i32 %14, i32* %15
%16 = add nuw nsw i64 %12, 1
%17 = load i32, i32* %1
%18 = sext i32 %17 to i64
%19 = icmp slt i64 %16, %18
br i1 %19, label %11, label %20
20: ; preds = %11
%21 = getelementptr inbounds [120 x i32], [120 x i32]* %2, i64 0, i64 0
%22 = load i32, i32* %21
store i32 1, i32* %3
%23 = icmp sgt i32 %17, 0
br i1 %23, label %24, label %42
24: ; preds = %20
%25 = zext i32 %17 to i64
br label %26
26: ; preds = %39, %24
%27 = phi i32 [ 1, %24 ], [ %36, %39 ]
%28 = phi i32 [ %22, %24 ], [ %41, %39 ]
%29 = phi i64 [ 0, %24 ], [ %32, %39 ]
%30 = phi i32 [ %22, %24 ], [ %37, %39 ]
%31 = icmp slt i32 %28, %30
%32 = add nuw nsw i64 %29, 1
br i1 %31, label %33, label %35
33: ; preds = %26
%34 = trunc i64 %32 to i32
store i32 %34, i32* %3
br label %35
35: ; preds = %26, %33
%36 = phi i32 [ %34, %33 ], [ %27, %26 ]
%37 = phi i32 [ %28, %33 ], [ %30, %26 ]
%38 = icmp eq i64 %32, %25
br i1 %38, label %42, label %39
39: ; preds = %35
%40 = getelementptr inbounds [120 x i32], [120 x i32]* %2, i64 0, i64 %32
%41 = load i32, i32* %40
br label %26
42: ; preds = %35, %10, %20
%43 = phi i32 [ 1, %20 ], [ 1, %10 ], [ %36, %35 ]
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %43)
ret i32 0
}