#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*/ printf(char *, ...);
int main() {
  int charc, c;
  charc = 0;
  while ((c = getchar()) != EOF) {
    if (c == '\t') {
      if ((charc + 4) >= 12) {
        for (int i = 0; i < (12 - charc); i++)
          printf("█");
        printf("\n");
        for (int i = 0; i < ((charc + 4) - 12); i++)
          printf("█");
        charc = (charc + 4) - 12;
      } else {
        for (int i = 0; i < 4; i++)
          printf("█");
        charc += 4;
      }
    } else {
      if (charc == 12) {
        printf("\n");
        charc = 0;
      }
      printf("%c", c);
      charc++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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     126d <main+0x14d>
cmpl   $0x9,-0xc(%rbp)
jne    122f <main+0x10f>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
cmp    $0xc,%eax
jl     11f4 <main+0xd4>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xc,%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    119e <main+0x7e>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116f <main+0x4f>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x4,%ecx
sub    $0xc,%ecx
cmp    %ecx,%eax
jge    11e3 <main+0xc3>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b3 <main+0x93>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
sub    $0xc,%eax
mov    %eax,-0x8(%rbp)
jmp    122a <main+0x10a>
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    1221 <main+0x101>
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11fb <main+0xdb>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
jmp    1268 <main+0x148>
cmpl   $0xc,-0x8(%rbp)
jne    124e <main+0x12e>
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%esi
lea    0xdae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea3(%rip),%r14
cmp    (%r14),%eax
jne    1157 <main+0x27>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebp
lea    0xea0(%rip),%r15
xor    %ebx,%ebx
jmp    1188 <main+0x58>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebp
cmp    (%r14),%eax
je     114a <main+0x1a>
cmp    $0x9,%ebp
jne    11d0 <main+0xa0>
cmp    $0x7,%ebx
jle    11f0 <main+0xc0>
cmp    $0xc,%ebx
jae    1220 <main+0xf0>
mov    $0xc,%ebp
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
cmp    %ebp,%ebx
jne    11a0 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x8(%rbx),%eax
cmp    $0x9,%ebx
mov    %eax,%ebx
jl     117a <main+0x4a>
jmp    122d <main+0xfd>
nopw   0x0(%rax,%rax,1)
cmp    $0xc,%ebx
jne    1170 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebx,%ebx
jmp    1170 <main+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x4,%ebx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    117a <main+0x4a>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xfffffff8,%ebx
mov    %ebx,%ebp
nop
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1230 <main+0x100>
jmp    117a <main+0x4a>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [4 x i8] c"\E2\96\88\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %7
7: ; preds = %69, %0
%8 = call i32 (...) @getchar()
store i32 %8, i32* %3
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %70
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 9
br i1 %13, label %14, label %59
14: ; preds = %11
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 4
%17 = icmp sge i32 %16, 12
br i1 %17, label %18, label %46
18: ; preds = %14
store i32 0, i32* %4
br label %19
19: ; preds = %26, %18
%20 = load i32, i32* %4
%21 = load i32, i32* %2
%22 = sub nsw i32 12, %21
%23 = icmp slt i32 %20, %22
br i1 %23, label %24, label %29
24: ; preds = %19
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %26
26: ; preds = %24
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %19
29: ; preds = %19
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %5
br label %31
31: ; preds = %39, %29
%32 = load i32, i32* %5
%33 = load i32, i32* %2
%34 = add nsw i32 %33, 4
%35 = sub nsw i32 %34, 12
%36 = icmp slt i32 %32, %35
br i1 %36, label %37, label %42
37: ; preds = %31
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %39
39: ; preds = %37
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %31
42: ; preds = %31
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 4
%45 = sub nsw i32 %44, 12
store i32 %45, i32* %2
br label %58
46: ; preds = %14
store i32 0, i32* %6
br label %47
47: ; preds = %52, %46
%48 = load i32, i32* %6
%49 = icmp slt i32 %48, 4
br i1 %49, label %50, label %55
50: ; preds = %47
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %52
52: ; preds = %50
%53 = load i32, i32* %6
%54 = add nsw i32 %53, 1
store i32 %54, i32* %6
br label %47
55: ; preds = %47
%56 = load i32, i32* %2
%57 = add nsw i32 %56, 4
store i32 %57, i32* %2
br label %58
58: ; preds = %55, %42
br label %69
59: ; preds = %11
%60 = load i32, i32* %2
%61 = icmp eq i32 %60, 12
br i1 %61, label %62, label %64
62: ; preds = %59
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %64
64: ; preds = %62, %59
%65 = load i32, i32* %3
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %65)
%67 = load i32, i32* %2
%68 = add nsw i32 %67, 1
store i32 %68, i32* %2
br label %69
69: ; preds = %64, %58
br label %7
70: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"\E2\96\88\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %52, label %4
4: ; preds = %0, %47
%5 = phi i32 [ %49, %47 ], [ %1, %0 ]
%6 = phi i32 [ %48, %47 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 9
br i1 %7, label %8, label %39
8: ; preds = %4
%9 = icmp sgt i32 %6, 7
br i1 %9, label %16, label %10
10: ; preds = %8
%11 = add nsw i32 %6, 4
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %47
16: ; preds = %8
%17 = icmp ult i32 %6, 12
br i1 %17, label %21, label %18
18: ; preds = %16
%19 = tail call i32 @putchar(i32 10)
%20 = add nsw i32 %6, -8
br label %27
21: ; preds = %16
%22 = sub nuw nsw i32 12, %6
br label %29
23: ; preds = %29
%24 = tail call i32 @putchar(i32 10)
%25 = add i32 %6, -8
%26 = icmp sgt i32 %6, 8
br i1 %26, label %27, label %47
27: ; preds = %18, %23
%28 = phi i32 [ %20, %18 ], [ %25, %23 ]
br label %34
29: ; preds = %21, %29
%30 = phi i32 [ %32, %29 ], [ 0, %21 ]
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%32 = add nuw nsw i32 %30, 1
%33 = icmp eq i32 %32, %22
br i1 %33, label %23, label %29
34: ; preds = %27, %34
%35 = phi i32 [ %37, %34 ], [ 0, %27 ]
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%37 = add nuw nsw i32 %35, 1
%38 = icmp eq i32 %37, %28
br i1 %38, label %47, label %34
39: ; preds = %4
%40 = icmp eq i32 %6, 12
br i1 %40, label %41, label %43
41: ; preds = %39
%42 = tail call i32 @putchar(i32 10)
br label %43
43: ; preds = %41, %39
%44 = phi i32 [ 0, %41 ], [ %6, %39 ]
%45 = tail call i32 @putchar(i32 %5)
%46 = add nsw i32 %44, 1
br label %47
47: ; preds = %34, %10, %23, %43
%48 = phi i32 [ %46, %43 ], [ %25, %23 ], [ %11, %10 ], [ %28, %34 ]
%49 = tail call i32 (...) @getchar()
%50 = load i32, i32* @EOF
%51 = icmp eq i32 %49, %50
br i1 %51, label %52, label %4
52: ; preds = %47, %0
ret i32 0
}