#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 printMST(int parent[], int size, int **graph) {
  printf("Edge   Weight\n");
  for (int i = 1; i < size; i++)
    printf("%d - %d    %d \n", parent[i], i, graph[i][parent[i]]);
}


x86 assembly (clang, -O0):
<printMST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1189 <printMST+0x79>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rdi
movslq (%rcx,%rdi,4),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1138 <printMST+0x28>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMST>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebx
mov    %rdi,%r15
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x2,%ebx
jl     1180 <printMST+0x60>
mov    %ebx,%r13d
mov    $0x1,%ebx
lea    0xeaf(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq (%r15,%rbx,4),%rsi
mov    (%r14,%rbx,8),%rax
mov    (%rax,%rsi,4),%ecx
mov    %r12,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1160 <printMST+0x40>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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