#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*/ con_printf(char *, ...);
int get_rt_distance(int);
void internal_print_distances(int size) {
  int i;
  con_printf("D |");
  for (i = 0; i < size; i++) {
    int v = get_rt_distance(i);
    if (v >= 0) {
      con_printf(" %3d", v);
    } else {
      con_printf("   -");
    }
  }
  con_printf("|\n");
}


x86 assembly (clang, -O0):
<internal_print_distances>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <con_printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1198 <internal_print_distances+0x78>
mov    -0x8(%rbp),%edi
call   1030 <get_rt_distance@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1177 <internal_print_distances+0x57>
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <con_printf@plt>
jmp    1185 <internal_print_distances+0x65>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <con_printf@plt>
jmp    118a <internal_print_distances+0x6a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <internal_print_distances+0x20>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <con_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_print_distances>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1040 <con_printf@plt>
test   %ebx,%ebx
jle    117a <internal_print_distances+0x5a>
lea    0xec2(%rip),%r14
lea    0xec0(%rip),%r15
xor    %ebp,%ebp
jmp    1161 <internal_print_distances+0x41>
nopl   (%rax)
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <con_printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
je     117a <internal_print_distances+0x5a>
mov    %ebp,%edi
call   1030 <get_rt_distance@plt>
test   %eax,%eax
js     1150 <internal_print_distances+0x30>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <con_printf@plt>
jmp    115a <internal_print_distances+0x3a>
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <con_printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"D |\00"
@.str.1 = [5 x i8] c" %3d\00"
@.str.2 = [5 x i8] c" -\00"
@.str.3 = [3 x i8] c"|\0A\00"
define void @internal_print_distances(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %6
6: ; preds = %21, %1
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i32, i32* %3
%12 = call i32 @get_rt_distance(i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %20
18: ; preds = %10
%19 = call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %6
24: ; preds = %6
%25 = call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"D |\00"
@.str.1 = [5 x i8] c" %3d\00"
@.str.2 = [5 x i8] c" -\00"
@.str.3 = [3 x i8] c"|\0A\00"
define void @internal_print_distances(i32 %0) {
%2 = tail call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %15
4: ; preds = %1, %12
%5 = phi i32 [ %13, %12 ], [ 0, %1 ]
%6 = tail call i32 @get_rt_distance(i32 %5)
%7 = icmp sgt i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %12
10: ; preds = %4
%11 = tail call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = add nuw nsw i32 %5, 1
%14 = icmp eq i32 %13, %0
br i1 %14, label %15, label %4
15: ; preds = %12, %1
%16 = tail call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret void
}