// File: /workspace/github_c_makefile_star2_O0/lh3[P]fermi2/sub.c
// Function: main_sub
int main_sub(int argc, char *argv[])
{
	int c, is_comp = 0, is_both = 1, n_threads = 1;
	rld_t *e;
	uint64_t n_seqs, *sub;
	FILE *fp;

	while ((c = getopt(argc, argv, "sct:")) >= 0) {
		if (c == 'c') is_comp = 1;
		else if (c == 's') is_both = 0;
		else if (c == 't') n_threads = atoi(optarg);
	}
	if (optind + 2 > argc) {
		fprintf(stderr, "Usage: fermi2 sub [-cs] [-t nThreads=1] <reads.rld> <bits.bin>\n");
		return 1;
	}
	e = rld_restore(argv[optind]);
	fp = fopen(argv[optind+1], "rb");
	fread(&n_seqs, 8, 1, fp);
	if (n_seqs != e->mcnt[1]) {
		fprintf(stderr, "[E::%s] unmatched index and the bit array\n", __func__);
		rld_destroy(e);
		return 1;
	}
	sub = malloc((n_seqs + 63) / 64 * 8);
	fread(sub, 8, (n_seqs + 63) / 64, fp);
	fclose(fp);
	e = fm_sub(e, sub, n_threads, is_comp, is_both);
	free(sub);
	rld_dump(e, "-");
	rld_destroy(e);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x1, -0x1c(%rbp)
movl $0x1, -0x20(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x26131(%rip), %rdx     # 0x2c2b3
callq 0x2300
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jl 0x61cb
cmpl $0x63, -0x14(%rbp)
jne 0x619e
movl $0x1, -0x18(%rbp)
jmp 0x61c9
cmpl $0x73, -0x14(%rbp)
jne 0x61ad
movl $0x0, -0x1c(%rbp)
jmp 0x61c7
cmpl $0x74, -0x14(%rbp)
jne 0x61c5
movq 0x2ce1e(%rip), %rax     # 0x32fd8
movq (%rax), %rdi
callq 0x2310
movl %eax, -0x20(%rbp)
jmp 0x61c7
jmp 0x61c9
jmp 0x6174
movq 0x2cdfe(%rip), %rax     # 0x32fd0
movl (%rax), %eax
addl $0x2, %eax
cmpl -0x8(%rbp), %eax
jle 0x6200
movq 0x2ce15(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x260cb(%rip), %rsi     # 0x2c2b8
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x6323
movq -0x10(%rbp), %rax
movq 0x2cdc5(%rip), %rcx     # 0x32fd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x37c0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x2cdaa(%rip), %rcx     # 0x32fd0
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x25e0c(%rip), %rsi     # 0x2c045
callq 0x22e0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rcx
leaq -0x30(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x20a0
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x28(%rcx), %rcx
cmpq 0x8(%rcx), %rax
je 0x629f
movq 0x2cd86(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x2607c(%rip), %rsi     # 0x2c2f8
leaq 0x260a0(%rip), %rdx     # 0x2c323
movb $0x0, %al
callq 0x21d0
movq -0x28(%rbp), %rdi
callq 0x28f0
movl $0x1, -0x4(%rbp)
jmp 0x6323
movq -0x30(%rbp), %rdi
addq $0x3f, %rdi
shrq $0x6, %rdi
shlq $0x3, %rdi
callq 0x2230
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rdx
addq $0x3f, %rdx
shrq $0x6, %rdx
movq -0x40(%rbp), %rcx
movl $0x8, %esi
callq 0x20a0
movq -0x40(%rbp), %rdi
callq 0x20e0
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x20(%rbp), %edx
movl -0x18(%rbp), %ecx
movl -0x1c(%rbp), %r8d
callq 0x5e50
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x28(%rbp), %rdi
leaq 0x26827(%rip), %rsi     # 0x2cb35
callq 0x35c0
movq -0x28(%rbp), %rdi
callq 0x28f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)