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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb7(%rip),%rdi
lea    -0xfb4(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xfb8(%rbp)
mov    -0xfb8(%rbp),%eax
cmp    -0xfb4(%rbp),%eax
jge    11a6 <main+0x86>
movslq -0xfb8(%rbp),%rax
lea    -0xfb0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe73(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xfb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfb8(%rbp)
jmp    115f <main+0x3f>
movl   $0x0,-0xfb8(%rbp)
mov    -0xfb8(%rbp),%eax
cmp    -0xfb4(%rbp),%eax
jge    1204 <main+0xe4>
movslq -0xfb8(%rbp),%rax
mov    -0xfb0(%rbp,%rax,4),%eax
cmp    -0x8(%rbp),%eax
jne    11eb <main+0xcb>
mov    -0xfb8(%rbp),%esi
lea    0xe1d(%rip),%rdi
call   1030 <printf@plt>
jmp    11f0 <main+0xd0>
mov    -0xfb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfb8(%rbp)
jmp    11b0 <main+0x90>
xor    %eax,%eax
add    $0xfc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xfb0,%rsp
lea    0xecd(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11c6 <main+0xa6>
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
lea    0xe9e(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     1170 <main+0x50>
test   %eax,%eax
jle    11c6 <main+0xa6>
xor    %ebx,%ebx
lea    0xe69(%rip),%r14
jmp    11ac <main+0x8c>
nopl   0x0(%rax)
add    $0x1,%rbx
movslq %eax,%rcx
cmp    %rcx,%rbx
jge    11c6 <main+0xa6>
mov    0x10(%rsp,%rbx,4),%ecx
cmp    0xc(%rsp),%ecx
jne    11a0 <main+0x80>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x8(%rsp),%eax
jmp    11a0 <main+0x80>
xor    %eax,%eax
add    $0xfb0,%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 [1000 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)
%9 = 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 %10
10: ; preds = %19, %0
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %16
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
br label %19
19: ; preds = %14
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %10
22: ; preds = %10
store i32 0, i32* %5
br label %23
23: ; preds = %38, %22
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %41
27: ; preds = %23
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = load i32, i32* %2
%33 = icmp eq i32 %31, %32
br i1 %33, label %34, label %37
34: ; preds = %27
%35 = load i32, i32* %5
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %34, %27
br label %38
38: ; preds = %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %23
41: ; preds = %23
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 [1000 x i32]
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast [1000 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 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 0
br i1 %10, label %13, label %37
11: ; preds = %13
%12 = icmp sgt i32 %18, 0
br i1 %12, label %21, label %37
13: ; preds = %0, %13
%14 = phi i64 [ %17, %13 ], [ 0, %0 ]
%15 = getelementptr inbounds [1000 x i32], [1000 x i32]* %2, i64 0, i64 %14
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = add nuw nsw i64 %14, 1
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = icmp slt i64 %17, %19
br i1 %20, label %13, label %11
21: ; preds = %11, %32
%22 = phi i32 [ %33, %32 ], [ %18, %11 ]
%23 = phi i64 [ %34, %32 ], [ 0, %11 ]
%24 = getelementptr inbounds [1000 x i32], [1000 x i32]* %2, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = load i32, i32* %1
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %32
28: ; preds = %21
%29 = trunc i64 %23 to i32
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %3
br label %32
32: ; preds = %21, %28
%33 = phi i32 [ %22, %21 ], [ %31, %28 ]
%34 = add nuw nsw i64 %23, 1
%35 = sext i32 %33 to i64
%36 = icmp slt i64 %34, %35
br i1 %36, label %21, label %37
37: ; preds = %32, %0, %11
ret i32 0
}