// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/deps/lua/src/lua_cjson.c
// Function: json_append_data
static void json_append_data(lua_State *l, json_config_t *cfg,
                             int current_depth, strbuf_t *json)
{
    int len;

    switch (lua_type(l, -1)) {
    case LUA_TSTRING:
        json_append_string(l, json, -1);
        break;
    case LUA_TNUMBER:
        json_append_number(l, cfg, json, -1);
        break;
    case LUA_TBOOLEAN:
        if (lua_toboolean(l, -1))
            strbuf_append_mem(json, "true", 4);
        else
            strbuf_append_mem(json, "false", 5);
        break;
    case LUA_TTABLE:
        current_depth++;
        json_check_encode_depth(l, cfg, current_depth, json);
        len = lua_array_length(l, cfg, json);
        if (len > 0)
            json_append_array(l, cfg, current_depth, json, len);
        else
            json_append_object(l, cfg, current_depth, json);
        break;
    case LUA_TNIL:
        strbuf_append_mem(json, "null", 4);
        break;
    case LUA_TLIGHTUSERDATA:
        if (lua_touserdata(l, -1) == NULL) {
            strbuf_append_mem(json, "null", 4);
            break;
        }
    default:
        /* Remaining types (LUA_TFUNCTION, LUA_TUSERDATA, LUA_TTHREAD,
         * and LUA_TLIGHTUSERDATA) cannot be serialised */
        json_encode_exception(l, cfg, json, -1, "type not supported");
        /* never returns */
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %r14
pushq $-0x1
popq %rsi
callq 0x786b8
cmpl $0x5, %eax
ja 0x88621
movl %eax, %eax
leaq 0x39c10(%rip), %rcx     # 0xc21e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $-0x1
popq %rsi
movq %r14, %rdi
callq 0x788bd
testl %eax, %eax
je 0x8885d
leaq 0x2f61a(%rip), %rsi     # 0xb7c0d
jmp 0x8864e
pushq $-0x1
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x88922
pushq $-0x1
popq %rsi
movq %r14, %rdi
callq 0x789d1
testq %rax, %rax
je 0x88647
leaq 0x39cd3(%rip), %r8      # 0xc22fb
pushq $-0x1
popq %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x88aba
leaq 0x28089(%rip), %rsi     # 0xb06d7
pushq $0x4
popq %rdx
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x88a8b
pushq $-0x1
popq %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x889b7
leal 0x1(%r12), %eax
movl %eax, 0xc(%rsp)
cmpl %r12d, 0x52c(%r15)
jle 0x886a7
pushq $0x3
popq %rsi
movq %r14, %rdi
callq 0x7835e
testl %eax, %eax
jne 0x886ce
cmpl $0x0, 0x538(%r15)
jne 0x886b9
movq %rbx, %rdi
callq 0x8d768
leaq 0x39d35(%rip), %rsi     # 0xc23f5
movq %r14, %rdi
movl 0xc(%rsp), %edx
xorl %eax, %eax
callq 0x82707
movq %r14, %rdi
callq 0x78a55
xorl %r13d, %r13d
pushq $-0x2
popq %r12
xorl %ebp, %ebp
movq %r14, %rdi
movl %r12d, %esi
callq 0x793f1
testl %eax, %eax
je 0x8886b
movq %r14, %rdi
movl %r12d, %esi
callq 0x786b8
cmpl $0x3, %eax
jne 0x8875b
movq %r14, %rdi
movl %r12d, %esi
callq 0x7885f
ucomisd 0x37a53(%rip), %xmm0    # 0xc0168
jne 0x88719
jnp 0x8875b
movsd %xmm0, 0x10(%rsp)
callq 0x26b50
movsd 0x10(%rsp), %xmm1
ucomisd 0x29c8e(%rip), %xmm1    # 0xb23c0
jb 0x8875b
ucomisd %xmm1, %xmm0
jne 0x8875b
jp 0x8875b
cvtsi2sd %r13d, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x8874c
cvttsd2si %xmm1, %r13d
incl %ebp
movq %r14, %rdi
movl %r12d, %esi
callq 0x78478
jmp 0x886df
pushq $-0x3
popq %rsi
movq %r14, %rdi
callq 0x78478
pushq $0x7b
popq %rsi
movq %rbx, %rdi
callq 0x88b1e
movq %r14, %rdi
callq 0x78a55
movb $0x1, %bpl
pushq $-0x2
popq %r12
pushq $0x2c
popq %r13
movq %r14, %rdi
movl %r12d, %esi
callq 0x793f1
testl %eax, %eax
je 0x88844
testb $0x1, %bpl
jne 0x887a8
movq %rbx, %rdi
movl %r13d, %esi
callq 0x88b1e
movq %r14, %rdi
movl %r12d, %esi
callq 0x786b8
cmpl $0x4, %eax
je 0x887ed
cmpl $0x3, %eax
jne 0x88808
movq %rbx, %rdi
pushq $0x22
popq %rsi
callq 0x88b1e
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x889b7
movq %rbx, %rdi
leaq 0x39c54(%rip), %rsi     # 0xc2437
pushq $0x2
popq %rdx
callq 0x88a8b
jmp 0x88820
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x88922
movq %rbx, %rdi
pushq $0x3a
popq %rsi
callq 0x88b1e
jmp 0x88820
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r12d, %ecx
leaq 0x39c1f(%rip), %r8      # 0xc243a
callq 0x88aba
movq %r14, %rdi
movq %r15, %rsi
movl 0xc(%rsp), %edx
movq %rbx, %rcx
callq 0x885a0
movq %r14, %rdi
movl %r12d, %esi
callq 0x78478
xorl %ebp, %ebp
jmp 0x88784
pushq $0x7d
popq %rsi
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x88b1e
leaq 0x32d61(%rip), %rsi     # 0xbb5c5
pushq $0x5
jmp 0x88650
movl 0x524(%r15), %eax
testl %eax, %eax
jle 0x888b2
imull %ebp, %eax
cmpl %eax, %r13d
jle 0x888b2
cmpl 0x528(%r15), %r13d
jle 0x888b2
cmpl $0x0, 0x520(%r15)
jne 0x88766
leaq 0x39b82(%rip), %r8      # 0xc241e
pushq $-0x1
popq %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x88aba
jmp 0x88766
testl %r13d, %r13d
jle 0x88766
pushq $0x5b
popq %rsi
movq %rbx, %rdi
callq 0x88b1e
negl %r13d
pushq $0x1
popq %r12
movb $0x1, %al
pushq $-0x1
popq %rbp
leal (%r12,%r13), %ecx
cmpl $0x1, %ecx
je 0x8891b
testb $0x1, %al
jne 0x888ea
movq %rbx, %rdi
pushq $0x2c
popq %rsi
callq 0x88b1e
movq %r14, %rdi
movl %ebp, %esi
movl %r12d, %edx
callq 0x78da6
movq %r14, %rdi
movq %r15, %rsi
movl 0xc(%rsp), %edx
movq %rbx, %rcx
callq 0x885a0
movq %r14, %rdi
pushq $-0x2
popq %rsi
callq 0x78478
incl %r12d
xorl %eax, %eax
jmp 0x888d2
pushq $0x5d
jmp 0x88846