// File: tedsharpe[P]ORFCall/ORFCall.cc
// Function: (anonymous namespace)::Reference::findAlignment(std::vector<unsigned char, std::allocator<unsigned char>> const&) const
Alignment findAlignment( Sequence const& seq ) const
    {
        if ( seq.size() < mK )
            return Alignment();

        auto notFound = mUniqueKmers.end();
        for ( Kmer kmer(seq.begin()), end(seq.end()-mK+1); kmer != end; ++kmer )
        {
            auto itr = mUniqueKmers.find(kmer);
            if ( itr != notFound )
            {
                Offset refStart = itr->second.getOffset();
                Offset readStart = kmer - seq.begin();
                Offset backOff = std::min(refStart,readStart);
                refStart -= backOff;
                readStart -= backOff;
                Offset len = std::min(mRefSeq.size()-refStart,
                                        seq.size()-readStart);
                bool isRC = itr->second.isRC();
                if ( isRC )
                {
                    refStart = mRefSeq.size()-refStart-len;
                    readStart = seq.size()-readStart-len;
                }
                return Alignment(refStart,refStart+len,readStart,isRC);
            }
        }
        return Alignment();
    }

// Assembly:
subq $0x98, %rsp
movq %rdi, (%rsp)
movq %rdi, 0x8(%rsp)
movq %rsi, 0x90(%rsp)
movq %rdx, 0x88(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x88(%rsp), %rdi
callq 0x17530
movq 0x10(%rsp), %rcx
movl (%rcx), %ecx
cmpq %rcx, %rax
jae 0xd6d4
movq (%rsp), %rdi
callq 0xdbe0
jmp 0xd8e9
movq 0x10(%rsp), %rdi
addq $0x38, %rdi
callq 0xdc10
movq %rax, 0x80(%rsp)
movq 0x88(%rsp), %rdi
callq 0x1dc60
movq %rax, 0x78(%rsp)
movq 0x88(%rsp), %rdi
callq 0x1dc90
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x60(%rsp)
movl (%rax), %eax
movl %eax, %esi
leaq 0x60(%rsp), %rdi
callq 0x1e240
movq %rax, 0x68(%rsp)
leaq 0x68(%rsp), %rdi
movl $0x1, %esi
callq 0x1a140
movq %rax, 0x70(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x19f20
testb $0x1, %al
jne 0xd755
jmp 0xd8e0
movq 0x10(%rsp), %rdi
addq $0x38, %rdi
leaq 0x78(%rsp), %rsi
callq 0xdc40
movq %rax, 0x58(%rsp)
leaq 0x58(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0xaac0
testb $0x1, %al
jne 0xd788
jmp 0xd8cf
leaq 0x58(%rsp), %rdi
callq 0xdc70
movq %rax, %rdi
addq $0x8, %rdi
callq 0xdc90
movq %rax, 0x50(%rsp)
movq 0x88(%rsp), %rdi
callq 0x1dc60
movq %rax, 0x40(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x1e280
movq %rax, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x17a30
movq 0x10(%rsp), %rdi
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rcx
movq 0x50(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x50(%rsp)
movq 0x38(%rsp), %rcx
movq 0x48(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x48(%rsp)
addq $0x8, %rdi
callq 0x17530
subq 0x50(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x88(%rsp), %rdi
callq 0x17530
subq 0x48(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x17a30
movq (%rax), %rax
movq %rax, 0x30(%rsp)
leaq 0x58(%rsp), %rdi
callq 0xdc70
movq %rax, %rdi
addq $0x8, %rdi
callq 0xdca0
andb $0x1, %al
movb %al, 0x1f(%rsp)
testb $0x1, 0x1f(%rsp)
je 0xd8a6
movq 0x10(%rsp), %rdi
addq $0x8, %rdi
callq 0x17530
subq 0x50(%rsp), %rax
subq 0x30(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x88(%rsp), %rdi
callq 0x17530
subq 0x48(%rsp), %rax
subq 0x30(%rsp), %rax
movq %rax, 0x48(%rsp)
movq (%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq 0x30(%rsp), %rdx
movq 0x48(%rsp), %rcx
movb 0x1f(%rsp), %al
andb $0x1, %al
movzbl %al, %r8d
callq 0xdcb0
jmp 0xd8e9
jmp 0xd8d1
leaq 0x78(%rsp), %rdi
callq 0x19f60
jmp 0xd73d
movq (%rsp), %rdi
callq 0xdbe0
movq 0x8(%rsp), %rax
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)