// File: /workspace/github_cpp_makefile_star2_O3/BenLangmead[P]bowtie/./range_source.h
// Function: Branch::init(AllocOnlyPool<RangeState>&, AllocOnlyPool<Edit>&, unsigned int, unsigned int, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short, unsigned int, unsigned int, EbwtParams const&, unsigned char const*, EditList const*)
bool init(AllocOnlyPool<RangeState>& rsPool,
	          AllocOnlyPool<Edit>& epool,
	          uint32_t id,
	          uint32_t qlen,
	          uint16_t depth0,
	          uint16_t depth1,
	          uint16_t depth2,
	          uint16_t depth3,
	          uint16_t rdepth,
	          uint16_t len,
	          uint16_t cost,
	          uint16_t ham,
	          TIndexOffU itop,
	          TIndexOffU ibot,
	          const EbwtParams& ep,
	          const uint8_t* ebwt,
	          const EditList* edits = NULL)
	{
		id_ = id;
		delayedCost_ = 0;
		depth0_ = depth0;
		depth1_ = depth1;
		depth2_ = depth2;
		depth3_ = depth3;
		assert_gt(depth3_, 0);
		rdepth_ = rdepth;
		len_ = len;
		cost_ = cost;
		ham_ = ham;
		top_ = itop;
		bot_ = ibot;

		if(ibot > itop+1) {
			// Care about both top and bot
			SideLocus::initFromTopBot(itop, ibot, ep, ebwt, ltop_, lbot_);
		} else if(ibot > itop) {
			// Only care about top
			ltop_.initFromRow(itop, ep, ebwt);
			lbot_.invalidate();
		}
		if(qlen - rdepth_ > 0) {
			ranges_ = rsPool.allocC(qlen - rdepth_); // allocated from the RangeStatePool
			if(ranges_ == NULL) {
				return false; // RangeStatePool exhausted
			}
			rangesSz_ = qlen - rdepth_;
		} else {
			ranges_ = NULL;
			rangesSz_ = 0;
		}
#ifndef NDEBUG
		for(size_t i = 0; i < (qlen - rdepth_); i++) {
			for(int j = 0; j < 4; j++) {
				assert_eq(0, ranges_[i].tops[j]);
				assert_eq(0, ranges_[i].bots[j]);
			}
		}
#endif
		curtailed_ = false;
		exhausted_ = false;
		prepped_ = true;
		delayedIncrease_ = false;
		edits_.clear();
		if(edits != NULL) {
			const size_t numEdits = edits->size();
			for(size_t i = 0; i < numEdits; i++) {
				edits_.add(edits->get(i), epool, qlen);
			}
		}
		// If we're starting with a non-zero length, that means we're
		// jumping over a bunch of unrevisitable positions.
		for(size_t i = 0; i < len_; i++) {
			ranges_[i].eliminated_ = true;
			assert(eliminated((int)i));
		}
		assert(repOk(qlen));
		return true;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %r14d
movl %ecx, %eax
movq %rdx, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, %rbx
movq 0xa0(%rsp), %rcx
movq 0x98(%rsp), %rdx
movl 0x90(%rsp), %esi
movl %eax, (%rdi)
movl 0x88(%rsp), %eax
movw $0x0, 0x80(%rdi)
movw %r9w, 0x4(%rdi)
movzwl 0x50(%rsp), %edi
movw %di, 0x6(%rbx)
movzwl 0x58(%rsp), %edi
movw %di, 0x8(%rbx)
movzwl 0x60(%rsp), %edi
movw %di, 0xa(%rbx)
movzwl 0x68(%rsp), %edi
movw %di, 0xc(%rbx)
movzwl 0x70(%rsp), %edi
movw %di, 0xe(%rbx)
movzwl 0x78(%rsp), %edi
movw %di, 0x10(%rbx)
movzwl 0x80(%rsp), %edi
movw %di, 0x12(%rbx)
movl %eax, 0x24(%rbx)
movl %esi, 0x28(%rbx)
leal 0x1(%rax), %edi
cmpl %esi, %edi
jae 0x2b494
leaq 0x2c(%rbx), %r8
leaq 0x3c(%rbx), %r9
movl %eax, %edi
callq 0x2bb86
jmp 0x2b4a7
cmpl %eax, %esi
jbe 0x2b4a7
leaq 0x2c(%rbx), %rdi
movl %eax, %esi
callq 0x1b036
movb $-0x1, 0x4a(%rbx)
movzwl 0xc(%rbx), %eax
movl %r14d, %r12d
subl %eax, %r12d
jne 0x2b4bf
movq $0x0, 0x18(%rbx)
xorl %eax, %eax
jmp 0x2b4f9
movq %r15, %rdi
movl %r12d, %esi
callq 0x2bcdc
testq %rax, %rax
je 0x2b5c5
movq %rax, %r15
movl %r12d, %eax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x9250
movq %r15, 0x18(%rbx)
movzwl 0xc(%rbx), %ecx
movl %r14d, %eax
subw %cx, %ax
movw %ax, 0x20(%rbx)
movl $0x10000, 0x82(%rbx)    # imm = 0x10000
movq $0x0, 0x50(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rbx)
cmpq $0x0, 0xa8(%rsp)
je 0x2b59b
movq 0xa8(%rsp), %rax
movq (%rax), %rbp
testq %rbp, %rbp
je 0x2b59b
leaq 0x50(%rbx), %r15
addq $0x8, %rax
movq %rax, 0x8(%rsp)
movl %r14d, %r12d
movq $-0x58, %r14
xorl %r13d, %r13d
cmpq $0x5, %r13
ja 0x2b55c
movq 0x8(%rsp), %rax
leaq (%rax,%r13,4), %rsi
jmp 0x2b57f
movq 0xa8(%rsp), %rax
cmpq $0x15, %r13
ja 0x2b578
movq 0x20(%rax), %rax
leaq (%rax,%r13,4), %rsi
addq $-0x18, %rsi
jmp 0x2b57f
movq 0x28(%rax), %rsi
addq %r14, %rsi
movq %r15, %rdi
movq 0x10(%rsp), %rdx
movq %r12, %rcx
callq 0x2bc4e
incq %r13
addq $0x4, %r14
cmpq %r13, %rbp
jne 0x2b54b
movb $0x1, %al
cmpw $0x0, 0xe(%rbx)
je 0x2b5cf
movl $0x28, %ecx
xorl %edx, %edx
movq 0x18(%rbx), %rsi
movb $0x1, (%rsi,%rcx)
incq %rdx
movzwl 0xe(%rbx), %esi
addq $0x30, %rcx
cmpq %rsi, %rdx
jb 0x2b5ab
jmp 0x2b5cf
movq $0x0, 0x18(%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq