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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     11c4 <main+0xa4>
cmpl   $0x20,-0xc(%rbp)
jne    1167 <main+0x47>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a4 <main+0x84>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1192 <main+0x72>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116e <main+0x4e>
mov    -0xc(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jne    11bf <main+0x9f>
mov    $0x9,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x10(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%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    %eax,%ebx
xor    %ebp,%ebp
jmp    1168 <main+0x48>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %bl,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     1137 <main+0x17>
cmp    $0x20,%ebx
jne    1180 <main+0x60>
add    $0x1,%ebp
cmp    $0x4,%ebp
jne    115a <main+0x3a>
mov    $0x9,%bl
jmp    1150 <main+0x30>
nopl   0x0(%rax)
test   %ebp,%ebp
jle    1150 <main+0x30>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1190 <main+0x70>
jmp    1150 <main+0x30>

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

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