#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 printDisplay(unsigned char *display) {
  int i, j;
  for (i = 0; i < 48; i++) {
    for (j = 0; j < 64; j++) {
      if (display[i * 64 + j] != 0)
        printf("X");
      else
        printf(" ");
    }
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printDisplay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x30,-0xc(%rbp)
jge    11a5 <printDisplay+0x95>
movl   $0x0,-0x10(%rbp)
cmpl   $0x40,-0x10(%rbp)
jge    118b <printDisplay+0x7b>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116c <printDisplay+0x5c>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    1178 <printDisplay+0x68>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <printDisplay+0x6d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <printDisplay+0x24>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printDisplay+0x13>
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDisplay>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %r14d,%r14d
jmp    1138 <printDisplay+0x28>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
add    $0x40,%r15
cmp    $0x30,%r14
je     1162 <printDisplay+0x52>
xor    %ebx,%ebx
jmp    114f <printDisplay+0x3f>
nopl   0x0(%rax)
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x40,%rbx
je     1120 <printDisplay+0x10>
cmpb   $0x0,(%r15,%rbx,1)
mov    $0x20,%edi
je     1140 <printDisplay+0x30>
mov    $0x58,%edi
jmp    1140 <printDisplay+0x30>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printDisplay(i8* nocapture %0) {
br label %2
2: ; preds = %1, %15
%3 = phi i64 [ 0, %1 ], [ %17, %15 ]
%4 = shl nsw i64 %3, 6
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %13, %5 ]
%7 = add nuw nsw i64 %6, %4
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = select i1 %10, i32 32, i32 88
%12 = tail call i32 @putchar(i32 %11)
%13 = add nuw nsw i64 %6, 1
%14 = icmp eq i64 %13, 64
br i1 %14, label %15, label %5
15: ; preds = %5
%16 = tail call i32 @putchar(i32 10)
%17 = add nuw nsw i64 %3, 1
%18 = icmp eq i64 %17, 48
br i1 %18, label %19, label %2
19: ; preds = %15
%20 = tail call i32 @putchar(i32 10)
ret void
}