#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\t%d\t%d\n", nl, nw, nc);
  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   $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     11d5 <main+0xb5>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0xa,-0x14(%rbp)
je     1187 <main+0x67>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x20,-0x14(%rbp)
je     11a5 <main+0x85>
cmpl   $0xa,-0x14(%rbp)
je     11a5 <main+0x85>
cmpl   $0x9,-0x14(%rbp)
jne    11b1 <main+0x91>
movl   $0x0,-0x24(%rbp)
jmp    11d0 <main+0xb0>
cmpl   $0x0,-0x24(%rbp)
jne    11cb <main+0xab>
movl   $0x1,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11d0 <main+0xb0>
jmp    1152 <main+0x32>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%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    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ead(%rip),%r15
mov    $0x0,%r14d
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
movabs $0x100000600,%r12
xor    %r13d,%r13d
xor    %ebp,%ebp
xor    %r14d,%r14d
xor    %ebx,%ebx
jmp    11b1 <main+0x91>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x1,%r13d
adc    $0x0,%r14d
mov    $0x1,%r13d
mov    %dl,%cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebp
cmp    (%r15),%eax
je     114b <main+0x2b>
xor    %ecx,%ecx
cmp    $0xa,%eax
setne  %dl
cmp    $0x20,%eax
ja     1190 <main+0x70>
mov    %eax,%eax
bt     %rax,%r12
jae    1190 <main+0x70>
xor    %r13d,%r13d
jmp    119e <main+0x7e>

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [10 x i8] c"%d\09%d\09%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 ], [ 0, %2 ]
%9 = phi i32 [ %12, %20 ], [ 0, %2 ]
%10 = phi i32 [ %21, %20 ], [ 0, %2 ]
%11 = phi i32 [ %15, %20 ], [ 0, %2 ]
%12 = add nuw nsw i32 %9, 1
%13 = icmp ne i32 %7, 10
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %11, %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, 0
%18 = zext i1 %17 to i32
%19 = add nsw i32 %10, %18
br label %20
20: ; preds = %16, %6, %6, %6
%21 = phi i32 [ %10, %6 ], [ %19, %16 ], [ %10, %6 ], [ %10, %6 ]
%22 = phi i32 [ 0, %6 ], [ 1, %16 ], [ 0, %6 ], [ 0, %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 ], [ %15, %20 ]
%28 = phi i32 [ 0, %2 ], [ %21, %20 ]
%29 = phi i32 [ 0, %2 ], [ %12, %20 ]
%30 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %27, i32 %28, i32 %29)
ret i32 0
}