#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 */
scalar_t__ strcmp(char const *, char *);
bool parse_device(const char *param, int *device) {
  if (strcmp(param, "all") == 0) {
    *device = 9;
  } else if (strcmp(param, "intensity") == 0) {
    *device = 10;
  } else if (strcmp(param, "wan") == 0) {
    *device = 0;
  } else if (strcmp(param, "wifi") == 0) {
    *device = 1;
  } else if (strcmp(param, "pwr") == 0) {
    *device = 2;
  } else if (strcmp(param, "lan") == 0) {
    *device = 3;
  } else if (strcmp(param, "lan1") == 0) {
    *device = 4;
  } else if (strcmp(param, "lan2") == 0) {
    *device = 5;
  } else if (strcmp(param, "lan3") == 0) {
    *device = 6;
  } else if (strcmp(param, "lan4") == 0) {
    *device = 7;
  } else if (strcmp(param, "lan5") == 0) {
    *device = 8;
  } else if (strcmp(param, "binmask") == 0) {
    *device = 11;
  } else if (strcmp(param, "get") == 0) {
    *device = 12;
  } else {
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<parse_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1149 <parse_device+0x39>
mov    -0x18(%rbp),%rax
movl   $0x9,(%rax)
jmp    137d <parse_device+0x26d>
mov    -0x10(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1172 <parse_device+0x62>
mov    -0x18(%rbp),%rax
movl   $0xa,(%rax)
jmp    1378 <parse_device+0x268>
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    119b <parse_device+0x8b>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    1373 <parse_device+0x263>
mov    -0x10(%rbp),%rdi
lea    0xe6c(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11c4 <parse_device+0xb4>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
jmp    136e <parse_device+0x25e>
mov    -0x10(%rbp),%rdi
lea    0xe48(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11ed <parse_device+0xdd>
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
jmp    1369 <parse_device+0x259>
mov    -0x10(%rbp),%rdi
lea    0xe23(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1216 <parse_device+0x106>
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
jmp    1364 <parse_device+0x254>
mov    -0x10(%rbp),%rdi
lea    0xdfe(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    123f <parse_device+0x12f>
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
jmp    135f <parse_device+0x24f>
mov    -0x10(%rbp),%rdi
lea    0xdda(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1268 <parse_device+0x158>
mov    -0x18(%rbp),%rax
movl   $0x5,(%rax)
jmp    135a <parse_device+0x24a>
mov    -0x10(%rbp),%rdi
lea    0xdb6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1291 <parse_device+0x181>
mov    -0x18(%rbp),%rax
movl   $0x6,(%rax)
jmp    1355 <parse_device+0x245>
mov    -0x10(%rbp),%rdi
lea    0xd92(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    12ba <parse_device+0x1aa>
mov    -0x18(%rbp),%rax
movl   $0x7,(%rax)
jmp    1350 <parse_device+0x240>
mov    -0x10(%rbp),%rdi
lea    0xd6e(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    12e3 <parse_device+0x1d3>
mov    -0x18(%rbp),%rax
movl   $0x8,(%rax)
jmp    134b <parse_device+0x23b>
mov    -0x10(%rbp),%rdi
lea    0xd4a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    130c <parse_device+0x1fc>
mov    -0x18(%rbp),%rax
movl   $0xb,(%rax)
jmp    1346 <parse_device+0x236>
mov    -0x10(%rbp),%rdi
lea    0xd29(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1335 <parse_device+0x225>
mov    -0x18(%rbp),%rax
movl   $0xc,(%rax)
jmp    1341 <parse_device+0x231>
movl   $0x0,-0x4(%rbp)
jmp    1384 <parse_device+0x274>
jmp    1346 <parse_device+0x236>
jmp    134b <parse_device+0x23b>
jmp    1350 <parse_device+0x240>
jmp    1355 <parse_device+0x245>
jmp    135a <parse_device+0x24a>
jmp    135f <parse_device+0x24f>
jmp    1364 <parse_device+0x254>
jmp    1369 <parse_device+0x259>
jmp    136e <parse_device+0x25e>
jmp    1373 <parse_device+0x263>
jmp    1378 <parse_device+0x268>
jmp    137d <parse_device+0x26d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_device>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     124f <parse_device+0x13f>
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1256 <parse_device+0x146>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     125d <parse_device+0x14d>
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1261 <parse_device+0x151>
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1268 <parse_device+0x158>
lea    0xe85(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     126f <parse_device+0x15f>
lea    0xe71(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1276 <parse_device+0x166>
lea    0xe5e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     127d <parse_device+0x16d>
lea    0xe4b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1284 <parse_device+0x174>
lea    0xe38(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     128b <parse_device+0x17b>
lea    0xe25(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1292 <parse_device+0x182>
lea    0xe16(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1299 <parse_device+0x189>
lea    0xe0a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    12a6 <parse_device+0x196>
mov    $0xc,%eax
jmp    129e <parse_device+0x18e>
mov    $0x9,%eax
jmp    129e <parse_device+0x18e>
mov    $0xa,%eax
jmp    129e <parse_device+0x18e>
xor    %eax,%eax
jmp    129e <parse_device+0x18e>
mov    $0x1,%eax
jmp    129e <parse_device+0x18e>
mov    $0x2,%eax
jmp    129e <parse_device+0x18e>
mov    $0x3,%eax
jmp    129e <parse_device+0x18e>
mov    $0x4,%eax
jmp    129e <parse_device+0x18e>
mov    $0x5,%eax
jmp    129e <parse_device+0x18e>
mov    $0x6,%eax
jmp    129e <parse_device+0x18e>
mov    $0x7,%eax
jmp    129e <parse_device+0x18e>
mov    $0x8,%eax
jmp    129e <parse_device+0x18e>
mov    $0xb,%eax
mov    %eax,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"all\00"
@.str.1 = [10 x i8] c"intensity\00"
@.str.2 = [4 x i8] c"wan\00"
@.str.3 = [5 x i8] c"wifi\00"
@.str.4 = [4 x i8] c"pwr\00"
@.str.5 = [4 x i8] c"lan\00"
@.str.6 = [5 x i8] c"lan1\00"
@.str.7 = [5 x i8] c"lan2\00"
@.str.8 = [5 x i8] c"lan3\00"
@.str.9 = [5 x i8] c"lan4\00"
@.str.10 = [5 x i8] c"lan5\00"
@.str.11 = [8 x i8] c"binmask\00"
@.str.12 = [4 x i8] c"get\00"
define i32 @parse_device(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32*, i32** %5
store i32 9, i32* %10
br label %96
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i32*, i32** %5
store i32 10, i32* %16
br label %95
17: ; preds = %11
%18 = load i8*, i8** %4
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load i32*, i32** %5
store i32 0, i32* %22
br label %94
23: ; preds = %17
%24 = load i8*, i8** %4
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = load i32*, i32** %5
store i32 1, i32* %28
br label %93
29: ; preds = %23
%30 = load i8*, i8** %4
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = load i32*, i32** %5
store i32 2, i32* %34
br label %92
35: ; preds = %29
%36 = load i8*, i8** %4
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = load i32*, i32** %5
store i32 3, i32* %40
br label %91
41: ; preds = %35
%42 = load i8*, i8** %4
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = load i32*, i32** %5
store i32 4, i32* %46
br label %90
47: ; preds = %41
%48 = load i8*, i8** %4
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = load i32*, i32** %5
store i32 5, i32* %52
br label %89
53: ; preds = %47
%54 = load i8*, i8** %4
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %53
%58 = load i32*, i32** %5
store i32 6, i32* %58
br label %88
59: ; preds = %53
%60 = load i8*, i8** %4
%61 = call i64 @strcmp(i8* %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %59
%64 = load i32*, i32** %5
store i32 7, i32* %64
br label %87
65: ; preds = %59
%66 = load i8*, i8** %4
%67 = call i64 @strcmp(i8* %66, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %65
%70 = load i32*, i32** %5
store i32 8, i32* %70
br label %86
71: ; preds = %65
%72 = load i8*, i8** %4
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = load i32*, i32** %5
store i32 11, i32* %76
br label %85
77: ; preds = %71
%78 = load i8*, i8** %4
%79 = call i64 @strcmp(i8* %78, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %83
81: ; preds = %77
%82 = load i32*, i32** %5
store i32 12, i32* %82
br label %84
83: ; preds = %77
store i32 0, i32* %3
br label %97
84: ; preds = %81
br label %85
85: ; preds = %84, %75
br label %86
86: ; preds = %85, %69
br label %87
87: ; preds = %86, %63
br label %88
88: ; preds = %87, %57
br label %89
89: ; preds = %88, %51
br label %90
90: ; preds = %89, %45
br label %91
91: ; preds = %90, %39
br label %92
92: ; preds = %91, %33
br label %93
93: ; preds = %92, %27
br label %94
94: ; preds = %93, %21
br label %95
95: ; preds = %94, %15
br label %96
96: ; preds = %95, %9
store i32 1, i32* %3
br label %97
97: ; preds = %96, %83
%98 = load i32, i32* %3
ret i32 %98
}

LLVM IR (-O2):
@.str = [4 x i8] c"all\00"
@.str.1 = [10 x i8] c"intensity\00"
@.str.2 = [4 x i8] c"wan\00"
@.str.3 = [5 x i8] c"wifi\00"
@.str.4 = [4 x i8] c"pwr\00"
@.str.5 = [4 x i8] c"lan\00"
@.str.6 = [5 x i8] c"lan1\00"
@.str.7 = [5 x i8] c"lan2\00"
@.str.8 = [5 x i8] c"lan3\00"
@.str.9 = [5 x i8] c"lan4\00"
@.str.10 = [5 x i8] c"lan5\00"
@.str.11 = [8 x i8] c"binmask\00"
@.str.12 = [4 x i8] c"get\00"
define i32 @parse_device(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %41, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %41, label %8
8: ; preds = %5
%9 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %41, label %11
11: ; preds = %8
%12 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %41, label %14
14: ; preds = %11
%15 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %41, label %17
17: ; preds = %14
%18 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %41, label %20
20: ; preds = %17
%21 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %41, label %23
23: ; preds = %20
%24 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %41, label %26
26: ; preds = %23
%27 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %41, label %29
29: ; preds = %26
%30 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %41, label %32
32: ; preds = %29
%33 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %41, label %35
35: ; preds = %32
%36 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %41, label %38
38: ; preds = %35
%39 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %38, %35, %32, %29, %26, %23, %20, %17, %14, %11, %8, %5, %2
%42 = phi i32 [ 9, %2 ], [ 10, %5 ], [ 0, %8 ], [ 1, %11 ], [ 2, %14 ], [ 3, %17 ], [ 4, %20 ], [ 5, %23 ], [ 6, %26 ], [ 7, %29 ], [ 8, %32 ], [ 11, %35 ], [ 12, %38 ]
store i32 %42, i32* %1
br label %43
43: ; preds = %41, %38
%44 = phi i32 [ 0, %38 ], [ 1, %41 ]
ret i32 %44
}