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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%eax
je     11d1 <main+0xb1>
cmpl   $0xa,-0x8(%rbp)
je     117a <main+0x5a>
cmpl   $0x9,-0x8(%rbp)
je     117a <main+0x5a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmpl   $0x9,-0x8(%rbp)
jne    11b1 <main+0x91>
jmp    1189 <main+0x69>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x8,%eax
jge    11ac <main+0x8c>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1189 <main+0x69>
jmp    11b1 <main+0x91>
cmpl   $0x8,-0xc(%rbp)
jge    11c5 <main+0xa5>
cmpl   $0xa,-0x8(%rbp)
jne    11cc <main+0xac>
movl   $0x0,-0xc(%rbp)
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    %r15d,%r15d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb0(%rip),%r14
cmp    (%r14),%eax
jne    114a <main+0x2a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebx
xor    %ebp,%ebp
jmp    1177 <main+0x57>
add    $0x1,%ebp
movsbl %bl,%edi
call   1030 <putchar@plt>
cmp    $0x8,%ebp
cmovge %r15d,%ebp
cmp    $0xa,%ebx
cmove  %r15d,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     113d <main+0x1d>
lea    -0xb(%rbx),%eax
cmp    $0xfffffffd,%eax
jbe    1150 <main+0x30>
cmp    $0x9,%ebx
jne    115b <main+0x3b>
add    $0xfffffff8,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
inc    %ebp
jne    1190 <main+0x70>
mov    $0x9,%ebp
jmp    115b <main+0x3b>

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