#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);
int main() {
  int c;
  int nl = 0;
  while ((c = getchar()) != EOF)
    if (c == '\n' | c == ' ' | c == '\t')
      ++nl;
  printf("%d blanks, tabs, or new lines\n", nl);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     1190 <main+0x70>
cmpl   $0xa,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x20,-0x8(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmpl   $0x9,-0x8(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     118b <main+0x6b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb3(%rip),%r14
cmp    (%r14),%eax
jne    1150 <main+0x30>
lea    0xebf(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
movabs $0x100000600,%r15
xor    %ebx,%ebx
jmp    116c <main+0x4c>
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
je     113a <main+0x1a>
cmp    $0x20,%eax
ja     1160 <main+0x40>
mov    %eax,%eax
bt     %rax,%r15
jae    1160 <main+0x40>
add    $0x1,%ebx
jmp    1160 <main+0x40>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [31 x i8] c"%d blanks, tabs, or new lines\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %24, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %25
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
%11 = zext i1 %10 to i32
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 32
%14 = zext i1 %13 to i32
%15 = or i32 %11, %14
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 9
%18 = zext i1 %17 to i32
%19 = or i32 %15, %18
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %8
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %8
br label %4
25: ; preds = %4
%26 = load i32, i32* %3
%27 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [31 x i8] c"%d blanks, tabs, or new lines\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 %14, label %4
4: ; preds = %0, %9
%5 = phi i32 [ %11, %9 ], [ %1, %0 ]
%6 = phi i32 [ %10, %9 ], [ 0, %0 ]
switch i32 %5, label %9 [
i32 32, label %7
i32 10, label %7
i32 9, label %7
]
7: ; preds = %4, %4, %4
%8 = add nsw i32 %6, 1
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ %8, %7 ], [ %6, %4 ]
%11 = tail call i32 (...) @getchar()
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %4
14: ; preds = %9, %0
%15 = phi i32 [ 0, %0 ], [ %10, %9 ]
%16 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}