// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x1c(%rbp), %eax
movl -0x28(%rbp), %esi
sarl $0x8, %esi
movl $0x2, %ecx
movl $0x5, %edx
cmpl $0x1, %esi
cmovel %edx, %ecx
cmpl %ecx, %eax
jge 0xeba7b
jmp 0xebbdf
movl $0x880, %edi            # imm = 0x880
callq 0x4650
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0xeba9c
movq $0x0, -0x8(%rbp)
jmp 0xebc0a
movq -0x30(%rbp), %rax
movl $0x5, (%rax)
movl -0x24(%rbp), %eax
movl %eax, -0x40(%rbp)
subl $0x4, %eax
je 0xebace
jmp 0xebab3
movl -0x40(%rbp), %eax
subl $0x5, %eax
jne 0xebadf
jmp 0xebabd
movq -0x30(%rbp), %rax
leaq -0x398(%rip), %rcx      # 0xeb730
movq %rcx, 0x28(%rax)
jmp 0xebb0f
movq -0x30(%rbp), %rax
leaq 0x147(%rip), %rcx       # 0xebc20
movq %rcx, 0x28(%rax)
jmp 0xebb0f
movl $0x1, %edi
leaq 0xd87a(%rip), %rsi      # 0xf9365
leaq 0xd894(%rip), %rdx      # 0xf9386
movb $0x0, %al
callq 0x1b030
movq -0x30(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x8(%rbp)
jmp 0xebc0a
movq -0x30(%rbp), %rax
leaq -0x17a(%rip), %rcx      # 0xeb9a0
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rax
leaq -0x159(%rip), %rcx      # 0xeb9d0
movq %rcx, 0x58(%rax)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb (%rax), %cl
movq -0x30(%rbp), %rax
movb %cl, 0x60(%rax)
movl -0x28(%rbp), %eax
sarl $0x8, %eax
cmpl $0x1, %eax
jne 0xebb93
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
movq -0x38(%rbp), %rax
movzbl 0x1(%rax), %eax
shll $0x8, %eax
addl %eax, %ecx
movq -0x38(%rbp), %rax
movzbl 0x2(%rax), %eax
shll $0x10, %eax
addl %eax, %ecx
movq -0x38(%rbp), %rax
movzbl 0x3(%rax), %eax
shll $0x18, %eax
addl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x64(%rax)
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
jmp 0xebbb9
movq 0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rsi
movslq -0x1c(%rbp), %rcx
addq %rcx, %rsi
leaq -0x38(%rbp), %rdi
leaq -0x3c(%rbp), %rdx
callq *%rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x64(%rax)
movq -0x38(%rbp), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
movslq -0x1c(%rbp), %rcx
cmpq %rcx, %rax
jne 0xebbd3
cmpl $0x0, -0x3c(%rbp)
je 0xebbd5
jmp 0xebbdf
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xebc0a
movl $0x1, %edi
leaq 0xd77a(%rip), %rsi      # 0xf9365
leaq 0xd7c8(%rip), %rdx      # 0xf93ba
movb $0x0, %al
callq 0x1b030
movq -0x30(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)