// File: /workspace/github_cpp_makefile_star2_O1/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 0x4b74
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 0x4bfc
movq -0x60(%rbp), %rax
cmpq -0x58(%rbp), %rax
je 0x493c
xorl %ebx, %ebx
leaq -0x2c(%rbp), %r15
leaq -0xb8(%rbp), %r13
movq %r14, -0x68(%rbp)
movq (%rax), %rax
movq %rax, -0x30(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x4c7a
movq %r13, %rdi
movq %r15, %rsi
callq 0x649a
cmpb $0x0, (%rax)
jne 0x492e
addl -0x30(%rbp), %ebx
movq %r13, %rdi
movq %r15, %rsi
callq 0x649a
movl %ebx, -0x34(%rbp)
movb $0x1, (%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x4ed4
movq %rax, %r15
movq (%rax), %r14
cmpq %r15, %r14
je 0x4923
leaq 0x10(%r14), %rsi
movl 0x10(%r14), %ebx
movl 0x14(%r14), %r12d
movq %r13, %rdi
callq 0x649a
cmpb $0x0, (%rax)
jne 0x491e
movslq %ebx, %rax
movq -0x80(%rbp), %rcx
cmpl %r12d, -0x4(%rcx,%rax,4)
jle 0x491e
movl %r12d, -0x4(%rcx,%rax,4)
movl -0x4(%rcx,%rax,4), %ecx
movl %ecx, -0x3c(%rbp)
movl %eax, -0x38(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x4bfc
movq (%r14), %r14
jmp 0x48d6
movl -0x34(%rbp), %ebx
movq -0x68(%rbp), %r14
leaq -0x2c(%rbp), %r15
movq -0x60(%rbp), %rax
cmpq -0x58(%rbp), %rax
jne 0x4891
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x4951
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x2160
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x4966
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x2160
leaq -0xb8(%rbp), %rdi
callq 0x4e4c
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4993
movq %rax, %rbx
jmp 0x49ab
jmp 0x4993
jmp 0x4993
jmp 0x4993
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x49ab
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x2160
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x49c0
movq -0x50(%rbp), %rsi
subq %rdi, %rsi
callq 0x2160
leaq -0xb8(%rbp), %rdi
callq 0x4e4c
movq %rbx, %rdi
callq 0x2260