#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*/ addRandomEntrances(int **);
int /*<<< orphan*/ drawMaze(int **);
int getRandomNumber(int);
int /*<<< orphan*/ initialiseMazeArray(int **);
int /*<<< orphan*/ removeWalls(int **, int **, int, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int maze[13][13] = {{0}};
  int visited[13 / 2][13 / 2] = {{0}};
  srand(time(NULL));
  int startRow = getRandomNumber(13 / 2);
  int startCol = getRandomNumber(13 / 2);
  initialiseMazeArray(maze);
  removeWalls(maze, visited, startRow, startCol);
  addRandomEntrances(maze);
  system("cls");
  drawMaze(maze);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x2b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x2a4,%edx
call   1040 <memset@plt>
lea    -0x340(%rbp),%rdi
xor    %esi,%esi
mov    $0x90,%edx
call   1040 <memset@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    $0x6,%edi
call   10a0 <getRandomNumber@plt>
mov    %eax,-0x344(%rbp)
mov    $0x6,%edi
call   10a0 <getRandomNumber@plt>
mov    %eax,-0x348(%rbp)
lea    -0x2b0(%rbp),%rdi
call   1050 <initialiseMazeArray@plt>
lea    -0x2b0(%rbp),%rdi
lea    -0x340(%rbp),%rsi
mov    -0x344(%rbp),%edx
mov    -0x348(%rbp),%ecx
call   1090 <removeWalls@plt>
lea    -0x2b0(%rbp),%rdi
call   1070 <addRandomEntrances@plt>
lea    0xdca(%rip),%rdi
call   1030 <system@plt>
lea    -0x2b0(%rbp),%rdi
call   10b0 <drawMaze@plt>
lea    0xdb6(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x350,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x340,%rsp
lea    0x90(%rsp),%r14
mov    $0x2a4,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    $0x6,%edi
call   10a0 <getRandomNumber@plt>
mov    %eax,%ebp
mov    $0x6,%edi
call   10a0 <getRandomNumber@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1050 <initialiseMazeArray@plt>
mov    %rsp,%rsi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1090 <removeWalls@plt>
mov    %r14,%rdi
call   1070 <addRandomEntrances@plt>
lea    0xdd0(%rip),%rdi
call   1030 <system@plt>
mov    %r14,%rdi
call   10b0 <drawMaze@plt>
lea    0xdc0(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x [13 x i32]]
%3 = alloca [6 x [6 x i32]]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [13 x [13 x i32]]* %2 to i8*
%7 = bitcast [6 x [6 x i32]]* %3 to i8*
%8 = call i32 @time(i32* null)
%9 = call i32 @srand(i32 %8)
%10 = call i32 @getRandomNumber(i32 6)
store i32 %10, i32* %4
%11 = call i32 @getRandomNumber(i32 6)
store i32 %11, i32* %5
%12 = getelementptr inbounds [13 x [13 x i32]], [13 x [13 x i32]]* %2, i64 0, i64 0
%13 = bitcast [13 x i32]* %12 to i32**
%14 = call i32 @initialiseMazeArray(i32** %13)
%15 = getelementptr inbounds [13 x [13 x i32]], [13 x [13 x i32]]* %2, i64 0, i64 0
%16 = bitcast [13 x i32]* %15 to i32**
%17 = getelementptr inbounds [6 x [6 x i32]], [6 x [6 x i32]]* %3, i64 0, i64 0
%18 = bitcast [6 x i32]* %17 to i32**
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = call i32 @removeWalls(i32** %16, i32** %18, i32 %19, i32 %20)
%22 = getelementptr inbounds [13 x [13 x i32]], [13 x [13 x i32]]* %2, i64 0, i64 0
%23 = bitcast [13 x i32]* %22 to i32**
%24 = call i32 @addRandomEntrances(i32** %23)
%25 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%26 = getelementptr inbounds [13 x [13 x i32]], [13 x [13 x i32]]* %2, i64 0, i64 0
%27 = bitcast [13 x i32]* %26 to i32**
%28 = call i32 @drawMaze(i32** %27)
%29 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca [13 x [13 x i32]]
%2 = alloca [6 x [6 x i32]]
%3 = bitcast [13 x [13 x i32]]* %1 to i8*
%4 = bitcast [6 x [6 x i32]]* %2 to i8*
%5 = tail call i32 @time(i32* null)
%6 = tail call i32 @srand(i32 %5)
%7 = tail call i32 @getRandomNumber(i32 6)
%8 = tail call i32 @getRandomNumber(i32 6)
%9 = bitcast [13 x [13 x i32]]* %1 to i32**
%10 = call i32 @initialiseMazeArray(i32** %9)
%11 = bitcast [6 x [6 x i32]]* %2 to i32**
%12 = call i32 @removeWalls(i32** %9, i32** %11, i32 %7, i32 %8)
%13 = call i32 @addRandomEntrances(i32** %9)
%14 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @drawMaze(i32** %9)
%16 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}