// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x20(%rsp), %rax
movl $0x0, 0x8(%rax)
movq 0x28(%rsp), %rax
movl 0x8(%rax), %eax
andl $0xf, %eax
cmpl $0x8, %eax
jne 0x3fef
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 0x3fe2
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x3fa5
movq 0x20(%rsp), %rax
movl 0x4(%rax), %ecx
addl $0x10, %ecx
movl %ecx, 0x4(%rax)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x20(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %esi
shlq $0x4, %rsi
callq 0x2230
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x3f59
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x3fa3
jmp 0x3f5b
leaq 0xf8d6(%rip), %rdi      # 0x13838
leaq 0xf96d(%rip), %rsi      # 0x138d6
movl $0x2cc, %edx            # imm = 0x2CC
movb $0x0, %al
callq 0x2100
leaq 0xf8ce(%rip), %rdi      # 0x1384a
movb $0x0, %al
callq 0x2100
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x2050
movq 0x20(%rsp), %rax
movq $0x0, 0x10(%rax)
jmp 0x4156
jmp 0x3fa5
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rsi
movl 0x8(%rsi), %edx
movl %edx, %edi
addl $0x1, %edi
movl %edi, 0x8(%rsi)
movl %edx, %edx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x3ee5
movl $0x0, 0x34(%rsp)
jmp 0x4168
movq 0x28(%rsp), %rax
movl 0x8(%rax), %eax
andl $0xf, %eax
cmpl $0x9, %eax
jne 0x414c
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 0x4138
movq 0x20(%rsp), %rax
movl 0x8(%rax), %eax
movq 0x20(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x40d1
movq 0x20(%rsp), %rax
movl 0x4(%rax), %ecx
addl $0x10, %ecx
movl %ecx, 0x4(%rax)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x20(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, %esi
shlq $0x4, %rsi
callq 0x2230
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x4085
movq 0x8(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x40cf
jmp 0x4087
leaq 0xf7aa(%rip), %rdi      # 0x13838
leaq 0xf841(%rip), %rsi      # 0x138d6
movl $0x2df, %edx            # imm = 0x2DF
movb $0x0, %al
callq 0x2100
leaq 0xf7a2(%rip), %rdi      # 0x1384a
movb $0x0, %al
callq 0x2100
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x2050
movq 0x20(%rsp), %rax
movq $0x0, 0x10(%rax)
jmp 0x4156
jmp 0x40d1
movq 0x18(%rsp), %rdi
addq $0x8, %rdi
callq 0x2130
movl %eax, %ecx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rdx
movl 0x8(%rdx), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rsi
movl 0x8(%rsi), %edx
movl %edx, %edi
addl $0x1, %edi
movl %edi, 0x8(%rsi)
movl %edx, %edx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x4011
movq 0x20(%rsp), %rdi
callq 0x4180
movl $0x0, 0x34(%rsp)
jmp 0x4168
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
jmp 0x4168
movq 0x20(%rsp), %rdi
callq 0x20f0
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)