int debug_find_path(int *ptr, int last_row, int last_column) {
  if (last_row == 19 && last_column == 19) {
    printf("Shortest Path");
    return 0;
  }
  if (*(ptr) == 0) {
    printf("No shortest path from (0,0) to (19,19).\n");
    return 0;
  } else if (*(ptr) == 1) {
    ptr++;
    if (*(ptr) == 1) {
      last_column++;
      printf("Pointer shifted right column. \n Pointer Adress: %d \n Pointer "
             "value: %d (%d,%d)\n\n",
             ptr, *(ptr), last_row, last_column);
      return debug_find_path(ptr, last_row, last_column);
    }
    ptr--;
    ptr += 20;
    if (*(ptr) == 1) {
      last_row++;
      printf("Pointer shifted bottom row. \n Pointer Adress: %d \n Pointer "
             "value: %d (%d,%d)\n\n",
             ptr, *(ptr), last_row, last_column);
      return debug_find_path(ptr, last_row, last_column);
    }
    *(ptr) = 0;
    ptr -= 20;
    *(ptr) = 0;
    ptr--;
    if (*(ptr) == 1) {
      last_column--;
      printf("Pointer shifted left row. \n Pointer Adress: %d \n Pointer "
             "value: %d (%d,%d)\n\n",
             ptr, *(ptr), last_row, last_column);
      return debug_find_path(ptr, last_row, last_column);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<debug_find_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x13,-0x14(%rbp)
jne    1160 <debug_find_path+0x40>
cmpl   $0x13,-0x18(%rbp)
jne    1160 <debug_find_path+0x40>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    12d9 <debug_find_path+0x1b9>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1187 <debug_find_path+0x67>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    12d9 <debug_find_path+0x1b9>
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    12cd <debug_find_path+0x1ad>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    11ec <debug_find_path+0xcc>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <debug_find_path@plt>
mov    %eax,-0x4(%rbp)
jmp    12d9 <debug_find_path+0x1b9>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x50,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1250 <debug_find_path+0x130>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <debug_find_path@plt>
mov    %eax,-0x4(%rbp)
jmp    12d9 <debug_find_path+0x1b9>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffb0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    12c8 <debug_find_path+0x1a8>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <debug_find_path@plt>
mov    %eax,-0x4(%rbp)
jmp    12d9 <debug_find_path+0x1b9>
jmp    12cd <debug_find_path+0x1ad>
jmp    12d2 <debug_find_path+0x1b2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_find_path>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
cmp    $0x13,%esi
sete   %r12b
jne    1160 <debug_find_path+0x40>
cmp    $0x13,%ebx
jne    1160 <debug_find_path+0x40>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xea7(%rip),%r15
lea    0xf40(%rip),%r13
jmp    119a <debug_find_path+0x7a>
add    $0x4,%rbp
add    $0x1,%ebx
mov    %r15,%rdi
mov    %rbp,%rsi
mov    $0x1,%edx
mov    %r14d,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x13,%ebx
sete   %al
test   %al,%r12b
jne    1141 <debug_find_path+0x21>
mov    0x0(%rbp),%eax
cmp    $0x1,%eax
jne    1206 <debug_find_path+0xe6>
cmpl   $0x1,0x4(%rbp)
je     1170 <debug_find_path+0x50>
cmpl   $0x1,0x50(%rbp)
je     11ce <debug_find_path+0xae>
movl   $0x0,0x50(%rbp)
movl   $0x0,0x0(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    114f <debug_find_path+0x2f>
add    $0xfffffffffffffffc,%rbp
add    $0xffffffff,%ebx
mov    %r13,%rdi
jmp    117a <debug_find_path+0x5a>
add    $0x50,%rbp
add    $0x1,%r14d
lea    0xe82(%rip),%rdi
mov    %rbp,%rsi
mov    $0x1,%edx
mov    %r14d,%ecx
mov    %ebx,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x13,%r14d
sete   %r12b
jne    119a <debug_find_path+0x7a>
cmp    $0x13,%ebx
jne    119a <debug_find_path+0x7a>
jmp    1141 <debug_find_path+0x21>
test   %eax,%eax
jne    114f <debug_find_path+0x2f>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
jmp    114f <debug_find_path+0x2f>

LLVM IR (-O0):
@.str = [14 x i8] c"Shortest Path\00"
@.str.1 = [41 x i8] c"No shortest path from (0,0) to (19,19).\0A\00"
@.str.2 = [81 x i8] c"Pointer shifted right column. \0A Pointer Adress: %d \0A Pointer value: %d (%d,%d)\0A\0A\00"
@.str.3 = [79 x i8] c"Pointer shifted bottom row. \0A Pointer Adress: %d \0A Pointer value: %d (%d,%d)\0A\0A\00"
@.str.4 = [77 x i8] c"Pointer shifted left row. \0A Pointer Adress: %d \0A Pointer value: %d (%d,%d)\0A\0A\00"
define i32 @debug_find_path(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 19
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, 19
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %91
15: ; preds = %10, %3
%16 = load i32*, i32** %5
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
br label %91
21: ; preds = %15
%22 = load i32*, i32** %5
%23 = load i32, i32* %22
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %89
25: ; preds = %21
%26 = load i32*, i32** %5
%27 = getelementptr inbounds i32, i32* %26, i32 1
store i32* %27, i32** %5
%28 = load i32*, i32** %5
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %44
31: ; preds = %25
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
%34 = load i32*, i32** %5
%35 = load i32*, i32** %5
%36 = load i32, i32* %35
%37 = load i32, i32* %6
%38 = load i32, i32* %7
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.2, i64 0, i64 0), i32* %34, i32 %36, i32 %37, i32 %38)
%40 = load i32*, i32** %5
%41 = load i32, i32* %6
%42 = load i32, i32* %7
%43 = call i32 @debug_find_path(i32* %40, i32 %41, i32 %42)
store i32 %43, i32* %4
br label %91
44: ; preds = %25
%45 = load i32*, i32** %5
%46 = getelementptr inbounds i32, i32* %45, i32 -1
store i32* %46, i32** %5
%47 = load i32*, i32** %5
%48 = getelementptr inbounds i32, i32* %47, i64 20
store i32* %48, i32** %5
%49 = load i32*, i32** %5
%50 = load i32, i32* %49
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %65
52: ; preds = %44
%53 = load i32, i32* %6
%54 = add nsw i32 %53, 1
store i32 %54, i32* %6
%55 = load i32*, i32** %5
%56 = load i32*, i32** %5
%57 = load i32, i32* %56
%58 = load i32, i32* %6
%59 = load i32, i32* %7
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0), i32* %55, i32 %57, i32 %58, i32 %59)
%61 = load i32*, i32** %5
%62 = load i32, i32* %6
%63 = load i32, i32* %7
%64 = call i32 @debug_find_path(i32* %61, i32 %62, i32 %63)
store i32 %64, i32* %4
br label %91
65: ; preds = %44
%66 = load i32*, i32** %5
store i32 0, i32* %66
%67 = load i32*, i32** %5
%68 = getelementptr inbounds i32, i32* %67, i64 -20
store i32* %68, i32** %5
%69 = load i32*, i32** %5
store i32 0, i32* %69
%70 = load i32*, i32** %5
%71 = getelementptr inbounds i32, i32* %70, i32 -1
store i32* %71, i32** %5
%72 = load i32*, i32** %5
%73 = load i32, i32* %72
%74 = icmp eq i32 %73, 1
br i1 %74, label %75, label %88
75: ; preds = %65
%76 = load i32, i32* %7
%77 = add nsw i32 %76, -1
store i32 %77, i32* %7
%78 = load i32*, i32** %5
%79 = load i32*, i32** %5
%80 = load i32, i32* %79
%81 = load i32, i32* %6
%82 = load i32, i32* %7
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.4, i64 0, i64 0), i32* %78, i32 %80, i32 %81, i32 %82)
%84 = load i32*, i32** %5
%85 = load i32, i32* %6
%86 = load i32, i32* %7
%87 = call i32 @debug_find_path(i32* %84, i32 %85, i32 %86)
store i32 %87, i32* %4
br label %91
88: ; preds = %65
br label %89
89: ; preds = %88, %21
br label %90
90: ; preds = %89
store i32 0, i32* %4
br label %91
91: ; preds = %90, %75, %52, %31, %19, %13
%92 = load i32, i32* %4
ret i32 %92
}

LLVM IR (-O2):
@.str = [14 x i8] c"Shortest Path\00"
@.str.2 = [81 x i8] c"Pointer shifted right column. \0A Pointer Adress: %d \0A Pointer value: %d (%d,%d)\0A\0A\00"
@.str.3 = [79 x i8] c"Pointer shifted bottom row. \0A Pointer Adress: %d \0A Pointer value: %d (%d,%d)\0A\0A\00"
@.str.4 = [77 x i8] c"Pointer shifted left row. \0A Pointer Adress: %d \0A Pointer value: %d (%d,%d)\0A\0A\00"
@str = [40 x i8] c"No shortest path from (0,0) to (19,19).\00"
define i32 @debug_find_path(i32* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 19
%5 = icmp eq i32 %2, 19
%6 = and i1 %4, %5
br i1 %6, label %12, label %7
7: ; preds = %3, %36
%8 = phi i1 [ %39, %36 ], [ %4, %3 ]
%9 = phi i32 [ %15, %36 ], [ %2, %3 ]
%10 = phi i32 [ %37, %36 ], [ %1, %3 ]
%11 = phi i32* [ %33, %36 ], [ %0, %3 ]
br label %14
12: ; preds = %36, %27, %3
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %49
14: ; preds = %7, %27
%15 = phi i32 [ %9, %7 ], [ %29, %27 ]
%16 = phi i32* [ %11, %7 ], [ %28, %27 ]
%17 = load i32, i32* %16
switch i32 %17, label %49 [
i32 0, label %18
i32 1, label %20
]
18: ; preds = %14
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
br label %49
20: ; preds = %14
%21 = getelementptr inbounds i32, i32* %16, i64 1
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %32
24: ; preds = %20
%25 = add nsw i32 %15, 1
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str.2, i64 0, i64 0), i32* %21, i32 1, i32 %10, i32 %25)
br label %27
27: ; preds = %24, %46
%28 = phi i32* [ %21, %24 ], [ %43, %46 ]
%29 = phi i32 [ %25, %24 ], [ %47, %46 ]
%30 = icmp eq i32 %29, 19
%31 = and i1 %8, %30
br i1 %31, label %12, label %14
32: ; preds = %20
%33 = getelementptr inbounds i32, i32* %16, i64 20
%34 = load i32, i32* %33
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %42
36: ; preds = %32
%37 = add nsw i32 %10, 1
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0), i32* %33, i32 1, i32 %37, i32 %15)
%39 = icmp eq i32 %37, 19
%40 = icmp eq i32 %15, 19
%41 = and i1 %39, %40
br i1 %41, label %12, label %7
42: ; preds = %32
store i32 0, i32* %33
store i32 0, i32* %16
%43 = getelementptr inbounds i32, i32* %16, i64 -1
%44 = load i32, i32* %43
%45 = icmp eq i32 %44, 1
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = add nsw i32 %15, -1
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.4, i64 0, i64 0), i32* %43, i32 1, i32 %10, i32 %47)
br label %27
49: ; preds = %42, %14, %18, %12
ret i32 0
}