#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*/ entry();
int /*<<< orphan*/ list();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ search(int);
int main() {
  list();
  char ch;
  int n;
  while (ch != '#') {
    scanf("%c", &ch);
    if (ch == '1') {
      entry();
    } else if (ch == '2')
      puts("the students number:");
    scanf("%d", &n);
    search(n);
    continue;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <list@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x23,%eax
je     11db <main+0x8b>
lea    0xe86(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x31,%eax
jne    119e <main+0x4e>
mov    $0x0,%al
call   1050 <entry@plt>
jmp    11bc <main+0x6c>
movsbl -0x5(%rbp),%eax
cmp    $0x32,%eax
jne    11b7 <main+0x67>
lea    0xe51(%rip),%rdi
call   1030 <puts@plt>
jmp    11bc <main+0x6c>
lea    0xe55(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1040 <search@plt>
jmp    1166 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1060 <list@plt>
lea    0xe95(%rip),%r14
lea    0xb(%rsp),%r12
lea    0xe8c(%rip),%r15
lea    0xe9a(%rip),%r13
lea    0xc(%rsp),%rbx
jmp    11b5 <main+0x65>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <search@plt>
cmpb   $0x23,0xb(%rsp)
je     11d8 <main+0x88>
mov    %r14,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
movzbl 0xb(%rsp),%eax
cmp    $0x32,%al
je     1190 <main+0x40>
cmp    $0x31,%al
jne    1198 <main+0x48>
xor    %eax,%eax
call   1050 <entry@plt>
jmp    1198 <main+0x48>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [21 x i8] c"the students number:\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @list()
br label %5
5: ; preds = %23, %0
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 35
br i1 %8, label %9, label %27
9: ; preds = %5
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 49
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 (...) @entry()
br label %23
16: ; preds = %9
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 50
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %16
br label %23
23: ; preds = %22, %14
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%25 = load i32, i32* %3
%26 = call i32 @search(i32 %25)
br label %5
27: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [21 x i8] c"the students number:\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = tail call i32 (...) @list()
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %0, %12
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = load i8, i8* %1
switch i8 %7, label %12 [
i8 49, label %8
i8 50, label %10
]
8: ; preds = %5
%9 = call i32 (...) @entry()
br label %12
10: ; preds = %5
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %5, %10, %8
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %2
%15 = call i32 @search(i32 %14)
%16 = load i8, i8* %1
%17 = icmp eq i8 %16, 35
br i1 %17, label %18, label %5
18: ; preds = %12
ret i32 0
}