// File: /workspace/github_c_makefile_star2_O2/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 0x2139e(%rip), %r14d    # 0x28d54
callq 0x5d93
leaq 0x20b4e(%rip), %r12     # 0x28510
leaq 0x21497(%rip), %r15     # 0x28e60
leaq 0x215a(%rip), %rbp      # 0x9b2a
leaq 0x20ae9(%rip), %rbx     # 0x284c0
leaq 0x1ef6(%rip), %r13      # 0x98d4
movl 0x2135c(%rip), %ecx     # 0x28d40
testl %ecx, %ecx
je 0x7b16
movl (%r12), %eax
cmpl $0xa, %eax
je 0x7b16
decl %eax
cmpl $0x8, %eax
ja 0x7a7a
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x3368
jmp 0x7a68
movq %rbx, %rdi
callq 0x374c
jmp 0x7a68
leaq 0x20aef(%rip), %rax     # 0x28514
movl (%rax), %edi
callq 0x3269
jmp 0x7a68
movzbl (%rbx), %eax
cmpl $0x2d, %eax
je 0x7a8a
cmpl $0x28, %eax
jne 0x7a0a
cmpb $0x0, 0x1(%rbx)
jne 0x7a0a
callq 0x79a4
jmp 0x79de
leaq 0x20ac9(%rip), %rax     # 0x28518
movsd (%rax), %xmm0
callq 0x35b8
jmp 0x7a68
leaq 0x20ab3(%rip), %rax     # 0x28514
movl (%rax), %edi
callq 0x2d9b
movswl %ax, %edi
callq 0x6fb3
callq 0x5d93
jmp 0x79de
movq %r15, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x499b
jmp 0x7a70
cmpb $0x0, 0x1(%rbx)
jne 0x7a0a
callq 0x2220
movq %r15, %rbp
movl %r14d, %r15d
movq (%rax), %r14
xorl %eax, %eax
callq 0x636a
movsbq %al, %rax
testb $0x8, 0x1(%r14,%rax,2)
movl %r15d, %r14d
movq %rbp, %r15
leaq 0x206a(%rip), %rbp      # 0x9b2a
je 0x7a0a
callq 0x5d93
movl (%r12), %eax
cmpl $0x4, %eax
je 0x7ae9
cmpl $0x3, %eax
jne 0x7b00
xorl %edi, %edi
leaq 0x20a32(%rip), %rax     # 0x28514
subl (%rax), %edi
jmp 0x7a63
leaq 0x20a28(%rip), %rax     # 0x28518
movsd (%rax), %xmm0
xorps 0x1da5(%rip), %xmm0     # 0x98a0
jmp 0x7a53
movq %r15, %rdi
leaq 0x1fcd(%rip), %rsi      # 0x9ad7
leaq 0x1fdc(%rip), %rdx      # 0x9aed
jmp 0x7a83
testl %ecx, %ecx
je 0x7b43
cmpb $0x29, (%rbx)
jne 0x7b29
cmpb $0x0, 0x1(%rbx)
je 0x7bd0
leaq 0x21330(%rip), %rdi     # 0x28e60
leaq 0x2011(%rip), %rsi      # 0x9b48
leaq 0x20982(%rip), %rdx     # 0x284c0
callq 0x499b
movl 0x2120b(%rip), %ebx     # 0x28d54
subl %r14d, %ebx
movl %ebx, %edi
callq 0x318d
movswl %ax, %ebp
movl %ebp, %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
leaq 0x66c7(%rip), %rcx      # 0xe230
leaq (%rcx,%rax), %r15
addq $0x8, %r15
leaq 0x21338(%rip), %r12     # 0x28eb0
testl %ebx, %ebx
jle 0x7bbb
movslq 0x211d1(%rip), %rax     # 0x28d54
movswl (%r12,%rax,2), %r14d
movq (%r15), %rax
movw %r14w, -0x2(%rax,%rbx,2)
movl %r14d, %edi
callq 0x2b30
movl %r14d, %edi
callq 0x2b55
movslq 0x211ac(%rip), %rax     # 0x28d54
andw $0x0, (%r12,%rax,2)
decl %eax
movl %eax, 0x2119e(%rip)     # 0x28d54
decq %rbx
jmp 0x7b78
movl %ebp, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6fb3
callq 0x5d93
jmp 0x7b43
nop