#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, int, int);
int main(int argc, char *argv[]) {
  int c, nl, nw, nc, state;
  state = 0;
  nl = nw = nc = 0;
  while ((c = 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    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%eax
je     1179 <main+0x59>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1152 <main+0x32>
cmpl   $0xa,-0x14(%rbp)
jne    118c <main+0x6c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x20,-0x14(%rbp)
je     11aa <main+0x8a>
cmpl   $0xa,-0x14(%rbp)
je     11aa <main+0x8a>
cmpl   $0x9,-0x14(%rbp)
jne    11b6 <main+0x96>
movl   $0x0,-0x24(%rbp)
jmp    11d5 <main+0xb5>
cmpl   $0x0,-0x24(%rbp)
jne    11d0 <main+0xb0>
movl   $0x1,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11d5 <main+0xb5>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%ebx
mov    0x2eb8(%rip),%r14
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    (%r14),%eax
jne    1130 <main+0x10>
xor    %esi,%esi
cmp    $0xa,%eax
sete   %sil
cmp    $0x20,%eax
setne  %cl
add    $0xfffffff5,%eax
cmp    $0xfffffffe,%eax
setb   %al
and    %cl,%al
movzbl %al,%edx
lea    0xe9d(%rip),%rdi
mov    %ebx,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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