// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_external_encode_store
int cram_external_encode_store(cram_codec *c, cram_block *b, char *prefix,
			       int version) {
    char tmp[99], *tp = tmp;
    int len = 0;

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

    tp += itf8_put(tp, c->e_external.content_id);
    len += itf8_put_blk(b, c->codec);
    len += itf8_put_blk(b, tp-tmp);
    BLOCK_APPEND(b, tmp, tp-tmp);
    len += tp-tmp;

    return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %r15
testq %rdx, %rdx
je 0x87e4d
movq %rdx, %r12
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 0x87e36
movl $0x400, %r13d           # imm = 0x400
movq %rcx, %xmm0
punpckldq 0x423d(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x4245(%rip), %xmm0     # 0x8c020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x8af9(%rip), %xmm1     # 0x908e8
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
sarq $0x3f, %rdi
subsd 0x103cd(%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), %rdx
leaq (%rdx,%r14), %rsi
cmpq %rsi, %rcx
jbe 0x87dc6
addq %rdx, %rax
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x6570
addq %r14, 0x30(%rbx)
jmp 0x87e50
xorl %r14d, %r14d
movl 0x30(%r15), %eax
cmpl $0x7f, %eax
ja 0x87e67
movb %al, (%rsp)
movl $0x1, %r12d
jmp 0x87efe
movl %eax, %ecx
cmpl $0x3fff, %eax           # imm = 0x3FFF
ja 0x87e85
shrl $0x8, %ecx
orb $-0x80, %cl
movb %cl, (%rsp)
movb %al, 0x1(%rsp)
movl $0x2, %r12d
jmp 0x87efe
cmpl $0x1fffff, %eax         # imm = 0x1FFFFF
ja 0x87ea5
shrl $0x10, %ecx
orb $-0x40, %cl
movb %cl, (%rsp)
movb %ah, 0x1(%rsp)
movb %al, 0x2(%rsp)
movl $0x3, %r12d
jmp 0x87efe
cmpl $0xfffffff, %eax        # imm = 0xFFFFFFF
ja 0x87ece
shrl $0x18, %ecx
orb $-0x20, %cl
movb %cl, (%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x1(%rsp)
movb %ah, 0x2(%rsp)
movb %al, 0x3(%rsp)
movl $0x4, %r12d
jmp 0x87efe
shrl $0x1c, %ecx
orb $-0x10, %cl
movb %cl, (%rsp)
movl %eax, %ecx
shrl $0x14, %ecx
movb %cl, 0x1(%rsp)
movl %eax, %ecx
shrl $0xc, %ecx
movb %cl, 0x2(%rsp)
movl %eax, %ecx
shrl $0x4, %ecx
movb %cl, 0x3(%rsp)
andb $0xf, %al
movb %al, 0x4(%rsp)
movl $0x5, %r12d
movl (%r15), %esi
movq %rbx, %rdi
callq 0x55da8
movl %eax, %ebp
movq %rbx, %rdi
movl %r12d, %esi
callq 0x55da8
movl %eax, %r15d
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rdx
leaq (%rdx,%r12), %rsi
cmpq %rsi, %rcx
ja 0x87fa4
movl $0x400, %r13d           # imm = 0x400
movq %rcx, %xmm0
punpckldq 0x40cf(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x40d7(%rip), %xmm0     # 0x8c020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x898b(%rip), %xmm1     # 0x908e8
cvttsd2si %xmm1, %rdx
movq %rdx, %rdi
sarq $0x3f, %rdi
subsd 0x1025f(%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), %rdx
leaq (%rdx,%r12), %rsi
cmpq %rsi, %rcx
jbe 0x87f34
addq %rdx, %rax
movq %rsp, %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x6570
addq %r12, 0x30(%rbx)
addl %r12d, %r14d
addl %r15d, %ebp
addl %r14d, %ebp
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq