#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 PrintTheSolution(int distance[][4]) {
  int i, j;
  printf("The shortest distances between every pair of vertices \n");
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 4; j++) {
      if (distance[i][j] == 99999)
        printf("%7s", "INF");
      else
        printf("%7d", distance[i][j]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<PrintTheSolution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    11d9 <PrintTheSolution+0xc9>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    11bd <PrintTheSolution+0xad>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x1869f,(%rax,%rcx,4)
jne    1186 <PrintTheSolution+0x76>
lea    0xec5(%rip),%rdi
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11aa <PrintTheSolution+0x9a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11af <PrintTheSolution+0x9f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <PrintTheSolution+0x32>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <PrintTheSolution+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintTheSolution>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%r13
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb1(%rip),%r14
lea    0xeae(%rip),%r15
lea    0xeab(%rip),%r12
xor    %ebx,%ebx
jmp    1195 <PrintTheSolution+0x65>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rbx
cmp    $0x40,%rbx
je     124a <PrintTheSolution+0x11a>
mov    0x0(%r13,%rbx,1),%esi
cmp    $0x1869f,%esi
jne    11c0 <PrintTheSolution+0x90>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11ca <PrintTheSolution+0x9a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%r13,%rbx,1),%esi
cmp    $0x1869f,%esi
jne    11f0 <PrintTheSolution+0xc0>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11fa <PrintTheSolution+0xca>
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%r13,%rbx,1),%esi
cmp    $0x1869f,%esi
jne    1220 <PrintTheSolution+0xf0>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    122a <PrintTheSolution+0xfa>
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%r13,%rbx,1),%esi
cmp    $0x1869f,%esi
je     1170 <PrintTheSolution+0x40>
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    117d <PrintTheSolution+0x4d>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [56 x i8] c"The shortest distances between every pair of vertices \0A\00"
@.str.1 = [4 x i8] c"%7s\00"
@.str.2 = [4 x i8] c"INF\00"
@.str.3 = [4 x i8] c"%7d\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @PrintTheSolution([4 x i32]* %0) {
%2 = alloca [4 x i32]*
%3 = alloca i32
%4 = alloca i32
store [4 x i32]* %0, [4 x i32]** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %6
6: ; preds = %41, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %44
9: ; preds = %6
store i32 0, i32* %4
br label %10
10: ; preds = %36, %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 4
br i1 %12, label %13, label %39
13: ; preds = %10
%14 = load [4 x i32]*, [4 x i32]** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 %16
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %17, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = icmp eq i32 %21, 99999
br i1 %22, label %23, label %25
23: ; preds = %13
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %35
25: ; preds = %13
%26 = load [4 x i32]*, [4 x i32]** %2
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [4 x i32], [4 x i32]* %26, i64 %28
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [4 x i32], [4 x i32]* %29, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %25, %23
br label %36
36: ; preds = %35
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %10
39: ; preds = %10
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %41
41: ; preds = %39
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 1
store i32 %43, i32* %3
br label %6
44: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%7s\00"
@.str.2 = [4 x i8] c"INF\00"
@.str.3 = [4 x i8] c"%7d\00"
@str = [55 x i8] c"The shortest distances between every pair of vertices \00"
define void @PrintTheSolution([4 x i32]* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %1, %36
%4 = phi i64 [ 0, %1 ], [ %38, %36 ]
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 %4, i64 0
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 99999
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %3
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %6)
br label %12
12: ; preds = %8, %10
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 %4, i64 1
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 99999
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %14)
br label %20
18: ; preds = %12
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %16
%21 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 %4, i64 2
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 99999
br i1 %23, label %26, label %24
24: ; preds = %20
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %22)
br label %28
26: ; preds = %20
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %24
%29 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 %4, i64 3
%30 = load i32, i32* %29
%31 = icmp eq i32 %30, 99999
br i1 %31, label %34, label %32
32: ; preds = %28
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %30)
br label %36
34: ; preds = %28
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %36
36: ; preds = %34, %32
%37 = tail call i32 @putchar(i32 10)
%38 = add nuw nsw i64 %4, 1
%39 = icmp eq i64 %38, 4
br i1 %39, label %40, label %3
40: ; preds = %36
ret void
}