#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 find_path(int **, int /*<<< orphan*/, int, int, int, int *,
              int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int matrix[3][3] = {{1, 1, 2}, {-1, 3, 3}, {4, 4, 4}};
  int path[10] = {0};
  int len = find_path(matrix, 0, 1, 2, 2, path, 0);
  printf(" %d", len);
  for (int i = 0; i < len; i++) {
    printf("%d ", path[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x24,%edx
call   1060 <memcpy@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%r9
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x2,%r8d
mov    %r8d,%ecx
movl   $0x0,(%rsp)
call   1030 <find_path@plt>
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%esi
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    11d8 <main+0x98>
movslq -0x68(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%esi
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    11aa <main+0x6a>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    0xef1(%rip),%eax
mov    %eax,0x60(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x30(%rsp)
movl   $0x0,(%rsp)
lea    0x40(%rsp),%rdi
lea    0x10(%rsp),%r9
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
call   1030 <find_path@plt>
mov    %eax,%ebx
lea    0xe92(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
test   %ebx,%ebx
jle    11c5 <main+0xa5>
mov    %ebx,%r15d
xor    %ebx,%ebx
lea    0xe7f(%rip),%r14
nopl   0x0(%rax)
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    11b0 <main+0x90>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.matrix = [3 x [3 x i32]] [[3 x i32] [i32 1, i32 1, i32 2], [3 x i32] [i32 -1, i32 3, i32 3], [3 x i32] [i32 4, i32 4, i32 4]]
@.str = [4 x i8] c" %d\00"
@.str.1 = [4 x i8] c"%d \00"
define void @main() {
%1 = alloca [3 x [3 x i32]]
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [3 x [3 x i32]]* %1 to i8*
%6 = bitcast [10 x i32]* %2 to i8*
%7 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 0
%8 = bitcast [3 x i32]* %7 to i32**
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = call i32 @find_path(i32** %8, i32 0, i32 1, i32 2, i32 2, i32* %9, i32 0)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 0, i32* %4
br label %13
13: ; preds = %23, %0
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %26
17: ; preds = %13
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %17
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %13
26: ; preds = %13
ret void
}

LLVM IR (-O2):
@__const.main.matrix = [3 x [3 x i32]] [[3 x i32] [i32 1, i32 1, i32 2], [3 x i32] [i32 -1, i32 3, i32 3], [3 x i32] [i32 4, i32 4, i32 4]]
@.str = [4 x i8] c" %d\00"
@.str.1 = [4 x i8] c"%d \00"
define void @main() {
%1 = alloca [3 x [3 x i32]]
%2 = alloca [10 x i32]
%3 = bitcast [3 x [3 x i32]]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = bitcast [3 x [3 x i32]]* %1 to i32**
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 @find_path(i32** %5, i32 0, i32 1, i32 2, i32 2, i32* %6, i32 0)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = icmp sgt i32 %7, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = zext i32 %7 to i64
br label %13
12: ; preds = %13, %0
ret void
13: ; preds = %10, %13
%14 = phi i64 [ 0, %10 ], [ %18, %13 ]
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = add nuw nsw i64 %14, 1
%19 = icmp eq i64 %18, %11
br i1 %19, label %12, label %13
}