// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdx, 0x40(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x50(%rsp)
movq %r9, 0x58(%rsp)
testb %al, %al
je 0x23072
movdqa %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
pushq $-0x1
popq %rbp
testq %rdi, %rdi
je 0x23381
movl %esi, %r15d
movq %rdi, %rbx
movq 0x40(%rdi), %r14
testq %r14, %r14
jne 0x230b2
xorl %eax, %eax
cmpl $0x11, 0x4c(%rbx)
sete %al
leal 0x3e(,%rax,2), %edi
callq 0x233be
movq %rax, %r14
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x23381
xorl %ebx, %ebx
addl $0xfffffc18, %r15d      # imm = 0xFFFFFC18
cmpl $0x4, %r15d
ja 0x23383
leaq 0x56178(%rip), %rax     # 0x79244
movslq (%rax,%r15,4), %rsi
addq %rax, %rsi
leaq 0x30(%rsp), %rdx
leaq 0x120(%rsp), %rcx
movabsq $0x3000000010, %rax     # imm = 0x3000000010
jmpq *%rsi
movl $0x1, 0x60(%r14)
jmp 0x23383
movl $0x1, 0x7c(%r14)
jmp 0x23383
movl $0x1, 0x68(%r14)
jmp 0x23383
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq %rax, (%rsp)
pushq $0x10
popq %rcx
cmpq $0x28, %rcx
ja 0x23169
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x23177
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq %rax, (%rsp)
movl $0x1, 0x64(%r14)
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x23190
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x2319e
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rsi
leaq 0x6c(%r14), %rdi
pushq $0x2
popq %rdx
callq 0x4250
movb $0x0, 0x6e(%r14)
jmp 0x23383
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %r15
testq %r15, %r15
je 0x23383
cmpb $0x31, (%r15)
jne 0x231bb
cmpb $0x0, 0x1(%r15)
je 0x23383
cmpq $0x0, 0x70(%r14)
jne 0x231da
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x4300
movq %rax, 0x70(%r14)
testq %rax, %rax
je 0x23381
movq %r15, %rdi
callq 0x41d0
incq %rax
movq %rax, 0x28(%rsp)
xorl %r8d, %r8d
movq %r15, 0x20(%rsp)
leaq 0x3(%r8), %r12
cmpq 0x28(%rsp), %r12
ja 0x233b3
leaq (%r15,%r8), %rcx
movsbl (%r15,%r8), %ebp
cmpl $0x2c, %ebp
je 0x23397
movsbl 0x1(%rcx), %r15d
cmpl $0x2c, %r15d
je 0x23397
movzbl 0x2(%rcx), %eax
testl %eax, %eax
je 0x23233
cmpl $0x2c, %eax
jne 0x23397
movq 0x70(%r14), %r13
movl 0x8(%r13), %eax
cmpl 0xc(%r13), %eax
jb 0x23265
movl (%r13), %esi
movl 0x4(%r13), %eax
addl %eax, %eax
cmpl %eax, %esi
jbe 0x23253
decl %esi
jmp 0x23255
incl %esi
movq %r13, %rdi
callq 0x29243
testl %eax, %eax
js 0x233b7
shll $0x8, %ebp
addl %r15d, %ebp
movl (%r13), %edx
leal -0x1(%rdx), %r8d
movl %r8d, %esi
andl %ebp, %esi
movq 0x10(%r13), %rax
movl %esi, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %edi
leal (%rsi,%rsi), %ecx
shrl %cl, %edi
testb $0x2, %dil
je 0x23293
movl %esi, %edi
jmp 0x2330d
pushq $0x1
popq %r10
movl %esi, %r9d
movl %edx, %edi
movl %r9d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %r11d
leal (%r9,%r9), %ecx
andl $0x1e, %ecx
movl %r11d, %r15d
shrl %cl, %r15d
testb $0x2, %r15b
jne 0x232ed
testb $0x1, %r15b
jne 0x232cc
movq 0x18(%r13), %r15
movl %r9d, %ebx
cmpl %ebp, (%r15,%rbx,4)
je 0x232ed
btl %ecx, %r11d
cmovbl %r9d, %edi
addl %r10d, %r9d
andl %r8d, %r9d
incl %r10d
cmpl %esi, %r9d
jne 0x2329c
movb $0x1, %cl
movl %edx, %r8d
cmpl %edx, %edi
je 0x232fd
jmp 0x2330d
shrl %cl, %r11d
testb $0x2, %r11b
sete %cl
movl %edi, %r8d
movl %r9d, %esi
cmpl %edx, %r8d
cmovel %esi, %r8d
testb %cl, %cl
cmovnel %esi, %r8d
movl %r8d, %edi
movl %edi, %edx
shrl $0x4, %edx
movl (%rax,%rdx,4), %esi
leal (%rdi,%rdi), %ecx
andl $0x1e, %ecx
shrl %cl, %esi
movl %edi, %edi
testb $0x2, %sil
movq 0x20(%rsp), %r15
jne 0x23354
movq %r12, %r8
testb $0x1, %sil
je 0x231f2
movq 0x18(%r13), %rsi
movl %ebp, (%rsi,%rdi,4)
pushq $0x3
popq %rsi
shll %cl, %esi
notl %esi
andl %esi, (%rax,%rdx,4)
incl 0x4(%r13)
movq %r12, %r8
jmp 0x231f2
movq 0x18(%r13), %rsi
movl %ebp, (%rsi,%rdi,4)
pushq $0x3
popq %rsi
shll %cl, %esi
notl %esi
andl %esi, (%rax,%rdx,4)
movq 0x4(%r13), %xmm0
psubd 0x55ced(%rip), %xmm0    # 0x79060
movq %xmm0, 0x4(%r13)
movq %r12, %r8
jmp 0x231f2
movl %ebp, %ebx
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5679e(%rip), %rsi     # 0x79b3c
leaq 0x567a7(%rip), %rdx     # 0x79b4c
xorl %ebx, %ebx
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x110c6
jmp 0x23383
xorl %ebx, %ebx
jmp 0x23383
pushq $-0x1
popq %rax
movl %eax, %ebx
jmp 0x23383