#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 EOF;
int getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(int);
int main(void) {
  int cur_char;
  int blank_num, tab_num;
  int blank_index, tab_index;
  blank_num = 0;
  tab_num = 0;
  while ((cur_char = getchar()) != EOF) {
    if (cur_char == ' ') {
      blank_num = blank_num + 1;
    } else if (cur_char == '\t') {
      tab_num = tab_num + 1;
    } else {
      if (cur_char != '\n') {
        for (blank_index = 0; blank_index < blank_num; blank_index++) {
          putchar(' ');
        }
        for (tab_index = 0; tab_index < tab_num; tab_index++) {
          putchar('\t');
        }
        putchar(cur_char);
      } else {
        printf("\\n");
        printf("\n");
      }
      blank_num = 0;
      tab_num = 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%eax
je     1233 <main+0x103>
cmpl   $0x20,-0x8(%rbp)
jne    117e <main+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    122e <main+0xfe>
cmpl   $0x9,-0x8(%rbp)
jne    1196 <main+0x66>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1229 <main+0xf9>
cmpl   $0xa,-0x8(%rbp)
je     1203 <main+0xd3>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11cb <main+0x9b>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a7 <main+0x77>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11f6 <main+0xc6>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11d2 <main+0xa2>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    121b <main+0xeb>
lea    0xdf6(%rip),%rdi
call   1040 <printf@plt>
lea    0xded(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    122e <main+0xfe>
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea2(%rip),%r15
cmp    (%r15),%eax
jne    1156 <main+0x26>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%r12d
lea    0xea0(%rip),%r14
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    1195 <main+0x65>
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%r12d
cmp    (%r15),%eax
je     114b <main+0x1b>
cmp    $0x9,%r12d
je     11b0 <main+0x80>
cmp    $0xa,%r12d
je     1170 <main+0x40>
cmp    $0x20,%r12d
jne    11c0 <main+0x90>
add    $0x1,%ebp
jmp    1186 <main+0x56>
nopl   0x0(%rax)
add    $0x1,%ebx
jmp    1186 <main+0x56>
cs nopw 0x0(%rax,%rax,1)
nop
test   %ebp,%ebp
jle    11df <main+0xaf>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11d0 <main+0xa0>
test   %ebx,%ebx
jle    11ff <main+0xcf>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11f0 <main+0xc0>
mov    %r12d,%edi
jmp    117d <main+0x4d>

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [3 x i8] c"\\n\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %37, label %4
4: ; preds = %0, %31
%5 = phi i32 [ %34, %31 ], [ %1, %0 ]
%6 = phi i32 [ %33, %31 ], [ 0, %0 ]
%7 = phi i32 [ %32, %31 ], [ 0, %0 ]
switch i32 %5, label %8 [
i32 32, label %10
i32 9, label %12
i32 10, label %28
]
8: ; preds = %4
%9 = icmp sgt i32 %7, 0
br i1 %9, label %16, label %14
10: ; preds = %4
%11 = add nsw i32 %7, 1
br label %31
12: ; preds = %4
%13 = add nsw i32 %6, 1
br label %31
14: ; preds = %16, %8
%15 = icmp sgt i32 %6, 0
br i1 %15, label %21, label %26
16: ; preds = %8, %16
%17 = phi i32 [ %19, %16 ], [ 0, %8 ]
%18 = tail call i32 @putchar(i32 32)
%19 = add nuw nsw i32 %17, 1
%20 = icmp eq i32 %19, %7
br i1 %20, label %14, label %16
21: ; preds = %14, %21
%22 = phi i32 [ %24, %21 ], [ 0, %14 ]
%23 = tail call i32 @putchar(i32 9)
%24 = add nuw nsw i32 %22, 1
%25 = icmp eq i32 %24, %6
br i1 %25, label %26, label %21
26: ; preds = %21, %14
%27 = tail call i32 @putchar(i32 %5)
br label %31
28: ; preds = %4
%29 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%30 = tail call i32 @putchar(i32 10)
br label %31
31: ; preds = %26, %28, %12, %10
%32 = phi i32 [ %11, %10 ], [ %7, %12 ], [ 0, %28 ], [ 0, %26 ]
%33 = phi i32 [ %6, %10 ], [ %13, %12 ], [ 0, %28 ], [ 0, %26 ]
%34 = tail call i32 (...) @getchar()
%35 = load i32, i32* @EOF
%36 = icmp eq i32 %34, %35
br i1 %36, label %37, label %4
37: ; preds = %31, %0
ret i32 0
}