#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() {
  int c;
  int num_spaces, num_tabs, num_newlines;
  num_spaces = num_tabs = num_newlines = 0;
  printf("---------------------------\n");
  while ((c = getchar()) != EOF) {
    if (c == ' ')
      ++num_spaces;
    else if (c == '\t')
      ++num_tabs;
    else if (c == '\n')
      ++num_newlines;
  }
  printf("\n---------------------------\n"
         "Number of Blanks: %d\n"
         "Number of Tabs: %d\n"
         "Number of Newlines: %d\n"
         "---------------------------\n",
         num_spaces, num_tabs, num_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)
lea    0xf11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%eax
je     11bd <main+0x9d>
cmpl   $0x20,-0x8(%rbp)
jne    1183 <main+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b8 <main+0x98>
cmpl   $0x9,-0x8(%rbp)
jne    119b <main+0x7b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b3 <main+0x93>
cmpl   $0xa,-0x8(%rbp)
jne    11ae <main+0x8e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b3 <main+0x93>
jmp    11b8 <main+0x98>
jmp    1152 <main+0x32>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe33(%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
lea    0xf3b(%rip),%rdi
call   1030 <puts@plt>
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e94(%rip),%r15
mov    $0x0,%ebx
mov    $0x0,%ebp
cmp    (%r15),%eax
jne    1185 <main+0x55>
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     1163 <main+0x33>
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):
@.str = [29 x i8] c"---------------------------\0A\00"
@EOF = global i32 0
@.str.1 = [121 x i8] c"\0A---------------------------\0ANumber of Blanks: %d\0ANumber of Tabs: %d\0ANumber of Newlines: %d\0A---------------------------\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
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %31, %0
%8 = call i32 (...) @getchar()
store i32 %8, i32* %2
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %32
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 32
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %31
17: ; preds = %11
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 9
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %30
23: ; preds = %17
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 10
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %29
29: ; preds = %26, %23
br label %30
30: ; preds = %29, %20
br label %31
31: ; preds = %30, %14
br label %7
32: ; preds = %7
%33 = load i32, i32* %3
%34 = load i32, i32* %4
%35 = load i32, i32* %5
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([121 x i8], [121 x i8]* @.str.1, i64 0, i64 0), i32 %33, i32 %34, i32 %35)
ret i32 0
}

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