// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/ldscript.c
// Function: symbol_assignment
static void symbol_assignment(struct GlobalVars *gv,
                              char *symname,uint8_t symflags)
{
  char *fn = "symbol_assignment(): ";
  struct LinkedSection *cls = current_ls;
  struct MemoryDescr *md = cls ? cls->relocmem : vdefmem;
  struct Symbol *sym;
  lword expr_val;

  if (!strcmp(symname,".")) {
    if (level >= 1) {
      if (!preparse) {
        if (!(symflags & SYMF_PROVIDED)) {
          parse_expr(md->current,&expr_val);
          change_address(md,expr_val);
        }
        else {
          /* Address symbol '.' cannot be provided */
          error(108,scriptname,getlineno());
        }
      }
    }
    else {
      /* Address symbol '.' invalid outside SECTIONS block */
      error(101,scriptname,getlineno());
    }
  }

  else {
    /* real symbol assignment */

    if (level < 1) {
      if (preparse) {   /* level 0 (outside SECTION) is only parsed once! */
        if (parse_expr(-1,&expr_val)) {
          scriptsymbol(gv,symname,expr_val,SYM_ABS,symflags);
        }
        else {
          /* Only absolute expr. may be assigned outside SECTIONS block */
          error(110,scriptname,getlineno());
        }
      }
    }

    else {
      if (preparse) {
        scriptsymbol(gv,symname,0,SYM_ABS,symflags);
      }
      else {
        if (sym = findsymbol(gv,NULL,symname)) {
          int abs = parse_expr(md->current,&expr_val);

          if (level < 2)
            abs = 1;
          sym->type = abs ? SYM_ABS : SYM_RELOC;
          if (!abs) {
            if (current_ls) {
              /* assign section and remove from scriptsymbol list,
                 will be moved into section's symbol list in linker_copy() */
              if (listempty(&current_ls->sections)) {
                sym->relsect = get_dummy_sec(current_ls->name);
                /* a section with symbols must be allocated? @@@ */
                current_ls->flags |= SF_ALLOC;
              }
              else
                sym->relsect = (struct Section *)current_ls->sections.first;
              remnode(&sym->n);
            }
            else
              ierror("%sNo current LinkedSection set, while "
                     "defining %s",fn,symname);
          }
          sym->value = abs ? expr_val : (expr_val - current_ls->base);
        }
        else
          ierror("%s%s disappeared",fn,symname);
      }
    }
  }

  skip_expr(symflags&SYMF_PROVIDED);
}

// Assembly:
subq $0x78, %rsp
movb %dl, %al
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movb %al, 0x67(%rsp)
leaq 0x201fe(%rip), %rax     # 0x35c29
movq %rax, 0x58(%rsp)
movq 0x2efa1(%rip), %rax     # 0x449d8
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x50(%rsp)
je 0x15a54
movq 0x50(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x28(%rsp)
jmp 0x15a60
movq 0x2efad(%rip), %rax     # 0x44a08
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x68(%rsp), %rdi
leaq 0x1e58e(%rip), %rsi     # 0x34004
callq 0x5130
cmpl $0x0, %eax
jne 0x15b18
cmpl $0x1, 0x2ef61(%rip)     # 0x449ec
jl 0x15aef
cmpl $0x0, 0x2ef9c(%rip)     # 0x44a30
jne 0x15aed
movzbl 0x67(%rsp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x15ac7
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rdi
leaq 0x38(%rsp), %rsi
callq 0x18a10
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x16a60
jmp 0x15aeb
movq 0x2ef22(%rip), %rax     # 0x449f0
movq %rax, 0x20(%rsp)
callq 0x18f50
movq 0x20(%rsp), %rsi
movl %eax, %edx
movl $0x6c, %edi
movb $0x0, %al
callq 0x8c00
jmp 0x15aed
jmp 0x15b13
movq 0x2eefa(%rip), %rax     # 0x449f0
movq %rax, 0x18(%rsp)
callq 0x18f50
movq 0x18(%rsp), %rsi
movl %eax, %edx
movl $0x65, %edi
movb $0x0, %al
callq 0x8c00
jmp 0x15d05
cmpl $0x1, 0x2eecd(%rip)     # 0x449ec
jge 0x15b8c
cmpl $0x0, 0x2ef08(%rip)     # 0x44a30
je 0x15b87
movq $-0x1, %rdi
leaq 0x38(%rsp), %rsi
callq 0x18a10
cmpl $0x0, %eax
je 0x15b61
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x38(%rsp), %rdx
movl $0x1, %ecx
movzbl 0x67(%rsp), %r8d
callq 0x18160
jmp 0x15b85
movq 0x2ee88(%rip), %rax     # 0x449f0
movq %rax, 0x10(%rsp)
callq 0x18f50
movq 0x10(%rsp), %rsi
movl %eax, %edx
movl $0x6e, %edi
movb $0x0, %al
callq 0x8c00
jmp 0x15b87
jmp 0x15d03
cmpl $0x0, 0x2ee9d(%rip)     # 0x44a30
je 0x15bb8
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
movzbl 0x67(%rsp), %r8d
callq 0x18160
jmp 0x15d01
movq 0x70(%rsp), %rdi
movq 0x68(%rsp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0xf580
movq %rax, 0x40(%rsp)
cmpq $0x0, %rax
je 0x15ce7
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rdi
leaq 0x38(%rsp), %rsi
callq 0x18a10
movl %eax, 0x34(%rsp)
cmpl $0x2, 0x2edf4(%rip)     # 0x449ec
jge 0x15c02
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %edx
movl $0x2, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, %cl
movq 0x40(%rsp), %rax
movb %cl, 0x40(%rax)
cmpl $0x0, 0x34(%rsp)
jne 0x15caf
cmpq $0x0, 0x2eda5(%rip)     # 0x449d8
je 0x15c95
movq 0x2ed9c(%rip), %rax     # 0x449d8
movq 0x60(%rax), %rax
cmpq $0x0, (%rax)
jne 0x15c75
movq 0x2ed8b(%rip), %rax     # 0x449d8
movq 0x18(%rax), %rdi
callq 0x182e0
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x2ed6f(%rip), %rax     # 0x449d8
movzbl 0x21(%rax), %ecx
orl $0x1, %ecx
movb %cl, 0x21(%rax)
jmp 0x15c89
movq 0x2ed5c(%rip), %rax     # 0x449d8
movq 0x60(%rax), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x40(%rsp), %rdi
callq 0x7530
jmp 0x15cad
movq 0x58(%rsp), %rsi
movq 0x68(%rsp), %rdx
leaq 0x1ff99(%rip), %rdi     # 0x35c3f
movb $0x0, %al
callq 0x8ae0
jmp 0x15caf
cmpl $0x0, 0x34(%rsp)
je 0x15cc2
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x15cd7
movq 0x38(%rsp), %rax
movq 0x2ed0a(%rip), %rcx     # 0x449d8
subq 0x40(%rcx), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x30(%rax)
jmp 0x15cff
movq 0x58(%rsp), %rsi
movq 0x68(%rsp), %rdx
leaq 0x1ff79(%rip), %rdi     # 0x35c71
movb $0x0, %al
callq 0x8ae0
jmp 0x15d01
jmp 0x15d03
jmp 0x15d05
movzbl 0x67(%rsp), %edi
andl $0x8, %edi
callq 0x14f40
addq $0x78, %rsp
retq
nopw (%rax,%rax)