// File: /workspace/github_c_makefile_star2_O0/lh3[P]fermi2/unpack.c
// Function: main_unpack
int main_unpack(int argc, char *argv[])
{
	int64_t i, n;
	int c;
	rld_t *e;
	kstring_t str = {0,0,0};

	while ((c = getopt(argc, argv, "")) >= 0);
	if (optind == argc) {
		fprintf(stderr, "Usage: fermi2 unpack <reads.rld> [list|file]\n");
		return 1;
	}
	e = rld_restore(argv[optind]);
	if (optind + 1 < argc) {
		char *p, **list;
		list = hts_readlines(argv[optind+1], &n);
		if (list == 0) return 1;
		for (i = 0; i < n; ++i) {
			if (isdigit(list[i][0])) {
				int64_t x = strtol(list[i], &p, 10);
				if (x < e->mcnt[1]) print1(e, x, &str);
			}
			free(list[i]);
		}
		free(list);
	} else for (i = 0; i < e->mcnt[1]; ++i) print1(e, i, &str);
	free(str.s);
	rld_destroy(e);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2160
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x257b8(%rip), %rdx     # 0x2c595
callq 0x2300
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
jl 0x6dec
jmp 0x6dcf
movq 0x2c1dd(%rip), %rax     # 0x32fd0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jne 0x6e1e
movq 0x2c1f7(%rip), %rax     # 0x32ff8
movq (%rax), %rdi
leaq 0x25561(%rip), %rsi     # 0x2c36c
movb $0x0, %al
callq 0x21d0
movl $0x1, -0x4(%rbp)
jmp 0x6f8b
movq -0x10(%rbp), %rax
movq 0x2c1a7(%rip), %rcx     # 0x32fd0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x37c0
movq %rax, -0x30(%rbp)
movq 0x2c190(%rip), %rax     # 0x32fd0
movl (%rax), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jge 0x6f35
movq -0x10(%rbp), %rax
movq 0x2c177(%rip), %rcx     # 0x32fd0
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x20(%rbp), %rsi
callq 0x6af0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x6e85
movl $0x1, -0x4(%rbp)
jmp 0x6f8b
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x6f2a
callq 0x2370
movq (%rax), %rax
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x6f08
movq -0x50(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x48(%rbp), %rsi
movl $0xa, %edx
callq 0x21f0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x28(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jae 0x6f06
movq -0x30(%rbp), %rdi
movq -0x58(%rbp), %rax
movl %eax, %esi
leaq -0x40(%rbp), %rdx
callq 0x6fa0
jmp 0x6f08
movq -0x50(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2040
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x6e8d
movq -0x50(%rbp), %rdi
callq 0x2040
jmp 0x6f72
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x28(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jae 0x6f70
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %esi
leaq -0x40(%rbp), %rdx
callq 0x6fa0
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x6f3d
jmp 0x6f72
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x30(%rbp), %rdi
callq 0x28f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)