#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 *, char *, char *);
void PLY_PrintMask(char *msg, unsigned char m) {
  char str[9] = "00000000";
  int i;
  for (i = 0; i < 8; i++) {
    if (m & 0x01)
      str[7 - i] = '1';
    m = m >> 1;
  }
  printf("%s : %s\n", msg, str);
}


x86 assembly (clang, -O0):
<PLY_PrintMask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xed5(%rip),%al
mov    %al,-0xa(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    117e <PLY_PrintMask+0x6e>
movzbl -0x9(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1166 <PLY_PrintMask+0x56>
mov    $0x7,%eax
sub    -0x18(%rbp),%eax
cltq
movb   $0x31,-0x12(%rbp,%rax,1)
movzbl -0x9(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x9(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113d <PLY_PrintMask+0x2d>
mov    -0x8(%rbp),%rsi
lea    -0x12(%rbp),%rdx
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PLY_PrintMask>:
sub    $0x18,%rsp
mov    %rdi,%rax
movabs $0x3030303030303030,%rcx
30 30 30
mov    %rcx,0x8(%rsp)
movb   $0x0,0x10(%rsp)
test   $0x1,%sil
jne    1173 <PLY_PrintMask+0x63>
test   $0x2,%sil
jne    117e <PLY_PrintMask+0x6e>
test   $0x4,%sil
jne    1189 <PLY_PrintMask+0x79>
test   $0x8,%sil
jne    1194 <PLY_PrintMask+0x84>
test   $0x10,%sil
jne    119f <PLY_PrintMask+0x8f>
test   $0x20,%sil
jne    11aa <PLY_PrintMask+0x9a>
test   $0x40,%sil
jne    11b5 <PLY_PrintMask+0xa5>
test   %sil,%sil
js     11bf <PLY_PrintMask+0xaf>
lea    0xea8(%rip),%rdi
lea    0x8(%rsp),%rdx
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x18,%rsp
ret
movb   $0x31,0xf(%rsp)
test   $0x2,%sil
je     1137 <PLY_PrintMask+0x27>
movb   $0x31,0xe(%rsp)
test   $0x4,%sil
je     113d <PLY_PrintMask+0x2d>
movb   $0x31,0xd(%rsp)
test   $0x8,%sil
je     1143 <PLY_PrintMask+0x33>
movb   $0x31,0xc(%rsp)
test   $0x10,%sil
je     1149 <PLY_PrintMask+0x39>
movb   $0x31,0xb(%rsp)
test   $0x20,%sil
je     114f <PLY_PrintMask+0x3f>
movb   $0x31,0xa(%rsp)
test   $0x40,%sil
je     1155 <PLY_PrintMask+0x45>
movb   $0x31,0x9(%rsp)
test   %sil,%sil
jns    115a <PLY_PrintMask+0x4a>
movb   $0x31,0x8(%rsp)
jmp    115a <PLY_PrintMask+0x4a>

LLVM IR (-O0):
@__const.PLY_PrintMask.str = [9 x i8] c"00000000\00"
@.str = [9 x i8] c"%s : %s\0A\00"
define void @PLY_PrintMask(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca [9 x i8]
%6 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%7 = bitcast [9 x i8]* %5 to i8*
store i32 0, i32* %6
br label %8
8: ; preds = %26, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = and i32 %13, 1
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = load i32, i32* %6
%18 = sub nsw i32 7, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 %19
store i8 49, i8* %20
br label %21
21: ; preds = %16, %11
%22 = load i8, i8* %4
%23 = zext i8 %22 to i32
%24 = ashr i32 %23, 1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %4
br label %26
26: ; preds = %21
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %8
29: ; preds = %8
%30 = load i8*, i8** %3
%31 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%32 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %30, i8* %31)
ret void
}

LLVM IR (-O2):
@__const.PLY_PrintMask.str = [9 x i8] c"00000000\00"
@.str = [9 x i8] c"%s : %s\0A\00"
define void @PLY_PrintMask(i8* %0, i8 zeroext %1) {
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = and i8 %1, 1
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 7
store i8 49, i8* %8
br label %9
9: ; preds = %7, %2
%10 = and i8 %1, 2
%11 = icmp eq i8 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 6
store i8 49, i8* %13
br label %14
14: ; preds = %12, %9
%15 = and i8 %1, 4
%16 = icmp eq i8 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 5
store i8 49, i8* %18
br label %19
19: ; preds = %17, %14
%20 = and i8 %1, 8
%21 = icmp eq i8 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 4
store i8 49, i8* %23
br label %24
24: ; preds = %22, %19
%25 = and i8 %1, 16
%26 = icmp eq i8 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %24
%28 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 3
store i8 49, i8* %28
br label %29
29: ; preds = %27, %24
%30 = and i8 %1, 32
%31 = icmp eq i8 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %29
%33 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 2
store i8 49, i8* %33
br label %34
34: ; preds = %32, %29
%35 = and i8 %1, 64
%36 = icmp eq i8 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %34
%38 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 1
store i8 49, i8* %38
br label %39
39: ; preds = %37, %34
%40 = icmp sgt i8 %1, -1
br i1 %40, label %42, label %41
41: ; preds = %39
store i8 49, i8* %4
br label %42
42: ; preds = %41, %39
%43 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}