#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 getchar();
int /*<<< orphan*/ printf(char *, int, int, int);
main() {
  int c, nl, nw, nc, state;
  int end = getchar();
  state = 0;
  nl = nw = nc = 0;
  while ((c = getchar()) != end) {
    ++nc;
    if (c == '\n') {
      ++nl;
    }
    if (c == ' ' || !c == '\t' || c == '\n') {
      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)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    -0x1c(%rbp),%eax
je     11df <main+0xbf>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    1184 <main+0x64>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     11af <main+0x8f>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x9,%eax
je     11af <main+0x8f>
cmpl   $0xa,-0x8(%rbp)
jne    11bb <main+0x9b>
movl   $0x0,-0x18(%rbp)
jmp    11da <main+0xba>
cmpl   $0x0,-0x18(%rbp)
jne    11d5 <main+0xb5>
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11da <main+0xba>
jmp    1155 <main+0x35>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe11(%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    %r14d,%r14d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    $0x0,%ebx
mov    $0x0,%ebp
cmp    %r15d,%eax
jne    1169 <main+0x49>
lea    0xeae(%rip),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebp,%ebp
xor    %r12d,%r12d
xor    %ebx,%ebx
xor    %r14d,%r14d
jmp    1196 <main+0x76>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %r12d,%r12d
mov    %dl,%cl
add    %ecx,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    %r15d,%eax
je     114b <main+0x2b>
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %dl
je     1180 <main+0x60>
cmp    $0x20,%eax
je     1180 <main+0x60>
cmp    $0x1,%r12d
adc    $0x0,%r14d
mov    $0x1,%r12d
jmp    1183 <main+0x63>

LLVM IR (-O0):
@.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
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (...) @getchar()
store i32 %8, i32* %7
store i32 0, i32* %6
store i32 0, i32* %5
store i32 0, i32* %4
store i32 0, i32* %3
br label %9
9: ; preds = %41, %0
%10 = call i32 (...) @getchar()
store i32 %10, i32* %2
%11 = load i32, i32* %7
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %42
13: ; preds = %9
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %21
21: ; preds = %18, %13
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 32
br i1 %23, label %33, label %24
24: ; preds = %21
%25 = load i32, i32* %2
%26 = icmp ne i32 %25, 0
%27 = xor i1 %26, true
%28 = zext i1 %27 to i32
%29 = icmp eq i32 %28, 9
br i1 %29, label %33, label %30
30: ; preds = %24
%31 = load i32, i32* %2
%32 = icmp eq i32 %31, 10
br i1 %32, label %33, label %34
33: ; preds = %30, %24, %21
store i32 0, i32* %6
br label %41
34: ; preds = %30
%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
br label %9
42: ; preds = %9
%43 = load i32, i32* %3
%44 = load i32, i32* %4
%45 = load i32, i32* %5
%46 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %43, i32 %44, i32 %45)
%47 = load i32, i32* %1
ret i32 %47
}

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