// File: minimind[P]simple-graph/unittest/../graph/graph.hpp
// Function: void hidden_copy_topology<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, (anonymous namespace)::CopyFunctor>(Graph<(anonymous namespace)::CopyFunctor::node_type, (anonymous namespace)::CopyFunctor::edge_type>&, Graph<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>> const&, (anonymous namespace)::CopyFunctor&)
void hidden_copy_topology( Graph< typename F::node_type, typename F::edge_type >& toReturn,
                           const Graph<N,E>&                                      originalGraph,
                           F&                                                     creator )
{
  // We need to go through all the nodes and edges, using the function to copy them.
  for ( typename SimpleGraph::ConstNodeIterator<N,E> i = originalGraph.nodes.begin();
        i != originalGraph.nodes.end();
        ++i )
  {
    toReturn.nodes.m_nodes.insert( std::make_pair(
        i.key(),
        boost::shared_ptr< SimpleGraph::SimpleNode< typename F::node_type, typename F::edge_type > >
          ( new SimpleGraph::SimpleNode< typename F::node_type, typename F::edge_type >( creator( i ), i.key() ) )
      )
    );
  }

  for ( typename SimpleGraph::ConstEdgeIterator<N,E> j = originalGraph.edges.begin();
        j != originalGraph.edges.end();
        ++j )
  {
    typename SimpleGraph::NodeIterator< typename F::node_type, typename F::edge_type > left = toReturn.nodes.find( j.left().key() );
    if ( left == toReturn.nodes.end() )
    {
      throw std::runtime_error( "Cannot copy graph as cannot find left node" );
    }

    typename SimpleGraph::NodeIterator< typename F::node_type, typename F::edge_type > right = toReturn.nodes.find( j.right().key() );
    if ( right == toReturn.nodes.end() )
    {
      throw std::runtime_error( "Cannot copy graph as cannot find right node" );
    }

    toReturn.add_edge( creator( j, left, right ), left, right );
  }

  toReturn.m_counter = originalGraph.m_counter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x575a0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x57600
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x575d0
testb $0x1, %al
jne 0x65937
jmp 0x65abb
movq -0x8(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0x20(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x57690
movq %rax, -0x48(%rbp)
movl $0x40, %edi
callq 0xb530
movq -0x118(%rbp), %rdx
movq %rax, -0x110(%rbp)
movb $0x1, -0x85(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x65da0
jmp 0x65984
leaq -0x20(%rbp), %rdi
callq 0x57690
movq %rax, -0x128(%rbp)
jmp 0x65996
movq -0x128(%rbp), %rdx
movq -0x110(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x55a70
jmp 0x659af
movq -0x110(%rbp), %rsi
movb $0x0, -0x85(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x55ab0
jmp 0x659c8
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x576e0
jmp 0x659db
movq -0x120(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x559f0
movb %dl, -0x131(%rbp)
movq %rax, -0x130(%rbp)
jmp 0x659fa
movb -0x131(%rbp), %al
movq -0x130(%rbp), %rcx
movq %rcx, -0x98(%rbp)
movb %al, -0x90(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x55b20
leaq -0x58(%rbp), %rdi
callq 0x55b40
leaq -0x78(%rbp), %rdi
callq 0xb330
leaq -0x20(%rbp), %rdi
callq 0x57750
jmp 0x65914
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x65a9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x65a91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x65a88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x55b20
leaq -0x58(%rbp), %rdi
callq 0x55b40
leaq -0x78(%rbp), %rdi
callq 0xb330
testb $0x1, -0x85(%rbp)
jne 0x65aa5
jmp 0x65ab6
movq -0x110(%rbp), %rdi
movl $0x40, %esi
callq 0xb550
jmp 0x65d8c
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x57780
movq %rax, -0xa0(%rbp)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x577e0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x577b0
testb $0x1, %al
jne 0x65aff
jmp 0x65d73
movq -0x8(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x57850
movq %rax, -0xb8(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x57690
movq -0x140(%rbp), %rdi
movq %rax, %rsi
callq 0x57810
movq %rax, -0xb0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x578c0
movq %rax, -0xc0(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x57890
testb $0x1, %al
jne 0x65b68
jmp 0x65bc7
movl $0x10, %edi
callq 0xb290
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x148(%rbp)
leaq 0x14a33(%rip), %rsi     # 0x7a5b9
callq 0xb1c0
jmp 0x65b8d
movq -0x148(%rbp), %rdi
movq 0x47455(%rip), %rsi     # 0xacff0
movq 0x473fe(%rip), %rdx     # 0xacfa0
callq 0xb8d0
movq -0x148(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
callq 0xb400
jmp 0x65d8c
movq -0x8(%rbp), %rax
movq %rax, -0x150(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x578f0
movq %rax, -0xd0(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x57690
movq -0x150(%rbp), %rdi
movq %rax, %rsi
callq 0x57810
movq %rax, -0xc8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x578c0
movq %rax, -0xd8(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x57890
testb $0x1, %al
jne 0x65c30
jmp 0x65c8f
movl $0x10, %edi
callq 0xb290
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x158(%rbp)
leaq 0x14996(%rip), %rsi     # 0x7a5e4
callq 0xb1c0
jmp 0x65c55
movq -0x158(%rbp), %rdi
movq 0x4738d(%rip), %rsi     # 0xacff0
movq 0x47336(%rip), %rdx     # 0xacfa0
callq 0xb8d0
movq -0x158(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
callq 0xb400
jmp 0x65d8c
movq -0x8(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x190(%rbp)
leaq -0x100(%rbp), %rdi
movq %rdi, -0x188(%rbp)
leaq -0xb0(%rbp), %rsi
movq %rsi, -0x168(%rbp)
callq 0x57dc0
leaq -0x108(%rbp), %rdi
movq %rdi, -0x180(%rbp)
leaq -0xc8(%rbp), %rsi
movq %rsi, -0x160(%rbp)
callq 0x57dc0
movq -0x190(%rbp), %rsi
movq -0x188(%rbp), %rcx
movq -0x180(%rbp), %r8
leaq -0xf8(%rbp), %rdi
movq %rdi, -0x170(%rbp)
leaq -0xa0(%rbp), %rdx
callq 0x65df0
movq -0x178(%rbp), %rdi
movq -0x170(%rbp), %rsi
movq -0x168(%rbp), %rdx
movq -0x160(%rbp), %rcx
callq 0x54c90
jmp 0x65d39
leaq -0xf8(%rbp), %rdi
callq 0xb330
leaq -0xa0(%rbp), %rdi
callq 0x57960
jmp 0x65acf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0xb330
jmp 0x65d8c
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0xb920
nopw %cs:(%rax,%rax)