#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*/ free(char **);
scalar_t__ malloc(int);
int /*<<< orphan*/ mapGenerator(char **);
int /*<<< orphan*/ printArray(char **);
int /*<<< orphan*/ wallGenerator(char **);
int main(void) {
  int i;
  char **array;
  i = 0;
  array = (char **)malloc(sizeof(char *) * 9);
  while (i < 9) {
    array[i] = (char *)malloc(sizeof(char) * 9);
    i++;
  }
  wallGenerator(array);
  mapGenerator(array);
  printArray(array);
  free(array);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x48,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x9,-0x8(%rbp)
jge    11a5 <main+0x55>
mov    $0x9,%edi
call   1060 <malloc@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1174 <main+0x24>
mov    -0x10(%rbp),%rdi
call   1040 <wallGenerator@plt>
mov    -0x10(%rbp),%rdi
call   1050 <mapGenerator@plt>
mov    -0x10(%rbp),%rdi
call   1070 <printArray@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x48,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    $0x9,%edi
call   1060 <malloc@plt>
mov    %rax,(%rbx)
mov    $0x9,%edi
call   1060 <malloc@plt>
mov    %rax,0x8(%rbx)
mov    $0x9,%edi
call   1060 <malloc@plt>
mov    %rax,0x10(%rbx)
mov    $0x9,%edi
call   1060 <malloc@plt>
mov    %rax,0x18(%rbx)
mov    $0x9,%edi
call   1060 <malloc@plt>
mov    %rax,0x20(%rbx)
mov    $0x9,%edi
call   1060 <malloc@plt>
mov    %rax,0x28(%rbx)
mov    $0x9,%edi
call   1060 <malloc@plt>
mov    %rax,0x30(%rbx)
mov    $0x9,%edi
call   1060 <malloc@plt>
mov    %rax,0x38(%rbx)
mov    $0x9,%edi
call   1060 <malloc@plt>
mov    %rax,0x40(%rbx)
mov    %rbx,%rdi
call   1040 <wallGenerator@plt>
mov    %rbx,%rdi
call   1050 <mapGenerator@plt>
mov    %rbx,%rdi
call   1070 <printArray@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8**
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i64 @malloc(i32 72)
%5 = inttoptr i64 %4 to i8**
store i8** %5, i8*** %3
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 9
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = call i64 @malloc(i32 9)
%11 = inttoptr i64 %10 to i8*
%12 = load i8**, i8*** %3
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
store i8* %11, i8** %15
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %6
18: ; preds = %6
%19 = load i8**, i8*** %3
%20 = call i32 @wallGenerator(i8** %19)
%21 = load i8**, i8*** %3
%22 = call i32 @mapGenerator(i8** %21)
%23 = load i8**, i8*** %3
%24 = call i32 @printArray(i8** %23)
%25 = load i8**, i8*** %3
%26 = call i32 @free(i8** %25)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 72)
%2 = inttoptr i64 %1 to i8**
%3 = tail call i64 @malloc(i32 9)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = tail call i64 @malloc(i32 9)
%6 = inttoptr i64 %5 to i8*
%7 = getelementptr inbounds i8*, i8** %2, i64 1
store i8* %6, i8** %7
%8 = tail call i64 @malloc(i32 9)
%9 = inttoptr i64 %8 to i8*
%10 = getelementptr inbounds i8*, i8** %2, i64 2
store i8* %9, i8** %10
%11 = tail call i64 @malloc(i32 9)
%12 = inttoptr i64 %11 to i8*
%13 = getelementptr inbounds i8*, i8** %2, i64 3
store i8* %12, i8** %13
%14 = tail call i64 @malloc(i32 9)
%15 = inttoptr i64 %14 to i8*
%16 = getelementptr inbounds i8*, i8** %2, i64 4
store i8* %15, i8** %16
%17 = tail call i64 @malloc(i32 9)
%18 = inttoptr i64 %17 to i8*
%19 = getelementptr inbounds i8*, i8** %2, i64 5
store i8* %18, i8** %19
%20 = tail call i64 @malloc(i32 9)
%21 = inttoptr i64 %20 to i8*
%22 = getelementptr inbounds i8*, i8** %2, i64 6
store i8* %21, i8** %22
%23 = tail call i64 @malloc(i32 9)
%24 = inttoptr i64 %23 to i8*
%25 = getelementptr inbounds i8*, i8** %2, i64 7
store i8* %24, i8** %25
%26 = tail call i64 @malloc(i32 9)
%27 = inttoptr i64 %26 to i8*
%28 = getelementptr inbounds i8*, i8** %2, i64 8
store i8* %27, i8** %28
%29 = tail call i32 @wallGenerator(i8** %2)
%30 = tail call i32 @mapGenerator(i8** %2)
%31 = tail call i32 @printArray(i8** %2)
%32 = tail call i32 @free(i8** %2)
ret i32 0
}