#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 main() {
  char c;
  int cnt_space, cnt_table, cnt_lf;
  cnt_space = 0;
  cnt_table = 0;
  cnt_lf = 0;
  while ((c = getchar()) != EOF) {
    if (c == ' ')
      ++cnt_space;
    if (c == '\t')
      ++cnt_table;
    if (c == '\n')
      ++cnt_lf;
  }
  printf("空格个数  ：%d\n", cnt_space);
  printf("制表符个数：%d\n", cnt_table);
  printf("换行符个数：%d\n", cnt_lf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e90(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11aa <main+0x8a>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1179 <main+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    118f <main+0x6f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    11a5 <main+0x85>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
mov    -0xc(%rbp),%esi
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb1(%rip),%r15
mov    $0x0,%ebx
mov    $0x0,%r14d
cmp    (%r15),%al
je     1178 <main+0x58>
xor    %r14d,%r14d
xor    %ebx,%ebx
xor    %ebp,%ebp
xchg   %ax,%ax
xor    %ecx,%ecx
cmp    $0x20,%al
sete   %cl
add    %ecx,%ebp
xor    %ecx,%ecx
cmp    $0x9,%al
sete   %cl
add    %ecx,%ebx
xor    %ecx,%ecx
cmp    $0xa,%al
sete   %cl
add    %ecx,%r14d
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r15),%al
jne    1150 <main+0x30>
lea    0xe81(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xe88(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i8 0
@.str = [21 x i8] c"\E7\A9\BA\E6\A0\BC\E4\B8\AA\E6\95\B0 \EF\BC\9A%d\0A\00"
@.str.1 = [22 x i8] c"\E5\88\B6\E8\A1\A8\E7\AC\A6\E4\B8\AA\E6\95\B0\EF\BC\9A%d\0A\00"
@.str.2 = [22 x i8] c"\E6\8D\A2\E8\A1\8C\E7\AC\A6\E4\B8\AA\E6\95\B0\EF\BC\9A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %33, %0
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %2
%8 = sext i8 %7 to i32
%9 = load i8, i8* @EOF
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %8, %10
br i1 %11, label %12, label %34
12: ; preds = %6
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 32
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %12
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 9
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %26
26: ; preds = %23, %19
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 10
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %33
33: ; preds = %30, %26
br label %6
34: ; preds = %6
%35 = load i32, i32* %3
%36 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %4
%38 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %5
%40 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %39)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [21 x i8] c"\E7\A9\BA\E6\A0\BC\E4\B8\AA\E6\95\B0 \EF\BC\9A%d\0A\00"
@.str.1 = [22 x i8] c"\E5\88\B6\E8\A1\A8\E7\AC\A6\E4\B8\AA\E6\95\B0\EF\BC\9A%d\0A\00"
@.str.2 = [22 x i8] c"\E6\8D\A2\E8\A1\8C\E7\AC\A6\E4\B8\AA\E6\95\B0\EF\BC\9A%d\0A\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %21, label %4
4: ; preds = %0, %4
%5 = phi i8 [ %18, %4 ], [ %1, %0 ]
%6 = phi i32 [ %17, %4 ], [ 0, %0 ]
%7 = phi i32 [ %14, %4 ], [ 0, %0 ]
%8 = phi i32 [ %11, %4 ], [ 0, %0 ]
%9 = icmp eq i8 %5, 32
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %8, %10
%12 = icmp eq i8 %5, 9
%13 = zext i1 %12 to i32
%14 = add nuw nsw i32 %7, %13
%15 = icmp eq i8 %5, 10
%16 = zext i1 %15 to i32
%17 = add nuw nsw i32 %6, %16
%18 = tail call signext i8 (...) @getchar()
%19 = load i8, i8* @EOF
%20 = icmp eq i8 %18, %19
br i1 %20, label %21, label %4
21: ; preds = %4, %0
%22 = phi i32 [ 0, %0 ], [ %11, %4 ]
%23 = phi i32 [ 0, %0 ], [ %14, %4 ]
%24 = phi i32 [ 0, %0 ], [ %17, %4 ]
%25 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %22)
%26 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%27 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %24)
ret i32 0
}