#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 *, ...);
main() {
  int state, c, first, ln, vln, i;
  ln = 1;
  state = 0;
  if (c = getchar()) {
    for (vln = 1; vln <= 20; vln++) {
      printf("  %d", vln);
    }
    printf("\n%d", ln);
  }
  while ((c = getchar()) != EOF) {
    if (c == ' ' || c == '\n' || c == '\t') {
      state = 0;
    } else if (state == 0) {
      state = 1;
    }
    if (state == 1) {
      printf("|=|");
      first = 0;
    } else if (first == 0) {
      printf("\n");
      ln++;
      printf("%d", ln);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1191 <main+0x71>
movl   $0x1,-0x18(%rbp)
cmpl   $0x14,-0x18(%rbp)
jg     1180 <main+0x60>
mov    -0x18(%rbp),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1157 <main+0x37>
mov    -0x14(%rbp),%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1196 <main+0x76>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e41(%rip),%rcx
cmp    (%rcx),%eax
je     124f <main+0x12f>
cmpl   $0x20,-0xc(%rbp)
je     11cd <main+0xad>
cmpl   $0xa,-0xc(%rbp)
je     11cd <main+0xad>
cmpl   $0x9,-0xc(%rbp)
jne    11d9 <main+0xb9>
movl   $0x0,-0x8(%rbp)
jmp    11ef <main+0xcf>
cmpl   $0x0,-0x8(%rbp)
jne    11ea <main+0xca>
movl   $0x1,-0x8(%rbp)
jmp    11ef <main+0xcf>
cmpl   $0x1,-0x8(%rbp)
jne    1213 <main+0xf3>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
jmp    124a <main+0x12a>
cmpl   $0x0,-0x10(%rbp)
jne    1245 <main+0x125>
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124a <main+0x12a>
jmp    1196 <main+0x76>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
test   %eax,%eax
je     1290 <main+0x160>
lea    0xeaf(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd81(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2d4a(%rip),%r12
cmp    (%r12),%eax
jne    12b5 <main+0x185>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebx
lea    0xd45(%rip),%r15
movabs $0x100000600,%r13
xor    %r14d,%r14d
jmp    12f9 <main+0x1c9>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%r14d
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     12a4 <main+0x174>
cmp    $0x20,%eax
ja     1308 <main+0x1d8>
xor    %ebp,%ebp
mov    %eax,%eax
bt     %rax,%r13
jb     12d0 <main+0x1a0>
mov    %r14d,%ebp
cmp    $0x1,%r14d
ja     12d0 <main+0x1a0>
lea    0xcf1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%r14d
jmp    12ec <main+0x1bc>

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

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