#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 printIntermediateData(int checkedVertex[], int vertexWeight[],
                           int vertexParent[], int size) {
  int i;
  printf("%6s:%8s,%8s,%8s\n", "Vertex", "Checked", "Weight", "Parent");
  for (i = 0; i < size; i++) {
    printf("%6d:", i);
    printf("%8d", checkedVertex[i]);
    if (vertexWeight[i] == 32768) {
      printf("%8s", "MAX");
    } else {
      printf("%8d", vertexWeight[i]);
    }
    printf("%8d", vertexParent[i]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printIntermediateData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
lea    0xedc(%rip),%rsi
lea    0xedc(%rip),%rdx
lea    0xedd(%rip),%rcx
lea    0xedd(%rip),%r8
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    120b <printIntermediateData+0xfb>
mov    -0x20(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
cmpl   $0x8000,(%rax,%rcx,4)
jne    11bd <printIntermediateData+0xad>
lea    0xe8d(%rip),%rdi
lea    0xe8a(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d6 <printIntermediateData+0xc6>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1158 <printIntermediateData+0x48>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIntermediateData>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r13
lea    0xec3(%rip),%rdi
lea    0xecd(%rip),%rsi
lea    0xecd(%rip),%rdx
lea    0xece(%rip),%rcx
lea    0xece(%rip),%r8
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
jle    11ed <printIntermediateData+0xcd>
mov    %ebx,%r12d
lea    0xec1(%rip),%rbx
xor    %ebp,%ebp
jmp    11ab <printIntermediateData+0x8b>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r14,%rbp,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
je     11ed <printIntermediateData+0xcd>
lea    0xe7c(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x0(%r13,%rbp,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%rbp,4),%esi
cmp    $0x8000,%esi
jne    1180 <printIntermediateData+0x60>
lea    0xe5a(%rip),%rdi
lea    0xe57(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    118a <printIntermediateData+0x6a>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"%6s:%8s,%8s,%8s\0A\00"
@.str.1 = [7 x i8] c"Vertex\00"
@.str.2 = [8 x i8] c"Checked\00"
@.str.3 = [7 x i8] c"Weight\00"
@.str.4 = [7 x i8] c"Parent\00"
@.str.5 = [5 x i8] c"%6d:\00"
@.str.6 = [4 x i8] c"%8d\00"
@.str.7 = [4 x i8] c"%8s\00"
@.str.8 = [4 x i8] c"MAX\00"
define void @printIntermediateData(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32 %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%6 = icmp sgt i32 %3, 0
br i1 %6, label %7, label %30
7: ; preds = %4
%8 = zext i32 %3 to i64
br label %9
9: ; preds = %7, %23
%10 = phi i64 [ 0, %7 ], [ %28, %23 ]
%11 = trunc i64 %10 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds i32, i32* %0, i64 %10
%14 = load i32, i32* %13
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds i32, i32* %1, i64 %10
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 32768
br i1 %18, label %19, label %21
19: ; preds = %9
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %23
21: ; preds = %9
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %17)
br label %23
23: ; preds = %21, %19
%24 = getelementptr inbounds i32, i32* %2, i64 %10
%25 = load i32, i32* %24
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %25)
%27 = tail call i32 @putchar(i32 10)
%28 = add nuw nsw i64 %10, 1
%29 = icmp eq i64 %28, %8
br i1 %29, label %30, label %9
30: ; preds = %23, %4
ret void
}