// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_byte_array_len_encode_store
int cram_byte_array_len_encode_store(cram_codec *c, cram_block *b,
                                     char *prefix, int version) {
    int len = 0, len2, len3, r = 0, n;
    cram_codec *tc;
    cram_block *b_len = NULL, *b_val = NULL;

    if (prefix) {
        size_t l = strlen(prefix);
        BLOCK_APPEND(b, prefix, l);
        len += l;
    }

    tc = c->u.e_byte_array_len.len_codec;
    b_len = cram_new_block(0, 0);
    if (!b_len) goto block_err;
    len2 = tc->store(tc, b_len, NULL, version);
    if (len2 < 0) goto block_err;

    tc = c->u.e_byte_array_len.val_codec;
    b_val = cram_new_block(0, 0);
    if (!b_val) goto block_err;
    len3 = tc->store(tc, b_val, NULL, version);
    if (len3 < 0) goto block_err;

    len += (n = c->vv->varint_put32_blk(b, c->codec));  r |= n;
    len += (n = c->vv->varint_put32_blk(b, len2+len3)); r |= n;
    BLOCK_APPEND(b, BLOCK_DATA(b_len), BLOCK_SIZE(b_len));
    BLOCK_APPEND(b, BLOCK_DATA(b_val), BLOCK_SIZE(b_val));

    cram_free_block(b_len);
    cram_free_block(b_val);

    if (r > 0)
        return len + len2 + len3;

 block_err:
    if (b_len) cram_free_block(b_len);
    if (b_val) cram_free_block(b_val);
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xeb472
movq -0x20(%rbp), %rdi
callq 0x41b0
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0xe2300
cmpl $0x0, %eax
jge 0xeb464
jmp 0xeb5c5
movq -0x58(%rbp), %rcx
movslq -0x28(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movq %rax, -0x40(%rbp)
xorl %esi, %esi
movl %esi, %edi
callq 0x6ede0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0xeb497
jmp 0xeb5c5
movq -0x40(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0x24(%rbp), %ecx
xorl %edx, %edx
callq *%rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jge 0xeb4bc
jmp 0xeb5c5
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x40(%rbp)
xorl %esi, %esi
movl %esi, %edi
callq 0x6ede0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0xeb4e4
jmp 0xeb5c5
movq -0x40(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x24(%rbp), %ecx
xorl %edx, %edx
callq *%rax
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jge 0xeb509
jmp 0xeb5c5
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x58(%rax), %rax
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl (%rcx), %esi
callq *%rax
movl %eax, -0x38(%rbp)
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x38(%rbp), %eax
orl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x58(%rax), %rax
movq -0x18(%rbp), %rdi
movl -0x2c(%rbp), %esi
addl -0x30(%rbp), %esi
callq *%rax
movl %eax, -0x38(%rbp)
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x38(%rbp), %eax
orl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x48(%rbp), %rax
movq 0x30(%rax), %rdx
callq 0xe2300
cmpl $0x0, %eax
jge 0xeb57d
jmp 0xeb5c5
movq -0x18(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x50(%rbp), %rax
movq 0x30(%rax), %rdx
callq 0xe2300
cmpl $0x0, %eax
jge 0xeb59d
jmp 0xeb5c5
movq -0x48(%rbp), %rdi
callq 0x6f940
movq -0x50(%rbp), %rdi
callq 0x6f940
cmpl $0x0, -0x34(%rbp)
jle 0xeb5c3
movl -0x28(%rbp), %eax
addl -0x2c(%rbp), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xeb5ec
jmp 0xeb5c5
cmpq $0x0, -0x48(%rbp)
je 0xeb5d5
movq -0x48(%rbp), %rdi
callq 0x6f940
cmpq $0x0, -0x50(%rbp)
je 0xeb5e5
movq -0x50(%rbp), %rdi
callq 0x6f940
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)