#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 lineCount = 1;
  int wordCount = 1;
  int charCount = 1;
  int c;
  while ((c = getchar()) != EOF) {
    charCount = charCount + 1;
    if (c == '\n') {
      lineCount = lineCount + 1;
      wordCount = wordCount + 1;
    }
    if (c == ' ' || c == '\f' || c == '\t' || c == '\r' || c == '\v') {
      wordCount = wordCount + 1;
    }
  }
  printf("%d %d %d\n", lineCount, wordCount, charCount);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
je     11c2 <main+0xa2>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xa,-0x14(%rbp)
jne    1182 <main+0x62>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x20,-0x14(%rbp)
je     11b4 <main+0x94>
cmpl   $0xc,-0x14(%rbp)
je     11b4 <main+0x94>
cmpl   $0x9,-0x14(%rbp)
je     11b4 <main+0x94>
cmpl   $0xd,-0x14(%rbp)
je     11b4 <main+0x94>
cmpl   $0xb,-0x14(%rbp)
jne    11bd <main+0x9d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <main+0x24>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb3(%rip),%r15
mov    $0x1,%ebx
mov    $0x1,%ebp
mov    $0x1,%r14d
cmp    (%r15),%eax
je     11a4 <main+0x84>
mov    $0x1,%r14d
mov    $0x1,%ebp
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
add    %ecx,%r14d
cmp    $0x20,%eax
sete   %cl
cmp    $0xc,%eax
sete   %dl
or     %cl,%dl
mov    %eax,%ecx
and    $0xfffffffb,%ecx
cmp    $0x9,%ecx
sete   %cl
or     %dl,%cl
cmp    $0xb,%eax
sete   %al
or     %cl,%al
movzbl %al,%eax
add    %eax,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r15),%eax
jne    1160 <main+0x40>
lea    0xe55(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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