// File: /workspace/github_cpp_makefile_star2_O2/grogers0[P]dots_and_boxes/./boost/algorithm/combination.hpp
// Function: bool boost::detail::next_combination<__gnu_cxx::__normal_iterator<Edge*, std::vector<Edge, std::allocator<Edge>>>>(__gnu_cxx::__normal_iterator<Edge*, std::vector<Edge, std::allocator<Edge>>>, __gnu_cxx::__normal_iterator<Edge*, std::vector<Edge, std::allocator<Edge>>>, __gnu_cxx::__normal_iterator<Edge*, std::vector<Edge, std::allocator<Edge>>>, __gnu_cxx::__normal_iterator<Edge*, std::vector<Edge, std::allocator<Edge>>>)
bool next_combination(BidirectionalIterator first1,
                        BidirectionalIterator last1,
                        BidirectionalIterator first2,
                        BidirectionalIterator last2)
  {
      if ((first1 == last1) || (first2 == last2)) {
          return false;
      }
      
      BidirectionalIterator m1 = last1;
      BidirectionalIterator m2 = last2; --m2;
      
      // Find first m1 not less than *m2 (i.e., lower_bound(first1, last1, *m2)).
      // Actually, this loop stops at one position before that, except perhaps
      // if m1 == first1 (in which case one must compare *first1 with *m2).
      while (--m1 != first1 && !(*m1 < *m2)) {
      }
      
      // Test if all elements in [first1, last1) not less than *m2.
      bool result = (m1 == first1) && !(*first1 < *m2);
      
      if (!result) {

          // Find first first2 greater than *m1 (since *m1 < *m2, we know it
          // can't pass m2 and there's no need to test m2).
          while (first2 != m2 && !(*m1 < *first2)) {
              ++first2;
          }
          
          first1 = m1;
          std::iter_swap (first1, first2);
          ++first1;
          ++first2;
      }
      
      // Merge [first1, last1) with [first2, last2), given that the rest of the
      // original ranges are sorted and compare appropriately.
      if ((first1 != last1) && (first2 != last2)) {      
          for (m1 = last1, m2 = first2;  (m1 != first1) && (m2 != last2); ++m2) {
              std::iter_swap (--m1, m2);
          }
          
          std::reverse (first1, m1);
          std::reverse (first1, last1);
          
          std::reverse (m2, last2);
          std::reverse (first2, last2);
      }
      
      return !result;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
cmpq %rsi, %rdi
sete %al
cmpq %rcx, %rdx
sete %cl
orb %al, %cl
je 0x4557
xorl %ebp, %ebp
jmp 0x4634
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq -0x4(%rbx), %rbp
leaq -0x4(%rsi), %rcx
movq %rcx, %r13
movl (%rbp), %esi
cmpq %r12, %rcx
je 0x4585
movq %r13, %rdi
callq 0x4646
leaq -0x4(%r13), %rcx
testb %al, %al
je 0x4568
jmp 0x4591
movq %r12, %rdi
callq 0x4646
testb %al, %al
je 0x45ca
leaq 0x4(%r13), %r12
cmpq %rbp, %r14
je 0x45af
movl (%r14), %esi
movq %r13, %rdi
callq 0x4646
testb %al, %al
jne 0x45af
addq $0x4, %r14
jmp 0x4595
movzwl (%r13), %eax
movzwl (%r14), %ecx
movw %cx, (%r13)
movw %ax, (%r14)
addq $0x4, %r14
movb $0x1, %bpl
jmp 0x45cc
xorl %ebp, %ebp
cmpq %r15, %r12
setne %al
cmpq %rbx, %r14
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x4634
movq %r15, %rsi
movq %r14, %r13
cmpq %r12, %rsi
je 0x460b
cmpq %rbx, %r13
je 0x460b
movzwl -0x4(%rsi), %eax
movzwl (%r13), %ecx
movw %cx, -0x4(%rsi)
addq $-0x4, %rsi
movw %ax, (%r13)
addq $0x4, %r13
jmp 0x45e5
movq %r12, %rdi
callq 0x4683
movq %r12, %rdi
movq %r15, %rsi
callq 0x4683
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4683
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4683
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop