#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 */
scalar_t__ dfsOut(int, int, char *, int, int, int, int, int *);
int /*<<< orphan*/ findStart(int, int, char *, int *, int *);
int /*<<< orphan*/ printf(char *);
void mazeTraverse(char *maze, int row, int col, int startRow, int startColume) {
  findStart(row, col, maze, &startRow, &startColume);
  int path[1000] = {0};
  path[startRow * col + startColume] = 1;
  if (dfsOut(row, col, maze, startRow, startColume, startRow, startColume,
             path))
    printf("Success!\n");
  else
    printf("Fail!\n");
  return;
}


x86 assembly (clang, -O0):
<mazeTraverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1060 <findStart@plt>
lea    -0xfc0(%rbp),%rdi
xor    %esi,%esi
mov    $0xfa0,%edx
call   1050 <memset@plt>
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0x18(%rbp),%eax
cltq
movl   $0x1,-0xfc0(%rbp,%rax,4)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x18(%rbp),%r10d
lea    -0xfc0(%rbp),%rax
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <dfsOut@plt>
cmp    $0x0,%rax
je     11e6 <mazeTraverse+0xa6>
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
jmp    11f2 <mazeTraverse+0xb2>
lea    0xe1d(%rip),%rdi
call   1030 <printf@plt>
add    $0xfd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mazeTraverse>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xfb8,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %ecx,0xc(%rsp)
mov    %r8d,0x8(%rsp)
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %esi,%edi
mov    %edx,%esi
mov    %r14,%rdx
call   1060 <findStart@plt>
lea    0x10(%rsp),%r15
mov    $0xfa0,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,%eax
imul   %ebx,%eax
mov    0x8(%rsp),%r8d
add    %r8d,%eax
cltq
movl   $0x1,0x10(%rsp,%rax,4)
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14,%rdx
mov    %ecx,%r9d
push   %r15
push   %r8
call   1040 <dfsOut@plt>
add    $0x10,%rsp
test   %rax,%rax
lea    0xe3d(%rip),%rax
lea    0xe3c(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
add    $0xfb8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Success!\0A\00"
@.str.1 = [7 x i8] c"Fail!\0A\00"
define void @mazeTraverse(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [1000 x i32]
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %6
%15 = call i32 @findStart(i32 %12, i32 %13, i8* %14, i32* %9, i32* %10)
%16 = bitcast [1000 x i32]* %11 to i8*
%17 = load i32, i32* %9
%18 = load i32, i32* %8
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %10
%21 = add nsw i32 %19, %20
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [1000 x i32], [1000 x i32]* %11, i64 0, i64 %22
store i32 1, i32* %23
%24 = load i32, i32* %7
%25 = load i32, i32* %8
%26 = load i8*, i8** %6
%27 = load i32, i32* %9
%28 = load i32, i32* %10
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = getelementptr inbounds [1000 x i32], [1000 x i32]* %11, i64 0, i64 0
%32 = call i64 @dfsOut(i32 %24, i32 %25, i8* %26, i32 %27, i32 %28, i32 %29, i32 %30, i32* %31)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %5
%35 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %38
36: ; preds = %5
%37 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %38
38: ; preds = %36, %34
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"Fail!\00"
@str.2 = [9 x i8] c"Success!\00"
define void @mazeTraverse(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca [1000 x i32]
store i32 %3, i32* %6
store i32 %4, i32* %7
%9 = call i32 @findStart(i32 %1, i32 %2, i8* %0, i32* %6, i32* %7)
%10 = bitcast [1000 x i32]* %8 to i8*
%11 = load i32, i32* %6
%12 = mul nsw i32 %11, %2
%13 = load i32, i32* %7
%14 = add nsw i32 %12, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [1000 x i32], [1000 x i32]* %8, i64 0, i64 %15
store i32 1, i32* %16
%17 = getelementptr inbounds [1000 x i32], [1000 x i32]* %8, i64 0, i64 0
%18 = call i64 @dfsOut(i32 %1, i32 %2, i8* %0, i32 %11, i32 %13, i32 %11, i32 %13, i32* %17)
%19 = icmp eq i64 %18, 0
%20 = select i1 %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0)
%21 = call i32 @puts(i8* dereferenceable(1) %20)
ret void
}