#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 *, ...);
main() {
  int c, i, j, cont, estado;
  int len_word[10];
  estado = cont = j = 0;
  for (i = 0; i < 10; ++i)
    len_word[i] = 0;
  while ((c = getchar()) != EOF && c != '\n') {
    if (c == '\t' || c == ' ')
      estado = 1;
    else {
      if (estado == 1) {
        ++cont;
        estado = 0;
      }
      ++len_word[cont];
    }
  }
  printf("Longitud de las palabras:\n");
  for (i = 0; i < 10; ++i)
    printf(" %d", len_word[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    116f <main+0x4f>
movslq -0xc(%rbp),%rax
movl   $0x0,-0x40(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <main+0x2b>
jmp    1174 <main+0x54>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
mov    0x2e5f(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x41(%rbp)
je     119e <main+0x7e>
cmpl   $0xa,-0x8(%rbp)
setne  %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    11ae <main+0x8e>
jmp    11fc <main+0xdc>
cmpl   $0x9,-0x8(%rbp)
je     11c2 <main+0xa2>
cmpl   $0x20,-0x8(%rbp)
jne    11ce <main+0xae>
movl   $0x1,-0x18(%rbp)
jmp    11f7 <main+0xd7>
cmpl   $0x1,-0x18(%rbp)
jne    11e8 <main+0xc8>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movslq -0x14(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x40(%rbp,%rax,4)
jmp    1174 <main+0x54>
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    123f <main+0x11f>
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%esi
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1211 <main+0xf1>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movq   $0x0,0x40(%rsp)
movl   $0x0,0xc(%rsp)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%eax
je     1238 <main+0x108>
mov    0x2e75(%rip),%r12
mov    $0x0,%r8d
mov    $0x0,%ecx
mov    $0x0,%edi
mov    $0x0,%edx
mov    $0x0,%r15d
mov    $0x0,%r14d
mov    $0x0,%r13d
mov    $0x0,%ebp
mov    $0x0,%ebx
cmp    (%r12),%eax
je     124e <main+0x11e>
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x9,%eax
je     11ca <main+0x9a>
cmp    $0x20,%eax
jne    11e0 <main+0xb0>
mov    $0x1,%ebp
jmp    11f4 <main+0xc4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
cmp    $0x1,%ebp
sete   %al
add    %eax,%ebx
movslq %ebx,%rax
addl   $0x1,0x20(%rsp,%rax,4)
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%eax
je     1206 <main+0xd6>
cmp    (%r12),%eax
jne    11c0 <main+0x90>
mov    0x20(%rsp),%ebx
mov    0x24(%rsp),%ebp
mov    0x28(%rsp),%r13d
mov    0x2c(%rsp),%r14d
mov    0x30(%rsp),%r15d
mov    0x34(%rsp),%edx
mov    0x38(%rsp),%edi
mov    0x3c(%rsp),%ecx
mov    0x40(%rsp),%r8d
mov    0x44(%rsp),%eax
mov    %eax,0xc(%rsp)
jmp    124e <main+0x11e>
xor    %r8d,%r8d
xor    %ecx,%ecx
xor    %edi,%edi
xor    %edx,%edx
xor    %r15d,%r15d
xor    %r14d,%r14d
xor    %r13d,%r13d
xor    %ebp,%ebp
xor    %ebx,%ebx
mov    %edx,0x10(%rsp)
mov    %edi,0x14(%rsp)
mov    %ecx,0x18(%rsp)
mov    %r8d,0x1c(%rsp)
lea    0xd9e(%rip),%rdi
call   1030 <puts@plt>
lea    0xd8e(%rip),%r12
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    0x14(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    0x18(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    0x1c(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str.1 = [4 x i8] c" %d\00"
@str = [26 x i8] c"Longitud de las palabras:\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
%6 = icmp ne i32 %3, 10
%7 = and i1 %6, %5
br i1 %7, label %8, label %49
8: ; preds = %0, %20
%9 = phi i32 [ %23, %20 ], [ %3, %0 ]
%10 = phi i32 [ %22, %20 ], [ 0, %0 ]
%11 = phi i32 [ %21, %20 ], [ 0, %0 ]
switch i32 %9, label %12 [
i32 32, label %20
i32 9, label %20
]
12: ; preds = %8
%13 = icmp eq i32 %10, 1
%14 = zext i1 %13 to i32
%15 = add nsw i32 %11, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %17
br label %20
20: ; preds = %8, %8, %12
%21 = phi i32 [ %15, %12 ], [ %11, %8 ], [ %11, %8 ]
%22 = phi i32 [ 0, %12 ], [ 1, %8 ], [ 1, %8 ]
%23 = tail call i32 (...) @getchar()
%24 = load i32, i32* @EOF
%25 = icmp ne i32 %23, %24
%26 = icmp ne i32 %23, 10
%27 = and i1 %26, %25
br i1 %27, label %8, label %28
28: ; preds = %20
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%30 = load i32, i32* %29
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%32 = load i32, i32* %31
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%34 = load i32, i32* %33
%35 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%36 = load i32, i32* %35
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%38 = load i32, i32* %37
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%40 = load i32, i32* %39
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%42 = load i32, i32* %41
%43 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%44 = load i32, i32* %43
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%46 = load i32, i32* %45
%47 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%48 = load i32, i32* %47
br label %49
49: ; preds = %28, %0
%50 = phi i32 [ %48, %28 ], [ 0, %0 ]
%51 = phi i32 [ %46, %28 ], [ 0, %0 ]
%52 = phi i32 [ %44, %28 ], [ 0, %0 ]
%53 = phi i32 [ %42, %28 ], [ 0, %0 ]
%54 = phi i32 [ %40, %28 ], [ 0, %0 ]
%55 = phi i32 [ %38, %28 ], [ 0, %0 ]
%56 = phi i32 [ %36, %28 ], [ 0, %0 ]
%57 = phi i32 [ %34, %28 ], [ 0, %0 ]
%58 = phi i32 [ %32, %28 ], [ 0, %0 ]
%59 = phi i32 [ %30, %28 ], [ 0, %0 ]
%60 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %59)
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %58)
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %57)
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %56)
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %55)
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %54)
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %53)
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %52)
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %51)
%70 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %50)
ret i32 0
}