// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_byte_array_stop_decode_init
cram_codec *cram_byte_array_stop_decode_init(cram_block_compression_hdr *hdr,
                                             char *data, int size,
                                             enum cram_encoding codec,
                                             enum cram_external_type option,
                                             int version, varint_vec *vv) {
    cram_codec *c = NULL;
    unsigned char *cp = (unsigned char *)data;
    int err = 0;

    if (size < (CRAM_MAJOR_VERS(version) == 1 ? 5 : 2))
        goto malformed;

    if (!(c = malloc(sizeof(*c))))
        return NULL;

    c->codec  = E_BYTE_ARRAY_STOP;
    switch (option) {
    case E_BYTE_ARRAY_BLOCK:
        c->decode = cram_byte_array_stop_decode_block;
        break;
    case E_BYTE_ARRAY:
        c->decode = cram_byte_array_stop_decode_char;
        break;
    default:
        hts_log_error("The byte_array_stop codec only supports BYTE_ARRAYs");
        free(c);
        return NULL;
    }
    c->free   = cram_byte_array_stop_decode_free;
    c->describe = cram_byte_array_stop_describe;

    c->u.byte_array_stop.stop = *cp++;
    if (CRAM_MAJOR_VERS(version) == 1) {
        c->u.byte_array_stop.content_id = cp[0] + (cp[1]<<8) + (cp[2]<<16)
            + ((unsigned int) cp[3]<<24);
        cp += 4;
    } else {
        c->u.byte_array_stop.content_id = vv->varint_get32((char **)&cp, data+size, &err);
    }

    if ((char *)cp - data != size || err)
        goto malformed;

    return c;

 malformed:
    hts_log_error("Malformed byte_array_stop header stream");
    free(c);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r15d
movq %rsi, 0x8(%rsp)
movl $0x0, 0x14(%rsp)
andl $0xffffff00, %r15d      # imm = 0xFFFFFF00
xorl %eax, %eax
cmpl $0x100, %r15d           # imm = 0x100
sete %al
leal (%rax,%rax,2), %eax
addl $0x2, %eax
cmpl %edx, %eax
jle 0x922ab
xorl %ebx, %ebx
leaq 0x10c7f(%rip), %rsi     # 0xa2f0d
leaq 0x10ccd(%rip), %rdx     # 0xa2f62
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
movq %rbx, %rdi
callq 0x45c0
jmp 0x922e4
movl %r8d, %r12d
movl %edx, %ebp
movq %rsi, %r14
movl $0x880, %edi            # imm = 0x880
callq 0x4680
testq %rax, %rax
je 0x922e4
movq %rax, %rbx
movl $0x5, (%rax)
cmpl $0x5, %r12d
je 0x922f8
cmpl $0x4, %r12d
jne 0x9238b
leaq 0xbc(%rip), %rax        # 0x9239e
jmp 0x922ff
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x347(%rip), %rax      # 0x91fb8
leaq 0x1(%r14), %rcx
movq %rax, 0x28(%rbx)
leaq -0xef(%rip), %rax       # 0x9221f
movq %rax, 0x20(%rbx)
leaq -0xf0(%rip), %rax       # 0x92229
movq %rax, 0x58(%rbx)
movq %rcx, 0x8(%rsp)
movb (%r14), %al
movb %al, 0x60(%rbx)
cmpl $0x100, %r15d           # imm = 0x100
jne 0x92345
movl 0x1(%r14), %eax
leaq 0x5(%r14), %rcx
movq %rcx, 0x8(%rsp)
movl %ebp, %r13d
xorl %edx, %edx
jmp 0x9236f
movq 0x50(%rsp), %rax
movl %ebp, %r13d
leaq (%r14,%r13), %rsi
leaq 0x8(%rsp), %r15
leaq 0x14(%rsp), %r12
movq %r15, %rdi
movq %r12, %rdx
callq *0x18(%rax)
movq (%r15), %rcx
cmpl $0x0, (%r12)
setne %dl
movl %eax, 0x64(%rbx)
subq %r14, %rcx
cmpq %r13, %rcx
jne 0x92287
testb %dl, %dl
je 0x922e6
jmp 0x92287
leaq 0x10b7b(%rip), %rsi     # 0xa2f0d
leaq 0x10b95(%rip), %rdx     # 0xa2f2e
jmp 0x92295