// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/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;
    cram_codec *tc;
    cram_block *b_len, *b_val;

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

    tc = c->e_byte_array_len.len_codec; 
    b_len = cram_new_block(0, 0);
    len2 = tc->store(tc, b_len, NULL, version);

    tc = c->e_byte_array_len.val_codec;
    b_val = cram_new_block(0, 0);
    len3 = tc->store(tc, b_val, NULL, version);

    len += itf8_put_blk(b, c->codec);
    len += itf8_put_blk(b, len2+len3);
    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);

    return len + len2 + len3;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r13
testq %rdx, %rdx
je 0x8aae3
movq %rdx, %r15
movq %rdx, %rdi
callq 0x62d0
movq %rax, %r14
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rdx
leaq (%rdx,%r14), %rsi
cmpq %rsi, %rcx
ja 0x8aac7
movl $0x400, %r12d           # imm = 0x400
movq %rcx, %xmm0
punpckldq 0x15ac(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x15b4(%rip), %xmm0     # 0x8c020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x5e68(%rip), %xmm1     # 0x908e8
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
sarq $0x3f, %rdi
subsd 0xd73c(%rip), %xmm1     # 0x981d0
cvttsd2si %xmm1, %rsi
andq %rdi, %rsi
orq %rdx, %rsi
testq %rcx, %rcx
cmoveq %r12, %rsi
movq %rsi, 0x28(%rbx)
movq %rax, %rdi
callq 0x6c80
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rdx
leaq (%rdx,%r14), %rsi
cmpq %rsi, %rcx
jbe 0x8aa57
addq %rdx, %rax
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x6570
movq %r14, 0x10(%rsp)
addq %r14, 0x30(%rbx)
jmp 0x8aaec
movq $0x0, 0x10(%rsp)
movq 0x48(%r13), %r12
xorl %edi, %edi
xorl %esi, %esi
callq 0x56309
movq %rax, %r15
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
movl %ebp, %ecx
callq *0x28(%r12)
movl %eax, 0x8(%rsp)
movl %ebp, %r14d
movq 0x50(%r13), %rbp
xorl %edi, %edi
xorl %esi, %esi
callq 0x56309
movq %rax, %r12
movq %rbp, %rdi
movq %rax, %rsi
xorl %edx, %edx
movl %r14d, %ecx
callq *0x28(%rbp)
movl %eax, %ebp
movl (%r13), %esi
movq %rbx, %rdi
callq 0x55da8
movl %eax, 0xc(%rsp)
addl 0x8(%rsp), %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x55da8
movl %eax, 0x8(%rsp)
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rsi
movq 0x30(%r15), %rdx
leaq (%rdx,%rsi), %rdi
cmpq %rdi, %rcx
ja 0x8abe7
movl $0x400, %r13d           # imm = 0x400
movq %rcx, %xmm0
punpckldq 0x1490(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1498(%rip), %xmm0     # 0x8c020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x5d4c(%rip), %xmm1     # 0x908e8
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
sarq $0x3f, %rdi
subsd 0xd620(%rip), %xmm1     # 0x981d0
cvttsd2si %xmm1, %rsi
andq %rdi, %rsi
orq %rdx, %rsi
testq %rcx, %rcx
cmoveq %r13, %rsi
movq %rsi, 0x28(%rbx)
movq %rax, %rdi
callq 0x6c80
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rsi
movq 0x30(%r15), %rdx
leaq (%rdx,%rsi), %rdi
cmpq %rdi, %rcx
jbe 0x8ab73
addq %rsi, %rax
movq 0x20(%r15), %rsi
movq %rax, %rdi
callq 0x6570
movq 0x30(%rbx), %rsi
addq 0x30(%r15), %rsi
movq %rsi, 0x30(%rbx)
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
movq 0x30(%r12), %rdx
leaq (%rdx,%rsi), %rdi
cmpq %rdi, %rcx
movq 0x10(%rsp), %r14
ja 0x8ac98
movl $0x400, %r13d           # imm = 0x400
movq %rcx, %xmm0
punpckldq 0x13e0(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x13e8(%rip), %xmm0     # 0x8c020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x5c9c(%rip), %xmm1     # 0x908e8
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
sarq $0x3f, %rdi
subsd 0xd570(%rip), %xmm1     # 0x981d0
cvttsd2si %xmm1, %rsi
andq %rdi, %rsi
orq %rdx, %rsi
testq %rcx, %rcx
cmoveq %r13, %rsi
movq %rsi, 0x28(%rbx)
movq %rax, %rdi
callq 0x6c80
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rsi
movq 0x30(%r12), %rdx
leaq (%rdx,%rsi), %rdi
cmpq %rdi, %rcx
jbe 0x8ac23
addq %rsi, %rax
movq 0x20(%r12), %rsi
movq %rax, %rdi
callq 0x6570
movq 0x30(%r12), %rax
addq %rax, 0x30(%rbx)
movq %r15, %rdi
callq 0x56a50
movq %r12, %rdi
callq 0x56a50
addl %r14d, %ebp
movl 0xc(%rsp), %eax
addl 0x8(%rsp), %eax
addl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq