// File: /workspace/github_c_makefile_star2_O2/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, %r15
movq %rcx, %r14
movq %rdx, 0x68(%rsp)
movq %rsi, %rax
movl %edi, 0x3c(%rsp)
cmpl $0x1, %edi
jne 0x3217
pushq $0x22
popq %rsi
movq %rax, %rdi
callq 0x23c0
testq %rax, %rax
je 0x3299
movq %rax, %r12
incq %r12
pushq $0x22
popq %rsi
movq %r12, %rdi
callq 0x23c0
testq %rax, %rax
je 0x3299
movl %eax, %ecx
movq %r12, 0x58(%rsp)
subl %r12d, %ecx
movq %rcx, 0x50(%rsp)
pushq $0x3a
popq %rsi
movq %rax, %rdi
callq 0x23c0
jmp 0x3229
movq $0x0, 0x50(%rsp)
movq $0x0, 0x58(%rsp)
movq %rax, %rdi
movq %r14, 0x60(%rsp)
pushq $-0x1
popq %rsi
pushq $0x1
popq %rax
movq %rax, 0x48(%rsp)
movabsq $0x400100004001, %rax   # imm = 0x400100004001
movq %rbx, 0x78(%rsp)
movq %r15, 0x70(%rsp)
xorl %r9d, %r9d
testq %rdi, %rdi
je 0x32c2
movzbl (%rdi), %ecx
testl %ecx, %ecx
je 0x32e9
cmpl $0x7b, %ecx
je 0x32de
cmpl $0x5b, %ecx
je 0x3308
cmpl $0x22, %ecx
je 0x3323
leal -0x30(%rcx), %edx
cmpb $0x9, %dl
jbe 0x334f
addl $-0x46, %ecx
cmpl $0x2e, %ecx
ja 0x3294
btq %rcx, %rax
jb 0x32a0
incq %rdi
jmp 0x3250
xorl %eax, %eax
jmp 0x3589
movq %rdi, %rbx
movb $0x1, %dil
movq $0x0, 0x8(%rsp)
movb $0x1, %r8b
movq $0x0, (%rsp)
pushq $0x4
popq %rax
jmp 0x334a
xorl %edi, %edi
xorl %r8d, %r8d
movq $0x0, 0x8(%rsp)
movq $0x0, (%rsp)
xorl %ebp, %ebp
xorl %ebx, %ebx
jmp 0x3304
movq %rdi, %rbp
leaq 0x1(%rdi), %rbx
pushq $0x1
jmp 0x3311
movq %rdi, %rbx
xorl %edi, %edi
xorl %r8d, %r8d
movq $0x0, 0x8(%rsp)
movq $0x0, (%rsp)
xorl %ebp, %ebp
movl %esi, %eax
jmp 0x336e
movq %rdi, %rbp
leaq 0x1(%rdi), %rbx
pushq $0x2
popq %rax
movb $0x1, %dil
xorl %r8d, %r8d
movq $0x0, 0x8(%rsp)
jmp 0x3366
incq %rdi
xorl %r8d, %r8d
pushq $0x1
popq %rax
movq %rax, (%rsp)
movq %rdi, %rbx
movb $0x1, %dil
movq $0x0, 0x8(%rsp)
movq $0x0, 0x48(%rsp)
xorl %eax, %eax
movq %rbx, %rbp
jmp 0x336e
movq %rdi, %rbp
leaq 0x1(%rdi), %rbx
pushq $0x3
popq %rax
movb $0x1, %dil
xorl %r8d, %r8d
movb $0x1, %cl
movq %rcx, 0x8(%rsp)
movq $0x0, (%rsp)
movl %eax, 0x38(%rsp)
movl %eax, %eax
movq %rax, 0x80(%rsp)
xorb $0x1, %dil
pushq $0x5
popq %r14
leaq 0x4ffe(%rip), %rsi      # 0x8389
movl $0x0, 0x14(%rsp)
movq %rbx, 0x40(%rsp)
movq %r8, 0x28(%rsp)
movq %rdi, 0x20(%rsp)
movq %rbp, 0x18(%rsp)
pushq $0x4
popq %r12
xorl %eax, %eax
testq %rbx, %rbx
je 0x353f
movb (%rbx), %cl
testb %cl, %cl
sete %dl
orb %dil, %dl
jne 0x353f
testb %r8b, %r8b
je 0x33ed
movq %r9, 0x30(%rsp)
movq %rbp, %rdi
callq 0x2270
movq %rax, %r13
movb (%rbp), %r15b
cmpb $0x74, %r15b
jne 0x3409
cmpl $0x4, %r13d
jge 0x341b
jmp 0x3460
cmpb $0x0, 0x8(%rsp)
je 0x3480
addb $-0x3a, %cl
cmpb $-0xb, %cl
ja 0x350c
jmp 0x3520
cmpb $0x54, %r15b
sete %al
cmpl $0x4, %r13d
setge %cl
testb %cl, %al
je 0x3454
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
leaq 0x4f69(%rip), %rsi      # 0x8393
movq %r12, %rdx
callq 0x2140
testl %eax, %eax
je 0x351b
movq %rbp, %rdi
leaq 0x4f54(%rip), %rsi      # 0x8398
movq %r12, %rdx
callq 0x2140
testl %eax, %eax
je 0x3527
cmpb $0x66, %r15b
jne 0x34a2
cmpl $0x5, %r13d
jge 0x34b4
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %r8
movq 0x18(%rsp), %rbp
movq 0x30(%rsp), %r9
leaq 0x4f0e(%rip), %rsi      # 0x8389
jmp 0x350c
movq 0x80(%rsp), %rax
cmpb 0x1(%rsi,%rax,2), %cl
jne 0x34fd
movl 0x14(%rsp), %eax
testl %eax, %eax
je 0x3531
decl %eax
movl %eax, 0x14(%rsp)
jmp 0x350c
cmpb $0x46, %r15b
sete %al
cmpl $0x5, %r13d
setge %cl
testb %cl, %al
je 0x3460
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
leaq 0x4eda(%rip), %rsi      # 0x839d
movq %r14, %rdx
callq 0x2140
testl %eax, %eax
je 0x3517
movq %rbp, %rdi
leaq 0x4eca(%rip), %rsi      # 0x83a3
movq %r14, %rdx
callq 0x2140
testl %eax, %eax
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %r8
movq 0x30(%rsp), %r9
leaq 0x4e90(%rip), %rsi      # 0x8389
jne 0x350c
jmp 0x3517
movq %rax, %rdx
xorl %eax, %eax
cmpb (%rsi,%rdx,2), %cl
sete %al
addl %eax, 0x14(%rsp)
incq %rbx
decl %r9d
jmp 0x33ab
pushq $0x5
jmp 0x351d
pushq $0x4
popq %rax
jmp 0x353f
movq 0x40(%rsp), %rax
jmp 0x353a
pushq $0x4
popq %rax
movq 0x18(%rsp), %rbp
jmp 0x353f
movq 0x48(%rsp), %rax
addl 0x40(%rsp), %eax
subl %ebp, %eax
subl %r9d, %eax
cmpl $0x1, 0x3c(%rsp)
jne 0x355f
movq 0x68(%rsp), %rcx
movq 0x58(%rsp), %rdx
movq %rdx, (%rcx)
movq 0x60(%rsp), %rcx
movq 0x50(%rsp), %rdx
movl %edx, (%rcx)
movq 0x70(%rsp), %rcx
movq %rbp, (%rcx)
movq 0x78(%rsp), %rcx
movl %eax, (%rcx)
movq 0xc0(%rsp), %rcx
movl 0x38(%rsp), %edx
movl %edx, (%rcx)
movslq %eax, %rcx
movq (%rsp), %rax
addq %rbp, %rax
addq %rcx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq