// File: /workspace/github_c_makefile_star2_O2/msteveb[P]autosetup/./jimsh0.c
// Function: JimParseVar
static int JimParseVar(struct JimParserCtx *pc)
{

    pc->p++;
    pc->len--;

#ifdef EXPRSUGAR_BRACKET
    if (*pc->p == '[') {

        JimParseCmd(pc);
        pc->tt = JIM_TT_EXPRSUGAR;
        return JIM_OK;
    }
#endif

    pc->tstart = pc->p;
    pc->tt = JIM_TT_VAR;
    pc->tline = pc->linenr;

    if (*pc->p == '{') {
        pc->tstart = ++pc->p;
        pc->len--;

        while (pc->len && *pc->p != '}') {
            if (*pc->p == '\n') {
                pc->linenr++;
            }
            pc->p++;
            pc->len--;
        }
        pc->tend = pc->p - 1;
        if (pc->len) {
            pc->p++;
            pc->len--;
        }
    }
    else {
        while (1) {

            if (pc->p[0] == ':' && pc->p[1] == ':') {
                while (*pc->p == ':') {
                    pc->p++;
                    pc->len--;
                }
                continue;
            }
            if (isalnum(UCHAR(*pc->p)) || *pc->p == '_' || UCHAR(*pc->p) >= 0x80) {
                pc->p++;
                pc->len--;
                continue;
            }
            break;
        }

        if (*pc->p == '(') {
            int count = 1;
            const char *paren = NULL;

            pc->tt = JIM_TT_DICTSUGAR;

            while (count && pc->len) {
                pc->p++;
                pc->len--;
                if (*pc->p == '\\' && pc->len >= 1) {
                    pc->p++;
                    pc->len--;
                }
                else if (*pc->p == '(') {
                    count++;
                }
                else if (*pc->p == ')') {
                    paren = pc->p;
                    count--;
                }
            }
            if (count == 0) {
                pc->p++;
                pc->len--;
            }
            else if (paren) {

                paren++;
                pc->len += (pc->p - paren);
                pc->p = paren;
            }
#ifndef EXPRSUGAR_BRACKET
            if (*pc->tstart == '(') {
                pc->tt = JIM_TT_EXPRSUGAR;
            }
#endif
        }
        pc->tend = pc->p - 1;
    }
    if (pc->tstart == pc->p) {
        pc->p--;
        pc->len++;
        return JIM_ERR;
    }
    return JIM_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rcx
leaq 0x1(%rcx), %r13
movq %r13, (%rdi)
movl 0x8(%rdi), %eax
leal -0x1(%rax), %r15d
movl %r15d, 0x8(%rdi)
movq %r13, 0x10(%rdi)
movl $0x3, 0x24(%rdi)
movl 0xc(%rdi), %edx
movl %edx, 0x20(%rdi)
movb 0x1(%rcx), %r14b
cmpb $0x7b, %r14b
jne 0x15d1b
leaq 0x2(%rcx), %r10
movq %r10, (%rbx)
movq %r10, 0x10(%rbx)
pushq $0x2
popq %rdi
subl %eax, %edi
leal -0x2(%rax), %r8d
xorl %esi, %esi
movl %r8d, 0x8(%rbx)
movl %edi, %r9d
addl %esi, %r9d
je 0x15e0f
movzbl 0x2(%rcx,%rsi), %r9d
cmpl $0xa, %r9d
je 0x15d03
cmpl $0x7d, %r9d
jne 0x15d08
jmp 0x15e2f
incl %edx
movl %edx, 0xc(%rbx)
leaq (%rcx,%rsi), %r9
addq $0x3, %r9
movq %r9, (%rbx)
incq %rsi
decl %r8d
jmp 0x15cdc
movq %r13, %r12
movq %r13, -0x30(%rbp)
cmpb $0x3a, %r14b
jne 0x15d54
cmpb $0x3a, 0x1(%r13)
jne 0x15d54
leaq 0x1(%r13), %rax
movb $0x3a, %r14b
cmpb $0x3a, %r14b
jne 0x15d8b
incq %r13
movq %rax, (%rbx)
decl %r15d
movl %r15d, 0x8(%rbx)
movb (%rax), %r14b
incq %rax
movq %r13, %r12
jmp 0x15d36
callq 0x64e0
testb %r14b, %r14b
js 0x15d74
cmpb $0x5f, %r14b
je 0x15d74
movq (%rax), %rax
movzbl %r14b, %ecx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
je 0x15d93
leaq 0x1(%r13), %r12
movq %r12, (%rbx)
decl %r15d
movl %r15d, 0x8(%rbx)
movb 0x1(%r13), %r14b
movq %r12, %r13
jmp 0x15d22
decq %rax
movq %rax, %r13
jmp 0x15d22
cmpb $0x28, %r14b
jne 0x15e26
movl $0x4, 0x24(%rbx)
xorl %eax, %eax
movq -0x30(%rbp), %r10
pushq $0x1
popq %rdi
movq %r12, %rcx
movl %r15d, %edx
testl %edi, %edi
je 0x15e51
testl %edx, %edx
je 0x15e61
leaq 0x1(%rcx), %r12
movq %r12, (%rbx)
leal -0x1(%rdx), %r15d
movl %r15d, 0x8(%rbx)
movb 0x1(%rcx), %sil
cmpl $0x2, %edx
jl 0x15df0
cmpb $0x5c, %sil
jne 0x15df0
addq $0x2, %rcx
movq %rcx, (%rbx)
addl $-0x2, %edx
movl %edx, 0x8(%rbx)
jmp 0x15db3
movzbl %sil, %esi
cmpl $0x29, %esi
je 0x15e08
movq %r12, %rcx
movl %r15d, %edx
cmpl $0x28, %esi
jne 0x15db3
incl %edi
jmp 0x15dad
decl %edi
movq %r12, %rax
jmp 0x15dad
leaq (%rcx,%rsi), %rax
incq %rax
movq %rax, 0x18(%rbx)
addq %rsi, %rcx
addq $0x2, %rcx
xorl %r15d, %r15d
jmp 0x15e91
movq %r12, %rcx
movq -0x30(%rbp), %r10
jmp 0x15e89
leaq (%rcx,%rsi), %rdx
incq %rdx
movq %rdx, 0x18(%rbx)
addq %rsi, %rcx
addq $0x3, %rcx
movq %rcx, (%rbx)
subl %esi, %eax
addl $-0x3, %eax
movl %eax, 0x8(%rbx)
movl %eax, %r15d
jmp 0x15e91
incq %rcx
movq %rcx, (%rbx)
decl %edx
movl %edx, 0x8(%rbx)
movl %edx, %r15d
jmp 0x15e7c
testq %rax, %rax
je 0x15e79
incq %rax
subl %eax, %ecx
movl %ecx, 0x8(%rbx)
movq %rax, (%rbx)
movl %ecx, %r15d
movq %rax, %rcx
jmp 0x15e7c
xorl %r15d, %r15d
cmpb $0x28, (%r10)
jne 0x15e89
movl $0x11, 0x24(%rbx)
leaq -0x1(%rcx), %rax
movq %rax, 0x18(%rbx)
xorl %eax, %eax
cmpq %rcx, %r10
jne 0x15ea8
decq %rcx
movq %rcx, (%rbx)
incl %r15d
movl %r15d, 0x8(%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq