#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 /*<<< orphan*/ dijkstra(int **, int);
int main() {
  int graph[9][9] = {
      {0, 4, 0, 0, 0, 0, 0, 8, 0},  {4, 0, 8, 0, 0, 0, 0, 11, 0},
      {0, 8, 0, 7, 0, 4, 0, 0, 2},  {0, 0, 7, 0, 9, 14, 0, 0, 0},
      {0, 0, 0, 9, 0, 10, 0, 0, 0}, {0, 0, 4, 14, 10, 0, 2, 0, 0},
      {0, 0, 0, 0, 0, 2, 0, 1, 6},  {8, 11, 0, 0, 0, 0, 1, 0, 7},
      {0, 0, 2, 0, 0, 0, 6, 7, 0}};
  for (int i = 0; i < 9; i++)
    dijkstra(graph, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x150(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x144,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x154(%rbp)
cmpl   $0x9,-0x154(%rbp)
jge    1187 <main+0x67>
lea    -0x150(%rbp),%rdi
mov    -0x154(%rbp),%esi
call   1040 <dijkstra@plt>
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x154(%rbp)
jmp    1154 <main+0x34>
xor    %eax,%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x150,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x144,%edx
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <dijkstra@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <dijkstra@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <dijkstra@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <dijkstra@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <dijkstra@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <dijkstra@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <dijkstra@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <dijkstra@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <dijkstra@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.graph = [9 x [9 x i32]] [[9 x i32] [i32 0, i32 4, i32 0, i32 0, i32 0, i32 0, i32 0, i32 8, i32 0], [9 x i32] [i32 4, i32 0, i32 8, i32 0, i32 0, i32 0, i32 0, i32 11, i32 0], [9 x i32] [i32 0, i32 8, i32 0, i32 7, i32 0, i32 4, i32 0, i32 0, i32 2], [9 x i32] [i32 0, i32 0, i32 7, i32 0, i32 9, i32 14, i32 0, i32 0, i32 0], [9 x i32] [i32 0, i32 0, i32 0, i32 9, i32 0, i32 10, i32 0, i32 0, i32 0], [9 x i32] [i32 0, i32 0, i32 4, i32 14, i32 10, i32 0, i32 2, i32 0, i32 0], [9 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 1, i32 6], [9 x i32] [i32 8, i32 11, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 7], [9 x i32] [i32 0, i32 0, i32 2, i32 0, i32 0, i32 0, i32 6, i32 7, i32 0]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x [9 x i32]]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [9 x [9 x i32]]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 9
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 0
%10 = bitcast [9 x i32]* %9 to i32**
%11 = load i32, i32* %3
%12 = call i32 @dijkstra(i32** %10, i32 %11)
br label %13
13: ; preds = %8
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@__const.main.graph = [9 x [9 x i32]] [[9 x i32] [i32 0, i32 4, i32 0, i32 0, i32 0, i32 0, i32 0, i32 8, i32 0], [9 x i32] [i32 4, i32 0, i32 8, i32 0, i32 0, i32 0, i32 0, i32 11, i32 0], [9 x i32] [i32 0, i32 8, i32 0, i32 7, i32 0, i32 4, i32 0, i32 0, i32 2], [9 x i32] [i32 0, i32 0, i32 7, i32 0, i32 9, i32 14, i32 0, i32 0, i32 0], [9 x i32] [i32 0, i32 0, i32 0, i32 9, i32 0, i32 10, i32 0, i32 0, i32 0], [9 x i32] [i32 0, i32 0, i32 4, i32 14, i32 10, i32 0, i32 2, i32 0, i32 0], [9 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 1, i32 6], [9 x i32] [i32 8, i32 11, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 7], [9 x i32] [i32 0, i32 0, i32 2, i32 0, i32 0, i32 0, i32 6, i32 7, i32 0]]
define i32 @main() {
%1 = alloca [9 x [9 x i32]]
%2 = bitcast [9 x [9 x i32]]* %1 to i8*
%3 = bitcast [9 x [9 x i32]]* %1 to i32**
%4 = call i32 @dijkstra(i32** %3, i32 0)
%5 = call i32 @dijkstra(i32** %3, i32 1)
%6 = call i32 @dijkstra(i32** %3, i32 2)
%7 = call i32 @dijkstra(i32** %3, i32 3)
%8 = call i32 @dijkstra(i32** %3, i32 4)
%9 = call i32 @dijkstra(i32** %3, i32 5)
%10 = call i32 @dijkstra(i32** %3, i32 6)
%11 = call i32 @dijkstra(i32** %3, i32 7)
%12 = call i32 @dijkstra(i32** %3, i32 8)
ret i32 0
}