#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 cp_init(char const *);
int cr_init(char const *);
int dcc_init(char const *);
int dk_init(char const *);
int dr_init(char const *);
int io_init(char const *);
int lp_init(char const *);
int mt_init(char const *);
int /*<<< orphan*/ printf(char *);
int spo_init(char const *);
scalar_t__ strncasecmp(char const *, char *, int);
int handle_option(const char *option) {
  if (strncasecmp(option, "spo", 3) == 0) {
    return spo_init(option);
  } else if (strncasecmp(option, "cr", 2) == 0) {
    return cr_init(option);
  } else if (strncasecmp(option, "cp", 2) == 0) {
    return cp_init(option);
  } else if (strncasecmp(option, "mt", 2) == 0) {
    return mt_init(option);
  } else if (strncasecmp(option, "dr", 2) == 0) {
    return dr_init(option);
  } else if (strncasecmp(option, "dk", 2) == 0) {
    return dk_init(option);
  } else if (strncasecmp(option, "lp", 2) == 0) {
    return lp_init(option);
  } else if (strncasecmp(option, "dcc", 3) == 0) {
    return dcc_init(option);
  } else if (strncasecmp(option, "io", 2) == 0) {
    return io_init(option);
  }
  printf("unknown component\n");
  return 1;
}


x86 assembly (clang, -O0):
<handle_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe39(%rip),%rsi
mov    $0x3,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
jne    11ec <handle_option+0x3c>
mov    -0x10(%rbp),%rdi
call   1040 <spo_init@plt>
mov    %eax,-0x4(%rbp)
jmp    13a7 <handle_option+0x1f7>
mov    -0x10(%rbp),%rdi
lea    0xe0d(%rip),%rsi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
jne    121c <handle_option+0x6c>
mov    -0x10(%rbp),%rdi
call   10d0 <cr_init@plt>
mov    %eax,-0x4(%rbp)
jmp    13a7 <handle_option+0x1f7>
mov    -0x10(%rbp),%rdi
lea    0xde0(%rip),%rsi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
jne    124c <handle_option+0x9c>
mov    -0x10(%rbp),%rdi
call   1090 <cp_init@plt>
mov    %eax,-0x4(%rbp)
jmp    13a7 <handle_option+0x1f7>
mov    -0x10(%rbp),%rdi
lea    0xdb3(%rip),%rsi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
jne    127c <handle_option+0xcc>
mov    -0x10(%rbp),%rdi
call   1030 <mt_init@plt>
mov    %eax,-0x4(%rbp)
jmp    13a7 <handle_option+0x1f7>
mov    -0x10(%rbp),%rdi
lea    0xd86(%rip),%rsi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
jne    12ac <handle_option+0xfc>
mov    -0x10(%rbp),%rdi
call   1080 <dr_init@plt>
mov    %eax,-0x4(%rbp)
jmp    13a7 <handle_option+0x1f7>
mov    -0x10(%rbp),%rdi
lea    0xd59(%rip),%rsi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
jne    12dc <handle_option+0x12c>
mov    -0x10(%rbp),%rdi
call   1050 <dk_init@plt>
mov    %eax,-0x4(%rbp)
jmp    13a7 <handle_option+0x1f7>
mov    -0x10(%rbp),%rdi
lea    0xd2c(%rip),%rsi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
jne    130c <handle_option+0x15c>
mov    -0x10(%rbp),%rdi
call   10a0 <lp_init@plt>
mov    %eax,-0x4(%rbp)
jmp    13a7 <handle_option+0x1f7>
mov    -0x10(%rbp),%rdi
lea    0xcff(%rip),%rsi
mov    $0x3,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
jne    133c <handle_option+0x18c>
mov    -0x10(%rbp),%rdi
call   10c0 <dcc_init@plt>
mov    %eax,-0x4(%rbp)
jmp    13a7 <handle_option+0x1f7>
mov    -0x10(%rbp),%rdi
lea    0xcd3(%rip),%rsi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
cmp    $0x0,%rax
jne    136c <handle_option+0x1bc>
mov    -0x10(%rbp),%rdi
call   1060 <io_init@plt>
mov    %eax,-0x4(%rbp)
jmp    13a7 <handle_option+0x1f7>
jmp    1371 <handle_option+0x1c1>
jmp    1376 <handle_option+0x1c6>
jmp    137b <handle_option+0x1cb>
jmp    1380 <handle_option+0x1d0>
jmp    1385 <handle_option+0x1d5>
jmp    138a <handle_option+0x1da>
jmp    138f <handle_option+0x1df>
jmp    1394 <handle_option+0x1e4>
lea    0xc82(%rip),%rdi
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_option>:
push   %rbx
mov    %rdi,%rbx
lea    0xe45(%rip),%rsi
mov    $0x3,%edx
call   10b0 <strncasecmp@plt>
test   %rax,%rax
je     12bd <handle_option+0x10d>
lea    0xe2f(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
test   %rax,%rax
je     12c6 <handle_option+0x116>
lea    0xe15(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
test   %rax,%rax
je     12cf <handle_option+0x11f>
lea    0xdfb(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
test   %rax,%rax
je     12d8 <handle_option+0x128>
lea    0xde1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
test   %rax,%rax
je     12e1 <handle_option+0x131>
lea    0xdc7(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
test   %rax,%rax
je     12ea <handle_option+0x13a>
lea    0xdad(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
test   %rax,%rax
je     12f3 <handle_option+0x143>
lea    0xd97(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   10b0 <strncasecmp@plt>
test   %rax,%rax
je     12fc <handle_option+0x14c>
lea    0xd82(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   10b0 <strncasecmp@plt>
test   %rax,%rax
je     1305 <handle_option+0x155>
lea    0xd6c(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <spo_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    10d0 <cr_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1090 <cp_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <mt_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1080 <dr_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <dk_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    10a0 <lp_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    10c0 <dcc_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1070 <io_init@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"spo\00"
@.str.1 = [3 x i8] c"cr\00"
@.str.2 = [3 x i8] c"cp\00"
@.str.3 = [3 x i8] c"mt\00"
@.str.4 = [3 x i8] c"dr\00"
@.str.5 = [3 x i8] c"dk\00"
@.str.6 = [3 x i8] c"lp\00"
@.str.7 = [4 x i8] c"dcc\00"
@.str.8 = [3 x i8] c"io\00"
@.str.9 = [19 x i8] c"unknown component\0A\00"
define i32 @handle_option(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strncasecmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @spo_init(i8* %8)
store i32 %9, i32* %2
br label %76
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i64 @strncasecmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = call i32 @cr_init(i8* %15)
store i32 %16, i32* %2
br label %76
17: ; preds = %10
%18 = load i8*, i8** %3
%19 = call i64 @strncasecmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i8*, i8** %3
%23 = call i32 @cp_init(i8* %22)
store i32 %23, i32* %2
br label %76
24: ; preds = %17
%25 = load i8*, i8** %3
%26 = call i64 @strncasecmp(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i8*, i8** %3
%30 = call i32 @mt_init(i8* %29)
store i32 %30, i32* %2
br label %76
31: ; preds = %24
%32 = load i8*, i8** %3
%33 = call i64 @strncasecmp(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %31
%36 = load i8*, i8** %3
%37 = call i32 @dr_init(i8* %36)
store i32 %37, i32* %2
br label %76
38: ; preds = %31
%39 = load i8*, i8** %3
%40 = call i64 @strncasecmp(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %38
%43 = load i8*, i8** %3
%44 = call i32 @dk_init(i8* %43)
store i32 %44, i32* %2
br label %76
45: ; preds = %38
%46 = load i8*, i8** %3
%47 = call i64 @strncasecmp(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %45
%50 = load i8*, i8** %3
%51 = call i32 @lp_init(i8* %50)
store i32 %51, i32* %2
br label %76
52: ; preds = %45
%53 = load i8*, i8** %3
%54 = call i64 @strncasecmp(i8* %53, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %52
%57 = load i8*, i8** %3
%58 = call i32 @dcc_init(i8* %57)
store i32 %58, i32* %2
br label %76
59: ; preds = %52
%60 = load i8*, i8** %3
%61 = call i64 @strncasecmp(i8* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32 2)
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %59
%64 = load i8*, i8** %3
%65 = call i32 @io_init(i8* %64)
store i32 %65, i32* %2
br label %76
66: ; preds = %59
br label %67
67: ; preds = %66
br label %68
68: ; preds = %67
br label %69
69: ; preds = %68
br label %70
70: ; preds = %69
br label %71
71: ; preds = %70
br label %72
72: ; preds = %71
br label %73
73: ; preds = %72
br label %74
74: ; preds = %73
%75 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %2
br label %76
76: ; preds = %74, %63, %56, %49, %42, %35, %28, %21, %14, %7
%77 = load i32, i32* %2
ret i32 %77
}

LLVM IR (-O2):
@.str = [4 x i8] c"spo\00"
@.str.1 = [3 x i8] c"cr\00"
@.str.2 = [3 x i8] c"cp\00"
@.str.3 = [3 x i8] c"mt\00"
@.str.4 = [3 x i8] c"dr\00"
@.str.5 = [3 x i8] c"dk\00"
@.str.6 = [3 x i8] c"lp\00"
@.str.7 = [4 x i8] c"dcc\00"
@.str.8 = [3 x i8] c"io\00"
@str = [18 x i8] c"unknown component\00"
define i32 @handle_option(i8* %0) {
%2 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @spo_init(i8* %0)
br label %48
6: ; preds = %1
%7 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @cr_init(i8* %0)
br label %48
11: ; preds = %6
%12 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 @cp_init(i8* %0)
br label %48
16: ; preds = %11
%17 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 @mt_init(i8* %0)
br label %48
21: ; preds = %16
%22 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = tail call i32 @dr_init(i8* %0)
br label %48
26: ; preds = %21
%27 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = tail call i32 @dk_init(i8* %0)
br label %48
31: ; preds = %26
%32 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = tail call i32 @lp_init(i8* %0)
br label %48
36: ; preds = %31
%37 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = tail call i32 @dcc_init(i8* %0)
br label %48
41: ; preds = %36
%42 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32 2)
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = tail call i32 @io_init(i8* %0)
br label %48
46: ; preds = %41
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %48
48: ; preds = %46, %44, %39, %34, %29, %24, %19, %14, %9, %4
%49 = phi i32 [ %5, %4 ], [ %10, %9 ], [ %15, %14 ], [ %20, %19 ], [ %25, %24 ], [ %30, %29 ], [ %35, %34 ], [ %40, %39 ], [ %45, %44 ], [ 1, %46 ]
ret i32 %49
}