// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x28(%rsp), %rax
movl 0x8(%rax), %eax
andl $0xf, %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x9, %eax
ja 0x4787
movq 0x8(%rsp), %rax
leaq 0xea7d(%rip), %rcx      # 0x13138
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x48d0
movq %rax, 0x20(%rsp)
jmp 0x4789
movq 0x28(%rsp), %rax
movb 0x18(%rax), %al
andb $0x1, %al
movzbl %al, %edi
callq 0x48e0
movq %rax, 0x20(%rsp)
jmp 0x4789
movq 0x28(%rsp), %rax
movl 0x18(%rax), %edi
callq 0x4900
movq %rax, 0x20(%rsp)
jmp 0x4789
movq 0x28(%rsp), %rax
movl 0x18(%rax), %edi
callq 0x4920
movq %rax, 0x20(%rsp)
jmp 0x4789
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x4940
movq %rax, 0x20(%rsp)
jmp 0x4789
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x4960
movq %rax, 0x20(%rsp)
jmp 0x4789
movq 0x28(%rsp), %rax
movsd 0x18(%rax), %xmm0
callq 0x4980
movq %rax, 0x20(%rsp)
jmp 0x4789
movq 0x28(%rsp), %rdi
addq $0x18, %rdi
callq 0x49a0
movq %rax, 0x20(%rsp)
jmp 0x4789
callq 0x2af0
movq %rax, 0x20(%rsp)
jmp 0x4789
callq 0x49c0
movq %rax, 0x20(%rsp)
jmp 0x4789
jmp 0x4789
cmpq $0x0, 0x20(%rsp)
je 0x48b5
movq 0x28(%rsp), %rdi
addq $0x8, %rdi
movq 0x20(%rsp), %rsi
addq $0x8, %rsi
callq 0x21e0
cmpl $0x0, %eax
jge 0x47f3
jmp 0x47b3
leaq 0xf07e(%rip), %rdi      # 0x13838
leaq 0xf193(%rip), %rsi      # 0x13954
movl $0x36b, %edx            # imm = 0x36B
movb $0x0, %al
callq 0x2100
leaq 0xf111(%rip), %rdi      # 0x138e5
movb $0x0, %al
callq 0x2100
movq 0x20(%rsp), %rdi
callq 0x22a0
movq $0x0, 0x30(%rsp)
jmp 0x48bf
movq 0x28(%rsp), %rax
movl 0x8(%rax), %eax
andl $0xf, %eax
cmpl $0x8, %eax
je 0x4817
movq 0x28(%rsp), %rax
movl 0x8(%rax), %eax
andl $0xf, %eax
cmpl $0x9, %eax
jne 0x48b3
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq 0x28(%rsp), %rcx
addq $0x18, %rcx
cmpq %rcx, %rax
je 0x48b1
movq 0x18(%rsp), %rdi
callq 0x2290
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
jne 0x488c
jmp 0x484f
leaq 0xefe2(%rip), %rdi      # 0x13838
leaq 0xf0f7(%rip), %rsi      # 0x13954
movl $0x372, %edx            # imm = 0x372
movb $0x0, %al
callq 0x2100
leaq 0xf086(%rip), %rdi      # 0x138f6
movb $0x0, %al
callq 0x2100
movq 0x20(%rsp), %rdi
callq 0x22a0
movq $0x0, 0x30(%rsp)
jmp 0x48bf
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
addq $0x18, %rsi
callq 0x2b00
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x4825
jmp 0x48b3
jmp 0x48b5
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax)