#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_dv_distance(int, int);
int /*<<< orphan*/ is_neighbour(int);
void internal_print_dvtab(int size) {
  int i;
  for (int n = 0; n < size; n++) {
    if (!is_neighbour(n)) {
      continue;
    }
    con_printf("%d |", n);
    for (i = 0; i < size; i++) {
      int v = get_dv_distance(n, i);
      if (v >= 0) {
        con_printf(" %3d", v);
      } else {
        con_printf("   -");
      }
    }
    con_printf("|\n");
  }
}


x86 assembly (clang, -O0):
<internal_print_dvtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11f3 <internal_print_dvtab+0xc3>
mov    -0xc(%rbp),%edi
call   1040 <is_neighbour@plt>
cmp    $0x0,%eax
jne    1164 <internal_print_dvtab+0x34>
jmp    11e5 <internal_print_dvtab+0xb5>
mov    -0xc(%rbp),%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1050 <con_printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11d7 <internal_print_dvtab+0xa7>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <get_dv_distance@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     11b6 <internal_print_dvtab+0x86>
mov    -0x10(%rbp),%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1050 <con_printf@plt>
jmp    11c4 <internal_print_dvtab+0x94>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1050 <con_printf@plt>
jmp    11c9 <internal_print_dvtab+0x99>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117c <internal_print_dvtab+0x4c>
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1050 <con_printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <internal_print_dvtab+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_print_dvtab>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    11cf <internal_print_dvtab+0x9f>
mov    %edi,%ebx
lea    0xeb9(%rip),%r15
lea    0xebc(%rip),%r12
lea    0xeb0(%rip),%r13
xor    %ebp,%ebp
jmp    1171 <internal_print_dvtab+0x41>
xchg   %ax,%ax
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <con_printf@plt>
add    $0x1,%ebp
cmp    %ebx,%ebp
je     11cf <internal_print_dvtab+0x9f>
mov    %ebp,%edi
call   1040 <is_neighbour@plt>
test   %eax,%eax
je     116a <internal_print_dvtab+0x3a>
xor    %r14d,%r14d
lea    0xe7a(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <con_printf@plt>
jmp    11b3 <internal_print_dvtab+0x83>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <con_printf@plt>
add    $0x1,%r14d
cmp    %r14d,%ebx
je     1160 <internal_print_dvtab+0x30>
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <get_dv_distance@plt>
test   %eax,%eax
js     11a0 <internal_print_dvtab+0x70>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <con_printf@plt>
jmp    11aa <internal_print_dvtab+0x7a>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 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_dvtab(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
br label %6
6: ; preds = %39, %1
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %42
10: ; preds = %6
%11 = load i32, i32* %4
%12 = call i32 @is_neighbour(i32 %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %10
br label %39
15: ; preds = %10
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %16)
store i32 0, i32* %3
br label %18
18: ; preds = %34, %15
%19 = load i32, i32* %3
%20 = load i32, i32* %2
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %37
22: ; preds = %18
%23 = load i32, i32* %4
%24 = load i32, i32* %3
%25 = call i32 @get_dv_distance(i32 %23, i32 %24)
store i32 %25, i32* %5
%26 = load i32, i32* %5
%27 = icmp sge i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = load i32, i32* %5
%30 = call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %29)
br label %33
31: ; preds = %22
%32 = call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
br label %34
34: ; preds = %33
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %18
37: ; preds = %18
%38 = call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %39
39: ; preds = %37, %14
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %6
42: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [5 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_dvtab(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %23, %1
ret void
4: ; preds = %1, %23
%5 = phi i32 [ %24, %23 ], [ 0, %1 ]
%6 = tail call i32 @is_neighbour(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = tail call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %10
10: ; preds = %8, %18
%11 = phi i32 [ %19, %18 ], [ 0, %8 ]
%12 = tail call i32 @get_dv_distance(i32 %5, i32 %11)
%13 = icmp sgt i32 %12, -1
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = tail call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %18
16: ; preds = %10
%17 = tail call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
%19 = add nuw nsw i32 %11, 1
%20 = icmp eq i32 %19, %0
br i1 %20, label %21, label %10
21: ; preds = %18
%22 = tail call i32 (i8*, ...) @con_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %23
23: ; preds = %4, %21
%24 = add nuw nsw i32 %5, 1
%25 = icmp eq i32 %24, %0
br i1 %25, label %3, label %4
}