#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(void) {
  int array_m[8] = {2, 20, 8, 10, 4, 6, 16, 18};
  int array_n[8] = {1, 3, 9, 7, 11, 15, 19};
  int i, number, count = 0;
  do {
    scanf("%d", &number);
    if (number > 0 && number <= 20)
      break;
  } while (1);
  for (i = 0; i <= 7; i++) {
    if (array_m[i] == number) {
      printf("%d is in M at index [%d]\n", number, i);
      count++;
      break;
    } else {
      if (array_n[i] == number) {
        printf("%d is in N at index [%d]\n", number, i);
        count++;
        break;
      }
    }
  }
  if (count == 0) {
    printf("%d is not in neither M nor N\n", number);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeb5(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x5c(%rbp)
lea    0xeab(%rip),%rdi
lea    -0x58(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x58(%rbp)
jle    11b7 <main+0x97>
cmpl   $0x14,-0x58(%rbp)
jg     11b7 <main+0x97>
jmp    11cb <main+0xab>
jmp    11bc <main+0x9c>
mov    $0x1,%al
test   $0x1,%al
jne    118e <main+0x6e>
jmp    11cb <main+0xab>
movl   $0x0,-0x54(%rbp)
cmpl   $0x7,-0x54(%rbp)
jg     125a <main+0x13a>
movslq -0x54(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
cmp    -0x58(%rbp),%eax
jne    120f <main+0xef>
mov    -0x58(%rbp),%esi
mov    -0x54(%rbp),%edx
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    125a <main+0x13a>
movslq -0x54(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
cmp    -0x58(%rbp),%eax
jne    1242 <main+0x122>
mov    -0x58(%rbp),%esi
mov    -0x54(%rbp),%edx
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    125a <main+0x13a>
jmp    1247 <main+0x127>
jmp    124c <main+0x12c>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11d2 <main+0xb2>
cmpl   $0x0,-0x5c(%rbp)
jne    1275 <main+0x155>
mov    -0x58(%rbp),%esi
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xf25(%rip),%r14
lea    0x4(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    -0x1(%rsi),%eax
cmp    $0x13,%eax
ja     1130 <main+0x10>
ja     1173 <main+0x53>
xor    %edx,%edx
lea    0xeae(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1,%edx
lea    0xf06(%rip),%rdi
jmp    11f8 <main+0xd8>
mov    $0x4,%edx
jmp    11f1 <main+0xd1>
lea    0xf0d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11ff <main+0xdf>
mov    $0x5,%edx
jmp    11f1 <main+0xd1>
mov    $0x3,%edx
lea    0xed7(%rip),%rdi
jmp    11f8 <main+0xd8>
mov    $0x2,%edx
jmp    11f1 <main+0xd1>
mov    $0x2,%edx
lea    0xec2(%rip),%rdi
jmp    11f8 <main+0xd8>
mov    $0x4,%edx
lea    0xeb4(%rip),%rdi
jmp    11f8 <main+0xd8>
mov    $0x5,%edx
lea    0xea6(%rip),%rdi
jmp    11f8 <main+0xd8>
mov    $0x6,%edx
jmp    11f1 <main+0xd1>
mov    $0x7,%edx
jmp    11f1 <main+0xd1>
mov    $0x6,%edx
lea    0xe8a(%rip),%rdi
jmp    11f8 <main+0xd8>
mov    $0x1,%edx
jmp    11f1 <main+0xd1>
mov    $0x3,%edx
lea    0xe5b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.array_m = [8 x i32] [i32 2, i32 20, i32 8, i32 10, i32 4, i32 6, i32 16, i32 18]
@__const.main.array_n = [8 x i32] [i32 1, i32 3, i32 9, i32 7, i32 11, i32 15, i32 19, i32 0]
@.str = [3 x i8] c"%d\00"
@.str.1 = [26 x i8] c"%d is in M at index [%d]\0A\00"
@.str.2 = [26 x i8] c"%d is in N at index [%d]\0A\00"
@.str.3 = [30 x i8] c"%d is not in neither M nor N\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca [8 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [8 x i32]* %2 to i8*
%8 = bitcast [8 x i32]* %3 to i8*
store i32 0, i32* %6
br label %9
9: ; preds = %18, %0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%11 = load i32, i32* %5
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i32, i32* %5
%15 = icmp sle i32 %14, 20
br i1 %15, label %16, label %17
16: ; preds = %13
br label %19
17: ; preds = %13, %9
br label %18
18: ; preds = %17
br i1 true, label %9, label %19
19: ; preds = %18, %16
store i32 0, i32* %4
br label %20
20: ; preds = %51, %19
%21 = load i32, i32* %4
%22 = icmp sle i32 %21, 7
br i1 %22, label %23, label %54
23: ; preds = %20
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = load i32, i32* %5
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %36
30: ; preds = %23
%31 = load i32, i32* %5
%32 = load i32, i32* %4
%33 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %31, i32 %32)
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %54
36: ; preds = %23
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = load i32, i32* %5
%42 = icmp eq i32 %40, %41
br i1 %42, label %43, label %49
43: ; preds = %36
%44 = load i32, i32* %5
%45 = load i32, i32* %4
%46 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %44, i32 %45)
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
br label %54
49: ; preds = %36
br label %50
50: ; preds = %49
br label %51
51: ; preds = %50
%52 = load i32, i32* %4
%53 = add nsw i32 %52, 1
store i32 %53, i32* %4
br label %20
54: ; preds = %43, %30, %20
%55 = load i32, i32* %6
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %60
57: ; preds = %54
%58 = load i32, i32* %5
%59 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %57, %54
%61 = load i32, i32* %1
ret i32 %61
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [26 x i8] c"%d is in M at index [%d]\0A\00"
@.str.2 = [26 x i8] c"%d is in N at index [%d]\0A\00"
@.str.3 = [30 x i8] c"%d is not in neither M nor N\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%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 = add i32 %5, -1
%7 = icmp ult i32 %6, 20
br i1 %7, label %8, label %3
8: ; preds = %3
switch i32 %5, label %28 [
i32 2, label %16
i32 1, label %25
i32 20, label %9
i32 3, label %19
i32 8, label %10
i32 9, label %20
i32 10, label %11
i32 7, label %21
i32 4, label %12
i32 11, label %22
i32 6, label %13
i32 15, label %23
i32 16, label %14
i32 19, label %24
i32 18, label %15
]
9: ; preds = %8
br label %16
10: ; preds = %8
br label %16
11: ; preds = %8
br label %16
12: ; preds = %8
br label %16
13: ; preds = %8
br label %16
14: ; preds = %8
br label %16
15: ; preds = %8
br label %16
16: ; preds = %8, %15, %14, %13, %12, %11, %10, %9
%17 = phi i32 [ 0, %8 ], [ 1, %9 ], [ 2, %10 ], [ 3, %11 ], [ 4, %12 ], [ 5, %13 ], [ 6, %14 ], [ 7, %15 ]
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %17)
br label %30
19: ; preds = %8
br label %25
20: ; preds = %8
br label %25
21: ; preds = %8
br label %25
22: ; preds = %8
br label %25
23: ; preds = %8
br label %25
24: ; preds = %8
br label %25
25: ; preds = %8, %24, %23, %22, %21, %20, %19
%26 = phi i32 [ 0, %8 ], [ 1, %19 ], [ 2, %20 ], [ 3, %21 ], [ 4, %22 ], [ 5, %23 ], [ 6, %24 ]
%27 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %26)
br label %30
28: ; preds = %8
%29 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %5)
br label %30
30: ; preds = %16, %25, %28
ret i32 0
}