// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
leaq 0x1(%rax), %r14
movq %r14, (%rdi)
decl 0x8(%rdi)
movq %r14, 0x10(%rdi)
movl $0x3, 0x24(%rdi)
movl 0xc(%rdi), %ecx
movl %ecx, 0x20(%rdi)
cmpb $0x7b, 0x1(%rax)
jne 0x183b6
addq $0x2, %rax
movq %rax, (%rbx)
movq %rax, 0x10(%rbx)
movl 0x8(%rbx), %eax
movl %eax, %ecx
decl %ecx
movl %ecx, 0x8(%rbx)
sete %cl
je 0x18391
movq (%rbx), %rdx
incq %rdx
movzbl -0x1(%rdx), %esi
cmpl $0xa, %esi
je 0x18373
cmpl $0x7d, %esi
jne 0x18376
jmp 0x18391
incl 0xc(%rbx)
movq %rdx, (%rbx)
leal -0x2(%rax), %ecx
movl %ecx, 0x8(%rbx)
incq %rdx
decl %eax
cmpl $0x1, %eax
sete %cl
jne 0x18363
movl $0x1, %eax
movq (%rbx), %rdx
leaq -0x1(%rdx), %rsi
movq %rsi, 0x18(%rbx)
testb $0x1, %cl
jne 0x184bc
incq %rdx
movq %rdx, (%rbx)
addl $-0x2, %eax
movl %eax, 0x8(%rbx)
jmp 0x184bc
movq (%rbx), %r15
movzbl (%r15), %r12d
cmpq $0x3a, %r12
jne 0x183ef
cmpb $0x3a, 0x1(%r15)
jne 0x183ef
cmpb $0x3a, (%r15)
jne 0x183b9
movl 0x8(%rbx), %eax
decl %eax
incq %r15
movq %r15, (%rbx)
movl %eax, 0x8(%rbx)
decl %eax
cmpb $0x3a, (%r15)
leaq 0x1(%r15), %r15
je 0x183d8
decq %r15
jmp 0x183b9
callq 0x64e0
testb %r12b, %r12b
js 0x1840c
cmpb $0x5f, %r12b
je 0x1840c
movq (%rax), %rax
movzwl (%rax,%r12,2), %eax
andl $0x8, %eax
je 0x18417
incq %r15
movq %r15, (%rbx)
decl 0x8(%rbx)
jmp 0x183b9
cmpl $0x28, %r12d
jne 0x184b2
movl $0x4, 0x24(%rbx)
movl 0x8(%rbx), %esi
movl $0x1, %ecx
xorl %eax, %eax
testl %esi, %esi
je 0x18493
movq (%rbx), %r8
leaq 0x1(%r8), %rdi
movq %rdi, (%rbx)
leal -0x1(%rsi), %edx
movl %edx, 0x8(%rbx)
movzbl 0x1(%r8), %r9d
cmpl $0x5c, %r9d
setne %r10b
cmpl $0x2, %esi
setl %r11b
orb %r10b, %r11b
jne 0x18470
addq $0x2, %r8
movq %r8, (%rbx)
addl $-0x2, %esi
movl %esi, 0x8(%rbx)
movl %esi, %edx
jmp 0x18485
cmpl $0x29, %r9d
je 0x18480
cmpl $0x28, %r9d
jne 0x18485
incl %ecx
jmp 0x18485
decl %ecx
movq %rdi, %rax
movl %edx, %esi
testl %ecx, %ecx
jne 0x18432
incq (%rbx)
decl 0x8(%rbx)
jmp 0x184a5
testq %rax, %rax
je 0x184a5
incq %rax
movl (%rbx), %ecx
subl %eax, %ecx
movl %ecx, 0x8(%rbx)
movq %rax, (%rbx)
cmpb $0x28, (%r14)
jne 0x184b2
movl $0x11, 0x24(%rbx)
movq (%rbx), %rax
decq %rax
movq %rax, 0x18(%rbx)
movq (%rbx), %rcx
xorl %eax, %eax
cmpq %rcx, 0x10(%rbx)
jne 0x184d5
decq %rcx
movq %rcx, (%rbx)
incl 0x8(%rbx)
movl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq