#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 /*<<< orphan*/ putchar(int);
int main(void) {
  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') {
      if (state == 1) {
        state = 0;
        putchar('\n');
      }
    } else if (state == 0) {
      state = 1;
      nw++;
    }
    if (state == 1) {
      putchar(c);
    }
  }
  printf("%d %d %d\n", nl, nw, nc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e7c(%rip),%rcx
cmp    (%rcx),%eax
je     1204 <main+0xd4>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    1190 <main+0x60>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     11ae <main+0x7e>
cmpl   $0xa,-0x8(%rbp)
je     11ae <main+0x7e>
cmpl   $0x9,-0x8(%rbp)
jne    11ce <main+0x9e>
cmpl   $0x1,-0x18(%rbp)
jne    11c9 <main+0x99>
movl   $0x0,-0x18(%rbp)
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11ed <main+0xbd>
cmpl   $0x0,-0x18(%rbp)
jne    11e8 <main+0xb8>
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ed <main+0xbd>
cmpl   $0x1,-0x18(%rbp)
jne    11ff <main+0xcf>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    115b <main+0x2b>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xdec(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
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    %ebx,%ebx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e9d(%rip),%rcx
movl   $0x0,0x4(%rsp)
mov    $0x0,%ebp
cmp    (%rcx),%eax
jne    1181 <main+0x51>
lea    0xe9d(%rip),%rdi
mov    %ebx,%esi
mov    0x4(%rsp),%edx
mov    %ebp,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r14d,%r14d
xor    %ebp,%ebp
movl   $0x0,0x4(%rsp)
xor    %ebx,%ebx
jmp    11d4 <main+0xa4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x1,%r14d
adcl   $0x0,0x4(%rsp)
mov    $0x1,%r13d
mov    %eax,%edi
call   1030 <putchar@plt>
mov    %r13d,%r14d
mov    %r15b,%r12b
add    %r12d,%ebx
xor    %eax,%eax
call   1050 <getchar@plt>
add    $0x1,%ebp
mov    0x2e18(%rip),%rcx
cmp    (%rcx),%eax
je     115c <main+0x2c>
xor    %r12d,%r12d
cmp    $0xa,%eax
sete   %r15b
cmp    $0x20,%eax
ja     11a0 <main+0x70>
mov    %eax,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    11a0 <main+0x70>
xor    %r13d,%r13d
mov    $0xa,%eax
cmp    $0x1,%r14d
mov    $0x0,%r14d
je     11af <main+0x7f>
jmp    11b9 <main+0x89>

LLVM IR (-O0):
@EOF = global i32 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* %6
store i32 0, i32* %5
store i32 0, i32* %4
store i32 0, i32* %3
br label %7
7: ; preds = %47, %0
%8 = call i32 (...) @getchar()
store i32 %8, i32* %2
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %48
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 %34
28: ; preds = %25, %22, %19
%29 = load i32, i32* %6
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %33
31: ; preds = %28
store i32 0, i32* %6
%32 = call i32 @putchar(i32 10)
br label %33
33: ; preds = %31, %28
br label %41
34: ; preds = %25
%35 = load i32, i32* %6
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %34
store i32 1, i32* %6
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %40
40: ; preds = %37, %34
br label %41
41: ; preds = %40, %33
%42 = load i32, i32* %6
%43 = icmp eq i32 %42, 1
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i32, i32* %2
%46 = call i32 @putchar(i32 %45)
br label %47
47: ; preds = %44, %41
br label %7
48: ; preds = %7
%49 = load i32, i32* %3
%50 = load i32, i32* %4
%51 = load i32, i32* %5
%52 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %49, i32 %50, i32 %51)
ret i32 0
}

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