#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 /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char words[255];
  scanf("%[^\n]", words);
  int count = 0;
  char letter;
  for (int i = 0; i < strlen(words); i++) {
    letter = words[i];
    if (letter != ' ' && letter != '.') {
      count++;
    } else {
      if (count == 0) {
        ;
      } else {
        printf("%d", count);
        if (letter != '.') {
          printf(" ");
        }
      }
      count = 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0x114(%rbp)
movl   $0x0,-0x11c(%rbp)
mov    -0x11c(%rbp),%eax
mov    %eax,-0x120(%rbp)
lea    -0x110(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x120(%rbp),%eax
cmp    %ecx,%eax
jge    1245 <main+0x115>
movslq -0x11c(%rbp),%rax
mov    -0x110(%rbp,%rax,1),%al
mov    %al,-0x115(%rbp)
movsbl -0x115(%rbp),%eax
cmp    $0x20,%eax
je     11d9 <main+0xa9>
movsbl -0x115(%rbp),%eax
cmp    $0x2e,%eax
je     11d9 <main+0xa9>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    122c <main+0xfc>
cmpl   $0x0,-0x114(%rbp)
jne    11eb <main+0xbb>
jmp    1222 <main+0xf2>
mov    -0x114(%rbp),%esi
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x115(%rbp),%eax
cmp    $0x2e,%eax
je     121d <main+0xed>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1222 <main+0xf2>
movl   $0x0,-0x114(%rbp)
jmp    1231 <main+0x101>
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
jmp    1169 <main+0x39>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x100,%rsp
lea    0xeaa(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11cf <main+0x8f>
xor    %ebx,%ebx
lea    0xe90(%rip),%r14
mov    %rsp,%r15
xor    %esi,%esi
jmp    119a <main+0x5a>
nopl   (%rax)
add    $0x1,%esi
mov    %esi,%ebp
add    $0x1,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
mov    %ebp,%esi
cmp    %rax,%rbx
jge    11cf <main+0x8f>
movzbl (%rsp,%rbx,1),%r12d
cmp    $0x20,%r12b
je     11ab <main+0x6b>
cmp    $0x2e,%r12b
jne    1180 <main+0x40>
xor    %ebp,%ebp
test   %esi,%esi
je     1185 <main+0x45>
xor    %ebp,%ebp
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x2e,%r12b
je     1185 <main+0x45>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1185 <main+0x45>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%[^\0A]\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %21, %0
ret i32 0
7: ; preds = %0, %21
%8 = phi i64 [ %23, %21 ], [ 0, %0 ]
%9 = phi i32 [ %22, %21 ], [ 0, %0 ]
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 %8
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 46
switch i8 %11, label %13 [
i8 46, label %15
i8 32, label %15
]
13: ; preds = %7
%14 = add nsw i32 %9, 1
br label %21
15: ; preds = %7, %7
%16 = icmp eq i32 %9, 0
br i1 %16, label %21, label %17
17: ; preds = %15
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br i1 %12, label %21, label %19
19: ; preds = %17
%20 = call i32 @putchar(i32 32)
br label %21
21: ; preds = %15, %19, %17, %13
%22 = phi i32 [ %14, %13 ], [ 0, %17 ], [ 0, %19 ], [ 0, %15 ]
%23 = add nuw nsw i64 %8, 1
%24 = call i32 @strlen(i8* %2)
%25 = sext i32 %24 to i64
%26 = icmp slt i64 %23, %25
br i1 %26, label %7, label %6
}