// File: BenLangmead[P]bowtie/pat.cpp
// Function: VectorPatternSource::VectorPatternSource(EList<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 128> const&, int, int)
VectorPatternSource::VectorPatternSource(
	const EList<string>& seqs,
	int trim3,
	int trim5) :
	TrimmingPatternSource(trim3, trim5),
	cur_(0),
	paired_(false),
	tokbuf_(),
	bufs_()
{
	// Install sequences in buffers, ready for immediate copying in
	// nextBatch().  Formatting of the buffer is just like
	// TabbedPatternSource.
	const size_t seqslen = seqs.size();
	for(size_t i = 0; i < seqslen; i++) {
		tokbuf_.clear();
		tokenize(seqs[i], ":", tokbuf_, 2);
		assert_gt(tokbuf_.size(), 0);
		assert_leq(tokbuf_.size(), 2);
		// Get another buffer ready
		bufs_.resize(bufs_.size()+1);
		bufs_.back().clear();
		// Install name
		itoa10<TReadId>(static_cast<TReadId>(i), nametmp_);
		bufs_.back() = nametmp_;
		bufs_.back().push_back('\t');
		// Install sequence
		bufs_.back().append(tokbuf_[0].c_str());
		bufs_.back().push_back('\t');
		// Install qualities
		if(tokbuf_.size() > 1) {
			bufs_.back().append(tokbuf_[1].c_str());
		} else {
			const size_t len = tokbuf_[0].length();
			for(size_t i = 0; i < len; i++) {
				bufs_.back().push_back('I');
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x88(%rbp)
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x2bcd0
movq -0x88(%rbp), %rdi
leaq 0x2824b(%rip), %rax     # 0xa7908
movq %rax, (%rdi)
movq $0x0, 0x20(%rdi)
movb $0x0, 0x28(%rdi)
addq $0x30, %rdi
movq %rdi, -0x80(%rbp)
callq 0x27220
jmp 0x7f6db
movq -0x88(%rbp), %rdi
addq $0x50, %rdi
movq %rdi, -0x90(%rbp)
callq 0x27220
jmp 0x7f6f4
movq -0x10(%rbp), %rdi
callq 0x26400
movq %rax, -0x98(%rbp)
jmp 0x7f706
movq -0x98(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x7fa85
movq -0x88(%rbp), %rdi
addq $0x30, %rdi
callq 0x27dc0
jmp 0x7f739
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x28860
movq %rax, -0xa0(%rbp)
jmp 0x7f74f
leaq -0x59(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0xab70
movq -0xa8(%rbp), %rdx
leaq 0xaae8(%rip), %rsi      # 0x8a255
leaq -0x58(%rbp), %rdi
callq 0x24c10
jmp 0x7f778
movq -0xa0(%rbp), %rdi
movq -0x88(%rbp), %rdx
addq $0x30, %rdx
leaq -0x58(%rbp), %rsi
movl $0x2, %ecx
callq 0x7fac0
jmp 0x7f79a
leaq -0x58(%rbp), %rdi
callq 0xacd8
leaq -0x59(%rbp), %rdi
callq 0xa670
movq -0x88(%rbp), %rdi
addq $0x50, %rdi
movq %rdi, -0xb8(%rbp)
callq 0x26400
movq %rax, -0xb0(%rbp)
jmp 0x7f7cc
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x82e30
jmp 0x7f7e4
movq -0x88(%rbp), %rdi
addq $0x50, %rdi
callq 0x26420
movq %rax, -0xc0(%rbp)
jmp 0x7f7fd
movq -0xc0(%rbp), %rdi
callq 0xa7e0
movq -0x88(%rbp), %rsi
movq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
addq $0x70, %rsi
leaq -0x68(%rbp), %rdi
callq 0x82eb0
jmp 0x7f827
movq -0x88(%rbp), %rdi
movq %rdi, %rax
addq $0x70, %rax
movq %rax, -0xd0(%rbp)
addq $0x50, %rdi
callq 0x26420
movq %rax, -0xc8(%rbp)
jmp 0x7f84e
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdi
callq 0xa840
jmp 0x7f863
movq -0x88(%rbp), %rdi
addq $0x50, %rdi
callq 0x26420
movq %rax, -0xd8(%rbp)
jmp 0x7f87c
movq -0xd8(%rbp), %rdi
movl $0x9, %esi
callq 0xa510
jmp 0x7f88f
movq -0x88(%rbp), %rdi
addq $0x50, %rdi
callq 0x26420
movq %rax, -0xe0(%rbp)
jmp 0x7f8a8
movq -0x88(%rbp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x27460
movq %rax, -0xe8(%rbp)
jmp 0x7f8c5
movq -0xe8(%rbp), %rdi
callq 0xa210
movq -0xe0(%rbp), %rdi
movq %rax, %rsi
callq 0xac60
jmp 0x7f8e2
movq -0x88(%rbp), %rdi
addq $0x50, %rdi
callq 0x26420
movq %rax, -0xf0(%rbp)
jmp 0x7f8fb
movq -0xf0(%rbp), %rdi
movl $0x9, %esi
callq 0xa510
jmp 0x7f90e
movq -0x88(%rbp), %rdi
addq $0x30, %rdi
callq 0x26400
movq %rax, -0xf8(%rbp)
jmp 0x7f927
movq -0xf8(%rbp), %rax
cmpq $0x1, %rax
jbe 0x7f9f5
movq -0x88(%rbp), %rdi
addq $0x50, %rdi
callq 0x26420
movq %rax, -0x100(%rbp)
jmp 0x7f951
movq -0x88(%rbp), %rdi
addq $0x30, %rdi
movl $0x1, %esi
callq 0x27460
movq %rax, -0x108(%rbp)
jmp 0x7f96f
movq -0x108(%rbp), %rdi
callq 0xa210
movq -0x100(%rbp), %rdi
movq %rax, %rsi
callq 0xac60
jmp 0x7f98c
jmp 0x7fa72
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x7faa3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x7fa9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x7fa8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x7f9e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xacd8
leaq -0x59(%rbp), %rdi
callq 0xa670
jmp 0x7fa8e
movq -0x88(%rbp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x27460
movq %rax, -0x110(%rbp)
jmp 0x7fa12
movq -0x110(%rbp), %rdi
callq 0xa950
movq %rax, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x70(%rbp), %rax
jae 0x7fa70
movq -0x88(%rbp), %rdi
addq $0x50, %rdi
callq 0x26420
movq %rax, -0x118(%rbp)
jmp 0x7fa4d
movq -0x118(%rbp), %rdi
movl $0x49, %esi
callq 0xa510
jmp 0x7fa60
jmp 0x7fa62
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x7fa2a
jmp 0x7fa72
jmp 0x7fa74
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x7f719
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x90(%rbp), %rdi
callq 0x27260
movq -0x80(%rbp), %rdi
callq 0x27260
movq -0x88(%rbp), %rdi
callq 0x2bfe0
movq -0x20(%rbp), %rdi
callq 0xab60
nopl (%rax,%rax)