// File: /workspace/github_cpp_makefile_star2_O2/BenLangmead[P]bowtie/./ebwt.h
// Function: Ebwt::restore(SString<char>&) const
void Ebwt::restore(BTRefString& s) const {
	assert(isInMemory());
	s.resize(this->_eh._len);
	TIndexOffU jumps = 0;
	TIndexOffU i = this->_eh._len; // should point to final SA elt (starting with '$')
	SideLocus l(i, this->_eh, this->_ebwt);
	while(i != _zOff) {
		assert_lt(jumps, this->_eh._len);
		//if(_verbose) cout << "restore: i: " << i << endl;
		// Not a marked row; go back a char in the original string
		TIndexOffU newi = mapLF(l);
		assert_neq(newi, i);
		s[this->_eh._len - jumps - 1] = rowL(l);
		i = newi;
		l.initFromRow(i, this->_eh, this->_ebwt);
		jumps++;
	}
	assert_eq(jumps, this->_eh._len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r13
callq 0xd5d2
testb %al, %al
je 0x6fb0
leaq 0x108(%r13), %r14
movq 0x108(%r13), %rsi
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
callq 0xdd84
movq 0x108(%r13), %rbx
movq 0xc8(%r13), %rcx
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
movq %r14, (%rsp)
movq %r14, %rdx
callq 0xe2b6
pushq $-0x1
popq %r12
xorl %r15d, %r15d
movq 0x108(%r13), %rax
cmpq 0x68(%r13), %rbx
je 0x6dc7
cmpq %rax, %r15
jae 0x6f09
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0xddd8
cmpq %rbx, %rax
je 0x6ddf
movq %rax, %r14
movq %r13, %rdi
movq %rbp, %rsi
callq 0xe1d8
movl %eax, %ebx
movq 0x108(%r13), %rsi
addq %r12, %rsi
movq 0x8(%rsp), %rdi
callq 0xe1f4
movb %bl, (%rax)
movq 0xc8(%r13), %rcx
movq %rbp, %rdi
movq %r14, %rsi
movq (%rsp), %rdx
callq 0xe2b6
incq %r15
decq %r12
movq %r14, %rbx
jmp 0x6d58
cmpq %rax, %r15
jne 0x6fcf
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2d1d2(%rip), %r14     # 0x33fb8
leaq 0x2153d(%rip), %rsi     # 0x2832a
movq %r14, %rdi
callq 0x42d0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40b0
leaq 0x21368(%rip), %r15     # 0x2816f
movq %rax, %rdi
movq %r15, %rsi
callq 0x42d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x21326(%rip), %rsi     # 0x28174
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x42d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x23570(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x2123e(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x2286a(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0xad6, %esi            # imm = 0xAD6
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x22726(%rip), %rdi     # 0x2961b
leaq 0x214ac(%rip), %rcx     # 0x283a8
movq %rbx, %rsi
movl $0xad6, %edx            # imm = 0xAD6
callq 0x4190
movq 0x2d0a8(%rip), %r14     # 0x33fb8
leaq 0x21370(%rip), %rsi     # 0x28287
movq %r14, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x40b0
leaq 0x2136c(%rip), %rsi     # 0x2829d
movq %rax, %rdi
callq 0x42d0
movq (%rsp), %rcx
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x40b0
leaq 0x234c9(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x21197(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x227c3(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0xad2, %esi            # imm = 0xAD2
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x2267f(%rip), %rdi     # 0x2961b
leaq 0x21405(%rip), %rcx     # 0x283a8
movq %rbx, %rsi
movl $0xad2, %edx            # imm = 0xAD2
callq 0x4190
leaq 0x21139(%rip), %rdi     # 0x280f0
leaq 0x2113f(%rip), %rsi     # 0x280fd
leaq 0x213e3(%rip), %rcx     # 0x283a8
movl $0xacc, %edx            # imm = 0xACC
callq 0x4190
movq 0x2cfe2(%rip), %r14     # 0x33fb8
leaq 0x2117c(%rip), %rsi     # 0x28159
movq %r14, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x40b0
leaq 0x21178(%rip), %r12     # 0x2816f
movq %rax, %rdi
movq %r12, %rsi
callq 0x42d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movq %r15, %rsi
callq 0x40b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x21136(%rip), %rsi     # 0x28174
movq %rax, %rdi
callq 0x42d0
movq (%rsp), %rbx
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x40b0
movq %rax, %rdi
movq %r12, %rsi
callq 0x42d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x40b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x2337c(%rip), %rsi     # 0x2a418
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
leaq 0x2104a(%rip), %rbx     # 0x280fd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42d0
leaq 0x22676(%rip), %rsi     # 0x2973b
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl $0xadc, %esi            # imm = 0xADC
callq 0x45d0
movq %rax, %rdi
callq 0x4130
leaq 0x22532(%rip), %rdi     # 0x2961b
leaq 0x212b8(%rip), %rcx     # 0x283a8
movq %rbx, %rsi
movl $0xadc, %edx            # imm = 0xADC
callq 0x4190
nop