LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/errors.c
// Function: ierror
void ierror(char *errtxt,...)
/* display internal error and quit */
{
  struct GlobalVars *gv = &gvars;
  va_list vl;

  fprintf(stderr,"\nINTERNAL ERROR: ");
  va_start(vl,errtxt);
  vfprintf(stderr,errtxt,vl);
  va_end(vl);
  fprintf(stderr,".\nAborting.\n");
  gv->returncode = EXIT_FAILURE;
  cleanup(gv);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x6b91
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq 0x28458(%rip), %r12     # 0x2eff0
movq (%r12), %rcx
leaq 0x177cb(%rip), %rdi     # 0x1e36e
pushq $0x11
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
callq 0x5280
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rdx)
movq %r15, 0x10(%rdx)
movq (%r12), %rdi
movq %rbx, %rsi
callq 0x5240
movq (%r12), %rcx
leaq 0x17797(%rip), %rdi     # 0x1e380
pushq $0xc
popq %rsi
movq %r14, %rdx
callq 0x5280
leaq 0x2a38d(%rip), %rdi     # 0x30f88
movl $0x1, 0x11c(%rdi)
callq 0x53ac
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: getobjname
const char *getobjname(struct ObjectUnit *obj)
/* if library: return "file name(object name)" */
/* else: return "file name" */
{
  const char *fn = obj->lnkfile->filename;

  if (obj->lnkfile->type == ID_LIBARCH) {
    const char *on = obj->objname;
    if (strlen(fn)+strlen(on)+2 < FNAMEBUFSIZE) {
      sprintf(namebuf,"%s(%s)",fn,on);
      return (namebuf);
    }
  }
  return (fn);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x10(%rdi), %rax
movq 0x18(%rax), %rbx
cmpb $0x8, 0x39(%rax)
jne 0x6e78
movq 0x18(%rdi), %r14
movq %rbx, %rdi
callq 0x50e0
movq %rax, %r15
movq %r14, %rdi
callq 0x50e0
addq %r15, %rax
addq $-0x3fe, %rax           # imm = 0xFC02
cmpq $-0x400, %rax           # imm = 0xFC00
jb 0x6e78
leaq 0x2c382(%rip), %r15     # 0x331e0
leaq 0x1927b(%rip), %rsi     # 0x200e0
movq %r15, %rdi
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x5260
movq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: print_function_name
void print_function_name(struct Section *sec,unsigned long offs)
/* Try to determine the function to which the section offset */
/* belongs, by comparing with SYMI_FUNC-type symbol definitions. */
/* If this was successful and the current function is different */
/* from the last one printed, make an output to stderr. */
{
  static const char *infoname[] = { "", "object ", "function " };
  static struct Symbol *last_func=NULL;
  struct Symbol *sym,*func=NULL;
  int i;

  for (i=0; i<OBJSYMHTABSIZE; i++) {  /* scan all hash chains */
    for (sym=sec->obj->objsyms[i]; sym; sym=sym->obj_chain) {
      if (sym->relsect == sec) {
        if (sym->info <= SYMI_FUNC) {
          if (sym->type == SYM_RELOC) {
            if ((unsigned long)sym->value <= offs) {
              if (sym->size) {  /* size of function specified? */
                if ((unsigned long)(sym->value+sym->size) > offs) {
                  func = sym;
                  i = OBJSYMHTABSIZE;
                  break;  /* function found! */
                }
              }
              else {  /* no size - find nearest... */
                if (func) {
                  if (sym->value > func->value) {
                    if (func->bind<SYMB_GLOBAL || sym->bind>=SYMB_GLOBAL)
                      func = sym;
                  }
                }
                else
                  func = sym;
              }
            }
          }
        }
      }
    }
  }

  /* print function name */
  if (func && func!=last_func) {
    last_func = func;
    fprintf(stderr,"%s: In %s\"%s\":\n",getobjname(sec->obj),
            infoname[func->info],func->name);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rax
movq 0x10(%rdi), %rdi
movq 0x48(%rdi), %rcx
xorl %r14d, %r14d
pushq $0x20
popq %rdx
xorl %r8d, %r8d
cmpl $0x1f, %r8d
jg 0x6f23
movl %r8d, %r9d
leaq (%rcx,%r9,8), %r9
movq (%r9), %r9
testq %r9, %r9
je 0x6f1b
cmpq %rax, 0x38(%r9)
jne 0x6ecf
cmpb $0x2, 0x42(%r9)
ja 0x6ecf
cmpb $0x2, 0x40(%r9)
jne 0x6ecf
movq 0x30(%r9), %r11
cmpq %rsi, %r11
jbe 0x6edb
movq %r14, %r10
addq $0x18, %r9
movq %r10, %r14
jmp 0x6eaa
movl 0x44(%r9), %r10d
testq %r10, %r10
je 0x6ef1
addq %r10, %r11
movq %r14, %r10
cmpq %rsi, %r11
jbe 0x6ed2
jmp 0x6f15
movq %r9, %r10
testq %r14, %r14
je 0x6ed2
cmpq 0x30(%r14), %r11
jle 0x6ecf
cmpb $0x2, 0x43(%r14)
jb 0x6f10
cmpb $0x2, 0x43(%r9)
movq %r14, %r10
jb 0x6ed2
movq %r9, %r10
jmp 0x6ed2
movq %r9, %r14
movl %edx, %r8d
incl %r8d
jmp 0x6e99
testq %r14, %r14
je 0x6f31
cmpq 0x2c6b1(%rip), %r14     # 0x335e0
jne 0x6f39
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, 0x2c6a0(%rip)     # 0x335e0
movq 0x280a9(%rip), %rax     # 0x2eff0
movq (%rax), %rbx
callq 0x6e1c
movzbl 0x42(%r14), %ecx
leaq 0x19125(%rip), %rdx     # 0x20080
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
movq 0x20(%r14), %r8
leaq 0x1918c(%rip), %rsi     # 0x200f9
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5180
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: print_symbol
void print_symbol(FILE *f,struct Symbol *sym)
/* print symbol name, type, value, etc. */
{
  if (sym->type == SYM_COMMON)
    fprintf(f,"  %s: %s%s%s, alignment %d, size %d\n",sym->name,
            sym_bind[sym->bind],sym_type[sym->type],sym_info[sym->info],
            (int)sym->value,(int)sym->size);
  else if (sym->type == SYM_INDIR)
    fprintf(f,"  %s: %s%s%s, referencing %s\n",sym->name,
            sym_bind[sym->bind],sym_type[sym->type],sym_info[sym->info],
            sym->indir_name);
  else
#if 0
    fprintf(f,"  %s: %s%s%s, value 0x%llx, size %d\n",sym->name,
            sym_bind[sym->bind],sym_type[sym->type],sym_info[sym->info],
            (uint64_t)sym->value,(int)sym->size);
#else
    fprintf(f,"  %s: %s%s%s, value 0x%x, size %d\n",sym->name,
            sym_bind[sym->bind],sym_type[sym->type],sym_info[sym->info],
            (uint32_t)sym->value,(int)sym->size);
#endif
}

// Assembly:
pushq %rax
movq %rsi, %r10
movzbl 0x40(%rsi), %eax
movq 0x20(%rsi), %rdx
movzbl 0x43(%rsi), %ecx
leaq 0x28348(%rip), %rsi     # 0x2f2e0
movq (%rsi,%rcx,8), %rcx
cmpl $0x4, %eax
je 0x6fd2
cmpl $0x3, %eax
jne 0x7000
leaq 0x282d3(%rip), %rax     # 0x2f280
movq 0x18(%rax), %r8
movzbl 0x42(%r10), %eax
leaq 0x282f3(%rip), %rsi     # 0x2f2b0
movq (%rsi,%rax,8), %r9
movl 0x30(%r10), %r11d
movl 0x44(%r10), %r10d
leaq 0x19139(%rip), %rsi     # 0x20109
jmp 0x702a
leaq 0x282a7(%rip), %rax     # 0x2f280
movq 0x20(%rax), %r8
movzbl 0x42(%r10), %eax
leaq 0x282c7(%rip), %rsi     # 0x2f2b0
movq (%rsi,%rax,8), %r9
subq $0x8, %rsp
leaq 0x19136(%rip), %rsi     # 0x2012e
xorl %eax, %eax
pushq 0x28(%r10)
jmp 0x7030
leaq 0x28279(%rip), %rsi     # 0x2f280
movq (%rsi,%rax,8), %r8
movzbl 0x42(%r10), %eax
leaq 0x28299(%rip), %rsi     # 0x2f2b0
movq (%rsi,%rax,8), %r9
movl 0x30(%r10), %r11d
movl 0x44(%r10), %r10d
leaq 0x19122(%rip), %rsi     # 0x2014c
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x5180
popq %rcx
popq %rdx
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: trace_sym_access
bool trace_sym_access(struct GlobalVars *gv,const char *name)
/* check if the symbol with this name should be traced */
{
  struct SymNames *sn;

  if (gv->trace_syms) {
    sn = gv->trace_syms[elf_hash(name)%TRSYMHTABSIZE];
    while (sn) {
      if (!strcmp(name,sn->name))
        return (TRUE);  /* symbol found! */
      sn = sn->next;
    }
  }
  return (FALSE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0xa8(%rdi), %r15
xorl %ebx, %ebx
testq %r15, %r15
je 0x707d
movq %rsi, %r14
movq %rsi, %rdi
callq 0x69ee
andl $0x3f, %eax
leaq (%r15,%rax,8), %r15
pushq $0x1
popq %rbp
movq (%r15), %r15
testq %r15, %r15
je 0x707d
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x5160
testl %eax, %eax
jne 0x7063
movl %ebp, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: linker_init
void linker_init(struct GlobalVars *gv)
{
  initlist(&gv->linkfiles);
  initlist(&gv->selobjects);
  initlist(&gv->libobjects);
  initlist(&gv->sharedobjects);
  gv->symbols = alloc_hashtable(SYMHTABSIZE);
  initlist(&gv->pripointers);
  initlist(&gv->scriptsymbols);
  gv->got_base_name = gotbase_name;
  gv->plt_base_name = pltbase_name;

  if (gv->reloctab_format != RTAB_UNDEF) {
    if (!(fff[gv->dest_format]->rtab_mask & gv->reloctab_format)) {
      error(122,fff[gv->dest_format]->tname);
      gv->reloctab_format = fff[gv->dest_format]->rtab_format;
    }
  }
  else
    gv->reloctab_format = fff[gv->dest_format]->rtab_format;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x120, %rdi            # imm = 0x120
callq 0x63c8
leaq 0x138(%rbx), %rdi
callq 0x63c8
leaq 0x150(%rbx), %rdi
callq 0x63c8
leaq 0x168(%rbx), %rdi
callq 0x63c8
movl $0x10000, %edi          # imm = 0x10000
callq 0x63bf
movq %rax, 0x180(%rbx)
leaq 0x1a8(%rbx), %rdi
callq 0x63c8
leaq 0x190(%rbx), %rdi
callq 0x63c8
leaq 0x1950f(%rip), %rax     # 0x20600
movq %rax, 0x230(%rbx)
leaq 0x19521(%rip), %rax     # 0x20620
movq %rax, 0x238(%rbx)
movb 0x6e(%rbx), %cl
movzbl 0x50(%rbx), %eax
leaq 0x2807c(%rip), %r14     # 0x2f190
movq (%r14,%rax,8), %rax
testb %cl, %cl
je 0x7139
testb %cl, 0xa9(%rax)
jne 0x7142
movq (%rax), %rsi
pushq $0x7a
popq %rdi
xorl %eax, %eax
callq 0x6c19
movzbl 0x50(%rbx), %eax
movq (%r14,%rax,8), %rax
movb 0xa8(%rax), %al
movb %al, 0x6e(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: dyn_ext_entry
static struct Symbol *dyn_ext_entry(struct GlobalVars *gv,
                                    struct Symbol *xdef,struct Reloc *xref,
                                    int entrytype)
/* make a dyn_entry for an external reference */
{
  if (xdef->relsect->obj->lnkfile->type!=ID_SHAREDOBJ
      && entrytype==PLT_ENTRY) {
    /* resolve PLT relocation to a local function directly */
    switch (xref->rtype) {
      case R_PLT:
        xref->rtype = R_ABS;
        break;
      case R_PLTPC:
        xref->rtype = R_PC;
        break;
    }
  }
  else {
    DynArg a;
    struct Symbol *sym;

    a.sym = xdef;
    sym = dyn_entry(gv,a,entrytype);
    if (sym)
      return sym;
  }
  return xdef;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
cmpl $0x2, %ecx
jne 0x7b1b
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
cmpb $0x4, 0x39(%rax)
je 0x7b1b
movzbl 0x38(%rdx), %eax
cmpl $0x7, %eax
je 0x7b2c
cmpl $0x8, %eax
jne 0x7b31
movb $0x2, %al
jmp 0x7b2e
movq %rbx, %rsi
movl %ecx, %edx
callq 0xa0a8
testq %rax, %rax
jne 0x7b34
jmp 0x7b31
movb $0x1, %al
movb %al, 0x38(%rdx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: addrelref
static void addrelref(struct RelRef **rrptr,struct Section *sec)
/* if not already exists, add a new relative reference to another sect. */
{
  struct RelRef *rr;

  if (rr = *rrptr) {
    while (rr->next) {
      if (rr->refsec == sec)
        return;  /* reference already exists */
      rr = rr->next;
    }
  }
  else
    rr = (struct RelRef *)rrptr;

  rr->next = alloczero(sizeof(struct RelRef));
  rr->next->refsec = sec;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
testq %rax, %rax
je 0x7e31
movq (%rax), %rcx
testq %rcx, %rcx
je 0x7e2e
cmpq %rbx, 0x8(%rax)
movq %rcx, %rax
jne 0x7e1b
jmp 0x7e40
movq %rax, %r14
pushq $0x10
popq %rdi
callq 0x638a
movq %rax, (%r14)
movq %rbx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: dyn_reloc_entry
static void dyn_reloc_entry(struct GlobalVars *gv,struct Reloc *reloc,
                            int entrytype)
/* make a dyn_entry for a local GOT/PLT reference, fix reloc for entry */
{
  if (reloc->relocsect.ptr->obj->lnkfile->type!=ID_SHAREDOBJ
      && entrytype==PLT_LOCAL) {
    /* resolve PLT relocation to a local function directly */
    switch (reloc->rtype) {
      case R_PLT:
        reloc->rtype = R_ABS;
        break;
      case R_PLTPC:
        reloc->rtype = R_PC;
        break;
    }
  }
  else {
    DynArg a;
    struct Symbol *xdef;

    a.rel = reloc;
    if (xdef = dyn_entry(gv,a,entrytype)) {
      reloc->relocsect.ptr = xdef->relsect;
      reloc->addend = xdef->value;
    }
    else
      ierror("dyn_reloc_entry(): new xdef is NULL");
  }
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
cmpl $0x5, %edx
jne 0x7e77
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
cmpb $0x4, 0x39(%rax)
je 0x7e77
movzbl 0x38(%rbx), %eax
cmpl $0x8, %eax
je 0x7ea5
cmpl $0x7, %eax
jne 0x7ea9
movb $0x1, 0x38(%rbx)
jmp 0x7ea9
movq %rbx, %rsi
callq 0xa0a8
testq %rax, %rax
je 0x7e96
movq 0x38(%rax), %rcx
movq %rcx, 0x18(%rbx)
movq 0x30(%rax), %rax
movq %rax, 0x28(%rbx)
jmp 0x7ea9
leaq 0x18697(%rip), %rdi     # 0x20534
xorl %eax, %eax
popq %rbx
jmp 0x6b2c
movb $0x2, 0x38(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: linker_dynprep
void linker_dynprep(struct GlobalVars *gv)
/* Preparations for dynamic linking */
{
  /* hide unreferenced symbols from a shared library */
  hide_shlib_symbols(gv);

  /* export all global symbols when creating a shared library */
  if (gv->dest_sharedobj || gv->dyn_exp_all) {
    int i;

    for (i=0; i<SYMHTABSIZE; i++) {
      struct Symbol *sym;
      struct Symbol **chain = &gv->symbols[i];

      while (sym = *chain) {
        if (sym->bind>=SYMB_GLOBAL && !(sym->flags & SYMF_SHLIB) &&
            sym->relsect!=NULL && (sym->relsect->obj->flags & OUF_LINKED))
          dyn_export(gv,sym);
        chain = &sym->glob_chain;
      }
    }
  }

  /* let the target create and populate dynamic sections when needed */
  if (gv->dynamic && fff[gv->dest_format]->dyncreate)
    fff[gv->dest_format]->dyncreate(gv);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0xa58b
cmpl $0x0, 0x58(%rbx)
jne 0x7ec4
cmpl $0x0, 0x5c(%rbx)
je 0x7f21
xorl %r15d, %r15d
cmpq $0x10000, %r15          # imm = 0x10000
je 0x7f21
leaq (,%r15,8), %r14
addq 0x180(%rbx), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x7f1c
cmpb $0x2, 0x43(%r14)
jb 0x7f16
testb $0x10, 0x41(%r14)
jne 0x7f16
movq 0x38(%r14), %rax
testq %rax, %rax
je 0x7f16
movq 0x10(%rax), %rax
testb $0x1, 0x80(%rax)
je 0x7f16
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7b36
addq $0x10, %r14
jmp 0x7edf
incq %r15
jmp 0x7ec7
cmpl $0x0, 0x240(%rbx)
je 0x7f4c
movzbl 0x50(%rbx), %eax
leaq 0x2725b(%rip), %rcx     # 0x2f190
movq (%rcx,%rax,8), %rax
movq 0x68(%rax), %rax
testq %rax, %rax
je 0x7f4c
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: cmpsecflags
static uint8_t cmpsecflags(struct GlobalVars *gv,struct LinkedSection *ls,
                           uint8_t new)
/* return 0xff if sections are incompatible, otherwise return new flags */
{
  uint8_t old = ls->flags;

  if (ls->ld_flags & LSF_NOLOAD)
    new &= ~SF_ALLOC;
  else if ((old&SF_ALLOC) != (new&SF_ALLOC))
    return 0xff;

  return (fff[gv->dest_format]->cmpsecflags != NULL) ?
         fff[gv->dest_format]->cmpsecflags(old,new) : (old | new);
}

// Assembly:
movb 0x21(%rsi), %cl
testb $0x1, 0x24(%rsi)
jne 0x86d9
movl %ecx, %esi
xorb %dl, %sil
movb $-0x1, %al
testb $0x1, %sil
je 0x86dc
retq
andb $-0x2, %dl
movzbl 0x50(%rdi), %eax
leaq 0x26aa9(%rip), %rsi     # 0x2f190
movq (%rsi,%rax,8), %rax
movq 0x30(%rax), %rax
testq %rax, %rax
je 0x86fc
movzbl %cl, %edi
movzbl %dl, %esi
jmpq *%rax
orb %cl, %dl
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: merge_sec_attrs
static void merge_sec_attrs(struct LinkedSection *lsn,struct Section *sec,
                            uint8_t target_flags)
{
  if (lsn->type == ST_UNDEFINED) {
    lsn->type = sec->type;
    lsn->flags = sec->flags;
  }
  else {
    lsn->flags &= SF_PORTABLE_MASK;
    lsn->flags |= (sec->flags&SF_SMALLDATA) | target_flags;
  }

  if (lsn->protection != sec->protection) {
    if (lsn->protection!=0 &&
        (lsn->protection & sec->protection)!=sec->protection &&
        !listempty(&lsn->sections)) {
      /* merge protection-flags of the two sections */
      char prot1[5],prot2[5];
      strncpy(prot1,protstring(lsn->protection),5);
      strncpy(prot2,protstring(lsn->protection|sec->protection),5);
      strcpy(namebuf2,getobjname(((struct Section *)lsn->sections.last)->obj));
      error(22,lsn->name,prot1,namebuf2,prot2,getobjname(sec->obj));
    }
    lsn->protection |= sec->protection;
  }

  if (sec->alignment > lsn->alignment) {
    /* increase alignment to fit the needs of the new section */
    #if 0 /* @@@ no longer report about alignment corrections */
    if (lsn->alignment && !listempty(&lsn->sections)) {
      strcpy(namebuf2,getobjname(((struct Section *)lsn->sections.last)->obj));
      error(23,lsn->name,1<<lsn->alignment,namebuf2,
            1<<sec->alignment,getobjname(sec->obj));
    }
    #endif
    lsn->alignment = sec->alignment;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x0, 0x20(%rdi)
je 0x8730
movb 0x21(%rbx), %al
andb $0x1f, %al
movb 0x2d(%r14), %cl
andb $0x4, %cl
orb %dl, %cl
orb %al, %cl
movb %cl, 0x21(%rbx)
jmp 0x873e
movb 0x2c(%r14), %al
movb %al, 0x20(%rbx)
movb 0x2d(%r14), %al
movb %al, 0x21(%rbx)
movb 0x22(%rbx), %al
movb 0x2e(%r14), %cl
cmpb %cl, %al
je 0x880d
testb %al, %al
sete %dl
movl %eax, %esi
notb %sil
testb %sil, %cl
sete %sil
orb %dl, %sil
jne 0x8808
movq 0x60(%rbx), %rdx
cmpq $0x0, (%rdx)
je 0x8808
movzbl %al, %edi
callq 0xa0f7
leaq 0x269fc(%rip), %r13     # 0x2f180
leaq 0x13(%rsp), %r15
pushq $0x5
popq %rbp
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x5060
movb 0x2e(%r14), %al
orb 0x22(%rbx), %al
movzbl %al, %edi
callq 0xa0f7
leaq 0xe(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x5060
movq 0x70(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x6e1c
leaq 0x2ae20(%rip), %r13     # 0x335f0
movq %r13, %rdi
movq %rax, %rsi
callq 0x5080
movq 0x18(%rbx), %rbp
movq 0x10(%r14), %rdi
callq 0x6e1c
pushq $0x16
popq %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %r13, %rcx
movq %r12, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x6c19
movb 0x2e(%r14), %cl
movb 0x22(%rbx), %al
orb %cl, %al
movb %al, 0x22(%rbx)
movb 0x2f(%r14), %al
cmpb 0x23(%rbx), %al
jbe 0x8819
movb %al, 0x23(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: allocate_common
static unsigned long allocate_common(struct GlobalVars *gv,
                                     struct Section *sec,unsigned long addr)
/* allocate all common symbols to section 'sec' at 'addr',
   returns number of total bytes allocated */
{
  unsigned long abytes,alloc=0;
  struct Symbol *sym;
  int i;

  for (i=0; i<SYMHTABSIZE; i++) {
    for (sym=gv->symbols[i]; sym; sym=sym->glob_chain) {
      /* common symbol from this section name? */
      if (sym->relsect==sec && sym->type==SYM_COMMON) {

        /* allocate and transform into SYM_RELOC */
        abytes = comalign(addr+alloc,sym->value);
        sym->value = (lword)((addr+alloc) - sec->va) + abytes;
        sym->type = SYM_RELOC;
        alloc += abytes + sym->size;

        if (gv->map_file)
          fprintf(gv->map_file,"Allocating common %s: %x at %llx hex\n",
                  sym->name,(int)sym->size,(lword)sec->va+sym->value);
      }
    }
  }

  sec->size += alloc;
  return alloc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
xorl %eax, %eax
xorl %r12d, %r12d
cmpq $0x10000, %rax          # imm = 0x10000
je 0x88d6
movq %rax, (%rsp)
leaq (,%rax,8), %r13
addq 0x180(%r15), %r13
movq (%r13), %r13
testq %r13, %r13
je 0x88ca
cmpq %rbx, 0x38(%r13)
jne 0x88c4
cmpb $0x3, 0x40(%r13)
jne 0x88c4
leaq (%r12,%r14), %rbp
movq 0x30(%r13), %rsi
movq %rbp, %rdi
callq 0x6a3f
addq %rax, %rbp
movq %rbp, %rcx
subq 0x30(%rbx), %rcx
movq %rcx, 0x30(%r13)
movb $0x2, 0x40(%r13)
movl 0x44(%r13), %ecx
addq %rcx, %r12
addq %rax, %r12
movq 0x90(%r15), %rdi
testq %rdi, %rdi
je 0x88c4
movq 0x20(%r13), %rdx
leaq 0x17c9e(%rip), %rsi     # 0x20558
movq %rbp, %r8
xorl %eax, %eax
callq 0x5180
addq $0x10, %r13
jmp 0x8860
movq (%rsp), %rax
incq %rax
jmp 0x8841
addq %r12, 0x48(%rbx)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: searchlib
static char *searchlib(struct GlobalVars *gv,char *libname,int so_ver)
{
  struct LibPath *lpn = (struct LibPath *)gv->libpaths.first;
  struct LibPath *nextlpn;
  char *p,*path,*flavour_dir;
  int i,count;
  size_t len;

  if (p = scan_directory(".",libname,so_ver))
    return (p);

  while (nextlpn = (struct LibPath *)lpn->n.next) {
    for (count=gv->flavours.n_flavours; count>=0; count--) {
      flavour_dir = gv->flavours.flavour_dir;
      for (flavour_dir[0]='\0',i=0; i<count; i++) {
        if (!path_append(flavour_dir,flavour_dir,gv->flavours.flavours[i],
                         gv->flavours.flavours_len + 1))
          ierror("searchlib(): flavour \"%s\" doesn't fit into path buffer",
                 gv->flavours.flavours[i]);
      }
      len = strlen(lpn->path) + strlen(flavour_dir) + 3;
      if (len < FNAMEBUFSIZE) {
        path = path_append(namebuf2,lpn->path,flavour_dir,FNAMEBUFSIZE);
        if (p = scan_directory(path,libname,so_ver))
          return (p);
      }
    }
    lpn = nextlpn;
  }
  return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r12
movq (%rdi), %r15
leaq 0x15261(%rip), %rdi     # 0x1f011
callq 0x9ec0
testq %rax, %rax
je 0x9dc9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, 0x18(%rsp)
movl %ebx, 0xc(%rsp)
leaq 0x166aa(%rip), %rbp     # 0x20483
movq (%r15), %rax
testq %rax, %rax
je 0x9eb9
movq %rax, 0x10(%rsp)
movq %r15, 0x20(%rsp)
movl 0x30(%r12), %eax
movl %eax, %r15d
testl %eax, %eax
js 0x9eaf
movq 0x40(%r12), %r14
movb $0x0, (%r14)
xorl %ebx, %ebx
cmpq %rbx, %r15
je 0x9e48
movq 0x38(%r12), %rax
movq (%rax,%rbx,8), %rdx
movslq 0x34(%r12), %rcx
incq %rcx
movq %r14, %rdi
movq %r14, %rsi
callq 0xa150
testq %rax, %rax
jne 0x9e43
movq 0x38(%r12), %rax
movq (%rax,%rbx,8), %rsi
movq %rbp, %rdi
xorl %eax, %eax
callq 0x6b2c
incq %rbx
jmp 0x9e0a
movq 0x20(%rsp), %rax
movq 0x10(%rax), %r13
movq %r13, %rdi
callq 0x50e0
movq %rax, %rbx
movq %r14, %rdi
callq 0x50e0
addq %rbx, %rax
addq $0x3, %rax
cmpq $0x3ff, %rax            # imm = 0x3FF
ja 0x9ea4
movl $0x400, %ecx            # imm = 0x400
leaq 0x29771(%rip), %rdi     # 0x335f0
movq %r13, %rsi
movq %r14, %rdx
callq 0xa150
movq %rax, %rdi
movq 0x18(%rsp), %rsi
movl 0xc(%rsp), %edx
callq 0x9ec0
testq %rax, %rax
jne 0x9dba
decl %r15d
movl %r15d, %eax
jmp 0x9df4
movq 0x10(%rsp), %r15
jmp 0x9dd9
xorl %eax, %eax
jmp 0x9dba
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: make_dynobj
static void make_dynobj(struct GlobalVars *gv)
{
  if (gv->dynobj == NULL) {
    gv->dynobj = art_objunit(gv,"DYNAMIC",NULL,0);
    gv->dynobj->flags |= OUF_LINKED;
    addhead(&gv->selobjects,&gv->dynobj->n);
  }
}

// Assembly:
cmpq $0x0, 0x1e0(%rdi)
je 0xa073
retq
pushq %rbx
movq %rdi, %rbx
leaq 0x164ae(%rip), %rsi     # 0x2052c
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xb906
movq %rax, 0x1e0(%rbx)
orb $0x1, 0x80(%rax)
addq $0x138, %rbx            # imm = 0x138
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0x63fe
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: dyn_entry
static struct Symbol *dyn_entry(struct GlobalVars *gv,DynArg arg,int entrytype)
{
  make_dynobj(gv);

  if (fff[gv->dest_format]->dynentry)
    return fff[gv->dest_format]->dynentry(gv,arg,entrytype);
  
  /* dynamic symbol reference not supported by target */
  error(126,fff[gv->dest_format]->tname);
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
callq 0xa068
movzbl 0x50(%r15), %eax
leaq 0x250ca(%rip), %rcx     # 0x2f190
movq (%rcx,%rax,8), %rcx
movq 0x60(%rcx), %rax
testq %rax, %rax
je 0xa0e2
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq (%rcx), %rsi
pushq $0x7e
popq %rdi
xorl %eax, %eax
callq 0x6c19
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/linker.c
// Function: checkrr
static bool checkrr(struct RelRef *rr,struct Section *sec)
/* Check if there is a relative reference to the specified section. */
{
  while (rr) {
    if (rr->refsec == sec)
      return (TRUE);
    rr = rr->next;
  }
  return (FALSE);
}

// Assembly:
pushq $0x1
popq %rax
testq %rdi, %rdi
je 0xa14c
cmpq %rsi, 0x8(%rdi)
je 0xa14e
movq (%rdi), %rdi
jmp 0xa13c
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/dir.c
// Function: path_append
char *path_append(char *buf,const char *path,const char *add,size_t bufsize)
/* append a file- or path-name to an existing path */
{
  size_t len = strlen(path);

  if ((len+strlen(add)+1) < bufsize) {
    if (buf != path)
      strcpy(buf,path);
    if (len>0 && buf[len-1]!='/')
      buf[len++] = '/';
    strcpy(&buf[len],add);
    return (buf);
  }
  return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x50e0
movq %rax, %r15
movq %r14, %rdi
callq 0x50e0
addq %r15, %rax
incq %rax
cmpq %r13, %rax
jae 0xa1aa
cmpq %r12, %rbx
je 0xa193
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5080
testq %r15, %r15
je 0xa1ae
cmpb $0x2f, -0x1(%rbx,%r15)
je 0xa1b1
movb $0x2f, (%rbx,%r15)
incq %r15
jmp 0xa1b1
xorl %ebx, %ebx
jmp 0xa1bf
xorl %r15d, %r15d
addq %rbx, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x5080
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/dir.c
// Function: chk_file
bool chk_file(const char *path)
/* Check if file is present */
{
  FILE *f;

#ifdef AMIGAOS
  if (!strncmp(path,"./",2))
    path += 2;
#endif
  if (f = fopen(path,"rb"))
    fclose(f);
  return (f != NULL);
}

// Assembly:
pushq %rbx
leaq 0x14095(%rip), %rsi     # 0x1e295
callq 0x5230
movq %rax, %rbx
testq %rax, %rax
je 0xa215
movq %rbx, %rdi
callq 0x50c0
xorl %eax, %eax
testq %rbx, %rbx
setne %al
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: findsymbol
struct Symbol *findsymbol(struct GlobalVars *gv,struct Section *sec,
                          const char *name)
/* Return pointer to Symbol, otherwise return NULL.
   Make sure to prefer symbols from sec's ObjectUnit. */
{
  if (fff[gv->dest_format]->fndsymbol) {
    return fff[gv->dest_format]->fndsymbol(gv,sec,name);
  }
  else {
    struct Symbol *sym = gv->symbols[elf_hash(name)%SYMHTABSIZE];
    struct Symbol *found = NULL;

    while (sym) {
      if (!strcmp(name,sym->name)) {
        if (found && sec) {
          /* ignore, when not from the refering ObjectUnit */
          if (sym->relsect->obj == sec->obj)
            found = sym;
        }
        else
          found = sym;
      }
      sym = sym->glob_chain;
    }
    if (found!=NULL && found->type==SYM_INDIR)
      return findsymbol(gv,sec,found->indir_name);
    return found;
  }
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x24f55(%rip), %r13     # 0x2f190
movzbl 0x50(%r14), %eax
movq (%r13,%rax,8), %rax
movq 0x40(%rax), %rax
testq %rax, %rax
jne 0xa2c3
movq 0x180(%r14), %r12
movq %r15, %rdi
callq 0x69ee
movzwl %ax, %eax
leaq (%r12,%rax,8), %rbp
xorl %r12d, %r12d
movq (%rbp), %rbp
testq %rbp, %rbp
je 0xa2ac
movq 0x20(%rbp), %rsi
movq %r15, %rdi
callq 0x5160
testl %eax, %eax
jne 0xa2a0
movq %rbp, %rax
testq %rbx, %rbx
je 0xa2a3
movq %rbp, %rax
testq %r12, %r12
je 0xa2a3
movq 0x38(%rbp), %rax
movq 0x10(%rax), %rax
cmpq 0x10(%rbx), %rax
cmoveq %rbp, %r12
movq %r12, %rax
addq $0x10, %rbp
movq %rax, %r12
jmp 0xa267
testq %r12, %r12
je 0xa2dc
cmpb $0x4, 0x40(%r12)
jne 0xa2df
movq 0x28(%r12), %r15
jmp 0xa23b
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: hide_shlib_symbols
void hide_shlib_symbols(struct GlobalVars *gv)
/* scan for all unreferenced SYMF_SHLIB symbols in the global symbol list
   and remove them - they have to be invisible for the file we create */
{
  int i;

  for (i=0; i<SYMHTABSIZE; i++) {
    struct Symbol *sym;
    struct Symbol **chain = &gv->symbols[i];

    while (sym = *chain) {
      if ((sym->flags & SYMF_SHLIB) && !(sym->flags & SYMF_REFERENCED)) {
        /* remove from global symbol list */
        *chain = sym->glob_chain;
        sym->glob_chain = NULL;
      }
      else
        chain = &sym->glob_chain;
    }        
  }
}

// Assembly:
xorl %eax, %eax
cmpq $0x10000, %rax          # imm = 0x10000
je 0xa5d4
leaq (,%rax,8), %rcx
addq 0x180(%rdi), %rcx
movq (%rcx), %rdx
testq %rdx, %rdx
je 0xa5cf
movb 0x41(%rdx), %sil
andb $0x12, %sil
addq $0x10, %rdx
cmpb $0x10, %sil
jne 0xa5ca
movq (%rdx), %rsi
movq %rsi, (%rcx)
andq $0x0, (%rdx)
jmp 0xa5a4
movq %rdx, %rcx
jmp 0xa5a4
incq %rax
jmp 0xa58d
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: findlocsymbol
struct Symbol *findlocsymbol(struct GlobalVars *gv,struct ObjectUnit *ou,
                             const char *name)
/* find a symbol which is local to the provided ObjectUnit */
{
  struct Symbol *sym;
  struct Symbol **chain = &ou->objsyms[elf_hash(name)%OBJSYMHTABSIZE];

  while (sym = *chain) {
    if (!strcmp(sym->name,name))
      return sym;
    chain = &sym->obj_chain;
  }
  return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq 0x48(%rsi), %r14
movq %rdx, %rdi
callq 0x69ee
andl $0x1f, %eax
leaq (%r14,%rax,8), %r14
movq (%r14), %r14
testq %r14, %r14
je 0xa7b8
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x5160
testl %eax, %eax
je 0xa7b8
addq $0x18, %r14
jmp 0xa79a
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: addlocsymbol
void addlocsymbol(struct GlobalVars *gv,struct Section *s,char *name,
                  char *iname,lword val,uint8_t type,uint8_t flags,
                  uint8_t info,uint32_t size)
/* Define a new local symbol. Local symbols are allowed to be */
/* multiply defined. */
{
  struct Symbol *sym;
  struct Symbol **chain = &s->obj->objsyms[elf_hash(name)%OBJSYMHTABSIZE];

  while (sym = *chain)
    chain = &sym->obj_chain;
  *chain = sym = alloczero(sizeof(struct Symbol));
  sym->name = name;
  sym->indir_name = iname;
  sym->value = val;
  sym->relsect = s;
  sym->type = type;
  sym->flags = flags;
  sym->info = info;
  sym->bind = SYMB_LOCAL;
  sym->size = size;
  if (check_protection(gv,name))
    sym->flags |= SYMF_PROTECTED;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, 0x4(%rsp)
movq %r8, 0x8(%rsp)
movq %rcx, %r13
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, 0x10(%rsp)
movb 0x50(%rsp), %bpl
movq 0x10(%rsi), %rax
movq 0x48(%rax), %r14
movq %rdx, %rdi
callq 0x69ee
andl $0x1f, %eax
leaq (%r14,%rax,8), %rax
movq %rax, %r15
movq (%rax), %rcx
leaq 0x18(%rcx), %rax
testq %rcx, %rcx
jne 0xa805
pushq $0x50
popq %rdi
callq 0x638a
movq %rax, %r14
movq %rax, (%r15)
movq %rbx, 0x20(%rax)
movq %r13, 0x28(%rax)
movq 0x8(%rsp), %rax
movq %rax, 0x30(%r14)
movq %r12, 0x38(%r14)
movl 0x4(%rsp), %eax
movb %al, 0x40(%r14)
movb %bpl, 0x41(%r14)
movb 0x58(%rsp), %al
movb %al, 0x42(%r14)
movb $0x1, 0x43(%r14)
movl 0x60(%rsp), %eax
movl %eax, 0x44(%r14)
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0xa2f1
testl %eax, %eax
je 0xa871
orb $0x4, %bpl
movb %bpl, 0x41(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: addlnksymbol
struct Symbol *addlnksymbol(struct GlobalVars *gv,const char *name,lword val,
                            uint8_t type,uint8_t flags,uint8_t info,
                            uint8_t bind,uint32_t size)
/* Define a new, target-specific, linker symbol. */
{
  struct Symbol *sym;
  struct Symbol **chain;

  if (gv->lnksyms == NULL)
    gv->lnksyms = alloc_hashtable(LNKSYMHTABSIZE);
  chain = &gv->lnksyms[elf_hash(name)%LNKSYMHTABSIZE];

  while (sym = *chain)
    chain = &sym->obj_chain;
  *chain = sym = alloczero(sizeof(struct Symbol));
  sym->name = name;
  sym->value = val;
  sym->type = type;
  sym->flags = flags;
  sym->info = info;
  sym->bind = bind;
  sym->size = size;
  return sym;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, 0x4(%rsp)
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %r12
movq 0x188(%rdi), %r13
testq %r13, %r13
jne 0xa8bd
movq %rdi, %rbx
pushq $0x10
popq %rdi
callq 0x63bf
movq %rax, %r13
movq %rax, 0x188(%rbx)
movb 0x40(%rsp), %bl
movq %r12, %rdi
callq 0x69ee
andl $0xf, %eax
leaq (,%rax,8), %rax
addq %r13, %rax
movq %rax, %r13
movq (%rax), %rcx
leaq 0x18(%rcx), %rax
testq %rcx, %rcx
jne 0xa8d7
pushq $0x50
popq %rdi
callq 0x638a
movq %rax, (%r13)
movq %r12, 0x20(%rax)
movq %r15, 0x30(%rax)
movb %r14b, 0x40(%rax)
movb %bpl, 0x41(%rax)
movl 0x4(%rsp), %ecx
movb %cl, 0x42(%rax)
movb %bl, 0x43(%rax)
movl 0x48(%rsp), %ecx
movl %ecx, 0x44(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: findlnksymbol
struct Symbol *findlnksymbol(struct GlobalVars *gv,const char *name)
/* return pointer to Symbol, if present */
{
  struct Symbol *sym;

  if (gv->lnksyms) {
    sym = gv->lnksyms[elf_hash(name)%LNKSYMHTABSIZE];
    while (sym) {
      if (!strcmp(name,sym->name))
        return sym;  /* symbol found! */
      sym = sym->obj_chain;
    }
  }
  return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x188(%rdi), %r14
testq %r14, %r14
je 0xa962
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x69ee
andl $0xf, %eax
leaq (%r14,%rax,8), %r14
movq (%r14), %r14
testq %r14, %r14
je 0xa962
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x5160
testl %eax, %eax
je 0xa965
addq $0x18, %r14
jmp 0xa944
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: fixlnksymbols
void fixlnksymbols(struct GlobalVars *gv,struct LinkedSection *def_ls)
{
  struct Symbol *sym,*next;
  int i;

  if (gv->lnksyms) {
    for (i=0; i<LNKSYMHTABSIZE; i++) {
      for (sym=gv->lnksyms[i]; sym; sym=next) {
        next = sym->obj_chain;

        if (sym->flags & SYMF_LNKSYM) {
          if (fff[gv->dest_format]->setlnksym) {
            /* do target-specific symbol modificatios (relsect, value, etc.) */
            fff[gv->dest_format]->setlnksym(gv,sym);

            if (sym->relsect==NULL && def_ls!=NULL) {
              /* @@@ attach absolute symbols to the provided default section */
              if (!listempty(&def_ls->sections))
                sym->relsect = (struct Section *)def_ls->sections.first;
            }
            if (sym->type == SYM_RELOC)
              sym->value += sym->relsect->va;
#if 0 /* @@@ not needed? */
            add_objsymbol(sym->relsect->obj,sym);
#endif
            if (sym->bind >= SYMB_GLOBAL)
              addglobsym(gv,sym);  /* make it globally visible */
            /* add to final output section */
            addtail(&sym->relsect->lnksec->symbols,&sym->n);
            if (gv->map_file)
              print_symbol(gv->map_file,sym);
          }
        }
      }
      gv->lnksyms[i] = NULL;  /* clear chain, it's unusable now! */
    }
  }
}

// Assembly:
cmpq $0x0, 0x188(%rdi)
je 0xaa78
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
leaq 0x247f7(%rip), %r13     # 0x2f190
cmpq $0x10, %r12
je 0xaa6a
movq 0x188(%r14), %rax
movq (%rax,%r12,8), %rbp
testq %rbp, %rbp
je 0xaa56
movq %rbp, %r15
movq 0x18(%rbp), %rbp
testb $0x1, 0x41(%r15)
je 0xa9ae
movzbl 0x50(%r14), %eax
movq (%r13,%rax,8), %rax
movq 0x50(%rax), %rax
testq %rax, %rax
je 0xa9ae
movq %r14, %rdi
movq %r15, %rsi
callq *%rax
movq 0x38(%r15), %rax
testq %rbx, %rbx
je 0xaa00
testq %rax, %rax
jne 0xaa00
movq 0x60(%rbx), %rax
cmpq $0x0, (%rax)
je 0xa9fe
movq %rax, 0x38(%r15)
jmp 0xaa00
xorl %eax, %eax
cmpb $0x2, 0x40(%r15)
jne 0xaa0f
movq 0x30(%rax), %rcx
addq %rcx, 0x30(%r15)
cmpb $0x2, 0x43(%r15)
jb 0xaa25
movq %r14, %rdi
movq %r15, %rsi
callq 0xa32a
movq 0x38(%r15), %rax
movq 0x18(%rax), %rdi
movl $0xb0, %eax
addq %rax, %rdi
movq %r15, %rsi
callq 0x6414
movq 0x90(%r14), %rdi
testq %rdi, %rdi
je 0xa9ae
movq %r15, %rsi
callq 0x6f81
jmp 0xa9ae
movq 0x188(%r14), %rax
andq $0x0, (%rax,%r12,8)
incq %r12
jmp 0xa999
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: find_any_symbol
struct Symbol *find_any_symbol(struct GlobalVars *gv,struct Section *sec,
                               const char *name)
/* return pointer to a global symbol or linker symbol */
{
  struct Symbol *sym = findsymbol(gv,sec,name);

  if (sym == NULL)
    sym = findlnksymbol(gv,name);

  return sym;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
callq 0xa220
testq %rax, %rax
je 0xaa95
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa922
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: newreloc
struct Reloc *newreloc(struct GlobalVars *gv,struct Section *sec,
                       const char *xrefname,struct Section *rs,uint32_t id,
                       unsigned long offset,uint8_t rtype,lword addend)
/* allocate and init new relocation structure */
{
  struct Reloc *r = alloczero(sizeof(struct Reloc));

  if (r->xrefname = xrefname) {
    if (sec->obj) {
      uint16_t flags = sec->obj->lnkfile->flags;

      if (flags & IFF_DELUNDERSCORE) {
        if (*xrefname == '_')
          r->xrefname = ++xrefname;
      }
      else if (flags & IFF_ADDUNDERSCORE) {
        char *new_name = alloc(strlen(xrefname) + 2);

        *new_name = '_';
        strcpy(new_name+1,xrefname);
        r->xrefname = new_name;
      }
    }
  }
  if (rs)
    r->relocsect.ptr = rs;
  else
    r->relocsect.id = id;
  r->offset = offset;
  r->addend = addend;
  r->rtype = rtype;
  return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movl %r8d, %ebp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
pushq $0x40
popq %rdi
callq 0x638a
movq %rax, %r14
movq %r12, 0x10(%rax)
testq %r12, %r12
je 0xac69
movq 0x10(%r13), %rax
testq %rax, %rax
je 0xac69
movq 0x10(%rax), %rax
movzwl 0x3a(%rax), %eax
testb $0x1, %al
jne 0xac5b
testb $0x2, %al
je 0xac69
movq %r12, %rdi
callq 0x50e0
leaq 0x2(%rax), %rdi
callq 0x6340
movq %rax, %r13
movb $0x5f, (%rax)
leaq 0x1(%rax), %rdi
movq %r12, %rsi
callq 0x5080
movq %r13, %r12
jmp 0xac65
cmpb $0x5f, (%r12)
jne 0xac69
incq %r12
movq %r12, 0x10(%r14)
movq 0x48(%rsp), %rcx
movb 0x40(%rsp), %al
testq %r15, %r15
je 0xac7d
movq %r15, 0x18(%r14)
jmp 0xac81
movl %ebp, 0x18(%r14)
movq %rbx, 0x20(%r14)
movq %rcx, 0x28(%r14)
movb %al, 0x38(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: addreloc
void addreloc(struct Section *sec,struct Reloc *r,
              uint16_t pos,uint16_t siz,lword mask)
/* Add a relocation description of the current type to this relocation,
   which will be inserted into the sections reloc list, if not
   already done. */
{
  struct RelocInsert *new = alloc(sizeof(struct RelocInsert));
  struct RelocInsert *ri = r->insert;

  new->next = NULL;
  new->bpos = pos;
  new->bsiz = siz;
  new->mask = mask;
  if (ri) {
    while (ri->next)
      ri = ri->next;
    ri->next = new;
  }
  else
    r->insert = new;

  if (r->n.next==NULL && sec!=NULL) {
    if (r->xrefname)
      addtail(&sec->xrefs,&r->n);  /* add to current section's XRef list */
    else
      addtail(&sec->relocs,&r->n);  /* add to current section's Reloc list */
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %r15
movl %ecx, %ebp
movl %edx, %r12d
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x18
popq %rdi
callq 0x6340
movq 0x30(%rbx), %rcx
andq $0x0, (%rax)
movw %r12w, 0x8(%rax)
movw %bp, 0xa(%rax)
movq %r15, 0x10(%rax)
testq %rcx, %rcx
je 0xace4
movq %rcx, %rdx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0xacd7
jmp 0xace8
leaq 0x30(%rbx), %rdx
movq %rax, (%rdx)
testq %r14, %r14
je 0xad1a
cmpq $0x0, (%rbx)
jne 0xad1a
leaq 0x68(%r14), %rax
addq $0x50, %r14
cmpq $0x0, 0x10(%rbx)
cmovneq %rax, %r14
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6414
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: addstabs
void addstabs(struct ObjectUnit *ou,struct Section *sec,char *name,
              uint8_t type,int8_t other,int16_t desc,uint32_t value)
/* add an stab entry for debugging */
{
  struct StabDebug *stab = alloc(sizeof(struct StabDebug));

  stab->relsect = sec;
  stab->name.ptr = name;
  if (name) {
    if (*name == '\0')
      stab->name.ptr = NULL;
  }
  stab->n_type = type;
  stab->n_othr = other;
  stab->n_desc = desc;
  stab->n_value = value;
  addtail(&ou->stabs,&stab->n);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, 0x4(%rsp)
movl %r8d, %ebp
movl %ecx, %r15d
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
movl 0x40(%rsp), %ebx
pushq $0x28
popq %rdi
callq 0x6340
movq %r13, 0x10(%rax)
movq %r12, 0x18(%rax)
testq %r12, %r12
je 0xadb5
cmpb $0x0, (%r12)
jne 0xadb5
andq $0x0, 0x18(%rax)
movb %r15b, 0x20(%rax)
movb %bpl, 0x21(%rax)
movl 0x4(%rsp), %ecx
movw %cx, 0x22(%rax)
movl %ebx, 0x24(%rax)
addq $0x50, %r14
movq %r14, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6414
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: fixstabs
void fixstabs(struct ObjectUnit *ou)
/* fix offsets of relocatable stab entries */
{
  struct StabDebug *stab;

  for (stab=(struct StabDebug *)ou->stabs.first;
       stab->n.next!=NULL; stab=(struct StabDebug *)stab->n.next) {
    if (stab->relsect) {
      stab->n_value += (uint32_t)stab->relsect->va;
    }
  }
}

// Assembly:
movq 0x50(%rdi), %rax
movq %rax, %rcx
movq (%rax), %rax
testq %rax, %rax
je 0xae05
movq 0x10(%rcx), %rdx
testq %rdx, %rdx
je 0xade9
movl 0x30(%rdx), %edx
addl %edx, 0x24(%rcx)
jmp 0xade9
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: addtargetext
struct TargetExt *addtargetext(struct Section *s,uint8_t id,uint8_t subid,
                               uint16_t flags,uint32_t size)
/* Add a new TargetExt structure of given type to a section. The contents */
/* of this structure is target-specific. */
{
  struct TargetExt *te,*newte = alloc(size);

  newte->next = NULL;
  newte->id = id;
  newte->sub_id = subid;
  newte->flags = flags;
  if (te = s->special) {
    while (te->next)
      te = te->next;
    te->next = newte;
  }
  else
    s->special = newte;
  return newte;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
movl %r8d, %edi
callq 0x6340
andq $0x0, (%rax)
movb %r15b, 0x8(%rax)
movb %r14b, 0x9(%rax)
movw %bp, 0xa(%rax)
movq 0x88(%rbx), %rcx
testq %rcx, %rcx
je 0xae49
movq %rcx, %rbx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0xae3c
jmp 0xae50
addq $0x88, %rbx
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/targets.c
// Function: checktargetext
bool checktargetext(struct LinkedSection *ls,uint8_t id,uint8_t subid)
/* Checks if one of the sections in LinkedSection has a TargetExt */
/* block with the given id. If subid = 0 it will be ignored. */
{
  struct Section *sec = (struct Section *)ls->sections.first;
  struct Section *nextsec;
  struct TargetExt *te;

  while (nextsec = (struct Section *)sec->n.next) {
    if (te = sec->special) {
      do {
        if (te->id==id && (te->sub_id==subid || subid==0))
          return TRUE;
      }
      while (te = te->next);
    }
    sec = nextsec;
  }
  return FALSE;
}

// Assembly:
movq 0x60(%rdi), %r8
pushq $0x1
popq %rax
movq (%r8), %rcx
testq %rcx, %rcx
je 0xae98
movq 0x88(%r8), %rdi
movq %rcx, %r8
testq %rdi, %rdi
je 0xae65
cmpb %sil, 0x8(%rdi)
jne 0xae8b
testb %dl, %dl
je 0xae9a
cmpb %dl, 0x9(%rdi)
je 0xae9a
movq (%rdi), %rdi
testq %rdi, %rdi
jne 0xae7c
movq %rcx, %r8
jmp 0xae65
xorl %eax, %eax
retq