// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/rANS_static16_int.h
// Function: decode_alphabet
static inline int decode_alphabet(uint8_t *cp, uint8_t *cp_end, uint32_t *F) {
    if (cp == cp_end)
        return 0;

    uint8_t *op = cp;
    int rle = 0;
    int j = *cp++;
    if (cp+2 >= cp_end)
        goto carefully;

    do {
        F[j] = 1;
        if (!rle && j+1 == *cp) {
            j = *cp++;
            rle = *cp++;
        } else if (rle) {
            rle--;
            j++;
            if (j > 255)
                return 0;
        } else {
            j = *cp++;
        }
    } while(j && cp+2 < cp_end);

 carefully:
    if (j) {
        do {
            F[j] = 1;
            if(cp >= cp_end) return 0;
            if (!rle && j+1 == *cp) {
                if (cp+1 >= cp_end) return 0;
                j = *cp++;
                rle = *cp++;
            } else if (rle) {
                rle--;
                j++;
                if (j > 255)
                    return 0;
            } else {
                if (cp >= cp_end) return 0;
                j = *cp++;
            }
        } while(j && cp < cp_end);
    }

    return cp - op;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x92bc6
movl $0x0, -0x4(%rbp)
jmp 0x92ddd
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
addq $0x2, %rax
cmpq -0x18(%rbp), %rax
jb 0x92bfd
jmp 0x92cc3
jmp 0x92bff
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
cmpl $0x0, -0x2c(%rbp)
jne 0x92c51
movl -0x30(%rbp), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x92c51
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x2c(%rbp)
jmp 0x92c97
cmpl $0x0, -0x2c(%rbp)
je 0x92c80
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0xff, -0x30(%rbp)
jle 0x92c7e
movl $0x0, -0x4(%rbp)
jmp 0x92ddd
jmp 0x92c95
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x30(%rbp)
jmp 0x92c97
jmp 0x92c99
xorl %eax, %eax
cmpl $0x0, -0x30(%rbp)
movb %al, -0x31(%rbp)
je 0x92cb6
movq -0x10(%rbp), %rax
addq $0x2, %rax
cmpq -0x18(%rbp), %rax
setb %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x92bff
jmp 0x92cc3
cmpl $0x0, -0x30(%rbp)
je 0x92dcf
jmp 0x92ccf
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jb 0x92cf4
movl $0x0, -0x4(%rbp)
jmp 0x92ddd
cmpl $0x0, -0x2c(%rbp)
jne 0x92d51
movl -0x30(%rbp), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x92d51
movq -0x10(%rbp), %rax
addq $0x1, %rax
cmpq -0x18(%rbp), %rax
jb 0x92d25
movl $0x0, -0x4(%rbp)
jmp 0x92ddd
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x2c(%rbp)
jmp 0x92da7
cmpl $0x0, -0x2c(%rbp)
je 0x92d7d
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0xff, -0x30(%rbp)
jle 0x92d7b
movl $0x0, -0x4(%rbp)
jmp 0x92ddd
jmp 0x92da5
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jb 0x92d90
movl $0x0, -0x4(%rbp)
jmp 0x92ddd
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %eax
movl %eax, -0x30(%rbp)
jmp 0x92da7
jmp 0x92da9
xorl %eax, %eax
cmpl $0x0, -0x30(%rbp)
movb %al, -0x32(%rbp)
je 0x92dc2
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
setb %al
movb %al, -0x32(%rbp)
movb -0x32(%rbp), %al
testb $0x1, %al
jne 0x92ccf
jmp 0x92dcf
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)