// File: /workspace/github_c_makefile_star2_O2/nilyang[P]redis-tdd-annotation/deps/lua/src/lua_cmsgpack.c
// Function: mp_decode_to_lua_type
void mp_decode_to_lua_type(lua_State *L, mp_cur *c) {
    mp_cur_need(c,1);
    switch(c->p[0]) {
    case 0xcc:  /* uint 8 */
        mp_cur_need(c,2);
        lua_pushnumber(L,c->p[1]);
        mp_cur_consume(c,2);
        break;
    case 0xd0:  /* int 8 */
        mp_cur_need(c,2);
        lua_pushnumber(L,(char)c->p[1]);
        mp_cur_consume(c,2);
        break;
    case 0xcd:  /* uint 16 */
        mp_cur_need(c,3);
        lua_pushnumber(L,
            (c->p[1] << 8) |
             c->p[2]);
        mp_cur_consume(c,3);
        break;
    case 0xd1:  /* int 16 */
        mp_cur_need(c,3);
        lua_pushnumber(L,(int16_t)
            (c->p[1] << 8) |
             c->p[2]);
        mp_cur_consume(c,3);
        break;
    case 0xce:  /* uint 32 */
        mp_cur_need(c,5);
        lua_pushnumber(L,
            ((uint32_t)c->p[1] << 24) |
            ((uint32_t)c->p[2] << 16) |
            ((uint32_t)c->p[3] << 8) |
             (uint32_t)c->p[4]);
        mp_cur_consume(c,5);
        break;
    case 0xd2:  /* int 32 */
        mp_cur_need(c,5);
        lua_pushnumber(L,
            ((int32_t)c->p[1] << 24) |
            ((int32_t)c->p[2] << 16) |
            ((int32_t)c->p[3] << 8) |
             (int32_t)c->p[4]);
        mp_cur_consume(c,5);
        break;
    case 0xcf:  /* uint 64 */
        mp_cur_need(c,9);
        lua_pushnumber(L,
            ((uint64_t)c->p[1] << 56) |
            ((uint64_t)c->p[2] << 48) |
            ((uint64_t)c->p[3] << 40) |
            ((uint64_t)c->p[4] << 32) |
            ((uint64_t)c->p[5] << 24) |
            ((uint64_t)c->p[6] << 16) |
            ((uint64_t)c->p[7] << 8) |
             (uint64_t)c->p[8]);
        mp_cur_consume(c,9);
        break;
    case 0xd3:  /* int 64 */
        mp_cur_need(c,9);
        lua_pushnumber(L,
            ((int64_t)c->p[1] << 56) |
            ((int64_t)c->p[2] << 48) |
            ((int64_t)c->p[3] << 40) |
            ((int64_t)c->p[4] << 32) |
            ((int64_t)c->p[5] << 24) |
            ((int64_t)c->p[6] << 16) |
            ((int64_t)c->p[7] << 8) |
             (int64_t)c->p[8]);
        mp_cur_consume(c,9);
        break;
    case 0xc0:  /* nil */
        lua_pushnil(L);
        mp_cur_consume(c,1);
        break;
    case 0xc3:  /* true */
        lua_pushboolean(L,1);
        mp_cur_consume(c,1);
        break;
    case 0xc2:  /* false */
        lua_pushboolean(L,0);
        mp_cur_consume(c,1);
        break;
    case 0xca:  /* float */
        mp_cur_need(c,5);
        assert(sizeof(float) == 4);
        {
            float f;
            memcpy(&f,c->p+1,4);
            memrevifle(&f,4);
            lua_pushnumber(L,f);
            mp_cur_consume(c,5);
        }
        break;
    case 0xcb:  /* double */
        mp_cur_need(c,9);
        assert(sizeof(double) == 8);
        {
            double d;
            memcpy(&d,c->p+1,8);
            memrevifle(&d,8);
            lua_pushnumber(L,d);
            mp_cur_consume(c,9);
        }
        break;
    case 0xda:  /* raw 16 */
        mp_cur_need(c,3);
        {
            size_t l = (c->p[1] << 8) | c->p[2];
            mp_cur_need(c,3+l);
            lua_pushlstring(L,(char*)c->p+3,l);
            mp_cur_consume(c,3+l);
        }
        break;
    case 0xdb:  /* raw 32 */
        mp_cur_need(c,5);
        {
            size_t l = (c->p[1] << 24) |
                       (c->p[2] << 16) |
                       (c->p[3] << 8) |
                       c->p[4];
            mp_cur_need(c,5+l);
            lua_pushlstring(L,(char*)c->p+5,l);
            mp_cur_consume(c,5+l);
        }
        break;
    case 0xdc:  /* array 16 */
        mp_cur_need(c,3);
        {
            size_t l = (c->p[1] << 8) | c->p[2];
            mp_cur_consume(c,3);
            mp_decode_to_lua_array(L,c,l);
        }
        break;
    case 0xdd:  /* array 32 */
        mp_cur_need(c,5);
        {
            size_t l = (c->p[1] << 24) |
                       (c->p[2] << 16) |
                       (c->p[3] << 8) |
                       c->p[4];
            mp_cur_consume(c,5);
            mp_decode_to_lua_array(L,c,l);
        }
        break;
    case 0xde:  /* map 16 */
        mp_cur_need(c,3);
        {
            size_t l = (c->p[1] << 8) | c->p[2];
            mp_cur_consume(c,3);
            mp_decode_to_lua_hash(L,c,l);
        }
        break;
    case 0xdf:  /* map 32 */
        mp_cur_need(c,5);
        {
            size_t l = (c->p[1] << 24) |
                       (c->p[2] << 16) |
                       (c->p[3] << 8) |
                       c->p[4];
            mp_cur_consume(c,5);
            mp_decode_to_lua_hash(L,c,l);
        }
        break;
    default:    /* types that can't be idenitified by first byte value. */
        if ((c->p[0] & 0x80) == 0) {   /* positive fixnum */
            lua_pushnumber(L,c->p[0]);
            mp_cur_consume(c,1);
        } else if ((c->p[0] & 0xe0) == 0xe0) {  /* negative fixnum */
            lua_pushnumber(L,(signed char)c->p[0]);
            mp_cur_consume(c,1);
        } else if ((c->p[0] & 0xe0) == 0xa0) {  /* fix raw */
            size_t l = c->p[0] & 0x1f;
            mp_cur_need(c,1+l);
            lua_pushlstring(L,(char*)c->p+1,l);
            mp_cur_consume(c,1+l);
        } else if ((c->p[0] & 0xf0) == 0x90) {  /* fix map */
            size_t l = c->p[0] & 0xf;
            mp_cur_consume(c,1);
            mp_decode_to_lua_array(L,c,l);
        } else if ((c->p[0] & 0xf0) == 0x80) {  /* fix map */
            size_t l = c->p[0] & 0xf;
            mp_cur_consume(c,1);
            mp_decode_to_lua_hash(L,c,l);
        } else {
            c->err = MP_CUR_ERROR_BADFMT;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x72406
movq %rdi, %r14
movq (%rbx), %rsi
movzbl (%rsi), %edx
leal -0xc0(%rdx), %ecx
cmpl $0x1f, %ecx
ja 0x72417
leaq 0x26674(%rip), %rdi     # 0x987b4
movslq (%rdi,%rcx,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
movq %r14, %rdi
callq 0x60d21
jmp 0x7242a
cmpq $0x4, %rax
jbe 0x72406
movzbl 0x1(%rsi), %ecx
shll $0x18, %ecx
movzbl 0x2(%rsi), %edx
shll $0x10, %edx
movslq %ecx, %rcx
orq %rdx, %rcx
movzbl 0x3(%rsi), %edi
shll $0x8, %edi
orq %rcx, %rdi
movzbl 0x4(%rsi), %edx
orq %rdi, %rdx
addq $0x5, %rsi
movq %rsi, (%rbx)
addq $-0x5, %rax
jmp 0x723e8
cmpq $0x2, %rax
jbe 0x72406
movzwl 0x1(%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %edx
leaq 0x3(%rdx), %r15
cmpq %r15, %rax
jb 0x72406
addq $0x3, %rsi
jmp 0x7232a
cmpq $0x2, %rax
jbe 0x72406
movzbl 0x1(%rsi), %eax
shll $0x8, %eax
cwtl
movzbl 0x2(%rsi), %ecx
orl %eax, %ecx
cvtsi2sd %ecx, %xmm0
jmp 0x722a6
cmpq $0x8, %rax
jbe 0x72406
movq 0x1(%rsi), %rax
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
pushq $0x8
popq %rsi
movq %r15, %rdi
callq 0x72548
movsd (%r15), %xmm0
jmp 0x723b9
cmpq $0x8, %rax
jbe 0x72406
movq 0x1(%rsi), %rax
bswapq %rax
cvtsi2sd %rax, %xmm0
jmp 0x723b9
movq %r14, %rdi
xorl %esi, %esi
jmp 0x72283
cmpq $0x1, %rax
je 0x72406
movzbl 0x1(%rsi), %eax
jmp 0x72371
cmpq $0x4, %rax
jbe 0x72406
movl 0x1(%rsi), %eax
bswapl %eax
cvtsi2sd %eax, %xmm0
jmp 0x722d0
cmpq $0x4, %rax
jbe 0x72406
movl 0x1(%rsi), %eax
leaq 0x4(%rsp), %r15
movl %eax, (%r15)
pushq $0x4
popq %rsi
movq %r15, %rdi
callq 0x72548
cvtss2sd (%r15), %xmm0
jmp 0x722d0
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x60f7c
jmp 0x7242a
cmpq $0x2, %rax
jbe 0x72406
movzwl 0x1(%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
movq %r14, %rdi
callq 0x60d32
addq $0x3, (%rbx)
addq $-0x3, 0x8(%rbx)
jmp 0x7240d
cmpq $0x4, %rax
jbe 0x72406
movl 0x1(%rsi), %eax
bswapl %eax
cvtsi2sd %rax, %xmm0
movq %r14, %rdi
callq 0x60d32
addq $0x5, (%rbx)
addq $-0x5, 0x8(%rbx)
jmp 0x7240d
cmpq $0x4, %rax
jbe 0x72406
movzbl 0x1(%rsi), %ecx
shll $0x18, %ecx
movzbl 0x2(%rsi), %edx
shll $0x10, %edx
movslq %ecx, %rcx
orq %rdx, %rcx
movzbl 0x3(%rsi), %edx
shll $0x8, %edx
orq %rcx, %rdx
movzbl 0x4(%rsi), %ecx
leaq (%rcx,%rdx), %r15
addq $0x5, %r15
cmpq %r15, %rax
jb 0x72406
orq %rcx, %rdx
addq $0x5, %rsi
movq %r14, %rdi
callq 0x60d61
addq %r15, (%rbx)
subq %r15, 0x8(%rbx)
jmp 0x7240d
cmpq $0x2, %rax
jbe 0x72406
movzwl 0x1(%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %edx
addq $0x3, %rsi
movq %rsi, (%rbx)
addq $-0x3, %rax
jmp 0x72463
cmpq $0x1, %rax
je 0x72406
movsbl 0x1(%rsi), %eax
cvtsi2sd %eax, %xmm0
movq %r14, %rdi
callq 0x60d32
addq $0x2, (%rbx)
addq $-0x2, 0x8(%rbx)
jmp 0x7240d
cmpq $0x8, %rax
jbe 0x72406
movq 0x1(%rsi), %rax
bswapq %rax
movq %rax, %xmm1
punpckldq 0x24bbb(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x24bc3(%rip), %xmm1    # 0x96f70
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x60d32
addq $0x9, (%rbx)
addq $-0x9, 0x8(%rbx)
jmp 0x7240d
cmpq $0x2, %rax
jbe 0x72406
movzwl 0x1(%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %edx
addq $0x3, %rsi
movq %rsi, (%rbx)
addq $-0x3, %rax
movq %rax, 0x8(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x724eb
cmpq $0x4, %rax
ja 0x72433
movl $0x1, 0x10(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
testb %dl, %dl
js 0x7247b
movsbl %dl, %eax
cvtsi2sd %eax, %xmm0
movq %r14, %rdi
callq 0x60d32
incq (%rbx)
decq 0x8(%rbx)
jmp 0x7240d
movzbl 0x1(%rsi), %ecx
shll $0x18, %ecx
movzbl 0x2(%rsi), %edx
shll $0x10, %edx
movslq %ecx, %rcx
orq %rdx, %rcx
movzbl 0x3(%rsi), %edi
shll $0x8, %edi
orq %rcx, %rdi
movzbl 0x4(%rsi), %edx
orq %rdi, %rdx
addq $0x5, %rsi
movq %rsi, (%rbx)
addq $-0x5, %rax
movq %rax, 0x8(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x720ac
movl %edx, %ecx
andb $-0x20, %cl
cmpb $-0x60, %cl
je 0x724b6
movl %edx, %ecx
andl $-0x20, %ecx
cmpl $0xe0, %ecx
je 0x7241b
movl %edx, %ecx
andb $-0x10, %cl
negb %cl
jo 0x724ce
movl %edx, %ecx
andl $-0x10, %ecx
cmpl $0x90, %ecx
jne 0x724df
andl $0xf, %edx
incq %rsi
movq %rsi, (%rbx)
decq %rax
jmp 0x72463
andl $0x1f, %edx
cmpq %rdx, %rax
jbe 0x72406
leaq 0x1(%rdx), %r15
incq %rsi
jmp 0x7232a
andl $0xf, %edx
incq %rsi
movq %rsi, (%rbx)
decq %rax
jmp 0x723e8
movl $0x2, 0x10(%rbx)
jmp 0x7240d