#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 CHAR_MAX;
int /*<<< orphan*/ isprint(int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int i;
  for (i = 0; i <= CHAR_MAX; i++) {
    switch (i) {
    case '\a':
      printf("\\a");
      break;
    case '\b':
      printf("\\b");
      break;
    case '\f':
      printf("\\f");
      break;
    case '\n':
      printf("\\n");
      break;
    case '\r':
      printf("\\r");
      break;
    case '\t':
      printf("\\t");
      break;
    case '\v':
      printf("\\v");
      break;
    default:
      printf(" %c", isprint(i) ? i : ' ');
    }
    printf(" %02x\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
jg     124f <main+0x12f>
mov    -0x8(%rbp),%eax
add    $0xfffffff9,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x6,%eax
ja     11f6 <main+0xd6>
mov    -0x10(%rbp),%rax
lea    0xe98(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1230 <main+0x110>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1230 <main+0x110>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1230 <main+0x110>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1230 <main+0x110>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1230 <main+0x110>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1230 <main+0x110>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1230 <main+0x110>
mov    -0x8(%rbp),%edi
call   1040 <isprint@plt>
cmp    $0x0,%eax
je     1212 <main+0xf2>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    121f <main+0xff>
mov    $0x20,%eax
mov    %eax,-0x14(%rbp)
jmp    121f <main+0xff>
mov    -0x14(%rbp),%esi
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2eb6(%rip),%r13
cmpl   $0x0,0x0(%r13)
js     11f7 <main+0xd7>
mov    $0xffffffff,%ebp
lea    0xeec(%rip),%rbx
lea    0xeb0(%rip),%r12
lea    0xece(%rip),%r14
lea    0xed0(%rip),%r15
jmp    1189 <main+0x69>
mov    %r15,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    0x0(%r13),%ebp
jge    11f7 <main+0xd7>
mov    %ebp,%eax
lea    0x1(%rax),%ebp
add    $0xfffffffa,%eax
cmp    $0x6,%eax
ja     11b6 <main+0x96>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
lea    0xe76(%rip),%rdi
jmp    1170 <main+0x50>
lea    0xe7c(%rip),%rdi
jmp    1170 <main+0x50>
mov    %r14,%rdi
jmp    1170 <main+0x50>
mov    %ebp,%edi
call   1040 <isprint@plt>
test   %eax,%eax
mov    %ebp,%esi
mov    $0x20,%eax
cmove  %eax,%esi
lea    0xe61(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1177 <main+0x57>
lea    0xe3f(%rip),%rdi
jmp    1170 <main+0x50>
lea    0xe39(%rip),%rdi
jmp    1170 <main+0x50>
lea    0xe36(%rip),%rdi
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@CHAR_MAX = global i32 0
@.str = [3 x i8] c"\\a\00"
@.str.1 = [3 x i8] c"\\b\00"
@.str.2 = [3 x i8] c"\\f\00"
@.str.3 = [3 x i8] c"\\n\00"
@.str.4 = [3 x i8] c"\\r\00"
@.str.5 = [3 x i8] c"\\t\00"
@.str.6 = [3 x i8] c"\\v\00"
@.str.7 = [4 x i8] c" %c\00"
@.str.8 = [7 x i8] c" %02x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %36, %0
%4 = load i32, i32* %2
%5 = load i32, i32* @CHAR_MAX
%6 = icmp sle i32 %4, %5
br i1 %6, label %7, label %39
7: ; preds = %3
%8 = load i32, i32* %2
switch i32 %8, label %23 [
i32 7, label %9
i32 8, label %11
i32 12, label %13
i32 10, label %15
i32 13, label %17
i32 9, label %19
i32 11, label %21
]
9: ; preds = %7
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %33
11: ; preds = %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %33
13: ; preds = %7
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %33
15: ; preds = %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %33
17: ; preds = %7
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %33
19: ; preds = %7
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %33
21: ; preds = %7
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %33
23: ; preds = %7
%24 = load i32, i32* %2
%25 = call i32 @isprint(i32 %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = load i32, i32* %2
br label %30
29: ; preds = %23
br label %30
30: ; preds = %29, %27
%31 = phi i32 [ %28, %27 ], [ 32, %29 ]
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %30, %21, %19, %17, %15, %13, %11, %9
%34 = load i32, i32* %2
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %33
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
br label %3
39: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@CHAR_MAX = global i32 0
@.str = [3 x i8] c"\\a\00"
@.str.1 = [3 x i8] c"\\b\00"
@.str.2 = [3 x i8] c"\\f\00"
@.str.3 = [3 x i8] c"\\n\00"
@.str.4 = [3 x i8] c"\\r\00"
@.str.5 = [3 x i8] c"\\t\00"
@.str.6 = [3 x i8] c"\\v\00"
@.str.7 = [4 x i8] c" %c\00"
@.str.8 = [7 x i8] c" %02x\0A\00"
define i32 @main() {
%1 = load i32, i32* @CHAR_MAX
%2 = icmp slt i32 %1, 0
br i1 %2, label %29, label %3
3: ; preds = %0, %24
%4 = phi i32 [ %26, %24 ], [ 0, %0 ]
switch i32 %4, label %19 [
i32 7, label %5
i32 8, label %7
i32 12, label %9
i32 10, label %11
i32 13, label %13
i32 9, label %15
i32 11, label %17
]
5: ; preds = %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %24
7: ; preds = %3
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %24
9: ; preds = %3
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %24
11: ; preds = %3
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %24
13: ; preds = %3
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %24
15: ; preds = %3
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %24
17: ; preds = %3
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %24
19: ; preds = %3
%20 = tail call i32 @isprint(i32 %4)
%21 = icmp eq i32 %20, 0
%22 = select i1 %21, i32 32, i32 %4
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %19, %17, %15, %13, %11, %9, %7, %5
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %4)
%26 = add nuw nsw i32 %4, 1
%27 = load i32, i32* @CHAR_MAX
%28 = icmp slt i32 %4, %27
br i1 %28, label %3, label %29
29: ; preds = %24, %0
ret i32 0
}