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

    switch (json->type_member) {
    case JSON_NULL:   new_json = pjson_create_null(mem);                          break;
    case JSON_BOOL:   new_json = pjson_create_bool(json->value.vnum.vbool, mem);  break;
    case JSON_INT:    new_json = pjson_create_int(json->value.vnum.vint, mem);    break;
    case JSON_HEX:    new_json = pjson_create_hex(json->value.vnum.vhex, mem);    break;
    case JSON_LINT:   new_json = pjson_create_lint(json->value.vnum.vlint, mem);  break;
    case JSON_LHEX:   new_json = pjson_create_lhex(json->value.vnum.vlhex, mem);  break;
    case JSON_DOUBLE: new_json = pjson_create_double(json->value.vnum.vdbl, mem); break;
    case JSON_STRING: new_json = pjson_create_string(&json->value.vstr, mem);     break;
    case JSON_ARRAY:  new_json = pjson_create_array(mem);                         break;
    case JSON_OBJECT: new_json = pjson_create_object(mem);                        break;
    default:                                                                      break;
    }

    if (new_json) {
        if (pjson_string_strdup(&json->jkey, &new_json->jkey, &mem->key_mgr) < 0) {
            JsonErr("add key failed!\n");
            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 = pjson_deepcopy(item, mem)) == NULL) {
                    JsonErr("copy failed!\n");
                    return NULL;
                }
                json_list_add_tail(&node->list, &new_json->value.head);
            }
        }
    }

    return new_json;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x8(%rdi), %eax
andl $0xf, %eax
cmpl $0x9, %eax
ja 0x5748
leaq 0x6af0(%rip), %rcx      # 0xc19c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edi, %edi
jmp 0x5752
movq 0x18(%r14), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movl $0x4, %edi
jmp 0x573e
movl $0x9, %edi
jmp 0x5752
movl 0x18(%r14), %eax
leaq 0x8(%rsp), %rsi
movl %eax, (%rsi)
movl $0x2, %edi
jmp 0x573e
movl 0x18(%r14), %eax
leaq 0x8(%rsp), %rsi
movl %eax, (%rsi)
movl $0x3, %edi
jmp 0x573e
leaq 0x18(%r14), %rsi
movl $0x7, %edi
jmp 0x573e
movb 0x18(%r14), %al
leaq 0x8(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edi
jmp 0x573e
movq 0x18(%r14), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movl $0x5, %edi
jmp 0x573e
movsd 0x18(%r14), %xmm0
leaq 0x8(%rsp), %rsi
movsd %xmm0, (%rsi)
movl $0x6, %edi
movq %rbx, %rdx
callq 0x21a0
jmp 0x575a
xorl %r15d, %r15d
jmp 0x575d
movl $0x8, %edi
movq %rbx, %rsi
callq 0x2040
movq %rax, %r15
testq %r15, %r15
je 0x57fd
leaq 0x8(%r14), %r12
leaq 0x8(%r15), %rsi
leaq 0x28(%rbx), %rdx
movq %r12, %rdi
callq 0x2200
testl %eax, %eax
js 0x57ca
movl (%r12), %eax
andl $0xe, %eax
cmpl $0x8, %eax
jne 0x57fd
movq 0x18(%r14), %r13
addq $0x18, %r14
cmpq %r14, %r13
je 0x57fd
leaq 0x6f57(%rip), %r12      # 0xc6f5
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2180
testq %rax, %rax
je 0x57d8
movq 0x20(%r15), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq %rax, (%rcx)
movq %rax, 0x20(%r15)
movq (%r13), %r13
cmpq %r14, %r13
jne 0x579e
jmp 0x57fd
leaq 0x6f31(%rip), %r12      # 0xc702
movl $0x4fb, %edx            # imm = 0x4FB
jmp 0x57dd
movl $0x501, %edx            # imm = 0x501
leaq 0x6ab8(%rip), %rdi      # 0xc29c
leaq 0x6b4d(%rip), %rsi      # 0xc338
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x20f0
movq %r12, %rdi
callq 0x2090
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq