// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movq 0x10(%rbp), %rax
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq 0x7a7c(%rip), %rax      # 0xb389
movq %rax, -0x42(%rbp)
movw 0x7a79(%rip), %ax       # 0xb391
movw %ax, -0x3a(%rbp)
movl $0x0, -0x48(%rbp)
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0x39d2
movq -0x70(%rbp), %rdi
movl $0x22, %esi
callq 0x23a0
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x397c
movq $0x0, -0x8(%rbp)
jmp 0x3d53
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
movq %rax, -0x60(%rbp)
movq -0x70(%rbp), %rdi
movl $0x22, %esi
callq 0x23a0
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x39b2
movq $0x0, -0x8(%rbp)
jmp 0x3d53
movq -0x70(%rbp), %rax
movq -0x60(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x50(%rbp)
movq -0x70(%rbp), %rdi
movl $0x3a, %esi
callq 0x23a0
movq %rax, -0x70(%rbp)
jmp 0x39d4
xorl %eax, %eax
cmpq $0x0, -0x70(%rbp)
movb %al, -0x75(%rbp)
je 0x39f0
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x75(%rbp)
movb -0x75(%rbp), %al
testb $0x1, %al
jne 0x39fc
jmp 0x3b08
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x3a24
movl $0x0, -0x4c(%rbp)
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
movq %rax, -0x68(%rbp)
jmp 0x3b08
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7b, %eax
jne 0x3a4f
movl $0x1, -0x4c(%rbp)
movq -0x70(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x70(%rbp)
movq %rax, -0x68(%rbp)
jmp 0x3b08
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
jne 0x3a7a
movl $0x2, -0x4c(%rbp)
movq -0x70(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x70(%rbp)
movq %rax, -0x68(%rbp)
jmp 0x3b08
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x3aae
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0x3aae
movl $0x3, -0x4c(%rbp)
movq -0x70(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x70(%rbp)
movq %rax, -0x68(%rbp)
jmp 0x3b08
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
je 0x3ade
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x54, %eax
je 0x3ade
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
je 0x3ade
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x46, %eax
jne 0x3aef
movl $0x4, -0x4c(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x3b08
jmp 0x3af1
jmp 0x3af3
jmp 0x3af5
jmp 0x3af7
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x39d4
jmp 0x3b0a
xorl %eax, %eax
cmpq $0x0, -0x70(%rbp)
movb %al, -0x76(%rbp)
je 0x3b31
movq -0x70(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x76(%rbp)
je 0x3b31
cmpl $-0x1, -0x4c(%rbp)
setg %al
movb %al, -0x76(%rbp)
movb -0x76(%rbp), %al
testb $0x1, %al
jne 0x3b3d
jmp 0x3cf2
cmpl $0x4, -0x4c(%rbp)
jne 0x3c34
movq -0x68(%rbp), %rdi
callq 0x2260
movl %eax, -0x74(%rbp)
movq -0x68(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
je 0x3b6b
movq -0x68(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x54, %eax
jne 0x3bc0
cmpl $0x4, -0x74(%rbp)
jl 0x3bc0
movq -0x68(%rbp), %rdi
leaq 0x7817(%rip), %rsi      # 0xb393
movl $0x4, %edx
callq 0x2130
cmpl $0x0, %eax
je 0x3ba5
movq -0x68(%rbp), %rdi
leaq 0x7802(%rip), %rsi      # 0xb398
movl $0x4, %edx
callq 0x2130
cmpl $0x0, %eax
jne 0x3bc0
movl $0x4, -0x54(%rbp)
movq -0x68(%rbp), %rax
movslq -0x54(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
jmp 0x3cf2
movq -0x68(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
je 0x3bd8
movq -0x68(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x46, %eax
jne 0x3c2d
cmpl $0x5, -0x74(%rbp)
jl 0x3c2d
movq -0x68(%rbp), %rdi
leaq 0x77b4(%rip), %rsi      # 0xb39d
movl $0x5, %edx
callq 0x2130
cmpl $0x0, %eax
je 0x3c12
movq -0x68(%rbp), %rdi
leaq 0x77a0(%rip), %rsi      # 0xb3a3
movl $0x5, %edx
callq 0x2130
cmpl $0x0, %eax
jne 0x3c2d
movl $0x5, -0x54(%rbp)
movq -0x68(%rbp), %rax
movslq -0x54(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
jmp 0x3cf2
jmp 0x3c2f
jmp 0x3ce1
cmpl $0x3, -0x4c(%rbp)
jne 0x3c67
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x3c52
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jle 0x3c65
movq -0x70(%rbp), %rax
movq -0x68(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x54(%rbp)
jmp 0x3cf2
jmp 0x3cdf
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
movslq -0x4c(%rbp), %rcx
movsbl -0x41(%rbp,%rcx,2), %ecx
cmpl %ecx, %eax
jne 0x3cbe
cmpl $0x0, -0x48(%rbp)
jne 0x3cb3
movq -0x70(%rbp), %rax
movq -0x68(%rbp), %rcx
subq %rcx, %rax
movl -0x4c(%rbp), %esi
movl $0x1, %ecx
xorl %edx, %edx
cmpl $0x0, %esi
cmovel %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movl %eax, -0x54(%rbp)
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x3cf2
movl -0x48(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x3cdd
movq -0x70(%rbp), %rax
movsbl (%rax), %eax
movslq -0x4c(%rbp), %rcx
movsbl -0x42(%rbp,%rcx,2), %ecx
cmpl %ecx, %eax
jne 0x3cdb
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x3cdd
jmp 0x3cdf
jmp 0x3ce1
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x3b0a
cmpl $0x1, -0xc(%rbp)
jne 0x3d0c
movq -0x60(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl -0x50(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x68(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl -0x54(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movl -0x4c(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x0, -0x4c(%rbp)
jne 0x3d44
movq -0x68(%rbp), %rax
movslq -0x54(%rbp), %rcx
addq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x3d53
movq -0x68(%rbp), %rax
movslq -0x54(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq