// File: /workspace/github_c_makefile_star2_O3/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 $0x68, %rsp
movq %r9, 0x60(%rsp)
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %rbp
xorl %ebx, %ebx
cmpl $0x1, %edi
jne 0x339f
movl %edi, %r13d
movq %rbp, %rdi
movl $0x22, %esi
callq 0x23c0
testq %rax, %rax
je 0x3408
movq %rax, %rbp
incq %rbp
movq %rbp, %rdi
movl $0x22, %esi
callq 0x23c0
testq %rax, %rax
je 0x3408
movq %r14, 0x20(%rsp)
movl %eax, %r14d
movq %rbp, 0x58(%rsp)
subl %ebp, %r14d
movq %rax, %rdi
movl $0x3a, %esi
callq 0x23c0
movq %rax, %rbp
movl %r13d, %edi
movl %r14d, %esi
movq 0x20(%rsp), %r14
jmp 0x33aa
xorl %esi, %esi
movq $0x0, 0x58(%rsp)
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
testq %rbp, %rbp
je 0x340f
movl %edi, 0xc(%rsp)
movabsq $0x400100004001, %rax   # imm = 0x400100004001
movzbl (%rbp), %ecx
cmpl $0x5a, %ecx
jg 0x33d7
testl %ecx, %ecx
je 0x3438
cmpl $0x22, %ecx
jne 0x33e9
jmp 0x3443
cmpl $0x5b, %ecx
je 0x3462
cmpl $0x7b, %ecx
je 0x3473
leal -0x30(%rcx), %edx
cmpb $0x9, %dl
jbe 0x3494
addl $-0x46, %ecx
cmpl $0x2e, %ecx
ja 0x3403
btq %rcx, %rax
jb 0x3418
incq %rbp
jmp 0x33c3
xorl %eax, %eax
jmp 0x36a6
xorl %ebp, %ebp
xorl %edx, %edx
jmp 0x3674
movq %r15, 0x18(%rsp)
movl $0x4, %r8d
movl $0x1, %eax
movb $0x1, %dil
movq $0x0, 0x40(%rsp)
xorl %edx, %edx
jmp 0x345d
xorl %ebp, %ebp
xorl %edx, %edx
xorl %ebx, %ebx
jmp 0x363c
movq %r15, 0x18(%rsp)
incq %rbp
xorl %edi, %edi
movb $0x1, %dl
movq $0x0, 0x40(%rsp)
xorl %eax, %eax
xorl %r8d, %r8d
movq %rbp, %r15
jmp 0x34b3
movq %r15, 0x18(%rsp)
leaq 0x1(%rbp), %r15
movl $0x2, %r8d
jmp 0x3482
movq %r15, 0x18(%rsp)
leaq 0x1(%rbp), %r15
movl $0x1, %r8d
movl $0x1, %eax
xorl %edi, %edi
movq $0x0, 0x40(%rsp)
jmp 0x34b1
movq %r15, 0x18(%rsp)
leaq 0x1(%rbp), %r15
movl $0x3, %r8d
movl $0x1, %eax
movb $0x1, %cl
movq %rcx, 0x40(%rsp)
xorl %edi, %edi
xorl %edx, %edx
movb (%r15), %cl
testb %cl, %cl
je 0x3637
movq %rdx, 0x28(%rsp)
movl %esi, 0x14(%rsp)
movq %r12, 0x30(%rsp)
movq %r14, 0x20(%rsp)
movl %r8d, 0x10(%rsp)
movl %r8d, %edx
addl %r15d, %eax
subl %ebp, %eax
movl %r15d, %r13d
subl %ebp, %r13d
incq %r15
movl $0x0, 0x3c(%rsp)
leaq 0x5e93(%rip), %rsi      # 0x9389
movl %eax, %ebx
movq %rdi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
testb %dil, %dil
je 0x3524
movq %rbp, %rdi
callq 0x2270
movq %rax, %r12
movb (%rbp), %r14b
cmpb $0x74, %r14b
jne 0x353c
cmpl $0x4, %r12d
jge 0x354e
jmp 0x3592
cmpb $0x0, 0x40(%rsp)
je 0x35a5
addb $-0x3a, %cl
cmpb $-0xa, %cl
jae 0x3620
jmp 0x3650
cmpb $0x54, %r14b
sete %al
cmpl $0x4, %r12d
setge %cl
testb %cl, %al
je 0x3586
movl $0x4, %edx
movq %rbp, %rdi
leaq 0x5e36(%rip), %rsi      # 0x9393
callq 0x2140
testl %eax, %eax
je 0x3642
movl $0x4, %edx
movq %rbp, %rdi
leaq 0x5e1f(%rip), %rsi      # 0x9398
callq 0x2140
testl %eax, %eax
je 0x3642
cmpb $0x66, %r14b
jne 0x35bf
cmpl $0x5, %r12d
jge 0x35d1
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rdx
leaq 0x5de6(%rip), %rsi      # 0x9389
jmp 0x3620
cmpb 0x1(%rsi,%rdx,2), %cl
jne 0x3614
movl 0x3c(%rsp), %eax
testl %eax, %eax
je 0x3653
decl %eax
movl %eax, 0x3c(%rsp)
jmp 0x3620
cmpb $0x46, %r14b
sete %al
cmpl $0x5, %r12d
setge %cl
testb %cl, %al
je 0x3592
movl $0x5, %edx
movq %rbp, %rdi
leaq 0x5dbd(%rip), %rsi      # 0x939d
callq 0x2140
testl %eax, %eax
je 0x3649
movl $0x5, %edx
movq %rbp, %rdi
leaq 0x5dab(%rip), %rsi      # 0x93a3
callq 0x2140
testl %eax, %eax
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rdx
leaq 0x5d79(%rip), %rsi      # 0x9389
jne 0x3620
jmp 0x3649
xorl %eax, %eax
cmpb (%rsi,%rdx,2), %cl
sete %al
addl %eax, 0x3c(%rsp)
movb (%r15), %cl
incl %ebx
incl %r13d
incq %r15
testb %cl, %cl
jne 0x3502
xorl %ebx, %ebx
jmp 0x3653
movq 0x18(%rsp), %r15
movl 0xc(%rsp), %edi
jmp 0x3674
movl $0x4, %ebx
jmp 0x3653
movl $0x5, %ebx
jmp 0x3653
movl %r13d, %ebx
movq 0x20(%rsp), %r14
movq 0x30(%rsp), %r12
movq 0x18(%rsp), %r15
movl 0xc(%rsp), %edi
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %r8d
movq 0x28(%rsp), %rdx
movq 0xa0(%rsp), %rax
cmpl $0x1, %edi
jne 0x368d
movq 0x58(%rsp), %rcx
movq %rcx, (%r15)
movl %esi, (%r12)
movq %rbp, (%r14)
movq 0x60(%rsp), %rcx
movl %ebx, (%rcx)
movl %r8d, (%rax)
movslq %ebx, %rcx
addq %rbp, %rcx
movzbl %dl, %eax
addq %rcx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq