char map_roguedir(comval)
register char comval;
{
  switch (comval) {
  case 'h':
    comval = '4';
    break;
  case 'y':
    comval = '7';
    break;
  case 'k':
    comval = '8';
    break;
  case 'u':
    comval = '9';
    break;
  case 'l':
    comval = '6';
    break;
  case 'n':
    comval = '3';
    break;
  case 'j':
    comval = '2';
    break;
  case 'b':
    comval = '1';
    break;
  case '.':
    comval = '5';
    break;
  }
  return (comval);
}


x86 assembly (clang, -O0):
<map_roguedir>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffd2,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4b,%eax
ja     1180 <map_roguedir+0x80>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x34,-0x1(%rbp)
jmp    1180 <map_roguedir+0x80>
movb   $0x37,-0x1(%rbp)
jmp    1180 <map_roguedir+0x80>
movb   $0x38,-0x1(%rbp)
jmp    1180 <map_roguedir+0x80>
movb   $0x39,-0x1(%rbp)
jmp    1180 <map_roguedir+0x80>
movb   $0x36,-0x1(%rbp)
jmp    1180 <map_roguedir+0x80>
movb   $0x33,-0x1(%rbp)
jmp    1180 <map_roguedir+0x80>
movb   $0x32,-0x1(%rbp)
jmp    1180 <map_roguedir+0x80>
movb   $0x31,-0x1(%rbp)
jmp    1180 <map_roguedir+0x80>
movb   $0x35,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_roguedir>:
mov    %edi,%eax
movsbl %al,%ecx
add    $0xffffffd2,%ecx
cmp    $0x4b,%ecx
ja     111f <map_roguedir+0x1f>
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x35,%al
ret
mov    $0x31,%al
ret
mov    $0x34,%al
ret
mov    $0x32,%al
ret
mov    $0x38,%al
ret
mov    $0x36,%al
ret
mov    $0x33,%al
ret
mov    $0x39,%al
ret
mov    $0x37,%al
ret

LLVM IR (-O0):
define signext i8 @map_roguedir(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %15 [
i32 104, label %6
i32 121, label %7
i32 107, label %8
i32 117, label %9
i32 108, label %10
i32 110, label %11
i32 106, label %12
i32 98, label %13
i32 46, label %14
]
6: ; preds = %1
store i8 52, i8* %2
br label %15
7: ; preds = %1
store i8 55, i8* %2
br label %15
8: ; preds = %1
store i8 56, i8* %2
br label %15
9: ; preds = %1
store i8 57, i8* %2
br label %15
10: ; preds = %1
store i8 54, i8* %2
br label %15
11: ; preds = %1
store i8 51, i8* %2
br label %15
12: ; preds = %1
store i8 50, i8* %2
br label %15
13: ; preds = %1
store i8 49, i8* %2
br label %15
14: ; preds = %1
store i8 53, i8* %2
br label %15
15: ; preds = %1, %14, %13, %12, %11, %10, %9, %8, %7, %6
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @map_roguedir(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = shl i32 %0, 24
%4 = ashr exact i32 %3, 24
switch i32 %4, label %14 [
i32 104, label %5
i32 121, label %6
i32 107, label %7
i32 117, label %8
i32 108, label %9
i32 110, label %10
i32 106, label %11
i32 98, label %12
i32 46, label %13
]
5: ; preds = %1
br label %14
6: ; preds = %1
br label %14
7: ; preds = %1
br label %14
8: ; preds = %1
br label %14
9: ; preds = %1
br label %14
10: ; preds = %1
br label %14
11: ; preds = %1
br label %14
12: ; preds = %1
br label %14
13: ; preds = %1
br label %14
14: ; preds = %1, %13, %12, %11, %10, %9, %8, %7, %6, %5
%15 = phi i8 [ %2, %1 ], [ 53, %13 ], [ 49, %12 ], [ 50, %11 ], [ 51, %10 ], [ 54, %9 ], [ 57, %8 ], [ 56, %7 ], [ 55, %6 ], [ 52, %5 ]
ret i8 %15
}