// File: /workspace/github_cpp_makefile_star2_O3/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 0x28a0
movq %rdx, %r14
movq %rdi, %rbx
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r15 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r15, %rsi
pxor %xmm0, %xmm0
movdqu %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
callq 0x342a
movq 0x8(%r12), %rsi
subq (%r12), %rsi
sarq $0x3, %rsi
imulq %r15, %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x34c6
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %r15
cmpq %r15, %rax
je 0x2797
movq %r15, %rcx
subq %rax, %rcx
addq $-0x8, %rcx
movq %rcx, %xmm0
shrq $0x3, %rcx
addq $0x2, %rcx
andq $-0x2, %rcx
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
psrlq $0x3, %xmm0
xorl %edx, %edx
movdqa 0x28f0(%rip), %xmm1     # 0x5010
movdqa 0x28f8(%rip), %xmm2     # 0x5020
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movq %rdx, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm1, %xmm4
pxor %xmm2, %xmm4
movdqa %xmm4, %xmm5
pcmpgtd %xmm0, %xmm5
pcmpeqd %xmm0, %xmm4
pshufd $0xf5, %xmm4, %xmm6     # xmm6 = xmm4[1,1,3,3]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm4     # xmm4 = xmm5[1,1,3,3]
por %xmm6, %xmm4
movd %xmm4, %esi
notl %esi
testb $0x1, %sil
je 0x2775
movl %edx, %esi
andl $-0x2, %esi
movq %rsi, (%rax,%rdx,8)
pxor %xmm3, %xmm4
pextrw $0x4, %xmm4, %esi
testb $0x1, %sil
je 0x278e
movl %edx, %esi
orl $0x1, %esi
movq %rsi, 0x8(%rax,%rdx,8)
addq $0x2, %rdx
cmpq %rdx, %rcx
jne 0x2730
movq (%r12), %r13
movq 0x8(%r12), %rax
movq %rax, 0x20(%rsp)
cmpq %rax, %r13
je 0x2877
movq 0x8(%rsp), %r12
cmpq %r15, %r12
je 0x282f
movq %r15, %rbp
subq %r12, %rbp
movq %rbp, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rcx
movq %r14, %r8
callq 0x2c9b
cmpq $0x81, %rbp
jl 0x281e
leaq 0x80(%r12), %rbp
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x3202
cmpq %r15, %rbp
je 0x282f
movq %rbp, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x32c6
addq $0x8, %rbp
jmp 0x2805
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x3202
movq 0x10(%rsp), %rdx
addq $-0x8, %rdx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2852
movq (%rdx), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x285a
movq %rbx, %rdi
callq 0x3ab0
movq 0x10(%rsp), %r15
addq $-0x8, %r15
movq %r15, 0x10(%rsp)
addq $0x18, %r13
cmpq 0x20(%rsp), %r13
jne 0x27ae
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x288e
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 0x27ec(%rip), %rdi      # 0x5093
leaq 0x27ab(%rip), %rsi      # 0x5059
leaq 0x2801(%rip), %rcx      # 0x50b6
movl $0x25, %edx
callq 0x20b0
jmp 0x28c1
movq %rax, %r14
jmp 0x28e2
jmp 0x28c8
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x28e2
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x2140
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x28f6
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2140
movq %r14, %rdi
callq 0x21e0