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


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   $0x1,-0x24(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x20(%rbp)
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%eax
je     11d5 <main+0xb5>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0xa,-0x20(%rbp)
jne    1187 <main+0x67>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x20,-0x20(%rbp)
je     11a5 <main+0x85>
cmpl   $0x9,-0x20(%rbp)
je     11a5 <main+0x85>
cmpl   $0xa,-0x20(%rbp)
jne    11b1 <main+0x91>
movl   $0x1,-0x24(%rbp)
jmp    11d0 <main+0xb0>
cmpl   $0x1,-0x24(%rbp)
jne    11cb <main+0xab>
movl   $0x0,-0x24(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11d0 <main+0xb0>
jmp    1152 <main+0x32>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eac(%rip),%r15
mov    $0x0,%ebx
mov    $0x0,%ebp
cmp    (%r15),%eax
jne    116f <main+0x4f>
lea    0xeae(%rip),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%r13d
movabs $0x100000600,%r12
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %r14d,%r14d
jmp    11b2 <main+0x92>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
cmp    $0x1,%r13d
sete   %al
add    %eax,%r14d
xor    %r13d,%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     1190 <main+0x70>
mov    %eax,%eax
bt     %rax,%r12
jae    1190 <main+0x70>
mov    $0x1,%r13d
jmp    119f <main+0x7f>

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

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) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %26, label %6
6: ; preds = %2, %20
%7 = phi i32 [ %23, %20 ], [ %3, %2 ]
%8 = phi i32 [ %22, %20 ], [ 1, %2 ]
%9 = phi i32 [ %15, %20 ], [ 0, %2 ]
%10 = phi i32 [ %12, %20 ], [ 0, %2 ]
%11 = phi i32 [ %21, %20 ], [ 0, %2 ]
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %7, 10
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %9, %14
switch i32 %7, label %16 [
i32 32, label %20
i32 10, label %20
i32 9, label %20
]
16: ; preds = %6
%17 = icmp eq i32 %8, 1
%18 = zext i1 %17 to i32
%19 = add nsw i32 %11, %18
br label %20
20: ; preds = %16, %6, %6, %6
%21 = phi i32 [ %11, %6 ], [ %19, %16 ], [ %11, %6 ], [ %11, %6 ]
%22 = phi i32 [ 1, %6 ], [ 0, %16 ], [ 1, %6 ], [ 1, %6 ]
%23 = tail call i32 (...) @getchar()
%24 = load i32, i32* @EOF
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %6
26: ; preds = %20, %2
%27 = phi i32 [ 0, %2 ], [ %21, %20 ]
%28 = phi i32 [ 0, %2 ], [ %12, %20 ]
%29 = phi i32 [ 0, %2 ], [ %15, %20 ]
%30 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %28, i32 %27, i32 %29)
ret i32 0
}