// File: /workspace/github_c_makefile_star2_O3/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 %rdi, %rbx
cmpq $0x7f, %rsi
ja 0xbb0e
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0xbaf4
movl 0x18(%rbx), %ecx
movq %rsi, %r14
leal 0x1(%rcx), %esi
cmpl 0x1c(%rbx), %esi
jbe 0xbaee
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %dl, %dl
je 0xbcbe
movq %rbx, %rdi
movl $0x1, %esi
callq 0xd5db
testl %eax, %eax
jne 0xbcbe
movq 0x10(%rbx), %rax
movl 0x18(%rbx), %ecx
movl %ecx, %ecx
movb %r14b, (%rax,%rcx)
movl 0x18(%rbx), %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
ja 0xbcbe
incl %eax
jmp 0xbcb9
cmpq $0xff, %rsi
ja 0xbb7d
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0xbb62
movl 0x18(%rbx), %ecx
movq %rsi, %r14
leal 0x2(%rcx), %esi
cmpl 0x1c(%rbx), %esi
jbe 0xbb57
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %dl, %dl
je 0xbcbe
movq %rbx, %rdi
movl $0x2, %esi
callq 0xd5db
testl %eax, %eax
jne 0xbcbe
movq 0x10(%rbx), %rax
movl 0x18(%rbx), %ecx
movl %ecx, %ecx
movb $-0x34, (%rax,%rcx)
movb %r14b, 0x1(%rax,%rcx)
movl 0x18(%rbx), %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x7ffffffd, %eax       # imm = 0x7FFFFFFD
ja 0xbcbe
addl $0x2, %eax
jmp 0xbcb9
cmpq $0xffff, %rsi           # imm = 0xFFFF
ja 0xbbf6
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0xbbdb
movl 0x18(%rbx), %ecx
movq %rsi, %r14
leal 0x3(%rcx), %esi
cmpl 0x1c(%rbx), %esi
jbe 0xbbc6
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %dl, %dl
je 0xbcbe
movq %rbx, %rdi
movl $0x3, %esi
callq 0xd5db
testl %eax, %eax
jne 0xbcbe
movq 0x10(%rbx), %rax
movl 0x18(%rbx), %ecx
movq %r14, %rdx
movl %ecx, %ecx
rolw $0x8, %dx
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 0xbcbe
addl $0x3, %eax
jmp 0xbcb9
movq %rsi, %rax
shrq $0x20, %rax
jne 0xbc61
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0xbc4d
movl 0x18(%rbx), %ecx
movq %rsi, %r14
leal 0x5(%rcx), %esi
cmpl 0x1c(%rbx), %esi
jbe 0xbc3f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %dl, %dl
je 0xbcbe
movq %rbx, %rdi
movl $0x5, %esi
callq 0xd5db
testl %eax, %eax
jne 0xbcbe
movq 0x10(%rbx), %rax
movl 0x18(%rbx), %ecx
movl %ecx, %ecx
bswapl %r14d
movb $-0x32, (%rax,%rcx)
movl %r14d, 0x1(%rax,%rcx)
movl 0x18(%rbx), %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x7ffffffa, %eax       # imm = 0x7FFFFFFA
ja 0xbcbe
addl $0x5, %eax
jmp 0xbcb9
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0xbca7
movl 0x18(%rbx), %ecx
movq %rsi, %r14
leal 0x9(%rcx), %esi
cmpl 0x1c(%rbx), %esi
jbe 0xbc99
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %dl, %dl
je 0xbcbe
movq %rbx, %rdi
movl $0x9, %esi
callq 0xd5db
testl %eax, %eax
jne 0xbcbe
movq 0x10(%rbx), %rax
movl 0x18(%rbx), %ecx
movl %ecx, %ecx
bswapq %r14
movb $-0x31, (%rax,%rcx)
movq %r14, 0x1(%rax,%rcx)
movl 0x18(%rbx), %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x7ffffff6, %eax       # imm = 0x7FFFFFF6
ja 0xbcbe
addl $0x9, %eax
xorl %ebp, %ebp
movl %eax, 0x18(%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq