#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 printArray(int tiles[53][29]) {
  int i, j;
  for (i = 0; i < 29; i++) {
    for (j = 0; j < 53; j++) {
      if (tiles[i][j] == 0)
        printf(".");
      else if (tiles[i][j] == 1)
        printf("#");
      else
        printf("Q");
    }
    printf("\n");
  }
  printf("\n-----------------------------------\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1d,-0xc(%rbp)
jge    11d8 <printArray+0xc8>
movl   $0x0,-0x10(%rbp)
cmpl   $0x35,-0x10(%rbp)
jge    11be <printArray+0xae>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x74,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    116c <printArray+0x5c>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    11ab <printArray+0x9b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x74,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    119a <printArray+0x8a>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
jmp    11a6 <printArray+0x96>
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
jmp    11ab <printArray+0x9b>
jmp    11b0 <printArray+0xa0>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <printArray+0x24>
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printArray+0x13>
lea    0xe27(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %r14d,%r14d
mov    $0x2e,%r15d
jmp    1158 <printArray+0x38>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
add    $0x74,%rbx
cmp    $0x1d,%r14
je     1189 <printArray+0x69>
xor    %ebp,%ebp
jmp    1175 <printArray+0x55>
nopl   0x0(%rax)
test   %eax,%eax
cmove  %r15d,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    $0x35,%rbp
je     1140 <printArray+0x20>
mov    (%rbx,%rbp,4),%eax
mov    $0x23,%edi
cmp    $0x1,%eax
je     1160 <printArray+0x40>
mov    $0x51,%edi
jmp    1160 <printArray+0x40>
lea    0xe70(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@str = [37 x i8] c"\0A-----------------------------------\00"
define void @printArray([29 x i32]* nocapture %0) {
br label %2
2: ; preds = %1, %15
%3 = phi i64 [ 0, %1 ], [ %17, %15 ]
br label %4
4: ; preds = %2, %4
%5 = phi i64 [ 0, %2 ], [ %13, %4 ]
%6 = getelementptr inbounds [29 x i32], [29 x i32]* %0, i64 %3, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 1
%9 = select i1 %8, i32 35, i32 81
%10 = icmp eq i32 %7, 0
%11 = select i1 %10, i32 46, i32 %9
%12 = tail call i32 @putchar(i32 %11)
%13 = add nuw nsw i64 %5, 1
%14 = icmp eq i64 %13, 53
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = tail call i32 @putchar(i32 10)
%17 = add nuw nsw i64 %3, 1
%18 = icmp eq i64 %17, 29
br i1 %18, label %19, label %2
19: ; preds = %15
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}