#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*/ printf(char *, ...);
void display_djikstras(int *distance_to, int *edge_to) {
  int i = 0;
  printf("Vertex :  distance_to  edge_to\n");
  for (i = 0; i < 9; i++) {
    printf("  %d         %d          %d\n", i, distance_to[i], edge_to[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<display_djikstras>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
jge    117b <display_djikstras+0x6b>
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113c <display_djikstras+0x2c>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_djikstras>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedb(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%edx
mov    (%r14),%ecx
lea    0xead(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rbx),%edx
mov    0x4(%r14),%ecx
mov    %r15,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rbx),%edx
mov    0x8(%r14),%ecx
mov    %r15,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rbx),%edx
mov    0xc(%r14),%ecx
mov    %r15,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rbx),%edx
mov    0x10(%r14),%ecx
mov    %r15,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x14(%rbx),%edx
mov    0x14(%r14),%ecx
mov    %r15,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rbx),%edx
mov    0x18(%r14),%ecx
mov    %r15,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c(%rbx),%edx
mov    0x1c(%r14),%ecx
mov    %r15,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rbx),%edx
mov    0x20(%r14),%ecx
mov    %r15,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Vertex : distance_to edge_to\0A\00"
@.str.1 = [29 x i8] c" %d %d %d\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @display_djikstras(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %23, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 9
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load i32, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %16, i32 %21)
br label %23
23: ; preds = %10
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %7
26: ; preds = %7
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [29 x i8] c" %d %d %d\0A\00"
@str = [31 x i8] c"Vertex : distance_to edge_to\00"
define void @display_djikstras(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %4, i32 %5)
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %1, i64 1
%10 = load i32, i32* %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %8, i32 %10)
%12 = getelementptr inbounds i32, i32* %0, i64 2
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %1, i64 2
%15 = load i32, i32* %14
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 %13, i32 %15)
%17 = getelementptr inbounds i32, i32* %0, i64 3
%18 = load i32, i32* %17
%19 = getelementptr inbounds i32, i32* %1, i64 3
%20 = load i32, i32* %19
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 %18, i32 %20)
%22 = getelementptr inbounds i32, i32* %0, i64 4
%23 = load i32, i32* %22
%24 = getelementptr inbounds i32, i32* %1, i64 4
%25 = load i32, i32* %24
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 %23, i32 %25)
%27 = getelementptr inbounds i32, i32* %0, i64 5
%28 = load i32, i32* %27
%29 = getelementptr inbounds i32, i32* %1, i64 5
%30 = load i32, i32* %29
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 %28, i32 %30)
%32 = getelementptr inbounds i32, i32* %0, i64 6
%33 = load i32, i32* %32
%34 = getelementptr inbounds i32, i32* %1, i64 6
%35 = load i32, i32* %34
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 %33, i32 %35)
%37 = getelementptr inbounds i32, i32* %0, i64 7
%38 = load i32, i32* %37
%39 = getelementptr inbounds i32, i32* %1, i64 7
%40 = load i32, i32* %39
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 7, i32 %38, i32 %40)
%42 = getelementptr inbounds i32, i32* %0, i64 8
%43 = load i32, i32* %42
%44 = getelementptr inbounds i32, i32* %1, i64 8
%45 = load i32, i32* %44
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 %43, i32 %45)
%47 = tail call i32 @putchar(i32 10)
ret void
}