#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*/ printSolution(int **);
int /*<<< orphan*/ printf(char *);
scalar_t__ solveMazeUtil(int **, int /*<<< orphan*/, int /*<<< orphan*/,
                         int **);
int solveMaze(int maze[4][4]) {
  int sol[4][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}};
  if (solveMazeUtil(maze, 0, 0, sol) == 0) {
    printf("Solution doesn't exist");
    return 0;
  }
  printSolution(sol);
  return 1;
}


x86 assembly (clang, -O0):
<solveMaze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x50(%rbp),%rcx
xor    %edx,%edx
mov    %edx,%esi
call   1050 <solveMazeUtil@plt>
cmp    $0x0,%rax
jne    118f <solveMaze+0x4f>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    119f <solveMaze+0x5f>
lea    -0x50(%rbp),%rdi
call   1060 <printSolution@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solveMaze>:
push   %rbx
sub    $0x40,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
xor    %ebx,%ebx
mov    %rsp,%rcx
xor    %esi,%esi
xor    %edx,%edx
call   1040 <solveMazeUtil@plt>
test   %rax,%rax
je     116d <solveMaze+0x3d>
mov    %rsp,%rdi
call   1050 <printSolution@plt>
mov    $0x1,%ebx
jmp    1179 <solveMaze+0x49>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Solution doesn't exist\00"
define i32 @solveMaze([4 x i32]* %0) {
%2 = alloca i32
%3 = alloca [4 x i32]*
%4 = alloca [4 x [4 x i32]]
store [4 x i32]* %0, [4 x i32]** %3
%5 = bitcast [4 x [4 x i32]]* %4 to i8*
%6 = load [4 x i32]*, [4 x i32]** %3
%7 = bitcast [4 x i32]* %6 to i32**
%8 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 0
%9 = bitcast [4 x i32]* %8 to i32**
%10 = call i64 @solveMazeUtil(i32** %7, i32 0, i32 0, i32** %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %18
14: ; preds = %1
%15 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 0
%16 = bitcast [4 x i32]* %15 to i32**
%17 = call i32 @printSolution(i32** %16)
store i32 1, i32* %2
br label %18
18: ; preds = %14, %12
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [23 x i8] c"Solution doesn't exist\00"
define i32 @solveMaze([4 x i32]* %0) {
%2 = alloca [4 x [4 x i32]]
%3 = bitcast [4 x [4 x i32]]* %2 to i8*
%4 = bitcast [4 x i32]* %0 to i32**
%5 = bitcast [4 x [4 x i32]]* %2 to i32**
%6 = call i64 @solveMazeUtil(i32** %4, i32 0, i32 0, i32** %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 @printSolution(i32** %5)
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ 0, %8 ], [ 1, %10 ]
ret i32 %13
}