// File: /workspace/github_c_makefile_star2_O3/lh3[P]fermi2/dfs.c
// Function: main_count
int main_count(int argc, char *argv[])
{
	int i, c, n_threads = 1;
	dfs_count_t d;
	rld_t *e;
	memset(&d, 0, sizeof(dfs_count_t));
	d.len = 51, d.min_occ = 1;
	while ((c = getopt(argc, argv, "2bk:o:t:")) >= 0) {
		if (c == 'k') d.len = atoi(optarg);
		else if (c == 'o') d.min_occ = atoi(optarg);
		else if (c == 't') n_threads = atoi(optarg);
		else if (c == '2') d.bidir = 1;
		else if (c == 'b') d.bifur_only = d.bidir = 1;
	}
	if (d.bifur_only && d.min_occ < 2) d.min_occ = 2; // in the -b mode, we need to see at least 2 k-mers
	if (optind == argc) {
		fprintf(stderr, "\n");
		fprintf(stderr, "Usage:   fermi2 count [options] <in.fmd>\n\n");
		fprintf(stderr, "Options: -k INT      k-mer length [%d]\n", d.len);
		fprintf(stderr, "         -o INT      min occurence [%d]\n", d.min_occ);
		fprintf(stderr, "         -t INT      number of threads [%d]\n", n_threads);
		fprintf(stderr, "         -b          only print bifurcating k-mers (force -2)\n");
		fprintf(stderr, "         -2          bidirectional counting\n");
		fprintf(stderr, "\n");
		return 1;
	}
	d.str = calloc(n_threads, sizeof(kstring_t));
	d.e = e = rld_restore(argv[optind]);
	if (!(d.len&1)) {
		++d.len;
		if (dfs_verbose >= 2)
			fprintf(stderr, "[W::%s] %d is an even number; change k to %d\n", __func__, d.len-1, d.len);
	}
	if (d.bidir) fm_dfs(1, &e, 1, d.len, n_threads, 0, dfs_count2, &d);
	else fm_dfs(1, &e, 1, d.len, n_threads, dfs_count, 0, &d);
	rld_destroy(e);
	for (i = 0; i < n_threads; ++i) free(d.str[i].s);
	free(d.str);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movl %edi, %r15d
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
leaq 0x1181e(%rip), %rdx     # 0x1dee0
callq 0x22f0
testl %eax, %eax
js 0xc7ab
movl $0x33, 0x14(%rsp)
movl $0x1, 0x10(%rsp)
xorl %ebx, %ebx
leaq 0x117f8(%rip), %r13     # 0x1dee0
movq 0x188e9(%rip), %rbp     # 0x24fd8
xorl %r12d, %r12d
movl $0x1, 0xc(%rsp)
cmpl $0x6a, %eax
jle 0xc71d
cmpl $0x74, %eax
je 0xc734
cmpl $0x6f, %eax
je 0xc743
cmpl $0x6b, %eax
jne 0xc750
movq (%rbp), %rdi
callq 0x2300
movl %eax, 0x14(%rsp)
jmp 0xc750
cmpl $0x32, %eax
je 0xc72c
cmpl $0x62, %eax
jne 0xc750
movl $0x1, %ebx
movl $0x1, %r12d
jmp 0xc750
movq (%rbp), %rdi
callq 0x2300
movl %eax, 0x10(%rsp)
jmp 0xc750
movq (%rbp), %rdi
callq 0x2300
movl %eax, 0xc(%rsp)
movl %r15d, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x22f0
testl %eax, %eax
jns 0xc6fa
movl %r12d, 0x30(%rsp)
movl %ebx, 0x34(%rsp)
testl %ebx, %ebx
setne %al
testl %r12d, %r12d
sete %bl
movl 0xc(%rsp), %ecx
movl %ecx, 0x2c(%rsp)
movl 0x14(%rsp), %r13d
movl %r13d, 0x28(%rsp)
cmpl $0x2, %ecx
setl %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xc7a5
movl $0x2, 0x2c(%rsp)
movl $0x2, 0xc(%rsp)
movl 0x10(%rsp), %ebp
jmp 0xc7cf
movabsq $0x100000033, %rax      # imm = 0x100000033
movq %rax, 0x28(%rsp)
movb $0x1, %bl
movl $0x33, %r13d
movl $0x1, %ebp
movl $0x1, 0xc(%rsp)
movq 0x187fa(%rip), %rax     # 0x24fd0
movslq (%rax), %r12
cmpl %r15d, %r12d
je 0xc8f7
movslq %ebp, %rdi
movl $0x10, %esi
callq 0x2190
movq %rax, 0x38(%rsp)
movq (%r14,%r12,8), %rdi
callq 0x4119
movq %rax, 0x18(%rsp)
movq %rax, 0x20(%rsp)
testb $0x1, %r13b
je 0xc90c
movl %r13d, %eax
sarl %eax
cmpl $0x5, %eax
movl $0x5, %esi
cmovll %eax, %esi
leal (%rsi,%rsi), %ecx
movl $0x1, %r8d
movl $0x1, %eax
shll %cl, %eax
cmpl %ebp, %eax
movl %ebp, %edi
cmovll %eax, %edi
leaq 0x48(%rsp), %rdx
testb %bl, %bl
je 0xc86b
movl %r8d, (%rdx)
leaq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rdx)
leaq 0x20(%rsp), %rcx
movq %rcx, 0x18(%rdx)
leaq 0x460(%rip), %rcx       # 0xccbd
movq %rcx, 0x20(%rdx)
movq $0x0, 0x28(%rdx)
jmp 0xc893
movl %r8d, (%rdx)
leaq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rdx)
leaq 0x20(%rsp), %rcx
movq %rcx, 0x18(%rdx)
movq $0x0, 0x20(%rdx)
leaq 0xb6(%rip), %rcx        # 0xc945
movq %rcx, 0x28(%rdx)
movl %r13d, 0x4(%rdx)
movl %r8d, 0xc(%rdx)
movl %esi, 0x8(%rdx)
leaq -0x27d(%rip), %rsi      # 0xc628
movq %rax, %rcx
callq 0x340c
movq 0x18(%rsp), %rdi
callq 0x36d4
testl %ebp, %ebp
jle 0xc8dc
movl %ebp, %ebx
shlq $0x4, %rbx
xorl %r14d, %r14d
movq 0x38(%rsp), %rax
movq 0x8(%rax,%r14), %rdi
callq 0x2040
addq $0x10, %r14
cmpq %r14, %rbx
jne 0xc8c4
movq 0x38(%rsp), %rdi
callq 0x2040
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r13d, %edi
movl 0xc(%rsp), %esi
movl %ebp, %edx
callq 0x2bcc
movl $0x1, %eax
jmp 0xc8e8
movl %r13d, %r14d
orl $0x1, %r14d
movl %r14d, 0x28(%rsp)
movq 0x186d9(%rip), %rax     # 0x24ff8
movq (%rax), %rdi
leaq 0x116d5(%rip), %rsi     # 0x1dffe
leaq 0x116fc(%rip), %rdx     # 0x1e02c
movl %r13d, %ecx
movl %r14d, %r8d
xorl %eax, %eax
callq 0x21c0
movl %r14d, %r13d
jmp 0xc811