// File: /workspace/github_c_makefile_star2_O1/lengjingzju[P]json/json.c
// Function: json_deepcopy
json_object *json_deepcopy(json_object *json)
{
    json_object *new_json = NULL;
    json_object *item = NULL, *node = NULL;

    switch (json->type_member) {
    case JSON_NULL:   new_json = json_create_null();                        break;
    case JSON_BOOL:   new_json = json_create_bool(json->value.vnum.vbool);  break;
    case JSON_INT:    new_json = json_create_int(json->value.vnum.vint);    break;
    case JSON_HEX:    new_json = json_create_hex(json->value.vnum.vhex);    break;
    case JSON_LINT:   new_json = json_create_lint(json->value.vnum.vlint);  break;
    case JSON_LHEX:   new_json = json_create_lhex(json->value.vnum.vlhex);  break;
    case JSON_DOUBLE: new_json = json_create_double(json->value.vnum.vdbl); break;
    case JSON_STRING: new_json = json_create_string(&json->value.vstr);     break;
    case JSON_ARRAY:  new_json = json_create_array();                       break;
    case JSON_OBJECT: new_json = json_create_object();                      break;
    default:                                                                break;
    }

    if (new_json) {
        if (json_string_strdup(&json->jkey, &new_json->jkey) < 0) {
            JsonErr("add key failed!\n");
            json_del_object(new_json);
            return NULL;
        }
        if (json->type_member == JSON_ARRAY || json->type_member == JSON_OBJECT) {
            json_list_for_each_entry(item, &json->value.head, list, json_object) {
                if ((node = json_deepcopy(item)) == NULL) {
                    JsonErr("copy failed!\n");
                    json_del_object(new_json);
                    return NULL;
                }
                json_list_add_tail(&node->list, &new_json->value.head);
            }
        }
    }

    return new_json;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x8(%rdi), %eax
andl $0xf, %eax
cmpl $0x9, %eax
ja 0x4cb6
leaq 0x750b(%rip), %rcx      # 0xc138
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edi, %edi
jmp 0x4cc0
movq 0x18(%rbx), %rax
movq %rsp, %rsi
movq %rax, (%rsi)
movl $0x4, %edi
jmp 0x4caf
movl $0x9, %edi
jmp 0x4cc0
movl 0x18(%rbx), %eax
movq %rsp, %rsi
movl %eax, (%rsi)
movl $0x2, %edi
jmp 0x4caf
movl 0x18(%rbx), %eax
movq %rsp, %rsi
movl %eax, (%rsi)
movl $0x3, %edi
jmp 0x4caf
leaq 0x18(%rbx), %rsi
movl $0x7, %edi
jmp 0x4caf
movb 0x18(%rbx), %al
movq %rsp, %rsi
movb %al, (%rsi)
movl $0x1, %edi
jmp 0x4caf
movq 0x18(%rbx), %rax
movq %rsp, %rsi
movq %rax, (%rsi)
movl $0x5, %edi
jmp 0x4caf
movsd 0x18(%rbx), %xmm0
movq %rsp, %rsi
movsd %xmm0, (%rsi)
movl $0x6, %edi
callq 0x2290
jmp 0x4cc5
xorl %r14d, %r14d
jmp 0x4cc8
movl $0x8, %edi
callq 0x2030
movq %rax, %r14
testq %r14, %r14
je 0x4d68
leaq 0x8(%rbx), %r15
leaq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x21b0
testl %eax, %eax
js 0x4d2d
movl (%r15), %eax
andl $0xe, %eax
cmpl $0x8, %eax
jne 0x4d68
movq 0x18(%rbx), %r12
addq $0x18, %rbx
cmpq %rbx, %r12
je 0x4d68
leaq 0x79f1(%rip), %r15      # 0xc6f5
movq %r12, %rdi
callq 0x2260
testq %rax, %rax
je 0x4d3b
movq 0x20(%r14), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq %rax, (%rcx)
movq %rax, 0x20(%r14)
movq (%r12), %r12
cmpq %rbx, %r12
jne 0x4d04
jmp 0x4d68
leaq 0x79ce(%rip), %r15      # 0xc702
movl $0x36b, %edx            # imm = 0x36B
jmp 0x4d40
movl $0x372, %edx            # imm = 0x372
leaq 0x7555(%rip), %rdi      # 0xc29c
leaq 0x75eb(%rip), %rsi      # 0xc339
xorl %eax, %eax
callq 0x20f0
movq %r15, %rdi
callq 0x2090
movq %r14, %rdi
callq 0x2270
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq