// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x79072
movq (%rbx), %rsi
movzbl (%rsi), %edx
leal -0xc0(%rdx), %ecx
cmpl $0x1f, %ecx
ja 0x79081
leaq 0x299ec(%rip), %r8      # 0xa2788
movslq (%r8,%rcx,4), %rcx
addq %r8, %rcx
jmpq *%rcx
callq 0x666bd
jmp 0x7908e
cmpq $0x4, %rax
jbe 0x79072
movzbl 0x1(%rsi), %ecx
shll $0x18, %ecx
movzbl 0x2(%rsi), %edx
shll $0x10, %edx
movslq %ecx, %rcx
orq %rdx, %rcx
movzbl 0x3(%rsi), %r8d
shll $0x8, %r8d
orq %rcx, %r8
movzbl 0x4(%rsi), %edx
orq %r8, %rdx
addq $0x5, %rsi
movq %rsi, (%rbx)
addq $-0x5, %rax
jmp 0x79059
cmpq $0x2, %rax
jbe 0x79072
movzwl 0x1(%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %edx
leaq 0x3(%rdx), %r14
cmpq %r14, %rax
jb 0x79072
addq $0x3, %rsi
jmp 0x78fa7
cmpq $0x2, %rax
jbe 0x79072
movzbl 0x1(%rsi), %eax
shll $0x8, %eax
cwtl
movzbl 0x2(%rsi), %ecx
orl %eax, %ecx
cvtsi2sd %ecx, %xmm0
jmp 0x78f29
cmpq $0x8, %rax
jbe 0x79072
movq 0x1(%rsi), %rcx
leaq 0x10(%rsp), %rax
movq %rcx, (%rax)
movl $0x7, %ecx
movb (%rax), %dl
movb 0x10(%rsp,%rcx), %sil
movb %sil, (%rax)
movb %dl, 0x10(%rsp,%rcx)
incq %rax
decq %rcx
cmpq $0x3, %rcx
jne 0x78e57
movsd 0x10(%rsp), %xmm0
jmp 0x7902d
cmpq $0x8, %rax
jbe 0x79072
movq 0x1(%rsi), %rax
bswapq %rax
cvtsi2sd %rax, %xmm0
jmp 0x7902d
xorl %esi, %esi
jmp 0x78f06
cmpq $0x1, %rax
je 0x79072
movzbl 0x1(%rsi), %eax
jmp 0x78feb
cmpq $0x4, %rax
jbe 0x79072
movl 0x1(%rsi), %eax
bswapl %eax
cvtsi2sd %eax, %xmm0
jmp 0x78f50
cmpq $0x4, %rax
jbe 0x79072
movl 0x1(%rsi), %ecx
leaq 0xc(%rsp), %rax
movl %ecx, (%rax)
movl $0x3, %ecx
movb (%rax), %dl
movb 0xc(%rsp,%rcx), %sil
movb %sil, (%rax)
movb %dl, 0xc(%rsp,%rcx)
incq %rax
decq %rcx
cmpq $0x1, %rcx
jne 0x78edf
cvtss2sd 0xc(%rsp), %xmm0
jmp 0x78f50
movl $0x1, %esi
callq 0x6691c
jmp 0x7908e
cmpq $0x2, %rax
jbe 0x79072
movzwl 0x1(%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
callq 0x666d1
addq $0x3, (%rbx)
addq $-0x3, 0x8(%rbx)
jmp 0x79079
cmpq $0x4, %rax
jbe 0x79072
movl 0x1(%rsi), %eax
bswapl %eax
cvtsi2sd %rax, %xmm0
callq 0x666d1
addq $0x5, (%rbx)
addq $-0x5, 0x8(%rbx)
jmp 0x79079
cmpq $0x4, %rax
jbe 0x79072
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), %r14
addq $0x5, %r14
cmpq %r14, %rax
jb 0x79072
orq %rcx, %rdx
addq $0x5, %rsi
callq 0x66700
addq %r14, (%rbx)
subq %r14, 0x8(%rbx)
jmp 0x79079
cmpq $0x2, %rax
jbe 0x79072
movzwl 0x1(%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %edx
addq $0x3, %rsi
movq %rsi, (%rbx)
addq $-0x3, %rax
jmp 0x790c9
cmpq $0x1, %rax
je 0x79072
movsbl 0x1(%rsi), %eax
cvtsi2sd %eax, %xmm0
callq 0x666d1
addq $0x2, (%rbx)
addq $-0x2, 0x8(%rbx)
jmp 0x79079
cmpq $0x8, %rax
jbe 0x79072
movq 0x1(%rsi), %rax
bswapq %rax
movq %rax, %xmm1
punpckldq 0x27f47(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x27f4f(%rip), %xmm1    # 0xa0f70
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x666d1
addq $0x9, (%rbx)
addq $-0x9, 0x8(%rbx)
jmp 0x79079
cmpq $0x2, %rax
jbe 0x79072
movzwl 0x1(%rsi), %ecx
rolw $0x8, %cx
movzwl %cx, %edx
addq $0x3, %rsi
movq %rsi, (%rbx)
addq $-0x3, %rax
movq %rax, 0x8(%rbx)
movq %rbx, %rsi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x79155
cmpq $0x4, %rax
ja 0x79097
movl $0x1, 0x10(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
testb %dl, %dl
js 0x790dc
cvtsi2sd %edx, %xmm0
callq 0x666d1
incq (%rbx)
decq 0x8(%rbx)
jmp 0x79079
movzbl 0x1(%rsi), %ecx
shll $0x18, %ecx
movzbl 0x2(%rsi), %edx
shll $0x10, %edx
movslq %ecx, %rcx
orq %rdx, %rcx
movzbl 0x3(%rsi), %r8d
shll $0x8, %r8d
orq %rcx, %r8
movzbl 0x4(%rsi), %edx
orq %r8, %rdx
addq $0x5, %rsi
movq %rsi, (%rbx)
addq $-0x5, %rax
movq %rax, 0x8(%rbx)
movq %rbx, %rsi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x78d00
movl %edx, %ecx
andb $-0x20, %cl
cmpb $-0x60, %cl
je 0x790fc
movl %edx, %ecx
andl $-0x20, %ecx
cmpl $0xe0, %ecx
jne 0x79114
movsbl %dl, %eax
cvtsi2sd %eax, %xmm0
jmp 0x79089
andl $0x1f, %edx
cmpq %rdx, %rax
jbe 0x79072
leaq 0x1(%rdx), %r14
incq %rsi
jmp 0x78fa7
movl %edx, %ecx
andb $-0x10, %cl
negb %cl
jo 0x79138
movl %edx, %ecx
andl $-0x10, %ecx
cmpl $0x90, %ecx
jne 0x79149
andl $0xf, %edx
incq %rsi
movq %rsi, (%rbx)
decq %rax
jmp 0x790c9
andl $0xf, %edx
incq %rsi
movq %rsi, (%rbx)
decq %rax
jmp 0x79059
movl $0x2, 0x10(%rbx)
jmp 0x79079