#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 argc, const char *argv[]) {
  int i, j, a[6], n;
  for (i = 0; i < 6; i++)
    scanf("%d", &a[i]);
  for (i = 0; i < 8; i++) {
    scanf("%d", &n);
    for (j = 0; j < 6; j++) {
      if (n == a[j])
        printf("%d\n", n);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    1170 <main+0x50>
movslq -0x14(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea3(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    11e8 <main+0xc8>
lea    0xe78(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x6,-0x18(%rbp)
jge    11d5 <main+0xb5>
mov    -0x34(%rbp),%eax
movslq -0x18(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jne    11c2 <main+0xa2>
mov    -0x34(%rbp),%esi
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
jmp    11c7 <main+0xa7>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1198 <main+0x78>
jmp    11da <main+0xba>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1177 <main+0x57>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xecf(%rip),%r14
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    $0x8,%ebp
lea    0xc(%rsp),%r15
lea    0xe73(%rip),%rbx
jmp    11a9 <main+0x89>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0xffffffff,%ebp
je     124b <main+0x12b>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    0x10(%rsp),%esi
je     11e0 <main+0xc0>
cmp    0x14(%rsp),%esi
je     11f2 <main+0xd2>
cmp    0x18(%rsp),%esi
je     1204 <main+0xe4>
cmp    0x1c(%rsp),%esi
je     1216 <main+0xf6>
cmp    0x20(%rsp),%esi
je     1228 <main+0x108>
cmp    0x24(%rsp),%esi
jne    11a0 <main+0x80>
jmp    123e <main+0x11e>
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
cmp    0x14(%rsp),%esi
jne    11c4 <main+0xa4>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
cmp    0x18(%rsp),%esi
jne    11ca <main+0xaa>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
cmp    0x1c(%rsp),%esi
jne    11d0 <main+0xb0>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
cmp    0x20(%rsp),%esi
jne    11d6 <main+0xb6>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
cmp    0x24(%rsp),%esi
jne    11a0 <main+0x80>
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    11a0 <main+0x80>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
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(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [6 x i32]
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %10
10: ; preds = %18, %2
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 6
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %8, i64 0, i64 %15
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %16)
br label %18
18: ; preds = %13
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %10
21: ; preds = %10
store i32 0, i32* %6
br label %22
22: ; preds = %45, %21
%23 = load i32, i32* %6
%24 = icmp slt i32 %23, 8
br i1 %24, label %25, label %48
25: ; preds = %22
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
store i32 0, i32* %7
br label %27
27: ; preds = %41, %25
%28 = load i32, i32* %7
%29 = icmp slt i32 %28, 6
br i1 %29, label %30, label %44
30: ; preds = %27
%31 = load i32, i32* %9
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [6 x i32], [6 x i32]* %8, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = icmp eq i32 %31, %35
br i1 %36, label %37, label %40
37: ; preds = %30
%38 = load i32, i32* %9
%39 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %37, %30
br label %41
41: ; preds = %40
%42 = load i32, i32* %7
%43 = add nsw i32 %42, 1
store i32 %43, i32* %7
br label %27
44: ; preds = %27
br label %45
45: ; preds = %44
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
br label %22
48: ; preds = %22
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(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i32]
%4 = alloca i32
%5 = bitcast [6 x i32]* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 1
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 2
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 3
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%15 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 4
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 5
%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 = %2, %62
%20 = phi i32 [ %63, %62 ], [ 0, %2 ]
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%22 = load i32, i32* %4
%23 = load i32, i32* %7
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%27 = load i32, i32* %4
br label %28
28: ; preds = %19, %25
%29 = phi i32 [ %22, %19 ], [ %27, %25 ]
%30 = load i32, i32* %9
%31 = icmp eq i32 %29, %30
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%34 = load i32, i32* %4
br label %35
35: ; preds = %32, %28
%36 = phi i32 [ %34, %32 ], [ %29, %28 ]
%37 = load i32, i32* %11
%38 = icmp eq i32 %36, %37
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%41 = load i32, i32* %4
br label %42
42: ; preds = %39, %35
%43 = phi i32 [ %41, %39 ], [ %36, %35 ]
%44 = load i32, i32* %13
%45 = icmp eq i32 %43, %44
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %43)
%48 = load i32, i32* %4
br label %49
49: ; preds = %46, %42
%50 = phi i32 [ %48, %46 ], [ %43, %42 ]
%51 = load i32, i32* %15
%52 = icmp eq i32 %50, %51
br i1 %52, label %53, label %56
53: ; preds = %49
%54 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %50)
%55 = load i32, i32* %4
br label %56
56: ; preds = %53, %49
%57 = phi i32 [ %55, %53 ], [ %50, %49 ]
%58 = load i32, i32* %17
%59 = icmp eq i32 %57, %58
br i1 %59, label %60, label %62
60: ; preds = %56
%61 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %57)
br label %62
62: ; preds = %60, %56
%63 = add nuw nsw i32 %20, 1
%64 = icmp eq i32 %63, 8
br i1 %64, label %65, label %19
65: ; preds = %62
ret i32 0
}