#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);
int main() {
  int c, wsl = 0;
  while ((c = getchar()) != EOF) {
    if (c != ' ') {
      for (int i = 0; i < wsl / 4; ++i)
        putchar('\t');
      for (int i = 0; i < wsl % 4; ++i)
        putchar(' ');
      wsl = 0;
      putchar(c);
    } else {
      ++wsl;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     11f3 <main+0xd3>
cmpl   $0x20,-0x8(%rbp)
je     11e5 <main+0xc5>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1196 <main+0x76>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <main+0x40>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%eax
cmp    %edx,%eax
jge    11d1 <main+0xb1>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119d <main+0x7d>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    11ee <main+0xce>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
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   1040 <getchar@plt>
mov    0x2eb2(%rip),%r14
cmp    (%r14),%eax
jne    1146 <main+0x26>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%r15d
xor    %r12d,%r12d
jmp    1163 <main+0x43>
xchg   %ax,%ax
add    $0x1,%r12d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%r15d
cmp    (%r14),%eax
je     113b <main+0x1b>
cmp    $0x20,%r15d
je     1150 <main+0x30>
lea    0x3(%r12),%ebx
test   %r12d,%r12d
cmovns %r12d,%ebx
mov    %ebx,%eax
and    $0xfffffffc,%eax
mov    %r12d,%ebp
sub    %eax,%ebp
cmp    $0x4,%r12d
jl     119f <main+0x7f>
sar    $0x2,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1190 <main+0x70>
test   %ebp,%ebp
jle    11bf <main+0x9f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11b0 <main+0x90>
mov    %r15d,%edi
call   1030 <putchar@plt>
xor    %r12d,%r12d
jmp    1154 <main+0x34>

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
br label %6
6: ; preds = %41, %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 %42
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 32
br i1 %12, label %13, label %38
13: ; preds = %10
store i32 0, i32* %4
br label %14
14: ; preds = %21, %13
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = sdiv i32 %16, 4
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %24
19: ; preds = %14
%20 = call i32 @putchar(i32 9)
br label %21
21: ; preds = %19
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %14
24: ; preds = %14
store i32 0, i32* %5
br label %25
25: ; preds = %32, %24
%26 = load i32, i32* %5
%27 = load i32, i32* %3
%28 = srem i32 %27, 4
%29 = icmp slt i32 %26, %28
br i1 %29, label %30, label %35
30: ; preds = %25
%31 = call i32 @putchar(i32 32)
br label %32
32: ; preds = %30
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %25
35: ; preds = %25
store i32 0, i32* %3
%36 = load i32, i32* %2
%37 = call i32 @putchar(i32 %36)
br label %41
38: ; preds = %10
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %41
41: ; preds = %38, %35
br label %6
42: ; preds = %6
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 %33, label %4
4: ; preds = %0, %28
%5 = phi i32 [ %30, %28 ], [ %1, %0 ]
%6 = phi i32 [ %29, %28 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 32
br i1 %7, label %26, label %8
8: ; preds = %4
%9 = sdiv i32 %6, 4
%10 = srem i32 %6, 4
%11 = icmp sgt i32 %6, 3
br i1 %11, label %14, label %12
12: ; preds = %14, %8
%13 = icmp sgt i32 %10, 0
br i1 %13, label %21, label %19
14: ; preds = %8, %14
%15 = phi i32 [ %17, %14 ], [ 0, %8 ]
%16 = tail call i32 @putchar(i32 9)
%17 = add nuw nsw i32 %15, 1
%18 = icmp eq i32 %17, %9
br i1 %18, label %12, label %14
19: ; preds = %21, %12
%20 = tail call i32 @putchar(i32 %5)
br label %28
21: ; preds = %12, %21
%22 = phi i32 [ %24, %21 ], [ 0, %12 ]
%23 = tail call i32 @putchar(i32 32)
%24 = add nuw nsw i32 %22, 1
%25 = icmp eq i32 %24, %10
br i1 %25, label %19, label %21
26: ; preds = %4
%27 = add nsw i32 %6, 1
br label %28
28: ; preds = %26, %19
%29 = phi i32 [ 0, %19 ], [ %27, %26 ]
%30 = tail call i32 (...) @getchar()
%31 = load i32, i32* @EOF
%32 = icmp eq i32 %30, %31
br i1 %32, label %33, label %4
33: ; preds = %28, %0
ret i32 0
}