#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*/ wdctl_command_action(char *);
void wdctl_command(int command) {
  char *action = NULL;
  switch (command) {
  case 16:
    action = "add_trusted_mac";
    break;
  case 26:
    action = "del_trusted_mac";
    break;
  case 17:
    action = "clear_trusted_mac";
    break;
  case 13:
    action = "add_untrusted_mac";
    break;
  case 27:
    action = "del_untrusted_mac";
    break;
  case 14:
    action = "clear_untrusted_mac";
    break;
  case 25:
    action = "del_trusted_iplist";
    break;
  case 21:
    action = "add_trusted_iplist";
    break;
  case 24:
    action = "clear_trusted_iplist";
    break;
  case 28:
    action = "add_trusted_pdomains";
    break;
  case 29:
    action = "del_trusted_pdomains";
    break;
  case 30:
    action = "clear_trusted_pdomains";
    break;
  case 31:
    action = "show_trusted_pdomains";
    break;
  case 32:
    action = "add_trusted_local_mac";
    break;
  case 33:
    action = "del_trusted_local_mac";
    break;
  case 35:
    action = "clear_trusted_local_mac";
    break;
  case 34:
    action = "show_trusted_local_mac";
    break;
  }
  if (action)
    wdctl_command_action(action);
}


x86 assembly (clang, -O0):
<wdctl_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffff3,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x16,%eax
ja     1257 <wdctl_command+0x147>
mov    -0x18(%rbp),%rax
lea    0xebd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf09(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf09(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf09(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf0b(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf0d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf0f(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf13(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf16(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf19(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf1e(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf23(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf28(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf2f(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf35(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf3b(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf41(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1257 <wdctl_command+0x147>
lea    0xf49(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     126b <wdctl_command+0x15b>
mov    -0x10(%rbp),%rdi
call   1030 <wdctl_command_action@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wdctl_command>:
add    $0xfffffff3,%edi
cmp    $0x16,%edi
ja     1122 <wdctl_command+0x12>
mov    $0x7ff91b,%eax
bt     %edi,%eax
jb     1123 <wdctl_command+0x13>
ret
movslq %edi,%rax
lea    0x102b(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <wdctl_command_action@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"add_trusted_mac\00"
@.str.1 = [16 x i8] c"del_trusted_mac\00"
@.str.2 = [18 x i8] c"clear_trusted_mac\00"
@.str.3 = [18 x i8] c"add_untrusted_mac\00"
@.str.4 = [18 x i8] c"del_untrusted_mac\00"
@.str.5 = [20 x i8] c"clear_untrusted_mac\00"
@.str.6 = [19 x i8] c"del_trusted_iplist\00"
@.str.7 = [19 x i8] c"add_trusted_iplist\00"
@.str.8 = [21 x i8] c"clear_trusted_iplist\00"
@.str.9 = [21 x i8] c"add_trusted_pdomains\00"
@.str.10 = [21 x i8] c"del_trusted_pdomains\00"
@.str.11 = [23 x i8] c"clear_trusted_pdomains\00"
@.str.12 = [22 x i8] c"show_trusted_pdomains\00"
@.str.13 = [22 x i8] c"add_trusted_local_mac\00"
@.str.14 = [22 x i8] c"del_trusted_local_mac\00"
@.str.15 = [24 x i8] c"clear_trusted_local_mac\00"
@.str.16 = [23 x i8] c"show_trusted_local_mac\00"
define void @wdctl_command(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
switch i32 %4, label %22 [
i32 16, label %5
i32 26, label %6
i32 17, label %7
i32 13, label %8
i32 27, label %9
i32 14, label %10
i32 25, label %11
i32 21, label %12
i32 24, label %13
i32 28, label %14
i32 29, label %15
i32 30, label %16
i32 31, label %17
i32 32, label %18
i32 33, label %19
i32 35, label %20
i32 34, label %21
]
5: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %3
br label %22
6: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %22
7: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %22
8: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %22
9: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %22
10: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %22
11: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %22
12: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %22
13: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %22
14: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %22
15: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %22
16: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %22
17: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0), i8** %3
br label %22
18: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.13, i64 0, i64 0), i8** %3
br label %22
19: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i8** %3
br label %22
20: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i8** %3
br label %22
21: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.16, i64 0, i64 0), i8** %3
br label %22
22: ; preds = %1, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%23 = load i8*, i8** %3
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i8*, i8** %3
%27 = call i32 @wdctl_command_action(i8* %26)
br label %28
28: ; preds = %25, %22
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"add_trusted_mac\00"
@.str.1 = [16 x i8] c"del_trusted_mac\00"
@.str.2 = [18 x i8] c"clear_trusted_mac\00"
@.str.3 = [18 x i8] c"add_untrusted_mac\00"
@.str.4 = [18 x i8] c"del_untrusted_mac\00"
@.str.5 = [20 x i8] c"clear_untrusted_mac\00"
@.str.6 = [19 x i8] c"del_trusted_iplist\00"
@.str.7 = [19 x i8] c"add_trusted_iplist\00"
@.str.8 = [21 x i8] c"clear_trusted_iplist\00"
@.str.9 = [21 x i8] c"add_trusted_pdomains\00"
@.str.10 = [21 x i8] c"del_trusted_pdomains\00"
@.str.11 = [23 x i8] c"clear_trusted_pdomains\00"
@.str.12 = [22 x i8] c"show_trusted_pdomains\00"
@.str.13 = [22 x i8] c"add_trusted_local_mac\00"
@.str.14 = [22 x i8] c"del_trusted_local_mac\00"
@.str.15 = [24 x i8] c"clear_trusted_local_mac\00"
@.str.16 = [23 x i8] c"show_trusted_local_mac\00"
@reltable.wdctl_command = [23 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.3 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([20 x i8]* @.str.5 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.2 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.7 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.8 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([19 x i8]* @.str.6 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.1 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.4 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.9 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([21 x i8]* @.str.10 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.11 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.12 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.13 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([22 x i8]* @.str.14 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.16 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([24 x i8]* @.str.15 to i64), i64 ptrtoint ([23 x i32]* @reltable.wdctl_command to i64)) to i32)]
define void @wdctl_command(i32 %0) {
%2 = add i32 %0, -13
%3 = icmp ult i32 %2, 23
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = lshr i32 8386843, %2
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = sext i32 %2 to i64
%10 = shl i64 %9, 2
%11 = call i8* @llvm.load.relative.i64(i8* bitcast ([23 x i32]* @reltable.wdctl_command to i8*), i64 %10)
%12 = tail call i32 @wdctl_command_action(i8* %11)
br label %13
13: ; preds = %4, %1, %8
ret void
}