// File: /workspace/github_c_makefile_star2_O2/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:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x8(%rdi), %eax
andl $0xf, %eax
cmpl $0x9, %eax
ja 0x3379
movq %rdi, %rbx
leaq 0x6ed3(%rip), %rcx      # 0xa138
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edi, %edi
jmp 0x3283
movq 0x18(%rbx), %rax
movq %rsp, %rsi
movq %rax, (%rsi)
pushq $0x4
jmp 0x32d2
pushq $0x9
popq %rdi
callq 0x2030
jmp 0x32d8
movl 0x18(%rbx), %eax
movq %rsp, %rsi
movl %eax, (%rsi)
pushq $0x2
jmp 0x32d2
movl 0x18(%rbx), %eax
movq %rsp, %rsi
movl %eax, (%rsi)
pushq $0x3
jmp 0x32d2
leaq 0x18(%rbx), %rsi
pushq $0x7
jmp 0x32d2
movb 0x18(%rbx), %al
movq %rsp, %rsi
movb %al, (%rsi)
pushq $0x1
jmp 0x32d2
movq 0x18(%rbx), %rax
movq %rsp, %rsi
movq %rax, (%rsi)
pushq $0x5
jmp 0x32d2
movsd 0x18(%rbx), %xmm0
movq %rsp, %rsi
movsd %xmm0, (%rsi)
pushq $0x6
popq %rdi
callq 0x22c0
movq %rax, %r14
testq %rax, %rax
je 0x3379
leaq 0x8(%rbx), %r15
leaq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x21d0
testl %eax, %eax
js 0x333a
movl (%r15), %eax
andl $0xe, %eax
cmpl $0x8, %eax
jne 0x337c
addq $0x18, %rbx
leaq 0x73eb(%rip), %r15      # 0xa6f9
movq %rbx, %r12
movq (%r12), %r12
cmpq %rbx, %r12
je 0x337c
movq %r12, %rdi
callq 0x2290
testq %rax, %rax
je 0x334f
movq 0x20(%r14), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq %rax, (%rcx)
movq %rax, 0x20(%r14)
jmp 0x3311
leaq 0x73c5(%rip), %r15      # 0xa706
movl $0x36b, %edx            # imm = 0x36B
jmp 0x3354
callq 0x26b6
jmp 0x32d8
movl $0x372, %edx            # imm = 0x372
leaq 0x6f45(%rip), %rdi      # 0xa2a0
leaq 0x6fdb(%rip), %rsi      # 0xa33d
xorl %eax, %eax
callq 0x2100
movq %r15, %rdi
callq 0x2080
movq %r14, %rdi
callq 0x22a0
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq