#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(void) {
  int column, c;
  column = 0;
  while ((c = getchar()) != EOF) {
    if (c == '\t') {
      while (column % 8 != 0 && column != 0) {
        putchar(' ');
        ++column;
      }
    } else {
      if (c == '\n') {
        putchar(c);
        column = 0;
      } else {
        putchar(c);
        ++column;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     11e7 <main+0xc7>
cmpl   $0x9,-0xc(%rbp)
jne    11ae <main+0x8e>
jmp    115e <main+0x3e>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0xd(%rbp)
je     1181 <main+0x61>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1191 <main+0x71>
jmp    11a9 <main+0x89>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <main+0x3e>
jmp    11e2 <main+0xc2>
cmpl   $0xa,-0xc(%rbp)
jne    11cc <main+0xac>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
movl   $0x0,-0x8(%rbp)
jmp    11dd <main+0xbd>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e2 <main+0xc2>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb7(%rip),%rbx
cmp    (%rbx),%eax
jne    113e <main+0x1e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %ebp,%ebp
jmp    1165 <main+0x45>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     1135 <main+0x15>
cmp    $0xa,%eax
je     1190 <main+0x70>
cmp    $0x9,%eax
jne    1150 <main+0x30>
nop
test   $0x7,%bpl
je     115a <main+0x3a>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
test   $0x7,%bpl
jne    1176 <main+0x56>
jmp    115a <main+0x3a>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
jmp    115a <main+0x3a>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %38, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %3
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %39
8: ; preds = %4
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 9
br i1 %10, label %11, label %26
11: ; preds = %8
br label %12
12: ; preds = %21, %11
%13 = load i32, i32* %2
%14 = srem i32 %13, 8
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %2
%18 = icmp ne i32 %17, 0
br label %19
19: ; preds = %16, %12
%20 = phi i1 [ false, %12 ], [ %18, %16 ]
br i1 %20, label %21, label %25
21: ; preds = %19
%22 = call i32 @putchar(i32 32)
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %12
25: ; preds = %19
br label %38
26: ; preds = %8
%27 = load i32, i32* %3
%28 = icmp eq i32 %27, 10
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i32, i32* %3
%31 = call i32 @putchar(i32 %30)
store i32 0, i32* %2
br label %37
32: ; preds = %26
%33 = load i32, i32* %3
%34 = call i32 @putchar(i32 %33)
%35 = load i32, i32* %2
%36 = add nsw i32 %35, 1
store i32 %36, i32* %2
br label %37
37: ; preds = %32, %29
br label %38
38: ; preds = %37, %25
br label %4
39: ; preds = %4
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 %26, label %4
4: ; preds = %0, %21
%5 = phi i32 [ %23, %21 ], [ %1, %0 ]
%6 = phi i32 [ %22, %21 ], [ 0, %0 ]
switch i32 %5, label %18 [
i32 9, label %7
i32 10, label %16
]
7: ; preds = %4
%8 = and i32 %6, 7
%9 = icmp eq i32 %8, 0
br i1 %9, label %21, label %10
10: ; preds = %7, %10
%11 = phi i32 [ %13, %10 ], [ %6, %7 ]
%12 = tail call i32 @putchar(i32 32)
%13 = add i32 %11, 1
%14 = trunc i32 %13 to i3
%15 = icmp eq i3 %14, 0
br i1 %15, label %21, label %10
16: ; preds = %4
%17 = tail call i32 @putchar(i32 10)
br label %21
18: ; preds = %4
%19 = tail call i32 @putchar(i32 %5)
%20 = add nsw i32 %6, 1
br label %21
21: ; preds = %10, %7, %16, %18
%22 = phi i32 [ 0, %16 ], [ %20, %18 ], [ %6, %7 ], [ %13, %10 ]
%23 = tail call i32 (...) @getchar()
%24 = load i32, i32* @EOF
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %4
26: ; preds = %21, %0
ret i32 0
}