// File: /workspace/github_cpp_makefile_star2_O2/BenLangmead[P]bowtie/./ebwt_search_util.h
// Function: PartialAlignmentManager::addPartials(unsigned int, EList<PartialAlignment, 128> const&)
void addPartials(uint32_t patid, const EList<PartialAlignment>& ps) {
		if(ps.size() == 0) return;
		ThreadSafe _ts(&mutex_m);
		size_t origPlSz = _partialsList.size();
		// Assert that the entry doesn't exist yet
		assert(_partialsMap.find(patid) == _partialsMap.end());
		if(ps.size() == 1) {
			_partialsMap[patid] = ps[0];
			_partialsMap[patid].entry.type = 0; // singleton
		} else {
#ifndef NDEBUG
			// Make sure there are not duplicate entries
			for(size_t i = 0; i < ps.size()-1; i++)
				for(size_t j = i+1; j < ps.size(); j++)
					assert(!samePartialAlignment(ps[i], ps[j]));
#endif
			// Insert a "pointer" record into the map that refers to
			// the stretch of the _partialsList vector that contains
			// the partial alignments.
			PartialAlignment al;
			al.u64.u64 = 0xffffffffffffffffllu;
			al.off.off = origPlSz;
			al.off.type = 1; // list offset
			_partialsMap[patid] = al; // install pointer
			assert_gt(ps.size(), 1);
			// Now add all the non-tail partial alignments (all but the
			// last) to the _partialsList
			for(size_t i = 0; i < ps.size()-1; i++) {
				assert(validPartialAlignment(ps[i]));
				_partialsList.push_back(ps[i]);
				// list entry (non-tail)
				_partialsList.back().entry.type = 2;
			}
			// Now add the tail (last) partial alignment and mark it as
			// such
			assert(validPartialAlignment(ps.back()));
			_partialsList.push_back(ps.back());
			// list tail
			_partialsList.back().entry.type = 3;
#ifndef NDEBUG
			// Make sure there are not duplicate entries
			assert_eq(_partialsList.size(), origPlSz + ps.size());
			for(size_t i = origPlSz; i < _partialsList.size()-1; i++) {
				for(size_t j = i+1; j < _partialsList.size(); j++) {
					assert(!samePartialAlignment(_partialsList[i], _partialsList[j]));
				}
			}
#endif
		}
		// Assert that we added an entry
		assert(_partialsMap.find(patid) != _partialsMap.end());
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, 0xc(%rsp)
cmpq $0x0, 0x18(%rdx)
je 0x37048
movq %rdx, %r14
movq %rdi, %rbx
addq $0x50, %rdi
movq %rdi, 0x10(%rsp)
callq 0x40dda
cmpq $0x1, 0x18(%r14)
jne 0x36fa7
movq 0x8(%r14), %r14
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x37070
movq (%r14), %rcx
movq %rcx, (%rax)
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x37070
andb $0x3f, 0x7(%rax)
jmp 0x3703e
movq 0x48(%rbx), %r13
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x37070
leaq 0x30(%rbx), %r15
movabsq $0x3fffffffffffffff, %r12 # imm = 0x3FFFFFFFFFFFFFFF
andq %r12, %r13
leaq (%r12,%r13), %rcx
incq %rcx
movq %rcx, (%rax)
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x8(%r14), %rsi
movq 0x18(%r14), %rax
leaq -0x1(%rax), %rcx
cmpq %rcx, %rbp
jae 0x37017
addq %r13, %rsi
movq %r15, %rdi
callq 0x366e2
movq 0x38(%rbx), %rax
movq 0x48(%rbx), %rcx
movq -0x8(%rax,%rcx,8), %rdx
andq %r12, %rdx
btsq $0x3f, %rdx
movq %rdx, -0x8(%rax,%rcx,8)
incq %rbp
addq $0x8, %r13
jmp 0x36fd8
leaq (%rsi,%rax,8), %rsi
addq $-0x8, %rsi
movq %r15, %rdi
callq 0x366e2
movq 0x38(%rbx), %rax
movq 0x48(%rbx), %rcx
movabsq $-0x4000000000000000, %rdx # imm = 0xC000000000000000
orq %rdx, -0x8(%rax,%rcx,8)
leaq 0x10(%rsp), %rdi
callq 0x1a9ee
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3705b
jmp 0x3705b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1a9ee
movq %rbx, %rdi
callq 0x9950