// File: GAStudyGroup[P]GPX2/src/cross/gpx/sources/GPX2.cpp
// Function: GPX2::findAllPartitions()
void GPX2::findAllPartitions()
{    //goes through the graph finding all partition that there are in it
    int id{ 1 };
    vector<vector<string>> partitions;
    vector<string> cities;

    //gets the list of all cities
    for (auto node : unitedGraph) {cities.push_back(node.first);}

    while (!cities.empty()) { //while there still are cities in the list
        partitions.push_back(GPX2Support::findPartition(cities.front(),unitedGraph));// inserts the partition in the partition list

        for (string i : partitions.back()) {
            cities.erase(remove(cities.begin(), cities.end(), i), cities.end());
        }
    }

    for (vector<string> vi : partitions) { // removes partition with just one element
        if (vi.size() != 1) {
            vector<string> accessNodes;
            for (string idN : vi) {
                if (unitedGraph[idN]->getAccess()) {
                    accessNodes.push_back(idN);
                }
            }
            candidatePartitions.insert(make_pair(id, new Partition(id, vi, accessNodes)));
            id++;
        }
    }

    GPX2Support::cleanInsideAccess(candidatePartitions,unitedGraph);
}

// Assembly:
subq $0x288, %rsp            # imm = 0x288
movq %rdi, 0x280(%rsp)
movq 0x280(%rsp), %rax
movq %rax, 0x68(%rsp)
movl $0x1, 0x27c(%rsp)
leaq 0x260(%rsp), %rdi
callq 0x61100
leaq 0x248(%rsp), %rdi
callq 0x1e3e0
movq 0x68(%rsp), %rax
addq $0x90, %rax
movq %rax, 0x240(%rsp)
movq 0x240(%rsp), %rdi
callq 0x60ba0
movq %rax, 0x238(%rsp)
movq 0x240(%rsp), %rdi
callq 0x60bd0
movq %rax, 0x230(%rsp)
leaq 0x238(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x60c00
testb $0x1, %al
jne 0x5f2cc
jmp 0x5f35d
leaq 0x238(%rsp), %rdi
callq 0x60c20
movq %rax, %rsi
leaq 0x208(%rsp), %rdi
callq 0x60da0
jmp 0x5f2eb
leaq 0x248(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x37210
jmp 0x5f302
leaq 0x208(%rsp), %rdi
callq 0x60de0
leaq 0x238(%rsp), %rdi
callq 0x60d70
jmp 0x5f2ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x5f9ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0x208(%rsp), %rdi
callq 0x60de0
jmp 0x5f9ad
jmp 0x5f35f
leaq 0x248(%rsp), %rdi
callq 0x49f70
xorb $-0x1, %al
testb $0x1, %al
jne 0x5f377
jmp 0x5f5c8
leaq 0x248(%rsp), %rdi
callq 0x61140
movq %rax, %rsi
leaq 0x1c0(%rsp), %rdi
callq 0x6200
jmp 0x5f396
movq 0x68(%rsp), %rdx
addq $0x90, %rdx
leaq 0x1e0(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x6c900
jmp 0x5f3b9
leaq 0x260(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x61110
jmp 0x5f3d0
leaq 0x1e0(%rsp), %rdi
callq 0xa2c0
leaq 0x1c0(%rsp), %rdi
callq 0x6988
leaq 0x260(%rsp), %rdi
callq 0x61170
movq %rax, 0x1b8(%rsp)
movq 0x1b8(%rsp), %rdi
callq 0x1e310
movq %rax, 0x1b0(%rsp)
movq 0x1b8(%rsp), %rdi
callq 0x1e340
movq %rax, 0x1a8(%rsp)
leaq 0x1b0(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x1e370
testb $0x1, %al
jne 0x5f447
jmp 0x5f5c3
leaq 0x1b0(%rsp), %rdi
callq 0x1e3b0
movq %rax, %rsi
leaq 0x188(%rsp), %rdi
callq 0x6200
jmp 0x5f466
leaq 0x248(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x1e310
movq 0x58(%rsp), %rdi
movq %rax, 0x170(%rsp)
callq 0x1e340
movq %rax, 0x168(%rsp)
movq 0x170(%rsp), %rdi
movq 0x168(%rsp), %rsi
leaq 0x188(%rsp), %rdx
callq 0x61250
movq %rax, 0x60(%rsp)
jmp 0x5f4b6
movq 0x60(%rsp), %rax
movq %rax, 0x178(%rsp)
leaq 0x180(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x555d0
leaq 0x248(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x1e340
movq %rax, 0x158(%rsp)
leaq 0x160(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x555d0
movq 0x48(%rsp), %rdi
movq 0x180(%rsp), %rsi
movq 0x160(%rsp), %rdx
callq 0x611b0
movq %rax, 0x50(%rsp)
jmp 0x5f528
movq 0x50(%rsp), %rax
movq %rax, 0x150(%rsp)
leaq 0x188(%rsp), %rdi
callq 0x6988
leaq 0x1b0(%rsp), %rdi
callq 0x1e3c0
jmp 0x5f429
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x5f58b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0xa2c0
leaq 0x1c0(%rsp), %rdi
callq 0x6988
jmp 0x5f9ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0x188(%rsp), %rdi
callq 0x6988
jmp 0x5f9ad
jmp 0x5f35f
leaq 0x260(%rsp), %rax
movq %rax, 0x148(%rsp)
movq 0x148(%rsp), %rdi
callq 0x612b0
movq %rax, 0x140(%rsp)
movq 0x148(%rsp), %rdi
callq 0x612e0
movq %rax, 0x138(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x61310
testb $0x1, %al
jne 0x5f620
jmp 0x5f975
leaq 0x140(%rsp), %rdi
callq 0x61350
movq %rax, %rsi
leaq 0x120(%rsp), %rdi
callq 0x305f0
jmp 0x5f63f
leaq 0x120(%rsp), %rdi
callq 0x30bb0
cmpq $0x1, %rax
je 0x5f956
leaq 0x108(%rsp), %rdi
callq 0x1e3e0
leaq 0x120(%rsp), %rax
movq %rax, 0x100(%rsp)
movq 0x100(%rsp), %rdi
callq 0x1e310
movq %rax, 0xf8(%rsp)
movq 0x100(%rsp), %rdi
callq 0x1e340
movq %rax, 0xf0(%rsp)
leaq 0xf8(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x1e370
testb $0x1, %al
jne 0x5f6bb
jmp 0x5f78e
leaq 0xf8(%rsp), %rdi
callq 0x1e3b0
movq %rax, %rsi
leaq 0xd0(%rsp), %rdi
callq 0x6200
jmp 0x5f6da
movq 0x68(%rsp), %rdi
addq $0x90, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x60c60
movq %rax, 0x40(%rsp)
jmp 0x5f6fa
movq 0x40(%rsp), %rax
movq (%rax), %rdi
callq 0x661d0
movb %al, 0x3f(%rsp)
jmp 0x5f70d
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x5f717
jmp 0x5f76f
leaq 0x108(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x37210
jmp 0x5f72e
jmp 0x5f76f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x5f93a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x6988
jmp 0x5f93a
leaq 0xd0(%rsp), %rdi
callq 0x6988
leaq 0xf8(%rsp), %rdi
callq 0x1e3c0
jmp 0x5f69d
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
movl $0x80, %edi
callq 0x64b0
movq %rax, 0x30(%rsp)
jmp 0x5f7a9
movb $0x1, 0x87(%rsp)
movl 0x27c(%rsp), %eax
movl %eax, 0x24(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x305f0
jmp 0x5f7d3
leaq 0x88(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x305f0
jmp 0x5f7ea
movl 0x24(%rsp), %esi
movq 0x30(%rsp), %rdi
leaq 0xa0(%rsp), %rdx
leaq 0x88(%rsp), %rcx
callq 0x67dc0
jmp 0x5f80a
movq 0x30(%rsp), %rax
movb $0x0, 0x87(%rsp)
movq %rax, 0xb8(%rsp)
leaq 0x27c(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x61360
movq %rdx, 0x18(%rsp)
movl %eax, 0x20(%rsp)
jmp 0x5f83f
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rax
movl 0x20(%rsp), %ecx
movl %ecx, 0xc0(%rsp)
movq %rax, 0xc8(%rsp)
leaq 0xc0(%rsp), %rsi
callq 0x54d60
movb %dl, 0xf(%rsp)
movq %rax, 0x10(%rsp)
jmp 0x5f874
movb 0xf(%rsp), %al
movq 0x10(%rsp), %rcx
movq %rcx, 0x70(%rsp)
movb %al, 0x78(%rsp)
leaq 0x88(%rsp), %rdi
callq 0xa2c0
leaq 0xa0(%rsp), %rdi
callq 0xa2c0
movl 0x27c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x27c(%rsp)
leaq 0x108(%rsp), %rdi
callq 0xa2c0
jmp 0x5f956
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x5f91d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x5f910
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0x88(%rsp), %rdi
callq 0xa2c0
leaq 0xa0(%rsp), %rdi
callq 0xa2c0
testb $0x1, 0x87(%rsp)
jne 0x5f929
jmp 0x5f938
movq 0x30(%rsp), %rdi
movl $0x80, %esi
callq 0x64c0
jmp 0x5f93a
leaq 0x108(%rsp), %rdi
callq 0xa2c0
leaq 0x120(%rsp), %rdi
callq 0xa2c0
jmp 0x5f9ad
leaq 0x120(%rsp), %rdi
callq 0xa2c0
leaq 0x140(%rsp), %rdi
callq 0x61390
jmp 0x5f602
movq 0x68(%rsp), %rdi
movq %rdi, %rsi
addq $0x90, %rsi
callq 0x6b6d0
jmp 0x5f98b
leaq 0x248(%rsp), %rdi
callq 0xa2c0
leaq 0x260(%rsp), %rdi
callq 0x613b0
addq $0x288, %rsp            # imm = 0x288
retq
leaq 0x248(%rsp), %rdi
callq 0xa2c0
leaq 0x260(%rsp), %rdi
callq 0x613b0
movq 0x200(%rsp), %rdi
callq 0x6850
nopw %cs:(%rax,%rax)