#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 */
typedef int /*<<< orphan*/ qmat;

/* Variables and functions */
int /*<<< orphan*/ find_path(int *, int);
int /*<<< orphan*/ print_matrix(int *, int, char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int qmat[5][5] = {{1, 1, 4, 2, 3},
                    {2, 3, 1, 4, 1},
                    {3, 2, 1, 2, 4},
                    {5, 4, 2, 4, 5},
                    {6, 7, 8, 9, 2}};
  int i, j, size = 5;
  printf("Size of qmat is %lu\n", sizeof(qmat));
  print_matrix((int *)qmat, 5, "Question");
  find_path((int *)qmat, 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
movl   $0x5,-0x8c(%rbp)
lea    0xeec(%rip),%rdi
mov    $0x64,%esi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rdi
mov    $0x5,%esi
lea    0xee7(%rip),%rdx
call   1060 <print_matrix@plt>
lea    -0x80(%rbp),%rdi
mov    $0x5,%esi
call   1030 <find_path@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    0xf25(%rip),%eax
mov    %eax,0x60(%rsp)
movaps 0xf0a(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeee(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe9a(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe7e(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed7(%rip),%rdi
mov    $0x64,%esi
call   1040 <printf@plt>
lea    0xedb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <print_matrix@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <find_path@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.qmat = [5 x [5 x i32]] [[5 x i32] [i32 1, i32 1, i32 4, i32 2, i32 3], [5 x i32] [i32 2, i32 3, i32 1, i32 4, i32 1], [5 x i32] [i32 3, i32 2, i32 1, i32 2, i32 4], [5 x i32] [i32 5, i32 4, i32 2, i32 4, i32 5], [5 x i32] [i32 6, i32 7, i32 8, i32 9, i32 2]]
@.str = [21 x i8] c"Size of qmat is %lu\0A\00"
@.str.1 = [9 x i8] c"Question\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [5 x [5 x i32]]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = bitcast [5 x [5 x i32]]* %5 to i8*
store i32 5, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 100)
%11 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %5, i64 0, i64 0
%12 = bitcast [5 x i32]* %11 to i32*
%13 = call i32 @print_matrix(i32* %12, i32 5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %5, i64 0, i64 0
%15 = bitcast [5 x i32]* %14 to i32*
%16 = call i32 @find_path(i32* %15, i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.qmat = [5 x [5 x i32]] [[5 x i32] [i32 1, i32 1, i32 4, i32 2, i32 3], [5 x i32] [i32 2, i32 3, i32 1, i32 4, i32 1], [5 x i32] [i32 3, i32 2, i32 1, i32 2, i32 4], [5 x i32] [i32 5, i32 4, i32 2, i32 4, i32 5], [5 x i32] [i32 6, i32 7, i32 8, i32 9, i32 2]]
@.str = [21 x i8] c"Size of qmat is %lu\0A\00"
@.str.1 = [9 x i8] c"Question\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x [5 x i32]]
%4 = bitcast [5 x [5 x i32]]* %3 to i8*
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 100)
%6 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %3, i64 0, i64 0, i64 0
%7 = call i32 @print_matrix(i32* %6, i32 5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @find_path(i32* %6, i32 5)
ret i32 0
}