// File: /workspace/github_c_makefile_star2_O2/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 0x3a7a
movq 0x79eb(%rip), %rbx      # 0xbbb8
movl 0x79d5(%rip), %ebp      # 0xbba8
leaq 0x13636(%rip), %r13     # 0x17810
orl $0x2, %ebp
leaq 0x781c(%rip), %r14      # 0xba00
leaq 0x79c1(%rip), %r15      # 0xbbac
movq 0x13a06(%rip), %rax     # 0x17bf8
movzbl (%rax,%r13), %eax
cmpq $0x3b, %rax
ja 0x4211
movabsq $0x800820000000401, %rcx # imm = 0x800820000000401
btq %rax, %rcx
jb 0x4311
cmpl $0x5d, %eax
je 0x4311
callq 0x3a7a
movq 0x7992(%rip), %rax      # 0xbbb8
movl %eax, %r12d
andl $0xfff, %r12d           # imm = 0xFFF
cmpl $0x7, %ebp
jne 0x4290
movl 0x796d(%rip), %ecx      # 0xbba8
orl $0x2, %ecx
cmpl $0x7, %ecx
je 0x4290
cmpl $0x7f, %r12d
jbe 0x4290
movq 0x11d68(%rip), %rcx     # 0x15fb8
addq 0x11d59(%rip), %rcx     # 0x15fb0
movl %ecx, %edx
andl $0xf80, %edx            # imm = 0xF80
cmpl %r12d, %edx
seta %dl
orq $0x7f, %rcx
cmpq %rcx, %r12
setg %cl
orb %dl, %cl
je 0x4298
btl $0x8, %ebx
jae 0x42aa
movq 0x13998(%rip), %rdx     # 0x17c18
movq %r14, %rdi
movq %r15, %rsi
callq 0x4043
jmp 0x41eb
orq %r12, %rbx
jmp 0x41eb
movzbl %al, %eax
orq %rax, %rbx
orq $0x80, %rbx
jmp 0x41eb
movq %r12, %rdi
callq 0x5294
xorl %r14d, %r14d
testb %al, %al
sete %r14b
leaq 0x13116(%rip), %rdi     # 0x173d8
leaq 0x12d07(%rip), %rax     # 0x16fd0
cmoveq %rax, %rdi
leaq 0x11cd4(%rip), %rax     # 0x15fa8
leaq 0x11cc5(%rip), %rcx     # 0x15fa0
cmoveq %rcx, %rax
shll $0x7, %r14d
movq (%rax), %rsi
movq %r12, %rdx
callq 0x52d9
orq %rbx, %r14
orq %rax, %r14
orq $0x100, %r14            # imm = 0x100
movb $0x1, 0x13d1e(%rip)     # 0x18020
movq %r14, %rbx
leaq 0x76f4(%rip), %r14      # 0xba00
jmp 0x41eb
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq