// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/lua/src/lua_cjson.c
// Function: json_append_number
static void json_append_number(lua_State *l, json_config_t *cfg,
                               strbuf_t *json, int lindex)
{
    double num = lua_tonumber(l, lindex);
    int len;

    if (cfg->encode_invalid_numbers == 0) {
        /* Prevent encoding invalid numbers */
        if (isinf(num) || isnan(num))
            json_encode_exception(l, cfg, json, lindex, "must not be NaN or Inf");
    } else if (cfg->encode_invalid_numbers == 1) {
        /* Encode invalid numbers, but handle "nan" separately
         * since some platforms may encode as "-nan". */
        if (isnan(num)) {
            strbuf_append_mem(json, "nan", 3);
            return;
        }
    } else {
        /* Encode invalid numbers as "null" */
        if (isinf(num) || isnan(num)) {
            strbuf_append_mem(json, "null", 4);
            return;
        }
    }

    strbuf_ensure_empty_length(json, FPCONV_G_FMT_BUFSIZE);
    len = fpconv_g_fmt(strbuf_empty_ptr(json), num, cfg->encode_number_precision);
    strbuf_extend_length(json, len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0xace10
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x530(%rax)
jne 0xc98b0
movsd -0x28(%rbp), %xmm1
movaps %xmm1, %xmm0
movaps 0x711cc(%rip), %xmm2    # 0x13aa10
pand %xmm2, %xmm0
movq %xmm1, %rdx
movl $0x1, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x0, %rdx
cmovll %eax, %ecx
movsd 0x7119a(%rip), %xmm1    # 0x13aa00
xorl %eax, %eax
ucomisd %xmm1, %xmm0
setnp %sil
sete %dl
testb %sil, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
jne 0xc9890
movsd -0x28(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0xc9890
jmp 0xc98ab
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
leaq 0x81f98(%rip), %r8      # 0x14b83e
callq 0xc9dd0
jmp 0xc9961
movq -0x10(%rbp), %rax
cmpl $0x1, 0x530(%rax)
jne 0xc98eb
movsd -0x28(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0xc98cf
jmp 0xc98e9
movq -0x18(%rbp), %rdi
leaq 0x71d0f(%rip), %rsi     # 0x13b5e9
movl $0x3, %edx
callq 0xc99b0
jmp 0xc999e
jmp 0xc995f
movsd -0x28(%rbp), %xmm1
movaps %xmm1, %xmm0
movaps 0x71116(%rip), %xmm2    # 0x13aa10
pand %xmm2, %xmm0
movq %xmm1, %rdx
movl $0x1, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x0, %rdx
cmovll %eax, %ecx
movsd 0x710e4(%rip), %xmm1    # 0x13aa00
xorl %eax, %eax
ucomisd %xmm1, %xmm0
setnp %sil
sete %dl
testb %sil, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
jne 0xc9946
movsd -0x28(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0xc9946
jmp 0xc995d
movq -0x18(%rbp), %rdi
leaq 0x6fe06(%rip), %rsi     # 0x139757
movl $0x4, %edx
callq 0xc99b0
jmp 0xc999e
jmp 0xc995f
jmp 0xc9961
movq -0x18(%rbp), %rdi
movl $0x20, %esi
callq 0xc9e50
movq -0x18(%rbp), %rdi
callq 0xc9ee0
movq %rax, %rdi
movsd -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
movl 0x534(%rax), %esi
callq 0xd32b0
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0xc9f00
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)