// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x28(%rsp), %rax
movl 0x8(%rax), %eax
andl $0xf, %eax
movl %eax, %ecx
movq %rcx, (%rsp)
subl $0x9, %eax
ja 0x5abf
movq (%rsp), %rax
leaq 0xd7e6(%rip), %rcx      # 0x131a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x20(%rsp), %rdi
callq 0x5c00
movq %rax, 0x18(%rsp)
jmp 0x5ac1
movq 0x28(%rsp), %rax
movb 0x18(%rax), %al
movq 0x20(%rsp), %rsi
andb $0x1, %al
movzbl %al, %edi
callq 0x5c20
movq %rax, 0x18(%rsp)
jmp 0x5ac1
movq 0x28(%rsp), %rax
movl 0x18(%rax), %edi
movq 0x20(%rsp), %rsi
callq 0x5c50
movq %rax, 0x18(%rsp)
jmp 0x5ac1
movq 0x28(%rsp), %rax
movl 0x18(%rax), %edi
movq 0x20(%rsp), %rsi
callq 0x5c80
movq %rax, 0x18(%rsp)
jmp 0x5ac1
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x20(%rsp), %rsi
callq 0x5cb0
movq %rax, 0x18(%rsp)
jmp 0x5ac1
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x20(%rsp), %rsi
callq 0x5ce0
movq %rax, 0x18(%rsp)
jmp 0x5ac1
movq 0x28(%rsp), %rax
movsd 0x18(%rax), %xmm0
movq 0x20(%rsp), %rdi
callq 0x5d10
movq %rax, 0x18(%rsp)
jmp 0x5ac1
movq 0x28(%rsp), %rdi
addq $0x18, %rdi
movq 0x20(%rsp), %rsi
callq 0x5d40
movq %rax, 0x18(%rsp)
jmp 0x5ac1
movq 0x20(%rsp), %rdi
callq 0x5650
movq %rax, 0x18(%rsp)
jmp 0x5ac1
movq 0x20(%rsp), %rdi
callq 0x5d70
movq %rax, 0x18(%rsp)
jmp 0x5ac1
jmp 0x5ac1
cmpq $0x0, 0x18(%rsp)
je 0x5be7
movq 0x28(%rsp), %rdi
addq $0x8, %rdi
movq 0x18(%rsp), %rsi
addq $0x8, %rsi
movq 0x20(%rsp), %rdx
addq $0x28, %rdx
callq 0x2220
cmpl $0x0, %eax
jge 0x5b2a
jmp 0x5af4
leaq 0xdd3d(%rip), %rdi      # 0x13838
leaq 0xde51(%rip), %rsi      # 0x13953
movl $0x4fb, %edx            # imm = 0x4FB
movb $0x0, %al
callq 0x2100
leaq 0xddd0(%rip), %rdi      # 0x138e5
movb $0x0, %al
callq 0x2100
movq $0x0, 0x30(%rsp)
jmp 0x5bf1
movq 0x28(%rsp), %rax
movl 0x8(%rax), %eax
andl $0xf, %eax
cmpl $0x8, %eax
je 0x5b4e
movq 0x28(%rsp), %rax
movl 0x8(%rax), %eax
andl $0xf, %eax
cmpl $0x9, %eax
jne 0x5be5
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x28(%rsp), %rcx
addq $0x18, %rcx
cmpq %rcx, %rax
je 0x5be3
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x21b0
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
jne 0x5bbe
jmp 0x5b8b
leaq 0xdca6(%rip), %rdi      # 0x13838
leaq 0xddba(%rip), %rsi      # 0x13953
movl $0x501, %edx            # imm = 0x501
movb $0x0, %al
callq 0x2100
leaq 0xdd4a(%rip), %rdi      # 0x138f6
movb $0x0, %al
callq 0x2100
movq $0x0, 0x30(%rsp)
jmp 0x5bf1
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
addq $0x18, %rsi
callq 0x2b00
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x5b5c
jmp 0x5be5
jmp 0x5be7
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)