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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%eax
je     11b4 <main+0x94>
cmpl   $0xa,-0x8(%rbp)
jne    1167 <main+0x47>
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0x8(%rbp)
jne    119e <main+0x7e>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
je     1199 <main+0x79>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1171 <main+0x51>
jmp    11af <main+0x8f>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb3(%rip),%rbx
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
xor    %ebp,%ebp
jmp    1165 <main+0x45>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     1139 <main+0x19>
cmp    $0xa,%eax
cmove  %r14d,%ebp
cmp    $0x9,%eax
jne    1150 <main+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   $0xcccccccd,%ebp,%eax
add    $0x19999999,%eax
cmp    $0x33333333,%eax
jb     115a <main+0x3a>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
jmp    1180 <main+0x60>

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