// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x1c(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2160
movl $0x33, -0x38(%rbp)
movl $0x1, -0x34(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x1c75e(%rip), %rdx     # 0x2cd10
callq 0x2300
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
jl 0x1063d
cmpl $0x6b, -0x18(%rbp)
jne 0x105d9
movq 0x22a0c(%rip), %rax     # 0x32fd8
movq (%rax), %rdi
callq 0x2310
movl %eax, -0x38(%rbp)
jmp 0x10638
cmpl $0x6f, -0x18(%rbp)
jne 0x105f3
movq 0x229f2(%rip), %rax     # 0x32fd8
movq (%rax), %rdi
callq 0x2310
movl %eax, -0x34(%rbp)
jmp 0x10636
cmpl $0x74, -0x18(%rbp)
jne 0x1060d
movq 0x229d8(%rip), %rax     # 0x32fd8
movq (%rax), %rdi
callq 0x2310
movl %eax, -0x1c(%rbp)
jmp 0x10634
cmpl $0x32, -0x18(%rbp)
jne 0x1061c
movl $0x1, -0x30(%rbp)
jmp 0x10632
cmpl $0x62, -0x18(%rbp)
jne 0x10630
movl $0x1, -0x30(%rbp)
movl $0x1, -0x2c(%rbp)
jmp 0x10632
jmp 0x10634
jmp 0x10636
jmp 0x10638
jmp 0x105a4
cmpl $0x0, -0x2c(%rbp)
je 0x10650
cmpl $0x2, -0x34(%rbp)
jge 0x10650
movl $0x2, -0x34(%rbp)
movq 0x22979(%rip), %rax     # 0x32fd0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jne 0x10737
movq 0x2298f(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x1c391(%rip), %rsi     # 0x2ca04
movb $0x0, %al
callq 0x21d0
movq 0x22977(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x1c68e(%rip), %rsi     # 0x2cd19
movb $0x0, %al
callq 0x21d0
movq 0x2295f(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
movl -0x38(%rbp), %edx
leaq 0x1c69e(%rip), %rsi     # 0x2cd44
movb $0x0, %al
callq 0x21d0
movq 0x22944(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
movl -0x34(%rbp), %edx
leaq 0x1c6ab(%rip), %rsi     # 0x2cd6c
movb $0x0, %al
callq 0x21d0
movq 0x22929(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
movl -0x1c(%rbp), %edx
leaq 0x1c6b9(%rip), %rsi     # 0x2cd95
movb $0x0, %al
callq 0x21d0
movq 0x2290e(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x1c6ce(%rip), %rsi     # 0x2cdc2
movb $0x0, %al
callq 0x21d0
movq 0x228f6(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x1c6f5(%rip), %rsi     # 0x2ce01
movb $0x0, %al
callq 0x21d0
movq 0x228de(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x1c2e0(%rip), %rsi     # 0x2ca04
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x10864
movslq -0x1c(%rbp), %rdi
movl $0x10, %esi
callq 0x21a0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x2287c(%rip), %rcx     # 0x32fd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x37c0
movq %rax, -0x48(%rbp)
movq %rax, -0x40(%rbp)
movl -0x38(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x107b0
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
cmpl $0x2, 0x22a61(%rip)     # 0x331e4
jl 0x107ae
movq 0x2286c(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
movl -0x38(%rbp), %ecx
subl $0x1, %ecx
movl -0x38(%rbp), %r8d
leaq 0x1c68e(%rip), %rsi     # 0x2ce2e
leaq 0x1c6b5(%rip), %rdx     # 0x2ce5c
movb $0x0, %al
callq 0x21d0
jmp 0x107b0
cmpl $0x0, -0x30(%rbp)
je 0x107e8
movl -0x38(%rbp), %ecx
movl -0x1c(%rbp), %r8d
movl $0x1, %edx
leaq -0x48(%rbp), %rsi
xorl %eax, %eax
movl %eax, %r9d
leaq 0x9e(%rip), %r10        # 0x10870
leaq -0x40(%rbp), %rax
movl %edx, %edi
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x10390
jmp 0x10819
movl -0x38(%rbp), %ecx
movl -0x1c(%rbp), %r8d
movl $0x1, %edx
leaq -0x48(%rbp), %rsi
leaq 0x321(%rip), %r9        # 0x10b20
xorl %eax, %eax
leaq -0x40(%rbp), %rax
movl %edx, %edi
movq $0x0, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x10390
movq -0x48(%rbp), %rdi
callq 0x28f0
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x10854
movq -0x28(%rbp), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x2040
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x10829
movq -0x28(%rbp), %rdi
callq 0x2040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)