#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*/ print(char *, ...);
void print_c(char c) {
  if (c == '\n')
    print("\\n");
  else if (c == '\r')
    print("\\r");
  else if (c == '\t')
    print("\\t");
  else if (c == '\0')
    print("\\0");
  else
    print("%c", c);
}


x86 assembly (clang, -O0):
<print_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    113e <print_c+0x2e>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
jmp    11bf <print_c+0xaf>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
jne    115e <print_c+0x4e>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
jmp    11ba <print_c+0xaa>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jne    117e <print_c+0x6e>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
jmp    11b5 <print_c+0xa5>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    119e <print_c+0x8e>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
jmp    11b0 <print_c+0xa0>
movsbl -0x1(%rbp),%esi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
jmp    11b5 <print_c+0xa5>
jmp    11ba <print_c+0xaa>
jmp    11bf <print_c+0xaf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_c>:
cmp    $0xd,%dil
ja     1138 <print_c+0x28>
movzbl %dil,%eax
lea    0xedf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf10(%rip),%rdi
xor    %eax,%eax
jmp    1030 <print@plt>
movsbl %dil,%esi
lea    0xf01(%rip),%rdi
xor    %eax,%eax
jmp    1030 <print@plt>
lea    0xeed(%rip),%rdi
xor    %eax,%eax
jmp    1030 <print@plt>
lea    0xed9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <print@plt>
lea    0xece(%rip),%rdi
xor    %eax,%eax
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\\n\00"
@.str.1 = [3 x i8] c"\\r\00"
@.str.2 = [3 x i8] c"\\t\00"
@.str.3 = [3 x i8] c"\\0\00"
@.str.4 = [3 x i8] c"%c\00"
define void @print_c(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %33
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 13
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %32
14: ; preds = %8
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 9
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %31
20: ; preds = %14
%21 = load i8, i8* %2
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %30
26: ; preds = %20
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %26, %24
br label %31
31: ; preds = %30, %18
br label %32
32: ; preds = %31, %12
br label %33
33: ; preds = %32, %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\\n\00"
@.str.1 = [3 x i8] c"\\r\00"
@.str.2 = [3 x i8] c"\\t\00"
@.str.3 = [3 x i8] c"\\0\00"
@.str.4 = [3 x i8] c"%c\00"
define void @print_c(i8 signext %0) {
switch i8 %0, label %10 [
i8 10, label %2
i8 13, label %4
i8 9, label %6
i8 0, label %8
]
2: ; preds = %1
%3 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %13
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %13
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %13
8: ; preds = %1
%9 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %13
10: ; preds = %1
%11 = sext i8 %0 to i32
%12 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %4, %8, %10, %6, %2
ret void
}