#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 print_path(int pre[][100], int source, int destination) {
  if (pre[source][destination] == 9999 || source == destination) {
    printf("cannot arrive!\n");
    return;
  }
  if (pre[source][destination] != source)
    print_path(pre, source, pre[source][destination]);
  printf("%-4c->", pre[source][destination] + 65);
}


x86 assembly (clang, -O0):
<print_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x190,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x270f,(%rax,%rcx,4)
je     1161 <print_path+0x41>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1174 <print_path+0x54>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e5 <print_path+0xc5>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x190,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0xc(%rbp),%eax
je     11bb <print_path+0x9b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x190,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
call   1040 <print_path@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x190,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
add    $0x41,%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_path>:
push   %rbx
cmp    %edx,%esi
je     1171 <print_path+0x41>
movslq %esi,%rcx
movslq %edx,%rax
imul   $0x190,%rcx,%rcx
add    %rdi,%rcx
mov    (%rcx,%rax,4),%edx
cmp    $0x270f,%edx
je     1171 <print_path+0x41>
cmp    %esi,%edx
je     115f <print_path+0x2f>
lea    (%rcx,%rax,4),%rbx
call   1050 <print_path@plt>
mov    (%rbx),%esi
add    $0x41,%esi
lea    0xe97(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
lea    0xe8f(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%-4c->\00"
@str = [15 x i8] c"cannot arrive!\00"
define void @print_path([100 x i32]* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %0, i64 %4, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 9999
%9 = icmp eq i32 %1, %2
%10 = or i1 %9, %8
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %21
13: ; preds = %3
%14 = icmp eq i32 %7, %1
br i1 %14, label %17, label %15
15: ; preds = %13
tail call void @print_path([100 x i32]* %0, i32 %1, i32 %7)
%16 = load i32, i32* %6
br label %17
17: ; preds = %15, %13
%18 = phi i32 [ %16, %15 ], [ %1, %13 ]
%19 = add nsw i32 %18, 65
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %17, %11
ret void
}