// File: /workspace/github_c_makefile_star2_O2/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
movl 0x8(%rdi), %eax
andl $0xf, %eax
cmpl $0x9, %eax
ja 0x3d67
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x6528(%rip), %rcx      # 0xa1a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edi, %edi
jmp 0x3c98
movq 0x18(%r14), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
pushq $0x4
jmp 0x3cf8
pushq $0x9
popq %rdi
movq %rbx, %rsi
callq 0x2040
jmp 0x3d01
movl 0x18(%r14), %eax
leaq 0x8(%rsp), %rsi
movl %eax, (%rsi)
pushq $0x2
jmp 0x3cf8
movl 0x18(%r14), %eax
leaq 0x8(%rsp), %rsi
movl %eax, (%rsi)
pushq $0x3
jmp 0x3cf8
leaq 0x18(%r14), %rsi
pushq $0x7
jmp 0x3cf8
movb 0x18(%r14), %al
leaq 0x8(%rsp), %rsi
movb %al, (%rsi)
pushq $0x1
jmp 0x3cf8
movq 0x18(%r14), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
pushq $0x5
jmp 0x3cf8
movsd 0x18(%r14), %xmm0
leaq 0x8(%rsp), %rsi
movsd %xmm0, (%rsi)
pushq $0x6
popq %rdi
movq %rbx, %rdx
callq 0x21c0
movq %rax, %r15
testq %rax, %rax
je 0x3d67
leaq 0x8(%r14), %r12
leaq 0x8(%r15), %rsi
leaq 0x28(%rbx), %rdx
movq %r12, %rdi
callq 0x2220
testl %eax, %eax
js 0x3d6c
movl (%r12), %eax
andl $0xe, %eax
cmpl $0x8, %eax
jne 0x3dac
addq $0x18, %r14
leaq 0x69c1(%rip), %r12      # 0xa6f9
movq %r14, %r13
movq (%r13), %r13
cmpq %r14, %r13
je 0x3dac
movq %r13, %rdi
movq %rbx, %rsi
callq 0x21a0
testq %rax, %rax
je 0x3d87
movq 0x20(%r15), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq %rax, (%rcx)
movq %rax, 0x20(%r15)
jmp 0x3d3b
xorl %r15d, %r15d
jmp 0x3dac
leaq 0x6993(%rip), %r12      # 0xa706
movl $0x4fb, %edx            # imm = 0x4FB
jmp 0x3d8c
movq %rbx, %rdi
callq 0x3a72
jmp 0x3d01
movl $0x501, %edx            # imm = 0x501
leaq 0x650d(%rip), %rdi      # 0xa2a0
leaq 0x65a2(%rip), %rsi      # 0xa33c
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x2100
movq %r12, %rdi
callq 0x2080
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq