// File: /workspace/github_c_makefile_star2_O1/lengjingzju[P]json/json.c
// Function: json_parse_value
static int _json_parse_value(json_parse_t *parse_ptr, json_object **root)
{
    json_string_t jkey = {0};
    char *str = NULL;
    json_object *item = NULL, *parent = NULL;
    json_object **item_array = NULL;
    int item_depth = -1, item_total = 0;

    goto next3;

next1:
    if (unlikely(item_depth >= item_total - 1)) {
        item_total += JSON_ITEM_NUM_PLUS_DEF;
        json_object **new_array = (json_object **)json_realloc(item_array, sizeof(json_object *) * item_total);
        if (new_array) {
            item_array = new_array;
        } else {
            JsonErr("malloc failed!\n");
            json_free(item_array);
            item_array = NULL;
            goto err;
        }
    }
    item_array[++item_depth] = item;
    parent = item;
    *root = *item_array;
    if (parent->type_member == JSON_ARRAY)
        goto next3;

next2:
    if (unlikely(_json_parse_key(parse_ptr, &jkey) < 0)) {
        goto err;
    }

next3:
    if (unlikely((item = (json_object *)_parse_alloc(parse_ptr, sizeof(json_object), &parse_ptr->mem->obj_mgr)) == NULL)) {
        JsonErr("malloc failed!\n");
        goto err;
    }
    memcpy(&item->jkey, &jkey, sizeof(json_string_t));
    memset(&jkey, 0, sizeof(json_string_t));

    parse_ptr->skip_blank(parse_ptr);
    _get_parse_ptr(parse_ptr, 0, 128, &str);

    switch (*str) {
    case '{':
        item->type_member = JSON_OBJECT;
        INIT_JSON_LIST_HEAD(&item->value.head);
        _UPDATE_PARSE_OFFSET(1);

        parse_ptr->skip_blank(parse_ptr);
        _get_parse_ptr(parse_ptr, 0, 1, &str);
        if (likely(*str != '}')) {
            if (parent)
                json_list_add_tail(&item->list, &parent->value.head);
            goto next1;
        } else {
            _UPDATE_PARSE_OFFSET(1);
        }
        break;

    case '[':
        item->type_member = JSON_ARRAY;
        INIT_JSON_LIST_HEAD(&item->value.head);
        _UPDATE_PARSE_OFFSET(1);

        parse_ptr->skip_blank(parse_ptr);
        _get_parse_ptr(parse_ptr, 0, 1, &str);
        if (likely(*str != ']')) {
            if (parent)
                json_list_add_tail(&item->list, &parent->value.head);
            goto next1;
        } else {
            _UPDATE_PARSE_OFFSET(1);
        }
        break;

    default:
        if (_json_parse_single_value(parse_ptr, str, &item->jkey, &item->value) < 0)
            goto err;
        break;
    }

    if (parent) {
        json_list_add_tail(&item->list, &parent->value.head);
        item = NULL;
    }

next4:
    if (likely(item_depth >= 0)) {
        parse_ptr->skip_blank(parse_ptr);
        _get_parse_ptr(parse_ptr, 0, 1, &str);
        if (parent->type_member == JSON_OBJECT) {
            switch (*str) {
            case ',':
                _UPDATE_PARSE_OFFSET(1);
#if !JSON_PARSE_LAST_COMMA
                goto next2;
#else
                parse_ptr->skip_blank(parse_ptr);
                _get_parse_ptr(parse_ptr, 0, 1, &str);
                if (*str != '}')
                    goto next2;
                FALLTHROUGH_ATTR;
#endif
            case '}':
                _UPDATE_PARSE_OFFSET(1);
                if (likely(item_depth > 0)) {
                    parent = item_array[--item_depth];
                    goto next4;
                }
                break;
            default:
                JsonPareseErr("invalid object!");
                goto err;
            }
        } else {
            switch (*str) {
            case ',':
                _UPDATE_PARSE_OFFSET(1);
#if !JSON_PARSE_LAST_COMMA
                goto next3;
#else
                parse_ptr->skip_blank(parse_ptr);
                _get_parse_ptr(parse_ptr, 0, 1, &str);
                if (*str != ']')
                    goto next3;
                FALLTHROUGH_ATTR;
#endif
            case ']':
                _UPDATE_PARSE_OFFSET(1);
                if (likely(item_depth > 0)) {
                    parent = item_array[--item_depth];
                    goto next4;
                }
                break;
            default:
                JsonPareseErr("invalid array!");
                goto err;
            }
        }
    }

    if (item_array) {
        *root = *item_array;
        json_free(item_array);
    } else {
        *root = item;
    }

    return 0;

err:
    if (item_array) {
        *root = *item_array;
        json_free(item_array);
    } else {
        if (!(*root)) {
            *root = item;
            item = NULL;
        }
    }

    if (parse_ptr->mem == &s_invalid_json_mem) {
        if (item)
            json_free(item);
        if (jkey.str)
            json_free(jkey.str);
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, 0x8(%rsp)
movq %rdi, %r12
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rax
movaps %xmm0, (%rax)
movq %rsp, %rbp
movq $0x0, (%rbp)
leaq 0x38(%rdi), %rax
movq %rax, 0x18(%rsp)
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
xorl %ebx, %ebx
xorl %r14d, %r14d
movq $0x0, 0x10(%rsp)
movq %rbx, %r15
movq 0x38(%r12), %rsi
leaq 0xb33a(%rip), %rax      # 0x10238
cmpq %rax, %rsi
je 0x4f13
addq $0x8, %rsi
movl $0x28, %edi
callq 0x3c99
jmp 0x4f1d
movl $0x28, %edi
callq 0x1160
movq %rax, %rbx
testq %rax, %rax
je 0x5374
movaps 0x20(%rsp), %xmm0
movups %xmm0, 0x8(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq %r12, %rdi
callq *0x40(%r12)
movl $0x80, %edx
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rcx
callq 0x751f
movq (%rsp), %rsi
movzbl (%rsi), %eax
cmpl $0x5b, %eax
je 0x4faf
cmpl $0x7b, %eax
jne 0x4ffa
movl 0x8(%rbx), %eax
andl $-0x10, %eax
orl $0x9, %eax
movl %eax, 0x8(%rbx)
leaq 0x18(%rbx), %rax
movq %rax, 0x18(%rbx)
movq %rax, 0x20(%rbx)
incq 0x10(%r12)
movq %r12, %rdi
callq *0x40(%r12)
movl $0x1, %edx
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rcx
callq 0x751f
movq (%rsp), %rax
cmpb $0x7d, (%rax)
jne 0x5101
jmp 0x4ff3
movl 0x8(%rbx), %eax
andl $-0x10, %eax
orl $0x8, %eax
movl %eax, 0x8(%rbx)
leaq 0x18(%rbx), %rax
movq %rax, 0x18(%rbx)
movq %rax, 0x20(%rbx)
incq 0x10(%r12)
movq %r12, %rdi
callq *0x40(%r12)
movl $0x1, %edx
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rcx
callq 0x751f
movq (%rsp), %rax
cmpb $0x5d, (%rax)
jne 0x5101
incq 0x10(%r12)
jmp 0x5012
leaq 0x8(%rbx), %rdx
leaq 0x18(%rbx), %rcx
movq %r12, %rdi
callq 0x201d
testl %eax, %eax
js 0x52e1
testq %r15, %r15
je 0x502a
movq 0x20(%r15), %rax
movq (%rax), %rcx
movq %rcx, (%rbx)
movq %rbx, (%rax)
movq %rbx, 0x20(%r15)
xorl %ebx, %ebx
testl %r13d, %r13d
js 0x533f
movl %r13d, %r13d
movq %r12, %rdi
callq *0x40(%r12)
movl $0x1, %edx
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rcx
callq 0x751f
movl 0x8(%r15), %ecx
andl $0xf, %ecx
movq (%rsp), %rax
movzbl (%rax), %eax
cmpl $0x9, %ecx
jne 0x509e
cmpl $0x7d, %eax
je 0x50d8
cmpl $0x2c, %eax
jne 0x5238
incq 0x10(%r12)
movq %r12, %rdi
callq *0x40(%r12)
movl $0x1, %edx
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rcx
callq 0x751f
movq (%rsp), %rax
cmpb $0x7d, (%rax)
je 0x50d8
jmp 0x514b
cmpl $0x5d, %eax
je 0x50d8
cmpl $0x2c, %eax
jne 0x51de
incq 0x10(%r12)
movq %r12, %rdi
callq *0x40(%r12)
movl $0x1, %edx
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rcx
callq 0x751f
movq (%rsp), %rax
cmpb $0x5d, (%rax)
jne 0x4ef2
incq 0x10(%r12)
testq %r13, %r13
je 0x533f
leaq -0x1(%r13), %rax
movl %eax, %ecx
movq (%r14,%rcx,8), %r15
testq %r13, %r13
movq %rax, %r13
jg 0x5036
jmp 0x533f
testq %r15, %r15
je 0x5117
movq 0x20(%r15), %rax
movq (%rax), %rcx
movq %rcx, (%rbx)
movq %rbx, (%rax)
movq %rbx, 0x20(%r15)
movq 0x10(%rsp), %rax
decl %eax
cmpl %eax, %r13d
jge 0x516d
movslq %r13d, %rax
incl %r13d
movq %rbx, 0x8(%r14,%rax,8)
movq (%r14), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movl 0x8(%rbx), %eax
andl $0xf, %eax
movq %rbx, %r15
cmpl $0x8, %eax
je 0x4eef
movq %rbx, 0x38(%rsp)
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
callq 0x1deb
movq %r15, %rbx
testl %eax, %eax
jns 0x4eef
jmp 0x53a7
movslq 0x10(%rsp), %rax
leaq 0x80(,%rax,8), %rsi
movq %r14, %rdi
callq 0x1190
testq %rax, %rax
je 0x518e
xorl %ecx, %ecx
movq %rax, %r14
jmp 0x51c4
leaq 0x52c7(%rip), %rdi      # 0xa45c
leaq 0x55cb(%rip), %rsi      # 0xa767
movl $0xaf2, %edx            # imm = 0xAF2
xorl %eax, %eax
callq 0x10d0
leaq 0x57b1(%rip), %rdi      # 0xa960
callq 0x1070
movq %r14, %rdi
callq 0x1030
movl $0x6, %ecx
xorl %r14d, %r14d
testl %ecx, %ecx
jne 0x539c
movq 0x10(%rsp), %rax
addl $0x10, %eax
movq %rax, 0x10(%rsp)
jmp 0x5123
movq 0x30(%r12), %rsi
testq %rsi, %rsi
je 0x5298
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rbp
movaps %xmm0, 0x10(%rbp)
movaps %xmm0, (%rbp)
addq 0x10(%r12), %rsi
movl $0x1f, %edx
movq %rbp, %rdi
callq 0x1050
leaq 0x5247(%rip), %rdi      # 0xa45c
leaq 0x554b(%rip), %rsi      # 0xa767
movl $0xb6b, %edx            # imm = 0xB6B
xorl %eax, %eax
callq 0x10d0
leaq 0x54ad(%rip), %rdi      # 0xa6dc
leaq 0x5553(%rip), %rsi      # 0xa789
jmp 0x528c
movq 0x30(%r12), %rsi
testq %rsi, %rsi
je 0x52bb
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rbp
movaps %xmm0, 0x10(%rbp)
movaps %xmm0, (%rbp)
addq 0x10(%r12), %rsi
movl $0x1f, %edx
movq %rbp, %rdi
callq 0x1050
leaq 0x51f1(%rip), %rdi      # 0xa45c
leaq 0x54f5(%rip), %rsi      # 0xa767
movl $0xb53, %edx            # imm = 0xB53
xorl %eax, %eax
callq 0x10d0
leaq 0x5457(%rip), %rdi      # 0xa6dc
leaq 0x54ed(%rip), %rsi      # 0xa779
movq %rbp, %rdx
xorl %eax, %eax
callq 0x10d0
jmp 0x52e1
leaq 0x51bd(%rip), %rdi      # 0xa45c
leaq 0x54c1(%rip), %rsi      # 0xa767
movl $0xb6b, %edx            # imm = 0xB6B
xorl %eax, %eax
callq 0x10d0
leaq 0x54d0(%rip), %rdi      # 0xa789
jmp 0x52dc
leaq 0x519a(%rip), %rdi      # 0xa45c
leaq 0x549e(%rip), %rsi      # 0xa767
movl $0xb53, %edx            # imm = 0xB53
xorl %eax, %eax
callq 0x10d0
leaq 0x549d(%rip), %rdi      # 0xa779
callq 0x1070
testq %r14, %r14
je 0x52fb
movq (%r14), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq %r14, %rdi
callq 0x1030
jmp 0x530b
movq 0x8(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x530b
movq %rbx, (%rax)
xorl %ebx, %ebx
movq 0x18(%rsp), %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0xaf1c(%rip), %rcx      # 0x10238
cmpq %rcx, (%rax)
jne 0x5363
testq %rbx, %rbx
je 0x532e
movq %rbx, %rdi
callq 0x1030
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x5363
callq 0x1030
jmp 0x5363
testq %r14, %r14
je 0x5359
movq (%r14), %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq %r14, %rdi
callq 0x1030
jmp 0x5361
movq 0x8(%rsp), %rax
movq %rbx, (%rax)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x50e1(%rip), %rdi      # 0xa45c
leaq 0x53e5(%rip), %rsi      # 0xa767
xorl %ebx, %ebx
movl $0xb05, %edx            # imm = 0xB05
xorl %eax, %eax
callq 0x10d0
leaq 0x55c9(%rip), %rdi      # 0xa960
jmp 0x52dc
cmpl $0x6, %ecx
je 0x52e1
jmp 0x5363
movq 0x38(%rsp), %rbx
jmp 0x52e1