// File: /workspace/github_c_makefile_star2_O0/lh3[P]fermi2/profk.c
// Function: main_kprof
int main_kprof(int argc, char *argv[])
{
	ketopt_t o = KETOPT_INIT;
	int c, min_ext = 61, sat_occ = 0;
	rld_t *e;
	kseq_t *ks;
	gzFile fp;

	while ((c = ketopt(&o, argc, argv, 1, "k:c:", 0)) >= 0) {
		if (c == 'k') min_ext = atoi(o.arg);
		else if (c == 'c') sat_occ = atoi(o.arg);
	}
	if (argc - o.ind < 2) {
		fprintf(stderr, "Usage: fermi2 kprof [options] <in.fmd> <in.fa>\n");
		fprintf(stderr, "Options:\n");
		fprintf(stderr, "  -k INT    min k-mer size [%d]\n", min_ext);
		fprintf(stderr, "  -c INT    occurrence saturation [%d]\n", sat_occ);
		return 1;
	}

	fp = gzopen(argv[o.ind+1], "r");
	if (fp == 0) {
		fprintf(stderr, "[E::%s] failed to open the sequence file\n", __func__);
		return 1;
	}
	ks = kseq_init(fp);
	e = rld_restore(argv[o.ind]);

	while (kseq_read(ks) >= 0) {
		int i, n_a;
		fm_icnt_t *a;
		a = fm_kprof(e, ks->seq.s, min_ext, sat_occ, &n_a);
		for (i = 0; i < n_a; ++i)
			fprintf(stdout, "%s\t%d\t%d\t%d\n", ks->name.s, a[i].st, a[i].en, a[i].occ);
		free(a);
	}
	rld_destroy(e);
	kseq_destroy(ks);
	gzclose(fp);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x963a(%rip), %rax      # 0x332a0
movq %rax, -0x30(%rbp)
movq 0x9637(%rip), %rax      # 0x332a8
movq %rax, -0x28(%rbp)
movq 0x9634(%rip), %rax      # 0x332b0
movq %rax, -0x20(%rbp)
movq 0x9631(%rip), %rax      # 0x332b8
movq %rax, -0x18(%rbp)
movl $0x3d, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0x30(%rbp), %rdi
movl $0x1, %ecx
leaq 0x44b0(%rip), %r8       # 0x2e160
xorl %eax, %eax
movl %eax, %r9d
callq 0x29ec0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jl 0x29cec
cmpl $0x6b, -0x34(%rbp)
jne 0x29cd6
movq -0x28(%rbp), %rdi
callq 0x2310
movl %eax, -0x38(%rbp)
jmp 0x29cea
cmpl $0x63, -0x34(%rbp)
jne 0x29ce8
movq -0x28(%rbp), %rdi
callq 0x2310
movl %eax, -0x3c(%rbp)
jmp 0x29cea
jmp 0x29c99
movl -0x8(%rbp), %eax
subl -0x30(%rbp), %eax
cmpl $0x2, %eax
jge 0x29d69
movq 0x92fa(%rip), %rax      # 0x32ff8
movq (%rax), %rdi
leaq 0x445d(%rip), %rsi      # 0x2e165
movb $0x0, %al
callq 0x21d0
movq 0x92e2(%rip), %rax      # 0x32ff8
movq (%rax), %rdi
leaq 0x4039(%rip), %rsi      # 0x2dd59
movb $0x0, %al
callq 0x21d0
movq 0x92ca(%rip), %rax      # 0x32ff8
movq (%rax), %rdi
movl -0x38(%rbp), %edx
leaq 0x445a(%rip), %rsi      # 0x2e195
movb $0x0, %al
callq 0x21d0
movq 0x92af(%rip), %rax      # 0x32ff8
movq (%rax), %rdi
movl -0x3c(%rbp), %edx
leaq 0x4460(%rip), %rsi      # 0x2e1b6
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x29eb0
movq -0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x311a(%rip), %rsi      # 0x2ce9b
callq 0x22c0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x29dbc
movq 0x9260(%rip), %rax      # 0x32ff8
movq (%rax), %rdi
leaq 0x41c5(%rip), %rsi      # 0x2df67
leaq 0x4435(%rip), %rdx      # 0x2e1de
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x29eb0
movq -0x58(%rbp), %rdi
callq 0x2a4f0
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x37c0
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rdi
callq 0x2a530
cmpl $0x0, %eax
jl 0x29e8e
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0x28(%rax), %rsi
movl -0x38(%rbp), %edx
movl -0x3c(%rbp), %ecx
leaq -0x60(%rbp), %r8
callq 0x29a90
movq %rax, -0x68(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0x29e80
movq 0x919b(%rip), %rax      # 0x32fc0
movq (%rax), %rdi
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x68(%rbp), %rax
movslq -0x5c(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x68(%rbp), %rax
movslq -0x5c(%rbp), %rsi
imulq $0xc, %rsi, %rsi
addq %rsi, %rax
movl 0x4(%rax), %r8d
movq -0x68(%rbp), %rax
movslq -0x5c(%rbp), %rsi
imulq $0xc, %rsi, %rsi
addq %rsi, %rax
movl 0x8(%rax), %r9d
leaq 0x437b(%rip), %rsi      # 0x2e1e9
movb $0x0, %al
callq 0x21d0
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x29e16
movq -0x68(%rbp), %rdi
callq 0x2040
jmp 0x29dde
movq -0x48(%rbp), %rdi
callq 0x28f0
movq -0x50(%rbp), %rdi
callq 0x2a8e0
movq -0x58(%rbp), %rdi
callq 0x2030
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)