// File: /workspace/github_c_makefile_star2_O0/lh3[P]fermi-lite/unitig.c
// Function: overlap_intv
static rldintv_t overlap_intv(const rld_t *e, int len, const uint8_t *seq, int min, int j, int at5, rldintv_v *p, int inc_sentinel)
{ // requirement: seq[j] matches the end of a read
	int c, depth, dir, end;
	rldintv_t ik, ok[6];
	p->n = 0;
	dir = at5? 1 : -1; // at5 is true iff we start from the 5'-end of a read
	end = at5? len : -1;
	c = seq[j];
	fm6_set_intv(e, c, ik);
	for (depth = 1, j += dir; j != end; j += dir, ++depth) {
		c = at5? fm6_comp(seq[j]) : seq[j];
		rld_extend(e, &ik, ok, !at5);
		if (!ok[c].x[2]) break; // cannot be extended
		if (depth >= min && ok[0].x[2]) {
			if (inc_sentinel) {
				ok[0].info = j - dir;
				kv_push(rldintv_t, *p, ok[0]);
			} else {
				ik.info = j - dir;
				kv_push(rldintv_t, *p, ik);
			}
		}
		ik = ok[c];
	}
	kv_reverse(rldintv_t, *p, 0); // reverse the array such that the smallest interval comes first
	return ik;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x138(%rbp)
movq %rdi, -0x130(%rbp)
movl 0x20(%rbp), %eax
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rsi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
movq 0x18(%rbp), %rax
movq $0x0, (%rax)
movl 0x10(%rbp), %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, 0x10(%rbp)
je 0xfa58
movl -0xc(%rbp), %eax
movl %eax, -0x13c(%rbp)
jmp 0xfa65
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x13c(%rbp)
jmp 0xfa65
movq -0x138(%rbp), %rax
movl -0x13c(%rbp), %ecx
movl %ecx, -0x30(%rbp)
movq -0x18(%rbp), %rcx
movslq -0x20(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movl %ecx, -0x24(%rbp)
movq -0x8(%rbp), %rcx
movq 0x20(%rcx), %rcx
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rcx
movq 0x20(%rcx), %rcx
movl -0x24(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movq -0x8(%rbp), %rdx
movq 0x20(%rdx), %rdx
movslq -0x24(%rbp), %rsi
subq (%rdx,%rsi,8), %rcx
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x148(%rbp)
cmpl $0x1, -0x24(%rbp)
jl 0xfaeb
cmpl $0x4, -0x24(%rbp)
jg 0xfaeb
movl $0x5, %eax
subl -0x24(%rbp), %eax
movl %eax, -0x14c(%rbp)
jmp 0xfaf4
movl -0x24(%rbp), %eax
movl %eax, -0x14c(%rbp)
movq -0x138(%rbp), %rax
movq -0x148(%rbp), %rcx
movl -0x14c(%rbp), %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movq %rcx, 0x8(%rax)
movq $0x0, 0x18(%rax)
movl $0x1, -0x28(%rbp)
movl -0x2c(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x30(%rbp), %eax
je 0xfe08
cmpl $0x0, 0x10(%rbp)
je 0xfb9a
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jl 0xfb7a
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x4, %eax
jg 0xfb7a
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
movl $0x5, %eax
subl %ecx, %eax
movl %eax, -0x150(%rbp)
jmp 0xfb8c
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x150(%rbp)
movl -0x150(%rbp), %eax
movl %eax, -0x154(%rbp)
jmp 0xfbac
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x154(%rbp)
movq -0x138(%rbp), %rsi
movl -0x154(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
cmpl $0x0, 0x10(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %ecx
callq 0xd6f0
movslq -0x24(%rbp), %rcx
leaq -0xf0(%rbp), %rax
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
jne 0xfbf8
jmp 0xfe08
movl -0x28(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0xfdba
cmpq $0x0, -0xe0(%rbp)
je 0xfdba
cmpl $0x0, 0x20(%rbp)
je 0xfcec
movl -0x20(%rbp), %eax
subl -0x2c(%rbp), %eax
cltq
movq %rax, -0xd8(%rbp)
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xfc9c
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xfc5b
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x160(%rbp)
jmp 0xfc69
movl $0x2, %eax
movq %rax, -0x160(%rbp)
jmp 0xfc69
movq -0x160(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x5, %rsi
callq 0x21e0
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
shlq $0x5, %rcx
addq %rcx, %rax
movq -0xf0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xe8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xe0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0xd8(%rbp), %rcx
movq %rcx, 0x18(%rax)
jmp 0xfdb8
movq -0x138(%rbp), %rax
movl -0x20(%rbp), %ecx
subl -0x2c(%rbp), %ecx
movslq %ecx, %rcx
movq %rcx, 0x18(%rax)
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xfd71
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xfd30
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x168(%rbp)
jmp 0xfd3e
movl $0x2, %eax
movq %rax, -0x168(%rbp)
jmp 0xfd3e
movq -0x168(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x5, %rsi
callq 0x21e0
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x138(%rbp), %rcx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rdx
movq %rdx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
shlq $0x5, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
jmp 0xfdb8
jmp 0xfdba
movq -0x138(%rbp), %rax
movslq -0x24(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
shlq $0x5, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movl -0x2c(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xfb2b
jmp 0xfe0a
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jbe 0xff64
movq 0x18(%rbp), %rax
cmpq $0x0, (%rax)
jbe 0xff64
movq 0x18(%rbp), %rax
movq (%rax), %rax
subq $0x0, %rax
movq %rax, -0x100(%rbp)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x108(%rbp)
movq $0x0, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movq -0x100(%rbp), %rcx
shrq %rcx
cmpq %rcx, %rax
jae 0xff62
movq -0x108(%rbp), %rax
movq -0x100(%rbp), %rcx
subq $0x1, %rcx
subq -0xf8(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x128(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x120(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x118(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x110(%rbp)
movq -0x108(%rbp), %rax
movq -0x100(%rbp), %rcx
subq $0x1, %rcx
subq -0xf8(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq -0x108(%rbp), %rcx
movq -0xf8(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq -0x108(%rbp), %rax
movq -0xf8(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq -0x128(%rbp), %rcx
movq %rcx, (%rax)
movq -0x120(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x118(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x110(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0xf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf8(%rbp)
jmp 0xfe53
jmp 0xff64
jmp 0xff66
movq -0x130(%rbp), %rax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopw %cs:(%rax,%rax)