#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][25] = {{0}};
  int visited[13 / 2][25 / 2] = {{0}};
  srand(time(NULL));
  int startRow = getRandomNumber(13 / 2);
  int startCol = getRandomNumber(25 / 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    $0x650,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x520(%rbp),%rdi
xor    %esi,%esi
mov    $0x514,%edx
call   1040 <memset@plt>
lea    -0x640(%rbp),%rdi
xor    %esi,%esi
mov    $0x120,%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,-0x644(%rbp)
mov    $0xc,%edi
call   10a0 <getRandomNumber@plt>
mov    %eax,-0x648(%rbp)
lea    -0x520(%rbp),%rdi
call   1050 <initialiseMazeArray@plt>
lea    -0x520(%rbp),%rdi
lea    -0x640(%rbp),%rsi
mov    -0x644(%rbp),%edx
mov    -0x648(%rbp),%ecx
call   1090 <removeWalls@plt>
lea    -0x520(%rbp),%rdi
call   1070 <addRandomEntrances@plt>
lea    0xdca(%rip),%rdi
call   1030 <system@plt>
lea    -0x520(%rbp),%rdi
call   10b0 <drawMaze@plt>
lea    0xdb6(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x650,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x638,%rsp
lea    0x120(%rsp),%r15
mov    $0x514,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rsp,%r14
mov    $0x120,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
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    $0xc,%edi
call   10a0 <getRandomNumber@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1050 <initialiseMazeArray@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1090 <removeWalls@plt>
mov    %r15,%rdi
call   1070 <addRandomEntrances@plt>
lea    0xdee(%rip),%rdi
call   1030 <system@plt>
mov    %r15,%rdi
call   10b0 <drawMaze@plt>
lea    0xdde(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x638,%rsp
pop    %rbx
pop    %r14
pop    %r15
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 [25 x i32]]
%3 = alloca [6 x [12 x i32]]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [13 x [25 x i32]]* %2 to i8*
%7 = bitcast [6 x [12 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 12)
store i32 %11, i32* %5
%12 = getelementptr inbounds [13 x [25 x i32]], [13 x [25 x i32]]* %2, i64 0, i64 0
%13 = bitcast [25 x i32]* %12 to i32**
%14 = call i32 @initialiseMazeArray(i32** %13)
%15 = getelementptr inbounds [13 x [25 x i32]], [13 x [25 x i32]]* %2, i64 0, i64 0
%16 = bitcast [25 x i32]* %15 to i32**
%17 = getelementptr inbounds [6 x [12 x i32]], [6 x [12 x i32]]* %3, i64 0, i64 0
%18 = bitcast [12 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 [25 x i32]], [13 x [25 x i32]]* %2, i64 0, i64 0
%23 = bitcast [25 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 [25 x i32]], [13 x [25 x i32]]* %2, i64 0, i64 0
%27 = bitcast [25 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 [25 x i32]]
%2 = alloca [6 x [12 x i32]]
%3 = bitcast [13 x [25 x i32]]* %1 to i8*
%4 = bitcast [6 x [12 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 12)
%9 = bitcast [13 x [25 x i32]]* %1 to i32**
%10 = call i32 @initialiseMazeArray(i32** %9)
%11 = bitcast [6 x [12 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
}