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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%rax
je     11cc <main+0xac>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    117e <main+0x5e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     119c <main+0x7c>
cmpl   $0xa,-0x8(%rbp)
je     119c <main+0x7c>
cmpl   $0x9,-0x8(%rbp)
jne    11a8 <main+0x88>
movl   $0x0,-0x18(%rbp)
jmp    11c7 <main+0xa7>
cmpl   $0x0,-0x18(%rbp)
jne    11c2 <main+0xa2>
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11c7 <main+0xa7>
jmp    114b <main+0x2b>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %r12d,%r12d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eaf(%rip),%r14
mov    $0x0,%ebp
cmp    (%r14),%rax
je     116d <main+0x4d>
mov    $0x1,%r15d
xor    %ebx,%ebx
xor    %ebp,%ebp
xor    %r12d,%r12d
add    $0x1,%ebp
xor    %eax,%eax
test   %ebx,%ebx
sete   %al
cmove  %r15d,%ebx
add    %eax,%r12d
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%rax
jne    1150 <main+0x30>
lea    0xe8c(%rip),%rdi
xor    %esi,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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