#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, int);
scalar_t__ separateur(int);
int main() {
  int lines, words, chars, c;
  int prec = '\n';
  lines = words = chars = 0;
  while ((c = getchar()) != EOF) {
    chars += 1;
    if (c == '\n')
      lines += 1;
    if (separateur(prec) && !separateur(c))
      words += 1;
    prec = c;
  }
  printf("%d %d %d\n", lines, words, chars);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e7c(%rip),%rcx
cmp    (%rcx),%eax
je     11c8 <main+0x98>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xa,-0x14(%rbp)
jne    1190 <main+0x60>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%edi
call   1050 <separateur@plt>
cmp    $0x0,%rax
je     11bd <main+0x8d>
mov    -0x14(%rbp),%edi
call   1050 <separateur@plt>
cmp    $0x0,%rax
jne    11bd <main+0x8d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115b <main+0x2b>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe28(%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   %r13
push   %r12
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2e9c(%rip),%rcx
mov    $0x0,%r13d
mov    $0x0,%ebx
cmp    (%rcx),%eax
jne    1180 <main+0x50>
lea    0xe9e(%rip),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    %r13d,%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    $0xa,%r15d
xor    %ebx,%ebx
xor    %r13d,%r13d
xor    %r14d,%r14d
jmp    11ab <main+0x7b>
mov    %r12b,%bpl
add    %ebp,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%r13d
mov    0x2e41(%rip),%rcx
cmp    (%rcx),%eax
je     115b <main+0x2b>
mov    %r15d,%edi
mov    %eax,%r15d
xor    %ebp,%ebp
cmp    $0xa,%eax
sete   %r12b
call   1050 <separateur@plt>
test   %rax,%rax
je     1190 <main+0x60>
mov    %r15d,%edi
call   1050 <separateur@plt>
cmp    $0x1,%rax
adc    $0x0,%r14d
jmp    1190 <main+0x60>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [10 x i8] c"%d %d %d\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 10, i32* %6
store i32 0, i32* %4
store i32 0, i32* %3
store i32 0, i32* %2
br label %7
7: ; preds = %30, %0
%8 = call i32 (...) @getchar()
store i32 %8, i32* %5
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %32
11: ; preds = %7
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
store i32 %13, i32* %4
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %19
19: ; preds = %16, %11
%20 = load i32, i32* %6
%21 = call i64 @separateur(i32 %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %30
23: ; preds = %19
%24 = load i32, i32* %5
%25 = call i64 @separateur(i32 %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %23
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %30
30: ; preds = %27, %23, %19
%31 = load i32, i32* %5
store i32 %31, i32* %6
br label %7
32: ; preds = %7
%33 = load i32, i32* %2
%34 = load i32, i32* %3
%35 = load i32, i32* %4
%36 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %33, i32 %34, i32 %35)
ret i32 0
}

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