// File: /workspace/github_c_makefile_star2_O3/lengjingzju[P]json/json.c
// Function: json_get_items
int json_get_items(json_object *json, json_items_t *items)
{
    json_object *pos = NULL;

    items->count = 0;
    if (json->type_member == JSON_ARRAY) {
        json_list_for_each_entry(pos, &json->value.head, list, json_object) {
            if (items->count == items->total) {
                items->total += JSON_ITEM_NUM_PLUS_DEF;
                json_item_t *new_items = (json_item_t *)json_realloc(items->items, items->total * sizeof(json_item_t));
                if (new_items) {
                    items->items = new_items;
                } else {
                    JsonErr("malloc failed!\n");
                    json_free(items->items);
                    items->items = NULL;
                    goto err;
                }
            }
            items->items[items->count++].json = pos;
        }
        return 0;
    }

    if (json->type_member == JSON_OBJECT) {
        json_list_for_each_entry(pos, &json->value.head, list, json_object) {
            if (items->count == items->total) {
                items->total += JSON_ITEM_NUM_PLUS_DEF;
                json_item_t *new_items = (json_item_t *)json_realloc(items->items, items->total * sizeof(json_item_t));
                if (new_items) {
                    items->items = new_items;
                } else {
                    JsonErr("malloc failed!\n");
                    json_free(items->items);
                    items->items = NULL;
                    goto err;
                }
            }
            items->items[items->count].hash = json_string_hash_code(&pos->jkey);
            items->items[items->count++].json = pos;
        }
        json_object_items_sort(items);
        return 0;
    }

    return -1;
err:
    json_free_items(items);
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movl $0x0, 0x8(%rsi)
movl 0x8(%rdi), %eax
andl $0xf, %eax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x9, %eax
je 0x4b97
cmpl $0x8, %eax
jne 0x4ca1
movq 0x18(%r15), %r12
addq $0x18, %r15
cmpq %r15, %r12
je 0x4c58
movq 0x10(%r14), %rax
xorl %esi, %esi
cmpl 0x4(%r14), %esi
jne 0x4b75
addl $0x10, %esi
movl %esi, 0x4(%r14)
shlq $0x4, %rsi
movq %rax, %rdi
callq 0x2200
testq %rax, %rax
je 0x4c5c
movq %rax, 0x10(%r14)
movl 0x8(%r14), %esi
movl %esi, %ecx
leal 0x1(%rsi), %edx
movl %edx, 0x8(%r14)
shlq $0x4, %rcx
movq %r12, 0x8(%rax,%rcx)
movq (%r12), %r12
movl %edx, %esi
cmpq %r15, %r12
jne 0x4b4b
jmp 0x4c58
movq 0x18(%r15), %r12
addq $0x18, %r15
cmpq %r15, %r12
je 0x4c54
xorl %esi, %esi
cmpl 0x4(%r14), %esi
jne 0x4bd1
addl $0x10, %esi
movl %esi, 0x4(%r14)
movq 0x10(%r14), %rdi
shlq $0x4, %rsi
callq 0x2200
testq %rax, %rax
je 0x4c63
movq %rax, 0x10(%r14)
leaq 0x8(%r12), %rdi
callq 0x2110
movq 0x10(%r14), %rcx
movl 0x8(%r14), %edx
leal 0x1(%rdx), %esi
shlq $0x4, %rdx
movl %eax, (%rcx,%rdx)
movl %esi, 0x8(%r14)
movq %r12, 0x8(%rcx,%rdx)
movq (%r12), %r12
cmpq %r15, %r12
jne 0x4baa
andb $-0x2, (%r14)
xorl %ebx, %ebx
cmpl $0x2, %esi
jb 0x4ca1
movq 0x10(%r14), %rdi
movl %esi, %esi
leaq 0x42e0(%rip), %rcx      # 0x8efb
movl $0x10, %r15d
movl $0x10, %edx
callq 0x2090
movl 0x8(%r14), %eax
cmpq $0x2, %rax
jb 0x4ca1
movq 0x10(%r14), %rcx
movl (%rcx), %edx
shlq $0x4, %rax
movl %edx, %esi
movl (%rcx,%r15), %edx
cmpl %edx, %esi
je 0x4caf
addq $0x10, %r15
cmpq %r15, %rax
jne 0x4c3f
jmp 0x4ca1
andb $-0x2, (%r14)
xorl %ebx, %ebx
jmp 0x4ca1
movl $0x2cc, %edx            # imm = 0x2CC
jmp 0x4c68
movl $0x2df, %edx            # imm = 0x2DF
leaq 0x762d(%rip), %rdi      # 0xc29c
leaq 0x7664(%rip), %rsi      # 0xc2da
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x20e0
leaq 0x7b19(%rip), %rdi      # 0xc7a0
callq 0x2080
movq 0x10(%r14), %rdi
callq 0x2050
movq %r15, 0x10(%r14)
andb $-0x2, (%r14)
movq %r15, 0x4(%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
orb $0x1, (%r14)
jmp 0x4ca1