#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__ EOF;
int /*<<< orphan*/ printf(char *, char, ...);
int /*<<< orphan*/ putchar(char);
scalar_t__ scanf(char *, char *);
int main(void) {
  int i = 0;
  char ch;
  while (scanf("%c", &ch) != EOF) {
    if (ch < 32) {
      if (ch == '\n')
        printf("\\n %d\t", ch);
      else if (ch == '\t')
        printf("\\t %d\t", ch);
      else
        printf("^%c %d\t", ch + 64, ch);
    } else
      printf("%2c %d\t", ch, ch);
    if (i++ % 10 == 9)
      putchar('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x9(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e8b(%rip),%rcx
cmp    (%rcx),%rax
je     1224 <main+0xf4>
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
jge    11e1 <main+0xb1>
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    1197 <main+0x67>
lea    0xe7c(%rip),%rdi
movsbl -0x9(%rbp),%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11dc <main+0xac>
movsbl -0x9(%rbp),%eax
cmp    $0x9,%eax
jne    11bb <main+0x8b>
lea    0xe5f(%rip),%rdi
movsbl -0x9(%rbp),%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11d7 <main+0xa7>
movsbl -0x9(%rbp),%eax
add    $0x40,%eax
movsbl -0x9(%rbp),%edx
lea    0xe44(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11dc <main+0xac>
jmp    11f9 <main+0xc9>
mov    -0x9(%rbp),%al
movsbl -0x9(%rbp),%edx
lea    0xe2a(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%edx
jne    121f <main+0xef>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1146 <main+0x16>
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    0xebe(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e95(%rip),%r14
cmp    (%r14),%rax
jne    1169 <main+0x39>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x9,%r15d
lea    0xe8a(%rip),%r13
lea    0x7(%rsp),%rbx
xor    %ebp,%ebp
jmp    1197 <main+0x67>
nop
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
add    $0xffffffff,%r15d
add    $0x1,%ebp
cmp    (%r14),%rax
je     1158 <main+0x28>
mov    %ebp,%r12d
mov    $0xcccccccd,%eax
imul   %rax,%r12
shr    $0x23,%r12
movsbl 0x7(%rsp),%edx
cmp    $0x1f,%edx
jg     11d0 <main+0xa0>
cmp    $0x9,%dl
je     11db <main+0xab>
cmp    $0xa,%dl
jne    11f0 <main+0xc0>
lea    0xe41(%rip),%rdi
mov    $0xa,%esi
jmp    11e7 <main+0xb7>
nopl   0x0(%rax)
lea    0xe42(%rip),%rdi
mov    %edx,%esi
jmp    11fd <main+0xcd>
lea    0xe28(%rip),%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1204 <main+0xd4>
lea    0x40(%rdx),%eax
movsbl %al,%esi
lea    0xe14(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%r12,%r12,4),%eax
lea    (%r15,%rax,2),%eax
test   %eax,%eax
jne    1180 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1180 <main+0x50>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"\\n %d\09\00"
@.str.2 = [7 x i8] c"\\t %d\09\00"
@.str.3 = [8 x i8] c"^%c %d\09\00"
@.str.4 = [8 x i8] c"%2c %d\09\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %48, %0
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %49
8: ; preds = %4
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp slt i32 %10, 32
br i1 %11, label %12, label %36
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i8, i8* %3
%18 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %17)
br label %35
19: ; preds = %12
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 9
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i8, i8* %3
%25 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8 signext %24)
br label %34
26: ; preds = %19
%27 = load i8, i8* %3
%28 = sext i8 %27 to i32
%29 = add nsw i32 %28, 64
%30 = trunc i32 %29 to i8
%31 = load i8, i8* %3
%32 = sext i8 %31 to i32
%33 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8 signext %30, i32 %32)
br label %34
34: ; preds = %26, %23
br label %35
35: ; preds = %34, %16
br label %41
36: ; preds = %8
%37 = load i8, i8* %3
%38 = load i8, i8* %3
%39 = sext i8 %38 to i32
%40 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8 signext %37, i32 %39)
br label %41
41: ; preds = %36, %35
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 1
store i32 %43, i32* %2
%44 = srem i32 %42, 10
%45 = icmp eq i32 %44, 9
br i1 %45, label %46, label %48
46: ; preds = %41
%47 = call i32 @putchar(i8 signext 10)
br label %48
48: ; preds = %46, %41
br label %4
49: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"\\n %d\09\00"
@.str.2 = [7 x i8] c"\\t %d\09\00"
@.str.3 = [8 x i8] c"^%c %d\09\00"
@.str.4 = [8 x i8] c"%2c %d\09\00"
define i32 @main() {
%1 = alloca i8
%2 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i64, i64* @EOF
%4 = icmp eq i64 %2, %3
br i1 %4, label %30, label %5
5: ; preds = %0, %26
%6 = phi i32 [ %21, %26 ], [ 0, %0 ]
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = icmp slt i8 %7, 32
br i1 %9, label %10, label %18
10: ; preds = %5
switch i8 %7, label %15 [
i8 10, label %11
i8 9, label %13
]
11: ; preds = %10
%12 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext 10)
br label %20
13: ; preds = %10
%14 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8 signext 9)
br label %20
15: ; preds = %10
%16 = add nsw i8 %7, 64
%17 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8 signext %16, i32 %8)
br label %20
18: ; preds = %5
%19 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8 signext %7, i32 %8)
br label %20
20: ; preds = %11, %15, %13, %18
%21 = add nuw nsw i32 %6, 1
%22 = urem i32 %6, 10
%23 = icmp eq i32 %22, 9
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 @putchar(i8 signext 10)
br label %26
26: ; preds = %24, %20
%27 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%28 = load i64, i64* @EOF
%29 = icmp eq i64 %27, %28
br i1 %29, label %30, label %5
30: ; preds = %26, %0
ret i32 0
}