// File: /workspace/github_c_makefile_star2_O3/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 0x60d0
movl $0x1, 0x22361(%rip)     # 0x28d40
xorl %eax, %eax
movl %eax, 0x2235d(%rip)     # 0x28d44
movl %eax, 0x2235b(%rip)     # 0x28d48
movl %eax, 0x2235d(%rip)     # 0x28d50
movl %eax, 0x2235b(%rip)     # 0x28d54
movl %eax, 0x22359(%rip)     # 0x28d58
movl %eax, 0x22347(%rip)     # 0x28d4c
leaq 0x22454(%rip), %rdi     # 0x28e60
leaq 0x21aad(%rip), %rsi     # 0x284c0
callq 0x2050
leaq 0x21af1(%rip), %rbp     # 0x28510
movl (%rbp), %eax
cmpl $0x9, %eax
je 0x6b2c
cmpl $0x2, %eax
je 0x6a58
cmpl $0x1, %eax
je 0x6ba1
leaq 0x22420(%rip), %rdi     # 0x28e60
leaq 0x2f49(%rip), %rsi      # 0x9990
leaq 0x21a72(%rip), %rdx     # 0x284c0
callq 0x26d5
jmp 0x6ba6
movb $0x0, 0x22401(%rip)     # 0x28e60
leaq 0x223fa(%rip), %r12     # 0x28e60
leaq 0x21a53(%rip), %r13     # 0x284c0
leaq 0x20e1c(%rip), %rbx     # 0x27890
leaq 0x77c5(%rip), %r14      # 0xe240
leaq 0x2262e(%rip), %r15     # 0x290b0
movq %r12, %rdi
movq %r13, %rsi
callq 0x21e0
callq 0x60e6
cmpl $0x1, (%rbp)
je 0x6aae
movq %r12, %rdi
leaq 0x2ea2(%rip), %rsi      # 0x9944
leaq 0x2eb3(%rip), %rdx      # 0x995c
callq 0x26d5
movl 0x22298(%rip), %eax     # 0x28d4c
leal 0x1(%rax), %ecx
movl %ecx, 0x2228f(%rip)     # 0x28d4c
cmpl $0x100, %eax            # imm = 0x100
jl 0x6ada
movq %r12, %rdi
leaq 0x2ea5(%rip), %rsi      # 0x9973
leaq 0x2bf8(%rip), %rdx      # 0x96cd
callq 0x26d5
movq %r13, %rdi
callq 0x379b
movw %ax, (%rbx)
movswl %ax, %edi
callq 0x2ed2
movswl (%rbx), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
movq 0x8(%r14,%rax), %rax
movslq 0x22246(%rip), %rcx     # 0x28d4c
movq %rax, (%r15,%rcx,8)
callq 0x60e6
movl 0x2222b(%rip), %eax     # 0x28d40
testl %eax, %eax
je 0x6bac
cmpl $0x2, (%rbp)
je 0x6a82
jmp 0x6bac
callq 0x60e6
cmpl $0x1, (%rbp)
je 0x6b4d
leaq 0x2dda(%rip), %rsi      # 0x9918
leaq 0x2231b(%rip), %rdi     # 0x28e60
movq %rdi, %rdx
callq 0x26d5
leaq 0x2196c(%rip), %rdi     # 0x284c0
callq 0x379b
leaq 0x20d30(%rip), %rbx     # 0x27890
movw %ax, (%rbx)
movswl %ax, %edi
callq 0x2ed2
movswl (%rbx), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
leaq 0x76c1(%rip), %rcx      # 0xe240
movq 0x8(%rcx,%rax), %rax
movslq 0x221c1(%rip), %rcx     # 0x28d4c
leaq 0x1(%rcx), %rdx
movl %edx, 0x221b7(%rip)     # 0x28d4c
leaq 0x22514(%rip), %rdx     # 0x290b0
movq %rax, 0x8(%rdx,%rcx,8)
callq 0x60e6
movl 0x22194(%rip), %eax     # 0x28d40
testl %eax, %eax
je 0x6cb9
movl $0x0, 0x22192(%rip)     # 0x28d50
cmpl $0x9, (%rbp)
jne 0x6cb9
leaq 0x218f1(%rip), %rax     # 0x284c0
cmpb $0x7c, (%rax)
jne 0x6cb9
leaq 0x218e1(%rip), %rax     # 0x284c0
cmpb $0x0, 0x1(%rax)
jne 0x6cb9
leaq 0x2add(%rip), %r12      # 0x96cd
leaq 0x218c9(%rip), %rbx     # 0x284c0
leaq 0x20c92(%rip), %r13     # 0x27890
leaq 0x763b(%rip), %r14      # 0xe240
leaq 0x22ca4(%rip), %r15     # 0x298b0
callq 0x60e6
movl (%rbp), %eax
cmpl $0x1, %eax
jne 0x6c8b
movl 0x22131(%rip), %eax     # 0x28d50
leal 0x1(%rax), %ecx
movl %ecx, 0x22128(%rip)     # 0x28d50
cmpl 0x2212a(%rip), %eax     # 0x28d58
jl 0x6c36
movl %ecx, 0x22122(%rip)     # 0x28d58
cmpl $0x100, %eax            # imm = 0x100
jl 0x6c55
leaq 0x2221c(%rip), %rdi     # 0x28e60
leaq 0x2d5e(%rip), %rsi      # 0x99a9
movq %r12, %rdx
callq 0x26d5
jmp 0x6c0c
movq %rbx, %rdi
callq 0x379b
movw %ax, (%r13)
movswl %ax, %edi
callq 0x2ed2
movswl (%r13), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
movq 0x8(%r14,%rax), %rax
movslq 0x220cb(%rip), %rcx     # 0x28d50
movq %rax, (%r15,%rcx,8)
jmp 0x6c0c
cmpl $0x9, %eax
jne 0x6c9f
cmpb $0x7c, (%rbx)
jne 0x6c9f
cmpb $0x0, 0x1(%rbx)
je 0x6f17
leaq 0x221ba(%rip), %rdi     # 0x28e60
leaq 0x2d1b(%rip), %rsi      # 0x99c8
leaq 0x2a19(%rip), %rdx      # 0x96cd
callq 0x26d5
cmpl $0x0, 0x22080(%rip)     # 0x28d40
je 0x6e6e
callq 0x6f9b
cmpl $0x0, 0x2206e(%rip)     # 0x28d40
je 0x6e6e
movslq 0x22069(%rip), %rcx     # 0x28d48
cmpq $0x100, %rcx            # imm = 0x100
jl 0x6d0a
leaq 0x22171(%rip), %rdi     # 0x28e60
leaq 0x2dd8(%rip), %rsi      # 0x9ace
leaq 0x29d0(%rip), %rdx      # 0x96cd
callq 0x26d5
movl 0x22040(%rip), %eax     # 0x28d48
jmp 0x6d1e
leal 0x1(%rcx), %eax
movl %eax, 0x22035(%rip)     # 0x28d48
leaq 0x22046(%rip), %rdx     # 0x28d60
movb $-0xb, (%rcx,%rdx)
cmpl $0x100, %eax            # imm = 0x100
jl 0x6d41
leaq 0x22134(%rip), %rdi     # 0x28e60
leaq 0x2d9b(%rip), %rsi      # 0x9ace
leaq 0x2993(%rip), %rdx      # 0x96cd
callq 0x26d5
jmp 0x6d57
leal 0x1(%rax), %ecx
movl %ecx, 0x21ffe(%rip)     # 0x28d48
cltq
leaq 0x2200d(%rip), %rcx     # 0x28d60
movb $-0xf, (%rax,%rcx)
cmpl $0x0, 0x21fe2(%rip)     # 0x28d40
je 0x6e6e
movl 0x21fde(%rip), %edi     # 0x28d48
callq 0x3656
movl %eax, %ebx
leaq 0x20b18(%rip), %r14     # 0x27890
movw %ax, (%r14)
movswl %ax, %ebp
movl %ebp, %edi
callq 0x2ed2
movslq 0x21fbb(%rip), %rdx     # 0x28d48
testq %rdx, %rdx
jle 0x6db8
movswl (%r14), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
leaq 0x7499(%rip), %rcx      # 0xe240
movq 0x8(%rcx,%rax), %rdi
leaq 0x21fad(%rip), %rsi     # 0x28d60
callq 0x2190
leaq 0x220a1(%rip), %rdi     # 0x28e60
callq 0x379b
movswl 0x8(%rsp), %ecx
shrl %ecx
movswq %cx, %rcx
shlq $0x4, %rcx
leaq 0x7466(%rip), %r15      # 0xe240
leaq (%r15,%rcx), %r14
addq $0x8, %r14
movq (%r14), %rcx
movw %ax, 0x2(%rcx)
movswl %ax, %edi
callq 0x2eda
movq (%r14), %rax
movw %bx, 0x4(%rax)
movl %ebp, %edi
callq 0x2eda
movl 0x21f4f(%rip), %edi     # 0x28d54
testl %edi, %edi
jle 0x6eac
callq 0x35ba
movl %eax, %ebx
cmpl $0x0, 0x21f39(%rip)     # 0x28d54
jle 0x6eae
movswl %bx, %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
addq %rax, %r15
addq $0x8, %r15
xorl %r12d, %r12d
leaq 0x22071(%rip), %r13     # 0x28eb0
movswl 0x2(%r13,%r12,2), %edi
movq (%r15), %rax
movw %di, (%rax,%r12,2)
callq 0x2eda
movswl 0x2(%r13,%r12,2), %edi
callq 0x2f00
movslq 0x21ef0(%rip), %rax     # 0x28d54
incq %r12
cmpq %rax, %r12
jl 0x6e3f
jmp 0x6eae
movswl 0x8(%rsp), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
leaq 0x73bc(%rip), %rcx      # 0xe240
movq 0x8(%rcx,%rax), %rax
movw $0x0, 0x4(%rax)
xorl %eax, %eax
xorl %ebx, %ebx
movswl %ax, %edi
callq 0x2eda
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
movq (%r14), %rax
movw %bx, 0x6(%rax)
movswl %bx, %edi
callq 0x2eda
movl $0x6, %edi
callq 0x3130
movq (%r14), %rcx
movw %ax, 0x8(%rcx)
movswl %ax, %edi
callq 0x2eda
movl 0x21e7c(%rip), %edi     # 0x28d58
incl %edi
callq 0x3130
movq (%r14), %rcx
movw %ax, 0xa(%rcx)
movswl %ax, %edi
callq 0x2eda
cmpl $0x0, 0xc(%rsp)
je 0x6f10
movq 0x10(%rsp), %rdi
callq 0x3b64
movq (%r14), %rcx
movw %ax, (%rcx)
movl $0x1, %ebx
jmp 0x6e93
movl $0x1, %ebx
jmp 0x6e9b
callq 0x60e6
jmp 0x6cb9