#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 */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ isgraph(int);
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
char *deemacs_key_to_str_representation(int32_t key) {
  char *res = malloc(16);
  *res = 0;
  if (key & 01000)
    strcat(res, "C-");
  if (key & 02000)
    strcat(res, "M-");
  key &= ~(01000 | 02000);
  switch (key) {
  case 00404:
    strcat(res, "<prior>");
    break;
  case 00405:
    strcat(res, "<next>");
    break;
  case 00406:
    strcat(res, "<home>");
    break;
  case 00407:
    strcat(res, "<end>");
    break;
  case 00410:
    strcat(res, "<delete>");
    break;
  case 00411:
    strcat(res, "<backspace>");
    break;
  case 00412:
    strcat(res, "<insert>");
    break;
  case 00413:
    strcat(res, "<left>");
    break;
  case 00414:
    strcat(res, "<right>");
    break;
  case 00415:
    strcat(res, "<up>");
    break;
  case 00416:
    strcat(res, "<down>");
    break;
  case 00403:
    strcat(res, "<RET>");
    break;
  case 00402:
    strcat(res, "<TAB>");
    break;
  case 00420:
    strcat(res, "<f1>");
    break;
  case 00421:
    strcat(res, "<f2>");
    break;
  case 00422:
    strcat(res, "<f3>");
    break;
  case 00423:
    strcat(res, "<f4>");
    break;
  case 00424:
    strcat(res, "<f5>");
    break;
  case 00425:
    strcat(res, "<f6>");
    break;
  case 00426:
    strcat(res, "<f7>");
    break;
  case 00427:
    strcat(res, "<f8>");
    break;
  case 00430:
    strcat(res, "<f9>");
    break;
  case 00431:
    strcat(res, "<f10>");
    break;
  case 00432:
    strcat(res, "<f11>");
    break;
  case 00433:
    strcat(res, "<f12>");
    break;
  case ' ':
    strcat(res, "SPC");
    break;
  default:
    if (key <= 0xff && isgraph(key)) {
      int l = strlen(res);
      res[l] = key;
      res[l + 1] = 0;
    } else
      sprintf(res, "<%x>", (unsigned)key);
  }
  return res;
}


x86 assembly (clang, -O0):
<deemacs_key_to_str_representation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x4(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
je     1191 <deemacs_key_to_str_representation+0x41>
mov    -0x10(%rbp),%rdi
lea    0x1264(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x4(%rbp),%eax
and    $0x400,%eax
cmp    $0x0,%eax
je     11b2 <deemacs_key_to_str_representation+0x62>
mov    -0x10(%rbp),%rdi
lea    0x1246(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x3(%rbp),%al
and    $0xf9,%al
mov    %al,-0x3(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xfb,%eax
ja     1407 <deemacs_key_to_str_representation+0x2b7>
mov    -0x20(%rbp),%rax
lea    0xe24(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
lea    0x1206(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x11f9(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x11eb(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x11dd(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x11ce(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x11c2(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x11b9(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x11ad(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x119f(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x1192(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x1182(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x1174(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x1165(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x1156(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x1146(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x1136(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x1126(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x1116(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x1106(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x10f6(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x10e6(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x10d6(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x10c6(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x10b7(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x10a8(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rdi
lea    0x1099(%rip),%rsi
call   1050 <strcat@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
cmpl   $0xff,-0x4(%rbp)
jg     1457 <deemacs_key_to_str_representation+0x307>
mov    -0x4(%rbp),%edi
call   1070 <isgraph@plt>
cmp    $0x0,%eax
je     1457 <deemacs_key_to_str_representation+0x307>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    146a <deemacs_key_to_str_representation+0x31a>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0x1035(%rip),%rsi
call   1060 <sprintf@plt>
jmp    146f <deemacs_key_to_str_representation+0x31f>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deemacs_key_to_str_representation>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
movb   $0x0,(%rax)
test   $0x200,%ebp
je     117d <deemacs_key_to_str_representation+0x2d>
lea    0x127b(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcat@plt>
test   $0x400,%ebp
je     1194 <deemacs_key_to_str_representation+0x44>
lea    0x1267(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcat@plt>
mov    %ebp,%ebx
and    $0xfffff9ff,%ebx
lea    -0x20(%rbx),%eax
cmp    $0xfb,%eax
ja     11c2 <deemacs_key_to_str_representation+0x72>
lea    0xe53(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x12d9(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
cmp    $0xff,%ebx
jg     1303 <deemacs_key_to_str_representation+0x1b3>
mov    %ebx,%edi
call   1070 <isgraph@plt>
test   %eax,%eax
je     1303 <deemacs_key_to_str_representation+0x1b3>
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
mov    %bpl,(%r14,%rax,1)
movb   $0x0,0x1(%r14,%rax,1)
jmp    12fb <deemacs_key_to_str_representation+0x1ab>
lea    0x1254(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x1242(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11e1(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11dd(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11d8(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11d3(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11cd(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11ca(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11ca(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11c7(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11c2(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11c1(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11bd(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11c7(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11c3(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11bf(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11bb(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11b7(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11b3(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11af(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11ab(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11a7(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11a3(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x11a0(%rip),%rsi
jmp    12f3 <deemacs_key_to_str_representation+0x1a3>
lea    0x119d(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcat@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0x1190(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
call   1060 <sprintf@plt>
jmp    12fb <deemacs_key_to_str_representation+0x1ab>

LLVM IR (-O0):
@.str = [3 x i8] c"C-\00"
@.str.1 = [3 x i8] c"M-\00"
@.str.2 = [8 x i8] c"<prior>\00"
@.str.3 = [7 x i8] c"<next>\00"
@.str.4 = [7 x i8] c"<home>\00"
@.str.5 = [6 x i8] c"<end>\00"
@.str.6 = [9 x i8] c"<delete>\00"
@.str.7 = [12 x i8] c"<backspace>\00"
@.str.8 = [9 x i8] c"<insert>\00"
@.str.9 = [7 x i8] c"<left>\00"
@.str.10 = [8 x i8] c"<right>\00"
@.str.11 = [5 x i8] c"<up>\00"
@.str.12 = [7 x i8] c"<down>\00"
@.str.13 = [6 x i8] c"<RET>\00"
@.str.14 = [6 x i8] c"<TAB>\00"
@.str.15 = [5 x i8] c"<f1>\00"
@.str.16 = [5 x i8] c"<f2>\00"
@.str.17 = [5 x i8] c"<f3>\00"
@.str.18 = [5 x i8] c"<f4>\00"
@.str.19 = [5 x i8] c"<f5>\00"
@.str.20 = [5 x i8] c"<f6>\00"
@.str.21 = [5 x i8] c"<f7>\00"
@.str.22 = [5 x i8] c"<f8>\00"
@.str.23 = [5 x i8] c"<f9>\00"
@.str.24 = [6 x i8] c"<f10>\00"
@.str.25 = [6 x i8] c"<f11>\00"
@.str.26 = [6 x i8] c"<f12>\00"
@.str.27 = [4 x i8] c"SPC\00"
@.str.28 = [5 x i8] c"<%x>\00"
define i8* @deemacs_key_to_str_representation(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i8* @malloc(i32 16)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
store i8 0, i8* %6
%7 = load i32, i32* %2
%8 = and i32 %7, 512
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10, %1
%14 = load i32, i32* %2
%15 = and i32 %14, 1024
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i8*, i8** %3
%19 = call i32 @strcat(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %17, %13
%21 = load i32, i32* %2
%22 = and i32 %21, -1537
store i32 %22, i32* %2
%23 = load i32, i32* %2
switch i32 %23, label %102 [
i32 260, label %24
i32 261, label %27
i32 262, label %30
i32 263, label %33
i32 264, label %36
i32 265, label %39
i32 266, label %42
i32 267, label %45
i32 268, label %48
i32 269, label %51
i32 270, label %54
i32 259, label %57
i32 258, label %60
i32 272, label %63
i32 273, label %66
i32 274, label %69
i32 275, label %72
i32 276, label %75
i32 277, label %78
i32 278, label %81
i32 279, label %84
i32 280, label %87
i32 281, label %90
i32 282, label %93
i32 283, label %96
i32 32, label %99
]
24: ; preds = %20
%25 = load i8*, i8** %3
%26 = call i32 @strcat(i8* %25, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %128
27: ; preds = %20
%28 = load i8*, i8** %3
%29 = call i32 @strcat(i8* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %128
30: ; preds = %20
%31 = load i8*, i8** %3
%32 = call i32 @strcat(i8* %31, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %128
33: ; preds = %20
%34 = load i8*, i8** %3
%35 = call i32 @strcat(i8* %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %128
36: ; preds = %20
%37 = load i8*, i8** %3
%38 = call i32 @strcat(i8* %37, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %128
39: ; preds = %20
%40 = load i8*, i8** %3
%41 = call i32 @strcat(i8* %40, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
br label %128
42: ; preds = %20
%43 = load i8*, i8** %3
%44 = call i32 @strcat(i8* %43, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %128
45: ; preds = %20
%46 = load i8*, i8** %3
%47 = call i32 @strcat(i8* %46, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
br label %128
48: ; preds = %20
%49 = load i8*, i8** %3
%50 = call i32 @strcat(i8* %49, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
br label %128
51: ; preds = %20
%52 = load i8*, i8** %3
%53 = call i32 @strcat(i8* %52, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
br label %128
54: ; preds = %20
%55 = load i8*, i8** %3
%56 = call i32 @strcat(i8* %55, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
br label %128
57: ; preds = %20
%58 = load i8*, i8** %3
%59 = call i32 @strcat(i8* %58, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
br label %128
60: ; preds = %20
%61 = load i8*, i8** %3
%62 = call i32 @strcat(i8* %61, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
br label %128
63: ; preds = %20
%64 = load i8*, i8** %3
%65 = call i32 @strcat(i8* %64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %128
66: ; preds = %20
%67 = load i8*, i8** %3
%68 = call i32 @strcat(i8* %67, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
br label %128
69: ; preds = %20
%70 = load i8*, i8** %3
%71 = call i32 @strcat(i8* %70, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0))
br label %128
72: ; preds = %20
%73 = load i8*, i8** %3
%74 = call i32 @strcat(i8* %73, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0))
br label %128
75: ; preds = %20
%76 = load i8*, i8** %3
%77 = call i32 @strcat(i8* %76, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
br label %128
78: ; preds = %20
%79 = load i8*, i8** %3
%80 = call i32 @strcat(i8* %79, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
br label %128
81: ; preds = %20
%82 = load i8*, i8** %3
%83 = call i32 @strcat(i8* %82, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
br label %128
84: ; preds = %20
%85 = load i8*, i8** %3
%86 = call i32 @strcat(i8* %85, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0))
br label %128
87: ; preds = %20
%88 = load i8*, i8** %3
%89 = call i32 @strcat(i8* %88, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0))
br label %128
90: ; preds = %20
%91 = load i8*, i8** %3
%92 = call i32 @strcat(i8* %91, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0))
br label %128
93: ; preds = %20
%94 = load i8*, i8** %3
%95 = call i32 @strcat(i8* %94, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0))
br label %128
96: ; preds = %20
%97 = load i8*, i8** %3
%98 = call i32 @strcat(i8* %97, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0))
br label %128
99: ; preds = %20
%100 = load i8*, i8** %3
%101 = call i32 @strcat(i8* %100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0))
br label %128
102: ; preds = %20
%103 = load i32, i32* %2
%104 = icmp sle i32 %103, 255
br i1 %104, label %105, label %123
105: ; preds = %102
%106 = load i32, i32* %2
%107 = call i32 @isgraph(i32 %106)
%108 = icmp ne i32 %107, 0
br i1 %108, label %109, label %123
109: ; preds = %105
%110 = load i8*, i8** %3
%111 = call i32 @strlen(i8* %110)
store i32 %111, i32* %4
%112 = load i32, i32* %2
%113 = trunc i32 %112 to i8
%114 = load i8*, i8** %3
%115 = load i32, i32* %4
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i8, i8* %114, i64 %116
store i8 %113, i8* %117
%118 = load i8*, i8** %3
%119 = load i32, i32* %4
%120 = add nsw i32 %119, 1
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8, i8* %118, i64 %121
store i8 0, i8* %122
br label %127
123: ; preds = %105, %102
%124 = load i8*, i8** %3
%125 = load i32, i32* %2
%126 = call i32 @sprintf(i8* %124, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.28, i64 0, i64 0), i32 %125)
br label %127
127: ; preds = %123, %109
br label %128
128: ; preds = %127, %99, %96, %93, %90, %87, %84, %81, %78, %75, %72, %69, %66, %63, %60, %57, %54, %51, %48, %45, %42, %39, %36, %33, %30, %27, %24
%129 = load i8*, i8** %3
ret i8* %129
}

LLVM IR (-O2):
@.str = [3 x i8] c"C-\00"
@.str.1 = [3 x i8] c"M-\00"
@.str.2 = [8 x i8] c"<prior>\00"
@.str.3 = [7 x i8] c"<next>\00"
@.str.4 = [7 x i8] c"<home>\00"
@.str.5 = [6 x i8] c"<end>\00"
@.str.6 = [9 x i8] c"<delete>\00"
@.str.7 = [12 x i8] c"<backspace>\00"
@.str.8 = [9 x i8] c"<insert>\00"
@.str.9 = [7 x i8] c"<left>\00"
@.str.10 = [8 x i8] c"<right>\00"
@.str.11 = [5 x i8] c"<up>\00"
@.str.12 = [7 x i8] c"<down>\00"
@.str.13 = [6 x i8] c"<RET>\00"
@.str.14 = [6 x i8] c"<TAB>\00"
@.str.15 = [5 x i8] c"<f1>\00"
@.str.16 = [5 x i8] c"<f2>\00"
@.str.17 = [5 x i8] c"<f3>\00"
@.str.18 = [5 x i8] c"<f4>\00"
@.str.19 = [5 x i8] c"<f5>\00"
@.str.20 = [5 x i8] c"<f6>\00"
@.str.21 = [5 x i8] c"<f7>\00"
@.str.22 = [5 x i8] c"<f8>\00"
@.str.23 = [5 x i8] c"<f9>\00"
@.str.24 = [6 x i8] c"<f10>\00"
@.str.25 = [6 x i8] c"<f11>\00"
@.str.26 = [6 x i8] c"<f12>\00"
@.str.27 = [4 x i8] c"SPC\00"
@.str.28 = [5 x i8] c"<%x>\00"
define i8* @deemacs_key_to_str_representation(i32 %0) {
%2 = tail call dereferenceable_or_null(16) i8* @malloc(i32 16)
store i8 0, i8* %2
%3 = and i32 %0, 512
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = and i32 %0, 1024
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = and i32 %0, -1537
switch i32 %13, label %66 [
i32 260, label %14
i32 261, label %16
i32 262, label %18
i32 263, label %20
i32 264, label %22
i32 265, label %24
i32 266, label %26
i32 267, label %28
i32 268, label %30
i32 269, label %32
i32 270, label %34
i32 259, label %36
i32 258, label %38
i32 272, label %40
i32 273, label %42
i32 274, label %44
i32 275, label %46
i32 276, label %48
i32 277, label %50
i32 278, label %52
i32 279, label %54
i32 280, label %56
i32 281, label %58
i32 282, label %60
i32 283, label %62
i32 32, label %64
]
14: ; preds = %12
%15 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %81
16: ; preds = %12
%17 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %81
18: ; preds = %12
%19 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %81
20: ; preds = %12
%21 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %81
22: ; preds = %12
%23 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %81
24: ; preds = %12
%25 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
br label %81
26: ; preds = %12
%27 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %81
28: ; preds = %12
%29 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
br label %81
30: ; preds = %12
%31 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
br label %81
32: ; preds = %12
%33 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
br label %81
34: ; preds = %12
%35 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
br label %81
36: ; preds = %12
%37 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
br label %81
38: ; preds = %12
%39 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
br label %81
40: ; preds = %12
%41 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %81
42: ; preds = %12
%43 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
br label %81
44: ; preds = %12
%45 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0))
br label %81
46: ; preds = %12
%47 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0))
br label %81
48: ; preds = %12
%49 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
br label %81
50: ; preds = %12
%51 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0))
br label %81
52: ; preds = %12
%53 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
br label %81
54: ; preds = %12
%55 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i64 0, i64 0))
br label %81
56: ; preds = %12
%57 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.23, i64 0, i64 0))
br label %81
58: ; preds = %12
%59 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0))
br label %81
60: ; preds = %12
%61 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.25, i64 0, i64 0))
br label %81
62: ; preds = %12
%63 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0))
br label %81
64: ; preds = %12
%65 = tail call i32 @strcat(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0))
br label %81
66: ; preds = %12
%67 = icmp slt i32 %13, 256
br i1 %67, label %68, label %79
68: ; preds = %66
%69 = tail call i32 @isgraph(i32 %13)
%70 = icmp eq i32 %69, 0
br i1 %70, label %79, label %71
71: ; preds = %68
%72 = tail call i32 @strlen(i8* %2)
%73 = trunc i32 %0 to i8
%74 = sext i32 %72 to i64
%75 = getelementptr inbounds i8, i8* %2, i64 %74
store i8 %73, i8* %75
%76 = add nsw i32 %72, 1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %2, i64 %77
store i8 0, i8* %78
br label %81
79: ; preds = %68, %66
%80 = tail call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.28, i64 0, i64 0), i32 %13)
br label %81
81: ; preds = %71, %79, %64, %62, %60, %58, %56, %54, %52, %50, %48, %46, %44, %42, %40, %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14
ret i8* %2
}