#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 *argv[]) {
  int S = 0;
  int T = 0;
  int N = 0;
  int c = 0;
  while ((c = getchar()) != EOF)
    switch (c) {
    case ' ':
      ++S;
      break;
    case '\t':
      ++T;
      break;
    case '\n':
      ++N;
      break;
    }
  printf("%d %d %d\n", S, T, N);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x20(%rbp)
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%eax
je     11cb <main+0xab>
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x9,%eax
je     11af <main+0x8f>
jmp    117f <main+0x5f>
mov    -0x24(%rbp),%eax
sub    $0xa,%eax
je     11bd <main+0x9d>
jmp    1190 <main+0x70>
mov    -0x24(%rbp),%eax
sub    $0x20,%eax
jne    11c6 <main+0xa6>
jmp    11a1 <main+0x81>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c6 <main+0xa6>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11c6 <main+0xa6>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1152 <main+0x32>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe25(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%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* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
br label %10
10: ; preds = %25, %2
%11 = call i32 (...) @getchar()
store i32 %11, i32* %9
%12 = load i32, i32* @EOF
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %26
14: ; preds = %10
%15 = load i32, i32* %9
switch i32 %15, label %25 [
i32 32, label %16
i32 9, label %19
i32 10, label %22
]
16: ; preds = %14
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %25
19: ; preds = %14
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
br label %25
22: ; preds = %14
%23 = load i32, i32* %8
%24 = add nsw i32 %23, 1
store i32 %24, i32* %8
br label %25
25: ; preds = %14, %22, %19, %16
br label %10
26: ; preds = %10
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %27, i32 %28, i32 %29)
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, %15, %13, %11
%18 = phi i32 [ %10, %6 ], [ %10, %15 ], [ %10, %13 ], [ %12, %11 ]
%19 = phi i32 [ %9, %6 ], [ %9, %15 ], [ %14, %13 ], [ %9, %11 ]
%20 = phi i32 [ %8, %6 ], [ %16, %15 ], [ %8, %13 ], [ %8, %11 ]
%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
}