#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 */
struct Graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addEdge(struct Graph *, int, int, int);
struct Graph *createGraph(int);
int /*<<< orphan*/ dijkstra(struct Graph *, int /*<<< orphan*/);
int main() {
  int V = 9;
  struct Graph *graph = createGraph(V);
  addEdge(graph, 0, 1, 4);
  addEdge(graph, 0, 7, 8);
  addEdge(graph, 1, 2, 8);
  addEdge(graph, 1, 7, 11);
  addEdge(graph, 2, 3, 7);
  addEdge(graph, 2, 8, 2);
  addEdge(graph, 2, 5, 4);
  addEdge(graph, 3, 4, 9);
  addEdge(graph, 3, 5, 14);
  addEdge(graph, 4, 5, 10);
  addEdge(graph, 5, 6, 2);
  addEdge(graph, 6, 7, 1);
  addEdge(graph, 6, 8, 6);
  addEdge(graph, 7, 8, 7);
  dijkstra(graph, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <createGraph@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x4,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x7,%edx
mov    $0x8,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x8,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x7,%edx
mov    $0xb,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x7,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%ecx
mov    $0x8,%edx
mov    %ecx,%esi
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
mov    $0x5,%edx
mov    $0x4,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0x9,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
mov    $0xe,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0xa,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x2,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x6,%esi
mov    $0x7,%edx
mov    $0x1,%ecx
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x6,%ecx
mov    $0x8,%edx
mov    %ecx,%esi
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
mov    $0x7,%ecx
mov    $0x8,%edx
mov    %ecx,%esi
call   1030 <addEdge@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1050 <dijkstra@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x9,%edi
call   1040 <createGraph@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x4,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x7,%edx
mov    $0x8,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x8,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x7,%edx
mov    $0xb,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x7,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x8,%edx
mov    $0x2,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x5,%edx
mov    $0x4,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0x9,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x5,%edx
mov    $0xe,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0xa,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x2,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x7,%edx
mov    $0x1,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x8,%edx
mov    $0x6,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x8,%edx
mov    $0x7,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <dijkstra@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Graph = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.Graph*
store i32 0, i32* %1
store i32 9, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.Graph* @createGraph(i32 %4)
store %struct.Graph* %5, %struct.Graph** %3
%6 = load %struct.Graph*, %struct.Graph** %3
%7 = call i32 @addEdge(%struct.Graph* %6, i32 0, i32 1, i32 4)
%8 = load %struct.Graph*, %struct.Graph** %3
%9 = call i32 @addEdge(%struct.Graph* %8, i32 0, i32 7, i32 8)
%10 = load %struct.Graph*, %struct.Graph** %3
%11 = call i32 @addEdge(%struct.Graph* %10, i32 1, i32 2, i32 8)
%12 = load %struct.Graph*, %struct.Graph** %3
%13 = call i32 @addEdge(%struct.Graph* %12, i32 1, i32 7, i32 11)
%14 = load %struct.Graph*, %struct.Graph** %3
%15 = call i32 @addEdge(%struct.Graph* %14, i32 2, i32 3, i32 7)
%16 = load %struct.Graph*, %struct.Graph** %3
%17 = call i32 @addEdge(%struct.Graph* %16, i32 2, i32 8, i32 2)
%18 = load %struct.Graph*, %struct.Graph** %3
%19 = call i32 @addEdge(%struct.Graph* %18, i32 2, i32 5, i32 4)
%20 = load %struct.Graph*, %struct.Graph** %3
%21 = call i32 @addEdge(%struct.Graph* %20, i32 3, i32 4, i32 9)
%22 = load %struct.Graph*, %struct.Graph** %3
%23 = call i32 @addEdge(%struct.Graph* %22, i32 3, i32 5, i32 14)
%24 = load %struct.Graph*, %struct.Graph** %3
%25 = call i32 @addEdge(%struct.Graph* %24, i32 4, i32 5, i32 10)
%26 = load %struct.Graph*, %struct.Graph** %3
%27 = call i32 @addEdge(%struct.Graph* %26, i32 5, i32 6, i32 2)
%28 = load %struct.Graph*, %struct.Graph** %3
%29 = call i32 @addEdge(%struct.Graph* %28, i32 6, i32 7, i32 1)
%30 = load %struct.Graph*, %struct.Graph** %3
%31 = call i32 @addEdge(%struct.Graph* %30, i32 6, i32 8, i32 6)
%32 = load %struct.Graph*, %struct.Graph** %3
%33 = call i32 @addEdge(%struct.Graph* %32, i32 7, i32 8, i32 7)
%34 = load %struct.Graph*, %struct.Graph** %3
%35 = call i32 @dijkstra(%struct.Graph* %34, i32 0)
ret i32 0
}

LLVM IR (-O2):
%struct.Graph = type { i32 }
define i32 @main() {
%1 = tail call %struct.Graph* @createGraph(i32 9)
%2 = tail call i32 @addEdge(%struct.Graph* %1, i32 0, i32 1, i32 4)
%3 = tail call i32 @addEdge(%struct.Graph* %1, i32 0, i32 7, i32 8)
%4 = tail call i32 @addEdge(%struct.Graph* %1, i32 1, i32 2, i32 8)
%5 = tail call i32 @addEdge(%struct.Graph* %1, i32 1, i32 7, i32 11)
%6 = tail call i32 @addEdge(%struct.Graph* %1, i32 2, i32 3, i32 7)
%7 = tail call i32 @addEdge(%struct.Graph* %1, i32 2, i32 8, i32 2)
%8 = tail call i32 @addEdge(%struct.Graph* %1, i32 2, i32 5, i32 4)
%9 = tail call i32 @addEdge(%struct.Graph* %1, i32 3, i32 4, i32 9)
%10 = tail call i32 @addEdge(%struct.Graph* %1, i32 3, i32 5, i32 14)
%11 = tail call i32 @addEdge(%struct.Graph* %1, i32 4, i32 5, i32 10)
%12 = tail call i32 @addEdge(%struct.Graph* %1, i32 5, i32 6, i32 2)
%13 = tail call i32 @addEdge(%struct.Graph* %1, i32 6, i32 7, i32 1)
%14 = tail call i32 @addEdge(%struct.Graph* %1, i32 6, i32 8, i32 6)
%15 = tail call i32 @addEdge(%struct.Graph* %1, i32 7, i32 8, i32 7)
%16 = tail call i32 @dijkstra(%struct.Graph* %1, i32 0)
ret i32 0
}