#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*/ fwrite(unsigned char const *, unsigned char, int,
                          int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void show_utf8_char(unsigned int c, const unsigned char *b, unsigned char len) {
  switch (c) {
  case 0x08:
    printf("<BSP>");
    break;
  case '\t':
    printf("<TAB>");
    break;
  case '\n':
    printf("<RET>");
    break;
  case ' ':
    printf("<SPC>");
    break;
  default:
    fwrite(b, len, 1, stdout);
    break;
  }
}


x86 assembly (clang, -O0):
<show_utf8_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffff8,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x18,%eax
ja     11a1 <show_utf8_char+0x81>
mov    -0x20(%rbp),%rax
lea    0xeac(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf00(%rip),%rdi
call   1030 <printf@plt>
jmp    11be <show_utf8_char+0x9e>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
jmp    11be <show_utf8_char+0x9e>
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
jmp    11be <show_utf8_char+0x9e>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
jmp    11be <show_utf8_char+0x9e>
mov    -0x10(%rbp),%rdi
mov    -0x11(%rbp),%al
mov    0x2e31(%rip),%rcx
mov    (%rcx),%ecx
mov    $0x1,%edx
movzbl %al,%esi
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_utf8_char>:
add    $0xfffffff8,%edi
cmp    $0x18,%edi
ja     115c <show_utf8_char+0x3c>
lea    0xed1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xf25(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xf1f(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xf19(%rip),%rdi
jmp    1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%ecx
movzbl %dl,%eax
mov    %rsi,%rdi
mov    %eax,%esi
mov    $0x1,%edx
jmp    1040 <fwrite@plt>
lea    0xef8(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"<BSP>\00"
@.str.1 = [6 x i8] c"<TAB>\00"
@.str.2 = [6 x i8] c"<RET>\00"
@.str.3 = [6 x i8] c"<SPC>\00"
@stdout = global i32 0
define void @show_utf8_char(i32 %0, i8* %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
switch i32 %7, label %16 [
i32 8, label %8
i32 9, label %10
i32 10, label %12
i32 32, label %14
]
8: ; preds = %3
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %21
10: ; preds = %3
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %21
12: ; preds = %3
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %21
14: ; preds = %3
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %21
16: ; preds = %3
%17 = load i8*, i8** %5
%18 = load i8, i8* %6
%19 = load i32, i32* @stdout
%20 = call i32 @fwrite(i8* %17, i8 zeroext %18, i32 1, i32 %19)
br label %21
21: ; preds = %16, %14, %12, %10, %8
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"<BSP>\00"
@.str.1 = [6 x i8] c"<TAB>\00"
@.str.2 = [6 x i8] c"<RET>\00"
@.str.3 = [6 x i8] c"<SPC>\00"
@stdout = global i32 0
define void @show_utf8_char(i32 %0, i8* %1, i8 zeroext %2) {
switch i32 %0, label %12 [
i32 8, label %4
i32 9, label %6
i32 10, label %8
i32 32, label %10
]
4: ; preds = %3
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %15
6: ; preds = %3
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %15
8: ; preds = %3
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %15
10: ; preds = %3
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %15
12: ; preds = %3
%13 = load i32, i32* @stdout
%14 = tail call i32 @fwrite(i8* %1, i8 zeroext %2, i32 1, i32 %13)
br label %15
15: ; preds = %12, %10, %8, %6, %4
ret void
}