// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]vlink/expr.c
// Function: primary_expr
static struct Expr *primary_expr(void)
{
  lword val = 0;
  int type = ABS;
  struct Expr *new;

  if (*s == '(') {
    s++;
    skip();
    new = expression();
    if (*s != ')')
      error(66,scriptname,line,')');  /* ')' expected */
    else
      s++;
    skip();
    return new;
  }

  if (isdigit((unsigned char)*s)) {
    /* octal, decimal or hex constant */
    if (s[0]=='0' && (s[1]=='x' || s[1]=='X')) {
      s += 2;
      while (isxdigit((unsigned char)*s)) {
        if (*s>='0' && *s<='9')
          val = (val<<4) + *s++ - '0';
        else if (*s>='a' && *s<='f')
          val = (val<<4) + *s++ - 'a' + 10;
        else
          val = (val<<4) + *s++ - 'A' + 10;
      }
    }
    else {
      int base = (*s=='0') ? 8 : 10;

      while (*s>='0' && *s<('0'+base)) {
        val = base*val + *s++ - '0';
      }
    }

    if (toupper((unsigned char)*s) == 'K') {
      val <<= 10;
      s++;
    }
    else if (toupper((unsigned char)*s) == 'M') {
      val <<= 20;
      s++;
    }
  }

  else {
    char *word;

    if (word = getarg(1)) {
      if (word[0]=='.' && word[1]=='\0') {  /* current address symbol '.' */
        if (caddr != -1) {
          if (caddr != -2) {
            val = caddr;
            type = REL;
          }
        }
        else {
          /* Address symbol '.' invalid outside SECTIONS block */
          error(101,scriptname,line);
        }
      }
      else {  /* otherwise it's possibly a function- or symbol-name */
        struct Symbol *sym;

        if (sym = findsymbol(gv,NULL,word)) {
          if (caddr==-1 && sym->type!=SYM_ABS) {
            /* Reference to non-absolute symbol */
            error(102,scriptname,line,sym->name);
          }
          else if (caddr != -2) {
            if (sym->type == SYM_ABS) {
              val = sym->value;
            }
            else if (sym->type==SYM_RELOC && sym->relsect->lnksec!=NULL) {
              val = (lword)sym->relsect->va + sym->value;
              type = REL;
            }
            else {
              /* Symbol is not yet assigned */
              error(106,scriptname,line,sym->name);
            }
          }
        }
        else {
          struct ScriptFunc *sfptr;

          for (sfptr=ldFunctions; sfptr->name; sfptr++) {
            if (!strcmp(sfptr->name,word))
              break;
          }
          if (sfptr->name) {
            if (caddr == -2) {
              if (getchr() == '(')
                skipblock(1,'(',')');
              else
                back(1);
            }
            else if (caddr != -1)
              type = sfptr->funcptr(gv,caddr,&val) ? ABS : REL;
            else
              error(105,scriptname,line);  /* No function-calls allowed here */
          }
          else
            error(104,scriptname,line,word);  /* Unknown symbol or function */
        }
      }
    }
    else
      error(78,scriptname,line);   /* missing argument */
  }

  skip();
  new = new_expr();
  new->type = type;
  new->val = val;
  return new;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq $0x0, 0x8(%rsp)
movq 0x22bcc(%rip), %rbx     # 0x33690
movzbl (%rbx), %r14d
cmpq $0x28, %r14
jne 0x10b04
incq %rbx
movq %rbx, 0x22bb8(%rip)     # 0x33690
callq 0xffd0
callq 0x10235
movq %rax, %rbx
movq 0x22ba4(%rip), %rax     # 0x33690
cmpb $0x29, (%rax)
jne 0x10bab
incq %rax
movq %rax, 0x22b91(%rip)     # 0x33690
jmp 0x10bc9
callq 0x5290
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r14,2)
jne 0x10bd3
movl $0x1, %edi
callq 0x100e6
testq %rax, %rax
je 0x10c78
movq %rax, %rbx
cmpb $0x2e, (%rax)
jne 0x10b3d
cmpb $0x0, 0x1(%rbx)
je 0x10dd0
movq 0x22d64(%rip), %rdi     # 0x338a8
xorl %esi, %esi
movq %rbx, %rdx
callq 0xa82c
testq %rax, %rax
je 0x10c93
movl $0x15, %ebp
movq 0x22d3d(%rip), %rcx     # 0x338a0
cmpq $-0x2, %rcx
je 0x10da0
cmpq $-0x1, %rcx
jne 0x10b87
cmpb $0x1, 0x40(%rax)
jne 0x10e03
cmpq $-0x2, %rcx
je 0x10da0
movzbl 0x40(%rax), %ecx
cmpl $0x2, %ecx
je 0x10e1b
cmpl $0x1, %ecx
jne 0x10e3d
movq 0x30(%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0x10da0
movq 0x22cfe(%rip), %rsi     # 0x338b0
movl 0x22ae0(%rip), %edx     # 0x33698
movl $0x42, %edi
movl $0x29, %ecx
xorl %eax, %eax
callq 0x6f84
callq 0xffd0
jmp 0x10dc4
movl $0xa, %edi
cmpl $0x30, %r14d
jne 0x10d0a
movzbl 0x1(%rbx), %ecx
orl $0x20, %ecx
cmpl $0x78, %ecx
jne 0x10d05
leaq 0x2(%rbx), %rcx
movq %rcx, 0x22a93(%rip)     # 0x33690
movzbl 0x2(%rbx), %esi
testb $0x10, 0x1(%rax,%rsi,2)
je 0x10d64
movq 0x8(%rsp), %rdx
leal -0x30(%rsi), %edi
cmpb $0x9, %dil
ja 0x10c35
shlq $0x4, %rdx
incq %rcx
movq %rcx, 0x22a68(%rip)     # 0x33690
movzbl %sil, %esi
addq %rsi, %rdx
addq $-0x30, %rdx
jmp 0x10c64
leal -0x61(%rsi), %edi
shlq $0x4, %rdx
incq %rcx
movq %rcx, 0x22a4a(%rip)     # 0x33690
cmpb $0x5, %dil
ja 0x10c59
movzbl %sil, %esi
addq %rsi, %rdx
addq $-0x57, %rdx
jmp 0x10c64
movsbq %sil, %rsi
addq %rsi, %rdx
addq $-0x37, %rdx
movq %rdx, 0x8(%rsp)
movzbl (%rcx), %esi
testb $0x10, 0x1(%rax,%rsi,2)
jne 0x10c11
jmp 0x10d64
movq 0x22c31(%rip), %rsi     # 0x338b0
movl 0x22a13(%rip), %edx     # 0x33698
movl $0x4e, %edi
xorl %eax, %eax
callq 0x6f84
jmp 0x10cfb
leaq 0x1e786(%rip), %r14     # 0x2f420
movq (%r14), %rdi
testq %rdi, %rdi
sete %bpl
je 0x10cdf
movq %rbx, %rsi
callq 0x5160
testl %eax, %eax
je 0x10cd6
leaq 0x1e767(%rip), %r14     # 0x2f420
movq 0x10(%r14), %rdi
testq %rdi, %rdi
sete %bpl
je 0x10cdf
addq $0x10, %r14
movq %rbx, %rsi
callq 0x5160
testl %eax, %eax
jne 0x10cb9
testb %bpl, %bpl
je 0x10e5f
movq 0x22bca(%rip), %rsi     # 0x338b0
movl 0x229ac(%rip), %edx     # 0x33698
movl $0x68, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6f84
movl $0x15, %ebp
jmp 0x10da0
movl $0x8, %edi
movl %edi, %eax
orl $0x30, %eax
movq 0x2297a(%rip), %rcx     # 0x33690
movb (%rcx), %dl
cmpb $0x30, %dl
setge %sil
movsbl %dl, %r8d
cmpl %r8d, %eax
setg %r8b
andb %sil, %r8b
cmpb $0x1, %r8b
jne 0x10d64
movq 0x8(%rsp), %rsi
movl %edi, %edi
imulq %rdi, %rsi
movzbl %dl, %edx
addq %rdx, %rsi
addq $-0x30, %rsi
movq %rsi, 0x8(%rsp)
movsbl 0x1(%rcx), %edx
incq %rcx
cmpl $0x30, %edx
jl 0x10d5d
cmpl %edx, %eax
jg 0x10d3a
movq %rcx, 0x2292c(%rip)     # 0x33690
callq 0x5030
movq (%rax), %rcx
movq 0x2291d(%rip), %rax     # 0x33690
movzbl (%rax), %edx
movl (%rcx,%rdx,4), %ecx
movl $0x15, %ebp
cmpl $0x4d, %ecx
je 0x10d90
cmpl $0x4b, %ecx
jne 0x10da0
shlq $0xa, 0x8(%rsp)
jmp 0x10d96
shlq $0x14, 0x8(%rsp)
incq %rax
movq %rax, 0x228f0(%rip)     # 0x33690
callq 0xffd0
movl $0x20, %edi
callq 0x6668
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movl %ebp, (%rax)
movq 0x8(%rsp), %rax
movq %rax, 0x18(%rbx)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl $0x15, %ebp
movq 0x22ac4(%rip), %rax     # 0x338a0
cmpq $-0x2, %rax
je 0x10da0
cmpq $-0x1, %rax
jne 0x10e2e
movq 0x22ac1(%rip), %rsi     # 0x338b0
movl 0x228a3(%rip), %edx     # 0x33698
movl $0x65, %edi
xorl %eax, %eax
callq 0x6f84
jmp 0x10da0
movq 0x22aa6(%rip), %rsi     # 0x338b0
movl 0x22888(%rip), %edx     # 0x33698
movq 0x20(%rax), %rcx
movl $0x66, %edi
jmp 0x10e53
movq 0x38(%rax), %rcx
cmpq $0x0, 0x18(%rcx)
je 0x10e3d
movq 0x30(%rax), %rax
addq 0x30(%rcx), %rax
movq %rax, 0x8(%rsp)
movl $0x16, %ebp
jmp 0x10da0
movq 0x22a6c(%rip), %rsi     # 0x338b0
movl 0x2284e(%rip), %edx     # 0x33698
movq 0x20(%rax), %rcx
movl $0x6a, %edi
xorl %eax, %eax
callq 0x6f84
jmp 0x10da0
movq 0x22a3a(%rip), %rsi     # 0x338a0
cmpq $-0x1, %rsi
je 0x10eab
cmpq $-0x2, %rsi
jne 0x10ec2
callq 0xffd0
movq 0x22812(%rip), %rcx     # 0x33690
movb (%rcx), %al
testb %al, %al
je 0x10edf
incq %rcx
movq %rcx, 0x22802(%rip)     # 0x33690
cmpb $0x28, %al
jne 0x10edf
movl $0x1, %edi
movl $0x28, %esi
movl $0x29, %edx
callq 0x1008e
jmp 0x10cfb
movq 0x229fe(%rip), %rsi     # 0x338b0
movl 0x227e0(%rip), %edx     # 0x33698
movl $0x69, %edi
jmp 0x10c8a
movq 0x229df(%rip), %rdi     # 0x338a8
leaq 0x8(%rsp), %rdx
callq *0x8(%r14)
xorl %ebp, %ebp
cmpl $0x1, %eax
adcl $0x15, %ebp
jmp 0x10da0
decq 0x227aa(%rip)           # 0x33690
jmp 0x10cfb
nop