#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*/ putchar(int);
main() {
  int c, nb, nt, pos;
  nb = 0;
  nt = 0;
  for (pos = 1; (c = getchar()) != EOF; ++pos)
    if (c == ' ') {
      if (pos % 8 != 0)
        ++nb;
      else {
        nb = 0;
        ++nt;
      }
    } else {
      for (; nt > 0; --nt)
        putchar('\t');
      if (c = '\t')
        nb = 0;
      else
        for (; nb > 0; --nb)
          putchar(' ');
      putchar(c);
      if (c == '\n')
        pos = 0;
      else if (c == '\t')
        pos = pos + (8 - (pos - 1) % 8) - 1;
    }
}


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)
movl   $0x1,-0x14(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
je     127e <main+0x15e>
cmpl   $0x20,-0x8(%rbp)
jne    119e <main+0x7e>
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1189 <main+0x69>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1199 <main+0x79>
movl   $0x0,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    126b <main+0x14b>
jmp    11a3 <main+0x83>
cmpl   $0x0,-0x10(%rbp)
jle    11c5 <main+0xa5>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    11a3 <main+0x83>
movl   $0x9,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    11db <main+0xbb>
jmp    11e7 <main+0xc7>
movl   $0x0,-0xc(%rbp)
jmp    1213 <main+0xf3>
jmp    11ec <main+0xcc>
cmpl   $0x0,-0xc(%rbp)
jle    120e <main+0xee>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11ec <main+0xcc>
jmp    1213 <main+0xf3>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
cmpl   $0xa,-0x8(%rbp)
jne    1231 <main+0x111>
movl   $0x0,-0x14(%rbp)
jmp    1266 <main+0x146>
cmpl   $0x9,-0x8(%rbp)
jne    1261 <main+0x141>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
mov    $0x8,%ecx
sub    %edx,%ecx
add    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1266 <main+0x146>
jmp    126b <main+0x14b>
jmp    1270 <main+0x150>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
jne    113e <main+0x1e>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0x1,%ebx
xor    %ebp,%ebp
jmp    116a <main+0x4a>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%eax
and    $0x7,%eax
cmp    $0x1,%eax
adc    $0x0,%ebp
add    $0x1,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
je     1137 <main+0x17>
cmp    $0x20,%eax
je     1150 <main+0x30>
test   %ebp,%ebp
jle    1194 <main+0x74>
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1180 <main+0x60>
xor    %ebp,%ebp
mov    $0x9,%edi
call   1030 <putchar@plt>
lea    -0x1(%rbx),%eax
add    $0x6,%ebx
test   %eax,%eax
cmovns %eax,%ebx
and    $0xfffffff8,%ebx
add    $0x8,%ebx
jmp    115b <main+0x3b>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %65, %0
%7 = call i32 (...) @getchar()
store i32 %7, i32* %2
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %68
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 32
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = load i32, i32* %5
%15 = srem i32 %14, 8
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %23
20: ; preds = %13
store i32 0, i32* %3
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %23
23: ; preds = %20, %17
br label %64
24: ; preds = %10
br label %25
25: ; preds = %30, %24
%26 = load i32, i32* %4
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = call i32 @putchar(i32 9)
br label %30
30: ; preds = %28
%31 = load i32, i32* %4
%32 = add nsw i32 %31, -1
store i32 %32, i32* %4
br label %25
33: ; preds = %25
store i32 9, i32* %2
br i1 true, label %34, label %35
34: ; preds = %33
store i32 0, i32* %3
br label %45
35: ; preds = %33
br label %36
36: ; preds = %41, %35
%37 = load i32, i32* %3
%38 = icmp sgt i32 %37, 0
br i1 %38, label %39, label %44
39: ; preds = %36
%40 = call i32 @putchar(i32 32)
br label %41
41: ; preds = %39
%42 = load i32, i32* %3
%43 = add nsw i32 %42, -1
store i32 %43, i32* %3
br label %36
44: ; preds = %36
br label %45
45: ; preds = %44, %34
%46 = load i32, i32* %2
%47 = call i32 @putchar(i32 %46)
%48 = load i32, i32* %2
%49 = icmp eq i32 %48, 10
br i1 %49, label %50, label %51
50: ; preds = %45
store i32 0, i32* %5
br label %63
51: ; preds = %45
%52 = load i32, i32* %2
%53 = icmp eq i32 %52, 9
br i1 %53, label %54, label %62
54: ; preds = %51
%55 = load i32, i32* %5
%56 = load i32, i32* %5
%57 = sub nsw i32 %56, 1
%58 = srem i32 %57, 8
%59 = sub nsw i32 8, %58
%60 = add nsw i32 %55, %59
%61 = sub nsw i32 %60, 1
store i32 %61, i32* %5
br label %62
62: ; preds = %54, %51
br label %63
63: ; preds = %62, %50
br label %64
64: ; preds = %63, %23
br label %65
65: ; preds = %64
%66 = load i32, i32* %5
%67 = add nsw i32 %66, 1
store i32 %67, i32* %5
br label %6
68: ; preds = %6
%69 = load i32, i32* %1
ret i32 %69
}

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 %35, label %4
4: ; preds = %0, %28
%5 = phi i32 [ %32, %28 ], [ %1, %0 ]
%6 = phi i32 [ %31, %28 ], [ 1, %0 ]
%7 = phi i32 [ %29, %28 ], [ 0, %0 ]
%8 = icmp eq i32 %5, 32
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = icmp sgt i32 %7, 0
br i1 %10, label %16, label %21
11: ; preds = %4
%12 = and i32 %6, 7
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = add nsw i32 %7, %14
br label %28
16: ; preds = %9, %16
%17 = phi i32 [ %19, %16 ], [ %7, %9 ]
%18 = tail call i32 @putchar(i32 9)
%19 = add nsw i32 %17, -1
%20 = icmp ugt i32 %17, 1
br i1 %20, label %16, label %21
21: ; preds = %16, %9
%22 = phi i32 [ %7, %9 ], [ 0, %16 ]
%23 = tail call i32 @putchar(i32 9)
%24 = add nsw i32 %6, -1
%25 = srem i32 %24, 8
%26 = add i32 %6, 7
%27 = sub i32 %26, %25
br label %28
28: ; preds = %11, %21
%29 = phi i32 [ %22, %21 ], [ %15, %11 ]
%30 = phi i32 [ %27, %21 ], [ %6, %11 ]
%31 = add nsw i32 %30, 1
%32 = tail call i32 (...) @getchar()
%33 = load i32, i32* @EOF
%34 = icmp eq i32 %32, %33
br i1 %34, label %35, label %4
35: ; preds = %28, %0
ret i32 0
}