// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: ltf8_put_blk
int ltf8_put_blk(cram_block *blk, int64_t val) {
    char buf[9];
    int sz;

    sz = ltf8_put(buf, val);
    BLOCK_APPEND(blk, buf, sz);
    return sz;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rax
movq %rdi, %rbx
cmpq $0x7f, %rsi
ja 0x4e91c
movb %al, 0xf(%rsp)
movl $0x1, %ebp
jmp 0x4eafe
cmpq $0x3fff, %rax           # imm = 0x3FFF
ja 0x4e93e
movl %eax, %ecx
shrl $0x8, %ecx
orb $-0x80, %cl
movb %cl, 0xf(%rsp)
movb %al, 0x10(%rsp)
movl $0x2, %ebp
jmp 0x4eafe
cmpq $0x1fffff, %rax         # imm = 0x1FFFFF
ja 0x4e964
movl %eax, %ecx
shrl $0x10, %ecx
orb $-0x40, %cl
movb %cl, 0xf(%rsp)
movb %ah, 0x10(%rsp)
movb %al, 0x11(%rsp)
movl $0x3, %ebp
jmp 0x4eafe
cmpq $0xfffffff, %rax        # imm = 0xFFFFFFF
ja 0x4e993
movl %eax, %ecx
shrl $0x18, %ecx
orb $-0x20, %cl
movb %cl, 0xf(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x10(%rsp)
movb %ah, 0x11(%rsp)
movb %al, 0x12(%rsp)
movl $0x4, %ebp
jmp 0x4eafe
movq %rax, %rcx
shrq $0x23, %rcx
jne 0x4e9ce
movq %rax, %rcx
shrq $0x20, %rcx
orb $-0x10, %cl
movb %cl, 0xf(%rsp)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0x10(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x11(%rsp)
movb %ah, 0x12(%rsp)
movb %al, 0x13(%rsp)
movl $0x5, %ebp
jmp 0x4eafe
movq %rax, %rcx
shrq $0x2a, %rcx
jne 0x4ea14
movq %rax, %rcx
shrq $0x28, %rcx
orb $-0x8, %cl
movb %cl, 0xf(%rsp)
movq %rax, %rcx
shrq $0x20, %rcx
movb %cl, 0x10(%rsp)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0x11(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x12(%rsp)
movb %ah, 0x13(%rsp)
movb %al, 0x14(%rsp)
movl $0x6, %ebp
jmp 0x4eafe
movq %rax, %rcx
shrq $0x31, %rcx
jne 0x4ea65
movq %rax, %rcx
shrq $0x30, %rcx
orb $-0x4, %cl
movb %cl, 0xf(%rsp)
movq %rax, %rcx
shrq $0x28, %rcx
movb %cl, 0x10(%rsp)
movq %rax, %rcx
shrq $0x20, %rcx
movb %cl, 0x11(%rsp)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0x12(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x13(%rsp)
movb %ah, 0x14(%rsp)
movb %al, 0x15(%rsp)
movl $0x7, %ebp
jmp 0x4eafe
movq %rax, %rcx
shrq $0x38, %rcx
jne 0x4eab5
movb $-0x2, 0xf(%rsp)
movq %rax, %rcx
shrq $0x30, %rcx
movb %cl, 0x10(%rsp)
movq %rax, %rcx
shrq $0x28, %rcx
movb %cl, 0x11(%rsp)
movq %rax, %rcx
shrq $0x20, %rcx
movb %cl, 0x12(%rsp)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0x13(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x14(%rsp)
movb %ah, 0x15(%rsp)
movb %al, 0x16(%rsp)
movl $0x8, %ebp
jmp 0x4eafe
movb $-0x1, 0xf(%rsp)
movb %cl, 0x10(%rsp)
movq %rax, %rcx
shrq $0x30, %rcx
movb %cl, 0x11(%rsp)
movq %rax, %rcx
shrq $0x28, %rcx
movb %cl, 0x12(%rsp)
movq %rax, %rcx
shrq $0x20, %rcx
movb %cl, 0x13(%rsp)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0x14(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x15(%rsp)
movb %ah, 0x16(%rsp)
movb %al, 0x17(%rsp)
movl $0x9, %ebp
movl %ebp, %r14d
movq 0x30(%rbx), %r15
addq %r14, %r15
movq 0x28(%rbx), %rax
cmpq %r15, %rax
ja 0x4eb45
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r15, %rax
cmovaq %rax, %r15
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x4eb6b
movq %r15, 0x28(%rbx)
movq %rax, 0x20(%rbx)
movq 0x20(%rbx), %rdi
addq 0x30(%rbx), %rdi
leaq 0xf(%rsp), %rsi
movq %r14, %rdx
callq 0x43c0
addq %r14, 0x30(%rbx)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x4eb5e