// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x7100
movl %eax, %ecx
movq %rsp, %rbx
addq $0xf, %rcx
andq $-0x10, %rcx
subq %rcx, %rbx
movq %rbx, %rsp
testl %eax, %eax
jle 0xc872
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %edx, %edx
cmpb $0x3a, (%r14,%rdx)
je 0xc874
incq %rdx
cmpq %rdx, %rcx
jne 0xc863
xorl %edx, %edx
xorl %ecx, %ecx
cmpl %eax, %edx
jge 0xc928
movl %edx, %edx
movl %eax, %eax
movb $0x7d, %dil
movb $0x7b, %r8b
xorl %r9d, %r9d
xorl %esi, %esi
movb (%r14,%rdx), %r10b
testb $0x1, %r9b
je 0xc8bf
cmpb %r8b, %r10b
setne %r9b
cmpb %dil, %r10b
sete %r11b
orb %r9b, %r11b
je 0xc8dd
cmpb %dil, %r10b
jne 0xc8f8
cmpl $0x2, %ecx
jl 0xc925
decl %ecx
movslq %esi, %r9
movb %dil, (%rbx,%r9)
jmp 0xc8ff
movzbl %r10b, %r9d
cmpl $0x27, %r9d
je 0xc906
cmpl $0x5b, %r9d
je 0xc8e8
cmpl $0x7b, %r9d
jne 0xc916
movb $0x1, %r9b
movb $0x7d, %dil
jmp 0xc8ee
incl %ecx
movslq %esi, %rsi
movb %r8b, (%rbx,%rsi)
jmp 0xc8ff
movb $0x1, %r9b
movb $0x5d, %dil
movl $0x1, %ecx
movl %r10d, %r8d
jmp 0xc919
movslq %esi, %r9
movb %r10b, (%rbx,%r9)
incl %esi
movb $0x1, %r9b
jmp 0xc919
movb $0x1, %r9b
movb $0x27, %dil
movl $0x1, %ecx
movb $0x27, %r8b
jmp 0xc919
xorl %r9d, %r9d
incq %rdx
cmpq %rdx, %rax
jne 0xc88d
movslq %esi, %rcx
movb $0x0, (%rbx,%rcx)
movl $0x20, %edi
callq 0x7230
movq %rax, %r14
movq %rbx, %rdi
callq 0x7100
movq %rax, %r15
movq $0x0, 0x8(%r14)
leaq 0x1ab3d(%rip), %rax     # 0x27490
movq %rax, (%r14)
movq %r15, 0x10(%r14)
leaq 0x1(%r15), %r12
movq %r12, %rdi
callq 0x7030
movq %rax, %r13
movq %rax, 0x18(%r14)
movq %rax, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x71a0
movb $0x0, (%r13,%r15)
movq %r14, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x7200
movq %rbx, %rdi
callq 0x73b0