#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*/ printf(char *, ...);
void pretty_putchar(int c) {
  if (c >= 32 && c < 127)
    printf("  %c", c);
  else if (c == '\n')
    printf(" \\n");
  else if (c == '\t')
    printf(" \\t");
  else
    printf(" %02x", c);
}


x86 assembly (clang, -O0):
<pretty_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jl     1145 <pretty_putchar+0x35>
cmpl   $0x7f,-0x4(%rbp)
jge    1145 <pretty_putchar+0x35>
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119a <pretty_putchar+0x8a>
cmpl   $0xa,-0x4(%rbp)
jne    1162 <pretty_putchar+0x52>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1195 <pretty_putchar+0x85>
cmpl   $0x9,-0x4(%rbp)
jne    117f <pretty_putchar+0x6f>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1190 <pretty_putchar+0x80>
mov    -0x4(%rbp),%esi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1195 <pretty_putchar+0x85>
jmp    119a <pretty_putchar+0x8a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pretty_putchar>:
mov    %edi,%esi
lea    -0x20(%rsi),%eax
cmp    $0x5e,%eax
ja     1128 <pretty_putchar+0x18>
lea    0xedf(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
cmp    $0x9,%esi
je     1140 <pretty_putchar+0x30>
cmp    $0xa,%esi
jne    114e <pretty_putchar+0x3e>
lea    0xecc(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xec2(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c" %c\00"
@.str.1 = [4 x i8] c" \\n\00"
@.str.2 = [4 x i8] c" \\t\00"
@.str.3 = [6 x i8] c" %02x\00"
define void @pretty_putchar(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %13
6: ; preds = %1
switch i32 %0, label %11 [
i32 10, label %7
i32 9, label %9
]
7: ; preds = %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %13
9: ; preds = %6
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %13
11: ; preds = %6
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %0)
br label %13
13: ; preds = %7, %11, %9, %4
ret void
}