#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*/ getMaze(int, int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ solveMaze(int, int **);
void main() {
  int size;
  printf("Enter the size of the rat maze\n");
  scanf("%d", &size);
  int maze[size][size];
  printf("Enter the dead ends as 0 otherwise 1\n");
  getMaze(size, maze);
  solveMaze(size, maze);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,%rax
mov    %rsp,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,%rdx
imul   %rdx,%rdx
lea    0xf(,%rdx,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x28(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1050 <getMaze@plt>
mov    -0x28(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1060 <solveMaze@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
lea    0xea2(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rsp,%r14
mov    -0x14(%rbp),%eax
imul   %rax,%rax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%edi
mov    %rbx,%rsi
call   1050 <getMaze@plt>
mov    -0x14(%rbp),%edi
mov    %rbx,%rsi
call   1060 <solveMaze@plt>
mov    %r14,%rsp
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Enter the size of the rat maze\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"Enter the dead ends as 0 otherwise 1\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = zext i32 %7 to i64
%9 = load i32, i32* %1
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %2
%12 = mul nuw i64 %8, %10
%13 = alloca i32, i64 %12
store i64 %8, i64* %3
store i64 %10, i64* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* %1
%16 = bitcast i32* %13 to i32**
%17 = call i32 @getMaze(i32 %15, i32** %16)
%18 = load i32, i32* %1
%19 = bitcast i32* %13 to i32**
%20 = call i32 @solveMaze(i32 %18, i32** %19)
%21 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [31 x i8] c"Enter the size of the rat maze\00"
@str.3 = [37 x i8] c"Enter the dead ends as 0 otherwise 1\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
%8 = mul nuw i64 %6, %6
%9 = alloca i32, i64 %8
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
%11 = load i32, i32* %1
%12 = bitcast i32* %9 to i32**
%13 = call i32 @getMaze(i32 %11, i32** %12)
%14 = load i32, i32* %1
%15 = call i32 @solveMaze(i32 %14, i32** %12)
ret void
}