// File: /workspace/github_c_makefile_star2_O1/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 0x615c
movl $0x1, 0x221b9(%rip)     # 0x28d50
xorl %eax, %eax
movl %eax, 0x221b5(%rip)     # 0x28d54
movl %eax, 0x221b3(%rip)     # 0x28d58
movl %eax, 0x221b1(%rip)     # 0x28d5c
movl %eax, 0x221af(%rip)     # 0x28d60
movl %eax, 0x221ad(%rip)     # 0x28d64
movl %eax, 0x221ab(%rip)     # 0x28d68
leaq 0x222ac(%rip), %rdi     # 0x28e70
leaq 0x21905(%rip), %rsi     # 0x284d0
callq 0x2050
leaq 0x21949(%rip), %r13     # 0x28520
movl (%r13), %eax
cmpl $0x9, %eax
je 0x6ce5
cmpl $0x2, %eax
je 0x6c11
cmpl $0x1, %eax
je 0x6d5b
leaq 0x22277(%rip), %rdi     # 0x28e70
leaq 0x2d84(%rip), %rsi      # 0x9984
leaq 0x218c9(%rip), %rdx     # 0x284d0
callq 0x26d7
jmp 0x6d60
movb $0x0, 0x22258(%rip)     # 0x28e70
leaq 0x22251(%rip), %r15     # 0x28e70
leaq 0x218aa(%rip), %r12     # 0x284d0
leaq 0x20c63(%rip), %rbp     # 0x27890
leaq 0x760c(%rip), %rbx      # 0xe240
leaq 0x22485(%rip), %r14     # 0x290c0
movq %r15, %rdi
movq %r12, %rsi
callq 0x21e0
callq 0x6172
cmpl $0x1, (%r13)
je 0x6c68
movq %r15, %rdi
leaq 0x2cdc(%rip), %rsi      # 0x9938
leaq 0x2ced(%rip), %rdx      # 0x9950
callq 0x26d7
movl 0x220ee(%rip), %eax     # 0x28d5c
leal 0x1(%rax), %ecx
movl %ecx, 0x220e5(%rip)     # 0x28d5c
cmpl $0x100, %eax            # imm = 0x100
jl 0x6c94
movq %r15, %rdi
leaq 0x2cdf(%rip), %rsi      # 0x9967
leaq 0x2a26(%rip), %rdx      # 0x96b5
callq 0x26d7
movq %r12, %rdi
callq 0x37bd
movw %ax, (%rbp)
movswl %ax, %edi
callq 0x2f18
movswl (%rbp), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
movq 0x8(%rbx,%rax), %rax
movslq 0x2209a(%rip), %rcx     # 0x28d5c
movq %rax, (%r14,%rcx,8)
callq 0x6172
cmpl $0x0, 0x2207e(%rip)     # 0x28d50
je 0x6d60
cmpl $0x2, (%r13)
je 0x6c3b
jmp 0x6d60
callq 0x6172
cmpl $0x1, (%r13)
je 0x6d07
leaq 0x2c14(%rip), %rsi      # 0x990c
leaq 0x22171(%rip), %rdi     # 0x28e70
movq %rdi, %rdx
callq 0x26d7
leaq 0x217c2(%rip), %rdi     # 0x284d0
callq 0x37bd
leaq 0x20b76(%rip), %rbx     # 0x27890
movw %ax, (%rbx)
movswl %ax, %edi
callq 0x2f18
movswl (%rbx), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
leaq 0x7507(%rip), %rcx      # 0xe240
movq 0x8(%rcx,%rax), %rax
movslq 0x22017(%rip), %rcx     # 0x28d5c
leaq 0x1(%rcx), %rdx
movl %edx, 0x2200d(%rip)     # 0x28d5c
leaq 0x2236a(%rip), %rdx     # 0x290c0
movq %rax, 0x8(%rdx,%rcx,8)
callq 0x6172
cmpl $0x0, 0x21fe9(%rip)     # 0x28d50
je 0x6e78
movl $0x0, 0x21fe9(%rip)     # 0x28d60
cmpl $0x9, (%r13)
jne 0x6e78
leaq 0x21747(%rip), %rdi     # 0x284d0
leaq 0x2e74(%rip), %rsi      # 0x9c04
callq 0x2160
testl %eax, %eax
jne 0x6e78
leaq 0x2911(%rip), %r15      # 0x96b5
leaq 0x21725(%rip), %r12     # 0x284d0
leaq 0x20ade(%rip), %rbp     # 0x27890
leaq 0x7487(%rip), %rbx      # 0xe240
leaq 0x22b00(%rip), %r14     # 0x298c0
callq 0x6172
movl (%r13), %eax
cmpl $0x1, %eax
jne 0x6e3e
movl 0x21f8c(%rip), %eax     # 0x28d60
leal 0x1(%rax), %ecx
movl %ecx, 0x21f83(%rip)     # 0x28d60
cmpl 0x21f85(%rip), %eax     # 0x28d68
jl 0x6deb
movl %ecx, 0x21f7d(%rip)     # 0x28d68
cmpl $0x100, %eax            # imm = 0x100
jl 0x6e0a
leaq 0x22077(%rip), %rdi     # 0x28e70
leaq 0x2b9d(%rip), %rsi      # 0x999d
movq %r15, %rdx
callq 0x26d7
jmp 0x6dc0
movq %r12, %rdi
callq 0x37bd
movw %ax, (%rbp)
movswl %ax, %edi
callq 0x2f18
movswl (%rbp), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
movq 0x8(%rbx,%rax), %rax
movslq 0x21f28(%rip), %rcx     # 0x28d60
movq %rax, (%r14,%rcx,8)
jmp 0x6dc0
cmpl $0x9, %eax
jne 0x6e5e
leaq 0x21686(%rip), %rdi     # 0x284d0
leaq 0x2db3(%rip), %rsi      # 0x9c04
callq 0x2160
testl %eax, %eax
je 0x70c9
leaq 0x2200b(%rip), %rdi     # 0x28e70
leaq 0x2b50(%rip), %rsi      # 0x99bc
leaq 0x2842(%rip), %rdx      # 0x96b5
callq 0x26d7
cmpl $0x0, 0x21ed1(%rip)     # 0x28d50
je 0x6e86
callq 0x714d
cmpl $0x0, 0x21ec3(%rip)     # 0x28d50
je 0x6f0d
movslq 0x21ec2(%rip), %rax     # 0x28d58
cmpq $0x100, %rax            # imm = 0x100
jl 0x6eba
leaq 0x21fcb(%rip), %rdi     # 0x28e70
leaq 0x2c1f(%rip), %rsi      # 0x9acb
leaq 0x2802(%rip), %rdx      # 0x96b5
callq 0x26d7
jmp 0x6ece
leal 0x1(%rax), %ecx
movl %ecx, 0x21e95(%rip)     # 0x28d58
leaq 0x21ea6(%rip), %rcx     # 0x28d70
movb $-0xb, (%rax,%rcx)
movslq 0x21e83(%rip), %rax     # 0x28d58
cmpq $0x100, %rax            # imm = 0x100
jl 0x6ef9
leaq 0x21f8c(%rip), %rdi     # 0x28e70
leaq 0x2be0(%rip), %rsi      # 0x9acb
leaq 0x27c3(%rip), %rdx      # 0x96b5
callq 0x26d7
jmp 0x6f0d
leal 0x1(%rax), %ecx
movl %ecx, 0x21e56(%rip)     # 0x28d58
leaq 0x21e67(%rip), %rcx     # 0x28d70
movb $-0xf, (%rax,%rcx)
cmpl $0x0, 0x21e3c(%rip)     # 0x28d50
je 0x7020
movl 0x21e38(%rip), %edi     # 0x28d58
callq 0x3678
movl %eax, %ebx
leaq 0x20962(%rip), %r14     # 0x27890
movw %ax, (%r14)
movswl %ax, %ebp
movl %ebp, %edi
callq 0x2f18
movslq 0x21e15(%rip), %rdx     # 0x28d58
testq %rdx, %rdx
jle 0x6f6e
movswl (%r14), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
leaq 0x72e3(%rip), %rcx      # 0xe240
movq 0x8(%rcx,%rax), %rdi
leaq 0x21e07(%rip), %rsi     # 0x28d70
callq 0x2190
leaq 0x21efb(%rip), %rdi     # 0x28e70
callq 0x37bd
movswl 0x8(%rsp), %ecx
shrl %ecx
movswq %cx, %rcx
shlq $0x4, %rcx
leaq 0x72b0(%rip), %r15      # 0xe240
leaq (%r15,%rcx), %r14
addq $0x8, %r14
movq (%r14), %rcx
movw %ax, 0x2(%rcx)
movswl %ax, %edi
callq 0x2f20
movq (%r14), %rax
movw %bx, 0x4(%rax)
movl %ebp, %edi
callq 0x2f20
movl 0x21da9(%rip), %edi     # 0x28d64
testl %edi, %edi
jle 0x7047
callq 0x35da
movl %eax, %ebx
cmpl $0x0, 0x21d93(%rip)     # 0x28d64
jle 0x7049
movswl %bx, %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
addq %rax, %r15
addq $0x8, %r15
xorl %r12d, %r12d
leaq 0x21ecf(%rip), %r13     # 0x28ec0
movswl 0x2(%r13,%r12,2), %edi
movq (%r15), %rax
movw %di, (%rax,%r12,2)
callq 0x2f20
movswl 0x2(%r13,%r12,2), %edi
callq 0x2f46
movslq 0x21d4e(%rip), %rax     # 0x28d64
incq %r12
cmpq %rax, %r12
jl 0x6ff1
jmp 0x7049
movswl 0x8(%rsp), %eax
shrl %eax
movswq %ax, %rax
shlq $0x4, %rax
leaq 0x720a(%rip), %rcx      # 0xe240
movq 0x8(%rcx,%rax), %rax
movw $0x0, 0x4(%rax)
xorl %eax, %eax
xorl %ebx, %ebx
jmp 0x70a9
xorl %ebx, %ebx
movq (%r14), %rax
movw %bx, 0x6(%rax)
movswl %bx, %edi
callq 0x2f20
movl $0x6, %edi
callq 0x314c
movq (%r14), %rcx
movw %ax, 0x8(%rcx)
movswl %ax, %edi
callq 0x2f20
movl 0x21cf1(%rip), %edi     # 0x28d68
incl %edi
callq 0x314c
movq (%r14), %rcx
movw %ax, 0xa(%rcx)
movswl %ax, %edi
callq 0x2f20
cmpl $0x0, 0xc(%rsp)
je 0x70b3
movq 0x10(%rsp), %rdi
callq 0x3b88
movq (%r14), %rcx
movw %ax, (%rcx)
movl $0x1, %ebx
movswl %ax, %edi
callq 0x2f20
jmp 0x70b8
movl $0x1, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x6172
jmp 0x6e78