#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 printGamePlan(int plane[50][50], int size) {
  int i = 0, j = 0;
  printf("\n");
  for (i = 0; i < size + 1; i++) {
    printf("_");
  }
  printf("\n");
  for (i = 0; i < size; i++) {
    printf("|");
    for (j = 0; j < size; j++) {
      if (plane[i][j]) {
        printf("*");
      } else {
        printf(" ");
      }
    }
    printf("|\n");
  }
  for (i = 0; i < size + 1; i++) {
    printf("-");
  }
}


x86 assembly (clang, -O0):
<printGamePlan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    116b <printGamePlan+0x5b>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1140 <printGamePlan+0x30>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1213 <printGamePlan+0x103>
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11f9 <printGamePlan+0xe9>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0xc8,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11da <printGamePlan+0xca>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
jmp    11e6 <printGamePlan+0xd6>
lea    0xe25(%rip),%rdi
call   1030 <printf@plt>
jmp    11eb <printGamePlan+0xdb>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119d <printGamePlan+0x8d>
lea    0xe08(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117e <printGamePlan+0x6e>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1245 <printGamePlan+0x135>
lea    0xdd9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    121a <printGamePlan+0x10a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printGamePlan>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %rdi,%r13
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r15d,%r15d
js     11ff <printGamePlan+0xdf>
mov    $0xffffffff,%ebx
nopl   0x0(%rax)
mov    $0x5f,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    %ebx,%r15d
jne    1150 <printGamePlan+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r15d,%r15d
jle    11d2 <printGamePlan+0xb2>
mov    %r15d,%ebp
xor    %r12d,%r12d
lea    0xe82(%rip),%r14
jmp    1198 <printGamePlan+0x78>
mov    %r14,%rdi
call   1040 <puts@plt>
add    $0x1,%r12
add    $0xc8,%r13
cmp    %rbp,%r12
je     11d2 <printGamePlan+0xb2>
mov    $0x7c,%edi
call   1030 <putchar@plt>
xor    %ebx,%ebx
jmp    11be <printGamePlan+0x9e>
cs nopw 0x0(%rax,%rax,1)
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
je     1180 <printGamePlan+0x60>
cmpl   $0x0,0x0(%r13,%rbx,4)
mov    $0x20,%edi
je     11b0 <printGamePlan+0x90>
mov    $0x2a,%edi
jmp    11b0 <printGamePlan+0x90>
test   %r15d,%r15d
js     11f0 <printGamePlan+0xd0>
add    $0x1,%r15d
nopl   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r15d
jne    11e0 <printGamePlan+0xc0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"|\00"
define void @printGamePlan([50 x i32]* nocapture %0, i32 %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = icmp slt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @putchar(i32 10)
br label %39
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ 0, %2 ]
%9 = tail call i32 @putchar(i32 95)
%10 = add nuw i32 %8, 1
%11 = icmp eq i32 %8, %1
br i1 %11, label %12, label %7
12: ; preds = %7
%13 = tail call i32 @putchar(i32 10)
%14 = icmp sgt i32 %1, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = zext i32 %1 to i64
br label %18
17: ; preds = %30, %12
br i1 %4, label %39, label %34
18: ; preds = %30, %15
%19 = phi i64 [ 0, %15 ], [ %32, %30 ]
%20 = tail call i32 @putchar(i32 124)
br label %21
21: ; preds = %18, %21
%22 = phi i64 [ 0, %18 ], [ %28, %21 ]
%23 = getelementptr inbounds [50 x i32], [50 x i32]* %0, i64 %19, i64 %22
%24 = load i32, i32* %23
%25 = icmp eq i32 %24, 0
%26 = select i1 %25, i32 32, i32 42
%27 = tail call i32 @putchar(i32 %26)
%28 = add nuw nsw i64 %22, 1
%29 = icmp eq i64 %28, %16
br i1 %29, label %30, label %21
30: ; preds = %21
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%32 = add nuw nsw i64 %19, 1
%33 = icmp eq i64 %32, %16
br i1 %33, label %17, label %18
34: ; preds = %17, %34
%35 = phi i32 [ %37, %34 ], [ 0, %17 ]
%36 = tail call i32 @putchar(i32 45)
%37 = add nuw i32 %35, 1
%38 = icmp eq i32 %35, %1
br i1 %38, label %39, label %34
39: ; preds = %34, %5, %17
ret void
}