// File: /workspace/github_cpp_makefile_star2_O1/akojo[P]quickfind/match.cpp
// Function: match(__gnu_cxx::__normal_iterator<wstr*, std::vector<wstr, std::allocator<wstr>>>, __gnu_cxx::__normal_iterator<wstr*, std::vector<wstr, std::allocator<wstr>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
vector<wstr>::iterator match(vector<wstr>::iterator begin, vector<wstr>::iterator end, const string& pattern)
{
    for_each(begin, end, [&](wstr& s) { s.score = smatch(s.str, pattern); });
    auto last = partition(begin, end, [](wstr& s) { return s.score > 0; });
    sort(begin, last);
    return last;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
movq %rdi, %r12
cmpq %rsi, %rdi
je 0x308a
movq (%rdx), %rax
movq 0x8(%rdx), %rcx
movq %rax, 0x8(%rsp)
movq %rcx, 0x30(%rsp)
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq %r14, 0x28(%rsp)
movq %rsi, 0x38(%rsp)
cmpq $0x0, 0x30(%rsp)
setne %al
movq %r14, 0x10(%rsp)
movq 0x10(%r14), %rcx
movq %rcx, 0x20(%rsp)
testq %rcx, %rcx
setne %cl
andb %al, %cl
movq 0x8(%rsp), %r14
movl $0x1, %eax
cmpb $0x1, %cl
jne 0x2f6f
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rbx
decq 0x20(%rsp)
xorl %r12d, %r12d
movl $0x1, %eax
xorl %r13d, %r13d
movq 0x8(%rsp), %r14
movl %eax, %r15d
movsbl (%r14), %edi
callq 0x2260
movl %eax, %ebp
movsbl (%rbx,%r12), %edi
callq 0x2260
cmpl $0x1, %r13d
sete %cl
incl %r13d
xorl %edx, %edx
cmpl %eax, %ebp
sete %dl
movl $0x1, %eax
cmovel %eax, %r13d
addq %rdx, %r14
andb %cl, %dl
movzbl %dl, %eax
addl %r15d, %eax
cmpq 0x18(%rsp), %r14
je 0x2f6f
leaq 0x1(%r12), %rcx
cmpq %r12, 0x20(%rsp)
movq %rcx, %r12
jne 0x2f1c
cmpq 0x18(%rsp), %r14
movl $0x0, %ecx
cmovnel %ecx, %eax
movq 0x10(%rsp), %r14
movl %eax, (%r14)
addq $0x28, %r14
movq 0x38(%rsp), %rbp
cmpq %rbp, %r14
jne 0x2ed0
movq 0x28(%rsp), %r14
movq %r14, %r12
cmpq %rbp, %r14
je 0x308a
leaq 0x48(%rsp), %r15
leaq 0x58(%rsp), %r13
movq %r14, %rax
addq $0x18, %rax
movq %rax, %rbx
cmpl $0x0, -0x18(%rbx)
jle 0x2fd6
leaq 0x28(%rbx), %r12
addq $0x10, %rbx
cmpq %rbp, %rbx
movq %r12, %rbx
jne 0x2fbb
jmp 0x3086
leaq -0x18(%rbx), %r12
addq $-0x28, %rbp
cmpq %r12, %rbp
je 0x308a
cmpl $0x0, (%rbp)
jle 0x2fda
movl -0x18(%rbx), %eax
movl %eax, 0x40(%rsp)
movq %r13, 0x48(%rsp)
movq -0x10(%rbx), %rax
cmpq %rax, %rbx
je 0x3011
movq %rax, 0x48(%rsp)
movq (%rbx), %rax
movq %rax, 0x58(%rsp)
jmp 0x3019
movups (%rbx), %xmm0
movups %xmm0, (%r13)
leaq -0x10(%rbx), %rdi
movq -0x8(%rbx), %rax
movq %rax, 0x50(%rsp)
movq %rbx, -0x10(%rbx)
movq $0x0, -0x8(%rbx)
movb $0x0, (%rbx)
movl (%rbp), %eax
movl %eax, -0x18(%rbx)
leaq 0x8(%rbp), %r12
movq %r12, %rsi
callq 0x2210
movl 0x40(%rsp), %eax
movl %eax, (%rbp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x2210
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x3070
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2180
leaq 0x10(%rbx), %rax
cmpq %rax, %rbp
jne 0x2fb4
addq $0x10, %rbx
movq %rbx, %r12
jmp 0x308a
addq $-0x18, %r12
movq %r12, %rax
subq %r14, %rax
je 0x30c7
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rcx
bsrq %rcx, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x30d9
movq %r14, %rdi
movq %r12, %rsi
callq 0x31b6
movq %r12, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq