#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 printWordMasked(const char *word, const bool *mask) {
  for (; *word; word++) {
    if (mask[*word - 'a']) {
      putchar(*word);
    } else {
      putchar('-');
    }
  }
}


x86 assembly (clang, -O0):
<printWordMasked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1179 <printWordMasked+0x69>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x61,%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1159 <printWordMasked+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    1163 <printWordMasked+0x53>
mov    $0x2d,%edi
call   1030 <putchar@plt>
jmp    1168 <printWordMasked+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <printWordMasked+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printWordMasked>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1156 <printWordMasked+0x46>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
mov    $0x2d,%ebp
nopl   0x0(%rax)
movsbq %al,%rax
cmpl   $0x0,-0x184(%r14,%rax,4)
movzbl %al,%eax
cmove  %ebp,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <printWordMasked+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @printWordMasked(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
br label %5
5: ; preds = %26, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %29
9: ; preds = %5
%10 = load i32*, i32** %4
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %10, i64 %15
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %9
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = call i32 @putchar(i8 signext %21)
br label %25
23: ; preds = %9
%24 = call i32 @putchar(i8 signext 45)
br label %25
25: ; preds = %23, %19
br label %26
26: ; preds = %25
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
br label %5
29: ; preds = %5
ret void
}

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