#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*/ moveto(int, int);
int moveKey(char dir) {
  switch (dir) {
  case 'k':
    moveto(0, 1);
    return 0;
  case 'j':
    moveto(0, -1);
    return 0;
  case 'l':
    moveto(1, 0);
    return 0;
  case 'h':
    moveto(-1, 0);
    return 0;
  case 'b':
    moveto(-1, -1);
    return 0;
  case 'y':
    moveto(-1, 1);
    return 0;
  case 'n':
    moveto(1, -1);
    return 0;
  case 'u':
    moveto(1, 1);
    return 0;
  default:
    return 1;
    break;
  }
}


x86 assembly (clang, -O0):
<moveKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffff9e,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x17,%eax
ja     120e <moveKey+0xfe>
mov    -0x10(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <moveto@plt>
movl   $0x0,-0x4(%rbp)
jmp    1215 <moveKey+0x105>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1030 <moveto@plt>
movl   $0x0,-0x4(%rbp)
jmp    1215 <moveKey+0x105>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <moveto@plt>
movl   $0x0,-0x4(%rbp)
jmp    1215 <moveKey+0x105>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <moveto@plt>
movl   $0x0,-0x4(%rbp)
jmp    1215 <moveKey+0x105>
mov    $0xffffffff,%esi
mov    %esi,%edi
call   1030 <moveto@plt>
movl   $0x0,-0x4(%rbp)
jmp    1215 <moveKey+0x105>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <moveto@plt>
movl   $0x0,-0x4(%rbp)
jmp    1215 <moveKey+0x105>
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1030 <moveto@plt>
movl   $0x0,-0x4(%rbp)
jmp    1215 <moveKey+0x105>
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <moveto@plt>
movl   $0x0,-0x4(%rbp)
jmp    1215 <moveKey+0x105>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveKey>:
push   %rbx
mov    $0x1,%ebx
add    $0xffffff9e,%edi
cmp    $0x17,%edi
ja     1197 <moveKey+0x87>
lea    0xedb(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
jmp    1190 <moveKey+0x80>
xor    %ebx,%ebx
mov    $0xffffffff,%edi
jmp    116a <moveKey+0x5a>
xor    %ebx,%ebx
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1030 <moveto@plt>
jmp    1197 <moveKey+0x87>
xor    %ebx,%ebx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <moveto@plt>
jmp    1197 <moveKey+0x87>
xor    %ebx,%ebx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <moveto@plt>
jmp    1197 <moveKey+0x87>
mov    $0x1,%edi
mov    $0xffffffff,%esi
jmp    1190 <moveKey+0x80>
mov    $0x1,%edi
jmp    118b <moveKey+0x7b>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <moveto@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @moveKey(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
switch i32 %5, label %22 [
i32 107, label %6
i32 106, label %8
i32 108, label %10
i32 104, label %12
i32 98, label %14
i32 121, label %16
i32 110, label %18
i32 117, label %20
]
6: ; preds = %1
%7 = call i32 @moveto(i32 0, i32 1)
store i32 0, i32* %2
br label %23
8: ; preds = %1
%9 = call i32 @moveto(i32 0, i32 -1)
store i32 0, i32* %2
br label %23
10: ; preds = %1
%11 = call i32 @moveto(i32 1, i32 0)
store i32 0, i32* %2
br label %23
12: ; preds = %1
%13 = call i32 @moveto(i32 -1, i32 0)
store i32 0, i32* %2
br label %23
14: ; preds = %1
%15 = call i32 @moveto(i32 -1, i32 -1)
store i32 0, i32* %2
br label %23
16: ; preds = %1
%17 = call i32 @moveto(i32 -1, i32 1)
store i32 0, i32* %2
br label %23
18: ; preds = %1
%19 = call i32 @moveto(i32 1, i32 -1)
store i32 0, i32* %2
br label %23
20: ; preds = %1
%21 = call i32 @moveto(i32 1, i32 1)
store i32 0, i32* %2
br label %23
22: ; preds = %1
store i32 1, i32* %2
br label %23
23: ; preds = %22, %20, %18, %16, %14, %12, %10, %8, %6
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @moveKey(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %19 [
i32 107, label %3
i32 106, label %5
i32 108, label %7
i32 104, label %9
i32 98, label %11
i32 121, label %13
i32 110, label %15
i32 117, label %17
]
3: ; preds = %1
%4 = tail call i32 @moveto(i32 0, i32 1)
br label %19
5: ; preds = %1
%6 = tail call i32 @moveto(i32 0, i32 -1)
br label %19
7: ; preds = %1
%8 = tail call i32 @moveto(i32 1, i32 0)
br label %19
9: ; preds = %1
%10 = tail call i32 @moveto(i32 -1, i32 0)
br label %19
11: ; preds = %1
%12 = tail call i32 @moveto(i32 -1, i32 -1)
br label %19
13: ; preds = %1
%14 = tail call i32 @moveto(i32 -1, i32 1)
br label %19
15: ; preds = %1
%16 = tail call i32 @moveto(i32 1, i32 -1)
br label %19
17: ; preds = %1
%18 = tail call i32 @moveto(i32 1, i32 1)
br label %19
19: ; preds = %1, %17, %15, %13, %11, %9, %7, %5, %3
%20 = phi i32 [ 0, %17 ], [ 0, %15 ], [ 0, %13 ], [ 0, %11 ], [ 0, %9 ], [ 0, %7 ], [ 0, %5 ], [ 0, %3 ], [ 1, %1 ]
ret i32 %20
}