// File: /workspace/github_cpp_makefile_star2_O1/Manca[P]algorithms2/./assignment1.hpp
// Function: assignment1::prims_algorithm::run_algorithm(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void run_algorithm(const std::string& inputFile)
        {
            std::vector<Edge> edges;
            Graph g;

            std::ifstream file(inputFile, std::ios::in);

            if (file.is_open())
            {
                PROFILE("Read file for Prim's algo");
                int num_nodes, num_edges;
                file >> num_nodes >> num_edges;

                int snode, dnode, cost;
                while (file >> snode >> dnode >> cost)
                {
                    Edge e = std::make_tuple(snode, dnode, cost);
                    edges.push_back(e);

                    g[snode].push_back(std::make_tuple(snode, dnode, cost));
                    g[dnode].push_back(std::make_tuple(dnode, snode, cost));

                }
                file.close();
                PROFILE_STOP();

                // Compute Prim's Minimum Spanning Tree
                PROFILE("Prim's algorithm");
                long long total_cost = prims_algorithm(g);
                PROFILE_STOP();
                std::cout << "Total cost of Prim's MST is: " << total_cost << std::endl;

                assert(total_cost == -3612829);
            }
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rdi, %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
xorl %eax, %eax
movq %rax, 0x50(%rsp)
leaq 0x68(%rsp), %rcx
movl $0x0, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x90(%rsp), %rdi
movl $0x8, %edx
callq 0x2300
leaq 0x108(%rsp), %rdi
callq 0x20b0
testb %al, %al
je 0x33d9
callq 0x88b8
movq %rax, %rbx
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xb0b7(%rip), %rsi      # 0xe273
leaq 0xb0c9(%rip), %rdx      # 0xe28c
leaq 0x20(%rsp), %rdi
callq 0xbb3a
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x8904
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x31e9
callq 0x2200
leaq 0x90(%rsp), %rdi
leaq 0x5c(%rsp), %rsi
callq 0x2160
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
callq 0x2160
leaq 0x90(%rsp), %rbx
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0x60(%rsp), %r13
leaq 0x14(%rsp), %rbp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2160
movq %rax, %rdi
movq %r15, %rsi
callq 0x2160
movq %rax, %rdi
movq %r12, %rsi
callq 0x2160
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3307
movl 0x8(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x10(%rsp), %eax
movl %eax, 0x28(%rsp)
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0x3297
movl 0x28(%rsp), %eax
movl %eax, 0x8(%rsi)
movq 0x20(%rsp), %rax
movq %rax, (%rsi)
addq $0xc, 0x48(%rsp)
jmp 0x32a6
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0xb74a
movq %r13, %rdi
movq %r14, %rsi
callq 0x87ae
movl 0x8(%rsp), %ecx
movl %ecx, 0x14(%rsp)
movl 0xc(%rsp), %ecx
movl %ecx, 0x18(%rsp)
movl 0x10(%rsp), %ecx
movl %ecx, 0x1c(%rsp)
movq %rax, %rdi
movq %rbp, %rsi
callq 0xbbca
movq %r13, %rdi
movq %r15, %rsi
callq 0x87ae
movl 0x8(%rsp), %ecx
movl %ecx, 0x14(%rsp)
movl 0x10(%rsp), %ecx
movl %ecx, 0x18(%rsp)
movl 0xc(%rsp), %ecx
movl %ecx, 0x1c(%rsp)
movq %rax, %rdi
movq %rbp, %rsi
callq 0xbbca
jmp 0x3229
leaq 0x90(%rsp), %rdi
callq 0x2090
callq 0x88b8
movq %rax, %rdi
callq 0x894e
callq 0x88b8
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %r14
movq %r14, (%rdi)
leaq 0xaf50(%rip), %rsi      # 0xe28d
leaq 0xaf59(%rip), %rdx      # 0xe29d
callq 0xbb3a
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x8904
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x3365
callq 0x2200
leaq 0x60(%rsp), %rdi
callq 0x2c52
movq %rax, %rbx
callq 0x88b8
movq %rax, %rdi
callq 0x894e
movq 0x11c52(%rip), %rdi     # 0x14fd8
leaq 0xaf11(%rip), %rsi      # 0xe29e
movl $0x1d, %edx
callq 0x2250
movq 0x11c3a(%rip), %rdi     # 0x14fd8
movq %rbx, %rsi
callq 0x2100
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2190
cmpq $-0x37209d, %rbx        # imm = 0xFFC8DF63
jne 0x3411
leaq 0x90(%rsp), %rdi
callq 0x20c0
leaq 0x60(%rsp), %rdi
callq 0x9a88
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x33ff
callq 0x2200
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xaea4(%rip), %rdi      # 0xe2bc
leaq 0xad65(%rip), %rsi      # 0xe184
leaq 0xaead(%rip), %rcx      # 0xe2d3
movl $0x126, %edx            # imm = 0x126
callq 0x2170
jmp 0x3434
jmp 0x345d
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x3460
callq 0x2200
jmp 0x3460
jmp 0x345d
jmp 0x345d
jmp 0x345d
movq %rax, %rbx
jmp 0x346d
jmp 0x345d
jmp 0x345d
jmp 0x345d
jmp 0x345d
jmp 0x345d
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x20c0
leaq 0x60(%rsp), %rdi
callq 0x9a88
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x3486
callq 0x2200
movq %rbx, %rdi
callq 0x2360