// File: 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
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8130
movl %eax, -0xc(%rbp)
movb $0x0, -0xd(%rbp)
movb $0x7b, -0xe(%rbp)
movb $0x7d, -0xf(%rbp)
movl $0x0, -0x14(%rbp)
movl -0xc(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x20(%rbp)
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq %rcx, %rsp
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x12c0a
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x35(%rbp)
movsbl -0x35(%rbp), %eax
cmpl $0x3a, %eax
jne 0x12bfd
movl -0x34(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x12c0a
jmp 0x12bff
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x12bd6
movl -0x30(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x12d41
movq -0x8(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x3d(%rbp)
testb $0x1, -0xd(%rbp)
jne 0x12c92
movsbl -0x3d(%rbp), %eax
cmpl $0x7b, %eax
je 0x12c4b
movsbl -0x3d(%rbp), %eax
cmpl $0x5b, %eax
je 0x12c4b
movsbl -0x3d(%rbp), %eax
cmpl $0x27, %eax
jne 0x12c8d
movb -0x3d(%rbp), %al
movb %al, -0xe(%rbp)
movl $0x1, -0x14(%rbp)
movb $0x1, -0xd(%rbp)
movsbl -0x3d(%rbp), %eax
cmpl $0x7b, %eax
jne 0x12c6b
movb $0x7d, -0xf(%rbp)
jmp 0x12c8b
movsbl -0x3d(%rbp), %eax
cmpl $0x5b, %eax
jne 0x12c7a
movb $0x5d, -0xf(%rbp)
jmp 0x12c89
movsbl -0x3d(%rbp), %eax
cmpl $0x27, %eax
jne 0x12c87
movb $0x27, -0xf(%rbp)
jmp 0x12c89
jmp 0x12c8b
jmp 0x12c8d
jmp 0x12d31
movsbl -0x3d(%rbp), %eax
movsbl -0xe(%rbp), %ecx
cmpl %ecx, %eax
jne 0x12cd2
movsbl -0x3d(%rbp), %eax
movsbl -0xf(%rbp), %ecx
cmpl %ecx, %eax
je 0x12cd2
testb $0x1, -0xd(%rbp)
je 0x12cd2
movq -0x68(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movb -0x3d(%rbp), %dl
movslq -0x2c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x12d2f
movsbl -0x3d(%rbp), %eax
movsbl -0xf(%rbp), %ecx
cmpl %ecx, %eax
jne 0x12d0e
testb $0x1, -0xd(%rbp)
je 0x12d0e
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x12cf5
jmp 0x12d41
movq -0x68(%rbp), %rax
movb -0x3d(%rbp), %dl
movslq -0x2c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x12d2d
testb $0x1, -0xd(%rbp)
je 0x12d2b
movq -0x68(%rbp), %rax
movb -0x3d(%rbp), %dl
movslq -0x2c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x12d2d
jmp 0x12d2f
jmp 0x12d31
jmp 0x12d33
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x12c10
movq -0x68(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq %rax, -0x48(%rbp)
movl $0x20, %edi
callq 0x8290
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x70(%rbp)
movq -0x48(%rbp), %rsi
callq 0xc630
jmp 0x12d70
movq -0x70(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, %rsp
movq %rbp, %rsp
popq %rbp
retq
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
callq 0x8260
movq -0x58(%rbp), %rdi
callq 0x8400
nopw %cs:(%rax,%rax)