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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     11d1 <main+0xb1>
cmpl   $0x9,-0xc(%rbp)
jne    11a0 <main+0x80>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     119b <main+0x7b>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116c <main+0x4c>
jmp    11cc <main+0xac>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
cmpl   $0xa,-0xc(%rbp)
jne    11be <main+0x9e>
movl   $0x1,-0x8(%rbp)
jmp    11c7 <main+0xa7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11cc <main+0xac>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb3(%rip),%r14
cmp    (%r14),%eax
jne    1147 <main+0x27>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebx
mov    $0x1,%r15d
mov    $0x1,%ebp
jmp    117f <main+0x5f>
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0xa,%ebx
cmove  %r15d,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     113a <main+0x1a>
cmp    $0x9,%ebx
jne    1160 <main+0x40>
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0x1(%rbp),%ebx
test   $0x7,%bpl
je     11b6 <main+0x96>
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%ebp
test   $0x7,%bl
mov    %ebp,%ebx
jne    11a0 <main+0x80>
jmp    1171 <main+0x51>
mov    %ebx,%ebp
jmp    1171 <main+0x51>

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