// File: /workspace/github_c_makefile_star2_O1/lh3[P]fermi2/dfs.c
// Function: fm_dfs_core
void fm_dfs_core(int n, rld_t *const*e, int is_half, int max_k, int suf_len, int suf, fmdfs_f func, void *data, int tid)
{ // this routine is similar to fmc_collect1()
	int i, j, c;
	fmint6_t *size, *tk, *tl;
	elem_t *t;
	char *_path, *path;
	uint64_t ok[6], ol[6];
	kvec_t(elem_t) stack = {0,0,0};

	assert((max_k&1) || !is_half);
	t = alloca(sizeof(elem_t) * n);
	size = alloca(sizeof(fmint6_t) * n);
	tk = alloca(sizeof(fmint6_t) * n);
	tl = alloca(sizeof(fmint6_t) * n);
	_path = alloca(max_k + 2);
	path = _path + 1;
	kv_resize(elem_t, stack, n * max_k * 6);
	// descend
	for (i = 0; i < n; ++i) {
		elem_t *p;
		kv_pushp(elem_t, stack, &p);
		p->k = 0, p->l = e[i]->mcnt[0];
		for (j = 0; j < suf_len; ++j) {
			c = (suf>>j*2&3) + 1;
			rld_rank2a(e[i], p->k, p->l, ok, ol);
			p->k = e[i]->cnt[c] + ok[c];
			p->l = e[i]->cnt[c] + ol[c];
		}
		p->d = suf_len, p->c = (suf>>(suf_len-1)*2&3) + 1;
	}
	for (j = 0; j < suf_len; ++j)
		path[max_k - j - 1] = "ACGT"[suf>>j*2&3];
	path[max_k] = 0;
	// traverse
	while (stack.n) {
		int end, cont = 0x1E;
		for (i = n - 1; i >= 0; --i) t[i] = kv_pop(stack);
		if (t->d > max_k) continue;
		path[max_k - t->d] = "\0ACGTN"[t->c];
		for (i = 0; i < n; ++i) {
			assert(t[i].k < e[i]->mcnt[0]);
			rld_rank2a(e[i], t[i].k, t[i].l, tk[i].c, tl[i].c);
			for (c = 0; c < 6; ++c) {
				size[i].c[c] = tl[i].c[c] - tk[i].c[c];
				if (size[i].c[c] == 0) cont &= ~(1<<c);
			}
		}
		func(data, tid, t->d, path + (max_k - t->d), size, &cont);
		end = t->d == max_k>>1 && is_half? 2 : 4;
		for (c = 1; c <= end; ++c) {
			if ((cont>>c&1) == 0) continue;
			for (i = 0; i < n; ++i) {
				elem_t *p;
				kv_pushp(elem_t, stack, &p);
				p->k = e[i]->cnt[c] + tk[i].c[c];
				p->l = e[i]->cnt[c] + tl[i].c[c];
				p->d = t->d + 1;
				p->c = c;
			}
		}
	}
	free(stack.a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %r9d, -0x50(%rbp)
movl %ecx, %ebx
movl %edx, -0x98(%rbp)
testl %edx, %edx
sete %al
orb %bl, %al
testb $0x1, %al
je 0xbb0e
movl %r8d, %r13d
movq %rsi, %r14
movslq %edi, %rax
leaq (%rax,%rax,2), %rcx
movq %rsp, %r12
leaq 0xf(,%rcx,8), %rcx
andq $-0x10, %rcx
subq %rcx, %r12
movq %r12, %rsp
shlq $0x4, %rax
leaq (%rax,%rax,2), %rax
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0xa0(%rbp)
movq %rcx, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x88(%rbp)
movq %rcx, %rsp
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, -0x80(%rbp)
movq %rcx, %rsp
movslq %ebx, %rcx
movq %rsp, %rdx
movq %rcx, -0x60(%rbp)
leaq 0x11(%rcx), %r15
andq $-0x10, %r15
movq %rdx, -0x78(%rbp)
movq %rdx, %rax
subq %r15, %rax
movq %rax, %rsp
movl %ebx, %eax
movl %edi, -0x34(%rbp)
imull %edi, %eax
testl %eax, %eax
je 0xb606
addl %eax, %eax
leal (%rax,%rax,2), %eax
cltq
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x8(,%rcx,8), %rax
incq %rcx
movq %rcx, -0x40(%rbp)
leaq (%rax,%rax,2), %rdi
callq 0x2220
jmp 0xb610
movq $0x0, -0x40(%rbp)
xorl %eax, %eax
movq %r14, -0x68(%rbp)
movq %rbx, -0xa8(%rbp)
negq %r15
movq %r15, -0x70(%rbp)
movl -0x34(%rbp), %ecx
movl %ecx, %edx
movq %rdx, -0x90(%rbp)
testl %ecx, %ecx
movq %r12, -0xb0(%rbp)
movq %rax, -0x30(%rbp)
jle 0xb782
leal (,%r13,2), %ecx
addb $-0x2, %cl
movl -0x50(%rbp), %ebx
movl %ebx, %eax
sarl %cl, %eax
andl $0x3, %eax
incl %eax
movl %eax, -0x58(%rbp)
xorl %r15d, %r15d
leaq -0x130(%rbp), %r8
leaq -0x100(%rbp), %r9
movq %r13, -0x48(%rbp)
movq -0x40(%rbp), %rax
cmpq %rax, %r15
movq -0x30(%rbp), %rdi
jne 0xb6b3
leaq (%rax,%rax), %r14
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %r14
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %rsi
callq 0x2260
leaq -0x100(%rbp), %r9
leaq -0x130(%rbp), %r8
movq %rax, %rdi
movq %r14, -0x40(%rbp)
leaq (%r15,%r15,2), %rax
movq %rdi, -0x30(%rbp)
leaq (%rdi,%rax,8), %r12
movq $0x0, (%r12)
movq -0x68(%rbp), %rdx
movq (%rdx,%r15,8), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq %rax, 0x8(%r12)
testl %r13d, %r13d
jle 0xb758
xorl %r13d, %r13d
movq -0x48(%rbp), %rax
movl %eax, %r14d
movl -0x50(%rbp), %eax
movl %eax, %ebx
movl %r13d, %ecx
sarl %cl, %ebx
andl $0x3, %ebx
movq (%rdx,%r15,8), %rdi
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r8, %rcx
movq %r9, %r8
callq 0x4d57
movq -0x68(%rbp), %rdx
leaq -0x100(%rbp), %r9
leaq -0x130(%rbp), %r8
movq (%rdx,%r15,8), %rax
movq 0x20(%rax), %rax
movq -0x128(%rbp,%rbx,8), %rcx
addq 0x8(%rax,%rbx,8), %rcx
movq %rcx, (%r12)
movq -0xf8(%rbp,%rbx,8), %rcx
addq 0x8(%rax,%rbx,8), %rcx
movl -0x50(%rbp), %ebx
movq %rcx, 0x8(%r12)
addl $0x2, %r13d
decl %r14d
jne 0xb6ea
incq %r15
movq -0x48(%rbp), %r13
movl %r13d, 0x10(%r12)
movl -0x58(%rbp), %eax
movl %eax, 0x14(%r12)
cmpq -0x90(%rbp), %r15
movq -0xb0(%rbp), %r12
jne 0xb670
jmp 0xb788
xorl %r15d, %r15d
movl -0x50(%rbp), %ebx
movq -0x78(%rbp), %rax
movq -0x70(%rbp), %rcx
leaq (%rax,%rcx), %r9
incq %r9
testl %r13d, %r13d
movq -0xa8(%rbp), %r8
jle 0xb7d3
movl %r13d, %eax
leal -0x1(%r8), %edx
addq %rax, %rax
xorl %ecx, %ecx
leaq 0x113c1(%rip), %rsi     # 0x1cb77
movl %ebx, %edi
sarl %cl, %edi
andl $0x3, %edi
movb (%rdi,%rsi), %dil
movslq %edx, %rdx
movb %dil, (%r9,%rdx)
decl %edx
addq $0x2, %rcx
cmpq %rcx, %rax
jne 0xb7b6
movq -0x60(%rbp), %rax
movb $0x0, (%r9,%rax)
testq %r15, %r15
movl -0x34(%rbp), %edi
je 0xbad7
movl %r8d, %eax
sarl %eax
movl %eax, -0x94(%rbp)
movq -0x90(%rbp), %rcx
leaq 0x1(%rcx), %rax
movq %rax, -0xd0(%rbp)
leaq (,%rcx,8), %rax
leaq (%rax,%rax,2), %rax
movq %rax, -0x50(%rbp)
leaq (%r12,%rax), %r10
negq %rcx
movq %rcx, -0xc8(%rbp)
movq -0x88(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xc0(%rbp)
movq -0x80(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xb8(%rbp)
movq %r9, -0x60(%rbp)
movq %r10, -0x78(%rbp)
movl $0x1e, -0x38(%rbp)
testl %edi, %edi
jle 0xb898
leaq (%r15,%r15,2), %rax
movq -0x30(%rbp), %rcx
leaq (%rcx,%rax,8), %rax
addq -0xc8(%rbp), %r15
movq $-0x18, %rcx
movq -0xd0(%rbp), %rdx
movq 0x10(%rax,%rcx), %rsi
movq %rsi, 0x10(%r10,%rcx)
movups (%rax,%rcx), %xmm0
movups %xmm0, (%r10,%rcx)
decq %rdx
addq $-0x18, %rcx
cmpq $0x1, %rdx
jg 0xb878
movl 0x10(%r12), %ecx
movl %r8d, %eax
subl %ecx, %eax
jge 0xb8b1
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %r8
jmp 0xbab7
movl %ecx, -0x58(%rbp)
movslq %eax, %rdx
movslq 0x14(%r12), %rax
leaq 0x11604(%rip), %rcx     # 0x1cec7
movb (%rax,%rcx), %al
movq %rdx, -0x70(%rbp)
movb %al, (%r9,%rdx)
testl %edi, %edi
jle 0xb976
movq -0x80(%rbp), %rbx
movq -0x88(%rbp), %r14
movq -0xa0(%rbp), %r13
xorl %r8d, %r8d
leaq (%r8,%r8,2), %rax
movq (%r12,%rax,8), %rsi
movq -0x68(%rbp), %rcx
movq (%rcx,%r8,8), %rdi
movq 0x28(%rdi), %rcx
cmpq (%rcx), %rsi
jae 0xbaef
leaq (%r12,%rax,8), %rax
movq 0x8(%rax), %rdx
movq %r8, -0x48(%rbp)
movq %r8, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %r8
movq -0x88(%rbp), %rax
leaq (%rax,%r8), %rcx
addq -0x80(%rbp), %r8
callq 0x4d57
movl -0x38(%rbp), %eax
xorl %ecx, %ecx
movq (%rbx,%rcx,8), %rdx
subq (%r14,%rcx,8), %rdx
movq %rdx, (%r13,%rcx,8)
jne 0xb94d
btrl %ecx, %eax
movl %eax, -0x38(%rbp)
incq %rcx
cmpq $0x6, %rcx
jne 0xb938
movq -0x48(%rbp), %r8
incq %r8
addq $0x30, %r13
addq $0x30, %r14
addq $0x30, %rbx
cmpq -0x90(%rbp), %r8
jne 0xb8eb
movq -0x70(%rbp), %rcx
addq -0x60(%rbp), %rcx
movq 0x18(%rbp), %rdi
movl 0x20(%rbp), %esi
movl -0x58(%rbp), %ebx
movl %ebx, %edx
movq -0xa0(%rbp), %r8
leaq -0x38(%rbp), %r9
callq *0x10(%rbp)
xorl %eax, %eax
cmpl -0x94(%rbp), %ebx
setne %al
cmpl $0x0, -0x98(%rbp)
leaq 0x3(%rax,%rax), %rcx
movl $0x5, %eax
cmoveq %rax, %rcx
movq %rcx, -0x58(%rbp)
movl $0x1, %ebx
movq -0xb8(%rbp), %r9
movq -0xc0(%rbp), %r11
movl -0x34(%rbp), %edi
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %r8
testl %edi, %edi
setle %dl
movl -0x38(%rbp), %ecx
btl %ebx, %ecx
setae %cl
orb %dl, %cl
jne 0xba9f
leaq (,%r15,8), %rcx
leaq (%rcx,%rcx,2), %rdi
xorl %r13d, %r13d
movq -0x68(%rbp), %r14
movq %r11, -0x30(%rbp)
movq %rdi, -0x40(%rbp)
cmpq %r8, %r15
jne 0xba54
leaq (%r8,%r8), %r12
testq %r8, %r8
movl $0x2, %ecx
cmoveq %rcx, %r12
leaq (,%r12,8), %rcx
leaq (%rcx,%rcx,2), %rsi
movq %rax, %rdi
movq %r15, -0x48(%rbp)
movq %r9, %r15
callq 0x2260
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %r11
movq %r15, %r9
movq -0x48(%rbp), %r15
movq %r12, %r8
movq -0xb0(%rbp), %r12
incq %r15
leaq (%rax,%rdi), %rsi
movq (%r14), %rcx
movq 0x20(%rcx), %rcx
movq (%r11,%r13,2), %rdx
addq (%rcx,%rbx,8), %rdx
movq %rdx, (%r13,%rsi)
movq (%r9,%r13,2), %rdx
addq (%rcx,%rbx,8), %rdx
movq %rdx, 0x8(%r13,%rsi)
movl 0x10(%r12), %ecx
incl %ecx
movl %ecx, 0x10(%r13,%rsi)
movl %ebx, 0x14(%r13,%rsi)
addq $0x8, %r14
addq $0x18, %r13
cmpq %r13, -0x50(%rbp)
jne 0xba0b
incq %rbx
addq $0x8, %r11
addq $0x8, %r9
cmpq -0x58(%rbp), %rbx
movl -0x34(%rbp), %edi
jne 0xb9da
movq %r8, -0x40(%rbp)
movq %rax, -0x30(%rbp)
testq %r15, %r15
movq -0xa8(%rbp), %r8
movq -0x60(%rbp), %r9
movq -0x78(%rbp), %r10
jne 0xb84c
movq -0x30(%rbp), %rdi
callq 0x2040
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x111c8(%rip), %rdi     # 0x1ccbe
leaq 0x1116b(%rip), %rsi     # 0x1cc68
leaq 0x1116a(%rip), %rcx     # 0x1cc6e
movl $0x45, %edx
callq 0x2120
leaq 0x1113d(%rip), %rdi     # 0x1cc52
leaq 0x1114c(%rip), %rsi     # 0x1cc68
leaq 0x1114b(%rip), %rcx     # 0x1cc6e
movl $0x26, %edx
callq 0x2120