#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 getchar();
int main(void) {
  char c;
  int nword, nspace, nother, nnum;
  nword = nspace = nother = nnum = 0;
  while ((c = getchar()) != '\n') {
    if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z') {
      nword++;
    } else if (c >= '0' && c <= '9') {
      nnum++;
    } else if (c == ' ') {
      nspace++;
    } else {
      nother++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     11ee <main+0xde>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     116b <main+0x5b>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    1185 <main+0x75>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1193 <main+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1193 <main+0x83>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11e9 <main+0xd9>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     11bb <main+0xab>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     11bb <main+0xab>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11e4 <main+0xd4>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    11d6 <main+0xc6>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11df <main+0xcf>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e4 <main+0xd4>
jmp    11e9 <main+0xd9>
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
store i32 0, i32* %5
store i32 0, i32* %4
store i32 0, i32* %3
br label %7
7: ; preds = %53, %0
%8 = call signext i8 (...) @getchar()
store i8 %8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %54
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %27, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 65
br i1 %22, label %23, label %30
23: ; preds = %19
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 90
br i1 %26, label %27, label %30
27: ; preds = %23, %15
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %53
30: ; preds = %23, %19
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = icmp sge i32 %32, 48
br i1 %33, label %34, label %41
34: ; preds = %30
%35 = load i8, i8* %2
%36 = sext i8 %35 to i32
%37 = icmp sle i32 %36, 57
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %52
41: ; preds = %34, %30
%42 = load i8, i8* %2
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 32
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = load i32, i32* %4
%47 = add nsw i32 %46, 1
store i32 %47, i32* %4
br label %51
48: ; preds = %41
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %51
51: ; preds = %48, %45
br label %52
52: ; preds = %51, %38
br label %53
53: ; preds = %52, %27
br label %7
54: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %6, label %3
3: ; preds = %0, %3
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
br i1 %5, label %6, label %3
6: ; preds = %3, %0
ret i32 0
}