#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 */
struct Path {
  int dummy;
};
struct Cache {
  int dummy;
};

/* Variables and functions */
scalar_t__ getPath(int const, int const, int **, int const, int const,
                   struct Path **, struct Cache **);
struct Cache **initializeCacheHashTable(int const);
struct Path *findPath(const int rows, const int cols, bool maze[rows][cols]) {
  if (rows == 0 || cols == 0) {
    return (struct Path *)0;
  }
  struct Path *path = (struct Path *)0;
  struct Cache **cache = initializeCacheHashTable(rows * cols);
  if (getPath(rows, cols, maze, rows - 1, cols - 1, &path, cache)) {
    return path;
  }
  return (struct Path *)0;
}


x86 assembly (clang, -O0):
<findPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1146 <findPath+0x26>
cmpl   $0x0,-0x10(%rbp)
jne    1153 <findPath+0x33>
movq   $0x0,-0x8(%rbp)
jmp    11b3 <findPath+0x93>
movq   $0x0,-0x20(%rbp)
mov    -0xc(%rbp),%edi
imul   -0x10(%rbp),%edi
call   1040 <initializeCacheHashTable@plt>
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x28(%rbp),%rax
lea    -0x20(%rbp),%r9
mov    %rax,(%rsp)
call   1030 <getPath@plt>
cmp    $0x0,%rax
je     11ab <findPath+0x8b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11b3 <findPath+0x93>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findPath>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
test   %edi,%edi
je     1176 <findPath+0x56>
mov    %esi,%r15d
test   %esi,%esi
je     1176 <findPath+0x56>
mov    %rdx,%r14
mov    %edi,%ebx
movq   $0x0,0x8(%rsp)
mov    %r15d,%edi
imul   %ebx,%edi
call   1040 <initializeCacheHashTable@plt>
lea    -0x1(%rbx),%ecx
lea    -0x1(%r15),%r8d
mov    %rax,(%rsp)
lea    0x8(%rsp),%r9
mov    %ebx,%edi
mov    %r15d,%esi
mov    %r14,%rdx
call   1030 <getPath@plt>
test   %rax,%rax
je     1176 <findPath+0x56>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.Path = type { i32 }
%struct.Cache = type { i32 }
define %struct.Path* @findPath(i32 %0, i32 %1, i32* %2) {
%4 = alloca %struct.Path*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca %struct.Path*
%9 = alloca %struct.Cache**
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%10 = load i32, i32* %5
%11 = zext i32 %10 to i64
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %3
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16, %3
store %struct.Path* null, %struct.Path** %4
br label %39
20: ; preds = %16
store %struct.Path* null, %struct.Path** %8
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = mul nsw i32 %21, %22
%24 = call %struct.Cache** @initializeCacheHashTable(i32 %23)
store %struct.Cache** %24, %struct.Cache*** %9
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = load i32*, i32** %7
%28 = bitcast i32* %27 to i32**
%29 = load i32, i32* %5
%30 = sub nsw i32 %29, 1
%31 = load i32, i32* %6
%32 = sub nsw i32 %31, 1
%33 = load %struct.Cache**, %struct.Cache*** %9
%34 = call i64 @getPath(i32 %25, i32 %26, i32** %28, i32 %30, i32 %32, %struct.Path** %8, %struct.Cache** %33)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %20
%37 = load %struct.Path*, %struct.Path** %8
store %struct.Path* %37, %struct.Path** %4
br label %39
38: ; preds = %20
store %struct.Path* null, %struct.Path** %4
br label %39
39: ; preds = %38, %36, %19
%40 = load %struct.Path*, %struct.Path** %4
ret %struct.Path* %40
}

LLVM IR (-O2):
%struct.Path = type { i32 }
%struct.Cache = type { i32 }
define %struct.Path* @findPath(i32 %0, i32 %1, i32* %2) {
%4 = alloca %struct.Path*
%5 = icmp eq i32 %0, 0
%6 = icmp eq i32 %1, 0
%7 = or i1 %5, %6
br i1 %7, label %19, label %8
8: ; preds = %3
%9 = bitcast %struct.Path** %4 to i8*
store %struct.Path* null, %struct.Path** %4
%10 = mul nsw i32 %1, %0
%11 = tail call %struct.Cache** @initializeCacheHashTable(i32 %10)
%12 = bitcast i32* %2 to i32**
%13 = add nsw i32 %0, -1
%14 = add nsw i32 %1, -1
%15 = call i64 @getPath(i32 %0, i32 %1, i32** %12, i32 %13, i32 %14, %struct.Path** %4, %struct.Cache** %11)
%16 = icmp eq i64 %15, 0
%17 = load %struct.Path*, %struct.Path** %4
%18 = select i1 %16, %struct.Path* null, %struct.Path* %17
br label %19
19: ; preds = %3, %8
%20 = phi %struct.Path* [ %18, %8 ], [ null, %3 ]
ret %struct.Path* %20
}