// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, 0xc(%rsp)
movl %edi, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq %rsi, %rdi
callq 0x5d80
andl $0x0, 0x2287c(%rip)     # 0x28d44
andl $0x0, 0x22879(%rip)     # 0x28d48
andl $0x0, 0x2287a(%rip)     # 0x28d50
andl $0x0, 0x22877(%rip)     # 0x28d54
andl $0x0, 0x22874(%rip)     # 0x28d58
movl $0x1, 0x22852(%rip)     # 0x28d40
andl $0x0, 0x22857(%rip)     # 0x28d4c
leaq 0x22964(%rip), %rdi     # 0x28e60
leaq 0x21fbd(%rip), %rsi     # 0x284c0
callq 0x2050
leaq 0x22001(%rip), %rbp     # 0x28510
movl (%rbp), %eax
cmpl $0x9, %eax
je 0x6624
cmpl $0x2, %eax
je 0x6548
cmpl $0x1, %eax
je 0x6699
leaq 0x22930(%rip), %rdi     # 0x28e60
leaq 0x3439(%rip), %rsi      # 0x9970
leaq 0x21f82(%rip), %rdx     # 0x284c0
callq 0x499b
jmp 0x669e
pushq $0x1
popq %rax
movb $0x0, 0x2290e(%rip)     # 0x28e60
pushq $0x2
popq %rcx
leaq 0x22904(%rip), %r12     # 0x28e60
leaq 0x21f5d(%rip), %r13     # 0x284c0
leaq 0x21316(%rip), %rbx     # 0x27880
leaq 0x7cbf(%rip), %r14      # 0xe230
leaq 0x22b38(%rip), %r15     # 0x290b0
testl %eax, %eax
je 0x66a4
cmpl $0x2, %ecx
jne 0x66a4
movq %r12, %rdi
movq %r13, %rsi
callq 0x21c0
callq 0x5d93
cmpl $0x1, (%rbp)
je 0x65b5
movq %r12, %rdi
leaq 0x337b(%rip), %rsi      # 0x9924
leaq 0x338c(%rip), %rdx      # 0x993c
callq 0x499b
movl 0x22791(%rip), %eax     # 0x28d4c
leal 0x1(%rax), %ecx
movl %ecx, 0x22788(%rip)     # 0x28d4c
cmpl $0x100, %eax            # imm = 0x100
jl 0x65e1
movq %r12, %rdi
leaq 0x337e(%rip), %rsi      # 0x9953
leaq 0x30dd(%rip), %rdx      # 0x96b9
callq 0x499b
movq %r13, %rdi
callq 0x3368
movw %ax, (%rbx)
movswl %ax, %edi
callq 0x2b28
movswl (%rbx), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
movq 0x8(%r14,%rax), %rax
movslq 0x2273f(%rip), %rcx     # 0x28d4c
movq %rax, (%r15,%rcx,8)
callq 0x5d93
movl (%rbp), %ecx
movl 0x22721(%rip), %eax     # 0x28d40
jmp 0x6578
callq 0x5d93
cmpl $0x1, (%rbp)
je 0x6645
leaq 0x32c2(%rip), %rsi      # 0x98f8
leaq 0x22823(%rip), %rdi     # 0x28e60
movq %rdi, %rdx
callq 0x499b
leaq 0x21e74(%rip), %rdi     # 0x284c0
callq 0x3368
leaq 0x21228(%rip), %rbx     # 0x27880
movw %ax, (%rbx)
movswl %ax, %edi
callq 0x2b28
movswl (%rbx), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
leaq 0x7bb9(%rip), %rcx      # 0xe230
movq 0x8(%rcx,%rax), %rax
movslq 0x226c9(%rip), %rcx     # 0x28d4c
leaq 0x1(%rcx), %rdx
movl %edx, 0x226bf(%rip)     # 0x28d4c
leaq 0x22a1c(%rip), %rdx     # 0x290b0
movq %rax, 0x8(%rdx,%rcx,8)
callq 0x5d93
movl 0x2269c(%rip), %eax     # 0x28d40
testl %eax, %eax
je 0x67ae
andl $0x0, 0x2269d(%rip)     # 0x28d50
cmpl $0x9, (%rbp)
jne 0x67ae
leaq 0x21dfc(%rip), %rax     # 0x284c0
cmpb $0x7c, (%rax)
jne 0x67ae
leaq 0x21dec(%rip), %rax     # 0x284c0
cmpb $0x0, 0x1(%rax)
jne 0x67ae
leaq 0x2fd4(%rip), %r12      # 0x96b9
leaq 0x21dd4(%rip), %rbx     # 0x284c0
leaq 0x2118d(%rip), %r13     # 0x27880
leaq 0x7b36(%rip), %r14      # 0xe230
leaq 0x231af(%rip), %r15     # 0x298b0
callq 0x5d93
movl (%rbp), %eax
cmpl $0x1, %eax
jne 0x6780
movl 0x2263c(%rip), %eax     # 0x28d50
leal 0x1(%rax), %ecx
movl %ecx, 0x22633(%rip)     # 0x28d50
cmpl 0x22635(%rip), %eax     # 0x28d58
jl 0x672b
movl %ecx, 0x2262d(%rip)     # 0x28d58
cmpl $0x100, %eax            # imm = 0x100
jl 0x674a
leaq 0x22727(%rip), %rdi     # 0x28e60
leaq 0x3249(%rip), %rsi      # 0x9989
movq %r12, %rdx
callq 0x499b
jmp 0x6701
movq %rbx, %rdi
callq 0x3368
movw %ax, (%r13)
movswl %ax, %edi
callq 0x2b28
movswl (%r13), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
movq 0x8(%r14,%rax), %rax
movslq 0x225d6(%rip), %rcx     # 0x28d50
movq %rax, (%r15,%rcx,8)
jmp 0x6701
cmpl $0x9, %eax
jne 0x6794
cmpb $0x7c, (%rbx)
jne 0x6794
cmpb $0x0, 0x1(%rbx)
je 0x6990
leaq 0x226c5(%rip), %rdi     # 0x28e60
leaq 0x3206(%rip), %rsi      # 0x99a8
leaq 0x2f10(%rip), %rdx      # 0x96b9
callq 0x499b
cmpl $0x0, 0x2258b(%rip)     # 0x28d40
je 0x6848
callq 0x69ba
cmpl $0x0, 0x22579(%rip)     # 0x28d40
je 0x6848
movl $0xf5, %edi
callq 0x7361
movl $0xf1, %edi
callq 0x7361
cmpl $0x0, 0x2255c(%rip)     # 0x28d40
je 0x6848
movl 0x2255c(%rip), %edi     # 0x28d48
callq 0x3227
movl %eax, %ebx
leaq 0x21086(%rip), %r14     # 0x27880
movw %ax, (%r14)
movswl %ax, %ebp
movl %ebp, %edi
callq 0x2b28
movswl (%r14), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
leaq 0x7a13(%rip), %r15      # 0xe230
movq 0x8(%r15,%rax), %rax
movl 0x22520(%rip), %ecx     # 0x28d48
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
leaq 0x2252a(%rip), %rsi     # 0x28d60
cmpq %rdx, %rcx
je 0x6885
movb (%rdx,%rsi), %dil
movb %dil, (%rax,%rdx)
incq %rdx
jmp 0x6836
movswl 0x8(%rsp), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
leaq 0x79d2(%rip), %rcx      # 0xe230
movq 0x8(%rcx,%rax), %rax
andw $0x0, 0x4(%rax)
xorl %eax, %eax
xorl %ebx, %ebx
movswl %ax, %edi
callq 0x2b30
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x225d4(%rip), %rdi     # 0x28e60
callq 0x3368
movswl 0x8(%rsp), %ecx
shrl %ecx
movswq %cx, %rcx
shlq $0x4, %rcx
leaq (%r15,%rcx), %r14
addq $0x8, %r14
movq (%r14), %rcx
movw %ax, 0x2(%rcx)
movswl %ax, %edi
callq 0x2b30
movq (%r14), %rax
movw %bx, 0x4(%rax)
movl %ebp, %edi
callq 0x2b30
movl 0x22489(%rip), %edi     # 0x28d54
testl %edi, %edi
jle 0x6925
callq 0x318d
movswl %ax, %ebx
movl %ebx, %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
addq %rax, %r15
addq $0x8, %r15
pushq $0x1
popq %r12
leaq 0x225bb(%rip), %r13     # 0x28eb0
movslq 0x22458(%rip), %rax     # 0x28d54
cmpq %rax, %r12
jg 0x6927
movswl (%r13,%r12,2), %edi
movq (%r15), %rax
movw %di, -0x2(%rax,%r12,2)
callq 0x2b30
movswl (%r13,%r12,2), %edi
callq 0x2b55
incq %r12
jmp 0x68f5
xorl %ebx, %ebx
movq (%r14), %rax
movw %bx, 0x6(%rax)
movswl %bx, %edi
callq 0x2b30
pushq $0x6
popq %rdi
callq 0x2d9b
movq (%r14), %rcx
movw %ax, 0x8(%rcx)
movswl %ax, %edi
callq 0x2b30
movl 0x22405(%rip), %edi     # 0x28d58
incl %edi
callq 0x2d9b
movq (%r14), %rcx
movw %ax, 0xa(%rcx)
movswl %ax, %edi
callq 0x2b30
cmpl $0x0, 0xc(%rsp)
je 0x6988
movq 0x10(%rsp), %rdi
callq 0x374c
movq (%r14), %rcx
movw %ax, (%rcx)
pushq $0x1
popq %rbx
jmp 0x686c
pushq $0x1
popq %rbx
jmp 0x6874
callq 0x5d93
jmp 0x67ae