#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*/ print_blank_with_tab(int, int, int);
int /*<<< orphan*/ putchar(int);
int main(void) {
  int cur_char;
  int cur_blanks_length;
  int cur_line_length;
  cur_blanks_length = 0;
  cur_line_length = 0;
  while ((cur_char = getchar()) != EOF) {
    if (cur_char == ' ') {
      cur_blanks_length++;
      cur_line_length++;
    } else {
      if (cur_char != '\n') {
        print_blank_with_tab(cur_line_length, cur_blanks_length, 8);
      } else {
        cur_line_length = 0;
      }
      putchar(cur_char);
      cur_blanks_length = 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%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     11c1 <main+0x91>
cmpl   $0x20,-0x8(%rbp)
jne    1187 <main+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11bc <main+0x8c>
cmpl   $0xa,-0x8(%rbp)
je     11a6 <main+0x76>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x8,%edx
call   1040 <print_blank_with_tab@plt>
jmp    11ad <main+0x7d>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
movl   $0x0,-0xc(%rbp)
jmp    114d <main+0x1d>
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
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e9f(%rip),%r15
cmp    (%r15),%eax
jne    115f <main+0x2f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebp
xor    %r13d,%r13d
xor    %r14d,%r14d
xor    %r12d,%r12d
jmp    119e <main+0x6e>
nopl   0x0(%rax)
mov    %r13d,%edi
mov    %r14d,%esi
mov    $0x8,%edx
call   1040 <print_blank_with_tab@plt>
mov    %r13d,%ebx
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %ebx,%r13d
mov    %r12d,%r14d
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebp
cmp    (%r15),%eax
je     114e <main+0x1e>
mov    $0x0,%ebx
cmp    $0xa,%ebp
je     1183 <main+0x53>
cmp    $0x20,%ebp
jne    1170 <main+0x40>
add    $0x1,%r14d
add    $0x1,%r13d
jmp    1190 <main+0x60>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %28, %0
%6 = call i32 (...) @getchar()
store i32 %6, i32* %2
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %29
9: ; preds = %5
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %28
17: ; preds = %9
%18 = load i32, i32* %2
%19 = icmp ne i32 %18, 10
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %4
%22 = load i32, i32* %3
%23 = call i32 @print_blank_with_tab(i32 %21, i32 %22, i32 8)
br label %25
24: ; preds = %17
store i32 0, i32* %4
br label %25
25: ; preds = %24, %20
%26 = load i32, i32* %2
%27 = call i32 @putchar(i32 %26)
store i32 0, i32* %3
br label %28
28: ; preds = %25, %12
br label %5
29: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %22, label %4
4: ; preds = %0, %16
%5 = phi i32 [ %19, %16 ], [ %1, %0 ]
%6 = phi i32 [ %18, %16 ], [ 0, %0 ]
%7 = phi i32 [ %17, %16 ], [ 0, %0 ]
switch i32 %5, label %11 [
i32 32, label %8
i32 10, label %13
]
8: ; preds = %4
%9 = add nsw i32 %7, 1
%10 = add nsw i32 %6, 1
br label %16
11: ; preds = %4
%12 = tail call i32 @print_blank_with_tab(i32 %6, i32 %7, i32 8)
br label %13
13: ; preds = %4, %11
%14 = phi i32 [ %6, %11 ], [ 0, %4 ]
%15 = tail call i32 @putchar(i32 %5)
br label %16
16: ; preds = %13, %8
%17 = phi i32 [ %9, %8 ], [ 0, %13 ]
%18 = phi i32 [ %10, %8 ], [ %14, %13 ]
%19 = tail call i32 (...) @getchar()
%20 = load i32, i32* @EOF
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %4
22: ; preds = %16, %0
ret i32 0
}