#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 */
scalar_t__ isspace(char);
char *char_to_string(char c) {
  static char buffer[5];
  if (c == ' ') {
    buffer[0] = '\\';
    buffer[1] = 'x';
    buffer[2] = '2';
    buffer[3] = '0';
    buffer[4] = '\0';
  } else if (isspace(c)) {
    switch (c) {
    case '\n':
      buffer[1] = 'n';
      break;
    case '\f':
      buffer[1] = 'n';
      break;
    case '\r':
      buffer[1] = 'r';
      break;
    case '\t':
      buffer[1] = 't';
      break;
    case '\v':
      buffer[1] = 'v';
      break;
    }
    buffer[0] = '\\';
    buffer[2] = '\0';
  } else if (c == '\0') {
    buffer[0] = '\0';
  } else {
    buffer[0] = c;
    buffer[1] = '\0';
  }
  return buffer;
}


x86 assembly (clang, -O0):
<char_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jne    1153 <char_to_string+0x43>
movb   $0x5c,0x2ef7(%rip)
movb   $0x78,0x2ef1(%rip)
movb   $0x32,0x2eeb(%rip)
movb   $0x30,0x2ee5(%rip)
movb   $0x0,0x2edf(%rip)
jmp    120d <char_to_string+0xfd>
movsbl -0x1(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     11da <char_to_string+0xca>
movsbl -0x1(%rbp),%eax
add    $0xfffffff7,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     11c7 <char_to_string+0xb7>
mov    -0x10(%rbp),%rax
lea    0xe79(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x6e,0x2e93(%rip)
jmp    11c7 <char_to_string+0xb7>
movb   $0x6e,0x2e87(%rip)
jmp    11c7 <char_to_string+0xb7>
movb   $0x72,0x2e7b(%rip)
jmp    11c7 <char_to_string+0xb7>
movb   $0x74,0x2e6f(%rip)
jmp    11c7 <char_to_string+0xb7>
movb   $0x76,0x2e63(%rip)
movb   $0x5c,0x2e5b(%rip)
movb   $0x0,0x2e56(%rip)
jmp    1208 <char_to_string+0xf8>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    11f3 <char_to_string+0xe3>
movb   $0x0,0x2e3b(%rip)
jmp    1203 <char_to_string+0xf3>
mov    -0x1(%rbp),%al
mov    %al,0x2e2d(%rip)
movb   $0x0,0x2e27(%rip)
jmp    1208 <char_to_string+0xf8>
jmp    120d <char_to_string+0xfd>
lea    0x2e15(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_string>:
push   %rbx
mov    %edi,%ebx
cmp    $0x20,%bl
jne    112b <char_to_string+0x1b>
movl   $0x3032785c,0x2f07(%rip)
78 32 30
lea    0x2f04(%rip),%rax
jmp    1182 <char_to_string+0x72>
movsbl %bl,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1168 <char_to_string+0x58>
add    $0xfffffff7,%ebx
cmp    $0x4,%ebx
ja     1158 <char_to_string+0x48>
shl    $0x3,%ebx
movabs $0x726e766e74,%rax
mov    %ebx,%ecx
shr    %cl,%rax
mov    %al,0x2ed2(%rip)
movb   $0x5c,0x2eca(%rip)
lea    0x2ec5(%rip),%rax
jmp    1182 <char_to_string+0x72>
test   %bl,%bl
je     117b <char_to_string+0x6b>
mov    %bl,0x2eb7(%rip)
lea    0x2eb1(%rip),%rax
jmp    1182 <char_to_string+0x72>
lea    0x2ea7(%rip),%rax
movb   $0x0,(%rax)
lea    0x2e9d(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@char_to_string.buffer = internal global [5 x i8] zeroinitializer
define i8* @char_to_string(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, 32
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 92, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 0)
store i8 120, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 1)
store i8 50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 2)
store i8 48, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 3)
store i8 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 4)
br label %29
7: ; preds = %1
%8 = load i8, i8* %2
%9 = call i64 @isspace(i8 signext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
switch i32 %13, label %19 [
i32 10, label %14
i32 12, label %15
i32 13, label %16
i32 9, label %17
i32 11, label %18
]
14: ; preds = %11
store i8 110, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 1)
br label %19
15: ; preds = %11
store i8 110, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 1)
br label %19
16: ; preds = %11
store i8 114, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 1)
br label %19
17: ; preds = %11
store i8 116, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 1)
br label %19
18: ; preds = %11
store i8 118, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 1)
br label %19
19: ; preds = %11, %18, %17, %16, %15, %14
store i8 92, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 2)
br label %28
20: ; preds = %7
%21 = load i8, i8* %2
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %20
store i8 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 0)
br label %27
25: ; preds = %20
%26 = load i8, i8* %2
store i8 %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 1)
br label %27
27: ; preds = %25, %24
br label %28
28: ; preds = %27, %19
br label %29
29: ; preds = %28, %6
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@char_to_string.buffer = internal global [5 x i8] zeroinitializer
define i8* @char_to_string(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp eq i8 %0, 32
br i1 %3, label %4, label %5
4: ; preds = %1
store i8 92, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 0)
store i8 120, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 1)
store i8 50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 2)
store i8 48, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 3)
br label %20
5: ; preds = %1
%6 = tail call i64 @isspace(i8 signext %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %5
%9 = add nsw i32 %2, -9
%10 = icmp ult i32 %9, 5
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = zext i32 %9 to i40
%13 = shl nuw nsw i40 %12, 3
%14 = lshr i40 491479527028, %13
%15 = trunc i40 %14 to i8
store i8 %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 1)
br label %16
16: ; preds = %8, %11
store i8 92, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 0)
br label %20
17: ; preds = %5
%18 = icmp eq i8 %0, 0
br i1 %18, label %20, label %19
19: ; preds = %17
store i8 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 0)
br label %20
20: ; preds = %17, %16, %19, %4
%21 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 2), %16 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 1), %19 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 4), %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 0), %17 ]
store i8 0, i8* %21
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @char_to_string.buffer, i64 0, i64 0)
}