#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 n, int graph[5][5]) {
  int i;
  printf("Edge   Weight\n");
  for (i = 1; i < 5; 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)
cmpl   $0x5,-0x24(%rbp)
jge    118a <printMST+0x7a>
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
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rdi
movslq (%rcx,%rdi,4),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xe9a(%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   %rbx
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
movslq 0x4(%rbx),%rsi
mov    0x14(%r14,%rsi,4),%ecx
lea    0xeb9(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0x8(%rbx),%rsi
mov    0x28(%r14,%rsi,4),%ecx
mov    %r15,%rdi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0xc(%rbx),%rsi
mov    0x3c(%r14,%rsi,4),%ecx
mov    %r15,%rdi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0x10(%rbx),%rsi
mov    0x50(%r14,%rsi,4),%ecx
mov    %r15,%rdi
mov    $0x4,%edx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <printf@plt>

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

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, [5 x 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 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 1, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 1, i32 %9)
%11 = getelementptr inbounds i32, i32* %0, i64 2
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 2, i64 %13
%15 = load i32, i32* %14
%16 = 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 2, i32 %15)
%17 = getelementptr inbounds i32, i32* %0, i64 3
%18 = load i32, i32* %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 3, i64 %19
%21 = load i32, i32* %20
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 3, i32 %21)
%23 = getelementptr inbounds i32, i32* %0, i64 4
%24 = load i32, i32* %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 4, i64 %25
%27 = load i32, i32* %26
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %24, i32 4, i32 %27)
ret i32 undef
}