#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 *, long);
main() {
  int c;
  long n;
  while ((c = getchar()) != EOF) {
    if (c == ' ')
      ++n;
    if (c == '\t')
      ++n;
    if (c == '\n')
      ++n;
  }
  printf("%ld\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     118f <main+0x6f>
cmpl   $0x20,-0x8(%rbp)
jne    115e <main+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x9,-0x8(%rbp)
jne    1174 <main+0x54>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    118a <main+0x6a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <main+0xf>
mov    -0x10(%rbp),%rsi
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %ecx,%ecx
cmp    $0x20,%eax
sete   %cl
add    %rbx,%rcx
xor    %edx,%edx
cmp    $0x9,%eax
sete   %dl
add    %rcx,%rdx
xor    %ebx,%ebx
cmp    $0xa,%eax
sete   %bl
add    %rdx,%rbx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xe8c(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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