// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/lua/src/lua_cmsgpack.c
// Function: mp_encode_int
void mp_encode_int(lua_State *L, mp_buf *buf, int64_t n) {
    unsigned char b[9];
    int enclen;

    if (n >= 0) {
        if (n <= 127) {
            b[0] = n & 0x7f;    /* positive fixnum */
            enclen = 1;
        } else if (n <= 0xff) {
            b[0] = 0xcc;        /* uint 8 */
            b[1] = n & 0xff;
            enclen = 2;
        } else if (n <= 0xffff) {
            b[0] = 0xcd;        /* uint 16 */
            b[1] = (n & 0xff00) >> 8;
            b[2] = n & 0xff;
            enclen = 3;
        } else if (n <= 0xffffffffLL) {
            b[0] = 0xce;        /* uint 32 */
            b[1] = (n & 0xff000000) >> 24;
            b[2] = (n & 0xff0000) >> 16;
            b[3] = (n & 0xff00) >> 8;
            b[4] = n & 0xff;
            enclen = 5;
        } else {
            b[0] = 0xcf;        /* uint 64 */
            b[1] = (n & 0xff00000000000000LL) >> 56;
            b[2] = (n & 0xff000000000000LL) >> 48;
            b[3] = (n & 0xff0000000000LL) >> 40;
            b[4] = (n & 0xff00000000LL) >> 32;
            b[5] = (n & 0xff000000) >> 24;
            b[6] = (n & 0xff0000) >> 16;
            b[7] = (n & 0xff00) >> 8;
            b[8] = n & 0xff;
            enclen = 9;
        }
    } else {
        if (n >= -32) {
            b[0] = ((signed char)n);   /* negative fixnum */
            enclen = 1;
        } else if (n >= -128) {
            b[0] = 0xd0;        /* int 8 */
            b[1] = n & 0xff;
            enclen = 2;
        } else if (n >= -32768) {
            b[0] = 0xd1;        /* int 16 */
            b[1] = (n & 0xff00) >> 8;
            b[2] = n & 0xff;
            enclen = 3;
        } else if (n >= -2147483648LL) {
            b[0] = 0xd2;        /* int 32 */
            b[1] = (n & 0xff000000) >> 24;
            b[2] = (n & 0xff0000) >> 16;
            b[3] = (n & 0xff00) >> 8;
            b[4] = n & 0xff;
            enclen = 5;
        } else {
            b[0] = 0xd3;        /* int 64 */
            b[1] = (n & 0xff00000000000000LL) >> 56;
            b[2] = (n & 0xff000000000000LL) >> 48;
            b[3] = (n & 0xff0000000000LL) >> 40;
            b[4] = (n & 0xff00000000LL) >> 32;
            b[5] = (n & 0xff000000) >> 24;
            b[6] = (n & 0xff0000) >> 16;
            b[7] = (n & 0xff00) >> 8;
            b[8] = n & 0xff;
            enclen = 9;
        }
    }
    mp_buf_append(L,buf,b,enclen);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jl 0xcc599
cmpq $0x7f, -0x18(%rbp)
jg 0xcc42d
movq -0x18(%rbp), %rax
andq $0x7f, %rax
movb %al, -0x21(%rbp)
movl $0x1, -0x28(%rbp)
jmp 0xcc594
cmpq $0xff, -0x18(%rbp)
jg 0xcc454
movb $-0x34, -0x21(%rbp)
movq -0x18(%rbp), %rax
andq $0xff, %rax
movb %al, -0x20(%rbp)
movl $0x2, -0x28(%rbp)
jmp 0xcc592
cmpq $0xffff, -0x18(%rbp)    # imm = 0xFFFF
jg 0xcc48c
movb $-0x33, -0x21(%rbp)
movq -0x18(%rbp), %rax
andq $0xff00, %rax           # imm = 0xFF00
sarq $0x8, %rax
movb %al, -0x20(%rbp)
movq -0x18(%rbp), %rax
andq $0xff, %rax
movb %al, -0x1f(%rbp)
movl $0x3, -0x28(%rbp)
jmp 0xcc590
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x18(%rbp)
jg 0xcc4eb
movb $-0x32, -0x21(%rbp)
movabsq $0xff000000, %rax       # imm = 0xFF000000
andq -0x18(%rbp), %rax
sarq $0x18, %rax
movb %al, -0x20(%rbp)
movq -0x18(%rbp), %rax
andq $0xff0000, %rax         # imm = 0xFF0000
sarq $0x10, %rax
movb %al, -0x1f(%rbp)
movq -0x18(%rbp), %rax
andq $0xff00, %rax           # imm = 0xFF00
sarq $0x8, %rax
movb %al, -0x1e(%rbp)
movq -0x18(%rbp), %rax
andq $0xff, %rax
movb %al, -0x1d(%rbp)
movl $0x5, -0x28(%rbp)
jmp 0xcc58e
movb $-0x31, -0x21(%rbp)
movabsq $-0x100000000000000, %rax # imm = 0xFF00000000000000
andq -0x18(%rbp), %rax
shrq $0x38, %rax
movb %al, -0x20(%rbp)
movabsq $0xff000000000000, %rax # imm = 0xFF000000000000
andq -0x18(%rbp), %rax
sarq $0x30, %rax
movb %al, -0x1f(%rbp)
movabsq $0xff0000000000, %rax   # imm = 0xFF0000000000
andq -0x18(%rbp), %rax
sarq $0x28, %rax
movb %al, -0x1e(%rbp)
movabsq $0xff00000000, %rax     # imm = 0xFF00000000
andq -0x18(%rbp), %rax
sarq $0x20, %rax
movb %al, -0x1d(%rbp)
movabsq $0xff000000, %rax       # imm = 0xFF000000
andq -0x18(%rbp), %rax
sarq $0x18, %rax
movb %al, -0x1c(%rbp)
movq -0x18(%rbp), %rax
andq $0xff0000, %rax         # imm = 0xFF0000
sarq $0x10, %rax
movb %al, -0x1b(%rbp)
movq -0x18(%rbp), %rax
andq $0xff00, %rax           # imm = 0xFF00
sarq $0x8, %rax
movb %al, -0x1a(%rbp)
movq -0x18(%rbp), %rax
andq $0xff, %rax
movb %al, -0x19(%rbp)
movl $0x9, -0x28(%rbp)
jmp 0xcc590
jmp 0xcc592
jmp 0xcc594
jmp 0xcc718
cmpq $-0x20, -0x18(%rbp)
jl 0xcc5b3
movq -0x18(%rbp), %rax
movb %al, -0x21(%rbp)
movl $0x1, -0x28(%rbp)
jmp 0xcc716
cmpq $-0x80, -0x18(%rbp)
jl 0xcc5d7
movb $-0x30, -0x21(%rbp)
movq -0x18(%rbp), %rax
andq $0xff, %rax
movb %al, -0x20(%rbp)
movl $0x2, -0x28(%rbp)
jmp 0xcc714
cmpq $-0x8000, -0x18(%rbp)   # imm = 0x8000
jl 0xcc60f
movb $-0x2f, -0x21(%rbp)
movq -0x18(%rbp), %rax
andq $0xff00, %rax           # imm = 0xFF00
sarq $0x8, %rax
movb %al, -0x20(%rbp)
movq -0x18(%rbp), %rax
andq $0xff, %rax
movb %al, -0x1f(%rbp)
movl $0x3, -0x28(%rbp)
jmp 0xcc712
cmpq $-0x80000000, -0x18(%rbp) # imm = 0x80000000
jl 0xcc66d
movb $-0x2e, -0x21(%rbp)
movabsq $0xff000000, %rax       # imm = 0xFF000000
andq -0x18(%rbp), %rax
sarq $0x18, %rax
movb %al, -0x20(%rbp)
movq -0x18(%rbp), %rax
andq $0xff0000, %rax         # imm = 0xFF0000
sarq $0x10, %rax
movb %al, -0x1f(%rbp)
movq -0x18(%rbp), %rax
andq $0xff00, %rax           # imm = 0xFF00
sarq $0x8, %rax
movb %al, -0x1e(%rbp)
movq -0x18(%rbp), %rax
andq $0xff, %rax
movb %al, -0x1d(%rbp)
movl $0x5, -0x28(%rbp)
jmp 0xcc710
movb $-0x2d, -0x21(%rbp)
movabsq $-0x100000000000000, %rax # imm = 0xFF00000000000000
andq -0x18(%rbp), %rax
shrq $0x38, %rax
movb %al, -0x20(%rbp)
movabsq $0xff000000000000, %rax # imm = 0xFF000000000000
andq -0x18(%rbp), %rax
sarq $0x30, %rax
movb %al, -0x1f(%rbp)
movabsq $0xff0000000000, %rax   # imm = 0xFF0000000000
andq -0x18(%rbp), %rax
sarq $0x28, %rax
movb %al, -0x1e(%rbp)
movabsq $0xff00000000, %rax     # imm = 0xFF00000000
andq -0x18(%rbp), %rax
sarq $0x20, %rax
movb %al, -0x1d(%rbp)
movabsq $0xff000000, %rax       # imm = 0xFF000000
andq -0x18(%rbp), %rax
sarq $0x18, %rax
movb %al, -0x1c(%rbp)
movq -0x18(%rbp), %rax
andq $0xff0000, %rax         # imm = 0xFF0000
sarq $0x10, %rax
movb %al, -0x1b(%rbp)
movq -0x18(%rbp), %rax
andq $0xff00, %rax           # imm = 0xFF00
sarq $0x8, %rax
movb %al, -0x1a(%rbp)
movq -0x18(%rbp), %rax
andq $0xff, %rax
movb %al, -0x19(%rbp)
movl $0x9, -0x28(%rbp)
jmp 0xcc712
jmp 0xcc714
jmp 0xcc716
jmp 0xcc718
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x21(%rbp), %rdx
movslq -0x28(%rbp), %rcx
callq 0xcc0d0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)