// File: /workspace/github_cpp_makefile_star2_O1/Kei18[P]pibt/./src/solver/solver.cpp
// Function: Solver::WarshallFloyd()
void Solver::WarshallFloyd() {
  int nodeNum = G->getNodesNum();
  Nodes neighbor;
  int INF = 100000;
  dists = Eigen::MatrixXi::Ones(nodeNum, nodeNum) * INF;

  // initialize weight
  for (int i = 0; i < nodeNum; ++i) {
    neighbor = G->neighbor(G->getNodeFromIndex(i));
    for (auto v : neighbor) {
      dists(i, v->getIndex()) = 1;
    }
    dists(i, i) = 0;
  }

  // main loop
  for (int k = 0; k < nodeNum; ++k) {
    for (int i = 0; i < nodeNum; ++i) {
      for (int j = 0; j < nodeNum; ++j) {
        if (dists(i, j) > dists(i, k) + dists(k, j)) {
          dists(i, j) = dists(i, k) + dists(k, j);
        }
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x38(%rdi), %rcx
movq 0x18(%rcx), %rax
subq 0x10(%rcx), %rax
movq %rax, %rcx
shrq $0x3, %rcx
movq %rcx, (%rsp)
movslq %ecx, %r14
testq %r14, %r14
js 0x3efff
movq %rdi, %rbx
leaq 0x40(%rdi), %r15
cmpq %r14, 0x48(%rdi)
jne 0x3ed4a
cmpq %r14, 0x50(%rbx)
je 0x3ed81
shlq $0x1d, %rax
shrq $0x20, %rax
je 0x3ed6c
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
xorl %edx, %edx
divq %r14
cmpq %r14, %rax
jl 0x3f03d
movq %r14, %rsi
imulq %r14, %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %r14, %rcx
callq 0x3ff3e
movq 0x48(%rbx), %rdx
cmpq %r14, %rdx
jne 0x3f01e
movq 0x50(%rbx), %rax
cmpq %r14, %rax
jne 0x3f01e
movq (%r15), %rcx
imulq %rdx, %rax
leaq 0x3(%rax), %rdx
testq %rax, %rax
cmovnsq %rax, %rdx
andq $-0x4, %rdx
cmpq $0x4, %rax
jl 0x3edcd
xorl %esi, %esi
movaps 0xc990(%rip), %xmm0     # 0x4b750
movaps %xmm0, (%rcx,%rsi,4)
addq $0x4, %rsi
cmpq %rdx, %rsi
jl 0x3edc0
cmpq %rax, %rdx
jge 0x3ede1
movl $0x186a0, (%rcx,%rdx,4) # imm = 0x186A0
incq %rdx
cmpq %rdx, %rax
jne 0x3edd2
movl $0x0, %ecx
movq (%rsp), %rax
testl %eax, %eax
cmovgl %eax, %ecx
movq %rcx, 0x18(%rsp)
jle 0x3eeff
xorl %ebp, %ebp
xorl %r14d, %r14d
xorl %r13d, %r13d
movq 0x38(%rbx), %rsi
movq 0x10(%rsi), %rax
movq (%rax,%r13,8), %rdx
leaq 0x20(%rsp), %rdi
callq 0x1a320
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %r12
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
testq %rbp, %rbp
je 0x3ee55
subq %rbp, %r14
movq %rbp, %rdi
movq %r14, %rsi
callq 0x6380
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3ee6c
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x10(%rsp), %rbp
cmpq %r12, %rbp
je 0x3eec0
movq 0x48(%rbx), %rax
cmpq %r13, %rax
jle 0x3efe0
leaq (,%r13,4), %rcx
addq 0x40(%rbx), %rcx
movq %rbp, %rdx
movq (%rdx), %rsi
movslq 0x4(%rsi), %rsi
testq %rsi, %rsi
js 0x3efe0
cmpq %rsi, 0x50(%rbx)
jle 0x3efe0
imulq %rax, %rsi
movl $0x1, (%rcx,%rsi,4)
addq $0x8, %rdx
cmpq %r12, %rdx
jne 0x3ee92
movq 0x48(%rbx), %rax
cmpq %r13, %rax
jle 0x3efe0
cmpq %r13, 0x50(%rbx)
jle 0x3efe0
imulq %r13, %rax
shlq $0x2, %rax
addq (%r15), %rax
movl $0x0, (%rax,%r13,4)
incq %r13
movq 0x8(%rsp), %r14
cmpq 0x18(%rsp), %r13
jne 0x3ee02
jmp 0x3ef11
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
cmpl $0x0, (%rsp)
jle 0x3efba
movq (%rsp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
xorl %edx, %edx
testq %rax, %rax
je 0x3efa8
movq 0x48(%rbx), %rsi
movq %rsi, %rdi
imulq %rdx, %rdi
leaq (,%rsi,4), %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
cmpl $0x0, (%rsp)
jle 0x3ef9c
cmpq %r10, %rsi
jle 0x3efe0
movq 0x40(%rbx), %r11
movq 0x50(%rbx), %r14
leaq (%r11,%rdi,4), %r12
testq %r14, %r14
movl $0x0, %r13d
cmovgq %r14, %r13
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x3efe0
cmpq %rdx, %r14
jle 0x3efe0
cmpq %rdx, %rsi
jle 0x3efe0
movl (%r11,%rcx), %r15d
addl (%r12,%r10,4), %r15d
cmpl %r15d, (%r11,%r9)
jle 0x3ef91
movl %r15d, (%r11,%r9)
incq %rbp
addq %r8, %r11
cmpq %rbp, %rax
jne 0x3ef70
incq %r10
addq $0x4, %r9
cmpq %rax, %r10
jne 0x3ef46
incq %rdx
addq $0x4, %rcx
cmpq 0x18(%rsp), %rdx
jne 0x3ef28
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3efd1
movq 0x8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc150(%rip), %rdi      # 0x4b137
leaq 0xc17e(%rip), %rsi      # 0x4b16c
leaq 0xccb1(%rip), %rcx      # 0x4bca6
movl $0x16f, %edx            # imm = 0x16F
callq 0x6260
leaq 0xb814(%rip), %rdi      # 0x4a81a
leaq 0xb8a2(%rip), %rsi      # 0x4a8af
leaq 0xc854(%rip), %rcx      # 0x4b868
movl $0x4a, %edx
callq 0x6260
leaq 0xb9b3(%rip), %rdi      # 0x4a9d8
leaq 0xb9db(%rip), %rsi      # 0x4aa07
leaq 0xcaae(%rip), %rcx      # 0x4bae1
movl $0x2fd, %edx            # imm = 0x2FD
callq 0x6260
movl $0x8, %edi
callq 0x61d0
movq 0x22f3a(%rip), %rcx     # 0x61f88
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x22f54(%rip), %rsi     # 0x61fb0
movq 0x22f05(%rip), %rdx     # 0x61f68
movq %rax, %rdi
callq 0x6600
movq %rax, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
jmp 0x3f078
movq %rax, %rbx
testq %rbp, %rbp
je 0x3f08b
subq %rbp, %r14
movq %rbp, %rdi
movq %r14, %rsi
callq 0x6380
movq %rbx, %rdi
callq 0x6620
nop