#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*/ floyd(int **, int **, int **);
int /*<<< orphan*/ printPath(int **, int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int g[6][6] = {{0, 7, 9, 32767, 32767, 16},    {7, 0, 10, 15, 32767, 32767},
                 {9, 10, 0, 11, 32767, 2},       {32767, 15, 11, 0, 6, 32767},
                 {32767, 32767, 32767, 6, 0, 9}, {14, 32767, 2, 32767, 9, 0}};
  int path[6][6];
  int dist[6][6];
  int i, j;
  floyd(g, path, dist);
  for (i = 0; i < 6; i++) {
    for (j = 0; j < 6; j++) {
      printf("%d->%d %d  ", i, j, dist[i][j]);
      printPath(path, i, j);
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xa0(%rbp),%rdi
lea    0xea0(%rip),%rsi
mov    $0x90,%edx
call   1040 <memcpy@plt>
lea    -0xa0(%rbp),%rdi
lea    -0x130(%rbp),%rsi
lea    -0x1c0(%rbp),%rdx
call   1050 <floyd@plt>
movl   $0x0,-0x1c4(%rbp)
cmpl   $0x6,-0x1c4(%rbp)
jge    1247 <main+0x107>
movl   $0x0,-0x1c8(%rbp)
cmpl   $0x6,-0x1c8(%rbp)
jge    1225 <main+0xe5>
mov    -0x1c4(%rbp),%esi
mov    -0x1c8(%rbp),%edx
movslq -0x1c4(%rbp),%rcx
lea    -0x1c0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c8(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x130(%rbp),%rdi
mov    -0x1c4(%rbp),%esi
mov    -0x1c8(%rbp),%edx
call   1060 <printPath@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c8(%rbp)
jmp    11a5 <main+0x65>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c4(%rbp)
jmp    118e <main+0x4e>
xor    %eax,%eax
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1b8,%rsp
lea    0xe9b(%rip),%rsi
lea    0x120(%rsp),%rbx
mov    $0x90,%edx
mov    %rbx,%rdi
call   1050 <memcpy@plt>
lea    0x90(%rsp),%r14
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <floyd@plt>
lea    0x14(%rsp),%r12
lea    0xef4(%rip),%r15
xor    %ebx,%ebx
xchg   %ax,%ax
mov    -0x14(%r12),%ecx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %edx,%edx
call   1070 <printPath@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x10(%r12),%ecx
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1070 <printPath@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xc(%r12),%ecx
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
call   1070 <printPath@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8(%r12),%ecx
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
call   1070 <printPath@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%r12),%ecx
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
call   1070 <printPath@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%r12),%ecx
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x5,%edx
call   1070 <printPath@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
add    $0x18,%r12
cmp    $0x6,%rbx
jne    11a0 <main+0x50>
xor    %eax,%eax
add    $0x1b8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@__const.main.g = [6 x [6 x i32]] [[6 x i32] [i32 0, i32 7, i32 9, i32 32767, i32 32767, i32 16], [6 x i32] [i32 7, i32 0, i32 10, i32 15, i32 32767, i32 32767], [6 x i32] [i32 9, i32 10, i32 0, i32 11, i32 32767, i32 2], [6 x i32] [i32 32767, i32 15, i32 11, i32 0, i32 6, i32 32767], [6 x i32] [i32 32767, i32 32767, i32 32767, i32 6, i32 0, i32 9], [6 x i32] [i32 14, i32 32767, i32 2, i32 32767, i32 9, i32 0]]
@.str = [12 x i8] c"%d->%d %d \00"
define i32 @main() {
%1 = alloca [6 x [6 x i32]]
%2 = alloca [6 x [6 x i32]]
%3 = alloca [6 x [6 x i32]]
%4 = bitcast [6 x [6 x i32]]* %1 to i8*
%5 = bitcast [6 x [6 x i32]]* %2 to i8*
%6 = bitcast [6 x [6 x i32]]* %3 to i8*
%7 = bitcast [6 x [6 x i32]]* %1 to i32**
%8 = bitcast [6 x [6 x i32]]* %2 to i32**
%9 = bitcast [6 x [6 x i32]]* %3 to i32**
%10 = call i32 @floyd(i32** %7, i32** %8, i32** %9)
br label %11
11: ; preds = %0, %11
%12 = phi i64 [ 0, %0 ], [ %45, %11 ]
%13 = getelementptr inbounds [6 x [6 x i32]], [6 x [6 x i32]]* %3, i64 0, i64 %12, i64 0
%14 = load i32, i32* %13
%15 = trunc i64 %12 to i32
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %15, i32 0, i32 %14)
%17 = call i32 @printPath(i32** %8, i32 %15, i32 0)
%18 = call i32 @putchar(i32 10)
%19 = getelementptr inbounds [6 x [6 x i32]], [6 x [6 x i32]]* %3, i64 0, i64 %12, i64 1
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %15, i32 1, i32 %20)
%22 = call i32 @printPath(i32** %8, i32 %15, i32 1)
%23 = call i32 @putchar(i32 10)
%24 = getelementptr inbounds [6 x [6 x i32]], [6 x [6 x i32]]* %3, i64 0, i64 %12, i64 2
%25 = load i32, i32* %24
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %15, i32 2, i32 %25)
%27 = call i32 @printPath(i32** %8, i32 %15, i32 2)
%28 = call i32 @putchar(i32 10)
%29 = getelementptr inbounds [6 x [6 x i32]], [6 x [6 x i32]]* %3, i64 0, i64 %12, i64 3
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %15, i32 3, i32 %30)
%32 = call i32 @printPath(i32** %8, i32 %15, i32 3)
%33 = call i32 @putchar(i32 10)
%34 = getelementptr inbounds [6 x [6 x i32]], [6 x [6 x i32]]* %3, i64 0, i64 %12, i64 4
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %15, i32 4, i32 %35)
%37 = call i32 @printPath(i32** %8, i32 %15, i32 4)
%38 = call i32 @putchar(i32 10)
%39 = getelementptr inbounds [6 x [6 x i32]], [6 x [6 x i32]]* %3, i64 0, i64 %12, i64 5
%40 = load i32, i32* %39
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %15, i32 5, i32 %40)
%42 = call i32 @printPath(i32** %8, i32 %15, i32 5)
%43 = call i32 @putchar(i32 10)
%44 = call i32 @putchar(i32 10)
%45 = add nuw nsw i64 %12, 1
%46 = icmp eq i64 %45, 6
br i1 %46, label %47, label %11
47: ; preds = %11
ret i32 0
}