// File: 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
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x665a0
cmpq $0x0, %rax
jne 0x6a8a2
jmp 0x6ab0a
movq -0x50(%rbp), %rsi
addq $0x50, %rsi
leaq -0x20(%rbp), %rdi
callq 0x2f3b0
movq -0x50(%rbp), %rdi
addq $0x30, %rdi
callq 0x665a0
movq %rax, -0x58(%rbp)
jmp 0x6a8c6
movq -0x58(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x665a0
movq %rax, -0x60(%rbp)
jmp 0x6a8dd
movq -0x60(%rbp), %rax
cmpq $0x1, %rax
jne 0x6a965
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6ab40
movq %rax, -0x68(%rbp)
jmp 0x6a8fa
movq -0x50(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0x6ab70
movq %rax, -0x70(%rbp)
jmp 0x6a90d
movq -0x50(%rbp), %rdi
movq -0x70(%rbp), %rax
movq -0x68(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
leaq -0xc(%rbp), %rsi
callq 0x6ab70
movq %rax, -0x78(%rbp)
jmp 0x6a92e
movq -0x78(%rbp), %rax
movabsq $0x3fffffffffffffff, %rcx # imm = 0x3FFFFFFFFFFFFFFF
andq (%rax), %rcx
orq $0x0, %rcx
movq %rcx, (%rax)
jmp 0x6ab01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x2f3e0
jmp 0x6ab13
movq -0x50(%rbp), %rdi
movq $-0x1, -0x40(%rbp)
movq -0x28(%rbp), %rdx
movq -0x40(%rbp), %rax
movabsq $0x3fffffffffffffff, %rcx # imm = 0x3FFFFFFFFFFFFFFF
andq %rcx, %rdx
movabsq $-0x4000000000000000, %rsi # imm = 0xC000000000000000
andq %rsi, %rax
orq %rdx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
andq %rcx, %rax
movabsq $0x4000000000000000, %rcx # imm = 0x4000000000000000
orq %rcx, %rax
movq %rax, -0x40(%rbp)
leaq -0xc(%rbp), %rsi
callq 0x6ab70
movq %rax, -0x80(%rbp)
jmp 0x6a9c1
movq -0x80(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rdi
callq 0x665a0
movq %rax, -0x88(%rbp)
jmp 0x6a9f1
movq -0x90(%rbp), %rax
movq -0x88(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x6aa91
movq -0x50(%rbp), %rax
addq $0x30, %rax
movq %rax, -0xa0(%rbp)
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x6ab40
movq %rax, -0x98(%rbp)
jmp 0x6aa31
movq -0x98(%rbp), %rsi
movq -0xa0(%rbp), %rdi
callq 0x698e0
jmp 0x6aa46
movq -0x50(%rbp), %rdi
addq $0x30, %rdi
callq 0x6ac50
movq %rax, -0xa8(%rbp)
jmp 0x6aa5c
movq -0xa8(%rbp), %rax
movabsq $0x3fffffffffffffff, %rcx # imm = 0x3FFFFFFFFFFFFFFF
andq (%rax), %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
orq %rdx, %rcx
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x6a9d4
movq -0x50(%rbp), %rax
addq $0x30, %rax
movq %rax, -0xb8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6ac80
movq %rax, -0xb0(%rbp)
jmp 0x6aab2
movq -0xb0(%rbp), %rsi
movq -0xb8(%rbp), %rdi
callq 0x698e0
jmp 0x6aac7
movq -0x50(%rbp), %rdi
addq $0x30, %rdi
callq 0x6ac50
movq %rax, -0xc0(%rbp)
jmp 0x6aadd
movq -0xc0(%rbp), %rax
movabsq $0x3fffffffffffffff, %rcx # imm = 0x3FFFFFFFFFFFFFFF
andq (%rax), %rcx
movabsq $-0x4000000000000000, %rdx # imm = 0xC000000000000000
orq %rdx, %rcx
movq %rcx, (%rax)
leaq -0x20(%rbp), %rdi
callq 0x2f3e0
addq $0xc0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0xab60
nopl (%rax)