// File: /workspace/github_cpp_makefile_star2_O3/Manca[P]algorithms1/./assignment4.hpp
// Function: assignment4::computeSCC(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void computeSCC(const string& fileName)
    {
        cout << "***** ASSIGNMENT4 MAIN TEST CASE *****" << endl;
        // load from file
        Graph G, Grev;
        ifstream file(fileName, ios::in);
        for (int i = 1; i < NUM_NODES; i++)
        {
            G[i] = std::vector<int>();
            Grev[i] = std::vector<int>();
        }
        
        cout << "Reading file..." << endl;
        std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now();
        if (file.is_open())
        {
            std::string rawInput;
            int tail, head;
            while (getline(file, rawInput))
            {
                std::istringstream is(rawInput);

                is >> tail;
                is >> head;
                
                G[tail].push_back(head);
                Grev[head].push_back(tail);
            }
            file.close();
        }
        std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now();
        std::cout << "Done. Time took to read the whole file and construct two graphs: "
        << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count()
        << "ms.\n";
        
        // initialize global vars
        _seen       = seenList(G.size() + 1, 0);
        _times      = timesList(G.size() + 1, 0);
        _leaders    = leadersList(G.size() + 1, 0);
 
        DFSLoop(Grev);
        
        Graph newGraph = constructNewGraph(G, _times);
        DFSLoop(newGraph);
        
        sort(_leaders.begin(), _leaders.end());
        std::vector<SCC> SCCs;
        int el = _leaders[1];
        int elCnt = 1;
        for (size_t i = 2; i < _leaders.size(); i++)
        {
            if (_leaders[i] == el)
                elCnt++;
            else
            {
                SCC scc;
                scc.leader = el;
                scc.numNodes = elCnt;
                SCCs.push_back(scc);
                
                el = _leaders[i];
                elCnt = 1;
            }
        }
        // last SCC
        SCC scc;
        scc.leader = el;
        scc.numNodes = elCnt;
        SCCs.push_back(scc);
        
        cout << " Total number of SCCs is: " << SCCs.size() << endl << "Top 5 are: " << endl;
        
        // Let's just sort them in descending order by number of components
        sort(SCCs.begin(), SCCs.end(), compareByNumSCCs);
        
        for (int i = 0; i < 5; i++)
        {
            cout << "SCC with leader " << SCCs[i].leader << " has " << SCCs[i].numNodes << " nodes." << endl;
        }
        
        // Correct result is: 434821,968,459,313,211
        assert(SCCs[0].numNodes == 434821);
        assert(SCCs[1].numNodes == 968);
        assert(SCCs[2].numNodes == 459);
        assert(SCCs[3].numNodes == 313);
        assert(SCCs[4].numNodes == 211);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq %rdi, %r14
movq 0xa230(%rip), %rbx      # 0xdfd8
leaq 0x6401(%rip), %rsi      # 0xa1b0
movl $0x26, %edx
movq %rbx, %rdi
callq 0x2200
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
leaq 0x48(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x78(%rsp), %rax
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x220(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x22b0
leaq 0xa0(%rsp), %r14
movl $0x1, (%r14)
leaq 0x40(%rsp), %r15
leaq 0x70(%rsp), %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x61cc
movq (%rax), %rdi
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
testq %rdi, %rdi
je 0x3e6a
callq 0x21b0
movq %r12, %rdi
movq %r14, %rsi
callq 0x61cc
movq (%rax), %rdi
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
testq %rdi, %rdi
je 0x3e90
callq 0x21b0
movl 0xa0(%rsp), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xa0(%rsp)
cmpl $0xd5cc2, %eax          # imm = 0xD5CC2
jl 0x3e44
movq 0xa129(%rip), %r14      # 0xdfd8
leaq 0x6321(%rip), %rsi      # 0xa1d7
movl $0xf, %edx
movq %r14, %rdi
callq 0x2200
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq 0xa0f7(%rip), %rdi      # 0xdfd8
callq 0x2030
movq %rax, %rdi
callq 0x2140
callq 0x2240
movq %rax, 0x38(%rsp)
leaq 0x298(%rsp), %rdi
callq 0x2070
testb %al, %al
je 0x4040
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x10(%rsp), %r12
leaq 0xa0(%rsp), %r13
leaq 0x8(%rsp), %rbp
leaq 0x34(%rsp), %r14
movq 0xa091(%rip), %r15      # 0xdfd0
movq 0x220(%rsp), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2340
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x401f
movq %r13, %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x22e0
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2110
movq %r13, %rdi
movq %r14, %rsi
callq 0x2110
leaq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x61cc
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x3fc5
movl 0x34(%rsp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rax)
jmp 0x3fd0
movq %rax, %rdi
movq %r14, %rdx
callq 0x733a
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
callq 0x61cc
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x3ff7
movl 0x8(%rsp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rax)
jmp 0x4002
movq %rax, %rdi
movq %rbp, %rdx
callq 0x733a
movq %r13, %rdi
movq %r15, %rsi
callq 0x2270
leaq 0x118(%rsp), %rdi
callq 0x20a0
jmp 0x3f3f
leaq 0x220(%rsp), %rdi
callq 0x2060
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x4040
callq 0x21b0
callq 0x2240
movq %rax, %rbx
movq 0x9f89(%rip), %rdi      # 0xdfd8
leaq 0x6191(%rip), %rsi      # 0xa1e7
movl $0x41, %edx
callq 0x2200
subq 0x38(%rsp), %rbx
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
movq %rbx, %rax
imulq %rcx
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x12, %rdx
addq %rdx, %rsi
movq 0x9f4e(%rip), %rdi      # 0xdfd8
callq 0x21c0
leaq 0x6193(%rip), %rsi      # 0xa229
movl $0x4, %edx
movq %rax, %rdi
callq 0x2200
movq 0x68(%rsp), %rsi
incq %rsi
leaq 0x10(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0xa0(%rsp), %rdi
leaq 0x8(%rsp), %rcx
callq 0x6232
movq 0xa141(%rip), %rdi      # 0xe210
movaps 0xa0(%rsp), %xmm0
movaps %xmm0, 0xa132(%rip)     # 0xe210
movq 0xb0(%rsp), %rax
movq %rax, 0xa133(%rip)      # 0xe220
xorps %xmm0, %xmm0
movaps %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
testq %rdi, %rdi
je 0x4120
callq 0x21b0
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x4120
callq 0x21b0
movq 0x68(%rsp), %rsi
incq %rsi
leaq 0x10(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0xa0(%rsp), %rdi
leaq 0x8(%rsp), %rcx
callq 0x6232
movq 0xa0a4(%rip), %rdi      # 0xe1f0
movaps 0xa0(%rsp), %xmm0
movaps %xmm0, 0xa095(%rip)     # 0xe1f0
movq 0xb0(%rsp), %rax
movq %rax, 0xa096(%rip)      # 0xe200
xorps %xmm0, %xmm0
movaps %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
testq %rdi, %rdi
je 0x419d
callq 0x21b0
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x419d
callq 0x21b0
movq 0x68(%rsp), %rsi
incq %rsi
leaq 0x10(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0xa0(%rsp), %rdi
leaq 0x8(%rsp), %rcx
callq 0x6232
movq 0xa067(%rip), %rdi      # 0xe230
movaps 0xa0(%rsp), %xmm0
movaps %xmm0, 0xa058(%rip)     # 0xe230
movq 0xb0(%rsp), %rax
movq %rax, 0xa059(%rip)      # 0xe240
xorps %xmm0, %xmm0
movaps %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
testq %rdi, %rdi
je 0x421a
callq 0x21b0
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x421a
callq 0x21b0
leaq 0x70(%rsp), %rdi
callq 0x2b35
leaq 0x9fc5(%rip), %rdx      # 0xe1f0
leaq 0xa0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x2c02
leaq 0xa0(%rsp), %rdi
callq 0x2b35
movq 0x9fdf(%rip), %rbx      # 0xe230
movq 0x9fe0(%rip), %r14      # 0xe238
cmpq %r14, %rbx
je 0x429a
movq %r14, %rax
subq %rbx, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7ec1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7fa4
movq 0x9f9f(%rip), %rax      # 0xe230
movq 0x9fa0(%rip), %rbx      # 0xe238
jmp 0x429d
movq %rbx, %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl 0x4(%rax), %ecx
movq %rbx, %rdx
subq %rax, %rdx
cmpq $0x8, %rdx
jbe 0x435c
movl $0x1, %edx
movl $0x2, %r12d
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
cmpl %ecx, (%rax,%r12,4)
jne 0x42e0
incl %edx
jmp 0x4326
movl %ecx, 0x8(%rsp)
movl %edx, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x4304
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x18(%rsp)
jmp 0x430f
movq %r14, %rdi
movq %r15, %rdx
callq 0x81f0
movq 0x9f1a(%rip), %rax      # 0xe230
movl (%rax,%r12,4), %ecx
movl $0x1, %edx
movq 0x9f12(%rip), %rbx      # 0xe238
incq %r12
movq %rbx, %rsi
subq %rax, %rsi
sarq $0x2, %rsi
cmpq %rsi, %r12
jb 0x42d6
movq 0x18(%rsp), %rsi
movl %ecx, 0x8(%rsp)
movl %edx, 0xc(%rsp)
cmpq 0x20(%rsp), %rsi
je 0x436a
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x18(%rsp)
jmp 0x4379
movl %ecx, 0x8(%rsp)
movl $0x1, 0xc(%rsp)
xorl %esi, %esi
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x81f0
movq 0x9c58(%rip), %rdi      # 0xdfd8
leaq 0x5ea7(%rip), %rsi      # 0xa22e
movl $0x1a, %edx
callq 0x2200
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
sarq $0x3, %rsi
movq 0x9c32(%rip), %rdi      # 0xdfd8
callq 0x2130
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
movq %rax, %rbx
leaq 0x5e6a(%rip), %rsi      # 0xa249
movl $0xb, %edx
movq %rax, %rdi
callq 0x2200
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
cmpq %r14, %rbx
je 0x445d
movq %r14, %rax
subq %rbx, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq -0x16c6(%rip), %rcx     # 0x2d7a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8325
leaq -0x16d8(%rip), %rdx     # 0x2d7a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8450
xorl %ebp, %ebp
movq 0x9b72(%rip), %rbx      # 0xdfd8
leaq 0x5cf5(%rip), %r14      # 0xa162
leaq 0x5cff(%rip), %r15      # 0xa173
leaq 0x5cfe(%rip), %r12      # 0xa179
movl $0x10, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2200
movq 0x10(%rsp), %rax
movl (%rax,%rbp,8), %esi
movq %rbx, %rdi
callq 0x2300
movq %rax, %r13
movl $0x5, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2200
movq 0x10(%rsp), %rax
movl 0x4(%rax,%rbp,8), %esi
movq %r13, %rdi
callq 0x2300
movq %rax, %r13
movl $0x7, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2200
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
incq %rbp
cmpq $0x5, %rbp
jne 0x447b
movq 0x10(%rsp), %rdi
cmpl $0x6a285, 0x4(%rdi)     # imm = 0x6A285
jne 0x458e
cmpl $0x3c8, 0xc(%rdi)       # imm = 0x3C8
jne 0x45ad
cmpl $0x1cb, 0x14(%rdi)      # imm = 0x1CB
jne 0x45cc
cmpl $0x139, 0x1c(%rdi)      # imm = 0x139
jne 0x45eb
cmpl $0xd3, 0x24(%rdi)
jne 0x460a
callq 0x21b0
leaq 0xa0(%rsp), %rdi
callq 0x6c3a
leaq 0x220(%rsp), %rdi
callq 0x2080
leaq 0x70(%rsp), %rdi
callq 0x6c3a
leaq 0x40(%rsp), %rdi
callq 0x6c3a
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5cc0(%rip), %rdi      # 0xa255
leaq 0x5af3(%rip), %rsi      # 0xa08f
leaq 0x5ccd(%rip), %rcx      # 0xa270
movl $0x16c, %edx            # imm = 0x16C
callq 0x2120
leaq 0x5ce9(%rip), %rdi      # 0xa29d
leaq 0x5ad4(%rip), %rsi      # 0xa08f
leaq 0x5cae(%rip), %rcx      # 0xa270
movl $0x16d, %edx            # imm = 0x16D
callq 0x2120
leaq 0x5ce2(%rip), %rdi      # 0xa2b5
leaq 0x5ab5(%rip), %rsi      # 0xa08f
leaq 0x5c8f(%rip), %rcx      # 0xa270
movl $0x16e, %edx            # imm = 0x16E
callq 0x2120
leaq 0x5cdb(%rip), %rdi      # 0xa2cd
leaq 0x5a96(%rip), %rsi      # 0xa08f
leaq 0x5c70(%rip), %rcx      # 0xa270
movl $0x16f, %edx            # imm = 0x16F
callq 0x2120
leaq 0x5cd4(%rip), %rdi      # 0xa2e5
leaq 0x5a77(%rip), %rsi      # 0xa08f
leaq 0x5c51(%rip), %rcx      # 0xa270
movl $0x170, %edx            # imm = 0x170
callq 0x2120
jmp 0x464c
jmp 0x4653
jmp 0x4653
jmp 0x4653
jmp 0x4653
movq %rax, %rbx
jmp 0x46be
jmp 0x4653
jmp 0x4653
movq %rax, %rbx
jmp 0x46a4
jmp 0x4692
jmp 0x4653
jmp 0x4692
jmp 0x464c
movq %rax, %rbx
jmp 0x467c
jmp 0x4653
movq %rax, %rbx
jmp 0x46b1
movq %rax, %rbx
movq 0x996e(%rip), %rsi      # 0xdfd0
leaq 0xa0(%rsp), %rdi
callq 0x2270
leaq 0x118(%rsp), %rdi
callq 0x20a0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x46b1
callq 0x21b0
jmp 0x46b1
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x46a4
callq 0x21b0
leaq 0xa0(%rsp), %rdi
callq 0x6c3a
leaq 0x220(%rsp), %rdi
callq 0x2080
leaq 0x70(%rsp), %rdi
callq 0x6c3a
leaq 0x40(%rsp), %rdi
callq 0x6c3a
movq %rbx, %rdi
callq 0x2310