// File: /workspace/github_c_makefile_star2_O3/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 0x3bf8
movq 0x8788(%rip), %rbx      # 0xcbc8
movl 0x8772(%rip), %ebp      # 0xcbb8
leaq 0x143d3(%rip), %r13     # 0x18820
orl $0x2, %ebp
leaq 0x85b9(%rip), %r15      # 0xca10
leaq 0x875e(%rip), %r12      # 0xcbbc
movabsq $0x800820000000401, %r14 # imm = 0x800820000000401
movq 0x14799(%rip), %rax     # 0x18c08
movzbl (%rax,%r13), %eax
cmpq $0x3b, %rax
ja 0x4484
btq %rax, %r14
jb 0x45cd
cmpl $0x5d, %eax
je 0x45cd
callq 0x3bf8
movq 0x872f(%rip), %rax      # 0xcbc8
movl %eax, %edx
andl $0xfff, %edx            # imm = 0xFFF
cmpl $0x7, %ebp
jne 0x4501
movl 0x870c(%rip), %ecx      # 0xcbb8
orl $0x2, %ecx
cmpl $0x7, %ecx
je 0x4501
cmpl $0x7f, %edx
jbe 0x4501
movq 0x12b08(%rip), %rcx     # 0x16fc8
addq 0x12af9(%rip), %rcx     # 0x16fc0
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 0x4509
btl $0x8, %ebx
jae 0x451b
movq 0x14737(%rip), %rdx     # 0x18c28
movq %r15, %rdi
movq %r12, %rsi
callq 0x42b6
jmp 0x4468
orq %rdx, %rbx
jmp 0x4468
movzbl %al, %eax
orq %rax, %rbx
orq $0x80, %rbx
jmp 0x4468
movl 0x12a97(%rip), %eax     # 0x16fb8
shrl $0x7, %eax
movzbl %al, %ecx
leal (,%rcx,8), %eax
leaq 0x1329b(%rip), %rsi     # 0x177d0
movq (%rax,%rsi), %rsi
leaq 0x12a90(%rip), %rdi     # 0x16fd0
movq (%rax,%rdi), %rax
cmpq %rax, %rsi
jge 0x4562
movq %rsi, %rdi
leaq 0x13e95(%rip), %r8      # 0x183e8
cmpq %rdx, 0x8(%r8,%rdi,8)
je 0x457d
incq %rdi
cmpq %rdi, %rax
jne 0x454c
movq 0x12a47(%rip), %rsi     # 0x16fb0
leaq 0x13a70(%rip), %rdi     # 0x17fe0
callq 0x5812
orq $0x180, %rax            # imm = 0x180
jmp 0x45be
leaq 0x13e64(%rip), %rdi     # 0x183e8
leaq (%rdi,%rax,8), %rdi
cmpq %rsi, %rax
jle 0x459e
decq %rax
leaq -0x8(%rdi), %r8
cmpq %rdx, (%rdi)
movq %r8, %rdi
jne 0x4588
jmp 0x45b8
leaq -0x1(%rsi), %rax
leaq 0x13227(%rip), %rdi     # 0x177d0
movq %rax, (%rdi,%rcx,8)
leaq 0x13e34(%rip), %rcx     # 0x183e8
movq %rdx, (%rcx,%rsi,8)
orq $0x100, %rax            # imm = 0x100
orq %rax, %rbx
movb $0x1, 0x14a68(%rip)     # 0x19030
jmp 0x4468
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq