// File: Kingsford-Group[P]ghost2/src/alignGraphs.hpp
// Function: alignGraphs[abi:cxx11](Graph&, Graph&, std::vector<D_alpha, std::allocator<D_alpha>>&, int, double)
bmap alignGraphs(Graph& G, Graph& H, vector<D_alpha>& distances, int k, double skipProb)
{
  cout << "aligning graphs...\n";
  vector<D_alpha> minP;  // empty vector is a heap
  for(auto it = distances.begin(); it != distances.end(); it++)
  {
    minP.push_back(*it);
    push_heap(minP.begin(),minP.end(),CompareD_alphaG());
  }

  ptime t = bclock::local_time();
  bmap result = seedAndExtend(G, H, minP, k, skipProb);
  cout << "aligned " << result.size() << " nodes in " << (bclock::local_time()-t).total_milliseconds() << " milliseconds\n";

  printICS(G, H, result);
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0xb8(%rbp)
movq %rdi, %rax
movq %rax, -0xb0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movsd %xmm0, -0x30(%rbp)
movq 0x11172c(%rip), %rdi    # 0x130f98
leaq 0x9d123(%rip), %rsi     # 0xbc996
callq 0x106c0
leaq -0x48(%rbp), %rdi
callq 0x27ed0
movq -0x20(%rbp), %rdi
callq 0x275a0
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
callq 0x27610
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x275d0
testb $0x1, %al
jne 0x1f8ae
jmp 0x1f91f
leaq -0x50(%rbp), %rdi
callq 0x29570
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x27f30
jmp 0x1f8c5
leaq -0x48(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x275a0
movq -0xc0(%rbp), %rdi
movq %rax, -0x70(%rbp)
callq 0x27610
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x29b60
jmp 0x1f8f8
jmp 0x1f8fa
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x27810
movq %rax, -0x88(%rbp)
jmp 0x1f88e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1fac1
callq 0x23b20
movq %rax, -0xc8(%rbp)
jmp 0x1f92d
movq -0xb8(%rbp), %rdi
movq -0xc8(%rbp), %rax
movq %rax, -0x90(%rbp)
movb $0x0, -0x91(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x24(%rbp), %r8d
movsd -0x30(%rbp), %xmm0
leaq -0x48(%rbp), %rcx
callq 0x1e9a0
jmp 0x1f965
movq 0x11162c(%rip), %rdi    # 0x130f98
leaq 0x9d037(%rip), %rsi     # 0xbc9aa
callq 0x106c0
movq %rax, -0xd0(%rbp)
jmp 0x1f981
movq -0xb8(%rbp), %rdi
callq 0x29f60
movq %rax, -0xd8(%rbp)
jmp 0x1f996
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdi
callq 0x10190
movq %rax, -0xe0(%rbp)
jmp 0x1f9b2
movq -0xe0(%rbp), %rdi
leaq 0x9cff3(%rip), %rsi     # 0xbc9b3
callq 0x106c0
movq %rax, -0xe8(%rbp)
jmp 0x1f9ce
callq 0x23b20
movq %rax, -0xf0(%rbp)
jmp 0x1f9dc
movq -0xf0(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x23cc0
movq %rax, -0xf8(%rbp)
jmp 0x1fa06
movq -0xf8(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x23cf0
movq %rax, -0x100(%rbp)
jmp 0x1fa29
movq -0x100(%rbp), %rsi
movq -0xe8(%rbp), %rdi
callq 0x10d40
movq %rax, -0x108(%rbp)
jmp 0x1fa45
movq -0x108(%rbp), %rdi
leaq 0x9cd5e(%rip), %rsi     # 0xbc7b1
callq 0x106c0
jmp 0x1fa5a
movq -0xb8(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1f120
jmp 0x1fa70
movb $0x1, -0x91(%rbp)
testb $0x1, -0x91(%rbp)
jne 0x1faa8
jmp 0x1fa9c
movq -0xb8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
callq 0x29ca0
jmp 0x1fac1
movq -0xb8(%rbp), %rdi
callq 0x29ca0
leaq -0x48(%rbp), %rdi
callq 0x27ff0
movq -0xb0(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x27ff0
movq -0x60(%rbp), %rdi
callq 0x10cc0
nopw %cs:(%rax,%rax)