#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 */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int main() {
  register char c;
  puts("{\\tt");
  puts("\\noindent");
  while ((c = getchar()) != EOF) {
    switch (c) {
    case ' ':
      printf("{\\kern0.500em}");
      break;
    case '\t':
      printf("{\\kern4.000em}");
      break;
    case '\n':
      puts("\\hfill\n");
      puts("\\noindent");
      break;
    case '\\':
    case '$':
    case '&':
    case '{':
    case '}':
    case '#':
    case '~':
    case '`':
    case '_':
    case '^':
    case '"':
    case '%':
      printf("{\\char%d}", c);
      break;
    default:
      putchar(c);
      break;
    }
  }
  puts("}");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0x1082(%rip),%rdi
call   1040 <puts@plt>
lea    0x107b(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e6d(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1218 <main+0xd8>
movsbl -0x5(%rbp),%eax
add    $0xfffffff7,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x75,%eax
ja     120a <main+0xca>
mov    -0x10(%rbp),%rax
lea    0xe59(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1030(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1213 <main+0xd3>
lea    0x102c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1213 <main+0xd3>
lea    0x1028(%rip),%rdi
call   1040 <puts@plt>
lea    0xff4(%rip),%rdi
call   1040 <puts@plt>
jmp    1213 <main+0xd3>
movsbl -0x5(%rbp),%esi
lea    0x100f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1213 <main+0xd3>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    1167 <main+0x27>
lea    0xff6(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0x1086(%rip),%rdi
call   1040 <puts@plt>
lea    0x107f(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x2e77(%rip),%rbp
cmp    0x0(%rbp),%al
jne    1193 <main+0x53>
lea    0x1098(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe66(%rip),%r14
lea    0x1064(%rip),%r15
lea    0x1035(%rip),%r12
lea    0x1038(%rip),%r13
lea    0x1057(%rip),%rbx
jmp    11d6 <main+0x96>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    0x0(%rbp),%al
je     1176 <main+0x36>
movsbl %al,%esi
lea    -0x9(%rsi),%eax
cmp    $0x75,%eax
ja     1205 <main+0xc5>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
lea    0x1005(%rip),%rdi
jmp    1211 <main+0xd1>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
jmp    11ca <main+0x8a>
mov    %esi,%edi
call   1030 <putchar@plt>
jmp    11ca <main+0x8a>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11ca <main+0x8a>

LLVM IR (-O0):
@.str = [5 x i8] c"{\\tt\00"
@.str.1 = [10 x i8] c"\\noindent\00"
@EOF = global i8 0
@.str.2 = [15 x i8] c"{\\kern0.500em}\00"
@.str.3 = [15 x i8] c"{\\kern4.000em}\00"
@.str.4 = [8 x i8] c"\\hfill\0A\00"
@.str.5 = [10 x i8] c"{\\char%d}\00"
@.str.6 = [2 x i8] c"}\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %28, %0
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %2
%7 = sext i8 %6 to i32
%8 = load i8, i8* @EOF
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %7, %9
br i1 %10, label %11, label %29
11: ; preds = %5
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
switch i32 %13, label %25 [
i32 32, label %14
i32 9, label %16
i32 10, label %18
i32 92, label %21
i32 36, label %21
i32 38, label %21
i32 123, label %21
i32 125, label %21
i32 35, label %21
i32 126, label %21
i32 96, label %21
i32 95, label %21
i32 94, label %21
i32 34, label %21
i32 37, label %21
]
14: ; preds = %11
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %28
16: ; preds = %11
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %28
18: ; preds = %11
%19 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %28
21: ; preds = %11, %11, %11, %11, %11, %11, %11, %11, %11, %11, %11, %11
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %23)
br label %28
25: ; preds = %11
%26 = load i8, i8* %2
%27 = call i32 @putchar(i8 signext %26)
br label %28
28: ; preds = %25, %21, %18, %16, %14
br label %5
29: ; preds = %5
%30 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"{\\tt\00"
@.str.1 = [10 x i8] c"\\noindent\00"
@EOF = global i8 0
@.str.2 = [15 x i8] c"{\\kern0.500em}\00"
@.str.3 = [15 x i8] c"{\\kern4.000em}\00"
@.str.4 = [8 x i8] c"\\hfill\0A\00"
@.str.5 = [10 x i8] c"{\\char%d}\00"
@.str.6 = [2 x i8] c"}\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call signext i8 (...) @getchar()
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
br i1 %5, label %24, label %6
6: ; preds = %0, %20
%7 = phi i8 [ %21, %20 ], [ %3, %0 ]
%8 = sext i8 %7 to i32
switch i32 %8, label %18 [
i32 32, label %9
i32 9, label %11
i32 10, label %13
i32 92, label %16
i32 36, label %16
i32 38, label %16
i32 123, label %16
i32 125, label %16
i32 35, label %16
i32 126, label %16
i32 96, label %16
i32 95, label %16
i32 94, label %16
i32 34, label %16
i32 37, label %16
]
9: ; preds = %6
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %20
11: ; preds = %6
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %20
13: ; preds = %6
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %20
16: ; preds = %6, %6, %6, %6, %6, %6, %6, %6, %6, %6, %6, %6
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %8)
br label %20
18: ; preds = %6
%19 = tail call i32 @putchar(i8 signext %7)
br label %20
20: ; preds = %18, %16, %13, %11, %9
%21 = tail call signext i8 (...) @getchar()
%22 = load i8, i8* @EOF
%23 = icmp eq i8 %21, %22
br i1 %23, label %24, label %6
24: ; preds = %20, %0
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}