#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*/ putchar(char const);
void printword(const char *s) {
  if (!*s)
    putchar('-');
  while (*s) {
    if (*s == ' ')
      putchar('_');
    else if (*s == '\t')
      putchar('_');
    else if (*s == '\r')
      putchar('_');
    else if (*s == '\n')
      putchar('_');
    else
      putchar(*s);
    ++s;
  }
  putchar(' ');
}


x86 assembly (clang, -O0):
<printword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1133 <printword+0x23>
mov    $0x2d,%edi
call   1030 <putchar@plt>
jmp    1138 <printword+0x28>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     11ed <printword+0xdd>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1164 <printword+0x54>
mov    $0x5f,%edi
call   1030 <putchar@plt>
jmp    11dc <printword+0xcc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    1183 <printword+0x73>
mov    $0x5f,%edi
call   1030 <putchar@plt>
jmp    11d7 <printword+0xc7>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    11a2 <printword+0x92>
mov    $0x5f,%edi
call   1030 <putchar@plt>
jmp    11d2 <printword+0xc2>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    11c1 <printword+0xb1>
mov    $0x5f,%edi
call   1030 <putchar@plt>
jmp    11cd <printword+0xbd>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    11d2 <printword+0xc2>
jmp    11d7 <printword+0xc7>
jmp    11dc <printword+0xcc>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1138 <printword+0x28>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printword>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
jne    1126 <printword+0x16>
mov    $0x2d,%edi
call   1030 <putchar@plt>
movabs $0x100002600,%r14
jmp    114c <printword+0x3c>
mov    %eax,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %cl,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x20,%rax
ja     1132 <printword+0x22>
mov    $0x5f,%cl
bt     %rax,%r14
jb     1140 <printword+0x30>
test   %rax,%rax
jne    1132 <printword+0x22>
mov    $0x20,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @printword(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @putchar(i8 signext 45)
br label %8
8: ; preds = %6, %1
br label %9
9: ; preds = %48, %8
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %51
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 32
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = call i32 @putchar(i8 signext 95)
br label %48
20: ; preds = %13
%21 = load i8*, i8** %2
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 9
br i1 %24, label %25, label %27
25: ; preds = %20
%26 = call i32 @putchar(i8 signext 95)
br label %47
27: ; preds = %20
%28 = load i8*, i8** %2
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 13
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = call i32 @putchar(i8 signext 95)
br label %46
34: ; preds = %27
%35 = load i8*, i8** %2
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 10
br i1 %38, label %39, label %41
39: ; preds = %34
%40 = call i32 @putchar(i8 signext 95)
br label %45
41: ; preds = %34
%42 = load i8*, i8** %2
%43 = load i8, i8* %42
%44 = call i32 @putchar(i8 signext %43)
br label %45
45: ; preds = %41, %39
br label %46
46: ; preds = %45, %32
br label %47
47: ; preds = %46, %25
br label %48
48: ; preds = %47, %18
%49 = load i8*, i8** %2
%50 = getelementptr inbounds i8, i8* %49, i32 1
store i8* %50, i8** %2
br label %9
51: ; preds = %9
%52 = call i32 @putchar(i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @printword(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @putchar(i8 signext 45)
br label %6
6: ; preds = %4, %1
br label %7
7: ; preds = %6, %11
%8 = phi i8* [ %14, %11 ], [ %0, %6 ]
%9 = load i8, i8* %8
switch i8 %9, label %10 [
i8 0, label %15
i8 32, label %11
i8 9, label %11
i8 13, label %11
i8 10, label %11
]
10: ; preds = %7
br label %11
11: ; preds = %7, %7, %7, %7, %10
%12 = phi i8 [ %9, %10 ], [ 95, %7 ], [ 95, %7 ], [ 95, %7 ], [ 95, %7 ]
%13 = tail call i32 @putchar(i8 signext %12)
%14 = getelementptr inbounds i8, i8* %8, i64 1
br label %7
15: ; preds = %7
%16 = tail call i32 @putchar(i8 signext 32)
ret void
}