// File: /workspace/github_c_makefile_star2_O1/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, %ebp
movq %rsi, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
andl $0xffffff00, %ebp       # imm = 0xFFFFFF00
xorl %eax, %eax
cmpl $0x100, %ebp            # imm = 0x100
sete %al
leal (%rax,%rax,2), %eax
addl $0x2, %eax
leaq 0x10bf5(%rip), %r14     # 0xa57e2
cmpl %edx, %eax
jle 0x94c13
xorl %ebx, %ebx
leaq 0x10b93(%rip), %rsi     # 0xa578d
movl $0x1, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x14378
movq %rbx, %rdi
callq 0x45c0
jmp 0x94c4d
movl %r8d, %r13d
movl %edx, %r12d
movq %rsi, %r15
movl $0x880, %edi            # imm = 0x880
callq 0x4680
testq %rax, %rax
je 0x94c4d
movq %rax, %rbx
movl $0x5, (%rax)
cmpl $0x5, %r13d
je 0x94c61
cmpl $0x4, %r13d
jne 0x94ce8
leaq 0xa9(%rip), %rax        # 0x94cf4
jmp 0x94c68
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x31a(%rip), %rax      # 0x9494e
leaq 0x1(%r15), %rcx
movq %rax, 0x28(%rbx)
leaq -0xf1(%rip), %rax       # 0x94b86
movq %rax, 0x20(%rbx)
leaq -0xf2(%rip), %rax       # 0x94b90
movq %rax, 0x58(%rbx)
movq %rcx, 0x10(%rsp)
movb (%r15), %al
movb %al, 0x60(%rbx)
movl %r12d, %r12d
cmpl $0x100, %ebp            # imm = 0x100
jne 0x94cae
movl 0x1(%r15), %eax
movl %eax, 0x64(%rbx)
leaq 0x5(%r15), %rax
movq %rax, 0x10(%rsp)
jmp 0x94cc7
movq 0x50(%rsp), %rax
leaq (%r15,%r12), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq *0x18(%rax)
movl %eax, 0x64(%rbx)
movq 0x10(%rsp), %rax
subq %r15, %rax
cmpq %r12, %rax
jne 0x94bf3
cmpl $0x0, 0xc(%rsp)
je 0x94c4f
jmp 0x94bf3
leaq 0x10abf(%rip), %r14     # 0xa57ae
jmp 0x94bf3