// File: /workspace/github_c_makefile_star2_O0/antirez[P]stonky/stonky.c
// Function: cJSON_Select
cJSON *cJSON_Select(cJSON *o, const char *fmt, ...) {
    int next = JSEL_INVALID;        /* Type of the next selector. */
    char token[JSEL_MAX_TOKEN+1];   /* Current token. */
    int tlen;                       /* Current length of the token. */
    va_list ap;

    va_start(ap,fmt);
    const char *p = fmt;
    tlen = 0;
    while(1) {
        /* Our four special chars (plus the end of the string) signal the
         * end of the previous token and the start of the next one. */
        if (tlen && (*p == '\0' || strchr(".[]:",*p))) {
            token[tlen] = '\0';
            if (next == JSEL_INVALID) {
                goto notfound;
            } else if (next == JSEL_ARRAY) {
                if (!cJSON_IsArray(o)) goto notfound;
                int idx = atoi(token); /* cJSON API index is int. */
                if ((o = cJSON_GetArrayItem(o,idx)) == NULL)
                    goto notfound;
            } else if (next == JSEL_OBJ) {
                if (!cJSON_IsObject(o)) goto notfound;
                if ((o = cJSON_GetObjectItemCaseSensitive(o,token)) == NULL)
                    goto notfound;
            } else if (next == JSEL_TYPECHECK) {
                if (token[0] == 's' && !cJSON_IsString(o)) goto notfound;
                if (token[0] == 'n' && !cJSON_IsNumber(o)) goto notfound;
                if (token[0] == 'o' && !cJSON_IsObject(o)) goto notfound;
                if (token[0] == 'a' && !cJSON_IsArray(o)) goto notfound;
                if (token[0] == 'b' && !cJSON_IsBool(o)) goto notfound;
                if (token[0] == '!' && !cJSON_IsNull(o)) goto notfound;
            }
        } else if (next != JSEL_INVALID) {
            /* Otherwise accumulate characters in the current token, note that
             * the above check for JSEL_NEXT_INVALID prevents us from
             * accumulating at the start of the fmt string if no token was
             * yet selected. */
            if (*p != '*') {
                token[tlen] = *p++;
                tlen++;
                if (tlen > JSEL_MAX_TOKEN) goto notfound;
                continue;
            } else {
                /* The "*" character is special: if we are in the context
                 * of an array, we read an integer from the variable argument
                 * list, then concatenate it to the current string.
                 *
                 * If the context is an object, we read a string pointer
                 * from the variable argument string and concatenate the
                 * string to the current token. */
                int len;
                char buf[64];
                char *s;
                if (next == JSEL_ARRAY) {
                    int idx = va_arg(ap,int);
                    len = snprintf(buf,sizeof(buf),"%d",idx);
                    s = buf;
                } else if (next == JSEL_OBJ) {
                    s = va_arg(ap,char*);
                    len = strlen(s);
                } else {
                    goto notfound;
                }
                /* Common path. */
                if (tlen+len > JSEL_MAX_TOKEN) goto notfound;
                memcpy(token+tlen,buf,len);
                tlen += len;
                p++;
                continue;
            }
        }
        /* Select the next token type according to its type specifier. */
        if (*p == ']') p++; /* Skip closing "]", it's just useless syntax. */
        if (*p == '\0') break;
        else if (*p == '.') next = JSEL_OBJ;
        else if (*p == '[') next = JSEL_ARRAY;
        else if (*p == ':') next = JSEL_TYPECHECK;
        else goto notfound;
        tlen = 0; /* A new token starts. */
        p++; /* Token starts at next character. */
    }

cleanup:
    va_end(ap);
    return o;

notfound:
    o = NULL;
    goto cleanup;
}

// Assembly:
subq $0x278, %rsp            # imm = 0x278
testb %al, %al
je 0xb9b5
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
movq %r9, 0x58(%rsp)
movq %r8, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rdi, 0x270(%rsp)
movq %rsi, 0x268(%rsp)
movl $0x0, 0x264(%rsp)
leaq 0x140(%rsp), %rax
leaq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x280(%rsp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq 0x268(%rsp), %rax
movq %rax, 0x138(%rsp)
movl $0x0, 0x15c(%rsp)
cmpl $0x0, 0x15c(%rsp)
je 0xbc29
movq 0x138(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xba68
movq 0x138(%rsp), %rax
movsbl (%rax), %esi
leaq 0x9c70(%rip), %rdi      # 0x156c9
callq 0x20d0
cmpq $0x0, %rax
je 0xbc29
movslq 0x15c(%rsp), %rax
movb $0x0, 0x160(%rsp,%rax)
cmpl $0x0, 0x264(%rsp)
jne 0xba87
jmp 0xbf09
cmpl $0x2, 0x264(%rsp)
jne 0xbae8
movq 0x270(%rsp), %rdi
callq 0x5e10
cmpl $0x0, %eax
jne 0xbaa8
jmp 0xbf09
leaq 0x160(%rsp), %rdi
callq 0x2380
movl %eax, 0x134(%rsp)
movq 0x270(%rsp), %rdi
movl 0x134(%rsp), %esi
callq 0x3d70
movq %rax, 0x270(%rsp)
cmpq $0x0, %rax
jne 0xbae3
jmp 0xbf09
jmp 0xbc22
cmpl $0x1, 0x264(%rsp)
jne 0xbb36
movq 0x270(%rsp), %rdi
callq 0x5e50
cmpl $0x0, %eax
jne 0xbb09
jmp 0xbf09
movq 0x270(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x3fa0
movq %rax, 0x270(%rsp)
cmpq $0x0, %rax
jne 0xbb31
jmp 0xbf09
jmp 0xbc20
cmpl $0x3, 0x264(%rsp)
jne 0xbc1e
movsbl 0x160(%rsp), %eax
cmpl $0x73, %eax
jne 0xbb68
movq 0x270(%rsp), %rdi
callq 0x2a80
cmpl $0x0, %eax
jne 0xbb68
jmp 0xbf09
movsbl 0x160(%rsp), %eax
cmpl $0x6e, %eax
jne 0xbb8c
movq 0x270(%rsp), %rdi
callq 0x2b10
cmpl $0x0, %eax
jne 0xbb8c
jmp 0xbf09
movsbl 0x160(%rsp), %eax
cmpl $0x6f, %eax
jne 0xbbb0
movq 0x270(%rsp), %rdi
callq 0x5e50
cmpl $0x0, %eax
jne 0xbbb0
jmp 0xbf09
movsbl 0x160(%rsp), %eax
cmpl $0x61, %eax
jne 0xbbd4
movq 0x270(%rsp), %rdi
callq 0x5e10
cmpl $0x0, %eax
jne 0xbbd4
jmp 0xbf09
movsbl 0x160(%rsp), %eax
cmpl $0x62, %eax
jne 0xbbf8
movq 0x270(%rsp), %rdi
callq 0x5d90
cmpl $0x0, %eax
jne 0xbbf8
jmp 0xbf09
movsbl 0x160(%rsp), %eax
cmpl $0x21, %eax
jne 0xbc1c
movq 0x270(%rsp), %rdi
callq 0x5dd0
cmpl $0x0, %eax
jne 0xbc1c
jmp 0xbf09
jmp 0xbc1e
jmp 0xbc20
jmp 0xbc22
jmp 0xbc24
jmp 0xbe3b
cmpl $0x0, 0x264(%rsp)
je 0xbe39
movq 0x138(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
je 0xbc97
movq 0x138(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x138(%rsp)
movb (%rax), %cl
movslq 0x15c(%rsp), %rax
movb %cl, 0x160(%rsp,%rax)
movl 0x15c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x15c(%rsp)
cmpl $0x100, 0x15c(%rsp) # imm = 0x100
jle 0xbc92
jmp 0xbf09
jmp 0xba29
cmpl $0x2, 0x264(%rsp)
jne 0xbd43
leaq 0x140(%rsp), %rax
movq %rax, 0x20(%rsp)
movl 0x140(%rsp), %eax
movl %eax, 0x2c(%rsp)
cmpl $0x28, %eax
ja 0xbcde
movq 0x20(%rsp), %rcx
movl 0x2c(%rsp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, 0x18(%rsp)
jmp 0xbcf7
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xe4(%rsp)
leaq 0xf0(%rsp), %rdi
movl 0xe4(%rsp), %ecx
movl $0x40, %esi
leaq 0xb0bf(%rip), %rdx      # 0x16ddf
movb $0x0, %al
callq 0x23a0
movl %eax, 0x130(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0xe8(%rsp)
jmp 0xbdc9
cmpl $0x1, 0x264(%rsp)
jne 0xbdc2
leaq 0x140(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x140(%rsp), %eax
movl %eax, 0x14(%rsp)
cmpl $0x28, %eax
ja 0xbd85
movq 0x8(%rsp), %rcx
movl 0x14(%rsp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, (%rsp)
jmp 0xbd9d
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, (%rsp)
movq (%rsp), %rax
movq (%rax), %rax
movq %rax, 0xe8(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x20e0
movl %eax, 0x130(%rsp)
jmp 0xbdc7
jmp 0xbf09
jmp 0xbdc9
movl 0x15c(%rsp), %eax
addl 0x130(%rsp), %eax
cmpl $0x100, %eax            # imm = 0x100
jle 0xbde3
jmp 0xbf09
leaq 0x160(%rsp), %rdi
movslq 0x15c(%rsp), %rax
addq %rax, %rdi
leaq 0xf0(%rsp), %rsi
movslq 0x130(%rsp), %rdx
callq 0x21b0
movl 0x130(%rsp), %eax
addl 0x15c(%rsp), %eax
movl %eax, 0x15c(%rsp)
movq 0x138(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x138(%rsp)
jmp 0xba29
jmp 0xbe3b
movq 0x138(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x5d, %eax
jne 0xbe5f
movq 0x138(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x138(%rsp)
movq 0x138(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xbe74
jmp 0xbef7
movq 0x138(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0xbe91
movl $0x1, 0x264(%rsp)
jmp 0xbed1
movq 0x138(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
jne 0xbeae
movl $0x2, 0x264(%rsp)
jmp 0xbecf
movq 0x138(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
jne 0xbecb
movl $0x3, 0x264(%rsp)
jmp 0xbecd
jmp 0xbf09
jmp 0xbecf
jmp 0xbed1
jmp 0xbed3
movl $0x0, 0x15c(%rsp)
movq 0x138(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x138(%rsp)
jmp 0xba29
jmp 0xbef9
movq 0x270(%rsp), %rax
addq $0x278, %rsp            # imm = 0x278
retq
movq $0x0, 0x270(%rsp)
jmp 0xbef9
nopw (%rax,%rax)