#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*/ move_bob();
int /*<<< orphan*/ move_bol();
int /*<<< orphan*/ move_eob();
int /*<<< orphan*/ move_eol();
int /*<<< orphan*/ move_halfscreendown();
int /*<<< orphan*/ move_halfscreenup();
int /*<<< orphan*/ move_nextch();
int /*<<< orphan*/ move_nextln();
int /*<<< orphan*/ move_prevch();
int /*<<< orphan*/ move_prevln();
int /*<<< orphan*/ move_toline();
bool command_move(char c) {
  if (c == 'h')
    move_prevch();
  else if (c == 'l')
    move_nextch();
  else if (c == 'j')
    move_nextln();
  else if (c == 'k')
    move_prevln();
  else if (c == 'H')
    move_bol();
  else if (c == 'L')
    move_eol();
  else if (c == 'd')
    move_halfscreendown();
  else if (c == 'u')
    move_halfscreenup();
  else if (c == 'D')
    move_eob();
  else if (c == 'U')
    move_bob();
  else if (c == 'g')
    move_toline();
  else
    return (false);
  return (true);
}


x86 assembly (clang, -O0):
<command_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x68,%eax
jne    11d7 <command_move+0x27>
mov    $0x0,%al
call   10c0 <move_prevch@plt>
jmp    130f <command_move+0x15f>
movsbl -0x5(%rbp),%eax
cmp    $0x6c,%eax
jne    11f0 <command_move+0x40>
mov    $0x0,%al
call   1050 <move_nextch@plt>
jmp    130a <command_move+0x15a>
movsbl -0x5(%rbp),%eax
cmp    $0x6a,%eax
jne    1209 <command_move+0x59>
mov    $0x0,%al
call   10b0 <move_nextln@plt>
jmp    1305 <command_move+0x155>
movsbl -0x5(%rbp),%eax
cmp    $0x6b,%eax
jne    1222 <command_move+0x72>
mov    $0x0,%al
call   1090 <move_prevln@plt>
jmp    1300 <command_move+0x150>
movsbl -0x5(%rbp),%eax
cmp    $0x48,%eax
jne    123b <command_move+0x8b>
mov    $0x0,%al
call   1030 <move_bol@plt>
jmp    12fb <command_move+0x14b>
movsbl -0x5(%rbp),%eax
cmp    $0x4c,%eax
jne    1254 <command_move+0xa4>
mov    $0x0,%al
call   1070 <move_eol@plt>
jmp    12f6 <command_move+0x146>
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jne    126d <command_move+0xbd>
mov    $0x0,%al
call   10d0 <move_halfscreendown@plt>
jmp    12f1 <command_move+0x141>
movsbl -0x5(%rbp),%eax
cmp    $0x75,%eax
jne    1286 <command_move+0xd6>
mov    $0x0,%al
call   1040 <move_halfscreenup@plt>
jmp    12ec <command_move+0x13c>
movsbl -0x5(%rbp),%eax
cmp    $0x44,%eax
jne    129f <command_move+0xef>
mov    $0x0,%al
call   1080 <move_eob@plt>
jmp    12e7 <command_move+0x137>
movsbl -0x5(%rbp),%eax
cmp    $0x55,%eax
jne    12b8 <command_move+0x108>
mov    $0x0,%al
call   1060 <move_bob@plt>
jmp    12e2 <command_move+0x132>
movsbl -0x5(%rbp),%eax
cmp    $0x67,%eax
jne    12d1 <command_move+0x121>
mov    $0x0,%al
call   10a0 <move_toline@plt>
jmp    12dd <command_move+0x12d>
movl   $0x0,-0x4(%rbp)
jmp    1316 <command_move+0x166>
jmp    12e2 <command_move+0x132>
jmp    12e7 <command_move+0x137>
jmp    12ec <command_move+0x13c>
jmp    12f1 <command_move+0x141>
jmp    12f6 <command_move+0x146>
jmp    12fb <command_move+0x14b>
jmp    1300 <command_move+0x150>
jmp    1305 <command_move+0x155>
jmp    130a <command_move+0x15a>
jmp    130f <command_move+0x15f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_move>:
push   %rax
xor    %eax,%eax
add    $0xbc,%dil
cmp    $0x31,%dil
ja     1237 <command_move+0x87>
movzbl %dil,%ecx
lea    0xe38(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
xor    %eax,%eax
call   1080 <move_eob@plt>
jmp    1232 <command_move+0x82>
xor    %eax,%eax
call   1030 <move_bol@plt>
jmp    1232 <command_move+0x82>
xor    %eax,%eax
call   1070 <move_eol@plt>
jmp    1232 <command_move+0x82>
xor    %eax,%eax
call   1060 <move_bob@plt>
jmp    1232 <command_move+0x82>
xor    %eax,%eax
call   10d0 <move_halfscreendown@plt>
jmp    1232 <command_move+0x82>
xor    %eax,%eax
call   10a0 <move_toline@plt>
jmp    1232 <command_move+0x82>
xor    %eax,%eax
call   10c0 <move_prevch@plt>
jmp    1232 <command_move+0x82>
xor    %eax,%eax
call   10b0 <move_nextln@plt>
jmp    1232 <command_move+0x82>
xor    %eax,%eax
call   1090 <move_prevln@plt>
jmp    1232 <command_move+0x82>
xor    %eax,%eax
call   1050 <move_nextch@plt>
jmp    1232 <command_move+0x82>
xor    %eax,%eax
call   1040 <move_halfscreenup@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @command_move(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 104
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @move_prevch()
br label %80
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 108
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (...) @move_nextch()
br label %79
15: ; preds = %9
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 106
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 (...) @move_nextln()
br label %78
21: ; preds = %15
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 107
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 (...) @move_prevln()
br label %77
27: ; preds = %21
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 72
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 (...) @move_bol()
br label %76
33: ; preds = %27
%34 = load i8, i8* %3
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 76
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 (...) @move_eol()
br label %75
39: ; preds = %33
%40 = load i8, i8* %3
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 100
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = call i32 (...) @move_halfscreendown()
br label %74
45: ; preds = %39
%46 = load i8, i8* %3
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 117
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = call i32 (...) @move_halfscreenup()
br label %73
51: ; preds = %45
%52 = load i8, i8* %3
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 68
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = call i32 (...) @move_eob()
br label %72
57: ; preds = %51
%58 = load i8, i8* %3
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 85
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = call i32 (...) @move_bob()
br label %71
63: ; preds = %57
%64 = load i8, i8* %3
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 103
br i1 %66, label %67, label %69
67: ; preds = %63
%68 = call i32 (...) @move_toline()
br label %70
69: ; preds = %63
store i32 0, i32* %2
br label %81
70: ; preds = %67
br label %71
71: ; preds = %70, %61
br label %72
72: ; preds = %71, %55
br label %73
73: ; preds = %72, %49
br label %74
74: ; preds = %73, %43
br label %75
75: ; preds = %74, %37
br label %76
76: ; preds = %75, %31
br label %77
77: ; preds = %76, %25
br label %78
78: ; preds = %77, %19
br label %79
79: ; preds = %78, %13
br label %80
80: ; preds = %79, %7
store i32 1, i32* %2
br label %81
81: ; preds = %80, %69
%82 = load i32, i32* %2
ret i32 %82
}

LLVM IR (-O2):
define i32 @command_move(i8 signext %0) {
switch i8 %0, label %24 [
i8 104, label %2
i8 108, label %4
i8 106, label %6
i8 107, label %8
i8 72, label %10
i8 76, label %12
i8 100, label %14
i8 117, label %16
i8 68, label %18
i8 85, label %20
i8 103, label %22
]
2: ; preds = %1
%3 = tail call i32 (...) @move_prevch()
br label %24
4: ; preds = %1
%5 = tail call i32 (...) @move_nextch()
br label %24
6: ; preds = %1
%7 = tail call i32 (...) @move_nextln()
br label %24
8: ; preds = %1
%9 = tail call i32 (...) @move_prevln()
br label %24
10: ; preds = %1
%11 = tail call i32 (...) @move_bol()
br label %24
12: ; preds = %1
%13 = tail call i32 (...) @move_eol()
br label %24
14: ; preds = %1
%15 = tail call i32 (...) @move_halfscreendown()
br label %24
16: ; preds = %1
%17 = tail call i32 (...) @move_halfscreenup()
br label %24
18: ; preds = %1
%19 = tail call i32 (...) @move_eob()
br label %24
20: ; preds = %1
%21 = tail call i32 (...) @move_bob()
br label %24
22: ; preds = %1
%23 = tail call i32 (...) @move_toline()
br label %24
24: ; preds = %2, %6, %10, %14, %18, %22, %20, %16, %12, %8, %4, %1
%25 = phi i32 [ 0, %1 ], [ 1, %4 ], [ 1, %8 ], [ 1, %12 ], [ 1, %16 ], [ 1, %20 ], [ 1, %22 ], [ 1, %18 ], [ 1, %14 ], [ 1, %10 ], [ 1, %6 ], [ 1, %2 ]
ret i32 %25
}