#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 v, n, a, i;
  scanf("%d%d%d", &v, &n, &a);
  for (i = 0; a != v; ++i)
    scanf("%d", &a);
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     117c <main+0x5c>
lea    0xea1(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1150 <main+0x30>
mov    -0x14(%rbp),%esi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
xor    %ebx,%ebx
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x4(%rsp),%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    0x8(%rsp),%eax
je     117a <main+0x5a>
lea    0xeab(%rip),%r14
lea    0x4(%rsp),%r15
xor    %ebx,%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x1,%ebx
mov    0x4(%rsp),%eax
cmp    0x8(%rsp),%eax
jne    1160 <main+0x40>
lea    0xe86(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %3
%9 = load i32, i32* %1
%10 = icmp eq i32 %8, %9
br i1 %10, label %18, label %11
11: ; preds = %0, %11
%12 = phi i32 [ %14, %11 ], [ 0, %0 ]
%13 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%14 = add nuw nsw i32 %12, 1
%15 = load i32, i32* %3
%16 = load i32, i32* %1
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %11
18: ; preds = %11, %0
%19 = phi i32 [ 0, %0 ], [ %14, %11 ]
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %19)
ret i32 0
}