// File: /workspace/github_c_makefile_star2_O3/lh3[P]fermi2/diff.c
// Function: main_diff
int main_diff(int argc, char *argv[])
{
	int c, min_k = 25, max_k = 51, min_occ = 2, n_threads = 1;
	uint64_t n_seqs, *bits;
	rld_t *eqry = 0, *eref = 0;
	while ((c = getopt(argc, argv, "k:K:o:t:")) >= 0) {
		if (c == 'k') min_k = atoi(optarg);
		else if (c == 'K') max_k = atoi(optarg);
		else if (c == 'o') min_occ = atoi(optarg);
		else if (c == 't') n_threads = atoi(optarg);
	}
	if (optind == argc) {
		if (strcmp(argv[0], "diff") == 0)
			fprintf(stderr, "Usage: fermi2 diff [-k minK=%d] [-K maxK=%d] [-o minOcc=%d] [-t nThreads=1] <query.rld> <ref.rld>\n", min_k, max_k, min_occ);
		else fprintf(stderr, "Usage: fermi2 %s [-k minK=%d] [-K maxK=%d] [-o minOcc=%d] [-t nThreads=1] <query.rld>\n", argv[0], min_k, max_k, min_occ);
		return 1;
	}
	eqry = rld_restore(argv[optind]);
	if (optind + 1 < argc)
		eref = rld_restore(argv[optind+1]);
	n_seqs = eqry->mcnt[1];
	bits = fm_diff(eqry, eref, min_k, max_k, min_occ, n_threads);
	rld_destroy(eref);
	rld_destroy(eqry);
	fwrite(&n_seqs, 8, 1, stdout);
	fwrite(bits, 8, (n_seqs + 63) / 64, stdout);
	free(bits);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movl %edi, %r13d
leaq 0x17c8a(%rip), %rdx     # 0x1d214
callq 0x22f0
testl %eax, %eax
js 0x5626
movl $0x19, %r14d
movl $0x33, 0x8(%rsp)
movl $0x2, 0xc(%rsp)
movl $0x1, %r12d
movq 0x1fa1e(%rip), %rbp     # 0x24fd8
leaq 0x17c53(%rip), %rbx     # 0x1d214
cmpl $0x6e, %eax
jg 0x55de
cmpl $0x4b, %eax
je 0x55f6
cmpl $0x6b, %eax
jne 0x5612
movq (%rbp), %rdi
callq 0x2300
movl %eax, %r14d
jmp 0x5612
cmpl $0x6f, %eax
je 0x5605
cmpl $0x74, %eax
jne 0x5612
movq (%rbp), %rdi
callq 0x2300
movl %eax, %r12d
jmp 0x5612
movq (%rbp), %rdi
callq 0x2300
movl %eax, 0x8(%rsp)
jmp 0x5612
movq (%rbp), %rdi
callq 0x2300
movl %eax, 0xc(%rsp)
movl %r13d, %edi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x22f0
testl %eax, %eax
jns 0x55c1
jmp 0x5642
movl $0x1, %r12d
movl $0x2, 0xc(%rsp)
movl $0x33, 0x8(%rsp)
movl $0x19, %r14d
movq 0x1f987(%rip), %rbp     # 0x24fd0
movslq (%rbp), %rax
cmpl %r13d, %eax
je 0x570f
movq (%r15,%rax,8), %rdi
callq 0x4119
movq %rax, %rbx
movslq (%rbp), %rax
leal 0x1(%rax), %ecx
xorl %ebp, %ebp
cmpl %r13d, %ecx
jge 0x567f
movq 0x8(%r15,%rax,8), %rdi
callq 0x4119
movq %rax, %r13
jmp 0x5682
xorl %r13d, %r13d
movq 0x28(%rbx), %rax
movq 0x8(%rax), %rax
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movq %rbx, %rdi
movq %r13, %rsi
movl %r14d, %edx
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl %r12d, %r9d
callq 0x5060
movq %rax, %r14
movq %r13, %rdi
callq 0x36d4
movq %rbx, %rdi
callq 0x36d4
movq 0x1f8fa(%rip), %rbx     # 0x24fc0
movq (%rbx), %rcx
movl $0x8, %esi
movl $0x1, %edx
movq %r15, %rdi
callq 0x2310
movq (%r15), %rdx
addq $0x3f, %rdx
shrq $0x6, %rdx
movq (%rbx), %rcx
movl $0x8, %esi
movq %r14, %rdi
callq 0x2310
movq %r14, %rdi
callq 0x2040
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rbx
leaq 0x17b04(%rip), %rsi     # 0x1d21d
movq %rbx, %rdi
callq 0x21a0
movq 0x1f8d0(%rip), %rcx     # 0x24ff8
movq (%rcx), %rdi
testl %eax, %eax
jne 0x574b
leaq 0x17aec(%rip), %rsi     # 0x1d222
movl %r14d, %edx
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
xorl %eax, %eax
callq 0x21c0
jmp 0x5769
leaq 0x17b33(%rip), %rsi     # 0x1d285
movq %rbx, %rdx
movl %r14d, %ecx
movl 0x8(%rsp), %r8d
movl 0xc(%rsp), %r9d
xorl %eax, %eax
callq 0x21c0
movl $0x1, %ebp
jmp 0x56fe