// File: chhylp123[P]hifiasm/CommandLines.cpp
// Function: get_queries(int, char**, ketopt_t*, hifiasm_opt_t*)
void get_queries(int argc, char *argv[], ketopt_t* opt, hifiasm_opt_t* asm_opt)
{
    if(opt->ind == argc) {
        return;
    }

    asm_opt->num_reads = argc - opt->ind;
    asm_opt->read_file_names = (char**)malloc(sizeof(char*)*asm_opt->num_reads);
    
    long long i; int ret;
    gzFile dfp; kseq_t *ks = NULL;
    for (i = 0; i < asm_opt->num_reads; i++) {
        asm_opt->read_file_names[i] = argv[i + opt->ind];
        dfp = gzopen(asm_opt->read_file_names[i], "r");
        if (dfp == 0) {
            fprintf(stderr, "[ERROR] Cannot find the input read file: %s\n", 
                    asm_opt->read_file_names[i]);
		    exit(0);
        } else if(asm_opt->is_sc){
            ks = kseq_init(dfp);
            while (((ret = kseq_read(ks)) >= 0)) {
                if((ks->qual.l == 0) || (ks->qual.s == NULL)) {
                    fprintf(stderr, "[ERROR] %s is in fasta format rather than fastq format\n", asm_opt->read_file_names[i]);
                    asm_opt->is_sc = 0;
                    exit(0);
                }
                break;
            }
            kseq_destroy(ks); ks = NULL;
        }
        gzclose(dfp);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
cmpl -0x4(%rbp), %eax
jne 0x4b87
jmp 0x4d07
movl -0x4(%rbp), %ecx
movq -0x18(%rbp), %rax
subl (%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
movslq 0x4(%rax), %rdi
shlq $0x3, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0x4(%rcx), %rcx
cmpq %rcx, %rax
jge 0x4d07
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rdx
movslq (%rdx), %rdx
addq %rdx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x38b7c1(%rip), %rsi    # 0x3903d6
callq 0x22c0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x4c54
movq 0x3bf3b4(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x37c3ce(%rip), %rsi    # 0x381014
movb $0x0, %al
callq 0x22a0
xorl %edi, %edi
callq 0x2240
movq -0x20(%rbp), %rax
cmpq $0x0, 0x2b0(%rax)
je 0x4ceb
movq -0x38(%rbp), %rdi
callq 0x4d10
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x4d50
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
jl 0x4cda
movq -0x40(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x4c9a
movq -0x40(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x4cd8
movq 0x3bf33f(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x37c386(%rip), %rsi    # 0x381041
movb $0x0, %al
callq 0x22a0
movq -0x20(%rbp), %rax
movq $0x0, 0x2b0(%rax)
xorl %edi, %edi
callq 0x2240
jmp 0x4cda
movq -0x40(%rbp), %rdi
callq 0x5140
movq $0x0, -0x40(%rbp)
jmp 0x4ced
movq -0x38(%rbp), %rdi
callq 0x2380
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x4bc3
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)