// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x19, -0x18(%rbp)
movl $0x33, -0x1c(%rbp)
movl $0x2, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x2729b(%rip), %rdx     # 0x2c1c4
callq 0x2300
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jl 0x4fa7
cmpl $0x6b, -0x14(%rbp)
jne 0x4f50
movq 0x2e095(%rip), %rax     # 0x32fd8
movq (%rax), %rdi
callq 0x2310
movl %eax, -0x18(%rbp)
jmp 0x4fa2
cmpl $0x4b, -0x14(%rbp)
jne 0x4f6a
movq 0x2e07b(%rip), %rax     # 0x32fd8
movq (%rax), %rdi
callq 0x2310
movl %eax, -0x1c(%rbp)
jmp 0x4fa0
cmpl $0x6f, -0x14(%rbp)
jne 0x4f84
movq 0x2e061(%rip), %rax     # 0x32fd8
movq (%rax), %rdi
callq 0x2310
movl %eax, -0x20(%rbp)
jmp 0x4f9e
cmpl $0x74, -0x14(%rbp)
jne 0x4f9c
movq 0x2e047(%rip), %rax     # 0x32fd8
movq (%rax), %rdi
callq 0x2310
movl %eax, -0x24(%rbp)
jmp 0x4f9e
jmp 0x4fa0
jmp 0x4fa2
jmp 0x4f1b
movq 0x2e022(%rip), %rax     # 0x32fd0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jne 0x5027
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0x2720a(%rip), %rsi     # 0x2c1cd
callq 0x21b0
cmpl $0x0, %eax
jne 0x4ff1
movq 0x2e024(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
leaq 0x271ea(%rip), %rsi     # 0x2c1d2
movb $0x0, %al
callq 0x21d0
jmp 0x501b
movq 0x2e000(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movl -0x18(%rbp), %ecx
movl -0x1c(%rbp), %r8d
movl -0x20(%rbp), %r9d
leaq 0x27221(%rip), %rsi     # 0x2c235
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x5105
movq -0x10(%rbp), %rax
movq 0x2df9e(%rip), %rcx     # 0x32fd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x37c0
movq %rax, -0x40(%rbp)
movq 0x2df87(%rip), %rax     # 0x32fd0
movl (%rax), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x5073
movq -0x10(%rbp), %rax
movq 0x2df72(%rip), %rcx     # 0x32fd0
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x37c0
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
movl -0x20(%rbp), %r8d
movl -0x24(%rbp), %r9d
callq 0x4d70
movq %rax, -0x38(%rbp)
movq -0x48(%rbp), %rdi
callq 0x28f0
movq -0x40(%rbp), %rdi
callq 0x28f0
movq 0x2df05(%rip), %rax     # 0x32fc0
movq (%rax), %rcx
leaq -0x30(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x2320
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rdx
addq $0x3f, %rdx
shrq $0x6, %rdx
movq 0x2ded8(%rip), %rax     # 0x32fc0
movq (%rax), %rcx
movl $0x8, %esi
callq 0x2320
movq -0x38(%rbp), %rdi
callq 0x2040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop