#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*/ fputc(char, int /*<<< orphan*/ *);
void DumpCharacter(FILE *out, unsigned char *bitmap, int width, int height) {
  int x;
  int y;
  int c;
  for (y = 0; y < height; ++y) {
    fputc('\t', out);
    for (x = 0; x < width; x += 8) {
      c = bitmap[y * ((width + 7) / 8) + x / 8];
      if (c & 0x80) {
        fputc('X', out);
      } else {
        fputc('_', out);
      }
      if (c & 0x40) {
        fputc('X', out);
      } else {
        fputc('_', out);
      }
      if (c & 0x20) {
        fputc('X', out);
      } else {
        fputc('_', out);
      }
      if (c & 0x10) {
        fputc('X', out);
      } else {
        fputc('_', out);
      }
      if (c & 0x08) {
        fputc('X', out);
      } else {
        fputc('_', out);
      }
      if (c & 0x04) {
        fputc('X', out);
      } else {
        fputc('_', out);
      }
      if (c & 0x02) {
        fputc('X', out);
      } else {
        fputc('_', out);
      }
      if (c & 0x01) {
        fputc('X', out);
      } else {
        fputc('_', out);
      }
      fputc(',', out);
    }
    fputc('\n', out);
  }
}


x86 assembly (clang, -O0):
<DumpCharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    134d <DumpCharacter+0x23d>
mov    -0x8(%rbp),%rsi
mov    $0x9,%edi
call   1030 <fputc@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1331 <DumpCharacter+0x221>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x14(%rbp),%eax
add    $0x7,%eax
mov    $0x8,%esi
cltd
idiv   %esi
imul   %eax,%ecx
mov    -0x1c(%rbp),%eax
mov    $0x8,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x30(%rbp),%rax
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     11b7 <DumpCharacter+0xa7>
mov    -0x8(%rbp),%rsi
mov    $0x58,%edi
call   1030 <fputc@plt>
jmp    11c5 <DumpCharacter+0xb5>
mov    -0x8(%rbp),%rsi
mov    $0x5f,%edi
call   1030 <fputc@plt>
mov    -0x24(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     11e7 <DumpCharacter+0xd7>
mov    -0x8(%rbp),%rsi
mov    $0x58,%edi
call   1030 <fputc@plt>
jmp    11f5 <DumpCharacter+0xe5>
mov    -0x8(%rbp),%rsi
mov    $0x5f,%edi
call   1030 <fputc@plt>
mov    -0x24(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1217 <DumpCharacter+0x107>
mov    -0x8(%rbp),%rsi
mov    $0x58,%edi
call   1030 <fputc@plt>
jmp    1225 <DumpCharacter+0x115>
mov    -0x8(%rbp),%rsi
mov    $0x5f,%edi
call   1030 <fputc@plt>
mov    -0x24(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1247 <DumpCharacter+0x137>
mov    -0x8(%rbp),%rsi
mov    $0x58,%edi
call   1030 <fputc@plt>
jmp    1255 <DumpCharacter+0x145>
mov    -0x8(%rbp),%rsi
mov    $0x5f,%edi
call   1030 <fputc@plt>
mov    -0x24(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1277 <DumpCharacter+0x167>
mov    -0x8(%rbp),%rsi
mov    $0x58,%edi
call   1030 <fputc@plt>
jmp    1285 <DumpCharacter+0x175>
mov    -0x8(%rbp),%rsi
mov    $0x5f,%edi
call   1030 <fputc@plt>
mov    -0x24(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     12a7 <DumpCharacter+0x197>
mov    -0x8(%rbp),%rsi
mov    $0x58,%edi
call   1030 <fputc@plt>
jmp    12b5 <DumpCharacter+0x1a5>
mov    -0x8(%rbp),%rsi
mov    $0x5f,%edi
call   1030 <fputc@plt>
mov    -0x24(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     12d7 <DumpCharacter+0x1c7>
mov    -0x8(%rbp),%rsi
mov    $0x58,%edi
call   1030 <fputc@plt>
jmp    12e5 <DumpCharacter+0x1d5>
mov    -0x8(%rbp),%rsi
mov    $0x5f,%edi
call   1030 <fputc@plt>
mov    -0x24(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1307 <DumpCharacter+0x1f7>
mov    -0x8(%rbp),%rsi
mov    $0x58,%edi
call   1030 <fputc@plt>
jmp    1315 <DumpCharacter+0x205>
mov    -0x8(%rbp),%rsi
mov    $0x5f,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rsi
mov    $0x2c,%edi
call   1030 <fputc@plt>
mov    -0x1c(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x1c(%rbp)
jmp    114e <DumpCharacter+0x3e>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112d <DumpCharacter+0x1d>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpCharacter>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,0x18(%rsp)
mov    %rsi,0x20(%rsp)
mov    %ecx,0x10(%rsp)
test   %ecx,%ecx
jle    12d7 <DumpCharacter+0x1c7>
mov    %rdi,%rbx
mov    0x18(%rsp),%rcx
lea    0x7(%rcx),%eax
lea    0xe(%rcx),%edx
test   %eax,%eax
cmovns %eax,%edx
sar    $0x3,%edx
mov    %edx,0xc(%rsp)
movslq %ecx,%r14
xor    %eax,%eax
mov    %rax,(%rsp)
xor    %ecx,%ecx
jmp    118a <DumpCharacter+0x7a>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    0x14(%rsp),%ecx
add    $0x1,%ecx
mov    (%rsp),%rax
add    0xc(%rsp),%eax
mov    %rax,(%rsp)
cmp    0x10(%rsp),%ecx
je     12d7 <DumpCharacter+0x1c7>
mov    %ecx,0x14(%rsp)
mov    $0x9,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
cmpl   $0x0,0x18(%rsp)
jle    1160 <DumpCharacter+0x50>
mov    (%rsp),%rax
mov    %eax,%r15d
xor    %r13d,%r13d
jmp    11d4 <DumpCharacter+0xc4>
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x2c,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0x8,%r13
add    $0x1,%r15d
cmp    %r14,%r13
jge    1160 <DumpCharacter+0x50>
movslq %r15d,%rax
mov    0x20(%rsp),%rcx
movzbl (%rcx,%rax,1),%eax
movd   %eax,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa %xmm0,%xmm1
pand   0xe0b(%rip),%xmm1
pand   0xe13(%rip),%xmm0
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%r12d
mov    $0x5f,%ebp
mov    $0x5f,%edi
test   $0x80,%r12b
jne    122b <DumpCharacter+0x11b>
mov    $0x58,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x5f,%edi
test   $0x40,%r12b
jne    1243 <DumpCharacter+0x133>
mov    $0x58,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x5f,%edi
test   $0x20,%r12b
jne    125b <DumpCharacter+0x14b>
mov    $0x58,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x5f,%edi
test   $0x10,%r12b
jne    1273 <DumpCharacter+0x163>
mov    $0x58,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x5f,%edi
test   $0x8,%r12b
jne    128b <DumpCharacter+0x17b>
mov    $0x58,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x5f,%edi
test   $0x4,%r12b
jne    12a3 <DumpCharacter+0x193>
mov    $0x58,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x5f,%edi
test   $0x2,%r12b
jne    12bb <DumpCharacter+0x1ab>
mov    $0x58,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
test   $0x1,%r12b
jne    11b0 <DumpCharacter+0xa0>
mov    $0x58,%ebp
jmp    11b0 <DumpCharacter+0xa0>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @DumpCharacter(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %10
br label %12
12: ; preds = %125, %4
%13 = load i32, i32* %10
%14 = load i32, i32* %8
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %128
16: ; preds = %12
%17 = load i32*, i32** %5
%18 = call i32 @fputc(i8 signext 9, i32* %17)
store i32 0, i32* %9
br label %19
19: ; preds = %119, %16
%20 = load i32, i32* %9
%21 = load i32, i32* %7
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %122
23: ; preds = %19
%24 = load i8*, i8** %6
%25 = load i32, i32* %10
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 7
%28 = sdiv i32 %27, 8
%29 = mul nsw i32 %25, %28
%30 = load i32, i32* %9
%31 = sdiv i32 %30, 8
%32 = add nsw i32 %29, %31
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %24, i64 %33
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
store i32 %36, i32* %11
%37 = load i32, i32* %11
%38 = and i32 %37, 128
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %23
%41 = load i32*, i32** %5
%42 = call i32 @fputc(i8 signext 88, i32* %41)
br label %46
43: ; preds = %23
%44 = load i32*, i32** %5
%45 = call i32 @fputc(i8 signext 95, i32* %44)
br label %46
46: ; preds = %43, %40
%47 = load i32, i32* %11
%48 = and i32 %47, 64
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %46
%51 = load i32*, i32** %5
%52 = call i32 @fputc(i8 signext 88, i32* %51)
br label %56
53: ; preds = %46
%54 = load i32*, i32** %5
%55 = call i32 @fputc(i8 signext 95, i32* %54)
br label %56
56: ; preds = %53, %50
%57 = load i32, i32* %11
%58 = and i32 %57, 32
%59 = icmp ne i32 %58, 0
br i1 %59, label %60, label %63
60: ; preds = %56
%61 = load i32*, i32** %5
%62 = call i32 @fputc(i8 signext 88, i32* %61)
br label %66
63: ; preds = %56
%64 = load i32*, i32** %5
%65 = call i32 @fputc(i8 signext 95, i32* %64)
br label %66
66: ; preds = %63, %60
%67 = load i32, i32* %11
%68 = and i32 %67, 16
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %66
%71 = load i32*, i32** %5
%72 = call i32 @fputc(i8 signext 88, i32* %71)
br label %76
73: ; preds = %66
%74 = load i32*, i32** %5
%75 = call i32 @fputc(i8 signext 95, i32* %74)
br label %76
76: ; preds = %73, %70
%77 = load i32, i32* %11
%78 = and i32 %77, 8
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %83
80: ; preds = %76
%81 = load i32*, i32** %5
%82 = call i32 @fputc(i8 signext 88, i32* %81)
br label %86
83: ; preds = %76
%84 = load i32*, i32** %5
%85 = call i32 @fputc(i8 signext 95, i32* %84)
br label %86
86: ; preds = %83, %80
%87 = load i32, i32* %11
%88 = and i32 %87, 4
%89 = icmp ne i32 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %86
%91 = load i32*, i32** %5
%92 = call i32 @fputc(i8 signext 88, i32* %91)
br label %96
93: ; preds = %86
%94 = load i32*, i32** %5
%95 = call i32 @fputc(i8 signext 95, i32* %94)
br label %96
96: ; preds = %93, %90
%97 = load i32, i32* %11
%98 = and i32 %97, 2
%99 = icmp ne i32 %98, 0
br i1 %99, label %100, label %103
100: ; preds = %96
%101 = load i32*, i32** %5
%102 = call i32 @fputc(i8 signext 88, i32* %101)
br label %106
103: ; preds = %96
%104 = load i32*, i32** %5
%105 = call i32 @fputc(i8 signext 95, i32* %104)
br label %106
106: ; preds = %103, %100
%107 = load i32, i32* %11
%108 = and i32 %107, 1
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %113
110: ; preds = %106
%111 = load i32*, i32** %5
%112 = call i32 @fputc(i8 signext 88, i32* %111)
br label %116
113: ; preds = %106
%114 = load i32*, i32** %5
%115 = call i32 @fputc(i8 signext 95, i32* %114)
br label %116
116: ; preds = %113, %110
%117 = load i32*, i32** %5
%118 = call i32 @fputc(i8 signext 44, i32* %117)
br label %119
119: ; preds = %116
%120 = load i32, i32* %9
%121 = add nsw i32 %120, 8
store i32 %121, i32* %9
br label %19
122: ; preds = %19
%123 = load i32*, i32** %5
%124 = call i32 @fputc(i8 signext 10, i32* %123)
br label %125
125: ; preds = %122
%126 = load i32, i32* %10
%127 = add nsw i32 %126, 1
store i32 %127, i32* %10
br label %12
128: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @DumpCharacter(i32* nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %60
6: ; preds = %4
%7 = icmp sgt i32 %2, 0
%8 = add nsw i32 %2, 7
%9 = sdiv i32 %8, 8
%10 = sext i32 %2 to i64
br label %11
11: ; preds = %6, %56
%12 = phi i32 [ 0, %6 ], [ %58, %56 ]
%13 = tail call i32 @fputc(i8 signext 9, i32* %0)
br i1 %7, label %14, label %56
14: ; preds = %11
%15 = mul nsw i32 %12, %9
br label %16
16: ; preds = %14, %16
%17 = phi i64 [ 0, %14 ], [ %54, %16 ]
%18 = lshr exact i64 %17, 3
%19 = trunc i64 %18 to i32
%20 = add nsw i32 %15, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %1, i64 %21
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = insertelement <8 x i32> poison, i32 %24, i64 0
%26 = shufflevector <8 x i32> %25, <8 x i32> poison, <8 x i32> zeroinitializer
%27 = and <8 x i32> %26, <i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64, i32 128>
%28 = icmp eq <8 x i32> %27, zeroinitializer
%29 = extractelement <8 x i1> %28, i64 7
%30 = select i1 %29, i8 95, i8 88
%31 = tail call i32 @fputc(i8 signext %30, i32* %0)
%32 = extractelement <8 x i1> %28, i64 6
%33 = select i1 %32, i8 95, i8 88
%34 = tail call i32 @fputc(i8 signext %33, i32* %0)
%35 = extractelement <8 x i1> %28, i64 5
%36 = select i1 %35, i8 95, i8 88
%37 = tail call i32 @fputc(i8 signext %36, i32* %0)
%38 = extractelement <8 x i1> %28, i64 4
%39 = select i1 %38, i8 95, i8 88
%40 = tail call i32 @fputc(i8 signext %39, i32* %0)
%41 = extractelement <8 x i1> %28, i64 3
%42 = select i1 %41, i8 95, i8 88
%43 = tail call i32 @fputc(i8 signext %42, i32* %0)
%44 = extractelement <8 x i1> %28, i64 2
%45 = select i1 %44, i8 95, i8 88
%46 = tail call i32 @fputc(i8 signext %45, i32* %0)
%47 = extractelement <8 x i1> %28, i64 1
%48 = select i1 %47, i8 95, i8 88
%49 = tail call i32 @fputc(i8 signext %48, i32* %0)
%50 = extractelement <8 x i1> %28, i64 0
%51 = select i1 %50, i8 95, i8 88
%52 = tail call i32 @fputc(i8 signext %51, i32* %0)
%53 = tail call i32 @fputc(i8 signext 44, i32* %0)
%54 = add nuw i64 %17, 8
%55 = icmp slt i64 %54, %10
br i1 %55, label %16, label %56
56: ; preds = %16, %11
%57 = tail call i32 @fputc(i8 signext 10, i32* %0)
%58 = add nuw nsw i32 %12, 1
%59 = icmp eq i32 %58, %3
br i1 %59, label %60, label %11
60: ; preds = %56, %4
ret void
}