// File: 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:
subq $0x388, %rsp            # imm = 0x388
movq %rdi, 0x380(%rsp)
leaq 0x368(%rsp), %rdi
callq 0x10290
leaq 0x338(%rsp), %rdi
callq 0x10820
movq 0x380(%rsp), %rsi
leaq 0x130(%rsp), %rdi
movl $0x8, %edx
callq 0x33e0
jmp 0x4a75
leaq 0x130(%rsp), %rdi
callq 0x33d0
movb %al, 0x8f(%rsp)
jmp 0x4a8b
movb 0x8f(%rsp), %al
testb $0x1, %al
jne 0x4a9b
jmp 0x4e9f
callq 0x10a60
movq %rax, 0x80(%rsp)
jmp 0x4aaa
leaq 0xff(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0x3470
movq 0x78(%rsp), %rdx
leaq 0x2b708(%rip), %rsi     # 0x301d0
leaq 0x100(%rsp), %rdi
callq 0x3360
jmp 0x4ad7
movq 0x80(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x10ad0
jmp 0x4aee
leaq 0x100(%rsp), %rdi
callq 0x31f0
leaq 0xff(%rsp), %rdi
callq 0x3300
leaq 0x130(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x31e0
movq %rax, 0x70(%rsp)
jmp 0x4b24
movq 0x70(%rsp), %rdi
leaq 0xf4(%rsp), %rsi
callq 0x31e0
jmp 0x4b38
jmp 0x4b3a
leaq 0x130(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x31e0
movq %rax, 0x68(%rsp)
jmp 0x4b56
movq 0x68(%rsp), %rdi
leaq 0xec(%rsp), %rsi
callq 0x31e0
movq %rax, 0x60(%rsp)
jmp 0x4b6f
movq 0x60(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x31e0
movq %rax, 0x58(%rsp)
jmp 0x4b88
movq 0x58(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3310
movb %al, 0x57(%rsp)
jmp 0x4ba2
movb 0x57(%rsp), %al
testb $0x1, %al
jne 0x4baf
jmp 0x4d1b
leaq 0xdc(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
leaq 0xec(%rsp), %rdx
leaq 0xe8(%rsp), %rcx
callq 0x10b20
jmp 0x4bd6
leaq 0x368(%rsp), %rdi
leaq 0xdc(%rsp), %rsi
callq 0x10680
jmp 0x4bed
leaq 0x338(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x103a0
movq %rax, 0x48(%rsp)
jmp 0x4c09
leaq 0xd0(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
leaq 0xec(%rsp), %rdx
leaq 0xe8(%rsp), %rcx
callq 0x10b20
jmp 0x4c30
movq 0x48(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x10b60
jmp 0x4c44
leaq 0x338(%rsp), %rdi
leaq 0xec(%rsp), %rsi
callq 0x103a0
movq %rax, 0x40(%rsp)
jmp 0x4c60
leaq 0xc4(%rsp), %rdi
leaq 0xec(%rsp), %rsi
leaq 0xf0(%rsp), %rdx
leaq 0xe8(%rsp), %rcx
callq 0x10b20
jmp 0x4c87
movq 0x40(%rsp), %rdi
leaq 0xc4(%rsp), %rsi
callq 0x10b60
jmp 0x4c9b
jmp 0x4b3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
jmp 0x4edb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
jmp 0x4ece
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
jmp 0x4d09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
leaq 0x100(%rsp), %rdi
callq 0x31f0
leaq 0xff(%rsp), %rdi
callq 0x3300
jmp 0x4ece
leaq 0x130(%rsp), %rdi
callq 0x30a0
jmp 0x4d2a
callq 0x10a60
movq %rax, 0x38(%rsp)
jmp 0x4d36
movq 0x38(%rsp), %rdi
callq 0x10b90
jmp 0x4d42
callq 0x10a60
movq %rax, 0x30(%rsp)
jmp 0x4d4e
leaq 0x9f(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x3470
movq 0x28(%rsp), %rdx
leaq 0x2b47e(%rip), %rsi     # 0x301ea
leaq 0xa0(%rsp), %rdi
callq 0x3360
jmp 0x4d7b
movq 0x30(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x10ad0
jmp 0x4d8f
leaq 0xa0(%rsp), %rdi
callq 0x31f0
leaq 0x9f(%rsp), %rdi
callq 0x3300
leaq 0x338(%rsp), %rdi
callq 0x3f00
movq %rax, 0x20(%rsp)
jmp 0x4dbd
movq 0x20(%rsp), %rax
movq %rax, 0x90(%rsp)
callq 0x10a60
movq %rax, 0x18(%rsp)
jmp 0x4dd6
movq 0x18(%rsp), %rdi
callq 0x10b90
jmp 0x4de2
movq 0x3f1ef(%rip), %rdi     # 0x43fd8
leaq 0x2b40b(%rip), %rsi     # 0x301fb
callq 0x32c0
movq %rax, 0x10(%rsp)
jmp 0x4dfc
movq 0x10(%rsp), %rdi
movq 0x90(%rsp), %rsi
callq 0x3180
movq %rax, 0x8(%rsp)
jmp 0x4e15
movq 0x8(%rsp), %rdi
movq 0x3f1a7(%rip), %rsi     # 0x43fc8
callq 0x32f0
jmp 0x4e28
cmpq $-0x37209d, 0x90(%rsp) # imm = 0xFFC8DF63
jne 0x4e38
jmp 0x4e9d
leaq 0x2b3da(%rip), %rdi     # 0x30219
leaq 0x2b29b(%rip), %rsi     # 0x300e1
movl $0x126, %edx            # imm = 0x126
leaq 0x2b3de(%rip), %rcx     # 0x30230
callq 0x3200
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
jmp 0x4e8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x128(%rsp)
movl %eax, 0x124(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x31f0
leaq 0x9f(%rsp), %rdi
callq 0x3300
jmp 0x4ece
jmp 0x4e9f
leaq 0x130(%rsp), %rdi
callq 0x30f0
leaq 0x338(%rsp), %rdi
callq 0x10a50
leaq 0x368(%rsp), %rdi
callq 0x10760
addq $0x388, %rsp            # imm = 0x388
retq
leaq 0x130(%rsp), %rdi
callq 0x30f0
leaq 0x338(%rsp), %rdi
callq 0x10a50
leaq 0x368(%rsp), %rdi
callq 0x10760
movq 0x128(%rsp), %rdi
callq 0x3460
nopw %cs:(%rax,%rax)