#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);
void main() {
  int c, nl, nw, nc, inword;
  inword = 0;
  nl = 0;
  nw = 0;
  nc = 0;
  c = getchar();
  while (c != EOF) {
    nc = nc + 1;
    if (c == '\n')
      nl = nl + 1;
    if (c == ' ' || c == '\n' || c == '\t')
      inword = 0;
    else if (inword == 0) {
      inword = 1;
      nw = nw + 1;
    }
    c = getchar();
  }
  printf("%d \n", nl);
  printf("%d \n", nw);
  printf("%d \n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%eax
je     11d4 <main+0xb4>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    117c <main+0x5c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x20,-0x4(%rbp)
je     119a <main+0x7a>
cmpl   $0xa,-0x4(%rbp)
je     119a <main+0x7a>
cmpl   $0x9,-0x4(%rbp)
jne    11a6 <main+0x86>
movl   $0x0,-0x14(%rbp)
jmp    11c5 <main+0xa5>
cmpl   $0x0,-0x14(%rbp)
jne    11c0 <main+0xa0>
movl   $0x1,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c5 <main+0xa5>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
jmp    114e <main+0x2e>
mov    -0x8(%rbp),%esi
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe04(%rip),%rdi
call   1030 <printf@plt>
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    %ebp,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ead(%rip),%r15
mov    $0x0,%r14d
mov    $0x0,%ebx
cmp    (%r15),%eax
jne    117f <main+0x5f>
lea    0xeae(%rip),%r15
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>
movabs $0x100000600,%r12
xor    %r13d,%r13d
xor    %ebx,%ebx
xor    %r14d,%r14d
xor    %ebp,%ebp
jmp    11c1 <main+0xa1>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x1,%r13d
adc    $0x0,%r14d
mov    $0x1,%r13d
mov    %dl,%cl
add    %ecx,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    (%r15),%eax
je     114b <main+0x2b>
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %dl
cmp    $0x20,%eax
ja     11a0 <main+0x80>
mov    %eax,%eax
bt     %rax,%r12
jae    11a0 <main+0x80>
xor    %r13d,%r13d
jmp    11ae <main+0x8e>

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [5 x i8] c"%d \0A\00"
define void @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %24, label %4
4: ; preds = %0, %18
%5 = phi i32 [ %20, %18 ], [ 0, %0 ]
%6 = phi i32 [ %10, %18 ], [ 0, %0 ]
%7 = phi i32 [ %19, %18 ], [ 0, %0 ]
%8 = phi i32 [ %13, %18 ], [ 0, %0 ]
%9 = phi i32 [ %21, %18 ], [ %1, %0 ]
%10 = add nuw nsw i32 %6, 1
%11 = icmp eq i32 %9, 10
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %8, %12
switch i32 %9, label %14 [
i32 32, label %18
i32 10, label %18
i32 9, label %18
]
14: ; preds = %4
%15 = icmp eq i32 %5, 0
%16 = zext i1 %15 to i32
%17 = add nsw i32 %7, %16
br label %18
18: ; preds = %14, %4, %4, %4
%19 = phi i32 [ %7, %4 ], [ %17, %14 ], [ %7, %4 ], [ %7, %4 ]
%20 = phi i32 [ 0, %4 ], [ 1, %14 ], [ 0, %4 ], [ 0, %4 ]
%21 = tail call i32 (...) @getchar()
%22 = load i32, i32* @EOF
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %4
24: ; preds = %18, %0
%25 = phi i32 [ 0, %0 ], [ %13, %18 ]
%26 = phi i32 [ 0, %0 ], [ %19, %18 ]
%27 = phi i32 [ 0, %0 ], [ %10, %18 ]
%28 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %25)
%29 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %26)
%30 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %27)
ret void
}