// File: /workspace/github_c_makefile_star2_O1/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 $0x48, %rsp
movq %rsi, %rbx
movslq %edi, %r13
leal -0x1(%r13), %eax
movl %eax, 0x38(%rsp)
movl %r13d, %r10d
negl %r10d
movl $0x3d, 0x1c(%rsp)
movl $0x1, %r14d
xorl %r11d, %r11d
movq $0x0, 0x8(%rsp)
movl $0x0, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
movq %r10, 0x20(%rsp)
cmpl %edi, %r14d
setl %al
jge 0x1a7a1
movslq %r14d, %rcx
leal (%r11,%rdi), %edx
subl %r14d, %edx
incq %rcx
leal (%r10,%r14), %r9d
movb $0x1, %al
xorl %esi, %esi
movq -0x8(%rbx,%rcx,8), %r8
cmpb $0x2d, (%r8)
jne 0x1a780
cmpb $0x0, 0x1(%r8)
jne 0x1a79b
cmpq %r13, %rcx
setl %al
decl %esi
incq %rcx
cmpl %esi, %r9d
jne 0x1a76e
movl %edx, %r11d
movl %edi, %r14d
movl %edi, %r8d
jmp 0x1a7a4
subl %esi, %r11d
subl %esi, %r14d
movl %r14d, %r8d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb $0x1, %al
je 0x1a8d1
movslq %r8d, %r15
movq (%rbx,%r15,8), %r12
cmpb $0x2d, (%r12)
jne 0x1a8d1
movzbl 0x1(%r12), %eax
testl %eax, %eax
je 0x1a8d1
cmpl $0x2d, %eax
jne 0x1a7f4
cmpb $0x0, 0x2(%r12)
je 0x1a862
movl $0x3f, %ebp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %r12d, %r12d
jmp 0x1a948
movq %r8, 0x28(%rsp)
movq %r11, 0x30(%rsp)
movq 0x8(%rsp), %rax
cmpl $0x1, %eax
adcl $0x0, %eax
cltq
movsbl (%r12,%rax), %ebp
incq %rax
movq %rax, 0x8(%rsp)
movl $0x5, %edx
leaq 0x38ee(%rip), %rdi      # 0x1e112
movl %ebp, %esi
callq 0x2180
testq %rax, %rax
je 0x1a885
cmpb $0x3a, 0x1(%rax)
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %r10
movq 0x30(%rsp), %r11
movq 0x28(%rsp), %r8
jne 0x1a8ab
movq 0x8(%rsp), %rax
cmpb $0x0, (%r12,%rax)
je 0x1a92c
addq %rax, %r12
jmp 0x1a943
testl %r11d, %r11d
jle 0x1a8b8
movl %r11d, %ecx
leaq (%rbx,%r15,8), %rdx
xorl %eax, %eax
movq -0x8(%rdx), %rsi
movq %rsi, (%rdx)
addq $-0x8, %rdx
incq %rax
cmpq %rax, %rcx
jne 0x1a870
jmp 0x1a8ba
movl $0x3f, %ebp
xorl %r12d, %r12d
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %r10
movq 0x30(%rsp), %r11
movq 0x8(%rsp), %rax
movq 0x28(%rsp), %r8
jmp 0x1a948
xorl %r12d, %r12d
movq 0x8(%rsp), %rax
jmp 0x1a948
xorl %eax, %eax
movl %r8d, %ecx
subl %eax, %ecx
movslq %ecx, %rax
movq %r12, (%rbx,%rax,8)
incl %r8d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %r8d, %r14d
xorl %r12d, %r12d
testl %ebp, %ebp
js 0x1a9cf
cmpl $0x63, %ebp
je 0x1a90b
cmpl $0x6b, %ebp
jne 0x1a751
movq %r12, %rdi
movq %r11, %r15
callq 0x2300
movq %r15, %r11
movq 0x20(%rsp), %r10
movq 0x10(%rsp), %rdi
movl %eax, 0x1c(%rsp)
jmp 0x1a751
movq %r12, %rdi
movq %r11, %r15
callq 0x2300
movq %r15, %r11
movq 0x20(%rsp), %r10
movq 0x10(%rsp), %rdi
movl %eax, 0x18(%rsp)
jmp 0x1a751
cmpl 0x38(%rsp), %r8d
jge 0x1a9c5
leal 0x1(%r8), %r14d
movslq %r8d, %rax
movq 0x8(%rbx,%rax,8), %r12
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x1a96b
movq %rax, %rdx
movslq %r14d, %rax
movq (%rbx,%rax,8), %rax
movl %edx, %ecx
cmpb $0x0, (%rax,%rcx)
je 0x1a96b
movq %rdx, 0x8(%rsp)
movl %r14d, %r8d
jmp 0x1a8d4
leal 0x1(%r14), %eax
testl %r11d, %r11d
setle %cl
cmpl %r14d, %r8d
setg %dl
movq $0x0, 0x8(%rsp)
orb %cl, %dl
jne 0x1a9ba
movl %r11d, %ecx
leaq (%rbx,%r15,8), %rdx
negq %rcx
movq (%rbx,%r15,8), %rsi
xorl %r9d, %r9d
movq -0x8(%rdx,%r9,8), %r8
movq %r8, (%rdx,%r9,8)
decq %r9
cmpq %r9, %rcx
jne 0x1a999
movq %rsi, (%rdx,%r9,8)
incq %r15
addq $0x8, %rdx
cmpl %r15d, %eax
jne 0x1a992
movl %eax, %r14d
movl %eax, %r8d
jmp 0x1a8d4
movl $0x3a, %ebp
jmp 0x1a7e7
subl %r11d, %r8d
subl %r8d, %edi
cmpl $0x1, %edi
jle 0x1ae80
movslq %r8d, %r12
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x1997(%rip), %rsi      # 0x1c384
callq 0x22b0
testq %rax, %rax
je 0x1ae8f
movq %rax, %r13
movl $0x1, %edi
movl $0x50, %esi
callq 0x2190
movq %rax, %r15
movl $0x1, %edi
movl $0x20, %esi
callq 0x2190
movq %rax, %r14
movq %r13, 0x38(%rsp)
movq %r13, 0x10(%rax)
movl 0x8(%rax), %eax
andl $0x3, %eax
orl $0x10000, %eax          # imm = 0x10000
movl %eax, 0x8(%r14)
movl $0x4000, %edi           # imm = 0x4000
callq 0x2220
movq %rax, 0x18(%r14)
movq %r14, 0x48(%r15)
movq (%rbx,%r12,8), %rdi
callq 0x436c
movq %rax, 0x10(%rsp)
leaq 0x30(%r15), %r14
leaq 0x20(%r15), %r13
leaq 0x10(%r15), %rax
movq %rax, 0x28(%rsp)
movq 0x954e(%rip), %rbx      # 0x23fc0
movq %r13, 0x20(%rsp)
movq %r14, 0x30(%rsp)
movq %r15, 0x8(%rsp)
movq 0x48(%r15), %rbp
cmpl $0x0, 0x40(%r15)
jne 0x1ab1c
jmp 0x1aa9a
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x1aafd
movl 0x8(%rbp), %edx
testb $0x3, %dl
je 0x1aab0
movl (%rbp), %eax
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl 0x4(%rbp), %eax
jge 0x1aafd
movl (%rbp), %eax
cmpl 0x4(%rbp), %eax
jl 0x1aaea
movl $0x0, (%rbp)
movq 0x10(%rbp), %rdi
movq 0x18(%rbp), %rsi
sarl $0x2, %edx
callq 0x21b0
movl %eax, 0x4(%rbp)
movl 0x8(%rbp), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x1aae6
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%rbp)
testl %eax, %eax
je 0x1aa92
movq 0x18(%rbp), %rax
movslq (%rbp), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%rbp)
movzbl (%rax,%rcx), %r12d
movl %r12d, 0x4(%rsp)
cmpl $-0x1, %r12d
je 0x1ad7d
cmpl $0x40, %r12d
je 0x1ab18
cmpl $0x3e, %r12d
jne 0x1aa9a
movl %r12d, 0x40(%r15)
xorl %eax, %eax
movl %eax, 0x30(%r15)
movl %eax, 0x20(%r15)
movl %eax, 0x10(%r15)
movq %rbp, %rdi
xorl %esi, %esi
movq %r15, %rdx
leaq 0x4(%rsp), %rcx
xorl %r8d, %r8d
callq 0x1ae9b
testl %eax, %eax
js 0x1ac3d
cmpl $0xa, 0x4(%rsp)
je 0x1ab65
movq %rbp, %rdi
movl $0x2, %esi
movq 0x28(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1ae9b
cmpq $0x0, 0x28(%r15)
jne 0x1ab82
movl $0x100, 0x24(%r15)      # imm = 0x100
movl $0x100, %edi            # imm = 0x100
callq 0x2220
movq %rax, 0x28(%r15)
movl 0x8(%rbp), %edx
testb $0x3, %dl
je 0x1ab97
movl (%rbp), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x4(%rbp), %ecx
jge 0x1abe3
movl (%rbp), %eax
cmpl 0x4(%rbp), %eax
jl 0x1abd1
movl $0x0, (%rbp)
movq 0x10(%rbp), %rdi
movq 0x18(%rbp), %rsi
sarl $0x2, %edx
callq 0x21b0
movl %eax, 0x4(%rbp)
movl 0x8(%rbp), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x1abcd
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%rbp)
testl %eax, %eax
je 0x1ac36
movq 0x18(%rbp), %rax
movslq (%rbp), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%rbp)
movzbl (%rax,%rcx), %eax
movl %eax, 0x4(%rsp)
cmpl $0x2a, %eax
jg 0x1abf8
cmpl $0xa, %eax
je 0x1ab82
cmpl $-0x1, %eax
jne 0x1ac07
jmp 0x1ac4c
cmpl $0x2b, %eax
je 0x1ac4c
cmpl $0x3e, %eax
je 0x1ac48
cmpl $0x40, %eax
je 0x1ac48
movq 0x28(%r15), %rcx
movl 0x20(%r15), %edx
leal 0x1(%rdx), %esi
movl %esi, 0x20(%r15)
movb %al, (%rcx,%rdx)
movq %rbp, %rdi
movl $0x2, %esi
movq %r13, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x1ae9b
jmp 0x1ab82
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1abe3
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x1ad7d
movl %eax, 0x40(%r15)
movl 0x20(%r15), %r12d
leal 0x1(%r12), %eax
cmpl 0x24(%r15), %eax
jb 0x1ac90
movl %eax, %ecx
shrl %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x8, %eax
orl %ecx, %eax
movl %eax, %esi
shrl $0x10, %esi
orl %eax, %esi
incl %esi
movl %esi, 0x24(%r15)
movq 0x28(%r15), %rdi
callq 0x2260
movq %rax, 0x28(%r15)
movq 0x28(%r15), %rax
movb $0x0, (%rax,%r12)
cmpl $0x2b, 0x4(%rsp)
jne 0x1ad7d
movl 0x24(%r15), %esi
cmpl %esi, 0x34(%r15)
jae 0x1acbf
movl %esi, 0x34(%r15)
movq 0x38(%r15), %rdi
callq 0x2260
movq %rax, 0x38(%r15)
movl 0x8(%rbp), %edx
testb $0x3, %dl
je 0x1acd4
movl (%rbp), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x4(%rbp), %ecx
jge 0x1ad20
movl (%rbp), %eax
cmpl 0x4(%rbp), %eax
jl 0x1ad0e
movl $0x0, (%rbp)
movq 0x10(%rbp), %rdi
movq 0x18(%rbp), %rsi
sarl $0x2, %edx
callq 0x21b0
movl %eax, 0x4(%rbp)
movl 0x8(%rbp), %ecx
movl %ecx, %edx
sarl $0x2, %edx
cmpl %edx, %eax
jge 0x1ad0a
andl $-0x4, %ecx
incl %ecx
movl %ecx, 0x8(%rbp)
testl %eax, %eax
je 0x1ad30
movq 0x18(%rbp), %rax
movslq (%rbp), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%rbp)
movzbl (%rax,%rcx), %eax
movl %eax, 0x4(%rsp)
cmpl $-0x1, %eax
je 0x1ad77
cmpl $0xa, %eax
jne 0x1acbf
jmp 0x1ad37
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1ad20
movq %rbp, %rdi
movl $0x2, %esi
movq %r14, %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x1ae9b
testl %eax, %eax
js 0x1ad5c
movl (%r14), %eax
cmpl (%r13), %eax
jb 0x1ad37
movl $0x0, 0x40(%r15)
movl 0x20(%r15), %r12d
cmpl 0x30(%r15), %r12d
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmovnel %eax, %r12d
jmp 0x1ad7d
movl $0xfffffffe, %r12d      # imm = 0xFFFFFFFE
testl %r12d, %r12d
js 0x1ae0d
movq 0x28(%r15), %rsi
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %edx
movl 0x18(%rsp), %ecx
leaq 0x44(%rsp), %r8
callq 0x1a5cc
movq %rax, %rbp
movslq 0x44(%rsp), %rax
testq %rax, %rax
leaq 0x33e8(%rip), %r15      # 0x1e19b
jle 0x1adf1
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %r12
shlq $0x2, %rax
leaq (%rax,%rax,2), %r14
xorl %r13d, %r13d
movq (%rbx), %rdi
movl (%rbp,%r13), %ecx
movl 0x4(%rbp,%r13), %r8d
movl 0x8(%rbp,%r13), %r9d
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x21c0
addq $0xc, %r13
cmpq %r13, %r14
jne 0x1adc9
movq %rbp, %rdi
callq 0x2040
movq 0x30(%rsp), %r14
movq 0x20(%rsp), %r13
movq 0x8(%rsp), %r15
jmp 0x1aa81
movq 0x10(%rsp), %rdi
callq 0x38cc
testq %r15, %r15
movq 0x38(%rsp), %r14
je 0x1ae67
movq 0x8(%r15), %rdi
callq 0x2040
movq 0x18(%r15), %rdi
callq 0x2040
movq 0x28(%r15), %rdi
callq 0x2040
movq 0x38(%r15), %rdi
callq 0x2040
movq 0x48(%r15), %rbx
testq %rbx, %rbx
je 0x1ae5f
movq 0x18(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movq %r15, %rdi
callq 0x2040
movq %r14, %rdi
callq 0x2030
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x1c(%rsp), %edi
movl 0x18(%rsp), %esi
callq 0x325f
jmp 0x1ae94
callq 0x3240
movl $0x1, %eax
jmp 0x1ae71