// File: /workspace/github_c_makefile_star2_O1/aerospike[P]aerospike-common/src/main/aerospike/as_msgpack.c
// Function: pack_uint64
static inline int
pack_uint64(as_packer *pk, uint64_t val, bool resize)
{
	if (val < (1ULL << 7)) {
		return pack_byte(pk, (uint8_t)val, resize);
	}

	if (val < (1ULL << 8)) {
		return pack_type_uint8(pk, 0xcc, (uint8_t)val, resize);
	}

	if (val < (1ULL << 16)) {
		return pack_type_uint16(pk, 0xcd, (uint16_t)val, resize);
	}

	if (val < (1ULL << 32)) {
		return pack_type_uint32(pk, 0xce, (uint32_t)val, resize);
	}

	return pack_type_uint64(pk, 0xcf, val, resize);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rcx
movq %rdi, %rbx
cmpq $0x7f, %rsi
ja 0xbcd2
cmpq $0x0, 0x10(%rbx)
je 0xbcb8
movl 0x18(%rbx), %eax
incl %eax
cmpl 0x1c(%rbx), %eax
jbe 0xbcab
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %dl, %dl
je 0xbe84
movq %rbx, %rdi
movl $0x1, %esi
movq %rcx, %r14
callq 0xd771
movq %r14, %rcx
testl %eax, %eax
jne 0xbe84
movq 0x10(%rbx), %rax
movq %rcx, %rdx
movl 0x18(%rbx), %ecx
movb %dl, (%rax,%rcx)
movl 0x18(%rbx), %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
ja 0xbe84
incl %eax
jmp 0xbe7f
cmpq $0xff, %rcx
ja 0xbd42
cmpq $0x0, 0x10(%rbx)
je 0xbd27
movl 0x18(%rbx), %eax
addl $0x2, %eax
cmpl 0x1c(%rbx), %eax
jbe 0xbd15
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %dl, %dl
je 0xbe84
movq %rbx, %rdi
movl $0x2, %esi
movq %rcx, %r14
callq 0xd771
movq %r14, %rcx
testl %eax, %eax
jne 0xbe84
movq 0x10(%rbx), %rax
movq %rcx, %rdx
movl 0x18(%rbx), %ecx
movb $-0x34, (%rax,%rcx)
movb %dl, 0x1(%rax,%rcx)
movl 0x18(%rbx), %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x7ffffffd, %eax       # imm = 0x7FFFFFFD
ja 0xbe84
addl $0x2, %eax
jmp 0xbe7f
cmpq $0xffff, %rcx           # imm = 0xFFFF
ja 0xbdba
cmpq $0x0, 0x10(%rbx)
je 0xbd9f
movl 0x18(%rbx), %eax
addl $0x3, %eax
cmpl 0x1c(%rbx), %eax
jbe 0xbd85
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %dl, %dl
je 0xbe84
movq %rbx, %rdi
movl $0x3, %esi
movq %rcx, %r14
callq 0xd771
movq %r14, %rcx
testl %eax, %eax
jne 0xbe84
rolw $0x8, %cx
movq 0x10(%rbx), %rax
movq %rcx, %rdx
movl 0x18(%rbx), %ecx
movb $-0x33, (%rax,%rcx)
movb %dl, 0x1(%rax,%rcx)
movb %dh, 0x2(%rax,%rcx)
movl 0x18(%rbx), %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x7ffffffc, %eax       # imm = 0x7FFFFFFC
ja 0xbe84
addl $0x3, %eax
jmp 0xbe7f
movq %rcx, %rax
shrq $0x20, %rax
jne 0xbe25
cmpq $0x0, 0x10(%rbx)
je 0xbe11
movl 0x18(%rbx), %eax
addl $0x5, %eax
cmpl 0x1c(%rbx), %eax
jbe 0xbdfd
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %dl, %dl
je 0xbe84
movq %rbx, %rdi
movl $0x5, %esi
movq %rcx, %r14
callq 0xd771
movq %r14, %rcx
testl %eax, %eax
jne 0xbe84
bswapl %ecx
movq 0x10(%rbx), %rax
movq %rcx, %rdx
movl 0x18(%rbx), %ecx
movb $-0x32, (%rax,%rcx)
movl %edx, 0x1(%rax,%rcx)
movl 0x18(%rbx), %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x7ffffffa, %eax       # imm = 0x7FFFFFFA
ja 0xbe84
addl $0x5, %eax
jmp 0xbe7f
cmpq $0x0, 0x10(%rbx)
je 0xbe6d
movl 0x18(%rbx), %eax
addl $0x9, %eax
cmpl 0x1c(%rbx), %eax
jbe 0xbe57
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %dl, %dl
je 0xbe84
movq %rbx, %rdi
movl $0x9, %esi
movq %rcx, %r14
callq 0xd771
movq %r14, %rcx
testl %eax, %eax
jne 0xbe84
bswapq %rcx
movq 0x10(%rbx), %rax
movq %rcx, %rdx
movl 0x18(%rbx), %ecx
movb $-0x31, (%rax,%rcx)
movq %rdx, 0x1(%rax,%rcx)
movl 0x18(%rbx), %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x7ffffff6, %eax       # imm = 0x7FFFFFF6
ja 0xbe84
addl $0x9, %eax
movl %eax, 0x18(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq