// File: /workspace/github_c_makefile_star2_O0/GregorR[P]lstg/ImageBuilder/imageBuilder.c
// Function: nameTerm
int nameTerm(char *name)
{
  int             i;

  /*
     see if temporary 
   */
  for(i = 0; i < tempTop; i++)
  {
    if(strcmp(name, tempBuffer[i]) == 0)
    {
      genInstruction(PushTemporary, i);
      return 1;
    }
  }

  /*
     see if argument 
   */
  for(i = 0; i < argumentTop; i++)
  {
    if(strcmp(name, argumentNames[i]) == 0)
    {
      genInstruction(PushArgument, i);
      return 1;
    }
  }

  /*
     see if super 
   */
  if(strcmp(name, "super") == 0)
  {
    genInstruction(PushArgument, 0);
    superMessage = 1;
    return 1;
  }

  /*
     see if low constant 
   */
  for(i = 0; lowConstants[i]; i++)
  {
    if(strcmp(lowConstants[i], name) == 0)
    {
      genInstruction(PushConstant, 10 + i);
      return 1;
    }
  }

  /*
     see if instance variable 
   */
  if(currentClass)
  {
    int             low;

    i = lookupInstance(currentClass, name, &low);
    if(i >= 0)
    {
      genInstruction(PushInstance, i);
      return 1;
    }
  }

  /*
     see if global 
   */
  {
    struct object  *glob = lookupGlobal(name, 1);

    if(glob)
    {
      genInstruction(PushLiteral, addLiteral(glob));
      return 1;
    }
  }

  return (parseError("unknown identifier"));
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x39905(%rip), %eax     # 0x3c4d0
jge 0x2c16
movq 0x18(%rsp), %rdi
movslq 0x14(%rsp), %rcx
leaq 0x38952(%rip), %rax     # 0x3b530
movq (%rax,%rcx,8), %rsi
callq 0x10c0
cmpl $0x0, %eax
jne 0x2c07
movl 0x14(%rsp), %esi
movl $0x3, %edi
callq 0x1f80
movl $0x1, 0x24(%rsp)
jmp 0x2da4
jmp 0x2c09
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x2bc1
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x388f8(%rip), %eax     # 0x3b520
jge 0x2c73
movq 0x18(%rsp), %rdi
movslq 0x14(%rsp), %rcx
leaq 0x387f5(%rip), %rax     # 0x3b430
movq (%rax,%rcx,8), %rsi
callq 0x10c0
cmpl $0x0, %eax
jne 0x2c64
movl 0x14(%rsp), %esi
movl $0x2, %edi
callq 0x1f80
movl $0x1, 0x24(%rsp)
jmp 0x2da4
jmp 0x2c66
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x2c1e
movq 0x18(%rsp), %rdi
leaq 0x3684(%rip), %rsi      # 0x6303
callq 0x10c0
cmpl $0x0, %eax
jne 0x2cac
movl $0x2, %edi
xorl %esi, %esi
callq 0x1f80
movl $0x1, 0x39889(%rip)     # 0x3c528
movl $0x1, 0x24(%rsp)
jmp 0x2da4
movl $0x0, 0x14(%rsp)
movslq 0x14(%rsp), %rcx
leaq 0x6400(%rip), %rax      # 0x90c0
cmpq $0x0, (%rax,%rcx,8)
je 0x2d13
movslq 0x14(%rsp), %rcx
leaq 0x63ed(%rip), %rax      # 0x90c0
movq (%rax,%rcx,8), %rdi
movq 0x18(%rsp), %rsi
callq 0x10c0
cmpl $0x0, %eax
jne 0x2d04
movl 0x14(%rsp), %esi
addl $0xa, %esi
movl $0x5, %edi
callq 0x1f80
movl $0x1, 0x24(%rsp)
jmp 0x2da4
jmp 0x2d06
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x2cb4
cmpq $0x0, 0x39815(%rip)     # 0x3c530
je 0x2d58
movq 0x3980c(%rip), %rdi     # 0x3c530
movq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x2a70
movl %eax, 0x14(%rsp)
cmpl $0x0, 0x14(%rsp)
jl 0x2d56
movl 0x14(%rsp), %esi
movl $0x1, %edi
callq 0x1f80
movl $0x1, 0x24(%rsp)
jmp 0x2da4
jmp 0x2d58
movq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0x1470
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x2d94
movq 0x8(%rsp), %rdi
callq 0x2040
movl %eax, %esi
movl $0x4, %edi
callq 0x1f80
movl $0x1, 0x24(%rsp)
jmp 0x2da4
leaq 0x356e(%rip), %rdi      # 0x6309
callq 0x1350
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)