// File: /workspace/github_cpp_makefile_star2_O3/guitld[P]Graph-Algorithms/source/Graph.cpp
// Function: Graph::minimum_tree_cost()
int Graph::minimum_tree_cost(){

     // Defining structures for the algorithm
     unordered_map<int, bool> visited;
     priority_queue <pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
     vector<int> dists (this->size(), 99999999);
     int cost = 0;

     dists[this->adj_lists.begin()->first - 1] = 0;

     pq.push(pair<int, int> (0, this->adj_lists.begin()->first));
     
     while (!pq.empty()){
          // Popping the top of the priority queue
          pair<int,int> curr_v = pq.top();
          pq.pop();
          // Check whether the node was visited or not
          if (!visited[curr_v.second]){
               // Increasing the cost
               cost += curr_v.first;
               visited[curr_v.second] = true;
               // Looping through its neighbors
               for (auto const &neighbor : this->adj_lists[curr_v.second]){
                    int v = neighbor.first;
                    int weight = neighbor.second;
                    if (!visited[neighbor.first] && dists[v - 1] > weight){
                         dists[v - 1] = weight;
                         pq.push(pair<int, int> (dists[v - 1], v));
                    }
               }
          }
     }

     return cost;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %r14
leaq -0x88(%rbp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movaps %xmm0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movslq 0x18(%rdi), %rsi
leaq -0x30(%rbp), %rdx
movl $0x5f5e0ff, (%rdx)      # imm = 0x5F5E0FF
leaq -0x80(%rbp), %rdi
leaq -0x3c(%rbp), %rcx
callq 0x49ae
movq 0x10(%r14), %rax
movslq 0x8(%rax), %rcx
movq -0x80(%rbp), %rdx
xorl %ebx, %ebx
movl %ebx, -0x4(%rdx,%rcx,4)
leaq -0x30(%rbp), %rsi
movl %ebx, (%rsi)
movl 0x8(%rax), %eax
movl %eax, 0x4(%rsi)
leaq -0x60(%rbp), %rdi
callq 0x4a36
movq -0x60(%rbp), %rdi
cmpq -0x58(%rbp), %rdi
je 0x4773
xorl %ebx, %ebx
leaq -0x2c(%rbp), %r15
leaq -0xb8(%rbp), %r13
movq %r14, -0x68(%rbp)
movq (%rdi), %rax
movq %rax, -0x30(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x4ab0
movq %r13, %rdi
movq %r15, %rsi
callq 0x62b8
cmpb $0x0, (%rax)
jne 0x4765
addl -0x30(%rbp), %ebx
movq %r13, %rdi
movq %r15, %rsi
callq 0x62b8
movl %ebx, -0x34(%rbp)
movb $0x1, (%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x4d1c
movq %rax, %r15
movq (%rax), %r14
cmpq %r15, %r14
je 0x475a
leaq 0x10(%r14), %rsi
movl 0x10(%r14), %ebx
movl 0x14(%r14), %r12d
movq %r13, %rdi
callq 0x62b8
cmpb $0x0, (%rax)
jne 0x4755
movslq %ebx, %rax
movq -0x80(%rbp), %rcx
cmpl %r12d, -0x4(%rcx,%rax,4)
jle 0x4755
movl %r12d, -0x4(%rcx,%rax,4)
movl %r12d, -0x3c(%rbp)
movl %eax, -0x38(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x4a36
movq (%r14), %r14
jmp 0x4710
movl -0x34(%rbp), %ebx
movq -0x68(%rbp), %r14
leaq -0x2c(%rbp), %r15
movq -0x60(%rbp), %rdi
cmpq -0x58(%rbp), %rdi
jne 0x46cb
movq -0x80(%rbp), %rax
testq %rax, %rax
je 0x478f
movq -0x70(%rbp), %rsi
subq %rax, %rsi
movq %rax, %rdi
callq 0x2160
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x47a0
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x2160
leaq -0xb8(%rbp), %rdi
callq 0x4c94
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x47cd
movq %rax, %rbx
jmp 0x47e5
jmp 0x47cd
jmp 0x47cd
jmp 0x47cd
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x47e5
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x2160
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x47fa
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x2160
leaq -0xb8(%rbp), %rdi
callq 0x4c94
movq %rbx, %rdi
callq 0x2260