// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r9
movl %edi, %r10d
cmpl $0x2, %edi
jl 0x1b666
leal -0x1(%r10), %eax
movl %eax, 0x30(%rsp)
movl %r10d, %edx
negl %edx
movl $0x1, %r15d
movq $0x0, 0x38(%rsp)
movl $0x3d, 0xc(%rsp)
movabsq $0x100000000, %rbp      # imm = 0x100000000
xorl %eax, %eax
movl $0x0, (%rsp)
movq %rdx, 0x28(%rsp)
movl %eax, %r11d
movq %r15, 0x20(%rsp)
movslq %r15d, %rbx
leal (%r11,%r10), %ecx
subl %ebx, %ecx
movl %ebx, %eax
addq %rax, %rdx
movq %rbx, %r15
shlq $0x20, %r15
leaq (%r9,%rbx,8), %rdi
movq %rdi, %r14
xorl %r13d, %r13d
movl %r11d, %r12d
movq %rbx, %rsi
movq (%rdi,%r13,8), %r8
cmpb $0x2d, (%r8)
jne 0x1b42e
cmpb $0x0, 0x1(%r8)
jne 0x1b44b
incq %rsi
incl %r12d
incq %r13
addq %rbp, %r15
addq $0x8, %r14
movl %edx, %r8d
addl %r13d, %r8d
jne 0x1b41d
jmp 0x1b680
sarq $0x1d, %r15
movq (%r9,%r15), %rdi
cmpb $0x2d, (%rdi)
jne 0x1bbae
leaq (%rax,%r13), %r8
movl %r11d, %ecx
leaq (%rcx,%r13), %rsi
movzbl 0x1(%rdi), %edx
cmpl $0x2d, %edx
movq %rsi, 0x10(%rsp)
je 0x1b509
testl %edx, %edx
je 0x1bbc0
movq %r8, 0x68(%rsp)
movq %r11, 0x40(%rsp)
movq %r10, 0x48(%rsp)
movq %r9, 0x70(%rsp)
movl (%rsp), %eax
cmpl $0x1, %eax
adcl $0x0, %eax
movl %eax, (%rsp)
cltq
movq %rdi, 0x50(%rsp)
movsbl (%rdi,%rax), %esi
incq %rax
movq %rax, 0x60(%rsp)
movl $0x5, %edx
leaq 0x3e5a(%rip), %rdi      # 0x1f31a
movl %esi, 0x18(%rsp)
callq 0x2180
testq %rax, %rax
je 0x1b51a
cmpb $0x3a, 0x1(%rax)
movq 0x70(%rsp), %r9
movq 0x68(%rsp), %r8
jne 0x1b53a
movq 0x50(%rsp), %rdi
movq 0x60(%rsp), %rax
cmpb $0x0, (%rdi,%rax)
movq 0x48(%rsp), %r10
movq 0x40(%rsp), %r11
movq 0x10(%rsp), %rsi
movl 0x18(%rsp), %edx
je 0x1b571
addq %rax, %rdi
jmp 0x1b594
cmpb $0x0, 0x2(%rdi)
je 0x1bbd3
movl $0x3f, %edx
jmp 0x1b592
movl $0x3f, %edx
movq 0x70(%rsp), %r9
movq 0x48(%rsp), %r10
movq 0x40(%rsp), %r11
movq 0x10(%rsp), %rsi
movq 0x68(%rsp), %r8
jmp 0x1b54d
movq 0x48(%rsp), %r10
movq 0x40(%rsp), %r11
movq 0x10(%rsp), %rsi
movl 0x18(%rsp), %edx
cmpl $-0x2, (%rsp)
jle 0x1b592
movq (%r9,%r15), %rax
movq 0x60(%rsp), %rdi
movl %edi, %ecx
cmpb $0x0, (%rax,%rcx)
je 0x1b592
movl %edi, (%rsp)
movl %r8d, %r15d
xorl %edi, %edi
jmp 0x1b5f4
cmpl %r8d, 0x30(%rsp)
jle 0x1b58d
movq 0x20(%rsp), %rax
leal (%rax,%r13), %r8d
incl %r8d
movslq %r8d, %rax
movq (%r9,%rax,8), %rdi
jmp 0x1b594
movl $0x3a, %edx
xorl %edi, %edi
leal 0x1(%r8), %r15d
movl $0x0, (%rsp)
testl %esi, %esi
jle 0x1b5f4
movl %edx, 0x18(%rsp)
movq %rdi, 0x50(%rsp)
addq %r13, %rbx
movl %esi, %eax
movslq %r8d, %rcx
movl %r12d, %edx
negq %rdx
movq (%r9,%rbx,8), %rsi
xorl %edi, %edi
movq -0x8(%r14,%rdi,8), %r8
movq %r8, (%r14,%rdi,8)
decq %rdi
cmpq %rdi, %rdx
jne 0x1b5c0
movq %rbx, %rdi
subq %rax, %rdi
movq %rsi, (%r9,%rdi,8)
leaq 0x1(%rbx), %rsi
addq $0x8, %r14
cmpq %rcx, %rbx
movq %rsi, %rbx
jl 0x1b5ba
movq 0x50(%rsp), %rdi
movl 0x18(%rsp), %edx
testl %edx, %edx
js 0x1bbb2
cmpl $0x63, %edx
je 0x1b629
cmpl $0x6b, %edx
jne 0x1b64b
movq %r9, %rbx
movq %r10, %r14
movq %r15, %r12
movq %r11, %r15
callq 0x2300
movq %r15, %r11
movq %r12, %r15
movq %r14, %r10
movq %rbx, %r9
movl %eax, 0xc(%rsp)
jmp 0x1b64b
movq %r9, %rbx
movq %r10, %r14
movq %r15, %r12
movq %r11, %r15
callq 0x2300
movq %r15, %r11
movq %r12, %r15
movq %r14, %r10
movq %rbx, %r9
movq %rax, 0x38(%rsp)
movq 0x28(%rsp), %rdx
movq 0x10(%rsp), %rax
cmpl %r10d, %r15d
jl 0x1b3f0
movl %r15d, %eax
jmp 0x1bbc8
movl $0x1, %eax
movl $0x3d, 0xc(%rsp)
movq $0x0, 0x38(%rsp)
xorl %ecx, %ecx
jmp 0x1b683
movl %r10d, %eax
subl %ecx, %eax
subl %eax, %r10d
cmpl $0x1, %r10d
jle 0x1bb92
movslq %eax, %rbx
movq 0x8(%r9,%rbx,8), %rdi
leaq 0x1d1b(%rip), %rsi      # 0x1d3bc
movq %r9, %r15
callq 0x22b0
testq %rax, %rax
je 0x1bba2
movq %rax, %r14
movl $0x1, %edi
movl $0x50, %esi
callq 0x2190
movq %rax, %rbp
movl $0x1, %edi
movl $0x20, %esi
callq 0x2190
movq %rax, %r12
movq %r14, 0x30(%rsp)
movq %r14, 0x10(%rax)
movl $0x10000, 0x8(%rax)     # imm = 0x10000
movl $0x4000, %edi           # imm = 0x4000
callq 0x2220
movq %rax, 0x18(%r12)
movq %r12, 0x48(%rbp)
movq (%r15,%rbx,8), %rdi
callq 0x4119
movq %rax, %r13
leaq 0x30(%rbp), %r15
leaq 0x20(%rbp), %r14
leaq 0x10(%rbp), %rax
movq %rax, 0x18(%rsp)
xorl %eax, %eax
movq %r13, 0x28(%rsp)
movq %r14, 0x20(%rsp)
movq %r15, 0x10(%rsp)
movq %rbp, (%rsp)
testl %eax, %eax
jne 0x1b7bb
movl 0x8(%r12), %edx
movl (%r12), %ecx
movl 0x4(%r12), %eax
testb $0x3, %dl
je 0x1b751
cmpl %eax, %ecx
jge 0x1bb0e
movq 0x18(%r12), %rsi
cmpl %eax, %ecx
jl 0x1b79d
movl $0x0, (%r12)
movq 0x10(%r12), %rdi
sarl $0x2, %edx
callq 0x21b0
movl %eax, 0x4(%r12)
movl 0x8(%r12), %edx
movl %edx, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jge 0x1b78c
andl $-0x4, %edx
incl %edx
movl %edx, 0x8(%r12)
testl %eax, %eax
je 0x1bb0e
movl (%r12), %ecx
movq 0x18(%r12), %rsi
movslq %ecx, %rdi
incl %ecx
movl %ecx, (%r12)
movzbl (%rsi,%rdi), %esi
movl %esi, 0x8(%rsp)
cmpl $0x40, %esi
je 0x1b7b8
cmpl $0x3e, %esi
jne 0x1b744
movl %esi, 0x40(%rbp)
xorl %eax, %eax
movl %eax, 0x30(%rbp)
movl %eax, 0x20(%rbp)
movl %eax, 0x10(%rbp)
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rdx
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x1bc22
testl %eax, %eax
js 0x1bb7f
cmpl $0xa, 0x8(%rsp)
je 0x1b801
movq %r12, %rdi
movl $0x2, %esi
movq 0x18(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1bc22
movq (%rsp), %rbp
cmpq $0x0, 0x28(%rbp)
jne 0x1b821
movl $0x100, 0x24(%rbp)      # imm = 0x100
movl $0x100, %edi            # imm = 0x100
callq 0x2220
movq %rax, 0x28(%rbp)
movl 0x8(%r12), %edx
testb $0x3, %dl
sete %sil
movl (%r12), %ecx
movl 0x4(%r12), %eax
cmpl %eax, %ecx
setl %dil
orb %dil, %sil
testb $0x1, %sil
movq 0x20(%rsp), %r14
je 0x1b922
movq 0x18(%r12), %rsi
testb $0x1, %dil
jne 0x1b89c
movl $0x0, (%r12)
movq 0x10(%r12), %rdi
sarl $0x2, %edx
callq 0x21b0
movl %eax, 0x4(%r12)
movl 0x8(%r12), %edx
movl %edx, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jge 0x1b88b
andl $-0x4, %edx
incl %edx
movl %edx, 0x8(%r12)
testl %eax, %eax
je 0x1b922
movl (%r12), %ecx
movq 0x18(%r12), %rsi
movslq %ecx, %rdi
incl %ecx
movl %ecx, (%r12)
movb (%rsi,%rdi), %sil
movzbl %sil, %edi
movl %edi, 0x8(%rsp)
cmpl $0x2a, %edi
jg 0x1b8bd
cmpl $0xa, %edi
je 0x1b90b
jmp 0x1b8d4
cmpl $0x2b, %edi
je 0x1b92a
cmpl $0x3e, %edi
je 0x1bb06
cmpl $0x40, %edi
je 0x1bb06
movq 0x28(%rbp), %rax
movl 0x20(%rbp), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x20(%rbp)
movb %sil, (%rax,%rcx)
movq %r12, %rdi
movl $0x2, %esi
movq %r14, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x1bc22
movl 0x8(%r12), %edx
movl (%r12), %ecx
movl 0x4(%r12), %eax
cmpl %eax, %ecx
setl %dil
testb $0x3, %dl
je 0x1b84e
cmpl %eax, %ecx
jl 0x1b84e
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
movq %r13, %rbx
movq %rbp, %r13
movl 0x20(%rbp), %ebp
movl 0x24(%r13), %r14d
leal 0x1(%rbp), %ecx
movq 0x28(%r13), %rax
cmpl %r14d, %ecx
jb 0x1b97e
movl %ecx, %edx
shrl %edx
orl %ecx, %edx
movl %edx, %ecx
shrl $0x2, %ecx
orl %edx, %ecx
movl %ecx, %edx
shrl $0x4, %edx
orl %ecx, %edx
movl %edx, %ecx
shrl $0x8, %ecx
orl %edx, %ecx
movl %ecx, %r14d
shrl $0x10, %r14d
orl %ecx, %r14d
incl %r14d
movl %r14d, 0x24(%r13)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2260
movq %rax, 0x28(%r13)
movq %rbx, %r13
movb $0x0, (%rax,%rbp)
cmpl $0x2b, 0x8(%rsp)
jne 0x1ba69
movq (%rsp), %rbp
cmpl %r14d, 0x34(%rbp)
jae 0x1b9ae
movl %r14d, 0x34(%rbp)
movq 0x38(%rbp), %rdi
movl %r14d, %esi
callq 0x2260
movq %rax, 0x38(%rbp)
movl 0x8(%r12), %edx
movl (%r12), %ecx
movl 0x4(%r12), %eax
movq 0x20(%rsp), %r14
testb $0x3, %dl
je 0x1b9ce
cmpl %eax, %ecx
jge 0x1bb0e
movq 0x18(%r12), %rsi
cmpl %eax, %ecx
jl 0x1ba1a
movl $0x0, (%r12)
movq 0x10(%r12), %rdi
sarl $0x2, %edx
callq 0x21b0
movl %eax, 0x4(%r12)
movl 0x8(%r12), %edx
movl %edx, %ecx
sarl $0x2, %ecx
cmpl %ecx, %eax
jge 0x1ba09
andl $-0x4, %edx
incl %edx
movl %edx, 0x8(%r12)
testl %eax, %eax
je 0x1bb0e
movl (%r12), %ecx
movq 0x18(%r12), %rsi
movslq %ecx, %rdi
incl %ecx
movl %ecx, (%r12)
movzbl (%rsi,%rdi), %esi
movl %esi, 0x8(%rsp)
cmpl $0xa, %esi
jne 0x1b9c1
movq %r12, %rdi
movl $0x2, %esi
movq %r15, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x1bc22
movl (%r14), %ebp
movl (%r15), %ecx
testl %eax, %eax
js 0x1ba56
cmpl %ebp, %ecx
jb 0x1ba30
movq (%rsp), %rax
movl $0x0, 0x40(%rax)
cmpl %ecx, %ebp
jne 0x1bb7f
testl %ebp, %ebp
js 0x1bb7f
movq (%rsp), %rax
movq 0x28(%rax), %rsi
movq %r13, %rdi
movl 0xc(%rsp), %edx
movq 0x38(%rsp), %rcx
leaq 0x5c(%rsp), %r8
callq 0x1b247
movq %rax, %r14
movslq 0x5c(%rsp), %rax
testq %rax, %rax
movq 0x951f(%rip), %r13      # 0x24fc0
leaq 0x38fb(%rip), %r15      # 0x1f3a3
jle 0x1bae4
movq (%rsp), %rcx
movq 0x8(%rcx), %r12
shlq $0x2, %rax
leaq (%rax,%rax,2), %rbp
xorl %ebx, %ebx
movq (%r13), %rdi
movl (%r14,%rbx), %ecx
movl 0x4(%r14,%rbx), %r8d
movl 0x8(%r14,%rbx), %r9d
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x21c0
addq $0xc, %rbx
cmpq %rbx, %rbp
jne 0x1babc
movq %r14, %rdi
callq 0x2040
movq (%rsp), %rbp
movq 0x48(%rbp), %r12
movl 0x40(%rbp), %eax
movq 0x28(%rsp), %r13
movq 0x10(%rsp), %r15
jmp 0x1b72e
movl %edi, 0x40(%rbp)
jmp 0x1b92a
movq %r13, %rdi
callq 0x36d4
testq %rbp, %rbp
movq 0x30(%rsp), %r14
je 0x1bb66
movq 0x8(%rbp), %rdi
callq 0x2040
movq 0x18(%rbp), %rdi
callq 0x2040
movq 0x28(%rbp), %rdi
callq 0x2040
movq 0x38(%rbp), %rdi
callq 0x2040
movq 0x48(%rbp), %rbx
testq %rbx, %rbx
je 0x1bb5e
movq 0x18(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movq %rbp, %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2030
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x36d4
movq 0x30(%rsp), %r14
movq (%rsp), %rbp
jmp 0x1bb20
movl 0xc(%rsp), %edi
movq 0x38(%rsp), %rsi
callq 0x3062
jmp 0x1bba7
callq 0x3043
movl $0x1, %eax
jmp 0x1bb70
movl %esi, %eax
jmp 0x1bbc8
subl %r11d, %r15d
subl %r13d, %r15d
movl %r15d, %eax
jmp 0x1b685
movq 0x20(%rsp), %rax
addl %r13d, %eax
addl %r13d, %r11d
movl %r11d, %ecx
jmp 0x1b683
movq %rdi, %r11
addq %r13, %rcx
addq %r13, %rax
testl %ecx, %ecx
jle 0x1bbff
movl %ecx, %edx
negq %rdx
movslq %eax, %rsi
leaq (%r9,%rsi,8), %rsi
xorl %edi, %edi
movq -0x8(%rsi,%rdi,8), %r8
movq %r8, (%rsi,%rdi,8)
decq %rdi
cmpq %rdi, %rdx
jne 0x1bbee
xorl %edx, %edx
testl %r12d, %r12d
cmovgl %r12d, %edx
movq 0x20(%rsp), %rsi
subl %edx, %esi
addl %esi, %r13d
movslq %r13d, %rdx
movq %r11, (%r9,%rdx,8)
subl %ecx, %eax
incl %eax
jmp 0x1b685