// File: minimind[P]simple-graph/unittest/../graph/graph.hpp
// Function: 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>>>::remove_edge(SimpleGraph::EdgeIterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>&)
typename Graph<N,E>::edge_iterator Graph<N,E>::remove_edge( typename Graph<N,E>::edge_iterator& e )
{
  typename boost::shared_ptr< SimpleGraph::SimpleEdge<N,E> >& simpleEdge( *( e.m_iterator ) );
  typename std::list< boost::shared_ptr< SimpleGraph::SimpleEdge<N,E> > >::iterator mainIterator  = simpleEdge->m_mainIterator;
  typename std::list< boost::shared_ptr< SimpleGraph::SimpleEdge<N,E> > >::iterator leftIterator  = simpleEdge->m_leftIterator;
  typename std::list< boost::shared_ptr< SimpleGraph::SimpleEdge<N,E> > >::iterator rightIterator = simpleEdge->m_rightIterator;

  bool leftAndRightTheSame = &( *leftIterator ) == &( *rightIterator );
  bool leftAndMainTheSame  = &( *mainIterator ) == &( *leftIterator  );
  bool rightAndMainTheSame = &( *mainIterator ) == &( *rightIterator );

  typename Graph<N,E>::edge_iterator toReturn( mainIterator );
  ++toReturn;

  std::list< boost::shared_ptr< SimpleGraph::SimpleEdge<N,E> > >& eLeftIteratorEdges  = e.left().m_iterator->second->m_edges;
  std::list< boost::shared_ptr< SimpleGraph::SimpleEdge<N,E> > >& eRightIteratorEdges = e.right().m_iterator->second->m_edges;

  eLeftIteratorEdges.erase( leftIterator );

  if ( !leftAndRightTheSame )
  {
    eRightIteratorEdges.erase( rightIterator );
  }

  if ( !leftAndMainTheSame && !( rightAndMainTheSame && !leftAndRightTheSame ) )
  {
    edges.m_edges.erase( mainIterator );
  }

  return toReturn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x584f0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x56e90
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x56e90
movq 0x38(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x56e90
movq 0x40(%rax), %rax
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x584f0
movq %rax, -0xb0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x584f0
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movb %al, -0x39(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x584f0
movq %rax, -0xa8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x584f0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movb %al, -0x3a(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x584f0
movq %rax, -0xa0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x584f0
movq %rax, %rcx
movq -0xa0(%rbp), %rax
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movb %al, -0x3b(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x584d0
leaq -0x8(%rbp), %rdi
callq 0x55680
movq -0x18(%rbp), %rdi
callq 0x55620
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x56f00
movq %rax, %rdi
addq $0x8, %rdi
callq 0x56f20
addq $0x28, %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x55650
movq %rax, -0x60(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x56f00
movq %rax, %rdi
addq $0x8, %rdi
callq 0x56f20
addq $0x28, %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x5fc60
movq -0x98(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x5fc10
movq %rax, -0x70(%rbp)
testb $0x1, -0x39(%rbp)
jne 0x5f1b0
movq -0x58(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5fc60
movq -0xc0(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x5fc10
movq %rax, -0x80(%rbp)
testb $0x1, -0x3a(%rbp)
jne 0x5f1fe
testb $0x1, -0x3b(%rbp)
je 0x5f1c2
testb $0x1, -0x39(%rbp)
je 0x5f1fe
movq -0xb8(%rbp), %rax
addq $0x30, %rax
movq %rax, -0xc8(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x5fc60
movq -0xc8(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x5fc10
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax,%rax)