#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void dumpchar(int *rows) {
  int row, p, pixels;
  fprintf(stderr, "\n");
  for (row = 0; row < 18; row++) {
    pixels = rows[row];
    p = 512;
    while (p > 0) {
      if (pixels & p) {
        fprintf(stderr, "#");
      } else {
        fprintf(stderr, ".");
      }
      p >>= 1;
    }
    fprintf(stderr, "\n");
  }
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<dumpchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x12,-0xc(%rbp)
jge    11d0 <dumpchar+0xc0>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
movl   $0x200,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    11ad <dumpchar+0x9d>
mov    -0x14(%rbp),%eax
and    -0x10(%rbp),%eax
cmp    $0x0,%eax
je     118a <dumpchar+0x7a>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe82(%rip),%rsi
call   1030 <fprintf@plt>
jmp    119f <dumpchar+0x8f>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
lea    0xe6a(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1157 <dumpchar+0x47>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
lea    0xe43(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <dumpchar+0x28>
mov    0x2e09(%rip),%rax
mov    (%rax),%edi
lea    0xe20(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpchar>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,(%rsp)
mov    0x2eba(%rip),%r12
mov    (%r12),%edi
lea    0xeef(%rip),%rsi
call   1030 <fprintf@plt>
xor    %ebx,%ebx
lea    0xee5(%rip),%r13
lea    0xedc(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    (%rsp),%rax
mov    (%rax,%rbx,4),%ebp
test   $0x200,%ebp
mov    (%r12),%edi
mov    %r15,%rsi
cmove  %r13,%rsi
call   1030 <fprintf@plt>
test   $0x100,%ebp
mov    %r15,%rsi
cmove  %r13,%rsi
mov    (%r12),%edi
call   1030 <fprintf@plt>
movd   %ebp,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa %xmm0,%xmm1
pand   0xe68(%rip),%xmm1
pand   0xe70(%rip),%xmm0
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%r14d
test   $0x80,%r14b
mov    %r15,%rsi
cmovne %r13,%rsi
mov    (%r12),%edi
call   1030 <fprintf@plt>
test   $0x40,%r14b
mov    %r15,%rsi
cmovne %r13,%rsi
mov    (%r12),%edi
call   1030 <fprintf@plt>
test   $0x20,%r14b
mov    %r15,%rsi
cmovne %r13,%rsi
mov    (%r12),%edi
call   1030 <fprintf@plt>
test   $0x10,%r14b
mov    %r15,%rsi
cmovne %r13,%rsi
mov    (%r12),%edi
call   1030 <fprintf@plt>
test   $0x8,%r14b
mov    %r15,%rsi
cmovne %r13,%rsi
mov    (%r12),%edi
call   1030 <fprintf@plt>
test   $0x4,%r14b
mov    %r15,%rsi
cmovne %r13,%rsi
mov    (%r12),%edi
call   1030 <fprintf@plt>
test   $0x2,%r14b
mov    %r15,%rsi
cmovne %r13,%rsi
mov    (%r12),%edi
call   1030 <fprintf@plt>
test   $0x1,%r14b
mov    %r15,%rsi
cmovne %r13,%rsi
mov    (%r12),%edi
call   1030 <fprintf@plt>
mov    (%r12),%edi
lea    0xdbc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    $0x12,%rbx
jne    1150 <dumpchar+0x40>
mov    (%r12),%edi
lea    0xd9e(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [2 x i8] c"#\00"
@.str.2 = [2 x i8] c".\00"
define void @dumpchar(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %8
8: ; preds = %37, %1
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 18
br i1 %10, label %11, label %40
11: ; preds = %8
%12 = load i32*, i32** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
store i32 %16, i32* %5
store i32 512, i32* %4
br label %17
17: ; preds = %31, %11
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %34
20: ; preds = %17
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = and i32 %21, %22
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %20
%26 = load i32, i32* @stderr
%27 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %31
28: ; preds = %20
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %28, %25
%32 = load i32, i32* %4
%33 = ashr i32 %32, 1
store i32 %33, i32* %4
br label %17
34: ; preds = %17
%35 = load i32, i32* @stderr
%36 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %37
37: ; preds = %34
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %8
40: ; preds = %8
%41 = load i32, i32* @stderr
%42 = call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [2 x i8] c"#\00"
@.str.2 = [2 x i8] c".\00"
define void @dumpchar(i32* nocapture %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %56, %4 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = and i32 %7, 512
%9 = icmp eq i32 %8, 0
%10 = load i32, i32* @stderr
%11 = select i1 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%12 = tail call i32 @fprintf(i32 %10, i8* %11)
%13 = and i32 %7, 256
%14 = icmp eq i32 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* %15)
%18 = insertelement <8 x i32> poison, i32 %7, i64 0
%19 = shufflevector <8 x i32> %18, <8 x i32> poison, <8 x i32> zeroinitializer
%20 = and <8 x i32> %19, <i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64, i32 128>
%21 = icmp eq <8 x i32> %20, zeroinitializer
%22 = extractelement <8 x i1> %21, i64 7
%23 = select i1 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%24 = load i32, i32* @stderr
%25 = tail call i32 @fprintf(i32 %24, i8* %23)
%26 = extractelement <8 x i1> %21, i64 6
%27 = select i1 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%28 = load i32, i32* @stderr
%29 = tail call i32 @fprintf(i32 %28, i8* %27)
%30 = extractelement <8 x i1> %21, i64 5
%31 = select i1 %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%32 = load i32, i32* @stderr
%33 = tail call i32 @fprintf(i32 %32, i8* %31)
%34 = extractelement <8 x i1> %21, i64 4
%35 = select i1 %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%36 = load i32, i32* @stderr
%37 = tail call i32 @fprintf(i32 %36, i8* %35)
%38 = extractelement <8 x i1> %21, i64 3
%39 = select i1 %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%40 = load i32, i32* @stderr
%41 = tail call i32 @fprintf(i32 %40, i8* %39)
%42 = extractelement <8 x i1> %21, i64 2
%43 = select i1 %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%44 = load i32, i32* @stderr
%45 = tail call i32 @fprintf(i32 %44, i8* %43)
%46 = extractelement <8 x i1> %21, i64 1
%47 = select i1 %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%48 = load i32, i32* @stderr
%49 = tail call i32 @fprintf(i32 %48, i8* %47)
%50 = extractelement <8 x i1> %21, i64 0
%51 = select i1 %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%52 = load i32, i32* @stderr
%53 = tail call i32 @fprintf(i32 %52, i8* %51)
%54 = load i32, i32* @stderr
%55 = tail call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%56 = add nuw nsw i64 %5, 1
%57 = icmp eq i64 %56, 18
br i1 %57, label %58, label %4
58: ; preds = %4
%59 = load i32, i32* @stderr
%60 = tail call i32 @fprintf(i32 %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}