// File: /workspace/github_c_makefile_star2_O3/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 0x5abd
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x67f4(%rip), %rcx      # 0xc19c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edi, %edi
jmp 0x5a49
movq 0x18(%r14), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movl $0x4, %edi
jmp 0x5a3a
movl $0x9, %edi
jmp 0x5a49
movl 0x18(%r14), %eax
leaq 0x8(%rsp), %rsi
movl %eax, (%rsi)
movl $0x2, %edi
jmp 0x5a3a
movl 0x18(%r14), %eax
leaq 0x8(%rsp), %rsi
movl %eax, (%rsi)
movl $0x3, %edi
jmp 0x5a3a
leaq 0x18(%r14), %rsi
movl $0x7, %edi
jmp 0x5a3a
movb 0x18(%r14), %al
leaq 0x8(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edi
jmp 0x5a3a
movq 0x18(%r14), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movl $0x5, %edi
jmp 0x5a3a
movsd 0x18(%r14), %xmm0
leaq 0x8(%rsp), %rsi
movsd %xmm0, (%rsi)
movl $0x6, %edi
movq %rbx, %rdx
callq 0x2190
jmp 0x5a51
movl $0x8, %edi
movq %rbx, %rsi
callq 0x2040
movq %rax, %r15
testq %rax, %rax
je 0x5abd
leaq 0x8(%r14), %r12
leaq 0x8(%r15), %rsi
leaq 0x28(%rbx), %rdx
movq %r12, %rdi
callq 0x21f0
testl %eax, %eax
js 0x5ac2
movl (%r12), %eax
andl $0xe, %eax
cmpl $0x8, %eax
jne 0x5af5
movq 0x18(%r14), %r13
addq $0x18, %r14
cmpq %r14, %r13
je 0x5af5
leaq 0x6c64(%rip), %r12      # 0xc6f5
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2170
testq %rax, %rax
je 0x5ad0
movq 0x20(%r15), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq %rax, (%rcx)
movq %rax, 0x20(%r15)
movq (%r13), %r13
cmpq %r14, %r13
jne 0x5a91
jmp 0x5af5
xorl %r15d, %r15d
jmp 0x5af5
leaq 0x6c39(%rip), %r12      # 0xc702
movl $0x4fb, %edx            # imm = 0x4FB
jmp 0x5ad5
movl $0x501, %edx            # imm = 0x501
leaq 0x67c0(%rip), %rdi      # 0xc29c
leaq 0x6855(%rip), %rsi      # 0xc338
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x20e0
movq %r12, %rdi
callq 0x2080
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq