#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*/ strcmp(char *, char *);
int match_arg(char *string) {
  static char *param_table[] = {"-ep", "-ns", "-mb", "-mn", "-cs", "-mf", "-mi",
                                "-to", "-bs", "-sp", "-lp", "-bi", "-vb", "-db",
                                "-sc", "-ld", "-ud", "-ta", " "};
  int k;
  k = 0;
  do
    if (!strcmp(string, param_table[k]))
      return (k);
  while (*param_table[++k] != ' ');
  return (-1);
}


x86 assembly (clang, -O0):
<match_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rcx
lea    0x2efe(%rip),%rax
mov    (%rax,%rcx,8),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    114f <match_arg+0x3f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117e <match_arg+0x6e>
jmp    1154 <match_arg+0x44>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2ec9(%rip),%rax
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1123 <match_arg+0x13>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_arg>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12b0 <match_arg+0x1a0>
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12b4 <match_arg+0x1a4>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12bb <match_arg+0x1ab>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12c2 <match_arg+0x1b2>
lea    0xe9c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12c9 <match_arg+0x1b9>
lea    0xe89(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12d0 <match_arg+0x1c0>
lea    0xe76(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12d7 <match_arg+0x1c7>
lea    0xe63(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12de <match_arg+0x1ce>
lea    0xe50(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12e5 <match_arg+0x1d5>
lea    0xe3d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12ec <match_arg+0x1dc>
lea    0xe2a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12f3 <match_arg+0x1e3>
lea    0xe17(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12fa <match_arg+0x1ea>
lea    0xe04(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1301 <match_arg+0x1f1>
lea    0xdf1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1308 <match_arg+0x1f8>
lea    0xdde(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     130f <match_arg+0x1ff>
lea    0xdcb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1316 <match_arg+0x206>
lea    0xdb8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     131d <match_arg+0x20d>
lea    0xda5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
neg    %eax
sbb    %eax,%eax
or     $0x11,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret
mov    $0x2,%eax
pop    %rbx
ret
mov    $0x3,%eax
pop    %rbx
ret
mov    $0x4,%eax
pop    %rbx
ret
mov    $0x5,%eax
pop    %rbx
ret
mov    $0x6,%eax
pop    %rbx
ret
mov    $0x7,%eax
pop    %rbx
ret
mov    $0x8,%eax
pop    %rbx
ret
mov    $0x9,%eax
pop    %rbx
ret
mov    $0xa,%eax
pop    %rbx
ret
mov    $0xb,%eax
pop    %rbx
ret
mov    $0xc,%eax
pop    %rbx
ret
mov    $0xd,%eax
pop    %rbx
ret
mov    $0xe,%eax
pop    %rbx
ret
mov    $0xf,%eax
pop    %rbx
ret
mov    $0x10,%eax
pop    %rbx
ret

LLVM IR (-O0):
@match_arg.param_table = internal global [19 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 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 ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i32 0, i32 0)]
@.str = [4 x i8] c"-ep\00"
@.str.1 = [4 x i8] c"-ns\00"
@.str.2 = [4 x i8] c"-mb\00"
@.str.3 = [4 x i8] c"-mn\00"
@.str.4 = [4 x i8] c"-cs\00"
@.str.5 = [4 x i8] c"-mf\00"
@.str.6 = [4 x i8] c"-mi\00"
@.str.7 = [4 x i8] c"-to\00"
@.str.8 = [4 x i8] c"-bs\00"
@.str.9 = [4 x i8] c"-sp\00"
@.str.10 = [4 x i8] c"-lp\00"
@.str.11 = [4 x i8] c"-bi\00"
@.str.12 = [4 x i8] c"-vb\00"
@.str.13 = [4 x i8] c"-db\00"
@.str.14 = [4 x i8] c"-sc\00"
@.str.15 = [4 x i8] c"-ld\00"
@.str.16 = [4 x i8] c"-ud\00"
@.str.17 = [4 x i8] c"-ta\00"
@.str.18 = [2 x i8] c" \00"
define i32 @match_arg(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [19 x i8*], [19 x i8*]* @match_arg.param_table, i64 0, i64 %8
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %6, i8* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %5
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %26
15: ; preds = %5
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [19 x i8*], [19 x i8*]* @match_arg.param_table, i64 0, i64 %19
%21 = load i8*, i8** %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 32
br i1 %24, label %5, label %25
25: ; preds = %16
store i32 -1, i32* %2
br label %26
26: ; preds = %25, %13
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@.str = [4 x i8] c"-ep\00"
@.str.1 = [4 x i8] c"-ns\00"
@.str.2 = [4 x i8] c"-mb\00"
@.str.3 = [4 x i8] c"-mn\00"
@.str.4 = [4 x i8] c"-cs\00"
@.str.5 = [4 x i8] c"-mf\00"
@.str.6 = [4 x i8] c"-mi\00"
@.str.7 = [4 x i8] c"-to\00"
@.str.8 = [4 x i8] c"-bs\00"
@.str.9 = [4 x i8] c"-sp\00"
@.str.10 = [4 x i8] c"-lp\00"
@.str.11 = [4 x i8] c"-bi\00"
@.str.12 = [4 x i8] c"-vb\00"
@.str.13 = [4 x i8] c"-db\00"
@.str.14 = [4 x i8] c"-sc\00"
@.str.15 = [4 x i8] c"-ld\00"
@.str.16 = [4 x i8] c"-ud\00"
@.str.17 = [4 x i8] c"-ta\00"
define i32 @match_arg(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %56, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %56, label %7
7: ; preds = %4
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %56, label %10
10: ; preds = %7
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %56, label %13
13: ; preds = %10
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %56, label %16
16: ; preds = %13
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %56, label %19
19: ; preds = %16
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %56, label %22
22: ; preds = %19
%23 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
br i1 %24, label %56, label %25
25: ; preds = %22
%26 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%27 = icmp eq i32 %26, 0
br i1 %27, label %56, label %28
28: ; preds = %25
%29 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
br i1 %30, label %56, label %31
31: ; preds = %28
%32 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%33 = icmp eq i32 %32, 0
br i1 %33, label %56, label %34
34: ; preds = %31
%35 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%36 = icmp eq i32 %35, 0
br i1 %36, label %56, label %37
37: ; preds = %34
%38 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%39 = icmp eq i32 %38, 0
br i1 %39, label %56, label %40
40: ; preds = %37
%41 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%42 = icmp eq i32 %41, 0
br i1 %42, label %56, label %43
43: ; preds = %40
%44 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%45 = icmp eq i32 %44, 0
br i1 %45, label %56, label %46
46: ; preds = %43
%47 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%48 = icmp eq i32 %47, 0
br i1 %48, label %56, label %49
49: ; preds = %46
%50 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%51 = icmp eq i32 %50, 0
br i1 %51, label %56, label %52
52: ; preds = %49
%53 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%54 = icmp eq i32 %53, 0
%55 = select i1 %54, i32 17, i32 -1
br label %56
56: ; preds = %52, %49, %46, %43, %40, %37, %34, %31, %28, %25, %22, %19, %16, %13, %10, %7, %4, %1
%57 = phi i32 [ 0, %1 ], [ 1, %4 ], [ 2, %7 ], [ 3, %10 ], [ 4, %13 ], [ 5, %16 ], [ 6, %19 ], [ 7, %22 ], [ 8, %25 ], [ 9, %28 ], [ 10, %31 ], [ 11, %34 ], [ 12, %37 ], [ 13, %40 ], [ 14, %43 ], [ 15, %46 ], [ 16, %49 ], [ %55, %52 ]
ret i32 %57
}