#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 *, size_t, size_t, size_t);
int main(int argc, char **argv) {
  size_t blanks = 0;
  size_t tabs = 0;
  size_t newlines = 0;
  int c;
  while ((c = getchar()) != EOF) {
    switch (c) {
    case ' ':
      blanks++;
      break;
    case '\t':
      tabs++;
      break;
    case '\n':
      newlines++;
      break;
    default:
      continue;
    }
  }
  printf("Blanks: %lu\nTabs: %lu\nNewlines: %lu\n", blanks, tabs, newlines);
  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)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x2c(%rbp)
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
je     11da <main+0xba>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
sub    $0x9,%eax
je     11ae <main+0x8e>
jmp    117b <main+0x5b>
mov    -0x30(%rbp),%eax
sub    $0xa,%eax
je     11bf <main+0x9f>
jmp    118c <main+0x6c>
mov    -0x30(%rbp),%eax
sub    $0x20,%eax
jne    11d0 <main+0xb0>
jmp    119d <main+0x7d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11d5 <main+0xb5>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11d5 <main+0xb5>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11d5 <main+0xb5>
jmp    114e <main+0x2e>
jmp    114e <main+0x2e>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2eb9(%rip),%rbx
xor    %r14d,%r14d
xor    %r15d,%r15d
xor    %r12d,%r12d
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     116c <main+0x4c>
cmp    $0x9,%eax
je     1160 <main+0x40>
cmp    $0xa,%eax
je     1166 <main+0x46>
cmp    $0x20,%eax
jne    1140 <main+0x20>
add    $0x1,%r12
jmp    1140 <main+0x20>
add    $0x1,%r14
jmp    1140 <main+0x20>
add    $0x1,%r15
jmp    1140 <main+0x20>
lea    0xe8d(%rip),%rdi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [37 x i8] c"Blanks: %lu\0ATabs: %lu\0ANewlines: %lu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
store i64 0, i64* %7
store i64 0, i64* %8
br label %10
10: ; preds = %26, %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 %27
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 i64, i64* %6
%18 = add i64 %17, 1
store i64 %18, i64* %6
br label %26
19: ; preds = %14
%20 = load i64, i64* %7
%21 = add i64 %20, 1
store i64 %21, i64* %7
br label %26
22: ; preds = %14
%23 = load i64, i64* %8
%24 = add i64 %23, 1
store i64 %24, i64* %8
br label %26
25: ; preds = %14
br label %10
26: ; preds = %22, %19, %16
br label %10
27: ; preds = %10
%28 = load i64, i64* %6
%29 = load i64, i64* %7
%30 = load i64, i64* %8
%31 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %28, i64 %29, i64 %30)
ret i32 0
}

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