// File: /workspace/github_c_makefile_star2_O1/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 0x169fb(%rip), %rdx     # 0x1c1dc
callq 0x22f0
testl %eax, %eax
js 0x587d
movl $0x19, %r14d
movl $0x33, 0x8(%rsp)
movl $0x2, 0xc(%rsp)
movl $0x1, %r12d
movq 0x1e7c7(%rip), %rbp     # 0x23fd8
leaq 0x169c4(%rip), %rbx     # 0x1c1dc
cmpl $0x6e, %eax
jg 0x5835
cmpl $0x4b, %eax
je 0x584d
cmpl $0x6b, %eax
jne 0x5869
movq (%rbp), %rdi
callq 0x2300
movl %eax, %r14d
jmp 0x5869
cmpl $0x6f, %eax
je 0x585c
cmpl $0x74, %eax
jne 0x5869
movq (%rbp), %rdi
callq 0x2300
movl %eax, %r12d
jmp 0x5869
movq (%rbp), %rdi
callq 0x2300
movl %eax, 0x8(%rsp)
jmp 0x5869
movq (%rbp), %rdi
callq 0x2300
movl %eax, 0xc(%rsp)
movl %r13d, %edi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x22f0
testl %eax, %eax
jns 0x5818
jmp 0x5899
movl $0x1, %r12d
movl $0x2, 0xc(%rsp)
movl $0x33, 0x8(%rsp)
movl $0x19, %r14d
movq 0x1e730(%rip), %rbp     # 0x23fd0
movslq (%rbp), %rax
cmpl %r13d, %eax
je 0x5966
movq (%r15,%rax,8), %rdi
callq 0x436c
movq %rax, %rbx
movslq (%rbp), %rax
leal 0x1(%rax), %ecx
xorl %ebp, %ebp
cmpl %r13d, %ecx
jge 0x58d6
movq 0x8(%r15,%rax,8), %rdi
callq 0x436c
movq %rax, %r13
jmp 0x58d9
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 0x5190
movq %rax, %r14
movq %r13, %rdi
callq 0x38cc
movq %rbx, %rdi
callq 0x38cc
movq 0x1e6a3(%rip), %rbx     # 0x23fc0
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 0x16875(%rip), %rsi     # 0x1c1e5
movq %rbx, %rdi
callq 0x21a0
movq 0x1e679(%rip), %rcx     # 0x23ff8
movq (%rcx), %rdi
testl %eax, %eax
jne 0x59a2
leaq 0x1685d(%rip), %rsi     # 0x1c1ea
movl %r14d, %edx
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
xorl %eax, %eax
callq 0x21c0
jmp 0x59c0
leaq 0x168a4(%rip), %rsi     # 0x1c24d
movq %rbx, %rdx
movl %r14d, %ecx
movl 0x8(%rsp), %r8d
movl 0xc(%rsp), %r9d
xorl %eax, %eax
callq 0x21c0
movl $0x1, %ebp
jmp 0x5955