#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 /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ search(char *, char **, int);
scalar_t__ strcmp(char *, char *);
int main() {
  int N = 10;
  char *dictionary[] = {
      "skyline", "evolution", "supra",  "eclipse", "m3",
      "nsx",     "rx7",       "celica", "civic",   "rallye",
  };
  char key[200];
  while (1) {
    printf("Give car model or 'fin': ");
    scanf("%s", key);
    if (strcmp(key, "fin") == 0)
      break;
    search(key, dictionary, N);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x60(%rbp),%rdi
lea    0x2c5c(%rip),%rsi
mov    $0x50,%edx
call   1060 <memcpy@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x130(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x130(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11bf <main+0x6f>
jmp    11d7 <main+0x87>
lea    -0x130(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1040 <search@plt>
jmp    117e <main+0x2e>
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x120,%rsp
movaps 0x2cb9(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2c9d(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2c81(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2c65(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2c49(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    0x50(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1213 <main+0xd3>
lea    0x50(%rsp),%rbx
mov    %rsp,%r14
lea    0xe71(%rip),%r15
lea    0xe84(%rip),%r12
lea    0xe80(%rip),%r13
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1040 <search@plt>
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    11e0 <main+0xa0>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"skyline\00"
@.str.1 = [10 x i8] c"evolution\00"
@.str.2 = [6 x i8] c"supra\00"
@.str.3 = [8 x i8] c"eclipse\00"
@.str.4 = [3 x i8] c"m3\00"
@.str.5 = [4 x i8] c"nsx\00"
@.str.6 = [4 x i8] c"rx7\00"
@.str.7 = [7 x i8] c"celica\00"
@.str.8 = [6 x i8] c"civic\00"
@.str.9 = [7 x i8] c"rallye\00"
@__const.main.dictionary = [10 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i32 0, i32 0)]
@.str.10 = [26 x i8] c"Give car model or 'fin': \00"
@.str.11 = [3 x i8] c"%s\00"
@.str.12 = [4 x i8] c"fin\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i8*]
%4 = alloca [200 x i8]
store i32 0, i32* %1
store i32 10, i32* %2
%5 = bitcast [10 x i8*]* %3 to i8*
br label %6
6: ; preds = %0, %14
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0))
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %6
br label %19
14: ; preds = %6
%15 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%16 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
%17 = load i32, i32* %2
%18 = call i32 @search(i8* %15, i8** %16, i32 %17)
br label %6
19: ; preds = %13
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [8 x i8] c"skyline\00"
@.str.1 = [10 x i8] c"evolution\00"
@.str.2 = [6 x i8] c"supra\00"
@.str.3 = [8 x i8] c"eclipse\00"
@.str.4 = [3 x i8] c"m3\00"
@.str.5 = [4 x i8] c"nsx\00"
@.str.6 = [4 x i8] c"rx7\00"
@.str.7 = [7 x i8] c"celica\00"
@.str.8 = [6 x i8] c"civic\00"
@.str.9 = [7 x i8] c"rallye\00"
@__const.main.dictionary = [10 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i32 0, i32 0)]
@.str.10 = [26 x i8] c"Give car model or 'fin': \00"
@.str.11 = [3 x i8] c"%s\00"
@.str.12 = [4 x i8] c"fin\00"
define i32 @main() {
%1 = alloca [10 x i8*]
%2 = alloca [200 x i8]
%3 = bitcast [10 x i8*]* %1 to i8*
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %4)
%7 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %0
%10 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
br label %11
11: ; preds = %9, %11
%12 = call i32 @search(i8* %4, i8** %10, i32 10)
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %4)
%15 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %11
17: ; preds = %11, %0
ret i32 0
}