// File: 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:
subq $0x128, %rsp            # imm = 0x128
movq %rdi, 0x120(%rsp)
movq %rsi, 0x118(%rsp)
movq 0x120(%rsp), %rdi
movq %rdi, 0x78(%rsp)
movq 0x118(%rsp), %rax
movq %rax, (%rdi)
addq $0x8, %rdi
movq %rdi, 0x70(%rsp)
callq 0xff80
movq 0x78(%rsp), %rdi
addq $0x40, %rdi
movq %rdi, 0x80(%rsp)
callq 0xff90
movq 0x118(%rsp), %rdi
callq 0xffa0
movq %rax, 0x88(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xe0(%rsp)
movq $0x0, 0xf0(%rsp)
leaq 0xe0(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0xffc0
leaq 0xdf(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0xffd0
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq 0x98(%rsp), %rcx
leaq 0x100(%rsp), %rdi
callq 0xffe0
jmp 0xfc30
movq 0x78(%rsp), %rdi
addq $0x40, %rdi
leaq 0x100(%rsp), %rsi
callq 0x10060
leaq 0x100(%rsp), %rdi
callq 0x100a0
leaq 0xdf(%rsp), %rdi
callq 0x10100
leaq 0xe0(%rsp), %rdi
callq 0x10110
movw $0x0, 0xca(%rsp)
movzwl 0xca(%rsp), %eax
movq %rax, 0x68(%rsp)
movq 0x118(%rsp), %rdi
callq 0xffa0
movq %rax, %rcx
movq 0x68(%rsp), %rax
cmpq %rcx, %rax
jae 0xff21
movq 0x78(%rsp), %rcx
movw 0xca(%rsp), %ax
movw %ax, 0x56(%rsp)
movq %rcx, %rdx
addq $0x8, %rdx
movq %rdx, 0x58(%rsp)
movq (%rcx), %rdi
movzwl %ax, %eax
movl %eax, %esi
callq 0x101a0
movq %rax, 0x60(%rsp)
jmp 0xfcd4
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdi
callq 0x10170
movq %rax, 0x48(%rsp)
jmp 0xfcea
movq 0x48(%rsp), %rax
movw 0x56(%rsp), %cx
movw %cx, (%rax)
movzwl 0xca(%rsp), %eax
addl $0x1, %eax
movw %ax, 0xc8(%rsp)
movzwl 0xc8(%rsp), %eax
movq %rax, 0x40(%rsp)
movq 0x118(%rsp), %rdi
callq 0xffa0
movq %rax, %rcx
movq 0x40(%rsp), %rax
cmpq %rcx, %rax
jae 0xff06
movzwl 0xca(%rsp), %eax
movzwl 0xc8(%rsp), %ecx
cmpl %ecx, %eax
jne 0xfd9f
movl $0x1, %edi
callq 0x2260
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
leaq 0xdf(%rsp), %rdi
callq 0x10100
leaq 0xe0(%rsp), %rdi
callq 0x10110
jmp 0xff29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
jmp 0xff29
movq 0x78(%rsp), %rdi
movzwl 0xca(%rsp), %esi
movzwl 0xc8(%rsp), %edx
callq 0x14f20
movsd %xmm0, 0x38(%rsp)
jmp 0xfdc1
movq 0x78(%rsp), %rdi
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0xc0(%rsp)
movzwl 0xca(%rsp), %esi
movzwl 0xc8(%rsp), %edx
callq 0x14f20
movsd %xmm0, 0x30(%rsp)
jmp 0xfdf2
movsd 0x30(%rsp), %xmm0
movsd 0xe208(%rip), %xmm1     # 0x1e008
ucomisd %xmm1, %xmm0
jbe 0xfe0b
jmp 0xfeed
movq 0x78(%rsp), %rdi
addq $0x40, %rdi
movzwl 0xca(%rsp), %eax
movl %eax, %esi
callq 0x101e0
movq %rax, 0x28(%rsp)
jmp 0xfe2a
leaq 0xc8(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x10290
movsd %xmm0, 0x18(%rsp)
movw %ax, 0x26(%rsp)
jmp 0xfe4c
movq 0x28(%rsp), %rdi
movsd 0x18(%rsp), %xmm0
movw 0x26(%rsp), %ax
movw %ax, 0xb0(%rsp)
movsd %xmm0, 0xb8(%rsp)
leaq 0xb0(%rsp), %rsi
callq 0x10220
jmp 0xfe7c
movq 0x78(%rsp), %rdi
addq $0x40, %rdi
movzwl 0xc8(%rsp), %eax
movl %eax, %esi
callq 0x101e0
movq %rax, 0x10(%rsp)
jmp 0xfe9b
leaq 0xca(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x10290
movsd %xmm0, (%rsp)
movw %ax, 0xe(%rsp)
jmp 0xfebc
movq 0x10(%rsp), %rdi
movsd (%rsp), %xmm0
movw 0xe(%rsp), %ax
movw %ax, 0xa0(%rsp)
movsd %xmm0, 0xa8(%rsp)
leaq 0xa0(%rsp), %rsi
callq 0x10220
jmp 0xfeeb
jmp 0xfeed
movw 0xc8(%rsp), %ax
addw $0x1, %ax
movw %ax, 0xc8(%rsp)
jmp 0xfd0a
jmp 0xff08
movw 0xca(%rsp), %ax
addw $0x1, %ax
movw %ax, 0xca(%rsp)
jmp 0xfc77
addq $0x128, %rsp            # imm = 0x128
retq
movq 0x80(%rsp), %rdi
callq 0x100a0
movq 0x70(%rsp), %rdi
callq 0x102d0
movq 0xd0(%rsp), %rdi
callq 0x2370
nopl (%rax)