// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/sam.c
// Function: fastq_state_set
int fastq_state_set(samFile *fp, enum hts_fmt_option opt, ...) {
    va_list args;

    if (!fp)
        return -1;
    if (!fp->state)
        if (!(fp->state = fastq_state_init(fp->format.format == fastq_format
                                           ? '@' : '>')))
            return -1;

    fastq_state *x = (fastq_state *)fp->state;

    switch (opt) {
    case FASTQ_OPT_CASAVA:
        x->casava = 1;
        break;

    case FASTQ_OPT_NAME2:
        x->sra_names = 1;
        break;

    case FASTQ_OPT_AUX: {
        va_start(args, opt);
        x->aux = 1;
        char *tag = va_arg(args, char *);
        va_end(args);
        if (tag && strcmp(tag, "1") != 0) {
            if (!x->tags)
                if (!(x->tags = kh_init(tag)))
                    return -1;

            size_t i, tlen = strlen(tag);
            for (i = 0; i+3 <= tlen+1; i += 3) {
                if (tag[i+0] == ',' || tag[i+1] == ',' ||
                    !(tag[i+2] == ',' || tag[i+2] == '\0')) {
                    hts_log_warning("Bad tag format '%.3s'; skipping option", tag+i);
                    break;
                }
                int ret, tcode = tag[i+0]*256 + tag[i+1];
                kh_put(tag, x->tags, tcode, &ret);
                if (ret < 0)
                    return -1;
            }
        }
        break;
    }

    case FASTQ_OPT_BARCODE: {
        va_start(args, opt);
        char *bc = va_arg(args, char *);
        va_end(args);
        strncpy(x->BC, bc, 2);
        x->BC[2] = 0;
        break;
    }

    case FASTQ_OPT_RNUM:
        x->rnum = 1;
        break;

    default:
        break;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
testb %al, %al
je 0x3c2a1
movaps %xmm0, -0xe0(%rbp)
movaps %xmm1, -0xd0(%rbp)
movaps %xmm2, -0xc0(%rbp)
movaps %xmm3, -0xb0(%rbp)
movaps %xmm4, -0xa0(%rbp)
movaps %xmm5, -0x90(%rbp)
movaps %xmm6, -0x80(%rbp)
movaps %xmm7, -0x70(%rbp)
movq %r9, -0xe8(%rbp)
movq %r8, -0xf0(%rbp)
movq %rcx, -0xf8(%rbp)
movq %rdx, -0x100(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x3c2d7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3c61e
movq -0x10(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x3c31a
movq -0x10(%rbp), %rax
movl 0x4c(%rax), %ecx
movl $0x3e, %edi
movl $0x40, %eax
cmpl $0x11, %ecx
cmovel %eax, %edi
callq 0x3c630
movq -0x10(%rbp), %rcx
movq %rax, 0x40(%rcx)
cmpq $0x0, %rax
jne 0x3c318
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3c61e
jmp 0x3c31a
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
addl $0xfffffc18, %eax       # imm = 0xFFFFFC18
movl %eax, %ecx
movq %rcx, -0x118(%rbp)
subl $0x4, %eax
ja 0x3c615
movq -0x118(%rbp), %rax
leaq 0xb5116(%rip), %rcx     # 0xf1464
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x38(%rbp), %rax
movl $0x1, 0x60(%rax)
jmp 0x3c617
movq -0x38(%rbp), %rax
movl $0x1, 0x7c(%rax)
jmp 0x3c617
leaq -0x30(%rbp), %rax
leaq -0x110(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq -0x38(%rbp), %rax
movl $0x1, 0x64(%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x128(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x11c(%rbp)
cmpl $0x28, %eax
ja 0x3c3e1
movq -0x128(%rbp), %rcx
movl -0x11c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x130(%rbp)
jmp 0x3c3fe
movq -0x128(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
leaq -0x30(%rbp), %rax
cmpq $0x0, -0x40(%rbp)
je 0x3c555
movq -0x40(%rbp), %rdi
leaq 0xb5f5c(%rip), %rsi     # 0xf2382
callq 0x4690
cmpl $0x0, %eax
je 0x3c555
movq -0x38(%rbp), %rax
cmpq $0x0, 0x70(%rax)
jne 0x3c460
callq 0x3c6a0
movq -0x38(%rbp), %rcx
movq %rax, 0x70(%rcx)
cmpq $0x0, %rax
jne 0x3c45e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3c61e
jmp 0x3c460
movq -0x40(%rbp), %rdi
callq 0x41b0
movq %rax, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq $0x3, %rax
movq -0x50(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
ja 0x3c553
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2c, %eax
je 0x3c4d5
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %rcx
movsbl 0x1(%rax,%rcx), %eax
cmpl $0x2c, %eax
je 0x3c4d5
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %rcx
movsbl 0x2(%rax,%rcx), %eax
cmpl $0x2c, %eax
je 0x3c4f9
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %rcx
movsbl 0x2(%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x3c4f9
movq -0x40(%rbp), %rcx
addq -0x48(%rbp), %rcx
movl $0x3, %edi
leaq 0xb5c16(%rip), %rsi     # 0xf20ff
leaq 0xb5c1f(%rip), %rdx     # 0xf210f
movb $0x0, %al
callq 0x1b030
jmp 0x3c553
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %rcx
movsbl (%rax,%rcx), %eax
shll $0x8, %eax
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %rdx
movsbl 0x1(%rcx,%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rdi
movl -0x58(%rbp), %esi
leaq -0x54(%rbp), %rdx
callq 0x3c6c0
cmpl $0x0, -0x54(%rbp)
jge 0x3c540
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3c61e
jmp 0x3c542
movq -0x48(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x48(%rbp)
jmp 0x3c475
jmp 0x3c555
jmp 0x3c617
leaq -0x30(%rbp), %rax
leaq -0x110(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x140(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x134(%rbp)
cmpl $0x28, %eax
ja 0x3c5b9
movq -0x140(%rbp), %rcx
movl -0x134(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x148(%rbp)
jmp 0x3c5d6
movq -0x140(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
leaq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdi
addq $0x6c, %rdi
movq -0x60(%rbp), %rsi
movl $0x2, %edx
callq 0x4240
movq -0x38(%rbp), %rax
movb $0x0, 0x6e(%rax)
jmp 0x3c617
movq -0x38(%rbp), %rax
movl $0x1, 0x68(%rax)
jmp 0x3c617
jmp 0x3c617
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw (%rax,%rax)