// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl 0x20106(%rip), %eax     # 0x2ad94
movl %eax, -0xc(%rbp)
callq 0x8710
xorl %eax, %eax
cmpl $0x0, 0x200e1(%rip)     # 0x2ad80
movb %al, -0x11(%rbp)
je 0xacb4
leaq 0x1f895(%rip), %rax     # 0x2a540
cmpl $0xa, (%rax)
setne %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
testb $0x1, %al
jne 0xacc0
jmp 0xaec9
leaq 0x1f879(%rip), %rax     # 0x2a540
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x8, %eax
ja 0xaea5
movq -0x20(%rbp), %rax
leaq 0x1b87(%rip), %rcx      # 0xc86c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0xac80
jmp 0xaec4
leaq 0x1f851(%rip), %rax     # 0x2a550
movl (%rax), %edi
callq 0x34a0
movswl %ax, %edi
callq 0xa290
callq 0x8710
jmp 0xaec4
leaq 0x1f839(%rip), %rax     # 0x2a558
movsd (%rax), %xmm0
callq 0x4330
movswl %ax, %edi
callq 0xa290
callq 0x8710
jmp 0xaec4
leaq 0x1f7af(%rip), %rdi     # 0x2a4f0
callq 0x4000
movswl %ax, %edi
callq 0xa290
callq 0x8710
jmp 0xaec4
leaq 0x1f791(%rip), %rdi     # 0x2a4f0
leaq 0x1d32(%rip), %rsi      # 0xca98
callq 0x2150
cmpl $0x0, %eax
jne 0xad7a
callq 0xac80
jmp 0xaec4
leaq 0x1f76f(%rip), %rdi     # 0x2a4f0
leaq 0x1c10(%rip), %rsi      # 0xc998
callq 0x2150
cmpl $0x0, %eax
jne 0xae52
callq 0x2220
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movb $0x0, %al
callq 0x8ea0
movb %al, %cl
movq -0x28(%rbp), %rax
movsbl %cl, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xae52
callq 0x8710
leaq 0x1f76d(%rip), %rax     # 0x2a540
cmpl $0x3, (%rax)
jne 0xadf2
xorl %edi, %edi
leaq 0x1f76f(%rip), %rax     # 0x2a550
subl (%rax), %edi
callq 0x34a0
movswl %ax, %edi
callq 0xa290
jmp 0xae4b
leaq 0x1f747(%rip), %rax     # 0x2a540
cmpl $0x4, (%rax)
jne 0xae2f
leaq 0x1f753(%rip), %rax     # 0x2a558
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
callq 0x4330
movswl %ax, %edi
callq 0xa290
jmp 0xae49
leaq 0x2006a(%rip), %rdi     # 0x2aea0
leaq 0x1c3b(%rip), %rsi      # 0xca78
leaq 0x1c4a(%rip), %rdx      # 0xca8e
callq 0x64b0
jmp 0xae4b
callq 0x8710
jmp 0xaec4
leaq 0x1f697(%rip), %rdi     # 0x2a4f0
callq 0x4000
movswl %ax, %edi
callq 0xa290
callq 0x8710
jmp 0xaec4
leaq 0x1f6dc(%rip), %rax     # 0x2a550
movl (%rax), %edi
callq 0x3ea0
movswl %ax, %edi
callq 0xa290
callq 0x8710
jmp 0xaec4
leaq 0x1f65f(%rip), %rdi     # 0x2a4f0
callq 0x45d0
movswl %ax, %edi
callq 0xa290
callq 0x8710
jmp 0xaec4
leaq 0x1fff4(%rip), %rdi     # 0x2aea0
leaq 0x1c1c(%rip), %rsi      # 0xcacf
leaq 0x1f636(%rip), %rdx     # 0x2a4f0
callq 0x64b0
callq 0x8710
jmp 0xac96
cmpl $0x0, 0x1feb0(%rip)     # 0x2ad80
je 0xaf0d
leaq 0x1f617(%rip), %rdi     # 0x2a4f0
leaq 0x1bba(%rip), %rsi      # 0xca9a
callq 0x2150
cmpl $0x0, %eax
je 0xaf06
leaq 0x1ffaf(%rip), %rdi     # 0x2aea0
leaq 0x1bf5(%rip), %rsi      # 0xcaed
leaq 0x1f5f1(%rip), %rdx     # 0x2a4f0
callq 0x64b0
jmp 0xaf0b
callq 0x8710
jmp 0xaf0d
movl 0x1fe81(%rip), %eax     # 0x2ad94
subl -0xc(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %edi
callq 0x3d60
movw %ax, -0xe(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
cmpl $0x1, -0x4(%rbp)
jl 0xafb9
movslq 0x1fe58(%rip), %rcx     # 0x2ad94
leaq 0x1ffad(%rip), %rax     # 0x2aef0
movw (%rax,%rcx,2), %ax
movw %ax, -0x10(%rbp)
movw -0x10(%rbp), %ax
movswl -0xe(%rbp), %ecx
sarl %ecx
movslq %ecx, %rdx
leaq 0x5301(%rip), %rcx      # 0x10260
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movl -0x4(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movw %ax, (%rcx,%rdx,2)
movswl %ax, %edi
callq 0x2fd0
movswl -0x10(%rbp), %edi
callq 0x3020
movslq 0x1fe05(%rip), %rcx     # 0x2ad94
leaq 0x1ff5a(%rip), %rax     # 0x2aef0
movw $0x0, (%rax,%rcx,2)
movl 0x1fdf2(%rip), %eax     # 0x2ad94
subl $0x1, %eax
movl %eax, 0x1fde9(%rip)     # 0x2ad94
movl -0x4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xaf2b
movswl -0xe(%rbp), %edi
callq 0xa290
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)