// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/crossassemblers/macro7/macro7.c
// Function: getExpr
SYM_T *getExpr()
{
  delimiter = line[lexterm];

  if( line[lexstart] == '-' )
  {
    nextLexBlank();
    sym_getexpr = *(eval());
    sym_getexpr.val = sym_getexpr.val ^ 0777777;
  }
  else
  {
    sym_getexpr = *(eval());
  }


  if( is_blank( delimiter ))
  {
    return( &sym_getexpr );
  }

  /* Here we assume the current lexeme is the operator separating the         */
  /* previous operator from the next, if any.                                 */
  while( TRUE )
  {
    /* assert line[lexstart] == delimiter                                     */
    if( is_blank( delimiter ))
    {
      return( &sym_getexpr );
    }

    switch( line[lexstart] )
    {
    case '+':                   /* add                                        */
      nextLexBlank();           /* skip over the operator                     */
      sym_getexpr.val += (eval())->val;
      if( sym_getexpr.val >= 01000000 )
      {
        sym_getexpr.val = ( sym_getexpr.val + 1 ) & 0777777;
      }
      break;

    case '-':                   /* subtract                                   */
      nextLexBlank();           /* skip over the operator                     */
      sym_getexpr.val = sym_getexpr.val +
        ( (eval())->val ^ 0777777 );
      if( sym_getexpr.val >= 01000000 )
      {
        sym_getexpr.val = ( sym_getexpr.val + 1 ) & 0777777;
      }
      break;

    case '^':                   /* multiply                                   */
      nextLexBlank();           /* skip over the operator                     */
      sym_getexpr.val *= (eval())->val;
      break;

    case '%':                   /* divide                                     */
      nextLexBlank();           /* skip over the operator                     */
      sym_getexpr.val /= (eval())->val;
      break;

    case '&':                   /* and                                        */
      nextLexBlank();           /* skip over the operator                     */
      sym_getexpr.val &= (eval())->val;
      break;

    case '!':                   /* or                                         */
      nextLexBlank();           /* skip over the operator                     */
      sym_getexpr.val |= (eval())->val;
      break;

    default:
      if( isend( line[lexstart] ))
      {
        return( &sym_getexpr );
      }

      switch( line[lexstart] )
      {
      case '/':
      case '\t':
      case ')':
      case '<':
      case ':':
      case ',':
        break;

      case '=':
        errorMessage( &illegal_equals, lexstart );
        moveToEndOfLine();
        sym_getexpr.val = 0;
        break;

      default:
        errorMessage( &illegal_expression, lexstart );
        moveToEndOfLine();
        sym_getexpr.val = 0;
        break;
      }
      return( &sym_getexpr );
    }
  } /* end while                                                              */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movslq 0x10944(%rip), %rax     # 0x14120
leaq 0x107ad(%rip), %rbx     # 0x13f90
movb (%rax,%rbx), %al
movb %al, 0x10938(%rip)      # 0x14124
movslq 0x1091d(%rip), %rax     # 0x14110
cmpb $0x2d, (%rax,%rbx)
jne 0x3824
callq 0x3d4f
callq 0x468f
movups (%rax), %xmm0
movups %xmm0, 0x677b(%rip)     # 0x9f88
movq 0x10(%rax), %rax
movq %rax, 0x6780(%rip)      # 0x9f98
xorl $0x3ffff, 0x6772(%rip)  # imm = 0x3FFFF
jmp 0x383e
callq 0x468f
movups (%rax), %xmm0
movups %xmm0, 0x6755(%rip)     # 0x9f88
movq 0x10(%rax), %rax
movq %rax, 0x675a(%rip)      # 0x9f98
movzbl 0x108df(%rip), %eax     # 0x14124
movabsq $0x4000000100001000, %r14 # imm = 0x4000000100001000
cmpq $0x3e, %rax
ja 0x386b
btq %rax, %r14
jae 0x386b
leaq 0x6726(%rip), %rax      # 0x9f88
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x279e(%rip), %r15      # 0x6010
movl $0x3ffff, %ebp          # imm = 0x3FFFF
cmpb $0x3e, %al
ja 0x3884
movzbl %al, %eax
btq %rax, %r14
jb 0x385b
movslq 0x10885(%rip), %rsi     # 0x14110
movzbl (%rsi,%rbx), %eax
leal -0x25(%rax), %ecx
cmpl $0x18, %ecx
ja 0x38bc
movslq (%r15,%rcx,4), %rax
addq %r15, %rax
jmpq *%rax
callq 0x3d4f
callq 0x468f
movq %rax, %rcx
movl 0x66e1(%rip), %eax      # 0x9f94
cltd
idivl 0xc(%rcx)
jmp 0x395c
cmpl $0x21, %eax
je 0x3946
cmpl $0x5e, %eax
jne 0x396d
callq 0x3d4f
callq 0x468f
movq %rax, %rcx
movl 0x66b3(%rip), %eax      # 0x9f94
imull 0xc(%rcx), %eax
jmp 0x395c
callq 0x3d4f
movl 0x66a1(%rip), %r12d     # 0x9f94
callq 0x468f
movl 0xc(%rax), %eax
xorl %ebp, %eax
addl %r12d, %eax
jmp 0x3930
callq 0x3d4f
callq 0x468f
movq %rax, %rcx
movl 0x667f(%rip), %eax      # 0x9f94
andl 0xc(%rcx), %eax
jmp 0x395c
callq 0x3d4f
callq 0x468f
movq %rax, %rcx
movl 0x6667(%rip), %eax      # 0x9f94
addl 0xc(%rcx), %eax
movl %eax, 0x665e(%rip)      # 0x9f94
cmpl $0x40000, %eax          # imm = 0x40000
jl 0x3962
incl %eax
andl $0x3ffff, %eax          # imm = 0x3FFFF
jmp 0x395c
callq 0x3d4f
callq 0x468f
movq %rax, %rcx
movl 0x663b(%rip), %eax      # 0x9f94
orl 0xc(%rcx), %eax
movl %eax, 0x6632(%rip)      # 0x9f94
movb 0x107bc(%rip), %al      # 0x14124
jmp 0x3877
leal -0x9(%rax), %ecx
cmpl $0x2, %ecx
jb 0x385b
testl %eax, %eax
je 0x385b
leaq 0x6448(%rip), %rdi      # 0x9dd0
jmp 0x3991
leaq 0x648f(%rip), %rdi      # 0x9e20
callq 0x4944
callq 0x49c5
andl $0x0, 0x65f2(%rip)      # 0x9f94
jmp 0x385b