void shortestPath(int *v1, int origem, int destino, int n, int **listCm) {
  assert(v1);
  assert(listCm);
  if (n < 1)
    return;
  listCm[origem] = Dijkstra(v1, origem, n);
  imprimeCm(listCm[origem], destino);
  puts("");
  return;
}


x86 assembly (clang, -O0):
<shortestPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1060 <assert@plt>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1060 <assert@plt>
cmpl   $0x1,-0x14(%rbp)
jge    117e <shortestPath+0x3e>
jmp    11c2 <shortestPath+0x82>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1050 <Dijkstra@plt>
movslq %eax,%rdx
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1030 <imprimeCm@plt>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortestPath>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r12
mov    %ecx,%ebp
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <assert@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1060 <assert@plt>
test   %ebp,%ebp
jle    11a4 <shortestPath+0x64>
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <Dijkstra@plt>
movslq %eax,%rdi
movslq %r15d,%rax
mov    %rdi,(%r12,%rax,8)
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <imprimeCm@plt>
lea    0xe6b(%rip),%rdi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @shortestPath(i32* %0, i32 %1, i32 %2, i32 %3, i32** %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32**
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32** %4, i32*** %10
%11 = load i32*, i32** %6
%12 = call i32 (i32*, ...) bitcast (i32 (...)* @assert to i32 (i32*, ...)*)(i32* %11)
%13 = load i32**, i32*** %10
%14 = call i32 (i32**, ...) bitcast (i32 (...)* @assert to i32 (i32**, ...)*)(i32** %13)
%15 = load i32, i32* %9
%16 = icmp slt i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %5
br label %37
18: ; preds = %5
%19 = load i32*, i32** %6
%20 = load i32, i32* %7
%21 = load i32, i32* %9
%22 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @Dijkstra to i32 (i32*, i32, i32, ...)*)(i32* %19, i32 %20, i32 %21)
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
%25 = load i32**, i32*** %10
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32*, i32** %25, i64 %27
store i32* %24, i32** %28
%29 = load i32**, i32*** %10
%30 = load i32, i32* %7
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32*, i32** %29, i64 %31
%33 = load i32*, i32** %32
%34 = load i32, i32* %8
%35 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @imprimeCm to i32 (i32*, i32, ...)*)(i32* %33, i32 %34)
%36 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %37
37: ; preds = %18, %17
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @shortestPath(i32* %0, i32 %1, i32 %2, i32 %3, i32** %4) {
%6 = tail call i32 (i32*, ...) bitcast (i32 (...)* @assert to i32 (i32*, ...)*)(i32* %0)
%7 = tail call i32 (i32**, ...) bitcast (i32 (...)* @assert to i32 (i32**, ...)*)(i32** %4)
%8 = icmp slt i32 %3, 1
br i1 %8, label %17, label %9
9: ; preds = %5
%10 = tail call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @Dijkstra to i32 (i32*, i32, i32, ...)*)(i32* %0, i32 %1, i32 %3)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = sext i32 %1 to i64
%14 = getelementptr inbounds i32*, i32** %4, i64 %13
store i32* %12, i32** %14
%15 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @imprimeCm to i32 (i32*, i32, ...)*)(i32* %12, i32 %2)
%16 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %5, %9
ret void
}