// File: /workspace/github_c_makefile_star2_O2/icebert[P]pblat/htslib/cram/cram_codecs.c
// Function: cram_byte_array_stop_encode_store
int cram_byte_array_stop_encode_store(cram_codec *c, cram_block *b,
				      char *prefix, int version) {
    int len = 0;
    char buf[20], *cp = buf;

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

    cp += itf8_put(cp, c->codec);

    if (CRAM_MAJOR_VERS(version) == 1) {
	cp += itf8_put(cp, 5);
	*cp++ = c->e_byte_array_stop.stop;
	*cp++ = (c->e_byte_array_stop.content_id >>  0) & 0xff;
	*cp++ = (c->e_byte_array_stop.content_id >>  8) & 0xff;
	*cp++ = (c->e_byte_array_stop.content_id >> 16) & 0xff;
	*cp++ = (c->e_byte_array_stop.content_id >> 24) & 0xff;
    } else {
	cp += itf8_put(cp, 1 + itf8_size(c->e_byte_array_stop.content_id));
	*cp++ = c->e_byte_array_stop.stop;
	cp += itf8_put(cp, c->e_byte_array_stop.content_id);
    }

    BLOCK_APPEND(b, buf, cp-buf);
    len += cp-buf;

    return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x79a5b
movq %rdx, %r12
movq %rdx, %rdi
callq 0x62d0
movq %rax, %r13
movl $0x400, %ebp            # imm = 0x400
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdi
leaq (%rdi,%r13), %rcx
cmpq %rcx, %rax
ja 0x79a43
movq %rax, %xmm0
punpckldq 0x1622(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x162a(%rip), %xmm0     # 0x7b020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x5dde(%rip), %xmm1     # 0x7f7e8
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
subsd 0xd6b6(%rip), %xmm1     # 0x870d0
cvttsd2si %xmm1, %rsi
sarq $0x3f, %rdx
andq %rdx, %rsi
orq %rcx, %rsi
testq %rax, %rax
cmoveq %rbp, %rsi
movq %rsi, 0x28(%rbx)
movq 0x20(%rbx), %rdi
callq 0x6c80
movq %rax, 0x20(%rbx)
jmp 0x799d0
addq 0x20(%rbx), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x6570
addq %r13, 0x30(%rbx)
movslq %r13d, %r12
jmp 0x79a5e
xorl %r12d, %r12d
movl (%r14), %eax
cmpl $0x7f, %eax
ja 0x79a70
leaq 0x1(%rsp), %rbp
jmp 0x79af5
cmpl $0x3fff, %eax           # imm = 0x3FFF
ja 0x79a89
leaq 0x2(%rsp), %rbp
movl %eax, %ecx
shrl $0x8, %ecx
orb $-0x80, %cl
movb %cl, -0x2(%rbp)
jmp 0x79af5
cmpl $0x1fffff, %eax         # imm = 0x1FFFFF
ja 0x79aa6
leaq 0x3(%rsp), %rbp
movl %eax, %ecx
shrl $0x10, %ecx
orb $-0x40, %cl
movb %cl, -0x3(%rbp)
movb %ah, 0x1(%rsp)
jmp 0x79af5
cmpl $0xfffffff, %eax        # imm = 0xFFFFFFF
ja 0x79acb
leaq 0x4(%rsp), %rbp
movl %eax, %ecx
shrl $0x18, %ecx
orb $-0x20, %cl
movb %cl, -0x4(%rbp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, -0x3(%rbp)
movb %ah, 0x2(%rsp)
jmp 0x79af5
leaq 0x5(%rsp), %rbp
movl %eax, %ecx
shrl $0x1c, %ecx
orb $-0x10, %cl
movb %cl, -0x5(%rbp)
movl %eax, %ecx
shrl $0x14, %ecx
movb %cl, -0x4(%rbp)
movl %eax, %ecx
shrl $0xc, %ecx
movb %cl, -0x3(%rbp)
movl %eax, %ecx
shrl $0x4, %ecx
movb %cl, -0x2(%rbp)
andb $0xf, %al
movb %al, -0x1(%rbp)
andl $0xffffff00, %r15d      # imm = 0xFFFFFF00
cmpl $0x100, %r15d           # imm = 0x100
jne 0x79b23
movb $0x5, (%rbp)
movb 0x30(%r14), %al
movb %al, 0x1(%rbp)
movl 0x34(%r14), %eax
movl %eax, 0x2(%rbp)
addq $0x6, %rbp
jmp 0x79bf9
movl 0x34(%r14), %eax
cmpl $0x80, %eax
jae 0x79b43
movb $0x2, (%rbp)
movb 0x30(%r14), %cl
movb %cl, 0x1(%rbp)
movb %al, 0x2(%rbp)
pushq $0x1
jmp 0x79bf1
cmpl $0x4000, %eax           # imm = 0x4000
jae 0x79b6a
movb $0x3, (%rbp)
movb 0x30(%r14), %cl
movb %cl, 0x1(%rbp)
movl %eax, %ecx
shrl $0x8, %ecx
orb $-0x80, %cl
movb %cl, 0x2(%rbp)
movb %al, 0x3(%rbp)
pushq $0x2
jmp 0x79bf1
cmpl $0x200000, %eax         # imm = 0x200000
jae 0x79b91
movb $0x4, (%rbp)
movb 0x30(%r14), %cl
movb %cl, 0x1(%rbp)
movl %eax, %ecx
shrl $0x10, %ecx
orb $-0x40, %cl
movb %cl, 0x2(%rbp)
movb %ah, 0x3(%rbp)
movb %al, 0x4(%rbp)
pushq $0x3
jmp 0x79bf1
cmpl $0x10000000, %eax       # imm = 0x10000000
movb $0x6, %cl
sbbb $0x0, %cl
movb %cl, (%rbp)
movb 0x30(%r14), %cl
movb %cl, 0x1(%rbp)
movl %eax, %ecx
cmpl $0xfffffff, %eax        # imm = 0xFFFFFFF
ja 0x79bc9
shrl $0x18, %ecx
orb $-0x20, %cl
movb %cl, 0x2(%rbp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x3(%rbp)
movb %ah, 0x4(%rbp)
movb %al, 0x5(%rbp)
pushq $0x4
jmp 0x79bf1
shrl $0x1c, %ecx
orb $-0x10, %cl
movb %cl, 0x2(%rbp)
movl %eax, %ecx
shrl $0x14, %ecx
movb %cl, 0x3(%rbp)
movl %eax, %ecx
shrl $0xc, %ecx
movb %cl, 0x4(%rbp)
movl %eax, %ecx
shrl $0x4, %ecx
movb %cl, 0x5(%rbp)
andb $0xf, %al
movb %al, 0x6(%rbp)
pushq $0x5
popq %rax
addq %rax, %rbp
addq $0x2, %rbp
movq %rsp, %rax
subq %rax, %rbp
movl $0x400, %r14d           # imm = 0x400
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdi
leaq (%rdi,%rbp), %rcx
cmpq %rcx, %rax
ja 0x79c78
movq %rax, %xmm0
punpckldq 0x13ed(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x13f5(%rip), %xmm0     # 0x7b020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x5ba9(%rip), %xmm1     # 0x7f7e8
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
subsd 0xd481(%rip), %xmm1     # 0x870d0
cvttsd2si %xmm1, %rsi
sarq $0x3f, %rdx
andq %rdx, %rsi
orq %rcx, %rsi
testq %rax, %rax
cmoveq %r14, %rsi
movq %rsi, 0x28(%rbx)
movq 0x20(%rbx), %rdi
callq 0x6c80
movq %rax, 0x20(%rbx)
jmp 0x79c05
addq 0x20(%rbx), %rdi
movq %rsp, %rsi
movq %rbp, %rdx
callq 0x6570
addq %rbp, 0x30(%rbx)
addl %r12d, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq