// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/fqzcomp_qual.c
// Function: fqz_store_parameters1
static inline
int fqz_store_parameters1(fqz_param *pm, unsigned char *comp) {
    int comp_idx = 0, i, j;

    // Starting context
    comp[comp_idx++] = pm->context;
    comp[comp_idx++] = pm->context >> 8;

    comp[comp_idx++] = pm->pflags;
    comp[comp_idx++] = pm->max_sym;

    comp[comp_idx++] = (pm->qbits<<4)|pm->qshift;
    comp[comp_idx++] = (pm->qloc<<4)|pm->sloc;
    comp[comp_idx++] = (pm->ploc<<4)|pm->dloc;

    if (pm->store_qmap) {
        for (i = j = 0; i < 256; i++)
            if (pm->qmap[i] != INT_MAX)
                comp[comp_idx++] = i;
    }

    if (pm->qbits && pm->use_qtab)
        // custom qtab
        comp_idx += store_array(comp+comp_idx, pm->qtab, 256);

    if (pm->pbits && pm->use_ptab)
        // custom ptab
        comp_idx += store_array(comp+comp_idx, pm->ptab, 1024);

    if (pm->dbits && pm->use_dtab)
        // custom dtab
        comp_idx += store_array(comp+comp_idx, pm->dtab, 256);

    return comp_idx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %ax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
sarl $0x8, %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movl 0x3c(%rax), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shll $0x4, %eax
movq -0x8(%rbp), %rcx
orl 0x1c48(%rcx), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
shll $0x4, %eax
movq -0x8(%rbp), %rcx
orl 0x38(%rcx), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
shll $0x4, %eax
movq -0x8(%rbp), %rcx
orl 0x30(%rcx), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x8b3e9
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x100, -0x18(%rbp)     # imm = 0x100
jge 0x8b3e7
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
cmpl $0x7fffffff, 0x48(%rax,%rcx,4) # imm = 0x7FFFFFFF
je 0x8b3da
movl -0x18(%rbp), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x8b3dc
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x8b3a5
jmp 0x8b3e9
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0x8b426
movq -0x8(%rbp), %rax
movzbl 0x18(%rax), %eax
cmpl $0x0, %eax
je 0x8b426
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x448, %rsi            # imm = 0x448
movl $0x100, %edx            # imm = 0x100
callq 0x8afd0
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0x8b463
movq -0x8(%rbp), %rax
movzbl 0x1a(%rax), %eax
cmpl $0x0, %eax
je 0x8b463
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x848, %rsi            # imm = 0x848
movl $0x400, %edx            # imm = 0x400
callq 0x8afd0
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
je 0x8b4a0
movq -0x8(%rbp), %rax
movzbl 0x19(%rax), %eax
cmpl $0x0, %eax
je 0x8b4a0
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
addq $0x1848, %rsi           # imm = 0x1848
movl $0x100, %edx            # imm = 0x100
callq 0x8afd0
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)