#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 *, double, double, double);
int main() {
  int c;
  double b = 0;
  double n = 0;
  double t = 0;
  while ((c = getchar()) != EOF) {
    if (c == ' ') {
      ++b;
    }
    if (c == '\n') {
      ++n;
    }
    if (c == '\t') {
      ++t;
    }
  }
  printf(
      "Counts:\n\tBlanks = [%.0lf]\n\tNewlines = [%.0lf]\n\tTabs = [%.0lf]\n",
      b, n, t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%eax
je     11b9 <main+0x99>
cmpl   $0x20,-0x8(%rbp)
jne    117c <main+0x5c>
movsd  0xe8e(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    1198 <main+0x78>
movsd  0xe72(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x9,-0x8(%rbp)
jne    11b4 <main+0x94>
movsd  0xe56(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1147 <main+0x27>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb5(%rip),%rbx
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
cmp    (%rbx),%eax
jne    117b <main+0x5b>
lea    0xeac(%rip),%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
jmp    11ab <main+0x8b>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     1155 <main+0x35>
cmp    $0x20,%eax
je     11c0 <main+0xa0>
cmp    $0xa,%eax
je     11d9 <main+0xb9>
cmp    $0x9,%eax
jne    11a0 <main+0x80>
jmp    11f2 <main+0xd2>
nopl   0x0(%rax)
movsd  0x10(%rsp),%xmm0
addsd  0xe32(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
cmp    $0xa,%eax
jne    11b5 <main+0x95>
movsd  0x8(%rsp),%xmm0
addsd  0xe19(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
cmp    $0x9,%eax
jne    11a0 <main+0x80>
movsd  0x18(%rsp),%xmm0
addsd  0xe00(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
jmp    11a0 <main+0x80>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [63 x i8] c"Counts:\0A\09Blanks = [%.0lf]\0A\09Newlines = [%.0lf]\0A\09Tabs = [%.0lf]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
br label %6
6: ; preds = %28, %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 %29
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 32
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load double, double* %3
%15 = fadd double %14, 1.000000e+00
store double %15, double* %3
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 10
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load double, double* %4
%21 = fadd double %20, 1.000000e+00
store double %21, double* %4
br label %22
22: ; preds = %19, %16
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 9
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load double, double* %5
%27 = fadd double %26, 1.000000e+00
store double %27, double* %5
br label %28
28: ; preds = %25, %22
br label %6
29: ; preds = %6
%30 = load double, double* %3
%31 = load double, double* %4
%32 = load double, double* %5
%33 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), double %30, double %31, double %32)
ret i32 0
}

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