// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xacaa0
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x5, %eax
ja 0xc96d9
movq -0x30(%rbp), %rax
leaq 0x82091(%rip), %rcx     # 0x14b640
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xc9730
jmp 0xc96f6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xc9800
jmp 0xc96f6
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xacf00
cmpl $0x0, %eax
je 0xc9614
movq -0x20(%rbp), %rdi
leaq 0x776f1(%rip), %rsi     # 0x140cf9
movl $0x4, %edx
callq 0xc99b0
jmp 0xc9629
movq -0x20(%rbp), %rdi
leaq 0x7b096(%rip), %rsi     # 0x1446b5
movl $0x5, %edx
callq 0xc99b0
jmp 0xc96f6
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
callq 0xc9a10
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xc9a80
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jle 0xc967f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
callq 0xc9be0
jmp 0xc9693
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
callq 0xc9c90
jmp 0xc96f6
movq -0x20(%rbp), %rdi
leaq 0x700b7(%rip), %rsi     # 0x139757
movl $0x4, %edx
callq 0xc99b0
jmp 0xc96f6
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xad160
cmpq $0x0, %rax
jne 0xc96d7
movq -0x20(%rbp), %rdi
leaq 0x7008c(%rip), %rsi     # 0x139757
movl $0x4, %edx
callq 0xc99b0
jmp 0xc96f6
jmp 0xc96d9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq 0x8206a(%rip), %r8      # 0x14b75b
callq 0xc9dd0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)