// File: /workspace/github_c_makefile_star2_O1/afi-lambda[P]a_little_smalltalk/src/parser.c
// Function: nameTerm
static boolean nameTerm(char *name)
{
    int i;
    boolean done = false;
    boolean isSuper = false;

    /* it might be self or super */
    if (streq(name, "self") || streq(name, "super"))
    {
        genInstruction(PushArgument, 0);
        done = true;
        if (streq(name,"super"))
            isSuper = true;
    }

    /* or it might be a temporary (reverse this to get most recent first)*/
    if (!done)
        for (i = temporaryTop; (!done) && (i >= 1); i--)
            if (streq(name, temporaryName[i]))
            {
                genInstruction(PushTemporary, i - 1);
                done = true;
            }

    /* or it might be an argument */
    if (!done)
        for (i = 1; (!done) && (i <= argumentTop); i++)
            if (streq(name, argumentName[i]))
            {
                genInstruction(PushArgument, i);
                done = true;
            }

    /* or it might be an instance variable */
    if (!done)
        for (i = 1; (!done) && (i <= instanceTop); i++)
        {
            if (streq(name, instanceName[i]))
            {
                genInstruction(PushInstance, i - 1);
                done = true;
            }
        }

    /* or it might be a global constant */
    if (!done)
        for (i = 0; (!done) && glbsyms[i]; i++)
            if (streq(name, glbsyms[i]))
            {
                genInstruction(PushConstant, i + 4);
                done = true;
            }

    /* not anything else, it must be a global */
    /* must look it up at run time */
    if (!done)
    {
        genInstruction(PushLiteral, genLiteral(newSymbol(name)));
        genMessage(false, 0, newSymbol("value"));
    }

    return (isSuper);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x230e(%rip), %rsi      # 0x9a40
callq 0x2160
testl %eax, %eax
je 0x7754
leaq 0x2303(%rip), %rsi      # 0x9a45
movq %rbx, %rdi
callq 0x2160
testl %eax, %eax
je 0x7754
xorl %ebp, %ebp
movb $0x1, %al
jmp 0x77ac
movslq 0x215fd(%rip), %rax     # 0x28d58
cmpq $0x100, %rax            # imm = 0x100
jl 0x777f
leaq 0x21706(%rip), %rdi     # 0x28e70
leaq 0x235a(%rip), %rsi      # 0x9acb
leaq 0x1f3d(%rip), %rdx      # 0x96b5
callq 0x26d7
jmp 0x7793
leal 0x1(%rax), %ecx
movl %ecx, 0x215d0(%rip)     # 0x28d58
leaq 0x215e1(%rip), %rcx     # 0x28d70
movb $0x20, (%rax,%rcx)
leaq 0x22ab(%rip), %rsi      # 0x9a45
movq %rbx, %rdi
callq 0x2160
xorl %ebp, %ebp
testl %eax, %eax
sete %bpl
xorl %eax, %eax
testb %al, %al
je 0x793f
movslq 0x215a5(%rip), %r14     # 0x28d60
testq %r14, %r14
jle 0x7810
leaq 0x220f9(%rip), %rax     # 0x298c0
leaq (%rax,%r14,8), %r15
xorl %r12d, %r12d
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x2160
testl %eax, %eax
jne 0x77f1
leal -0x1(%r14), %esi
movl $0x3, %edi
callq 0x70d3
movl $0x1, %r12d
testl %r12d, %r12d
jne 0x7807
leaq -0x1(%r14), %rax
addq $-0x8, %r15
cmpq $0x1, %r14
movq %rax, %r14
jg 0x77ce
testl %r12d, %r12d
jne 0x793f
cmpl $0x0, 0x21545(%rip)     # 0x28d5c
jle 0x786d
xorl %r12d, %r12d
movl $0x1, %r14d
leaq 0x21897(%rip), %r15     # 0x290c0
movq (%r15,%r14,8), %rsi
movq %rbx, %rdi
callq 0x2160
testl %eax, %eax
jne 0x784c
movl $0x2, %edi
movl %r14d, %esi
callq 0x70d3
movl $0x1, %r12d
testl %r12d, %r12d
jne 0x7864
leaq 0x1(%r14), %rax
movslq 0x21500(%rip), %rcx     # 0x28d5c
cmpq %rcx, %r14
movq %rax, %r14
jl 0x7829
testl %r12d, %r12d
jne 0x793f
cmpl $0x0, 0x20ccc(%rip)     # 0x28540
jle 0x78c7
xorl %r12d, %r12d
movl $0x1, %r15d
leaq 0x20cca(%rip), %r14     # 0x28550
movq (%r14,%r15,8), %rsi
movq %rbx, %rdi
callq 0x2160
testl %eax, %eax
jne 0x78aa
leal -0x1(%r15), %esi
movl $0x1, %r12d
movl $0x1, %edi
callq 0x70d3
testl %r12d, %r12d
jne 0x78c2
leaq 0x1(%r15), %rax
movslq 0x20c86(%rip), %rcx     # 0x28540
cmpq %rcx, %r15
movq %rax, %r15
jl 0x7886
testl %r12d, %r12d
jne 0x793f
movl $0x4, %r14d
xorl %r12d, %r12d
leaq 0x54b9(%rip), %r13      # 0xcd90
cmpq $0x20, %r12
je 0x790b
movq (%r12,%r13), %rsi
movq %rbx, %rdi
callq 0x2160
movl %eax, %r15d
testl %eax, %eax
jne 0x78fd
movl $0x5, %edi
movl %r14d, %esi
callq 0x70d3
incl %r14d
addq $0x8, %r12
testl %r15d, %r15d
jne 0x78d7
jmp 0x793f
movq %rbx, %rdi
callq 0x37bd
movswl %ax, %edi
callq 0x7a4b
movl $0x4, %edi
movl %eax, %esi
callq 0x70d3
leaq 0x18f6(%rip), %rdi      # 0x9224
callq 0x37bd
movswl %ax, %edx
xorl %edi, %edi
xorl %esi, %esi
callq 0x73ac
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq