#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 */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, float, float, float);
int main(int argc, char *argv[]) {
  float blanks = 0;
  float tabs = 0;
  float newlines = 0;
  char c;
  while ((c = getchar()) != EOF) {
    switch (c) {
    case ' ':
      ++blanks;
      break;
    case '\t':
      ++tabs;
      break;
    case '\n':
      ++newlines;
      break;
    }
  }
  printf("blanks:%.0f, tabs:%.0f, newlines:%.0f\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)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1d(%rbp)
movsbl %al,%eax
mov    0x2e86(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11e9 <main+0xc9>
movsbl -0x1d(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x9,%eax
je     11bb <main+0x9b>
jmp    1182 <main+0x62>
mov    -0x24(%rbp),%eax
sub    $0xa,%eax
je     11d2 <main+0xb2>
jmp    1193 <main+0x73>
mov    -0x24(%rbp),%eax
sub    $0x20,%eax
jne    11e4 <main+0xc4>
jmp    11a4 <main+0x84>
movss  0xe54(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11e4 <main+0xc4>
movss  0xe3d(%rip),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    11e4 <main+0xc4>
movss  0xe26(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    114e <main+0x2e>
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
lea    0xe05(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb5(%rip),%rbx
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
cmp    (%rbx),%al
jne    1178 <main+0x58>
lea    0xeab(%rip),%rdi
movss  0x8(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
jmp    11bf <main+0x9f>
cs nopw 0x0(%rax,%rax,1)
nop
movss  0xc(%rsp),%xmm0
addss  0xe52(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
je     1152 <main+0x32>
movsbl %al,%eax
cmp    $0x9,%eax
je     11f0 <main+0xd0>
cmp    $0xa,%eax
je     11a0 <main+0x80>
cmp    $0x20,%eax
jne    11b4 <main+0x94>
movss  0x8(%rsp),%xmm0
addss  0xe21(%rip),%xmm0
movss  %xmm0,0x8(%rsp)
jmp    11b4 <main+0x94>
nopw   0x0(%rax,%rax,1)
movss  0x4(%rsp),%xmm0
addss  0xe02(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
jmp    11b4 <main+0x94>

LLVM IR (-O0):
@EOF = global i8 0
@.str = [39 x i8] c"blanks:%.0f, tabs:%.0f, newlines:%.0f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0.000000e+00, float* %6
store float 0.000000e+00, float* %7
store float 0.000000e+00, float* %8
br label %10
10: ; preds = %28, %2
%11 = call signext i8 (...) @getchar()
store i8 %11, i8* %9
%12 = sext i8 %11 to i32
%13 = load i8, i8* @EOF
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %12, %14
br i1 %15, label %16, label %29
16: ; preds = %10
%17 = load i8, i8* %9
%18 = sext i8 %17 to i32
switch i32 %18, label %28 [
i32 32, label %19
i32 9, label %22
i32 10, label %25
]
19: ; preds = %16
%20 = load float, float* %6
%21 = fadd float %20, 1.000000e+00
store float %21, float* %6
br label %28
22: ; preds = %16
%23 = load float, float* %7
%24 = fadd float %23, 1.000000e+00
store float %24, float* %7
br label %28
25: ; preds = %16
%26 = load float, float* %8
%27 = fadd float %26, 1.000000e+00
store float %27, float* %8
br label %28
28: ; preds = %16, %25, %22, %19
br label %10
29: ; preds = %10
%30 = load float, float* %6
%31 = load float, float* %7
%32 = load float, float* %8
%33 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), float %30, float %31, float %32)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [39 x i8] c"blanks:%.0f, tabs:%.0f, newlines:%.0f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call signext i8 (...) @getchar()
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
br i1 %5, label %25, label %6
6: ; preds = %2, %18
%7 = phi i8 [ %22, %18 ], [ %3, %2 ]
%8 = phi float [ %21, %18 ], [ 0.000000e+00, %2 ]
%9 = phi float [ %20, %18 ], [ 0.000000e+00, %2 ]
%10 = phi float [ %19, %18 ], [ 0.000000e+00, %2 ]
%11 = sext i8 %7 to i32
switch i32 %11, label %18 [
i32 32, label %12
i32 9, label %14
i32 10, label %16
]
12: ; preds = %6
%13 = fadd float %8, 1.000000e+00
br label %18
14: ; preds = %6
%15 = fadd float %10, 1.000000e+00
br label %18
16: ; preds = %6
%17 = fadd float %9, 1.000000e+00
br label %18
18: ; preds = %6, %16, %14, %12
%19 = phi float [ %10, %6 ], [ %10, %16 ], [ %15, %14 ], [ %10, %12 ]
%20 = phi float [ %9, %6 ], [ %17, %16 ], [ %9, %14 ], [ %9, %12 ]
%21 = phi float [ %8, %6 ], [ %8, %16 ], [ %8, %14 ], [ %13, %12 ]
%22 = tail call signext i8 (...) @getchar()
%23 = load i8, i8* @EOF
%24 = icmp eq i8 %22, %23
br i1 %24, label %25, label %6
25: ; preds = %18, %2
%26 = phi float [ 0.000000e+00, %2 ], [ %19, %18 ]
%27 = phi float [ 0.000000e+00, %2 ], [ %20, %18 ]
%28 = phi float [ 0.000000e+00, %2 ], [ %21, %18 ]
%29 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), float %28, float %26, float %27)
ret i32 0
}