// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/utility/json/json_parser.c
// Function: json_get_next_object
char* json_get_next_object(int type, char* str, char** key, int* key_len,
        char** val, int* val_len, int* val_type) {
    char JsonMark[JTYPEMAX][2] = { { '\"', '\"' }, { '{', '}' }, { '[', ']' }, {
            '0', ' ' } };
    int iMarkDepth = 0, iValueType = JNONE, iNameLen = 0, iValueLen = 0;
    char *p_cName = 0, *p_cValue = 0, *p_cPos = str;

    if (type == JOBJECT) {
        /****Catch Name****/
        p_cPos = strchr(p_cPos, '"');
        if (!p_cPos)
            return 0;
        p_cName = ++p_cPos;
        p_cPos = strchr(p_cPos, '"');
        if (!p_cPos)
            return 0;
        iNameLen = p_cPos - p_cName;

        /****Catch Value****/
        p_cPos = strchr(p_cPos, ':');
    }
    while (p_cPos && *p_cPos) {
        if (*p_cPos == '"') {
            iValueType = JSTRING;
            p_cValue = ++p_cPos;
            break;
        } else if (*p_cPos == '{') {
            iValueType = JOBJECT;
            p_cValue = p_cPos++;
            break;
        } else if (*p_cPos == '[') {
            iValueType = JARRAY;
            p_cValue = p_cPos++;
            break;
        } else if (*p_cPos >= '0' && *p_cPos <= '9') {
            iValueType = JNUMBER;
            p_cValue = p_cPos++;
            break;
        } else if (*p_cPos == 't' || *p_cPos == 'T' || *p_cPos == 'f' || *p_cPos == 'F') {
            iValueType = JBOOLEAN;
            p_cValue = p_cPos;
            break;
        }
        p_cPos++;
    }
    while (p_cPos && *p_cPos && iValueType > JNONE) {
        if (iValueType == JBOOLEAN) {
            int len = strlen(p_cValue);
            if ((*p_cValue == 't' || *p_cValue == 'T') && len >= 4
                    && (!strncmp(p_cValue, "true", 4)
                            || !strncmp(p_cValue, "TRUE", 4))) {
                iValueLen = 4;
                p_cPos = p_cValue + iValueLen;
                break;
            } else if ((*p_cValue == 'f' || *p_cValue == 'F') && len >= 5
                    && (!strncmp(p_cValue, "false", 5)
                            || !strncmp(p_cValue, "FALSE", 5))) {
                iValueLen = 5;
                p_cPos = p_cValue + iValueLen;
                break;
            }
        } else if (iValueType == JNUMBER) {
            if (*p_cPos < '0' || *p_cPos > '9') {
                iValueLen = p_cPos - p_cValue;
                break;
            }
        } else if (*p_cPos == JsonMark[iValueType][1]) {
            if (iMarkDepth == 0) {
                iValueLen = p_cPos - p_cValue + (iValueType == JSTRING ? 0 : 1);
                p_cPos++;
                break;
            } else {
                iMarkDepth--;
            }
        } else if (*p_cPos == JsonMark[iValueType][0]) {
            iMarkDepth++;
        }
        p_cPos++;
    }

    if (type == JOBJECT) {
        *key = p_cName;
        *key_len = iNameLen;
    }

    *val = p_cValue;
    *val_len = iValueLen;
    *val_type = iValueType;
    if (iValueType == JSTRING)
        return p_cValue + iValueLen + 1;
    else
        return p_cValue + iValueLen;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %r15
movl %edi, %ebp
cmpl $0x1, %edi
jne 0x3385
movq %r15, %rdi
movl $0x22, %esi
callq 0x23c0
testq %rax, %rax
je 0x3428
movq %rax, %r15
incq %r15
movq %r15, %rdi
movl $0x22, %esi
callq 0x23c0
testq %rax, %rax
je 0x3428
movl %eax, %ecx
movq %r15, 0x50(%rsp)
subl %r15d, %ecx
movq %rcx, 0x48(%rsp)
movq %rax, %rdi
movl $0x3a, %esi
callq 0x23c0
movq %rax, %r15
jmp 0x3397
movq $0x0, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
movl $0x1, %eax
movq %rax, 0x38(%rsp)
movq $0x0, 0x18(%rsp)
testq %r15, %r15
movq %rbx, 0x80(%rsp)
movq %r14, 0x78(%rsp)
movq %r12, 0x68(%rsp)
movq %r13, 0x60(%rsp)
movl %ebp, 0x34(%rsp)
je 0x342f
movabsq $0x400100004001, %rax   # imm = 0x400100004001
movzbl (%r15), %ecx
cmpl $0x5a, %ecx
jg 0x33f7
testl %ecx, %ecx
je 0x3473
cmpl $0x22, %ecx
jne 0x3409
jmp 0x3492
cmpl $0x5b, %ecx
je 0x34c4
cmpl $0x7b, %ecx
je 0x34d4
leal -0x30(%rcx), %edx
cmpb $0x9, %dl
jbe 0x34f3
addl $-0x46, %ecx
cmpl $0x2e, %ecx
ja 0x3423
btq %rcx, %rax
jb 0x3451
incq %r15
jmp 0x33dc
xorl %eax, %eax
jmp 0x375c
xorl %r13d, %r13d
xorl %r12d, %r12d
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
xorl %ebp, %ebp
xorl %r15d, %r15d
jmp 0x3517
movl $0x4, 0x4(%rsp)
movb $0x1, %r13b
movq $0x0, 0x10(%rsp)
movb $0x1, %r12b
movq $0x0, 0x8(%rsp)
jmp 0x34bf
xorl %r13d, %r13d
xorl %r12d, %r12d
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
xorl %ebp, %ebp
jmp 0x3517
incq %r15
xorl %r12d, %r12d
movl $0x1, %eax
movq %rax, 0x8(%rsp)
movb $0x1, %r13b
movq $0x0, 0x10(%rsp)
movq $0x0, 0x38(%rsp)
movl $0x0, 0x4(%rsp)
movq %r15, %rbp
jmp 0x3517
movq %r15, %rbp
incq %r15
movl $0x2, 0x4(%rsp)
jmp 0x34e2
movq %r15, %rbp
incq %r15
movl $0x1, 0x4(%rsp)
movb $0x1, %r13b
xorl %r12d, %r12d
movq $0x0, 0x10(%rsp)
jmp 0x350e
movq %r15, %rbp
incq %r15
movl $0x3, 0x4(%rsp)
movb $0x1, %r13b
xorl %r12d, %r12d
movb $0x1, %al
movq %rax, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
testq %r15, %r15
je 0x3709
movb (%r15), %al
testb %al, %al
sete %cl
movl %r13d, %edx
xorb $0x1, %dl
orb %cl, %dl
jne 0x3709
movl 0x4(%rsp), %ecx
movq %rcx, 0x70(%rsp)
leaq 0x5(%rbp), %rcx
movq %rcx, 0x58(%rsp)
leaq 0x4(%rbp), %rcx
movq %rcx, 0x40(%rsp)
movl $0x0, 0x24(%rsp)
leaq 0x5e29(%rip), %r14      # 0x9389
movq $0x0, 0x18(%rsp)
movq %r13, 0x28(%rsp)
testb %r12b, %r12b
je 0x3596
movq %r12, %r13
movq %rbp, %rbx
movq %rbp, %rdi
callq 0x2270
movq %rax, %r14
movb (%rbp), %r12b
cmpb $0x74, %r12b
jne 0x35ac
cmpl $0x4, %r14d
jge 0x35be
jmp 0x35f6
cmpb $0x0, 0x10(%rsp)
je 0x3613
addb $-0x3a, %al
cmpb $-0xb, %al
ja 0x36de
jmp 0x36f5
cmpb $0x54, %r12b
sete %al
cmpl $0x4, %r14d
setge %cl
testb %cl, %al
je 0x35f6
movl $0x4, %edx
movq %rbp, %rdi
leaq 0x5dc6(%rip), %rsi      # 0x9393
callq 0x2140
testl %eax, %eax
je 0x36a8
movl $0x4, %edx
movq %rbp, %rdi
leaq 0x5daf(%rip), %rsi      # 0x9398
callq 0x2140
testl %eax, %eax
je 0x36a8
cmpb $0x66, %r12b
jne 0x363a
movb $0x1, %cl
cmpl $0x5, %r14d
movq %r13, %r12
jge 0x3651
leaq 0x5d7b(%rip), %r14      # 0x9389
jmp 0x36c3
movq 0x70(%rsp), %rcx
cmpb 0x1(%r14,%rcx,2), %al
jne 0x36ce
movl 0x24(%rsp), %eax
testl %eax, %eax
je 0x36fa
decl %eax
movl %eax, 0x24(%rsp)
jmp 0x36de
cmpb $0x46, %r12b
sete %al
cmpl $0x5, %r14d
setge %dl
movb $0x1, %cl
testb %dl, %al
movq %r13, %r12
je 0x3607
movl $0x5, %edx
movq %rbx, %rdi
leaq 0x5d3d(%rip), %rsi      # 0x939d
callq 0x2140
movq %rbx, %rbp
testl %eax, %eax
leaq 0x5d18(%rip), %r14      # 0x9389
movq 0x28(%rsp), %r13
je 0x3695
movl $0x5, %edx
movq %rbx, %rdi
leaq 0x5d1c(%rip), %rsi      # 0x93a3
callq 0x2140
movq %rbx, %rbp
movb $0x1, %cl
testl %eax, %eax
jne 0x36c8
movl $0x5, %eax
movq %rax, 0x18(%rsp)
xorl %ecx, %ecx
movq 0x58(%rsp), %r15
jmp 0x36c8
xorl %ecx, %ecx
movl $0x4, %eax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %r15
leaq 0x5cc9(%rip), %r14      # 0x9389
movq %r13, %r12
movq 0x28(%rsp), %r13
testb %cl, %cl
jne 0x36de
jmp 0x3709
movq %rcx, %rdx
xorl %ecx, %ecx
cmpb (%r14,%rdx,2), %al
sete %cl
addl %ecx, 0x24(%rsp)
movb 0x1(%r15), %al
incq %r15
testb %al, %al
setne %cl
testb %cl, %r13b
jne 0x356e
jmp 0x3709
subl %ebp, %r15d
jmp 0x3704
movq 0x38(%rsp), %rax
subl %ebp, %eax
addl %eax, %r15d
movq %r15, 0x18(%rsp)
movq 0xc0(%rsp), %rax
cmpl $0x1, 0x34(%rsp)
jne 0x3731
movq 0x60(%rsp), %rcx
movq 0x50(%rsp), %rdx
movq %rdx, (%rcx)
movq 0x68(%rsp), %rcx
movq 0x48(%rsp), %rdx
movl %edx, (%rcx)
movq 0x78(%rsp), %rcx
movq %rbp, (%rcx)
movq 0x80(%rsp), %rcx
movq 0x18(%rsp), %rdx
movl %edx, (%rcx)
movl 0x4(%rsp), %ecx
movl %ecx, (%rax)
movslq %edx, %rcx
movq 0x8(%rsp), %rax
addq %rbp, %rax
addq %rcx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq