#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 main(void) {
  int ch;
  int blanks, tabs, newlines;
  blanks = tabs = newlines = 0;
  while ((ch = getchar()) != EOF)
    switch (ch) {
    case ' ':
      ++blanks;
      break;
    case '\t':
      ++tabs;
      break;
    case '\n':
      ++newlines;
      break;
    default:
      break;
    }
  printf("Blanks\tTabs\tNewlines\n");
  printf("%d\t%d\t%d\n", blanks, tabs, newlines);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
je     11c7 <main+0xa7>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x9,%eax
je     11a1 <main+0x81>
jmp    1171 <main+0x51>
mov    -0x18(%rbp),%eax
sub    $0xa,%eax
je     11af <main+0x8f>
jmp    1182 <main+0x62>
mov    -0x18(%rbp),%eax
sub    $0x20,%eax
jne    11bd <main+0x9d>
jmp    1193 <main+0x73>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c2 <main+0xa2>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11c2 <main+0xa2>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c2 <main+0xa2>
jmp    11c2 <main+0xa2>
jmp    1144 <main+0x24>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe31(%rip),%rdi
mov    $0x0,%al
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   1050 <getchar@plt>
mov    0x2ea0(%rip),%r15
mov    $0x0,%ebx
mov    $0x0,%ebp
cmp    (%r15),%eax
jne    1185 <main+0x55>
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
lea    0xe96(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <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    119f <main+0x6f>
xchg   %ax,%ax
add    $0x1,%ebp
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r15),%eax
je     1157 <main+0x27>
cmp    $0x9,%eax
je     11c0 <main+0x90>
cmp    $0xa,%eax
je     1190 <main+0x60>
cmp    $0x20,%eax
jne    1193 <main+0x63>
add    $0x1,%r14d
jmp    1193 <main+0x63>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebx
jmp    1193 <main+0x63>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [22 x i8] c"Blanks\09Tabs\09Newlines\0A\00"
@.str.1 = [10 x i8] c"%d\09%d\09%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 0, i32* %5
store i32 0, i32* %4
store i32 0, i32* %3
br label %6
6: ; preds = %22, %0
%7 = call i32 (...) @getchar()
store i32 %7, i32* %2
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load i32, i32* %2
switch i32 %11, label %21 [
i32 32, label %12
i32 9, label %15
i32 10, label %18
]
12: ; preds = %10
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %22
15: ; preds = %10
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %22
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %22
21: ; preds = %10
br label %22
22: ; preds = %21, %18, %15, %12
br label %6
23: ; preds = %6
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %25, i32 %26, i32 %27)
ret i32 0
}

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