// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: cram_block_size
uint32_t cram_block_size(cram_block *b) {
    unsigned char dat[100], *cp = dat;;
    uint32_t sz;

    *cp++ = b->method;
    *cp++ = b->content_type;
    cp += itf8_put((char*)cp, b->content_id);
    cp += itf8_put((char*)cp, b->comp_size);
    cp += itf8_put((char*)cp, b->uncomp_size);

    sz = cp-dat + 4;
    sz += b->method == RAW ? b->uncomp_size : b->comp_size;

    return sz;
}

// Assembly:
pushq %rbx
movl (%rdi), %ecx
leaq -0x6e(%rsp), %rax
movb %cl, -0x2(%rax)
movb 0x8(%rdi), %dl
movb %dl, -0x1(%rax)
movl 0xc(%rdi), %edx
cmpl $0x7f, %edx
ja 0x4f13d
movb %dl, -0x6e(%rsp)
movl $0x1, %edx
jmp 0x4f1e7
movl %edx, %esi
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x4f161
shrl $0x8, %esi
orb $-0x80, %sil
movb %sil, -0x6e(%rsp)
movb %dl, -0x6d(%rsp)
movl $0x2, %edx
jmp 0x4f1e7
cmpl $0x1fffff, %edx         # imm = 0x1FFFFF
ja 0x4f184
shrl $0x10, %esi
orb $-0x40, %sil
movb %sil, -0x6e(%rsp)
movb %dh, -0x6d(%rsp)
movb %dl, -0x6c(%rsp)
movl $0x3, %edx
jmp 0x4f1e7
cmpl $0xfffffff, %edx        # imm = 0xFFFFFFF
ja 0x4f1b1
shrl $0x18, %esi
orb $-0x20, %sil
movb %sil, -0x6e(%rsp)
movl %edx, %esi
shrl $0x10, %esi
movb %sil, -0x6d(%rsp)
movb %dh, -0x6c(%rsp)
movb %dl, -0x6b(%rsp)
movl $0x4, %edx
jmp 0x4f1e7
shrl $0x1c, %esi
orb $-0x10, %sil
movb %sil, -0x6e(%rsp)
movl %edx, %esi
shrl $0x14, %esi
movb %sil, -0x6d(%rsp)
movl %edx, %esi
shrl $0xc, %esi
movb %sil, -0x6c(%rsp)
movl %edx, %esi
shrl $0x4, %esi
movb %sil, -0x6b(%rsp)
andb $0xf, %dl
movb %dl, -0x6a(%rsp)
movl $0x5, %edx
addq %rdx, %rax
movl 0x10(%rdi), %edx
cmpl $0x7f, %edx
ja 0x4f1fe
movb %dl, (%rax)
movl $0x1, %esi
jmp 0x4f293
movl %edx, %esi
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x4f21c
shrl $0x8, %esi
orb $-0x80, %sil
movb %sil, (%rax)
movb %dl, 0x1(%rax)
movl $0x2, %esi
jmp 0x4f293
cmpl $0x1fffff, %edx         # imm = 0x1FFFFF
ja 0x4f23b
shrl $0x10, %esi
orb $-0x40, %sil
movb %sil, (%rax)
movb %dh, 0x1(%rax)
movb %dl, 0x2(%rax)
movl $0x3, %esi
jmp 0x4f293
cmpl $0xfffffff, %edx        # imm = 0xFFFFFFF
ja 0x4f263
shrl $0x18, %esi
orb $-0x20, %sil
movb %sil, (%rax)
movl %edx, %esi
shrl $0x10, %esi
movb %sil, 0x1(%rax)
movb %dh, 0x2(%rax)
movb %dl, 0x3(%rax)
movl $0x4, %esi
jmp 0x4f293
shrl $0x1c, %esi
orb $-0x10, %sil
movb %sil, (%rax)
movl %edx, %esi
shrl $0x14, %esi
movb %sil, 0x1(%rax)
movl %edx, %esi
shrl $0xc, %esi
movb %sil, 0x2(%rax)
movl %edx, %esi
shrl $0x4, %esi
movb %sil, 0x3(%rax)
andb $0xf, %dl
movb %dl, 0x4(%rax)
movl $0x5, %esi
leaq 0x10(%rdi), %rdx
addq %rsi, %rax
movl 0x14(%rdi), %ebx
addq $0x14, %rdi
cmpl $0x7f, %ebx
ja 0x4f2b2
movb %bl, (%rax)
movl $0x1, %esi
jmp 0x4f347
movl %ebx, %esi
cmpl $0x3fff, %ebx           # imm = 0x3FFF
ja 0x4f2d0
shrl $0x8, %esi
orb $-0x80, %sil
movb %sil, (%rax)
movb %bl, 0x1(%rax)
movl $0x2, %esi
jmp 0x4f347
cmpl $0x1fffff, %ebx         # imm = 0x1FFFFF
ja 0x4f2ef
shrl $0x10, %esi
orb $-0x40, %sil
movb %sil, (%rax)
movb %bh, 0x1(%rax)
movb %bl, 0x2(%rax)
movl $0x3, %esi
jmp 0x4f347
cmpl $0xfffffff, %ebx        # imm = 0xFFFFFFF
ja 0x4f317
shrl $0x18, %esi
orb $-0x20, %sil
movb %sil, (%rax)
movl %ebx, %esi
shrl $0x10, %esi
movb %sil, 0x1(%rax)
movb %bh, 0x2(%rax)
movb %bl, 0x3(%rax)
movl $0x4, %esi
jmp 0x4f347
shrl $0x1c, %esi
orb $-0x10, %sil
movb %sil, (%rax)
movl %ebx, %esi
shrl $0x14, %esi
movb %sil, 0x1(%rax)
movl %ebx, %esi
shrl $0xc, %esi
movb %sil, 0x2(%rax)
movl %ebx, %esi
shrl $0x4, %esi
movb %sil, 0x3(%rax)
andb $0xf, %bl
movb %bl, 0x4(%rax)
movl $0x5, %esi
testl %ecx, %ecx
cmoveq %rdi, %rdx
movl (%rdx), %ecx
addl %esi, %eax
leaq -0x70(%rsp), %rdx
subl %edx, %eax
addl %ecx, %eax
addl $0x4, %eax
popq %rbx
retq