// File: /workspace/github_cpp_makefile_star2_O1/GAStudyGroup[P]GPX2/src/cross/gpx/sources/GPX2Support.cpp
// Function: GPX2Support::insertGhost(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, Node*, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, Node*>>>&, Node*)
void GPX2Support::insertGhost(string& id, GPX2Structs::NodeMap& tour, Node* ghost)
{
    Node::node edgeFirst = tour[id]->getEdges()[0]; // edge to be added to the ghostNode
    tour[id]->deleteEdge(0); // delete edge
    tour[id]->addEdge(Node::node(ghost->getId(), 0)); // Adds to the original node the linking edge with the ghost

    for (unsigned i = 0; i < 2; i++) {
        // goes by the linking edges with the node connected with the ghost
        Node::node edge = tour[edgeFirst.first]->getEdges()[i];

        if (edge.first.compare(id) == 0) { // checks if it is the connection

            //adds the connection to the ghost and removes it from the original node
            tour[edgeFirst.first]->deleteEdge(i);
            tour[edgeFirst.first]->addEdge(Node::node(ghost->getId(), edgeFirst.second));
        }
    }

    ghost->addEdge(edgeFirst); // connects the ghost to the edge
    ghost->setAccess(true);
    ghost->addEdge(Node::node(tour[id]->getId(), 0)); // adds the original node as and edge of the ghost

    tour.insert(make_pair(ghost->getId(), ghost)); // inserts the ghost in the parent map
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdx, 0x28(%rsp)
movq %rsi, %rbx
movq %rdi, %r12
movq %rsi, %rdi
movq %r12, %rsi
callq 0x28bca
movq (%rax), %rdi
callq 0x29d64
movq (%rax), %r15
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x82cc
movsd 0x20(%r15), %xmm0
movsd %xmm0, 0x20(%r14)
movq %rbx, 0x30(%rsp)
movq %rbx, %rdi
movq %r12, 0x80(%rsp)
movq %r12, %rsi
callq 0x28bca
movq (%rax), %rdi
xorl %esi, %esi
callq 0x29d8e
movq 0x30(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x28bca
movq (%rax), %r12
movq %rsp, %rdi
movq 0x28(%rsp), %rsi
callq 0x29d42
leaq 0xe8(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x10(%rsp), %r15
movq -0x10(%r15), %rax
cmpq %r15, %rax
je 0x2d07c
movq %rax, 0xd8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0xe8(%rsp)
jmp 0x2d084
movups (%r15), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rsp), %rax
leaq 0xd8(%rsp), %rsi
movq %rax, 0x8(%rsi)
movq %r15, (%rsp)
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %rax, 0x20(%rsi)
movq %r12, %rdi
callq 0x29d84
movq 0xd8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2d0ce
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x53c0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2d0e4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0x98(%rsp), %rbx
movq $-0x28, %r15
xorl %ebp, %ebp
leaq 0x58(%rsp), %r12
movq %rsp, %r13
movq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x28bca
movq (%rax), %rdi
callq 0x29d64
movq (%rax), %r14
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x28(%r14,%r15), %rsi
movq 0x30(%r14,%r15), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x82cc
movsd 0x48(%r14,%r15), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r13, %rdi
movq 0x80(%rsp), %rsi
callq 0x5050
testl %eax, %eax
jne 0x2d23a
movq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x28bca
movq (%rax), %rdi
movl %ebp, %esi
callq 0x29d8e
movq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x28bca
movq (%rax), %r14
leaq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x29d42
movq %rbx, 0x88(%rsp)
movq 0x38(%rsp), %rax
leaq 0x48(%rsp), %rcx
cmpq %rcx, %rax
je 0x2d1bc
movq %rax, 0x88(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x98(%rsp)
jmp 0x2d1c2
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x40(%rsp), %rax
movq %rax, 0x90(%rsp)
movq %rcx, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movb $0x0, 0x48(%rsp)
movsd 0x78(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
movq %r14, %rdi
leaq 0x88(%rsp), %rsi
callq 0x29d84
movq 0x88(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2d21e
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2d23a
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x53c0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2d255
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x53c0
incl %ebp
addq $0x28, %r15
je 0x2d0fd
leaq 0x110(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
addq %rsi, %rdx
leaq 0x100(%rsp), %rdi
callq 0x82cc
leaq 0x10(%rsp), %r15
leaq 0x48(%rsp), %r12
movsd 0x78(%rsp), %xmm0
leaq 0x100(%rsp), %rsi
movsd %xmm0, 0x20(%rsi)
movq 0x28(%rsp), %rdi
callq 0x29d84
movq 0x100(%rsp), %rdi
cmpq %r14, %rdi
je 0x2d2cb
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0x29d7e
movq 0x30(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x28bca
movq (%rax), %rsi
movq %rsp, %rdi
callq 0x29d42
leaq 0xc0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rax
cmpq %r15, %rax
je 0x2d323
movq %rax, 0xb0(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0xc0(%rsp)
jmp 0x2d32b
movups (%r15), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rsp), %rax
leaq 0xb0(%rsp), %rsi
movq %rax, 0x8(%rsi)
movq %r15, (%rsp)
xorl %eax, %eax
movq %rax, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %rax, 0x20(%rsi)
movq 0x28(%rsp), %rdi
callq 0x29d84
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0x2d377
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x53c0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2d38d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x29d42
movq %r15, (%rsp)
movq 0x38(%rsp), %rax
cmpq %r12, %rax
je 0x2d3ba
movq %rax, (%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x2d3c3
movups (%r12), %xmm0
movups %xmm0, (%r15)
movq 0x40(%rsp), %rax
movq %rsp, %rsi
movq %rax, 0x8(%rsi)
movq %r12, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movb $0x0, 0x48(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x20(%rsi)
movq 0x30(%rsp), %rdi
callq 0x2944c
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2d40b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x2d422
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2d43e
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x53c0
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2d469
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2d561
movq 0x48(%rsp), %rsi
jmp 0x2d554
jmp 0x2d55e
movq %rax, %r12
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0x2d541
movq 0xc0(%rsp), %rsi
jmp 0x2d532
movq %rax, %r12
movq 0x100(%rsp), %rdi
cmpq %r14, %rdi
je 0x2d561
movq 0x110(%rsp), %rsi
jmp 0x2d554
movq %rax, %r12
movq 0xd8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2d4ed
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x53c0
movq (%rsp), %rdi
cmpq %r15, %rdi
jne 0x2d54f
jmp 0x2d561
jmp 0x2d55e
jmp 0x2d55e
jmp 0x2d55e
movq %rax, %r12
movq 0x88(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2d51e
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2d541
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2d541
jmp 0x2d53e
movq %rax, %r12
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2d561
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2d561
movq %rax, %r12
leaq 0x68(%rsp), %rax
movq 0x58(%rsp), %rdi
cmpq %rax, %rdi
je 0x2d57d
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %r12, %rdi
callq 0x5670