#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 *, ...);
int putesc(char c) {
  switch (c) {
  case ' ':
    printf("\\ ");
    break;
  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;
  case '\\':
    printf("\\\\");
    break;
  case '\'':
    printf("\\\'");
    break;
  case '\"':
    printf("\\\"");
    break;
  case '\?':
    printf("\\\?");
    break;
  default:
    printf(" %c", c);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<putesc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xfffffff9,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x55,%eax
ja     122c <putesc+0x11c>
mov    -0x10(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1009(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <putesc+0x12e>
lea    0xff9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <putesc+0x12e>
lea    0xfe9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <putesc+0x12e>
lea    0xfd9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <putesc+0x12e>
lea    0xfc9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <putesc+0x12e>
lea    0xfb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <putesc+0x12e>
lea    0xfa9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <putesc+0x12e>
lea    0xf99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <putesc+0x12e>
lea    0xf89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <putesc+0x12e>
lea    0xf79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <putesc+0x12e>
lea    0xf69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <putesc+0x12e>
lea    0xf59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <putesc+0x12e>
movsbl -0x1(%rbp),%esi
lea    0xf45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putesc>:
push   %rax
mov    %edi,%esi
lea    -0x7(%rsi),%eax
cmp    $0x55,%eax
ja     116a <putesc+0x5a>
lea    0xede(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1029(%rip),%rdi
jmp    11a5 <putesc+0x95>
lea    0x1023(%rip),%rdi
jmp    11a5 <putesc+0x95>
lea    0x1026(%rip),%rdi
jmp    11a5 <putesc+0x95>
lea    0x1017(%rip),%rdi
jmp    11a5 <putesc+0x95>
lea    0x1017(%rip),%rdi
jmp    11a5 <putesc+0x95>
lea    0x1002(%rip),%rdi
jmp    11a5 <putesc+0x95>
lea    0xfff(%rip),%rdi
jmp    11a5 <putesc+0x95>
lea    0x100b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11ac <putesc+0x9c>
lea    0xfd7(%rip),%rdi
jmp    11a5 <putesc+0x95>
lea    0xfec(%rip),%rdi
jmp    11a5 <putesc+0x95>
lea    0xfe0(%rip),%rdi
jmp    11a5 <putesc+0x95>
lea    0xfdd(%rip),%rdi
jmp    11a5 <putesc+0x95>
lea    0xfcb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"\\ \00"
@.str.1 = [3 x i8] c"\\a\00"
@.str.2 = [3 x i8] c"\\b\00"
@.str.3 = [3 x i8] c"\\f\00"
@.str.4 = [3 x i8] c"\\n\00"
@.str.5 = [3 x i8] c"\\r\00"
@.str.6 = [3 x i8] c"\\t\00"
@.str.7 = [3 x i8] c"\\v\00"
@.str.8 = [3 x i8] c"\\\\\00"
@.str.9 = [3 x i8] c"\\'\00"
@.str.10 = [3 x i8] c"\\\22\00"
@.str.11 = [3 x i8] c"\\?\00"
@.str.12 = [4 x i8] c" %c\00"
define i32 @putesc(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %27 [
i32 32, label %3
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
i32 92, label %19
i32 39, label %21
i32 34, label %23
i32 63, label %25
]
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %29
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %29
7: ; preds = %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %29
9: ; preds = %1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %29
11: ; preds = %1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %29
13: ; preds = %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %29
15: ; preds = %1
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %29
17: ; preds = %1
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %29
19: ; preds = %1
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %29
21: ; preds = %1
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %29
23: ; preds = %1
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %29
25: ; preds = %1
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %29
27: ; preds = %1
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %2)
br label %29
29: ; preds = %27, %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5, %3
ret i32 0
}