#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*/ initrand();
int /*<<< orphan*/ mazefree(char **, int);
char **mazeinit(int, int, char);
int /*<<< orphan*/ mazeprint(char **, int, int, int);
int /*<<< orphan*/ mazewalk(char **, int, int);
int /*<<< orphan*/ parsecmd(int, char **, int *, int *, int *, char *);
int main(int argc, char **argv) {
  int rows, cols, color;
  char **a, wall;
  parsecmd(argc, argv, &rows, &cols, &color, &wall);
  initrand();
  a = mazeinit(rows, cols, wall);
  mazewalk(a, rows, cols);
  mazeprint(a, rows, cols, color);
  mazefree(a, rows);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
lea    -0x29(%rbp),%r9
call   1060 <parsecmd@plt>
mov    $0x0,%al
call   1070 <initrand@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
movsbl -0x29(%rbp),%edx
call   1040 <mazeinit@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <mazewalk@plt>
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1080 <mazeprint@plt>
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <mazefree@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0x3(%rsp),%r9
call   1060 <parsecmd@plt>
xor    %eax,%eax
call   1070 <initrand@plt>
mov    0x4(%rsp),%edi
mov    0x8(%rsp),%esi
movsbl 0x3(%rsp),%edx
call   1040 <mazeinit@plt>
mov    %rax,%rbx
mov    0x4(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rax,%rdi
call   1030 <mazewalk@plt>
mov    0x4(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    %rbx,%rdi
call   1080 <mazeprint@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1050 <mazefree@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @parsecmd(i32 %11, i8** %12, i32* %6, i32* %7, i32* %8, i8* %10)
%14 = call i32 (...) @initrand()
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i8, i8* %10
%18 = call i8** @mazeinit(i32 %15, i32 %16, i8 signext %17)
store i8** %18, i8*** %9
%19 = load i8**, i8*** %9
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = call i32 @mazewalk(i8** %19, i32 %20, i32 %21)
%23 = load i8**, i8*** %9
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = load i32, i32* %8
%27 = call i32 @mazeprint(i8** %23, i32 %24, i32 %25, i32 %26)
%28 = load i8**, i8*** %9
%29 = load i32, i32* %6
%30 = call i32 @mazefree(i8** %28, i32 %29)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = call i32 @parsecmd(i32 %0, i8** %1, i32* %3, i32* %4, i32* %5, i8* %6)
%11 = call i32 (...) @initrand()
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i8, i8* %6
%15 = call i8** @mazeinit(i32 %12, i32 %13, i8 signext %14)
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = call i32 @mazewalk(i8** %15, i32 %16, i32 %17)
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = call i32 @mazeprint(i8** %15, i32 %19, i32 %20, i32 %21)
%23 = load i32, i32* %3
%24 = call i32 @mazefree(i8** %15, i32 %23)
ret i32 0
}