#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*/ drawstringfancy(char const *, int, int, char, int);
void print_keys(unsigned char player, unsigned char ofs) {
  const char *k1;
  const char *k2;
  const char *k3;
  const char *k4;
  char c;
  switch (player) {
  default:
  case 0:
    k1 = "1";
    k2 = "2";
    k3 = "3";
    k4 = "4";
    c = 2 << 3;
    break;
  case 1:
    k1 = "7";
    k2 = "8";
    k3 = "9";
    k4 = "0";
    c = 4 << 3;
    break;
  case 2:
    k1 = "Z";
    k2 = "X";
    k3 = "C";
    k4 = "V";
    c = 5 << 3;
    break;
  case 3:
    k1 = "H";
    k2 = "J";
    k3 = "K";
    k4 = "L";
    c = 6 << 3;
    break;
  }
  drawstringfancy(k1, 3 + 11 - ofs, 17, c, 1);
  drawstringfancy(k2, 17 + 11 - ofs, 17, c, 1);
  drawstringfancy(k3, 3 + 11 - ofs, 21, c, 1);
  drawstringfancy(k4, 17 + 11 - ofs, 21, c, 1);
}


x86 assembly (clang, -O0):
<print_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
mov    %rax,-0x38(%rbp)
sub    $0x3,%rax
ja     114a <print_keys+0x3a>
mov    -0x38(%rbp),%rax
lea    0xebf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    114f <print_keys+0x3f>
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeb1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xea8(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe9f(%rip),%rax
mov    %rax,-0x28(%rbp)
movb   $0x10,-0x29(%rbp)
jmp    121e <print_keys+0x10e>
lea    0xe8d(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xe84(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe7b(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe72(%rip),%rax
mov    %rax,-0x28(%rbp)
movb   $0x20,-0x29(%rbp)
jmp    121e <print_keys+0x10e>
lea    0xe60(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xe57(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe4e(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe45(%rip),%rax
mov    %rax,-0x28(%rbp)
movb   $0x28,-0x29(%rbp)
jmp    121e <print_keys+0x10e>
lea    0xe33(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xe2a(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe21(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe18(%rip),%rax
mov    %rax,-0x28(%rbp)
movb   $0x30,-0x29(%rbp)
mov    -0x10(%rbp),%rdi
movzbl -0x2(%rbp),%eax
mov    $0xe,%esi
sub    %eax,%esi
mov    $0x11,%edx
mov    $0x1,%r8d
movsbl -0x29(%rbp),%ecx
call   1030 <drawstringfancy@plt>
mov    -0x18(%rbp),%rdi
movzbl -0x2(%rbp),%eax
mov    $0x1c,%esi
sub    %eax,%esi
mov    $0x11,%edx
mov    $0x1,%r8d
movsbl -0x29(%rbp),%ecx
call   1030 <drawstringfancy@plt>
mov    -0x20(%rbp),%rdi
movzbl -0x2(%rbp),%eax
mov    $0xe,%esi
sub    %eax,%esi
mov    $0x15,%edx
mov    $0x1,%r8d
movsbl -0x29(%rbp),%ecx
call   1030 <drawstringfancy@plt>
mov    -0x28(%rbp),%rdi
movzbl -0x2(%rbp),%eax
mov    $0x1c,%esi
sub    %eax,%esi
mov    $0x15,%edx
mov    $0x1,%r8d
movsbl -0x29(%rbp),%ecx
call   1030 <drawstringfancy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_keys>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
add    $0xff,%dil
cmp    $0x2,%dil
ja     116f <print_keys+0x5f>
movsbq %dil,%rcx
lea    0xef0(%rip),%rdx
movslq (%rdx,%rcx,4),%rax
add    %rdx,%rax
lea    0xeee(%rip),%rdx
movslq (%rdx,%rcx,4),%r12
add    %rdx,%r12
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%r15
add    %rdx,%r15
lea    0xeea(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
mov    %rcx,(%rsp)
shl    $0x3,%dil
add    $0x20,%dil
jmp    1192 <print_keys+0x82>
mov    $0x10,%dil
lea    0xe8d(%rip),%rax
mov    %rax,(%rsp)
lea    0xe80(%rip),%r15
lea    0xe77(%rip),%r12
lea    0xe6e(%rip),%rax
movzbl %sil,%r14d
mov    $0xe,%ebx
sub    %r14d,%ebx
movsbl %dil,%r13d
mov    %rax,%rdi
mov    %ebx,%esi
mov    $0x11,%edx
mov    %r13d,%ecx
mov    $0x1,%r8d
call   1030 <drawstringfancy@plt>
mov    $0x1c,%ebp
sub    %r14d,%ebp
mov    %r12,%rdi
mov    %ebp,%esi
mov    $0x11,%edx
mov    %r13d,%ecx
mov    $0x1,%r8d
call   1030 <drawstringfancy@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x15,%edx
mov    %r13d,%ecx
mov    $0x1,%r8d
call   1030 <drawstringfancy@plt>
mov    (%rsp),%rdi
mov    %ebp,%esi
mov    $0x15,%edx
mov    %r13d,%ecx
mov    $0x1,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <drawstringfancy@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"2\00"
@.str.2 = [2 x i8] c"3\00"
@.str.3 = [2 x i8] c"4\00"
@.str.4 = [2 x i8] c"7\00"
@.str.5 = [2 x i8] c"8\00"
@.str.6 = [2 x i8] c"9\00"
@.str.7 = [2 x i8] c"0\00"
@.str.8 = [2 x i8] c"Z\00"
@.str.9 = [2 x i8] c"X\00"
@.str.10 = [2 x i8] c"C\00"
@.str.11 = [2 x i8] c"V\00"
@.str.12 = [2 x i8] c"H\00"
@.str.13 = [2 x i8] c"J\00"
@.str.14 = [2 x i8] c"K\00"
@.str.15 = [2 x i8] c"L\00"
define void @print_keys(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
switch i32 %11, label %12 [
i32 0, label %13
i32 1, label %14
i32 2, label %15
i32 3, label %16
]
12: ; preds = %2
br label %13
13: ; preds = %2, %12
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %8
store i8 16, i8* %9
br label %17
14: ; preds = %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8** %8
store i8 32, i8* %9
br label %17
15: ; preds = %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8** %8
store i8 40, i8* %9
br label %17
16: ; preds = %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0), i8** %8
store i8 48, i8* %9
br label %17
17: ; preds = %16, %15, %14, %13
%18 = load i8*, i8** %5
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = sub nsw i32 14, %20
%22 = load i8, i8* %9
%23 = call i32 @drawstringfancy(i8* %18, i32 %21, i32 17, i8 signext %22, i32 1)
%24 = load i8*, i8** %6
%25 = load i8, i8* %4
%26 = zext i8 %25 to i32
%27 = sub nsw i32 28, %26
%28 = load i8, i8* %9
%29 = call i32 @drawstringfancy(i8* %24, i32 %27, i32 17, i8 signext %28, i32 1)
%30 = load i8*, i8** %7
%31 = load i8, i8* %4
%32 = zext i8 %31 to i32
%33 = sub nsw i32 14, %32
%34 = load i8, i8* %9
%35 = call i32 @drawstringfancy(i8* %30, i32 %33, i32 21, i8 signext %34, i32 1)
%36 = load i8*, i8** %8
%37 = load i8, i8* %4
%38 = zext i8 %37 to i32
%39 = sub nsw i32 28, %38
%40 = load i8, i8* %9
%41 = call i32 @drawstringfancy(i8* %36, i32 %39, i32 21, i8 signext %40, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"2\00"
@.str.2 = [2 x i8] c"3\00"
@.str.3 = [2 x i8] c"4\00"
@.str.4 = [2 x i8] c"7\00"
@.str.5 = [2 x i8] c"8\00"
@.str.6 = [2 x i8] c"9\00"
@.str.7 = [2 x i8] c"0\00"
@.str.8 = [2 x i8] c"Z\00"
@.str.9 = [2 x i8] c"X\00"
@.str.10 = [2 x i8] c"C\00"
@.str.11 = [2 x i8] c"V\00"
@.str.12 = [2 x i8] c"H\00"
@.str.13 = [2 x i8] c"J\00"
@.str.14 = [2 x i8] c"K\00"
@.str.15 = [2 x i8] c"L\00"
@reltable.print_keys = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.4 to i64), i64 ptrtoint ([3 x i32]* @reltable.print_keys to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.8 to i64), i64 ptrtoint ([3 x i32]* @reltable.print_keys to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.12 to i64), i64 ptrtoint ([3 x i32]* @reltable.print_keys to i64)) to i32)]
@reltable.print_keys.19 = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.5 to i64), i64 ptrtoint ([3 x i32]* @reltable.print_keys.19 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.9 to i64), i64 ptrtoint ([3 x i32]* @reltable.print_keys.19 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.13 to i64), i64 ptrtoint ([3 x i32]* @reltable.print_keys.19 to i64)) to i32)]
@reltable.print_keys.20 = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.6 to i64), i64 ptrtoint ([3 x i32]* @reltable.print_keys.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.10 to i64), i64 ptrtoint ([3 x i32]* @reltable.print_keys.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.14 to i64), i64 ptrtoint ([3 x i32]* @reltable.print_keys.20 to i64)) to i32)]
@reltable.print_keys.21 = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.7 to i64), i64 ptrtoint ([3 x i32]* @reltable.print_keys.21 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.11 to i64), i64 ptrtoint ([3 x i32]* @reltable.print_keys.21 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.15 to i64), i64 ptrtoint ([3 x i32]* @reltable.print_keys.21 to i64)) to i32)]
define void @print_keys(i8 zeroext %0, i8 zeroext %1) {
%3 = add i8 %0, -1
%4 = icmp ult i8 %3, 3
br i1 %4, label %5, label %20
5: ; preds = %2
%6 = sext i8 %3 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.print_keys to i8*), i64 %7)
%9 = sext i8 %3 to i64
%10 = shl i64 %9, 2
%11 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.print_keys.19 to i8*), i64 %10)
%12 = sext i8 %3 to i64
%13 = shl i64 %12, 2
%14 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.print_keys.20 to i8*), i64 %13)
%15 = sext i8 %3 to i64
%16 = shl i64 %15, 2
%17 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.print_keys.21 to i8*), i64 %16)
%18 = shl i8 %3, 3
%19 = add i8 %18, 32
br label %20
20: ; preds = %5, %2
%21 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ], [ %8, %5 ]
%22 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %2 ], [ %11, %5 ]
%23 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %2 ], [ %14, %5 ]
%24 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %2 ], [ %17, %5 ]
%25 = phi i8 [ 16, %2 ], [ %19, %5 ]
%26 = zext i8 %1 to i32
%27 = sub nsw i32 14, %26
%28 = tail call i32 @drawstringfancy(i8* %21, i32 %27, i32 17, i8 signext %25, i32 1)
%29 = sub nsw i32 28, %26
%30 = tail call i32 @drawstringfancy(i8* %22, i32 %29, i32 17, i8 signext %25, i32 1)
%31 = tail call i32 @drawstringfancy(i8* %23, i32 %27, i32 21, i8 signext %25, i32 1)
%32 = tail call i32 @drawstringfancy(i8* %24, i32 %29, i32 21, i8 signext %25, i32 1)
ret void
}