// File: GAStudyGroup[P]GPX2/src/cross/gpx/sources/GPX2.cpp
// Function: GPX2::choose()
void GPX2::choose()
{
    //Find all exits and entries
    for (auto p : feasiblePartitions) {
        double totalRed{ 0 }, totalBlue{ 0 };
        for (auto pair : p.second->getEntryAndExits()) {
            totalRed += GPX2Support::partialDistance(pair.first, pair.second, red, p.second);
            totalBlue += GPX2Support::partialDistance(pair.first, pair.second, blue, p.second);
        }
        if (totalRed < totalBlue) {
            partitionsChoosen.push_back(GPX2Structs::Parent::RED);
        } else {
            partitionsChoosen.push_back(GPX2Structs::Parent::BLUE);
        }
    }
}

// Assembly:
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdi, 0x1b0(%rsp)
movq 0x1b0(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x30, %rax
movq %rax, 0x1a8(%rsp)
movq 0x1a8(%rsp), %rdi
callq 0x54cc0
movq %rax, 0x1a0(%rsp)
movq 0x1a8(%rsp), %rdi
callq 0x54d10
movq %rax, 0x198(%rsp)
leaq 0x1a0(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0x54cf0
testb $0x1, %al
jne 0x5fd30
jmp 0x600f4
leaq 0x1a0(%rsp), %rdi
callq 0x54d40
movq (%rax), %rcx
movq %rcx, 0x188(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x190(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x180(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x178(%rsp)
movq 0x190(%rsp), %rsi
leaq 0x158(%rsp), %rdi
callq 0x67ea0
leaq 0x158(%rsp), %rax
movq %rax, 0x170(%rsp)
movq 0x170(%rsp), %rdi
callq 0x392b0
movq %rax, 0x150(%rsp)
movq 0x170(%rsp), %rdi
callq 0x390a0
movq %rax, 0x148(%rsp)
leaq 0x150(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x61460
testb $0x1, %al
jne 0x5fde6
leaq 0x158(%rsp), %rdi
callq 0x31b40
jmp 0x6008a
leaq 0x150(%rsp), %rdi
callq 0x395d0
movq %rax, %rsi
leaq 0x108(%rsp), %rdi
callq 0x33630
jmp 0x5fe05
leaq 0xd8(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x6200
jmp 0x5fe1c
leaq 0x128(%rsp), %rsi
leaq 0xb8(%rsp), %rdi
callq 0x6200
jmp 0x5fe33
movq 0x8(%rsp), %rsi
addq $0xd8, %rsi
leaq 0x88(%rsp), %rdi
callq 0x614a0
jmp 0x5fe4e
movq 0x190(%rsp), %rcx
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x6df40
movl %eax, 0x4(%rsp)
jmp 0x5fe79
movl 0x4(%rsp), %eax
cvtsi2sd %eax, %xmm1
movsd 0x180(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x180(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x60b90
leaq 0xb8(%rsp), %rdi
callq 0x6988
leaq 0xd8(%rsp), %rdi
callq 0x6988
leaq 0x68(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x6200
jmp 0x5fed2
leaq 0x128(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x6200
jmp 0x5fee6
movq 0x8(%rsp), %rsi
addq $0x108, %rsi            # imm = 0x108
leaq 0x18(%rsp), %rdi
callq 0x614a0
jmp 0x5fefe
movq 0x190(%rsp), %rcx
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x6df40
movl %eax, (%rsp)
jmp 0x5ff1f
movl (%rsp), %eax
cvtsi2sd %eax, %xmm0
addsd 0x178(%rsp), %xmm0
movsd %xmm0, 0x178(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x60b90
leaq 0x48(%rsp), %rdi
callq 0x6988
leaq 0x68(%rsp), %rdi
callq 0x6988
leaq 0x108(%rsp), %rdi
callq 0x31d30
leaq 0x150(%rsp), %rdi
callq 0x614d0
jmp 0x5fdbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
jmp 0x6007b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
jmp 0x6006e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
jmp 0x60001
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
jmp 0x5fff4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x60b90
leaq 0xb8(%rsp), %rdi
callq 0x6988
leaq 0xd8(%rsp), %rdi
callq 0x6988
jmp 0x6006e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
jmp 0x60064
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
jmp 0x6005a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x60b90
leaq 0x48(%rsp), %rdi
callq 0x6988
leaq 0x68(%rsp), %rdi
callq 0x6988
leaq 0x108(%rsp), %rdi
callq 0x31d30
leaq 0x158(%rsp), %rdi
callq 0x31b40
jmp 0x600fc
movsd 0x180(%rsp), %xmm1
movsd 0x178(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x600c2
movq 0x8(%rsp), %rdi
addq $0x138, %rdi            # imm = 0x138
movl $0x0, 0x14(%rsp)
leaq 0x14(%rsp), %rsi
callq 0x614f0
jmp 0x600e0
movq 0x8(%rsp), %rdi
addq $0x138, %rdi            # imm = 0x138
movl $0x1, 0x10(%rsp)
leaq 0x10(%rsp), %rsi
callq 0x614f0
jmp 0x600e2
leaq 0x1a0(%rsp), %rdi
callq 0x552a0
jmp 0x5fd12
addq $0x1b8, %rsp            # imm = 0x1B8
retq
movq 0x100(%rsp), %rdi
callq 0x6850
nopl (%rax)