#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void echo_chr(unsigned char c) {
  if (c >= 32 && c < 127) {
    fprintf(stderr, "%c", c);
  } else {
    switch (c) {
    case '\a':
      fprintf(stderr, "\x1b[30;47m\\a\x1b[0m");
      break;
    case '\b':
      fprintf(stderr, "\x1b[30;47m\\b\x1b[0m");
      break;
    case 0x1b:
      fprintf(stderr, "\x1b[30;47m\\e\x1b[0m");
      break;
    case '\f':
      fprintf(stderr, "\x1b[30;47m\\f\x1b[0m");
      break;
    case '\n':
      fprintf(stderr, "\x1b[30;47m\\n\x1b[0m");
      break;
    case '\r':
      fprintf(stderr, "\x1b[30;47m\\r\x1b[0m");
      break;
    case '\t':
      fprintf(stderr, "\x1b[30;47m\\t\x1b[0m");
      break;
    case '\v':
      fprintf(stderr, "\x1b[30;47m\\v\x1b[0m");
      break;
    default:
      fprintf(stderr, "\x1b[30;47m%02x\x1b[0m", c);
    }
  }
  fflush(stderr);
}


x86 assembly (clang, -O0):
<echo_chr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jl     1168 <echo_chr+0x48>
movzbl -0x1(%rbp),%eax
cmp    $0x7f,%eax
jge    1168 <echo_chr+0x48>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
movzbl -0x1(%rbp),%edx
lea    0xef8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1292 <echo_chr+0x172>
movzbl -0x1(%rbp),%eax
add    $0xfffffff9,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x14,%eax
ja     1272 <echo_chr+0x152>
mov    -0x10(%rbp),%rax
lea    0xe77(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    128d <echo_chr+0x16d>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    128d <echo_chr+0x16d>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    128d <echo_chr+0x16d>
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
lea    0xe8e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    128d <echo_chr+0x16d>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
lea    0xe81(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    128d <echo_chr+0x16d>
mov    0x2dbb(%rip),%rax
mov    (%rax),%edi
lea    0xe74(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    128d <echo_chr+0x16d>
mov    0x2d9f(%rip),%rax
mov    (%rax),%edi
lea    0xe67(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    128d <echo_chr+0x16d>
mov    0x2d83(%rip),%rax
mov    (%rax),%edi
lea    0xe5a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    128d <echo_chr+0x16d>
mov    0x2d67(%rip),%rax
mov    (%rax),%edi
movzbl -0x1(%rbp),%edx
lea    0xe49(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1292 <echo_chr+0x172>
mov    0x2d47(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_chr>:
push   %rax
mov    %edi,%edx
lea    -0x20(%rdx),%eax
cmp    $0x5e,%al
ja     1146 <echo_chr+0x26>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xf1a(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    1211 <echo_chr+0xf1>
lea    -0x7(%rdx),%eax
cmp    $0x14,%al
ja     11e5 <echo_chr+0xc5>
movzbl %al,%eax
lea    0xea5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xee3(%rip),%rsi
jmp    120a <echo_chr+0xea>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    120a <echo_chr+0xea>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
lea    0xf16(%rip),%rsi
jmp    120a <echo_chr+0xea>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
lea    0xee6(%rip),%rsi
jmp    120a <echo_chr+0xea>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
lea    0xf01(%rip),%rsi
jmp    120a <echo_chr+0xea>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
jmp    120a <echo_chr+0xea>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
jmp    120a <echo_chr+0xea>
mov    0x2df4(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    113a <echo_chr+0x1a>
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
lea    0xe6b(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2dc8(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%c\00"
@.str.1 = [15 x i8] c"\1B[30;47m\\a\1B[0m\00"
@.str.2 = [15 x i8] c"\1B[30;47m\\b\1B[0m\00"
@.str.3 = [15 x i8] c"\1B[30;47m\\e\1B[0m\00"
@.str.4 = [15 x i8] c"\1B[30;47m\\f\1B[0m\00"
@.str.5 = [15 x i8] c"\1B[30;47m\\n\1B[0m\00"
@.str.6 = [15 x i8] c"\1B[30;47m\\r\1B[0m\00"
@.str.7 = [15 x i8] c"\1B[30;47m\\t\1B[0m\00"
@.str.8 = [15 x i8] c"\1B[30;47m\\v\1B[0m\00"
@.str.9 = [17 x i8] c"\1B[30;47m%02x\1B[0m\00"
define void @echo_chr(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp slt i32 %8, 127
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* @stderr
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %48
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
switch i32 %17, label %42 [
i32 7, label %18
i32 8, label %21
i32 27, label %24
i32 12, label %27
i32 10, label %30
i32 13, label %33
i32 9, label %36
i32 11, label %39
]
18: ; preds = %15
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %47
21: ; preds = %15
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %47
24: ; preds = %15
%25 = load i32, i32* @stderr
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %47
27: ; preds = %15
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %47
30: ; preds = %15
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
br label %47
33: ; preds = %15
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %47
36: ; preds = %15
%37 = load i32, i32* @stderr
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
br label %47
39: ; preds = %15
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %47
42: ; preds = %15
%43 = load i32, i32* @stderr
%44 = load i8, i8* %2
%45 = zext i8 %44 to i32
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %42, %39, %36, %33, %30, %27, %24, %21, %18
br label %48
48: ; preds = %47, %10
%49 = load i32, i32* @stderr
%50 = call i32 @fflush(i32 %49)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%c\00"
@.str.1 = [15 x i8] c"\1B[30;47m\\a\1B[0m\00"
@.str.2 = [15 x i8] c"\1B[30;47m\\b\1B[0m\00"
@.str.3 = [15 x i8] c"\1B[30;47m\\e\1B[0m\00"
@.str.4 = [15 x i8] c"\1B[30;47m\\f\1B[0m\00"
@.str.5 = [15 x i8] c"\1B[30;47m\\n\1B[0m\00"
@.str.6 = [15 x i8] c"\1B[30;47m\\r\1B[0m\00"
@.str.7 = [15 x i8] c"\1B[30;47m\\t\1B[0m\00"
@.str.8 = [15 x i8] c"\1B[30;47m\\v\1B[0m\00"
@.str.9 = [17 x i8] c"\1B[30;47m%02x\1B[0m\00"
define void @echo_chr(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = add i8 %0, -32
%4 = icmp ult i8 %3, 95
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %36
8: ; preds = %1
switch i8 %0, label %33 [
i8 7, label %9
i8 8, label %12
i8 27, label %15
i8 12, label %18
i8 10, label %21
i8 13, label %24
i8 9, label %27
i8 11, label %30
]
9: ; preds = %8
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %36
12: ; preds = %8
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %36
15: ; preds = %8
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %36
18: ; preds = %8
%19 = load i32, i32* @stderr
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %36
21: ; preds = %8
%22 = load i32, i32* @stderr
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
br label %36
24: ; preds = %8
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %36
27: ; preds = %8
%28 = load i32, i32* @stderr
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
br label %36
30: ; preds = %8
%31 = load i32, i32* @stderr
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
br label %36
33: ; preds = %8
%34 = load i32, i32* @stderr
%35 = tail call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i32 %2)
br label %36
36: ; preds = %9, %12, %15, %18, %21, %24, %27, %30, %33, %5
%37 = load i32, i32* @stderr
%38 = tail call i32 @fflush(i32 %37)
ret void
}