#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*/ add_edge(int, int, int);
int /*<<< orphan*/ add_vertex(char);
int /*<<< orphan*/ display_paths();
int /*<<< orphan*/ find_shortest_path();
int /*<<< orphan*/ init_adj();
int main(int argv, char *argc[]) {
  add_vertex('a');
  add_vertex('b');
  add_vertex('c');
  add_vertex('d');
  add_vertex('e');
  init_adj();
  add_edge(0, 1, 50);
  add_edge(0, 3, 80);
  add_edge(1, 2, 60);
  add_edge(1, 3, 90);
  add_edge(2, 4, 40);
  add_edge(3, 2, 20);
  add_edge(3, 4, 70);
  add_edge(4, 1, 50);
  find_shortest_path();
  display_paths();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x61,%edi
call   1070 <add_vertex@plt>
mov    $0x62,%edi
call   1070 <add_vertex@plt>
mov    $0x63,%edi
call   1070 <add_vertex@plt>
mov    $0x64,%edi
call   1070 <add_vertex@plt>
mov    $0x65,%edi
call   1070 <add_vertex@plt>
mov    $0x0,%al
call   1060 <init_adj@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x32,%edx
call   1030 <add_edge@plt>
xor    %edi,%edi
mov    $0x3,%esi
mov    $0x50,%edx
call   1030 <add_edge@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3c,%edx
call   1030 <add_edge@plt>
mov    $0x1,%edi
mov    $0x3,%esi
mov    $0x5a,%edx
call   1030 <add_edge@plt>
mov    $0x2,%edi
mov    $0x4,%esi
mov    $0x28,%edx
call   1030 <add_edge@plt>
mov    $0x3,%edi
mov    $0x2,%esi
mov    $0x14,%edx
call   1030 <add_edge@plt>
mov    $0x3,%edi
mov    $0x4,%esi
mov    $0x46,%edx
call   1030 <add_edge@plt>
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x32,%edx
call   1030 <add_edge@plt>
mov    $0x0,%al
call   1040 <find_shortest_path@plt>
mov    $0x0,%al
call   1050 <display_paths@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1070 <add_vertex@plt>
mov    $0x62,%edi
call   1070 <add_vertex@plt>
mov    $0x63,%edi
call   1070 <add_vertex@plt>
mov    $0x64,%edi
call   1070 <add_vertex@plt>
mov    $0x65,%edi
call   1070 <add_vertex@plt>
xor    %eax,%eax
call   1060 <init_adj@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x32,%edx
call   1030 <add_edge@plt>
xor    %edi,%edi
mov    $0x3,%esi
mov    $0x50,%edx
call   1030 <add_edge@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3c,%edx
call   1030 <add_edge@plt>
mov    $0x1,%edi
mov    $0x3,%esi
mov    $0x5a,%edx
call   1030 <add_edge@plt>
mov    $0x2,%edi
mov    $0x4,%esi
mov    $0x28,%edx
call   1030 <add_edge@plt>
mov    $0x3,%edi
mov    $0x2,%esi
mov    $0x14,%edx
call   1030 <add_edge@plt>
mov    $0x3,%edi
mov    $0x4,%esi
mov    $0x46,%edx
call   1030 <add_edge@plt>
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x32,%edx
call   1030 <add_edge@plt>
xor    %eax,%eax
call   1040 <find_shortest_path@plt>
xor    %eax,%eax
call   1050 <display_paths@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @add_vertex(i8 signext 97)
%7 = call i32 @add_vertex(i8 signext 98)
%8 = call i32 @add_vertex(i8 signext 99)
%9 = call i32 @add_vertex(i8 signext 100)
%10 = call i32 @add_vertex(i8 signext 101)
%11 = call i32 (...) @init_adj()
%12 = call i32 @add_edge(i32 0, i32 1, i32 50)
%13 = call i32 @add_edge(i32 0, i32 3, i32 80)
%14 = call i32 @add_edge(i32 1, i32 2, i32 60)
%15 = call i32 @add_edge(i32 1, i32 3, i32 90)
%16 = call i32 @add_edge(i32 2, i32 4, i32 40)
%17 = call i32 @add_edge(i32 3, i32 2, i32 20)
%18 = call i32 @add_edge(i32 3, i32 4, i32 70)
%19 = call i32 @add_edge(i32 4, i32 1, i32 50)
%20 = call i32 (...) @find_shortest_path()
%21 = call i32 (...) @display_paths()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add_vertex(i8 signext 97)
%4 = tail call i32 @add_vertex(i8 signext 98)
%5 = tail call i32 @add_vertex(i8 signext 99)
%6 = tail call i32 @add_vertex(i8 signext 100)
%7 = tail call i32 @add_vertex(i8 signext 101)
%8 = tail call i32 (...) @init_adj()
%9 = tail call i32 @add_edge(i32 0, i32 1, i32 50)
%10 = tail call i32 @add_edge(i32 0, i32 3, i32 80)
%11 = tail call i32 @add_edge(i32 1, i32 2, i32 60)
%12 = tail call i32 @add_edge(i32 1, i32 3, i32 90)
%13 = tail call i32 @add_edge(i32 2, i32 4, i32 40)
%14 = tail call i32 @add_edge(i32 3, i32 2, i32 20)
%15 = tail call i32 @add_edge(i32 3, i32 4, i32 70)
%16 = tail call i32 @add_edge(i32 4, i32 1, i32 50)
%17 = tail call i32 (...) @find_shortest_path()
%18 = tail call i32 (...) @display_paths()
ret i32 0
}