// File: /workspace/github_cpp_makefile_star2_O3/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, 0x38(%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, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rcx, %rsi
leaq 0x70(%rsp), %rdx
movq %rax, 0x10(%rdx)
movapd %xmm0, (%rdx)
leaq 0x90(%rsp), %rdi
leaq 0xb(%rsp), %rcx
callq 0x9728
movupd 0x40(%rbp), %xmm0
movq 0x50(%rbp), %rax
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, 0x30(%rsp)
movq %rcx, 0x50(%rbp)
leaq 0x50(%rsp), %rdi
movupd %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
callq 0x97b8
movq %rbx, %rdi
callq 0x97b8
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x946e
callq 0x2150
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rax
cmpq (%rcx), %rax
movq 0x30(%rsp), %rbp
je 0x969b
movw $0x2, %ax
movl %eax, 0xc(%rsp)
xorl %ecx, %ecx
movq $0x0, 0x10(%rsp)
movq (%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
movabsq $0x6db6db6db6db6db7, %rax # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %rdx
cmpq %rcx, %rdx
jbe 0x96cf
movq %rcx, 0x18(%rsp)
imulq $0x38, %rcx, %rax
addq %rax, %rsi
movq 0x38(%rsp), %rdi
callq 0x9944
movq 0x10(%rsp), %rcx
movw %cx, (%rax)
leal 0x1(%rcx), %edx
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
movl %edx, 0x2c(%rsp)
movzwl %dx, %edx
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rcx, %rax
movq %rdx, 0x40(%rsp)
cmpq %rdx, %rax
jbe 0x967d
movw $0xffff, 0x8(%rsp)      # imm = 0xFFFF
movzwl 0x10(%rsp), %r12d
movq 0x18(%rsp), %rax
leaq (%rax,%rax,2), %rax
movq %rax, 0x68(%rsp)
movl 0xc(%rsp), %eax
movl %eax, %r13d
movq 0x40(%rsp), %r15
subw $0x1, 0x8(%rsp)
jb 0x96ad
leal -0x1(%r13), %r14d
movzwl %r14w, %ebx
movq %rbp, %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0xb100
movsd %xmm0, 0x48(%rsp)
movq %rbp, %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0xb100
ucomisd 0x3a90(%rip), %xmm0     # 0xd008
ja 0x964f
movq 0x40(%rbp), %rax
movq 0x48(%rbp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq 0x18(%rsp), %rdx
jbe 0x96b7
movq 0x68(%rsp), %rcx
leaq (%rax,%rcx,8), %rdi
movw %r14w, 0x50(%rsp)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x95dc
movupd 0x50(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x8(%rdi)
jmp 0x95e6
leaq 0x50(%rsp), %rdx
callq 0x9d72
movq 0x40(%rbp), %rax
movq 0x48(%rbp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq %r15, %rdx
jbe 0x96be
leaq (%r15,%r15,2), %rcx
leaq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rax
movw %ax, 0x50(%rsp)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x9645
movupd 0x50(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x8(%rdi)
jmp 0x964f
leaq 0x50(%rsp), %rdx
callq 0x9d72
movzwl %r13w, %r15d
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rcx, %rax
incl %r13d
cmpq %r15, %rax
ja 0x953c
incl 0xc(%rsp)
movq 0x40(%rsp), %rsi
movq %rsi, %rcx
movl 0x2c(%rsp), %edx
movq %rdx, 0x10(%rsp)
cmpq %rsi, %rax
ja 0x9498
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x21b0
movq 0x18(%rsp), %rsi
jmp 0x96c1
movq %r15, %rsi
leaq 0x39f9(%rip), %rdi      # 0xd0c1
xorl %eax, %eax
callq 0x21f0
leaq 0x39eb(%rip), %rdi      # 0xd0c1
movq %rcx, %rsi
xorl %eax, %eax
callq 0x21f0
movq %rax, %r15
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x9709
callq 0x2150
jmp 0x9709
movq %rax, %r15
movq 0x30(%rsp), %rbp
jmp 0x9709
jmp 0x9706
jmp 0x9706
jmp 0x9706
jmp 0x9706
movq %rax, %r15
addq $0x40, %rbp
movq %rbp, %rdi
callq 0x97b8
movq 0x38(%rsp), %rdi
callq 0x9e8e
movq %r15, %rdi
callq 0x2250
nop