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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x65,-0x8(%rbp)
jge    116f <main+0x4f>
movslq -0x8(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea4(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    11b6 <main+0x96>
mov    -0x10(%rbp),%eax
movslq -0x8(%rbp),%rcx
cmp    -0x1a0(%rbp,%rcx,4),%eax
jne    11a3 <main+0x83>
mov    -0x8(%rbp),%esi
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
jmp    11a8 <main+0x88>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1176 <main+0x56>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x198,%rsp
xor    %ebx,%ebx
lea    0xecd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rsp,%rbx,1),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
add    $0x4,%rbx
cmp    $0x194,%rbx
jne    1140 <main+0x20>
xor    %ebx,%ebx
lea    0xe9e(%rip),%r14
jmp    117a <main+0x5a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
cmp    $0x64,%rbx
je     1192 <main+0x72>
mov    0x190(%rsp),%eax
cmp    (%rsp,%rbx,4),%eax
jne    1170 <main+0x50>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r14
ret

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

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