#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 FindMinDistance(int a, int b, int mSize, int pred[mSize][mSize]) {
  int temp = b;
  printf("Shortest Path\n%d ", b);
  while (temp != a) {
    temp = pred[a][temp];
    printf("%d ", temp);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<FindMinDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1186 <FindMinDistance+0x76>
mov    -0x28(%rbp),%rdx
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1143 <FindMinDistance+0x33>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FindMinDistance>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%ebp
mov    %edi,%r12d
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %r12d,%ebp
je     1177 <FindMinDistance+0x57>
mov    %r15d,%eax
movslq %r12d,%rcx
imul   %rax,%rcx
lea    (%r14,%rcx,4),%rbx
lea    0xeb3(%rip),%r14
nopl   0x0(%rax,%rax,1)
movslq %ebp,%rax
mov    (%rbx,%rax,4),%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %r12d,%ebp
jne    1160 <FindMinDistance+0x40>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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