// File: Eba-M[P]E3DC-Control/cJSON.c
// Function: print_value(cJSON const*, printbuffer*)
static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer)
{
    unsigned char *output = NULL;

    if ((item == NULL) || (output_buffer == NULL))
    {
        return false;
    }

    switch ((item->type) & 0xFF)
    {
        case cJSON_NULL:
            output = ensure(output_buffer, 5);
            if (output == NULL)
            {
                return false;
            }
            strcpy((char*)output, "null");
            return true;

        case cJSON_False:
            output = ensure(output_buffer, 6);
            if (output == NULL)
            {
                return false;
            }
            strcpy((char*)output, "false");
            return true;

        case cJSON_True:
            output = ensure(output_buffer, 5);
            if (output == NULL)
            {
                return false;
            }
            strcpy((char*)output, "true");
            return true;

        case cJSON_Number:
            return print_number(item, output_buffer);

        case cJSON_Raw:
        {
            size_t raw_length = 0;
            if (item->valuestring == NULL)
            {
                return false;
            }

            raw_length = strlen(item->valuestring) + sizeof("");
            output = ensure(output_buffer, raw_length);
            if (output == NULL)
            {
                return false;
            }
            memcpy(output, item->valuestring, raw_length);
            return true;
        }

        case cJSON_String:
            return print_string(item, output_buffer);

        case cJSON_Array:
            return print_array(item, output_buffer);

        case cJSON_Object:
            return print_object(item, output_buffer);

        default:
            return false;
    }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x59d47
cmpq $0x0, 0x20(%rsp)
jne 0x59d54
movl $0x0, 0x34(%rsp)
jmp 0x59f8b
movq 0x28(%rsp), %rax
movzbl 0x18(%rax), %eax
movl %eax, 0xc(%rsp)
subl $0x1, %eax
je 0x59e1d
jmp 0x59d6c
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0x59e64
jmp 0x59d7b
movl 0xc(%rsp), %eax
subl $0x4, %eax
je 0x59dd6
jmp 0x59d86
movl 0xc(%rsp), %eax
subl $0x8, %eax
je 0x59eab
jmp 0x59d95
movl 0xc(%rsp), %eax
subl $0x10, %eax
je 0x59f44
jmp 0x59da4
movl 0xc(%rsp), %eax
subl $0x20, %eax
je 0x59f59
jmp 0x59db3
movl 0xc(%rsp), %eax
subl $0x40, %eax
je 0x59f6e
jmp 0x59dc2
movl 0xc(%rsp), %eax
subl $0x80, %eax
je 0x59ec3
jmp 0x59f83
movq 0x20(%rsp), %rdi
movl $0x5, %esi
callq 0x5d750
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x59dff
movl $0x0, 0x34(%rsp)
jmp 0x59f8b
movq 0x18(%rsp), %rdi
leaq 0x8b4a(%rip), %rsi      # 0x62955
callq 0x2290
movl $0x1, 0x34(%rsp)
jmp 0x59f8b
movq 0x20(%rsp), %rdi
movl $0x6, %esi
callq 0x5d750
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x59e46
movl $0x0, 0x34(%rsp)
jmp 0x59f8b
movq 0x18(%rsp), %rdi
leaq 0x66d2(%rip), %rsi      # 0x60524
callq 0x2290
movl $0x1, 0x34(%rsp)
jmp 0x59f8b
movq 0x20(%rsp), %rdi
movl $0x5, %esi
callq 0x5d750
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x59e8d
movl $0x0, 0x34(%rsp)
jmp 0x59f8b
movq 0x18(%rsp), %rdi
leaq 0x6686(%rip), %rsi      # 0x6051f
callq 0x2290
movl $0x1, 0x34(%rsp)
jmp 0x59f8b
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x5d9a0
movl %eax, 0x34(%rsp)
jmp 0x59f8b
movq $0x0, 0x10(%rsp)
movq 0x28(%rsp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x59ee5
movl $0x0, 0x34(%rsp)
jmp 0x59f8b
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x2130
addq $0x1, %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x5d750
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x59f22
movl $0x0, 0x34(%rsp)
jmp 0x59f8b
movq 0x18(%rsp), %rdi
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rsi
movq 0x10(%rsp), %rdx
callq 0x2220
movl $0x1, 0x34(%rsp)
jmp 0x59f8b
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x5dbf0
movl %eax, 0x34(%rsp)
jmp 0x59f8b
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x5dc20
movl %eax, 0x34(%rsp)
jmp 0x59f8b
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x5de10
movl %eax, 0x34(%rsp)
jmp 0x59f8b
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)