// File: /workspace/github_c_makefile_star2_O3/afi-lambda[P]a_little_smalltalk/src/parser.c
// Function: parseArray
static int parseArray()
{
    int i, size, base;
    object newLit, obj;

    base = literalTop;
    nextToken();
    while (parseok && (token != closing))
    {
        switch (token)
        {
        case arraybegin:
            parseArray();
            break;

        case intconst:
            genLiteral(newInteger(tokenInteger));
            nextToken();
            break;

        case floatconst:
            genLiteral(newFloat(tokenFloat));
            nextToken();
            break;

        case nameconst:
        case namecolon:
        case symconst:
            genLiteral(newSymbol(tokenString));
            nextToken();
            break;

        case binary:
            if (streq(tokenString, "("))
            {
                parseArray();
                break;
            }
            if (streq(tokenString, "-") && isdigit(peek()))
            {
                nextToken();
                if (token == intconst)
                    genLiteral(newInteger(- tokenInteger));
                else if (token == floatconst)
                {
                    genLiteral(newFloat(-tokenFloat));
                }
                else
                    compilError(selector, "negation not followed", "by number");
                nextToken();
                break;
            }
            genLiteral(newSymbol(tokenString));
            nextToken();
            break;

        case charconst:
            genLiteral(newChar(tokenInteger));
            nextToken();
            break;

        case strconst:
            genLiteral(newStString(tokenString));
            nextToken();
            break;

        default:
            compilError(selector, "illegal text in literal array", tokenString);
            nextToken();
            break;
        }
    }

    if (parseok)
    {
        if (!streq(tokenString, ")"))
            compilError(selector, "array not terminated by right parenthesis",
                             tokenString);
        else
            nextToken();
    }
    size = literalTop - base;
    newLit = newArray(size);
    for (i = size; i >= 1; i--)
    {
        obj = literalArray[literalTop];
        basicAtPut(newLit, i, obj);
        decr(obj);
        literalArray[literalTop] = nilobj;
        literalTop = literalTop - 1;
    }
    return (genLiteral(newLit));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x20c8c(%rip), %ebp     # 0x28d54
callq 0x60e6
cmpl $0x0, 0x20c6c(%rip)     # 0x28d40
setne %cl
leaq 0x20432(%rip), %r12     # 0x28510
movl (%r12), %eax
cmpl $0xa, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x8250
leaq 0x20d66(%rip), %rbx     # 0x28e60
leaq 0x1a49(%rip), %r14      # 0x9b4a
leaq 0x203b8(%rip), %r15     # 0x284c0
leaq 0x17e5(%rip), %r13      # 0x98f4
decl %eax
cmpl $0x8, %eax
ja 0x81b3
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movq %r15, %rdi
callq 0x379b
jmp 0x8184
movq %r15, %rdi
callq 0x3b64
jmp 0x8184
leaq 0x203d5(%rip), %rax     # 0x28514
movl (%rax), %edi
callq 0x3698
jmp 0x8184
movzbl (%r15), %eax
cmpl $0x2d, %eax
je 0x81c3
cmpl $0x28, %eax
jne 0x8124
cmpb $0x0, 0x1(%r15)
jne 0x8124
callq 0x80b7
jmp 0x8191
leaq 0x203ad(%rip), %rax     # 0x28518
movsd (%rax), %xmm0
callq 0x39ee
jmp 0x8184
leaq 0x20397(%rip), %rax     # 0x28514
movl (%rax), %edi
callq 0x3130
movswl %ax, %edi
callq 0x77ff
callq 0x60e6
cmpl $0x0, 0x20ba8(%rip)     # 0x28d40
setne %cl
je 0x8250
movl (%r12), %eax
cmpl $0xa, %eax
jne 0x810f
jmp 0x8250
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x26d5
jmp 0x818c
cmpb $0x0, 0x1(%r15)
jne 0x8124
callq 0x2240
movl %ebp, 0x4(%rsp)
movq %r14, %rbp
movq %rbx, %r14
movq (%rax), %rbx
xorl %eax, %eax
callq 0x68a0
movsbq %al, %rax
testb $0x8, 0x1(%rbx,%rax,2)
movq %r14, %rbx
movq %rbp, %r14
movl 0x4(%rsp), %ebp
je 0x8124
callq 0x60e6
movl (%r12), %eax
cmpl $0x4, %eax
je 0x8223
cmpl $0x3, %eax
jne 0x823a
xorl %edi, %edi
leaq 0x202f8(%rip), %rax     # 0x28514
subl (%rax), %edi
jmp 0x817f
leaq 0x202ee(%rip), %rax     # 0x28518
movsd (%rax), %xmm0
xorps 0x168b(%rip), %xmm0     # 0x98c0
jmp 0x816f
movq %rbx, %rdi
leaq 0x18b3(%rip), %rsi      # 0x9af7
leaq 0x18c2(%rip), %rdx      # 0x9b0d
jmp 0x81bc
testb %cl, %cl
je 0x8284
leaq 0x20265(%rip), %rax     # 0x284c0
cmpb $0x29, (%rax)
jne 0x826a
cmpb $0x0, 0x1(%rax)
je 0x8324
leaq 0x20bef(%rip), %rdi     # 0x28e60
leaq 0x18f0(%rip), %rsi      # 0x9b68
leaq 0x20241(%rip), %rdx     # 0x284c0
callq 0x26d5
movl 0x20ac9(%rip), %r14d    # 0x28d54
movl %r14d, %edi
subl %ebp, %edi
callq 0x35ba
movswl %ax, %ebx
subl %ebp, %r14d
jle 0x830f
movl %ebx, %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
leaq 0x5f90(%rip), %rcx      # 0xe240
leaq (%rcx,%rax), %r15
addq $0x8, %r15
movl %r14d, %r12d
movl 0x20a93(%rip), %eax     # 0x28d54
incl %r14d
decq %r12
leaq 0x20be2(%rip), %r13     # 0x28eb0
cltq
movswl (%r13,%rax,2), %ebp
movq (%r15), %rax
movw %bp, (%rax,%r12,2)
movl %ebp, %edi
callq 0x2eda
movl %ebp, %edi
callq 0x2f00
movslq 0x20a61(%rip), %rax     # 0x28d54
movw $0x0, (%r13,%rax,2)
decl %eax
movl %eax, 0x20a51(%rip)     # 0x28d54
decl %r14d
decq %r12
cmpl $0x1, %r14d
jg 0x82ce
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x77ff
callq 0x60e6
jmp 0x8284