#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 *, int, int, int);
void printDij(int parent[], int key[], int graph[10][10], int V) {
  int i = 0;
  for (i = 1; i < V; i++) {
    printf("%d -> %d : %d\n", parent[i], i, graph[i][parent[i]]);
  }
}


x86 assembly (clang, -O0):
<printDij>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1187 <printDij+0x77>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x20(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
movslq -0x20(%rbp),%rdi
movslq (%rcx,%rdi,4),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1135 <printDij+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDij>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmp    $0x2,%ecx
jl     115f <printDij+0x4f>
mov    %rdx,%r15
mov    %rdi,%r14
mov    %ecx,%r13d
add    $0x28,%r15
mov    $0x1,%ebx
lea    0xec9(%rip),%r12
nopw   0x0(%rax,%rax,1)
movslq (%r14,%rbx,4),%rsi
mov    (%r15,%rsi,4),%ecx
mov    %r12,%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%rbx
add    $0x28,%r15
cmp    %rbx,%r13
jne    1140 <printDij+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"%d -> %d : %d\0A\00"
define void @printDij(i32* nocapture %0, i32* nocapture readnone %1, [10 x i32]* nocapture %2, i32 %3) {
%5 = icmp sgt i32 %3, 1
br i1 %5, label %6, label %19
6: ; preds = %4
%7 = zext i32 %3 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 1, %6 ], [ %17, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 %9, i64 %12
%14 = load i32, i32* %13
%15 = trunc i64 %9 to i32
%16 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %15, i32 %14)
%17 = add nuw nsw i64 %9, 1
%18 = icmp eq i64 %17, %7
br i1 %18, label %19, label %8
19: ; preds = %8, %4
ret void
}