#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 getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  void input(int[], char name[][8]);
  void sort(int[], char name[][8]);
  void search(int, int[], char name[][8]);
  int num[10], number, flag = 1, c;
  char name[10][8];
  input(num, name);
  sort(num, name);
  while (flag == 1) {
    printf("\ninput number to look for:");
    scanf("%d", &number);
    search(number, num, name);
    printf("continue ot not(Y/N)?");
    getchar();
    c = getchar();
    if (c == 'N' || c == 'n')
      flag = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <input@plt>
lea    -0x30(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1050 <sort@plt>
cmpl   $0x1,-0x38(%rbp)
jne    120f <main+0xaf>
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
lea    0xe65(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1060 <search@plt>
lea    0xe45(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x4e,-0x3c(%rbp)
je     1203 <main+0xa3>
cmpl   $0x6e,-0x3c(%rbp)
jne    120a <main+0xaa>
movl   $0x0,-0x38(%rbp)
jmp    1199 <main+0x39>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
lea    0x10(%rsp),%r14
lea    0x40(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <input@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <sort@plt>
lea    0xe68(%rip),%r12
lea    0xe7c(%rip),%r13
lea    0xc(%rsp),%rbx
lea    0xe73(%rip),%rbp
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1080 <scanf@plt>
mov    0xc(%rsp),%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <search@plt>
mov    %rbp,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
and    $0xffffffdf,%eax
cmp    $0x4e,%eax
jne    11b0 <main+0x50>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\0Ainput number to look for:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"continue ot not(Y/N)?\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [10 x [8 x i8]]
store i32 0, i32* %1
store i32 1, i32* %4
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [10 x [8 x i8]], [10 x [8 x i8]]* %6, i64 0, i64 0
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = getelementptr inbounds [10 x [8 x i8]], [10 x [8 x i8]]* %6, i64 0, i64 0
br label %11
11: ; preds = %29, %0
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %30
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%17 = load i32, i32* %3
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%19 = getelementptr inbounds [10 x [8 x i8]], [10 x [8 x i8]]* %6, i64 0, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 (...) @getchar()
%22 = call i32 (...) @getchar()
store i32 %22, i32* %5
%23 = load i32, i32* %5
%24 = icmp eq i32 %23, 78
br i1 %24, label %28, label %25
25: ; preds = %14
%26 = load i32, i32* %5
%27 = icmp eq i32 %26, 110
br i1 %27, label %28, label %29
28: ; preds = %25, %14
store i32 0, i32* %4
br label %29
29: ; preds = %28, %25
br label %11
30: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0Ainput number to look for:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"continue ot not(Y/N)?\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = alloca [10 x [8 x i8]]
%4 = bitcast [10 x i32]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = getelementptr inbounds [10 x [8 x i8]], [10 x [8 x i8]]* %3, i64 0, i64 0, i64 0
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [10 x [8 x i8]], [10 x [8 x i8]]* %3, i64 0, i64 0
br label %9
9: ; preds = %0, %9
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (...) @getchar()
%15 = call i32 (...) @getchar()
%16 = and i32 %15, -33
%17 = icmp eq i32 %16, 78
br i1 %17, label %18, label %9
18: ; preds = %9
ret i32 0
}