// File: /workspace/github_c_makefile_star2_O3/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
pushq %rax
movq %rcx, %rbx
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %r14
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x860ba
cmpl $0x5, %eax
ja 0x975a7
movl %eax, %eax
leaq 0x3a1f4(%rip), %rcx     # 0xd1720
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x862d2
movl 0xc(%rbx), %esi
movl %esi, %ecx
subl 0x8(%rbx), %ecx
testl %eax, %eax
je 0x97720
cmpl $-0x4, %ecx
jl 0x97565
addl $0x4, %esi
movq %rbx, %rdi
callq 0x9d14d
movl 0xc(%rbx), %esi
movq (%rbx), %rax
movslq %esi, %rcx
movl $0x65757274, (%rax,%rcx) # imm = 0x65757274
jmp 0x975fb
movq %r14, %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x97a3e
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x863eb
testq %rax, %rax
je 0x975d3
movl 0x538(%r15), %esi
leaq 0x3a286(%rip), %r8      # 0xd183b
movq %r14, %rdi
movq %rbx, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x97c4f
movl 0xc(%rbx), %esi
movl %esi, %eax
subl 0x8(%rbx), %eax
cmpl $-0x4, %eax
jl 0x975ee
addl $0x4, %esi
movq %rbx, %rdi
callq 0x9d14d
movl 0xc(%rbx), %esi
movq (%rbx), %rax
movslq %esi, %rcx
movl $0x6c6c756e, (%rax,%rcx) # imm = 0x6C6C756E
addl $0x4, 0xc(%rbx)
jmp 0x97a2f
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x97aef
leal 0x1(%r12), %ebp
cmpl %r12d, 0x52c(%r15)
jle 0x97644
movq %r14, %rdi
movl $0x3, %esi
callq 0x85c3e
testl %eax, %eax
jne 0x97669
cmpl $0x0, 0x538(%r15)
jne 0x97656
movq %rbx, %rdi
callq 0x9d0c9
leaq 0x3a2d8(%rip), %rsi     # 0xd1935
movq %r14, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x91147
movq %r14, %rdi
callq 0x86487
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x86e33
testl %eax, %eax
je 0x9774e
xorl %r12d, %r12d
xorl %r13d, %r13d
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x860ba
cmpl $0x3, %eax
jne 0x9770e
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x86274
ucomisd 0x37eed(%rip), %xmm0    # 0xcf5a0
jne 0x976b7
jnp 0x9770e
movsd %xmm0, (%rsp)
callq 0x26b50
movsd (%rsp), %xmm1
ucomisd 0x29352(%rip), %xmm1    # 0xc0a20
jb 0x9770e
ucomisd %xmm1, %xmm0
jne 0x9770e
jp 0x9770e
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x976eb
cvttsd2si %xmm1, %r13d
incl %r12d
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x85d59
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x86e33
testl %eax, %eax
jne 0x9768c
jmp 0x97754
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x85d59
jmp 0x9787f
cmpl $-0x5, %ecx
jl 0x97733
addl $0x5, %esi
movq %rbx, %rdi
callq 0x9d14d
movl 0xc(%rbx), %esi
movq (%rbx), %rax
movslq %esi, %rcx
movb $0x65, 0x4(%rax,%rcx)
movl $0x736c6166, (%rax,%rcx) # imm = 0x736C6166
addl $0x5, 0xc(%rbx)
jmp 0x97a2f
xorl %r13d, %r13d
xorl %r12d, %r12d
movl 0x524(%r15), %eax
testl %eax, %eax
jle 0x977a2
imull %r12d, %eax
cmpl %eax, %r13d
jle 0x977a2
cmpl 0x528(%r15), %r13d
jle 0x977a2
cmpl $0x0, 0x520(%r15)
jne 0x9787f
movl 0x538(%r15), %esi
leaq 0x3a1d1(%rip), %r8      # 0xd195e
movq %r14, %rdi
movq %rbx, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x97c4f
jmp 0x9787f
testl %r13d, %r13d
jle 0x9787f
movl 0xc(%rbx), %esi
movl %esi, %eax
subl 0x8(%rbx), %eax
cmpl $-0x1, %eax
jl 0x977c5
incl %esi
movq %rbx, %rdi
callq 0x9d14d
movl 0xc(%rbx), %esi
movq (%rbx), %rax
leal 0x1(%rsi), %ecx
movl %ecx, 0xc(%rbx)
movslq %esi, %rcx
movb $0x5b, (%rax,%rcx)
negl %r13d
movb $0x1, %al
movl $0x1, %r12d
testb $0x1, %al
jne 0x9780e
movl 0xc(%rbx), %esi
movl %esi, %eax
subl 0x8(%rbx), %eax
cmpl $-0x1, %eax
jl 0x977fe
incl %esi
movq %rbx, %rdi
callq 0x9d14d
movl 0xc(%rbx), %esi
movq (%rbx), %rax
leal 0x1(%rsi), %ecx
movl %ecx, 0xc(%rbx)
movslq %esi, %rcx
movb $0x2c, (%rax,%rcx)
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %r12d, %edx
callq 0x867e3
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %rbx, %rcx
callq 0x974f9
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x85d59
leal (%r12,%r13), %ecx
incl %ecx
movl %r12d, %edx
incl %edx
xorl %eax, %eax
movl %edx, %r12d
cmpl $0x1, %ecx
jne 0x977e0
movl 0xc(%rbx), %esi
movl %esi, %eax
subl 0x8(%rbx), %eax
cmpl $-0x1, %eax
jl 0x9786a
incl %esi
movq %rbx, %rdi
callq 0x9d14d
movl 0xc(%rbx), %esi
movq (%rbx), %rax
leal 0x1(%rsi), %ecx
movl %ecx, 0xc(%rbx)
movslq %esi, %rcx
movb $0x5d, (%rax,%rcx)
jmp 0x97a2f
movl 0xc(%rbx), %esi
movl %esi, %eax
subl 0x8(%rbx), %eax
cmpl $-0x1, %eax
jl 0x97899
incl %esi
movq %rbx, %rdi
callq 0x9d14d
movl 0xc(%rbx), %esi
movq (%rbx), %rax
leal 0x1(%rsi), %ecx
movl %ecx, 0xc(%rbx)
movslq %esi, %rcx
movb $0x7b, (%rax,%rcx)
movq %r14, %rdi
callq 0x86487
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x86e33
testl %eax, %eax
je 0x97a05
leaq 0x3a0aa(%rip), %r12     # 0xd1977
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x860ba
cmpl $0x4, %eax
je 0x97952
cmpl $0x3, %eax
jne 0x9798e
movl 0xc(%rbx), %esi
movl %esi, %eax
subl 0x8(%rbx), %eax
cmpl $-0x1, %eax
jl 0x97902
incl %esi
movq %rbx, %rdi
callq 0x9d14d
movl 0xc(%rbx), %esi
movq (%rbx), %rax
leal 0x1(%rsi), %ecx
movl %ecx, 0xc(%rbx)
movslq %esi, %rcx
movb $0x22, (%rax,%rcx)
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x97aef
movl 0xc(%rbx), %esi
movl %esi, %eax
subl 0x8(%rbx), %eax
cmpl $-0x2, %eax
jl 0x97940
addl $0x2, %esi
movq %rbx, %rdi
callq 0x9d14d
movl 0xc(%rbx), %esi
movq (%rbx), %rax
movslq %esi, %rcx
movw $0x3a22, (%rax,%rcx)    # imm = 0x3A22
addl $0x2, 0xc(%rbx)
jmp 0x979a8
movq %r14, %rdi
movq %rbx, %rsi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
callq 0x97a3e
movl 0xc(%rbx), %esi
movl %esi, %eax
subl 0x8(%rbx), %eax
cmpl $-0x1, %eax
jl 0x9797c
incl %esi
movq %rbx, %rdi
callq 0x9d14d
movl 0xc(%rbx), %esi
movq (%rbx), %rax
leal 0x1(%rsi), %ecx
movl %ecx, 0xc(%rbx)
movslq %esi, %rcx
movb $0x3a, (%rax,%rcx)
jmp 0x979a8
movl 0x538(%r15), %esi
movq %r14, %rdi
movq %rbx, %rdx
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
movq %r12, %r8
callq 0x97c4f
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %rbx, %rcx
callq 0x974f9
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x85d59
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x86e33
testl %eax, %eax
je 0x97a05
movl 0xc(%rbx), %esi
movl %esi, %eax
subl 0x8(%rbx), %eax
cmpl $-0x1, %eax
jl 0x979f0
incl %esi
movq %rbx, %rdi
callq 0x9d14d
movl 0xc(%rbx), %esi
movq (%rbx), %rax
leal 0x1(%rsi), %ecx
movl %ecx, 0xc(%rbx)
movslq %esi, %rcx
movb $0x2c, (%rax,%rcx)
jmp 0x978cd
movl 0xc(%rbx), %esi
movl %esi, %eax
subl 0x8(%rbx), %eax
cmpl $-0x1, %eax
jl 0x97a1f
incl %esi
movq %rbx, %rdi
callq 0x9d14d
movl 0xc(%rbx), %esi
movq (%rbx), %rax
leal 0x1(%rsi), %ecx
movl %ecx, 0xc(%rbx)
movslq %esi, %rcx
movb $0x7d, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq