// File: /workspace/github_c_makefile_star2_O3/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 0x3963
movl 0x5fd2(%rip), %ebx      # 0x9fa4
movl 0x5fc0(%rip), %ebp      # 0x9f98
leaq 0xffc1(%rip), %r12      # 0x13fa0
orl $0x2, %ebp
leaq 0x5e57(%rip), %r14      # 0x9e40
leaq 0x5fac(%rip), %r15      # 0x9f9c
movabsq $0x820000000601, %r13   # imm = 0x820000000601
movslq 0x1011f(%rip), %rax     # 0x14120
movzbl (%rax,%r12), %eax
cmpq $0x2f, %rax
ja 0x4016
btq %rax, %r13
jb 0x40ea
callq 0x3963
movl 0x5f83(%rip), %eax      # 0x9fa4
cmpl $0x7, %ebp
jne 0x40b6
movl 0x5f68(%rip), %ecx      # 0x9f98
orl $0x2, %ecx
cmpl $0x7, %ecx
je 0x4061
movl 0x8322(%rip), %ecx      # 0xc360
xorl %eax, %ecx
testl $0x6000, %ecx           # imm = 0x6000
je 0x406a
btl $0xd, %ebx
jae 0x4073
movl 0x100e4(%rip), %edx     # 0x14138
movq %r14, %rdi
movq %r15, %rsi
callq 0x3e58
jmp 0x3ffa
andl $0x3ffff, %eax          # imm = 0x3FFFF
orl %eax, %ebx
jmp 0x3ffa
andl $0x1fff, %eax           # imm = 0x1FFF
addl %eax, %ebx
jmp 0x3ffa
andl $0x7fff, %eax           # imm = 0x7FFF
movslq 0x82e9(%rip), %rdx      # 0xc368
cmpq $0x1eff, %rdx           # imm = 0x1EFF
jg 0x40a1
movl $0x1f00, %ecx           # imm = 0x1F00
leaq 0x82e4(%rip), %rsi      # 0xc378
cmpl %eax, (%rsi,%rcx,4)
je 0x40d4
decq %rcx
cmpq %rdx, %rcx
jg 0x408d
leal -0x1(%rdx), %ecx
movl %ecx, 0x82be(%rip)      # 0xc368
leaq 0x82c7(%rip), %rsi      # 0xc378
movl %eax, (%rsi,%rdx,4)
jmp 0x40d6
movl $0x3ffff, %ecx          # imm = 0x3FFFF
andl %ecx, %eax
addl %eax, %ebx
cmpl %ecx, %ebx
jl 0x3ffa
incl %ebx
andl $0x3ffff, %ebx          # imm = 0x3FFFF
jmp 0x3ffa
decl %ecx
orl $0x2000, %ecx           # imm = 0x2000
addl %ecx, %ebx
movb $0x1, 0x101df(%rip)     # 0x142c4
jmp 0x3ffa
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq