// File: /workspace/github_c_makefile_star2_O0/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
subq $0x110, %rsp            # imm = 0x110
movl 0x20(%rbp), %eax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
leaq -0xd8(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2160
movl -0x18(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xf48f
cmpl $0x0, -0x14(%rbp)
jne 0xf491
jmp 0xf4b0
leaq 0x1d762(%rip), %rdi     # 0x2cbfa
leaq 0x1d771(%rip), %rsi     # 0x2cc10
movl $0x26, %edx
leaq 0x1d76b(%rip), %rcx     # 0x2cc16
callq 0x2140
movslq -0x4(%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq 0xf(,%rax,8), %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x50(%rbp)
movslq -0x4(%rbp), %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x38(%rbp)
movslq -0x4(%rbp), %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x40(%rbp)
movslq -0x4(%rbp), %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x48(%rbp)
movslq -0x18(%rbp), %rcx
addq $0x11, %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
movq -0xd0(%rbp), %rax
movl -0x4(%rbp), %ecx
imull -0x18(%rbp), %ecx
imull $0x6, %ecx, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jae 0xf62c
movl -0x4(%rbp), %eax
imull -0x18(%rbp), %eax
imull $0x6, %eax, %eax
cltq
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
shrq %rax
orq -0xd0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
shrq $0x2, %rax
orq -0xd0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
shrq $0x4, %rax
orq -0xd0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
shrq $0x8, %rax
orq -0xd0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
shrq $0x10, %rax
orq -0xd0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rdi
imulq $0x18, -0xd0(%rbp), %rsi
callq 0x2270
movq %rax, -0xc8(%rbp)
jmp 0xf62e
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0xf7fc
jmp 0xf643
movq -0xd8(%rbp), %rax
cmpq -0xd0(%rbp), %rax
jne 0xf6a7
cmpq $0x0, -0xd0(%rbp)
je 0xf670
movq -0xd0(%rbp), %rax
shlq %rax
movq %rax, -0xf8(%rbp)
jmp 0xf67e
movl $0x2, %eax
movq %rax, -0xf8(%rbp)
jmp 0xf67e
movq -0xf8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rdi
imulq $0x18, -0xd0(%rbp), %rsi
callq 0x2270
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq -0xd8(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0xd8(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rax), %rax
movq (%rax), %rcx
movq -0xe0(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xf7c2
movl -0x20(%rbp), %eax
movl -0x28(%rbp), %ecx
shll %ecx
sarl %cl, %eax
andl $0x3, %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0xe0(%rbp), %rax
movq (%rax), %rsi
movq -0xe0(%rbp), %rax
movq 0x8(%rax), %rdx
leaq -0x90(%rbp), %rcx
leaq -0xc0(%rbp), %r8
callq 0x45e0
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movslq -0x2c(%rbp), %rax
addq -0x90(%rbp,%rax,8), %rcx
movq -0xe0(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movslq -0x2c(%rbp), %rax
addq -0xc0(%rbp,%rax,8), %rcx
movq -0xe0(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xf704
movl -0x1c(%rbp), %ecx
movq -0xe0(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x20(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
shll %ecx
sarl %cl, %eax
movl %eax, %ecx
andl $0x3, %ecx
addl $0x1, %ecx
movq -0xe0(%rbp), %rax
movl %ecx, 0x14(%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf635
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xf843
movl -0x20(%rbp), %eax
movl -0x28(%rbp), %ecx
shll %ecx
sarl %cl, %eax
andl $0x3, %eax
movslq %eax, %rcx
leaq 0x1d2fd(%rip), %rax     # 0x2cb1f
movb (%rax,%rcx), %dl
movq -0x60(%rbp), %rax
movl -0x18(%rbp), %ecx
subl -0x28(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xf803
movq -0x60(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
cmpq $0x0, -0xd8(%rbp)
je 0xfc53
movl $0x1e, -0xe8(%rbp)
movl -0x4(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0xf8c6
movq -0x50(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0xc8(%rbp), %rcx
movq -0xd8(%rbp), %rdx
addq $-0x1, %rdx
movq %rdx, -0xd8(%rbp)
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf870
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
cmpl -0x18(%rbp), %eax
jle 0xf8d7
jmp 0xf84f
movq -0x50(%rbp), %rax
movslq 0x14(%rax), %rcx
leaq 0x1d5bf(%rip), %rax     # 0x2cea5
movb (%rax,%rcx), %dl
movq -0x60(%rbp), %rax
movl -0x18(%rbp), %ecx
movq -0x50(%rbp), %rsi
subl 0x10(%rsi), %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0xfa55
movq -0x50(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x28(%rcx), %rcx
cmpq (%rcx), %rax
jae 0xf939
jmp 0xf958
leaq 0x1d326(%rip), %rdi     # 0x2cc66
leaq 0x1d2c9(%rip), %rsi     # 0x2cc10
movl $0x45, %edx
leaq 0x1d2c3(%rip), %rcx     # 0x2cc16
callq 0x2140
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x50(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movq -0x50(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
movq -0x40(%rbp), %rcx
movslq -0x24(%rbp), %rax
imulq $0x30, %rax, %rax
addq %rax, %rcx
movq -0x48(%rbp), %r8
movslq -0x24(%rbp), %rax
imulq $0x30, %rax, %rax
addq %rax, %r8
callq 0x45e0
movl $0x0, -0x2c(%rbp)
cmpl $0x6, -0x2c(%rbp)
jge 0xfa45
movq -0x48(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x40(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movslq -0x2c(%rbp), %rcx
subq (%rax,%rcx,8), %rdx
movq -0x38(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movslq -0x2c(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0xfa35
movl -0x2c(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
xorl $-0x1, %eax
andl -0xe8(%rbp), %eax
movl %eax, -0xe8(%rbp)
jmp 0xfa37
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xf9b3
jmp 0xfa47
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf904
movq 0x10(%rbp), %rax
movq 0x18(%rbp), %rdi
movl 0x20(%rbp), %esi
movq -0x50(%rbp), %rcx
movl 0x10(%rcx), %edx
movq -0x60(%rbp), %rcx
movl -0x18(%rbp), %r8d
movq -0x50(%rbp), %r9
subl 0x10(%r9), %r8d
movslq %r8d, %r8
addq %r8, %rcx
movq -0x38(%rbp), %r8
leaq -0xe8(%rbp), %r9
callq *%rax
movq -0x50(%rbp), %rax
movl 0x10(%rax), %ecx
movl -0x18(%rbp), %edx
sarl %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0xf9(%rbp)
jne 0xfaaf
cmpl $0x0, -0x14(%rbp)
setne %al
movb %al, -0xf9(%rbp)
movb -0xf9(%rbp), %dl
movl $0x4, %eax
movl $0x2, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0xe4(%rbp)
movl $0x1, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0xe4(%rbp), %eax
jg 0xfc4e
movl -0xe8(%rbp), %eax
movl -0x2c(%rbp), %ecx
sarl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xfaf9
jmp 0xfc40
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0xfc3e
jmp 0xfb0e
movq -0xd8(%rbp), %rax
cmpq -0xd0(%rbp), %rax
jne 0xfb72
cmpq $0x0, -0xd0(%rbp)
je 0xfb3b
movq -0xd0(%rbp), %rax
shlq %rax
movq %rax, -0x108(%rbp)
jmp 0xfb49
movl $0x2, %eax
movq %rax, -0x108(%rbp)
jmp 0xfb49
movq -0x108(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rdi
imulq $0x18, -0xd0(%rbp), %rsi
callq 0x2270
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq -0xd8(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0xd8(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xf0(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x40(%rbp), %rax
movslq -0x24(%rbp), %rdx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movslq -0x2c(%rbp), %rdx
addq (%rax,%rdx,8), %rcx
movq -0xf0(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x48(%rbp), %rax
movslq -0x24(%rbp), %rdx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movslq -0x2c(%rbp), %rdx
addq (%rax,%rdx,8), %rcx
movq -0xf0(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movq -0xf0(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x2c(%rbp), %ecx
movq -0xf0(%rbp), %rax
movl %ecx, 0x14(%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xfb00
jmp 0xfc40
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xfad2
jmp 0xf84f
movq -0xc8(%rbp), %rdi
callq 0x2040
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)