#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 *, int, int, int);
int main(int argc, char **argv) {
  int iFlag = 0, nc = 0, nl = 0, nw = 0;
  char cChar = 0;
  while ((cChar = getchar()) != EOF) {
    ++nc;
    if (cChar == '\n') {
      ++nl;
    }
    if ((cChar == ' ') || (cChar == '\t') || (cChar == '\n')) {
      iFlag = 0;
    } else {
      if (iFlag == 0) {
        ++nw;
        iFlag = 1;
      }
    }
  }
  printf("It have %d character, %d line and %d words.\n", nc, nl, nw);
  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)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movb   $0x0,-0x21(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x21(%rbp)
movsbl %al,%eax
mov    0x2e7e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11eb <main+0xcb>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0xa,%eax
jne    1194 <main+0x74>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x20,%eax
je     11bb <main+0x9b>
movsbl -0x21(%rbp),%eax
cmp    $0x9,%eax
je     11bb <main+0x9b>
movsbl -0x21(%rbp),%eax
cmp    $0xa,%eax
jne    11c7 <main+0xa7>
movl   $0x0,-0x14(%rbp)
jmp    11e6 <main+0xc6>
cmpl   $0x0,-0x14(%rbp)
jne    11e1 <main+0xc1>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movl   $0x1,-0x14(%rbp)
jmp    11e6 <main+0xc6>
jmp    1156 <main+0x36>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe05(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ead(%rip),%r15
mov    $0x0,%ebp
mov    $0x0,%r14d
cmp    (%r15),%al
jne    116f <main+0x4f>
lea    0xeae(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movabs $0x100000600,%r12
xor    %r14d,%r14d
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %r13d,%r13d
jmp    11b1 <main+0x91>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x1,%r13d
adc    $0x0,%r14d
mov    $0x1,%r13d
mov    %dl,%cl
add    %ecx,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    (%r15),%al
je     114b <main+0x2b>
xor    %ecx,%ecx
cmp    $0xa,%al
sete   %dl
cmp    $0x20,%al
ja     1190 <main+0x70>
movzbl %al,%eax
bt     %rax,%r12
jae    1190 <main+0x70>
xor    %r13d,%r13d
jmp    119e <main+0x7e>

LLVM IR (-O0):
@EOF = global i8 0
@.str = [45 x i8] c"It have %d character, %d line and %d words.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i8 0, i8* %10
br label %11
11: ; preds = %46, %2
%12 = call signext i8 (...) @getchar()
store i8 %12, i8* %10
%13 = sext i8 %12 to i32
%14 = load i8, i8* @EOF
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %13, %15
br i1 %16, label %17, label %47
17: ; preds = %11
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
store i32 %19, i32* %7
%20 = load i8, i8* %10
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 10
br i1 %22, label %23, label %26
23: ; preds = %17
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %26
26: ; preds = %23, %17
%27 = load i8, i8* %10
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 32
br i1 %29, label %38, label %30
30: ; preds = %26
%31 = load i8, i8* %10
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 9
br i1 %33, label %38, label %34
34: ; preds = %30
%35 = load i8, i8* %10
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 10
br i1 %37, label %38, label %39
38: ; preds = %34, %30, %26
store i32 0, i32* %6
br label %46
39: ; preds = %34
%40 = load i32, i32* %6
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = load i32, i32* %9
%44 = add nsw i32 %43, 1
store i32 %44, i32* %9
store i32 1, i32* %6
br label %45
45: ; preds = %42, %39
br label %46
46: ; preds = %45, %38
br label %11
47: ; preds = %11
%48 = load i32, i32* %7
%49 = load i32, i32* %8
%50 = load i32, i32* %9
%51 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %48, i32 %49, i32 %50)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [45 x i8] c"It have %d character, %d line and %d words.\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 %26, label %6
6: ; preds = %2, %20
%7 = phi i8 [ %23, %20 ], [ %3, %2 ]
%8 = phi i32 [ %22, %20 ], [ 0, %2 ]
%9 = phi i32 [ %15, %20 ], [ 0, %2 ]
%10 = phi i32 [ %12, %20 ], [ 0, %2 ]
%11 = phi i32 [ %21, %20 ], [ 0, %2 ]
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i8 %7, 10
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %9, %14
switch i8 %7, label %16 [
i8 32, label %20
i8 10, label %20
i8 9, label %20
]
16: ; preds = %6
%17 = icmp eq i32 %11, 0
%18 = zext i1 %17 to i32
%19 = add nsw i32 %8, %18
br label %20
20: ; preds = %16, %6, %6, %6
%21 = phi i32 [ 0, %6 ], [ 1, %16 ], [ 0, %6 ], [ 0, %6 ]
%22 = phi i32 [ %8, %6 ], [ %19, %16 ], [ %8, %6 ], [ %8, %6 ]
%23 = tail call signext i8 (...) @getchar()
%24 = load i8, i8* @EOF
%25 = icmp eq i8 %23, %24
br i1 %25, label %26, label %6
26: ; preds = %20, %2
%27 = phi i32 [ 0, %2 ], [ %12, %20 ]
%28 = phi i32 [ 0, %2 ], [ %15, %20 ]
%29 = phi i32 [ 0, %2 ], [ %22, %20 ]
%30 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %27, i32 %28, i32 %29)
ret i32 0
}