#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 print_path(int start, int stop, int precede[]) {
  int current = stop;
  int i = 0;
  int number_buffer[50];
  while (current != start) {
    number_buffer[i++] = current;
    current = precede[current];
  }
  number_buffer[i] = current;
  for (; i > 0; i--) {
    printf("%d -> ", number_buffer[i]);
  }
  printf("%d\n", number_buffer[i]);
}


x86 assembly (clang, -O0):
<print_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1168 <print_path+0x58>
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
cltq
mov    %ecx,-0xe0(%rbp,%rax,4)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <print_path+0x22>
mov    -0x14(%rbp),%ecx
movslq -0x18(%rbp),%rax
mov    %ecx,-0xe0(%rbp,%rax,4)
cmpl   $0x0,-0x18(%rbp)
jle    11a5 <print_path+0x95>
movslq -0x18(%rbp),%rax
mov    -0xe0(%rbp,%rax,4),%esi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1176 <print_path+0x66>
movslq -0x18(%rbp),%rax
mov    -0xe0(%rbp,%rax,4),%esi
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_path>:
push   %r15
push   %r14
push   %rbx
sub    $0xd0,%rsp
cmp    %edi,%esi
jne    1125 <print_path+0x15>
mov    %esi,(%rsp)
jmp    1189 <print_path+0x79>
mov    %edi,%eax
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %esi,(%rsp,%rbx,4)
add    $0x1,%rbx
movslq %esi,%rcx
mov    (%rdx,%rcx,4),%esi
cmp    %eax,%esi
jne    1130 <print_path+0x20>
mov    %ebx,%r14d
mov    %eax,(%rsp,%r14,4)
test   %ebx,%ebx
jle    118b <print_path+0x7b>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
cmp    $0x2,%r14d
jb     1189 <print_path+0x79>
mov    %ebx,%r15d
add    $0x1,%r15
lea    0xe92(%rip),%r14
xor    %ebx,%ebx
mov    -0x8(%rsp,%r15,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%r15
cmp    $0x2,%r15
jg     1170 <print_path+0x60>
jmp    118b <print_path+0x7b>
xor    %ebx,%ebx
movslq %ebx,%rax
mov    (%rsp,%rax,4),%esi
lea    0xe6f(%rip),%rdi
add    $0xd0,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d -> \00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @print_path(i32 %0, i32 %1, i32* nocapture %2) {
%4 = alloca [50 x i32]
%5 = bitcast [50 x i32]* %4 to i8*
%6 = icmp eq i32 %1, %0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = getelementptr inbounds [50 x i32], [50 x i32]* %4, i64 0, i64 0
store i32 %1, i32* %8
br label %33
9: ; preds = %3, %9
%10 = phi i64 [ %12, %9 ], [ 0, %3 ]
%11 = phi i32 [ %16, %9 ], [ %1, %3 ]
%12 = add nuw i64 %10, 1
%13 = getelementptr inbounds [50 x i32], [50 x i32]* %4, i64 0, i64 %10
store i32 %11, i32* %13
%14 = sext i32 %11 to i64
%15 = getelementptr inbounds i32, i32* %2, i64 %14
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, %0
br i1 %17, label %18, label %9
18: ; preds = %9
%19 = trunc i64 %12 to i32
%20 = and i64 %12, 4294967295
%21 = getelementptr inbounds [50 x i32], [50 x i32]* %4, i64 0, i64 %20
store i32 %0, i32* %21
%22 = icmp sgt i32 %19, 0
br i1 %22, label %23, label %33
23: ; preds = %18
%24 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%25 = icmp ugt i64 %20, 1
br i1 %25, label %26, label %33
26: ; preds = %23, %26
%27 = phi i64 [ %28, %26 ], [ %20, %23 ]
%28 = add nsw i64 %27, -1
%29 = getelementptr inbounds [50 x i32], [50 x i32]* %4, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = icmp sgt i64 %27, 2
br i1 %32, label %26, label %33
33: ; preds = %26, %23, %7, %18
%34 = phi i64 [ %12, %18 ], [ 0, %7 ], [ 0, %23 ], [ 0, %26 ]
%35 = shl i64 %34, 32
%36 = ashr exact i64 %35, 32
%37 = getelementptr inbounds [50 x i32], [50 x i32]* %4, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %38)
ret void
}