// File: /workspace/github_c_makefile_star2_O1/AK6DN[P]dec-utilities-for-pdp/macro8x/macro8x.c
// Function: getExprs
WORD32 getExprs()
{
  SYM_T  *symv;
  SYM_T  *symt;
  WORD32  temp;
  SYMTYP  temp_type;
  WORD32  value;
  SYMTYP  value_type;

  symv = getExpr();
  value = symv->val;
  value_type = symv->type;

  while( TRUE )
  {
    if( is_done( line[lexstart] ))
    {
      return( value );
    }
    switch( line[lexstart] )
    {
    case ')':
    case ']':
      return( value );

    default:
      break;
    }

    /* Interpret space as logical or                                          */
    symt = getExpr();
    temp = symt->val & 07777;
    temp_type = symt->type;

    switch( value_type )
    {
    case MRI:
    case MRIFIX:
      /* Previous symbol was a Memory Reference Instruction.                  */
      switch( temp_type )
      {
      case MRI:
      case MRIFIX:
        /* Current symbol is also a Memory Reference Instruction.             */
        value |= temp;          /* Just OR the MRI instructions.              */
        break;

      default:
        /* Now have the address part of the MRI instruction.                  */
        if( temp < 00200 )
        {
          value |= temp;        /* Page zero MRI.                             */
        }
        else if( (( fieldlc + reloc ) & 07600 ) <= temp
             && temp <= (( fieldlc + reloc ) | 0177 ))
        {
          value |= ( PAGE_BIT | (temp & ADDRESS_FIELD )); /* Current page MRI */
        }
        else
        {
          if(( value & INDIRECT_BIT ) == INDIRECT_BIT )
          {
            /* Already indirect, can't generate                               */
            errorSymbol( &illegal_indirect, symt->name, lexstartprev );
          }
          else
          {
            /* Now fix off page reference.                                    */
            /* Search current page literal pool for needed value.             */
            /* Set Indirect Current Page                                      */
            if( testZeroPool( temp ))
            {
              value |= ( 00400 | insertLiteral( &pz, field, temp ));
            }
            else
            {
              value |= ( 00600 | insertLiteral( &cp, clc, temp ));
            }
            indirect_generated = TRUE;
          }
        }
        break;
      }
      break;

    default:
        value |= temp;          /* Normal 12 bit value.                       */
        break;
    }
  } /* end while                                                              */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x3bea
movq 0x7796(%rip), %rbx      # 0xbbc8
movl 0x7780(%rip), %ebp      # 0xbbb8
leaq 0x133e1(%rip), %r15     # 0x17820
orl $0x2, %ebp
leaq 0x75c7(%rip), %r12      # 0xba10
leaq 0x776c(%rip), %r13      # 0xbbbc
movabsq $0x800820000000401, %r14 # imm = 0x800820000000401
movq 0x137a7(%rip), %rax     # 0x17c08
movzbl (%rax,%r15), %eax
cmpq $0x3b, %rax
ja 0x4476
btq %rax, %r14
jb 0x4585
cmpl $0x5d, %eax
je 0x4585
callq 0x3bea
movq 0x773d(%rip), %rax      # 0xbbc8
movl %eax, %edx
andl $0xfff, %edx            # imm = 0xFFF
cmpl $0x7, %ebp
jne 0x44f3
movl 0x771a(%rip), %ecx      # 0xbbb8
orl $0x2, %ecx
cmpl $0x7, %ecx
je 0x44f3
cmpl $0x7f, %edx
jbe 0x44f3
movq 0x11b16(%rip), %rcx     # 0x15fc8
addq 0x11b07(%rip), %rcx     # 0x15fc0
movl %ecx, %esi
andl $0xf80, %esi            # imm = 0xF80
cmpl %edx, %esi
seta %sil
orq $0x7f, %rcx
cmpq %rcx, %rdx
setg %cl
orb %sil, %cl
je 0x44fb
btl $0x8, %ebx
jae 0x450d
movq 0x13745(%rip), %rdx     # 0x17c28
movq %r12, %rdi
movq %r13, %rsi
callq 0x42a8
jmp 0x445a
orq %rdx, %rbx
jmp 0x445a
movzbl %al, %eax
orq %rax, %rbx
orq $0x80, %rbx
jmp 0x445a
movq 0x11aa4(%rip), %rsi     # 0x15fb8
movl %esi, %ecx
shrl $0x4, %ecx
andl $0x7f8, %ecx            # imm = 0x7F8
leaq 0x122aa(%rip), %rax     # 0x167d0
movq (%rcx,%rax), %rax
leaq 0x11a9f(%rip), %rdi     # 0x15fd0
movq (%rcx,%rdi), %rcx
cmpq %rcx, %rax
leaq 0x12ea9(%rip), %rdi     # 0x173e8
jge 0x4550
cmpq %rdx, 0x8(%rdi,%rax,8)
je 0x456b
incq %rax
cmpq %rax, %rcx
jne 0x4541
movq 0x11a59(%rip), %rsi     # 0x15fb0
leaq 0x12a82(%rip), %rdi     # 0x16fe0
callq 0x5790
orq $0x180, %rax            # imm = 0x180
jmp 0x4576
callq 0x5790
orq $0x100, %rax            # imm = 0x100
orq %rax, %rbx
movb $0x1, 0x13ab0(%rip)     # 0x18030
jmp 0x445a
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq