#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 min_val = 1000000001, min_day = -1;
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int j;
    scanf("%d", &j);
    if (j < min_val) {
      min_val = j;
      min_day = i;
    }
  }
  printf("%d\n", min_day);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3b9aca01,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    119b <main+0x7b>
lea    0xe99(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1188 <main+0x68>
mov    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    118d <main+0x6d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <main+0x34>
mov    -0xc(%rbp),%esi
lea    0xe5e(%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),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    1183 <main+0x63>
mov    $0x3b9aca01,%ebp
mov    $0xffffffff,%r12d
xor    %ebx,%ebx
lea    0xea8(%rip),%r14
lea    0xc(%rsp),%r15
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %ebp,%eax
cmovl  %eax,%ebp
cmovl  %ebx,%r12d
add    $0x1,%ebx
cmp    0x8(%rsp),%ebx
jl     1160 <main+0x40>
jmp    1189 <main+0x69>
mov    $0xffffffff,%r12d
lea    0xe73(%rip),%rdi
mov    %r12d,%esi
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 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1000000001, i32* %2
store i32 -1, i32* %3
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 0, i32* %5
br label %8
8: ; preds = %21, %0
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%14 = load i32, i32* %6
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i32, i32* %6
store i32 %18, i32* %2
%19 = load i32, i32* %5
store i32 %19, i32* %3
br label %20
20: ; preds = %17, %12
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %8
24: ; preds = %8
%25 = load i32, i32* %3
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
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 i32
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = bitcast i32* %2 to i8*
br label %12
9: ; preds = %12, %0
%10 = phi i32 [ -1, %0 ], [ %20, %12 ]
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
12: ; preds = %7, %12
%13 = phi i32 [ 0, %7 ], [ %21, %12 ]
%14 = phi i32 [ -1, %7 ], [ %20, %12 ]
%15 = phi i32 [ 1000000001, %7 ], [ %19, %12 ]
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, %15
%19 = select i1 %18, i32 %17, i32 %15
%20 = select i1 %18, i32 %13, i32 %14
%21 = add nuw nsw i32 %13, 1
%22 = load i32, i32* %1
%23 = icmp slt i32 %21, %22
br i1 %23, label %12, label %9
}