#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);
void printShortestPath(int parent[], int currentVertex, int startVertex) {
  if (currentVertex == startVertex) {
    printf("%d ", currentVertex);
  } else if (parent[currentVertex] == 0) {
    printShortestPath(parent, startVertex, startVertex);
    printf("%d ", currentVertex);
  } else {
    printShortestPath(parent, parent[currentVertex], startVertex);
    printf("%d ", currentVertex);
  }
}


x86 assembly (clang, -O0):
<printShortestPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1152 <printShortestPath+0x32>
mov    -0xc(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
jmp    11b2 <printShortestPath+0x92>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1187 <printShortestPath+0x67>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <printShortestPath@plt>
mov    -0xc(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
jmp    11ad <printShortestPath+0x8d>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x10(%rbp),%edx
call   1030 <printShortestPath@plt>
mov    -0xc(%rbp),%esi
lea    0xe58(%rip),%rdi
call   1040 <printf@plt>
jmp    11b2 <printShortestPath+0x92>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printShortestPath>:
push   %rbx
mov    %esi,%ebx
cmp    %edx,%esi
je     1137 <printShortestPath+0x17>
movslq %ebx,%rax
mov    (%rdi,%rax,4),%esi
test   %esi,%esi
cmove  %edx,%esi
call   1030 <printShortestPath@plt>
lea    0xec2(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printShortestPath(i32* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 %2, i32 %8
tail call void @printShortestPath(i32* %0, i32 %10, i32 %2)
br label %11
11: ; preds = %5, %3
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}