#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 *, ...);
void util_print_bitmap(int bitmap) {
  for (int y = 0; y < 4; ++y) {
    for (int x = 0; x < 4; ++x) {
      int mask = 1 << (y * 4 + x);
      printf("%c ", (bitmap & mask) ? 'x' : '.');
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<util_print_bitmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    119e <util_print_bitmap+0x8e>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1182 <util_print_bitmap+0x72>
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
add    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    -0x10(%rbp),%ecx
mov    $0x2e,%esi
mov    $0x78,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <util_print_bitmap+0x23>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <util_print_bitmap+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_print_bitmap>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebp
test   $0x1,%bpl
mov    $0x2e,%r15d
mov    $0x78,%r14d
mov    $0x78,%esi
cmove  %r15d,%esi
lea    0xeb7(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x2,%bpl
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x4,%bpl
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x8,%bpl
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   $0x10,%bpl
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x20,%bpl
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x40,%bpl
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x80,%bpl
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   $0x100,%ebp
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x200,%ebp
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x400,%ebp
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x800,%ebp
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   $0x1000,%ebp
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x2000,%ebp
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x4000,%ebp
mov    $0x78,%esi
cmove  %r15d,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x8000,%ebp
cmove  %r15d,%r14d
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c \00"
define void @util_print_bitmap(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 46, i32 120
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = and i32 %0, 2
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 46, i32 120
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = and i32 %0, 4
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 46, i32 120
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = and i32 %0, 8
%15 = icmp eq i32 %14, 0
%16 = select i1 %15, i32 46, i32 120
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = tail call i32 @putchar(i32 10)
%19 = and i32 %0, 16
%20 = icmp eq i32 %19, 0
%21 = select i1 %20, i32 46, i32 120
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = and i32 %0, 32
%24 = icmp eq i32 %23, 0
%25 = select i1 %24, i32 46, i32 120
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = and i32 %0, 64
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, i32 46, i32 120
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = and i32 %0, 128
%32 = icmp eq i32 %31, 0
%33 = select i1 %32, i32 46, i32 120
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = tail call i32 @putchar(i32 10)
%36 = and i32 %0, 256
%37 = icmp eq i32 %36, 0
%38 = select i1 %37, i32 46, i32 120
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %38)
%40 = and i32 %0, 512
%41 = icmp eq i32 %40, 0
%42 = select i1 %41, i32 46, i32 120
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %42)
%44 = and i32 %0, 1024
%45 = icmp eq i32 %44, 0
%46 = select i1 %45, i32 46, i32 120
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %46)
%48 = and i32 %0, 2048
%49 = icmp eq i32 %48, 0
%50 = select i1 %49, i32 46, i32 120
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %50)
%52 = tail call i32 @putchar(i32 10)
%53 = and i32 %0, 4096
%54 = icmp eq i32 %53, 0
%55 = select i1 %54, i32 46, i32 120
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %55)
%57 = and i32 %0, 8192
%58 = icmp eq i32 %57, 0
%59 = select i1 %58, i32 46, i32 120
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %59)
%61 = and i32 %0, 16384
%62 = icmp eq i32 %61, 0
%63 = select i1 %62, i32 46, i32 120
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %63)
%65 = and i32 %0, 32768
%66 = icmp eq i32 %65, 0
%67 = select i1 %66, i32 46, i32 120
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %67)
%69 = tail call i32 @putchar(i32 10)
ret void
}