#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 strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void tyo(char c) {
  static char *alt = "◊";
  static char *ctrl = "↑";
  if (c < 040) {
    switch (c) {
    case 033:
      write(1, alt, strlen(alt));
      return;
    case (('J') & 037):
      write(1, &c, 1);
      c = (('M') & 037);
    case (('M') & 037):
    case (('H') & 037):
    case (('I') & 037):
      write(1, &c, 1);
      break;
    default:
      write(1, ctrl, strlen(ctrl));
      c += 0100;
      write(1, &c, 1);
    }
  } else
    write(1, &c, 1);
}


x86 assembly (clang, -O0):
<tyo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jge    1200 <tyo+0xe0>
movsbl -0x1(%rbp),%eax
add    $0xfffffff8,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x13,%eax
ja     11ba <tyo+0x9a>
mov    -0x10(%rbp),%rax
lea    0xea4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2ec4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2eb9(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
jmp    1210 <tyo+0xf0>
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
movb   $0xd,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
jmp    11fb <tyo+0xdb>
mov    0x2e77(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e6c(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
movsbl -0x1(%rbp),%eax
add    $0x40,%eax
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
jmp    1210 <tyo+0xf0>
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tyo>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %bl,0x7(%rsp)
cmp    $0x1f,%bl
jg     118a <tyo+0x6a>
movsbl %bl,%eax
add    $0xfffffff8,%eax
cmp    $0x13,%eax
ja     1165 <tyo+0x45>
lea    0xebf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
movb   $0xd,0x7(%rsp)
jmp    118a <tyo+0x6a>
lea    0xee8(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x40,%bl
mov    %bl,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xea3(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write@plt>

LLVM IR (-O0):
@tyo.alt = internal global i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0)
@.str = [4 x i8] c"\E2\97\8A\00"
@tyo.ctrl = internal global i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0)
@.str.1 = [4 x i8] c"\E2\86\91\00"
define void @tyo(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp slt i32 %4, 32
br i1 %5, label %6, label %29
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
switch i32 %8, label %18 [
i32 27, label %9
i32 10, label %14
i32 13, label %16
i32 8, label %16
i32 9, label %16
]
9: ; preds = %6
%10 = load i8*, i8** @tyo.alt
%11 = load i8*, i8** @tyo.alt
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @write(i32 1, i8* %10, i32 %12)
br label %31
14: ; preds = %6
%15 = call i32 @write(i32 1, i8* %2, i32 1)
store i8 13, i8* %2
br label %16
16: ; preds = %6, %6, %6, %14
%17 = call i32 @write(i32 1, i8* %2, i32 1)
br label %28
18: ; preds = %6
%19 = load i8*, i8** @tyo.ctrl
%20 = load i8*, i8** @tyo.ctrl
%21 = call i32 @strlen(i8* %20)
%22 = call i32 @write(i32 1, i8* %19, i32 %21)
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = add nsw i32 %24, 64
%26 = trunc i32 %25 to i8
store i8 %26, i8* %2
%27 = call i32 @write(i32 1, i8* %2, i32 1)
br label %28
28: ; preds = %18, %16
br label %31
29: ; preds = %1
%30 = call i32 @write(i32 1, i8* %2, i32 1)
br label %31
31: ; preds = %9, %29, %28
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\E2\97\8A\00"
@.str.1 = [4 x i8] c"\E2\86\91\00"
define void @tyo(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = icmp slt i8 %0, 32
br i1 %3, label %4, label %18
4: ; preds = %1
%5 = sext i8 %0 to i32
switch i32 %5, label %13 [
i32 27, label %6
i32 10, label %9
i32 13, label %11
i32 8, label %11
i32 9, label %11
]
6: ; preds = %4
%7 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %20
9: ; preds = %4
%10 = call i32 @write(i32 1, i8* %2, i32 1)
store i8 13, i8* %2
br label %11
11: ; preds = %4, %4, %4, %9
%12 = call i32 @write(i32 1, i8* %2, i32 1)
br label %20
13: ; preds = %4
%14 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%15 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = add nsw i8 %0, 64
store i8 %16, i8* %2
%17 = call i32 @write(i32 1, i8* %2, i32 1)
br label %20
18: ; preds = %1
%19 = call i32 @write(i32 1, i8* %2, i32 1)
br label %20
20: ; preds = %11, %13, %6, %18
ret void
}