// File: /workspace/github_c_makefile_star2_O1/simh[P]simtools/crossassemblers/macro7/macro7.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( isdone( line[lexstart] ) || line[lexstart] == ')' )
    {
      return( value );
    }

    /* Interpret space as add */
    symt = getExpr();
    temp = symt->val & 0777777;
    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(( clc & 060000) == ( temp & 060000))
        {
          value += ( temp & ADDRESS_FIELD );        /* In range 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                                                 */
            value += ( INDIRECT_BIT | insertLiteral( &cp, clc, temp & 077777));
            indirect_generated = TRUE;
          }
        }
        break;
      }
      break;

    default:
        value = value + temp;          /* Normal 18 bit value.                */
        if( value >= 0777777 ) value = ( value + 1 ) & 0777777;
        break;
    }
  } /* end while                                                              */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x396c
movl 0x5fb7(%rip), %ebx      # 0x9fa4
movl 0x5fa5(%rip), %ebp      # 0x9f98
leaq 0xffa6(%rip), %r12      # 0x13fa0
orl $0x2, %ebp
leaq 0x5e3c(%rip), %r14      # 0x9e40
leaq 0x5f91(%rip), %r15      # 0x9f9c
movabsq $0x820000000601, %r13   # imm = 0x820000000601
movslq 0x10104(%rip), %rax     # 0x14120
movzbl (%rax,%r12), %eax
cmpq $0x2f, %rax
ja 0x4031
btq %rax, %r13
jb 0x411c
callq 0x396c
movl 0x5f68(%rip), %eax      # 0x9fa4
cmpl $0x7, %ebp
jne 0x40b0
movl 0x5f51(%rip), %ecx      # 0x9f98
orl $0x2, %ecx
cmpl $0x7, %ecx
je 0x4078
movl 0x830b(%rip), %ecx      # 0xc360
xorl %eax, %ecx
testl $0x6000, %ecx           # imm = 0x6000
je 0x4081
btl $0xd, %ebx
jae 0x408a
movl 0x100cd(%rip), %edx     # 0x14138
movq %r14, %rdi
movq %r15, %rsi
callq 0x3e73
jmp 0x4015
andl $0x3ffff, %eax          # imm = 0x3FFFF
orl %eax, %ebx
jmp 0x4015
andl $0x1fff, %eax           # imm = 0x1FFF
addl %eax, %ebx
jmp 0x4015
andl $0x7fff, %eax           # imm = 0x7FFF
movslq 0x82d2(%rip), %rcx      # 0xc368
cmpq $0x1eff, %rcx           # imm = 0x1EFF
jg 0x40f5
cmpl %eax, 0xfed3(%rip)      # 0x13f78
jne 0x40ce
movl $0x1eff, %edx           # imm = 0x1EFF
xorl %esi, %esi
jmp 0x40f0
movl $0x3ffff, %ecx          # imm = 0x3FFFF
andl %ecx, %eax
addl %eax, %ebx
cmpl %ecx, %ebx
jl 0x4015
incl %ebx
andl $0x3ffff, %ebx          # imm = 0x3FFFF
jmp 0x4015
movl $0x1eff, %edi           # imm = 0x1EFF
cmpq %rcx, %rdi
setle %sil
jle 0x40f5
leaq -0x1(%rdi), %rdx
leaq 0x8291(%rip), %r8       # 0xc378
cmpl %eax, (%r8,%rdi,4)
movq %rdx, %rdi
jne 0x40d3
testb %sil, %sil
je 0x4108
leal -0x1(%rcx), %edx
movl %edx, 0x826a(%rip)      # 0xc368
leaq 0x8273(%rip), %rsi      # 0xc378
movl %eax, (%rsi,%rcx,4)
orl $0x2000, %edx           # imm = 0x2000
addl %edx, %ebx
movb $0x1, 0x101ad(%rip)     # 0x142c4
jmp 0x4015
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq