#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
scalar_t__ isgraph(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ *stdin;
main() {
  register int c, cc = 0, wc = 0, lc = 0;
  FILE *f = stdin;
  while ((c = getc(f)) != EOF) {
    ++cc;
    if (isgraph(c)) {
      ++wc;
      do {
        c = getc(f);
        if (c == EOF)
          goto done;
        ++cc;
      } while (isgraph(c));
    }
    if (c == '\n')
      ++lc;
  }
done:
  printf("%8d%8d%8d\n", lc, wc, cc);
}


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    0x2e8d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e6b(%rip),%rcx
cmp    (%rcx),%eax
je     11fc <main+0xcc>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
je     11e4 <main+0xb4>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e29(%rip),%rcx
cmp    (%rcx),%eax
jne    11c4 <main+0x94>
jmp    1201 <main+0xd1>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
jne    11a1 <main+0x71>
jmp    11e4 <main+0xb4>
cmpl   $0xa,-0x8(%rbp)
jne    11f7 <main+0xc7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1162 <main+0x32>
jmp    1201 <main+0xd1>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xdef(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2ea6(%rip),%rax
mov    (%rax),%r12
mov    %r12,%rdi
call   1050 <getc@plt>
mov    0x2e8c(%rip),%r13
xor    %r14d,%r14d
mov    $0x0,%ebp
mov    $0x0,%r15d
cmp    0x0(%r13),%eax
jne    118d <main+0x5d>
lea    0xe91(%rip),%rdi
mov    %r14d,%esi
mov    %r15d,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebx
xor    %r14d,%r14d
xor    %r15d,%r15d
xor    %ebp,%ebp
jmp    11bb <main+0x8b>
nopl   0x0(%rax)
xor    %eax,%eax
cmp    $0xa,%ebx
sete   %al
add    %eax,%r14d
mov    %r12,%rdi
call   1050 <getc@plt>
mov    %eax,%ebx
cmp    0x0(%r13),%eax
je     1168 <main+0x38>
add    $0x1,%ebp
mov    %ebx,%edi
call   1040 <isgraph@plt>
test   %rax,%rax
je     11a0 <main+0x70>
add    $0x1,%r15d
xchg   %ax,%ax
mov    %r12,%rdi
call   1050 <getc@plt>
cmp    0x0(%r13),%eax
je     1168 <main+0x38>
mov    %eax,%ebx
add    $0x1,%ebp
mov    %eax,%edi
call   1040 <isgraph@plt>
test   %rax,%rax
jne    11d0 <main+0xa0>
jmp    11a0 <main+0x70>

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

LLVM IR (-O2):
@stdin = global i32* null
@EOF = global i32 0
@.str = [11 x i8] c"%8d%8d%8d\0A\00"
define i32 @main() {
%1 = load i32*, i32** @stdin
%2 = tail call i32 @getc(i32* %1)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %34, label %5
5: ; preds = %0, %24
%6 = phi i32 [ %31, %24 ], [ %2, %0 ]
%7 = phi i32 [ %30, %24 ], [ 0, %0 ]
%8 = phi i32 [ %26, %24 ], [ 0, %0 ]
%9 = phi i32 [ %25, %24 ], [ 0, %0 ]
%10 = add nsw i32 %9, 1
%11 = tail call i64 @isgraph(i32 %6)
%12 = icmp eq i64 %11, 0
br i1 %12, label %24, label %13
13: ; preds = %5
%14 = add nsw i32 %8, 1
br label %15
15: ; preds = %20, %13
%16 = phi i32 [ %10, %13 ], [ %21, %20 ]
%17 = tail call i32 @getc(i32* %1)
%18 = load i32, i32* @EOF
%19 = icmp eq i32 %17, %18
br i1 %19, label %34, label %20
20: ; preds = %15
%21 = add nsw i32 %16, 1
%22 = tail call i64 @isgraph(i32 %17)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %15
24: ; preds = %20, %5
%25 = phi i32 [ %10, %5 ], [ %21, %20 ]
%26 = phi i32 [ %8, %5 ], [ %14, %20 ]
%27 = phi i32 [ %6, %5 ], [ %17, %20 ]
%28 = icmp eq i32 %27, 10
%29 = zext i1 %28 to i32
%30 = add nuw nsw i32 %7, %29
%31 = tail call i32 @getc(i32* %1)
%32 = load i32, i32* @EOF
%33 = icmp eq i32 %31, %32
br i1 %33, label %34, label %5
34: ; preds = %24, %15, %0
%35 = phi i32 [ 0, %0 ], [ %7, %15 ], [ %30, %24 ]
%36 = phi i32 [ 0, %0 ], [ %16, %15 ], [ %25, %24 ]
%37 = phi i32 [ 0, %0 ], [ %14, %15 ], [ %26, %24 ]
%38 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %35, i32 %37, i32 %36)
ret i32 0
}