#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 u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
void print_glyph(u_int32_t *content, int height, int width) {
  int i, j;
  printf("/* +");
  for (i = 0; i < width; i++)
    printf("-");
  printf("+\n");
  for (i = 0; i < height; i++) {
    printf("   |");
    for (j = 0; j < width; j++)
      putchar(content[i + (j / 32) * height] & (1 << (31 - j % 32)) ? '*'
                                                                    : ' ');
    printf("|\n");
  }
  printf("   +");
  for (i = 0; i < width; i++)
    printf("-");
  printf("+ */\n");
  for (i = 0; i < height * ((width + 31) / 32); i++)
    printf("0x%08x,\n", content[i]);
}


x86 assembly (clang, -O0):
<print_glyph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    116f <print_glyph+0x4f>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <print_glyph+0x27>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    123e <print_glyph+0x11e>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1222 <print_glyph+0x102>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%eax
mov    $0x20,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x28(%rbp),%rax
imul   -0xc(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x1c(%rbp),%edx
mov    $0x1f,%ecx
sub    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
mov    $0x20,%eax
mov    $0x2a,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a5 <print_glyph+0x85>
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1184 <print_glyph+0x64>
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    127b <print_glyph+0x15b>
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1253 <print_glyph+0x133>
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
add    $0x1f,%eax
mov    $0x20,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x2c(%rbp),%eax
imul   %edx,%ecx
cmp    %ecx,%eax
jge    12de <print_glyph+0x1be>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1290 <print_glyph+0x170>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_glyph>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r13d
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r13d,%r13d
jle    116f <print_glyph+0x3f>
mov    %r13d,%ebx
nopl   0x0(%rax)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1160 <print_glyph+0x30>
lea    0xe97(%rip),%rdi
call   1040 <puts@plt>
test   %ebp,%ebp
jle    11f8 <print_glyph+0xc8>
lea    0xe82(%rip),%r12
xor    %ebx,%ebx
jmp    119f <print_glyph+0x6f>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1040 <puts@plt>
add    $0x1,%ebx
cmp    %ebp,%ebx
je     11f8 <print_glyph+0xc8>
lea    0xe5f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r13d,%r13d
jle    1190 <print_glyph+0x60>
xor    %r15d,%r15d
jmp    11ce <print_glyph+0x9e>
nopw   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    %r15d,%r13d
je     1190 <print_glyph+0x60>
mov    %r15d,%eax
shr    $0x5,%eax
imul   %ebp,%eax
add    %ebx,%eax
cltq
mov    (%r14,%rax,4),%eax
mov    %r15d,%ecx
not    %cl
movzbl %cl,%ecx
bt     %ecx,%eax
mov    $0x20,%edi
jae    11c0 <print_glyph+0x90>
mov    $0x2a,%edi
jmp    11c0 <print_glyph+0x90>
lea    0xe0b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r13d,%r13d
jle    121f <print_glyph+0xef>
mov    %r13d,%ebx
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1210 <print_glyph+0xe0>
lea    0xdf2(%rip),%rdi
call   1040 <puts@plt>
lea    0x1f(%r13),%eax
add    $0x3e,%r13d
test   %eax,%eax
cmovns %eax,%r13d
sar    $0x5,%r13d
imul   %ebp,%r13d
test   %r13d,%r13d
jle    1277 <print_glyph+0x147>
mov    %r13d,%ebp
lea    0xdbf(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1260 <print_glyph+0x130>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"/* +\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [3 x i8] c"+\0A\00"
@.str.3 = [5 x i8] c" |\00"
@.str.4 = [3 x i8] c"|\0A\00"
@.str.5 = [5 x i8] c" +\00"
@.str.6 = [6 x i8] c"+ */\0A\00"
@.str.7 = [9 x i8] c"0x%08x,\0A\00"
define void @print_glyph(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %10
10: ; preds = %16, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
store i32 %18, i32* %7
br label %10
19: ; preds = %10
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %7
br label %21
21: ; preds = %57, %19
%22 = load i32, i32* %7
%23 = load i32, i32* %5
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %60
25: ; preds = %21
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %8
br label %27
27: ; preds = %52, %25
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %55
31: ; preds = %27
%32 = load i32*, i32** %4
%33 = load i32, i32* %7
%34 = load i32, i32* %8
%35 = sdiv i32 %34, 32
%36 = load i32, i32* %5
%37 = mul nsw i32 %35, %36
%38 = add nsw i32 %33, %37
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %32, i64 %39
%41 = load i32, i32* %40
%42 = load i32, i32* %8
%43 = srem i32 %42, 32
%44 = sub nsw i32 31, %43
%45 = shl i32 1, %44
%46 = and i32 %41, %45
%47 = icmp ne i32 %46, 0
%48 = zext i1 %47 to i64
%49 = select i1 %47, i32 42, i32 32
%50 = trunc i32 %49 to i8
%51 = call i32 @putchar(i8 signext %50)
br label %52
52: ; preds = %31
%53 = load i32, i32* %8
%54 = add nsw i32 %53, 1
store i32 %54, i32* %8
br label %27
55: ; preds = %27
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %57
57: ; preds = %55
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
store i32 %59, i32* %7
br label %21
60: ; preds = %21
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %7
br label %62
62: ; preds = %68, %60
%63 = load i32, i32* %7
%64 = load i32, i32* %6
%65 = icmp slt i32 %63, %64
br i1 %65, label %66, label %71
66: ; preds = %62
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %68
68: ; preds = %66
%69 = load i32, i32* %7
%70 = add nsw i32 %69, 1
store i32 %70, i32* %7
br label %62
71: ; preds = %62
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %7
br label %73
73: ; preds = %88, %71
%74 = load i32, i32* %7
%75 = load i32, i32* %5
%76 = load i32, i32* %6
%77 = add nsw i32 %76, 31
%78 = sdiv i32 %77, 32
%79 = mul nsw i32 %75, %78
%80 = icmp slt i32 %74, %79
br i1 %80, label %81, label %91
81: ; preds = %73
%82 = load i32*, i32** %4
%83 = load i32, i32* %7
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i32, i32* %82, i64 %84
%86 = load i32, i32* %85
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %86)
br label %88
88: ; preds = %81
%89 = load i32, i32* %7
%90 = add nsw i32 %89, 1
store i32 %90, i32* %7
br label %73
91: ; preds = %73
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"/* +\00"
@.str.3 = [5 x i8] c" |\00"
@.str.5 = [5 x i8] c" +\00"
@.str.7 = [9 x i8] c"0x%08x,\0A\00"
@str = [2 x i8] c"+\00"
@str.8 = [5 x i8] c"+ */\00"
@str.9 = [2 x i8] c"|\00"
define void @print_glyph(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %11
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 45)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %2
br i1 %10, label %11, label %6
11: ; preds = %6, %3
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%13 = icmp sgt i32 %1, 0
br i1 %13, label %14, label %38
14: ; preds = %11, %34
%15 = phi i32 [ %36, %34 ], [ 0, %11 ]
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br i1 %5, label %17, label %34
17: ; preds = %14, %17
%18 = phi i32 [ %32, %17 ], [ 0, %14 ]
%19 = lshr i32 %18, 5
%20 = mul nsw i32 %19, %1
%21 = add nsw i32 %20, %15
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %0, i64 %22
%24 = load i32, i32* %23
%25 = and i32 %18, 31
%26 = xor i32 %25, 31
%27 = shl nuw i32 1, %26
%28 = and i32 %24, %27
%29 = icmp eq i32 %28, 0
%30 = select i1 %29, i8 32, i8 42
%31 = tail call i32 @putchar(i8 signext %30)
%32 = add nuw nsw i32 %18, 1
%33 = icmp eq i32 %32, %2
br i1 %33, label %34, label %17
34: ; preds = %17, %14
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.9, i64 0, i64 0))
%36 = add nuw nsw i32 %15, 1
%37 = icmp eq i32 %36, %1
br i1 %37, label %38, label %14
38: ; preds = %34, %11
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br i1 %5, label %40, label %45
40: ; preds = %38, %40
%41 = phi i32 [ %43, %40 ], [ 0, %38 ]
%42 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 45)
%43 = add nuw nsw i32 %41, 1
%44 = icmp eq i32 %43, %2
br i1 %44, label %45, label %40
45: ; preds = %40, %38
%46 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.8, i64 0, i64 0))
%47 = add nsw i32 %2, 31
%48 = sdiv i32 %47, 32
%49 = mul i32 %48, %1
%50 = icmp sgt i32 %49, 0
br i1 %50, label %51, label %60
51: ; preds = %45
%52 = zext i32 %49 to i64
br label %53
53: ; preds = %51, %53
%54 = phi i64 [ 0, %51 ], [ %58, %53 ]
%55 = getelementptr inbounds i32, i32* %0, i64 %54
%56 = load i32, i32* %55
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %56)
%58 = add nuw nsw i64 %54, 1
%59 = icmp eq i64 %58, %52
br i1 %59, label %60, label %53
60: ; preds = %53, %45
ret void
}