// File: /workspace/github_cpp_makefile_star2_O1/kdungs[P]codecon/src/matching.cc
// Function: matchingPositions(std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>> const&, std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>> const&)
std::vector<std::size_t> matchingPositions(const Rows& original, const Rows& modified) {
  assert(original.size() == modified.size());
  auto positions = std::vector<std::size_t>{};
  positions.reserve(original.size());

  auto ps = std::vector<std::size_t>(original.size());
  std::iota(std::begin(ps), std::end(ps), 0u);

  for (const auto& orow : original) {
    std::sort(std::begin(ps), std::end(ps),
              [&orow, &modified](const std::size_t l, const std::size_t r) {
                return distance(orow, modified[l]) >
                       distance(orow, modified[r]);
              });
    positions.push_back(ps.back());
    ps.pop_back();
  }

  return positions;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r12
movq 0x8(%rsi), %rsi
subq (%r12), %rsi
movq 0x8(%rdx), %rax
subq (%rdx), %rax
cmpq %rax, %rsi
jne 0x280c
movq %rdx, %r14
movq %rdi, %rbx
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r15, %rsi
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
callq 0x3374
movq 0x8(%r12), %rsi
subq (%r12), %rsi
sarq $0x3, %rsi
imulq %r15, %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x340a
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq %rcx, %rax
je 0x2707
xorl %edx, %edx
movl %edx, %esi
movq %rsi, (%rax)
incl %edx
addq $0x8, %rax
cmpq %rcx, %rax
jne 0x26f7
movq (%r12), %r15
movq 0x8(%r12), %rax
movq %rax, 0x20(%rsp)
cmpq %rax, %r15
je 0x27e3
movq 0x8(%rsp), %r13
movq 0x10(%rsp), %r12
cmpq %r12, %r13
je 0x27a3
movq %r12, %rbp
subq %r13, %rbp
movq %rbp, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rcx
movq %r14, %r8
callq 0x2c07
cmpq $0x81, %rbp
jl 0x2792
leaq 0x80(%r13), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x3152
cmpq %r12, %rbp
je 0x27a3
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3216
addq $0x8, %rbp
jmp 0x2779
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x3152
movq 0x10(%rsp), %rdx
addq $-0x8, %rdx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x27c6
movq (%rdx), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x27ce
movq %rbx, %rdi
callq 0x39ca
addq $-0x8, 0x10(%rsp)
addq $0x18, %r15
cmpq 0x20(%rsp), %r15
jne 0x271e
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x27fa
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2140
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2844(%rip), %rdi      # 0x5057
leaq 0x2803(%rip), %rsi      # 0x501d
leaq 0x2859(%rip), %rcx      # 0x507a
movl $0x25, %edx
callq 0x20b0
jmp 0x282d
movq %rax, %r14
jmp 0x284e
jmp 0x2834
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x284e
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2140
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2862
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2140
movq %r14, %rdi
callq 0x21e0