// File: /workspace/github_cpp_makefile_star2_O2/yasz24[P]eau2/src/network/./../serialize/jsonHelper.h
// Function: JSONHelper::getPayloadValue(char*)
static String* getPayloadValue(char* s) {
        int len = strlen( s );
        bool valueStarted = false;
        char objStart = '{';
        char objEnd = '}';
        int startCharDepth = 0;
        char buff[len];
        int loc = 0;
        //find first colon as jumping off point:
        int colonIndex = 0;
        for(int i = 0; i < len; i++) {
            char temp=s[i];
            if(temp == ':') {
                colonIndex = i;
                break;
            }
        }
        //pull the top level object-value from the serialzed string
        for (int i = colonIndex; i < len; i++){
            char temp = s[i];
            if(!valueStarted) {
                //the three ways a payload in our JSON can start, will rely on this to know what character closes the value
                //also keeps track of depth if there are nested objects
                if(temp == '{' || temp == '[' || temp == '\'') {
                    objStart = temp;
                    startCharDepth = 1;
                    valueStarted = true;
                    if(temp == '{') {
                        objEnd = '}';
                    } else if(temp == '[') {
                        objEnd = ']';
                    } else if(temp == '\'') {
                        objEnd = '\'';
                    }   
                }
            } else if(temp == objStart && temp != objEnd && valueStarted) {
                startCharDepth++;
                buff[loc] = temp;
                loc++;
            } else if(temp == objEnd && valueStarted) {
                startCharDepth--;
                //if we've reached the final level of end character, break out of loop
                if(startCharDepth <= 0) {
                    break;
                }
                buff[loc] = temp;
                loc++;
            } else if(valueStarted) {
                buff[loc] = temp;
                loc++;
            }
        }
        buff[loc] = '\0';
        char* classValue = buff;
        String* str = new String(classValue);
        return str;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x7110
movl %eax, %ecx
movq %rsp, %r14
addq $0xf, %rcx
andq $-0x10, %rcx
subq %rcx, %r14
movq %r14, %rsp
xorl %ecx, %ecx
testl %eax, %eax
movl %eax, %edx
cmovlel %ecx, %edx
cmpq %rcx, %rdx
je 0xc052
cmpb $0x3a, (%rbx,%rcx)
je 0xc054
incq %rcx
jmp 0xc042
xorl %ecx, %ecx
movl %ecx, %ecx
cltq
movb $0x7b, %dil
movb $0x7d, %sil
xorl %r9d, %r9d
pushq $0x1
popq %rdx
xorl %r8d, %r8d
xorl %r10d, %r10d
movslq %r9d, %r11
cmpq %rax, %rcx
jge 0xc104
movb (%rbx,%rcx), %r15b
testb $0x1, %r10b
je 0xc0a7
cmpb %dil, %r15b
setne %r9b
cmpb %sil, %r15b
sete %r10b
orb %r9b, %r10b
je 0xc0c5
cmpb %sil, %r15b
jne 0xc0dc
cmpl $0x2, %r8d
jl 0xc104
decl %r8d
movb %sil, (%r14,%r11)
jmp 0xc0e0
movzbl %r15b, %r10d
cmpl $0x27, %r10d
je 0xc0eb
cmpl $0x5b, %r10d
je 0xc0ce
cmpl $0x7b, %r10d
jne 0xc0f9
movb $0x1, %r10b
movb $0x7d, %sil
jmp 0xc0d4
incl %r8d
movb %dil, (%r14,%r11)
jmp 0xc0e0
movb $0x1, %r10b
movb $0x5d, %sil
movl %edx, %r8d
movl %r15d, %edi
jmp 0xc0fc
movb %r15b, (%r14,%r11)
incl %r11d
movb $0x1, %r10b
movl %r11d, %r9d
jmp 0xc0fc
movb $0x1, %r10b
movb $0x27, %sil
movl %edx, %r8d
movb $0x27, %dil
jmp 0xc0fc
xorl %r10d, %r10d
incq %rcx
jmp 0xc06a
movb $0x0, (%r14,%r11)
pushq $0x20
popq %rdi
callq 0x7250
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x8e1e
movq %rbx, %rax
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x7220
movq %r14, %rdi
callq 0x7390