#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 const *argv[]) {
  int c;
  int num_blanks, num_tabs, num_newlines;
  num_blanks = num_tabs = num_newlines = 0;
  while ((c = getchar()) != EOF) {
    if (c == ' ')
      ++num_blanks;
    else if (c == '\t')
      ++num_tabs;
    else if (c == '\n')
      ++num_newlines;
  }
  printf("%d %d %d\n", num_blanks, num_tabs, num_newlines);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%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    0x2e8c(%rip),%rcx
cmp    (%rcx),%eax
je     11b6 <main+0x96>
cmpl   $0x20,-0x14(%rbp)
jne    117c <main+0x5c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b1 <main+0x91>
cmpl   $0x9,-0x14(%rbp)
jne    1194 <main+0x74>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ac <main+0x8c>
cmpl   $0xa,-0x14(%rbp)
jne    11a7 <main+0x87>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11ac <main+0x8c>
jmp    11b1 <main+0x91>
jmp    114b <main+0x2b>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe3a(%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    %r14d,%r14d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb0(%rip),%r15
mov    $0x0,%ebx
mov    $0x0,%ebp
cmp    (%r15),%eax
jne    1167 <main+0x47>
lea    0xeb2(%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
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %r14d,%r14d
jmp    117f <main+0x5f>
add    $0x1,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r15),%eax
je     1147 <main+0x27>
cmp    $0x9,%eax
je     11a0 <main+0x80>
cmp    $0xa,%eax
je     1170 <main+0x50>
cmp    $0x20,%eax
jne    1173 <main+0x53>
add    $0x1,%r14d
jmp    1173 <main+0x53>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebx
jmp    1173 <main+0x53>

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