// File: /workspace/github_c_makefile_star2_O0/afi-lambda[P]a_little_smalltalk/src/parser.c
// Function: parse
boolean parse(object method, const char *text, boolean savetext)
{
    int i;
    object bytecodes, theLiterals;
    byte *bp;

    lexinit(text);
    parseok = true;
    blockstat = NotInBlock;
    codeTop = 0;
    literalTop = temporaryTop = argumentTop = 0;
    maxTemporary = 0;

    messagePattern();
    if (parseok)
        temporaries();
    if (parseok)
        body();
    if (parseok)
    {
        genInstruction(DoSpecial, PopTop);
        genInstruction(DoSpecial, SelfReturn);
    }

    if (!parseok)
    {
        basicAtPut(method, bytecodesInMethod, nilobj);
    }
    else
    {
        bytecodes = newByteArray(codeTop);
        bp = bytePtr(bytecodes);
        for (i = 0; i < codeTop; i++)
        {
            bp[i] = codeArray[i];
        }
        basicAtPut(method, messageInMethod, newSymbol(selector));
        basicAtPut(method, bytecodesInMethod, bytecodes);
        if (literalTop > 0)
        {
            theLiterals = newArray(literalTop);
            for (i = 1; i <= literalTop; i++)
            {
                basicAtPut(theLiterals, i, literalArray[i]);
                decr(literalArray[i]);
            }
            basicAtPut(method, literalsInMethod, theLiterals);
        }
        else
        {
            basicAtPut(method, literalsInMethod, nilobj);
        }
        basicAtPut(method, stackSizeInMethod, newInteger(6));
        basicAtPut(method, temporarySizeInMethod,
                   newInteger(1 + maxTemporary));
        if (savetext)
        {
            basicAtPut(method, textInMethod, newStString(text));
        }
        return (true);
    }
    return (false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %di, %ax
movw %ax, -0x6(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x86e0
movl $0x1, 0x21a97(%rip)     # 0x2ad80
movl $0x0, 0x21a91(%rip)     # 0x2ad84
movl $0x0, 0x21a8b(%rip)     # 0x2ad88
movl $0x0, 0x21a85(%rip)     # 0x2ad8c
movl $0x0, 0x21a7f(%rip)     # 0x2ad90
movl $0x0, 0x21a79(%rip)     # 0x2ad94
movl $0x0, 0x21a73(%rip)     # 0x2ad98
callq 0x9690
cmpl $0x0, 0x21a4f(%rip)     # 0x2ad80
je 0x9338
callq 0x9910
cmpl $0x0, 0x21a41(%rip)     # 0x2ad80
je 0x9346
callq 0x9aa0
cmpl $0x0, 0x21a33(%rip)     # 0x2ad80
je 0x936d
movl $0xf, %edi
movl $0x5, %esi
callq 0x9650
movl $0xf, %edi
movl $0x1, %esi
callq 0x9650
cmpl $0x0, 0x21a0c(%rip)     # 0x2ad80
jne 0x93a3
movswl -0x6(%rbp), %eax
sarl %eax
movslq %eax, %rcx
leaq 0x6eda(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movw $0x0, 0x4(%rax)
xorl %edi, %edi
callq 0x2fd0
jmp 0x963a
movl 0x219df(%rip), %edi     # 0x2ad88
callq 0x3e40
movw %ax, -0x1a(%rbp)
movw -0x1a(%rbp), %ax
leaq 0x204f3(%rip), %rcx     # 0x298b0
movw %ax, (%rcx)
movswl %ax, %edi
callq 0x2fb0
cmpl $0x0, %eax
je 0x93f4
leaq 0x204dc(%rip), %rax     # 0x298b0
movswl (%rax), %eax
sarl %eax
movslq %eax, %rcx
leaq 0x6e7d(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x9419
leaq 0x204b5(%rip), %rax     # 0x298b0
movswl (%rax), %eax
sarl %eax
movslq %eax, %rcx
leaq 0x6e56(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl 0x21957(%rip), %eax     # 0x2ad88
jge 0x9457
movslq -0x18(%rbp), %rcx
leaq 0x21962(%rip), %rax     # 0x2ada0
movb (%rax,%rcx), %dl
movq -0x28(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x9428
leaq 0x21a42(%rip), %rdi     # 0x2aea0
callq 0x4000
movswl -0x6(%rbp), %ecx
sarl %ecx
movslq %ecx, %rdx
leaq 0x6ded(%rip), %rcx      # 0x10260
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movw %ax, 0x2(%rcx)
movswl %ax, %edi
callq 0x2fd0
movw -0x1a(%rbp), %ax
movswl -0x6(%rbp), %ecx
sarl %ecx
movslq %ecx, %rdx
leaq 0x6dc2(%rip), %rcx      # 0x10260
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movw %ax, 0x4(%rcx)
movswl %ax, %edi
callq 0x2fd0
cmpl $0x0, 0x218d8(%rip)     # 0x2ad94
jle 0x956e
movl 0x218cc(%rip), %edi     # 0x2ad94
callq 0x3d60
movw %ax, -0x1c(%rbp)
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl 0x218b3(%rip), %eax     # 0x2ad94
jg 0x9541
movslq -0x18(%rbp), %rcx
leaq 0x21a02(%rip), %rax     # 0x2aef0
movw (%rax,%rcx,2), %ax
movswl -0x1c(%rbp), %ecx
sarl %ecx
movslq %ecx, %rdx
leaq 0x6d5e(%rip), %rcx      # 0x10260
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movl -0x18(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movw %ax, (%rcx,%rdx,2)
movswl %ax, %edi
callq 0x2fd0
movslq -0x18(%rbp), %rcx
leaq 0x219c3(%rip), %rax     # 0x2aef0
movswl (%rax,%rcx,2), %edi
callq 0x3020
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x94d8
movw -0x1c(%rbp), %ax
movswl -0x6(%rbp), %ecx
sarl %ecx
movslq %ecx, %rdx
leaq 0x6d0b(%rip), %rcx      # 0x10260
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movw %ax, 0x6(%rcx)
movswl %ax, %edi
callq 0x2fd0
jmp 0x9596
movswl -0x6(%rbp), %eax
sarl %eax
movslq %eax, %rcx
leaq 0x6ce2(%rip), %rax      # 0x10260
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movw $0x0, 0x6(%rax)
xorl %edi, %edi
callq 0x2fd0
movl $0x6, %edi
callq 0x34a0
movswl -0x6(%rbp), %ecx
sarl %ecx
movslq %ecx, %rdx
leaq 0x6cb0(%rip), %rcx      # 0x10260
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movw %ax, 0x8(%rcx)
movswl %ax, %edi
callq 0x2fd0
movl 0x217cb(%rip), %edi     # 0x2ad98
addl $0x1, %edi
callq 0x34a0
movswl -0x6(%rbp), %ecx
sarl %ecx
movslq %ecx, %rdx
leaq 0x6c7b(%rip), %rcx      # 0x10260
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movw %ax, 0xa(%rcx)
movswl %ax, %edi
callq 0x2fd0
cmpl $0x0, -0x14(%rbp)
je 0x9631
movq -0x10(%rbp), %rdi
callq 0x45d0
movswl -0x6(%rbp), %ecx
sarl %ecx
movslq %ecx, %rdx
leaq 0x6c45(%rip), %rcx      # 0x10260
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movw %ax, (%rcx)
movswl %ax, %edi
callq 0x2fd0
movl $0x1, -0x4(%rbp)
jmp 0x9641
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)