#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*/ putchar(char);
main() {
  char c;
  int i, str_len;
  str_len = 0;
  while ((c = getchar()) != EOF) {
    if (c == ' ' || c == '\n' || c == '\t') {
      putchar('\n');
      for (i = 0; i < str_len; i++) {
        putchar('-');
      }
      str_len = 0;
    } else {
      str_len++;
    }
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e9e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11cb <main+0xab>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     117c <main+0x5c>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     117c <main+0x5c>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    11bd <main+0x9d>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11b1 <main+0x91>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118d <main+0x6d>
movl   $0x0,-0x10(%rbp)
jmp    11c6 <main+0xa6>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <main+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb3(%rip),%r15
cmp    (%r15),%al
jne    1151 <main+0x31>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
movabs $0x100000600,%r14
xor    %ebp,%ebp
jmp    1173 <main+0x53>
nop
add    $0x1,%ebp
mov    %ebp,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %ebx,%ebp
cmp    (%r15),%al
je     113a <main+0x1a>
cmp    $0x20,%al
ja     1160 <main+0x40>
movzbl %al,%eax
bt     %rax,%r14
jae    1160 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebx,%ebx
test   %ebp,%ebp
jle    1165 <main+0x45>
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1190 <main+0x70>
jmp    1165 <main+0x45>

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %5
5: ; preds = %38, %0
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %2
%7 = sext i8 %6 to i32
%8 = load i8, i8* @EOF
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %7, %9
br i1 %10, label %11, label %39
11: ; preds = %5
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 32
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 10
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 9
br i1 %22, label %23, label %35
23: ; preds = %19, %15, %11
%24 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %3
br label %25
25: ; preds = %31, %23
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = call i32 @putchar(i8 signext 45)
br label %31
31: ; preds = %29
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %25
34: ; preds = %25
store i32 0, i32* %4
br label %38
35: ; preds = %19
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %38
38: ; preds = %35, %34
br label %5
39: ; preds = %5
%40 = call i32 @putchar(i8 signext 10)
%41 = load i32, i32* %1
ret i32 %41
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %22, label %4
4: ; preds = %0, %17
%5 = phi i8 [ %19, %17 ], [ %1, %0 ]
%6 = phi i32 [ %18, %17 ], [ 0, %0 ]
switch i8 %5, label %15 [
i8 32, label %7
i8 10, label %7
i8 9, label %7
]
7: ; preds = %4, %4, %4
%8 = tail call i32 @putchar(i8 signext 10)
%9 = icmp sgt i32 %6, 0
br i1 %9, label %10, label %17
10: ; preds = %7, %10
%11 = phi i32 [ %13, %10 ], [ 0, %7 ]
%12 = tail call i32 @putchar(i8 signext 45)
%13 = add nuw nsw i32 %11, 1
%14 = icmp eq i32 %13, %6
br i1 %14, label %17, label %10
15: ; preds = %4
%16 = add nsw i32 %6, 1
br label %17
17: ; preds = %10, %7, %15
%18 = phi i32 [ %16, %15 ], [ 0, %7 ], [ 0, %10 ]
%19 = tail call signext i8 (...) @getchar()
%20 = load i8, i8* @EOF
%21 = icmp eq i8 %19, %20
br i1 %21, label %22, label %4
22: ; preds = %17, %0
%23 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}