// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.h
// Function: append_uint64
static inline unsigned char *append_uint64(unsigned char *cp, uint64_t i) {
    uint64_t j;

    if (i <= 0xffffffff)
        return append_uint32(cp, i);

    if ((j = i/1000000000) > 1000000000) {
        cp = append_uint32(cp, j/1000000000);
        j %= 1000000000;
        cp = append_sub32(cp, j);
    } else {
        cp = append_uint32(cp, i / 1000000000);
    }
    cp = append_sub32(cp, i % 1000000000);

    return cp;
}

// Assembly:
movq %rsi, %rax
shrq $0x20, %rax
jne 0x3f799
jmp 0x40879
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
shrq $0x9, %rax
movabsq $0x44b82fa09b5a53, %rcx # imm = 0x44B82FA09B5A53
mulq %rcx
movq %rdx, %rbx
shrq $0xb, %rbx
imulq $0x3b9aca00, %rbx, %rax # imm = 0x3B9ACA00
movq %rsi, %r14
subq %rax, %r14
movabsq $0xde0b6b3e2feca00, %rax # imm = 0xDE0B6B3E2FECA00
cmpq %rax, %rsi
jb 0x3f8df
shrq $0x12, %rsi
movabsq $0x49c97747490f, %rcx   # imm = 0x49C97747490F
movq %rsi, %rax
mulq %rcx
shrl $0x18, %edx
movl %edx, %esi
callq 0x40879
movq %rax, %rcx
movabsq $0x44b82fa0a, %rdx      # imm = 0x44B82FA0A
movq %rbx, %rax
mulq %rdx
imulq $0x3b9aca00, %rdx, %rax # imm = 0x3B9ACA00
subq %rax, %rbx
imulq $0x2af31dc5, %rbx, %rax # imm = 0x2AF31DC5
shrq $0x38, %rax
imull $0x5f5e100, %eax, %edx  # imm = 0x5F5E100
orb $0x30, %al
movb %al, (%rcx)
subl %edx, %ebx
imulq $0x6b5fca7, %rbx, %rax  # imm = 0x6B5FCA7
shrq $0x32, %rax
imull $0x989680, %eax, %edx   # imm = 0x989680
orb $0x30, %al
movb %al, 0x1(%rcx)
subl %edx, %ebx
imulq $0x10c6f7b, %rbx, %rax  # imm = 0x10C6F7B
shrq $0x2c, %rax
leal 0x30(%rax), %edx
movb %dl, 0x2(%rcx)
imull $0xf4240, %eax, %eax    # imm = 0xF4240
subl %eax, %ebx
imulq $0xa7c5b, %rbx, %rax    # imm = 0xA7C5B
shrq $0x24, %rax
imull $0x186a0, %eax, %edx    # imm = 0x186A0
orb $0x30, %al
movb %al, 0x3(%rcx)
subl %edx, %ebx
imulq $0x68db9, %rbx, %rax    # imm = 0x68DB9
shrq $0x20, %rax
imull $0x2710, %eax, %edx     # imm = 0x2710
orb $0x30, %al
movb %al, 0x4(%rcx)
subl %edx, %ebx
imulq $0x418938, %rbx, %rax   # imm = 0x418938
shrq $0x20, %rax
leal 0x30(%rax), %edx
movb %dl, 0x5(%rcx)
imull $0x3e8, %eax, %eax      # imm = 0x3E8
subl %eax, %ebx
imulq $0x28f5c29, %rbx, %rax  # imm = 0x28F5C29
shrq $0x20, %rax
imull $0x64, %eax, %edx
orb $0x30, %al
movb %al, 0x6(%rcx)
subl %edx, %ebx
imulq $0x1999999a, %rbx, %rax # imm = 0x1999999A
shrq $0x20, %rax
movl %eax, %edx
orb $0x30, %dl
movb %dl, 0x7(%rcx)
addl %eax, %eax
leal (%rax,%rax,4), %eax
subl %eax, %ebx
orb $0x30, %bl
movb %bl, 0x8(%rcx)
addq $0x9, %rcx
jmp 0x3f8e9
movl %ebx, %esi
callq 0x40879
movq %rax, %rcx
movl %r14d, %eax
imulq $0x55e63b89, %rax, %rax # imm = 0x55E63B89
shrq $0x39, %rax
imull $0x5f5e100, %eax, %edx  # imm = 0x5F5E100
orb $0x30, %al
movb %al, (%rcx)
subl %edx, %r14d
imulq $0x6b5fca7, %r14, %rax  # imm = 0x6B5FCA7
shrq $0x32, %rax
imull $0x989680, %eax, %edx   # imm = 0x989680
orb $0x30, %al
movb %al, 0x1(%rcx)
subl %edx, %r14d
imulq $0x10c6f7b, %r14, %rax  # imm = 0x10C6F7B
shrq $0x2c, %rax
leal 0x30(%rax), %edx
movb %dl, 0x2(%rcx)
imull $0xf4240, %eax, %eax    # imm = 0xF4240
subl %eax, %r14d
imulq $0xa7c5b, %r14, %rax    # imm = 0xA7C5B
shrq $0x24, %rax
imull $0x186a0, %eax, %edx    # imm = 0x186A0
orb $0x30, %al
movb %al, 0x3(%rcx)
subl %edx, %r14d
imulq $0x68db9, %r14, %rax    # imm = 0x68DB9
shrq $0x20, %rax
imull $0x2710, %eax, %edx     # imm = 0x2710
orb $0x30, %al
movb %al, 0x4(%rcx)
subl %edx, %r14d
imulq $0x418938, %r14, %rax   # imm = 0x418938
shrq $0x20, %rax
leal 0x30(%rax), %edx
movb %dl, 0x5(%rcx)
imull $0x3e8, %eax, %eax      # imm = 0x3E8
subl %eax, %r14d
imulq $0x28f5c29, %r14, %rax  # imm = 0x28F5C29
shrq $0x20, %rax
imull $0x64, %eax, %edx
orb $0x30, %al
movb %al, 0x6(%rcx)
subl %edx, %r14d
imulq $0x1999999a, %r14, %rax # imm = 0x1999999A
shrq $0x20, %rax
movl %eax, %edx
orb $0x30, %dl
movb %dl, 0x7(%rcx)
addl %eax, %eax
leal (%rax,%rax,4), %eax
subl %eax, %r14d
orb $0x30, %r14b
movb %r14b, 0x8(%rcx)
addq $0x9, %rcx
movq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq