// File: /workspace/github_cpp_makefile_star2_O1/keyan[P]ev_routing_engine/./router.h
// Function: Router::Router(std::vector<Station, std::allocator<Station>> const&)
Router(const std::vector<Station> &network) : network_(network) {
    graph_ = std::vector<std::vector<std::pair<NodeID, Kilometers>>>(
        network.size(), std::vector<std::pair<NodeID, Kilometers>>());

    // Created directed graph limited by battery radius.
    for (NodeID i = 0; i < network.size(); ++i) {
      node_name_map_[network_.at(i).name] = i;

      for (NodeID j = i + 1; j < network.size(); ++j) {
        if (i == j) {
          exit(1);
        }
        Kilometers travel_dist = calculate_travel_km(i, j);
        if (calculate_travel_km(i, j) > MAX_CHARGE) {
          continue;
        }

        graph_.at(i).emplace_back(std::make_pair(j, travel_dist));
        graph_.at(j).emplace_back(std::make_pair(i, travel_dist));
      }
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %rcx
movq %rdi, %rbp
movq %rsi, (%rdi)
leaq 0x8(%rdi), %rax
movq %rax, 0x50(%rsp)
leaq 0x38(%rdi), %rax
movq %rax, 0x8(%rdi)
movq $0x1, 0x10(%rdi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%rdi)
movl $0x3f800000, 0x28(%rdi) # imm = 0x3F800000
movupd %xmm0, 0x30(%rdi)
movupd %xmm0, 0x40(%rdi)
xorl %eax, %eax
movq %rax, 0x50(%rdi)
movq 0x8(%rsi), %rsi
movq %rcx, 0x20(%rsp)
subq (%rcx), %rsi
sarq $0x3, %rsi
movabsq $0x6db6db6db6db6db7, %r14 # imm = 0x6DB6DB6DB6DB6DB7
imulq %r14, %rsi
leaq 0x70(%rsp), %rdx
movq %rax, 0x10(%rdx)
movapd %xmm0, (%rdx)
leaq 0x90(%rsp), %rdi
leaq 0xf(%rsp), %rcx
callq 0x92f0
leaq 0x30(%rsp), %rdi
xorpd %xmm0, %xmm0
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x40(%rbp), %rax
movupd 0x48(%rbp), %xmm0
leaq 0x90(%rsp), %rbx
movq (%rbx), %rcx
movq %rcx, 0x40(%rbp)
movq 0x8(%rbx), %rcx
movq %rcx, 0x48(%rbp)
movq 0x10(%rbx), %rcx
movq %rbp, 0x48(%rsp)
movq %rcx, 0x50(%rbp)
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rsi
movq %rax, (%rdi)
movupd %xmm0, 0x8(%rdi)
movq %rcx, (%rbx)
movq %rdx, 0x8(%rbx)
movq %rsi, 0x10(%rbx)
callq 0x9380
movq %rbx, %rdi
callq 0x9380
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x9034
callq 0x2150
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rax
cmpq (%rcx), %rax
movq 0x48(%rsp), %rbp
je 0x9269
movw $0x2, %ax
movl %eax, 0x1c(%rsp)
xorl %r8d, %r8d
movq $0x0, 0x10(%rsp)
movq (%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
imulq %r14, %rdx
cmpq %r8, %rdx
jbe 0x9298
movq %r8, 0x28(%rsp)
imulq $0x38, %r8, %rax
addq %rax, %rsi
movq 0x50(%rsp), %rdi
callq 0x9506
movq 0x10(%rsp), %rcx
movw %cx, (%rax)
leal 0x1(%rcx), %eax
movq 0x20(%rsp), %rdx
movq 0x8(%rdx), %rcx
subq (%rdx), %rcx
movzwl %ax, %eax
sarq $0x3, %rcx
imulq %r14, %rcx
movq %rax, 0x58(%rsp)
cmpq %rax, %rcx
jbe 0x922e
movw $0xffff, %r12w          # imm = 0xFFFF
movzwl 0x10(%rsp), %r15d
movq 0x28(%rsp), %rax
leaq (%rax,%rax,2), %rax
movq %rax, 0x68(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, %r13d
subw $0x1, %r12w
jb 0x927b
leal -0x1(%r13), %r14d
movzwl %r14w, %ebx
movq %rbp, %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0xacd4
movsd %xmm0, 0x60(%rsp)
movq %rbp, %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0xacd4
ucomisd 0x3ee9(%rip), %xmm0     # 0xd008
ja 0x91fb
movq 0x40(%rbp), %rax
movq 0x48(%rbp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq 0x28(%rsp), %rdx
jbe 0x9285
movq 0x68(%rsp), %rcx
leaq (%rax,%rcx,8), %rdi
movw %r14w, 0x30(%rsp)
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x9183
movupd 0x30(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x8(%rdi)
jmp 0x918d
leaq 0x30(%rsp), %rdx
callq 0x993e
movq 0x40(%rbp), %rax
movq 0x48(%rbp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
movq 0x58(%rsp), %rsi
cmpq %rsi, %rdx
jbe 0x928a
leaq (%rsi,%rsi,2), %rcx
leaq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rax
movw %ax, 0x30(%rsp)
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x91f1
movupd 0x30(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x8(%rdi)
jmp 0x91fb
leaq 0x30(%rsp), %rdx
callq 0x993e
movzwl %r13w, %edx
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rcx, %rax
incl %r13d
movq %rdx, 0x58(%rsp)
cmpq %rdx, %rax
ja 0x90e4
movq 0x10(%rsp), %rax
incl %eax
movq %rax, 0x10(%rsp)
movzwl %ax, %r8d
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %r14 # imm = 0x6DB6DB6DB6DB6DB7
imulq %r14, %rax
incl 0x1c(%rsp)
cmpq %r8, %rax
ja 0x905f
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x21b0
movq 0x28(%rsp), %rsi
leaq 0x3e30(%rip), %rdi      # 0xd0c1
xorl %eax, %eax
callq 0x21f0
leaq 0x3e22(%rip), %rdi      # 0xd0c1
movq %r8, %rsi
xorl %eax, %eax
callq 0x21f0
movq %rax, %r15
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x92d2
callq 0x2150
jmp 0x92d2
movq %rax, %r15
movq 0x48(%rsp), %rbp
jmp 0x92d2
jmp 0x92cf
jmp 0x92cf
jmp 0x92cf
jmp 0x92cf
movq %rax, %r15
addq $0x40, %rbp
movq %rbp, %rdi
callq 0x9380
movq 0x50(%rsp), %rdi
callq 0x9a5a
movq %r15, %rdi
callq 0x2250