#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void rc_print_mask(FILE *f, unsigned int mask) {
  if (mask & 1)
    fprintf(f, "x");
  if (mask & 2)
    fprintf(f, "y");
  if (mask & 4)
    fprintf(f, "z");
  if (mask & 8)
    fprintf(f, "w");
}


x86 assembly (clang, -O0):
<rc_print_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <rc_print_mask+0x2e>
mov    -0x8(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     115d <rc_print_mask+0x4d>
mov    -0x8(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     117c <rc_print_mask+0x6c>
mov    -0x8(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     119b <rc_print_mask+0x8b>
mov    -0x8(%rbp),%rdi
lea    0xe70(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_print_mask>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   $0x1,%bpl
jne    1137 <rc_print_mask+0x27>
test   $0x2,%bpl
jne    114a <rc_print_mask+0x3a>
test   $0x4,%bpl
jne    115d <rc_print_mask+0x4d>
test   $0x8,%bpl
jne    1170 <rc_print_mask+0x60>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x78,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
test   $0x2,%bpl
je     1124 <rc_print_mask+0x14>
mov    $0x79,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
test   $0x4,%bpl
je     112a <rc_print_mask+0x1a>
mov    $0x7a,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
test   $0x8,%bpl
je     1130 <rc_print_mask+0x20>
mov    $0x77,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"x\00"
@.str.1 = [2 x i8] c"y\00"
@.str.2 = [2 x i8] c"z\00"
@.str.3 = [2 x i8] c"w\00"
define void @rc_print_mask(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = and i32 %12, 2
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32*, i32** %3
%17 = call i32 @fprintf(i32* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %15, %11
%19 = load i32, i32* %4
%20 = and i32 %19, 4
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load i32*, i32** %3
%24 = call i32 @fprintf(i32* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %22, %18
%26 = load i32, i32* %4
%27 = and i32 %26, 8
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = load i32*, i32** %3
%31 = call i32 @fprintf(i32* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %32
32: ; preds = %29, %25
ret void
}

LLVM IR (-O2):
define void @rc_print_mask(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @fputc(i32 120, i32* %0)
br label %7
7: ; preds = %5, %2
%8 = and i32 %1, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @fputc(i32 121, i32* %0)
br label %12
12: ; preds = %10, %7
%13 = and i32 %1, 4
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 @fputc(i32 122, i32* %0)
br label %17
17: ; preds = %15, %12
%18 = and i32 %1, 8
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 @fputc(i32 119, i32* %0)
br label %22
22: ; preds = %20, %17
ret void
}