LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x71d0
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 0x71d0
leaq 0x2bc3a(%rip), %r15     # 0x32df0
leaq 0x1af23(%rip), %rsi     # 0x220e0
movq %r15, %rdi
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x5250
movq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rax
movq %rdi, %rax
movq 0x10(%rdi), %rcx
movq 0x48(%rcx), %rcx
xorl %edx, %edx
xorl %edi, %edi
movl %edx, %r8d
movq (%rcx,%r8,8), %r8
testq %r8, %r8
je 0x7260
movq %rdi, %r9
cmpq %rax, 0x38(%r8)
jne 0x7215
cmpb $0x2, 0x42(%r8)
ja 0x7215
cmpb $0x2, 0x40(%r8)
jne 0x7215
movq 0x30(%r8), %r10
cmpq %rsi, %r10
jbe 0x721e
movq %r9, %rdi
movq 0x18(%r8), %r8
jmp 0x71f0
movl 0x44(%r8), %edi
testq %rdi, %rdi
je 0x7234
addq %rdi, %r10
movq %r9, %rdi
cmpq %rsi, %r10
jbe 0x7218
jmp 0x7258
movq %r8, %rdi
testq %r9, %r9
je 0x7218
cmpq 0x30(%r9), %r10
jle 0x7215
cmpb $0x2, 0x43(%r9)
jb 0x7253
cmpb $0x2, 0x43(%r8)
movq %r9, %rdi
jb 0x7218
movq %r8, %rdi
jmp 0x7218
movl $0x20, %edx
movq %r8, %rdi
leal 0x1(%rdx), %r8d
cmpl $0x1f, %edx
movl %r8d, %edx
jl 0x71e9
testq %rdi, %rdi
je 0x727e
cmpq 0x2bf74(%rip), %rdi     # 0x331f0
jne 0x7280
popq %rax
retq
movq %rax, %rsi
callq 0x53cb
jmp 0x727e
// File: /workspace/github_c_makefile_star2_O1/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 0x2802f(%rip), %rsi     # 0x2f2d0
movq (%rsi,%rcx,8), %rcx
leaq 0x27fc4(%rip), %rsi     # 0x2f270
movq (%rsi,%rax,8), %r8
movzbl 0x42(%r10), %esi
leaq 0x27fe4(%rip), %r9      # 0x2f2a0
movq (%r9,%rsi,8), %r9
cmpl $0x4, %eax
je 0x72db
cmpl $0x3, %eax
jne 0x72ee
movl 0x30(%r10), %r11d
movl 0x44(%r10), %r10d
leaq 0x1ae30(%rip), %rsi     # 0x22109
jmp 0x72fd
subq $0x8, %rsp
leaq 0x1ae48(%rip), %rsi     # 0x2212e
xorl %eax, %eax
pushq 0x28(%r10)
jmp 0x7303
movl 0x30(%r10), %r11d
movl 0x44(%r10), %r10d
leaq 0x1ae4f(%rip), %rsi     # 0x2214c
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x5180
addq $0x10, %rsp
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq 0xa8(%rdi), %r15
xorl %ebx, %ebx
testq %r15, %r15
je 0x7350
movq %rsi, %r14
movq %rsi, %rdi
callq 0x6e09
andl $0x3f, %eax
leaq (%r15,%rax,8), %r15
movq (%r15), %r15
testq %r15, %r15
je 0x7350
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x5160
testl %eax, %eax
jne 0x7333
movl $0x1, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x670a
leaq 0x138(%rbx), %rdi
callq 0x670a
leaq 0x150(%rbx), %rdi
callq 0x670a
leaq 0x168(%rbx), %rdi
callq 0x670a
movl $0x10000, %edi          # imm = 0x10000
callq 0x66eb
movq %rax, 0x180(%rbx)
leaq 0x1a8(%rbx), %rdi
callq 0x670a
leaq 0x190(%rbx), %rdi
callq 0x670a
leaq 0x1b241(%rip), %rax     # 0x22600
movq %rax, 0x230(%rbx)
leaq 0x1b253(%rip), %rax     # 0x22620
movq %rax, 0x238(%rbx)
movb 0x6e(%rbx), %cl
movzbl 0x50(%rbx), %eax
leaq 0x27d9e(%rip), %r14     # 0x2f180
movq (%r14,%rax,8), %rax
testb %cl, %cl
je 0x7409
testb %cl, 0xa9(%rax)
jne 0x7412
movq (%rax), %rsi
movl $0x7a, %edi
xorl %eax, %eax
callq 0x6f84
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_O1/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 0x7ea0
movq 0x38(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
cmpb $0x4, 0x39(%rax)
je 0x7ea0
movzbl 0x38(%rdx), %eax
cmpl $0x7, %eax
je 0x7eb1
cmpl $0x8, %eax
jne 0x7eb6
movb $0x2, %al
jmp 0x7eb3
movq %rbx, %rsi
movl %ecx, %edx
callq 0xa709
testq %rax, %rax
jne 0x7eb9
jmp 0x7eb6
movb $0x1, %al
movb %al, 0x38(%rdx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x81c6
movq (%rax), %rcx
testq %rcx, %rcx
je 0x81c3
cmpq %rbx, 0x8(%rax)
movq %rcx, %rax
jne 0x81b0
jmp 0x81d7
movq %rax, %r14
movl $0x10, %edi
callq 0x66b6
movq %rax, (%r14)
movq %rbx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x820e
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
cmpb $0x4, 0x39(%rax)
je 0x820e
movzbl 0x38(%rbx), %eax
cmpl $0x8, %eax
je 0x823c
cmpl $0x7, %eax
jne 0x8240
movb $0x1, 0x38(%rbx)
jmp 0x8240
movq %rbx, %rsi
callq 0xa709
testq %rax, %rax
je 0x822d
movq 0x38(%rax), %rcx
movq %rcx, 0x18(%rbx)
movq 0x30(%rax), %rax
movq %rax, 0x28(%rbx)
jmp 0x8240
leaq 0x1a300(%rip), %rdi     # 0x22534
xorl %eax, %eax
popq %rbx
jmp 0x52b0
movb $0x2, 0x38(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xab56
cmpl $0x0, 0x58(%rbx)
jne 0x825b
cmpl $0x0, 0x5c(%rbx)
je 0x82c2
xorl %r15d, %r15d
movq 0x180(%rbx), %rax
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x82b6
cmpb $0x2, 0x43(%r14)
jb 0x82b0
movb 0x41(%r14), %al
testb $0x10, %al
jne 0x82b0
movq 0x38(%r14), %rcx
testq %rcx, %rcx
je 0x82b0
cmpb $0x3f, %al
ja 0x82b0
movq 0x10(%rcx), %rcx
movzwl 0x80(%rcx), %ecx
andl $0x1, %ecx
je 0x82b0
orb $-0x80, %al
movb %al, 0x41(%r14)
movq %rbx, %rdi
movq %r14, %rsi
movl $0x7, %edx
callq 0xa709
movq 0x10(%r14), %r14
jmp 0x8269
incq %r15
cmpq $0x10000, %r15          # imm = 0x10000
jne 0x825e
cmpl $0x0, 0x240(%rbx)
je 0x82ed
movzbl 0x50(%rbx), %eax
leaq 0x26eaa(%rip), %rcx     # 0x2f180
movq (%rcx,%rax,8), %rax
movq 0x68(%rax), %rax
testq %rax, %rax
je 0x82ed
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8b20
movl %ecx, %esi
xorb %dl, %sil
movb $-0x1, %al
testb $0x1, %sil
je 0x8b23
retq
andb $-0x2, %dl
movzbl 0x50(%rdi), %eax
leaq 0x26652(%rip), %rsi     # 0x2f180
movq (%rsi,%rax,8), %rax
movq 0x30(%rax), %rax
testq %rax, %rax
je 0x8b43
movzbl %cl, %edi
movzbl %dl, %esi
jmpq *%rax
orb %cl, %dl
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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, (%rsp)
movq %rsi, %rbx
movq %rdi, %r15
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x180(%r15), %rax
movq (%rax,%r13,8), %r14
testq %r14, %r14
je 0x8d71
cmpq %rbx, 0x38(%r14)
jne 0x8d6b
cmpb $0x3, 0x40(%r14)
jne 0x8d6b
movq (%rsp), %rax
leaq (%r12,%rax), %rbp
movq 0x30(%r14), %rsi
movq %rbp, %rdi
callq 0x6e63
addq %rax, %rbp
movq %rbp, %rcx
subq 0x30(%rbx), %rcx
movq %rcx, 0x30(%r14)
movb $0x2, 0x40(%r14)
movl 0x44(%r14), %ecx
addq %rcx, %r12
addq %rax, %r12
movq 0x90(%r15), %rdi
testq %rdi, %rdi
je 0x8d6b
movq 0x20(%r14), %rdx
leaq 0x197f7(%rip), %rsi     # 0x22558
movq %rbp, %r8
xorl %eax, %eax
callq 0x5180
movq 0x10(%r14), %r14
jmp 0x8d07
incq %r13
cmpq $0x10000, %r13          # imm = 0x10000
jne 0x8cfc
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_O1/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, %r15
movq (%rdi), %r12
leaq 0x16c3b(%rip), %rdi     # 0x2101c
callq 0xa506
testq %rax, %rax
je 0xa3fa
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r12), %rcx
testq %rcx, %rcx
je 0xa4ff
movq %r14, 0x18(%rsp)
movl %ebx, 0xc(%rsp)
leaq 0x1806c(%rip), %r13     # 0x22483
movq %r12, 0x20(%rsp)
movq %rcx, 0x10(%rsp)
movslq 0x30(%r15), %r14
testq %r14, %r14
js 0xa4e3
movq 0x40(%r15), %r12
movb $0x0, (%r12)
testq %r14, %r14
jle 0xa477
xorl %ebx, %ebx
movq 0x38(%r15), %rax
movq (%rax,%rbx,8), %rdx
movslq 0x34(%r15), %rcx
incq %rcx
movq %r12, %rdi
movq %r12, %rsi
callq 0xa75c
testq %rax, %rax
jne 0xa46f
movq 0x38(%r15), %rax
movq (%rax,%rbx,8), %rsi
movq %r13, %rdi
xorl %eax, %eax
callq 0x52b0
incq %rbx
cmpq %rbx, %r14
jne 0xa43e
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rbp
movq %rbp, %rdi
callq 0x50e0
movq %rax, %rbx
movq %r12, %rdi
callq 0x50e0
addq %rbx, %rax
addq $0x3, %rax
cmpq $0x3ff, %rax            # imm = 0x3FF
ja 0xa4d3
movl $0x400, %ecx            # imm = 0x400
leaq 0x28d52(%rip), %rdi     # 0x33200
movq %rbp, %rsi
movq %r12, %rdx
callq 0xa75c
movq %rax, %rdi
movq 0x18(%rsp), %rsi
movl 0xc(%rsp), %edx
callq 0xa506
testq %rax, %rax
jne 0xa3eb
leaq -0x1(%r14), %rax
testq %r14, %r14
movq %rax, %r14
jg 0xa42e
movq 0x10(%rsp), %r12
movq (%r12), %rcx
testq %rcx, %rcx
movl $0x0, %eax
jne 0xa417
jmp 0xa3eb
xorl %eax, %eax
jmp 0xa3eb
// File: /workspace/github_c_makefile_star2_O1/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 0xa6d4
retq
pushq %rbx
movq %rdi, %rbx
leaq 0x17e4d(%rip), %rsi     # 0x2252c
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xbfe9
movq %rax, 0x1e0(%rbx)
orb $0x1, 0x80(%rax)
addq $0x138, %rbx            # imm = 0x138
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0x6743
// File: /workspace/github_c_makefile_star2_O1/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 0xa6c9
movzbl 0x50(%r15), %eax
leaq 0x24a59(%rip), %rcx     # 0x2f180
movq (%rcx,%rax,8), %rcx
movq 0x60(%rcx), %rax
testq %rax, %rax
je 0xa743
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
popq %rbx
popq %r14
popq %r15
jmpq *%rax
movq (%rcx), %rsi
movl $0x7e, %edi
xorl %eax, %eax
callq 0x6f84
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0xa7b6
cmpq %r12, %rbx
je 0xa79f
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5080
testq %r15, %r15
je 0xa7ba
cmpb $0x2f, -0x1(%rbx,%r15)
je 0xa7bd
movb $0x2f, (%rbx,%r15)
incq %r15
jmp 0xa7bd
xorl %ebx, %ebx
jmp 0xa7cb
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_O1/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 0x15a94(%rip), %rsi     # 0x202a0
callq 0x5220
movq %rax, %rbx
testq %rax, %rax
je 0xa821
movq %rbx, %rdi
callq 0x50c0
xorl %eax, %eax
testq %rbx, %rbx
setne %al
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x24939(%rip), %r12     # 0x2f180
movzbl 0x50(%r14), %eax
movq (%r12,%rax,8), %rax
movq 0x40(%rax), %rax
testq %rax, %rax
jne 0xa8e1
movq 0x180(%r14), %r13
movq %r15, %rdi
callq 0x6e09
movzwl %ax, %eax
movq (%r13,%rax,8), %r13
testq %r13, %r13
je 0xa8bc
xorl %ebp, %ebp
movq 0x20(%r13), %rsi
movq %r15, %rdi
callq 0x5160
testl %eax, %eax
jne 0xa8ab
movq %r13, %rax
testq %rbx, %rbx
je 0xa8ae
movq %r13, %rax
testq %rbp, %rbp
je 0xa8ae
movq 0x38(%r13), %rax
movq 0x10(%rax), %rax
cmpq 0x10(%rbx), %rax
cmoveq %r13, %rbp
movq %rbp, %rax
movq 0x10(%r13), %r13
movq %rax, %rbp
testq %r13, %r13
jne 0xa87b
jmp 0xa8be
xorl %eax, %eax
testq %rax, %rax
je 0xa8d2
cmpb $0x4, 0x40(%rax)
jne 0xa8d2
movq 0x28(%rax), %r15
jmp 0xa847
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
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
// File: /workspace/github_c_makefile_star2_O1/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
movq 0x180(%rdi), %rdx
movq (%rdx,%rax,8), %rcx
testq %rcx, %rcx
je 0xab98
leaq (%rdx,%rax,8), %rdx
movb 0x41(%rcx), %sil
andb $0x12, %sil
addq $0x10, %rcx
cmpb $0x10, %sil
jne 0xab8d
movq (%rcx), %rsi
movq %rsi, (%rdx)
movq $0x0, (%rcx)
jmp 0xab90
movq %rcx, %rdx
movq (%rdx), %rcx
testq %rcx, %rcx
jne 0xab6c
incq %rax
cmpq $0x10000, %rax          # imm = 0x10000
jne 0xab58
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x6e09
andl $0x1f, %eax
movq (%r14,%rax,8), %r14
testq %r14, %r14
je 0xada0
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x5160
testl %eax, %eax
je 0xada3
movq 0x18(%r14), %r14
jmp 0xad85
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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, 0xc(%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, %rbp
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
movq 0x10(%rsi), %rax
movq 0x48(%rax), %r15
movq %rdx, %rdi
callq 0x6e09
andl $0x1f, %eax
leaq (%r15,%rax,8), %rax
movq %rax, %r12
movq (%rax), %rcx
leaq 0x18(%rcx), %rax
testq %rcx, %rcx
jne 0xade9
movl $0x50, %edi
callq 0x66b6
movq %rax, %r15
movq %rax, (%r12)
movq %rbx, 0x20(%rax)
movq %rbp, 0x28(%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x30(%r15)
movq %r13, 0x38(%r15)
movl 0xc(%rsp), %eax
movb %al, 0x40(%r15)
movb 0x50(%rsp), %bpl
movb %bpl, 0x41(%r15)
movb 0x58(%rsp), %al
movb %al, 0x42(%r15)
movb $0x1, 0x43(%r15)
movl 0x60(%rsp), %eax
movl %eax, 0x44(%r15)
addq $0xb0, %r14
movq (%r14), %r14
testq %r14, %r14
je 0xae70
movq 0x8(%r14), %rdi
movq %rbx, %rsi
callq 0x5160
testl %eax, %eax
jne 0xae4b
testq %r14, %r14
je 0xae70
orb $0x4, %bpl
movb %bpl, 0x41(%r15)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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, %ebx
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
cmpq $0x0, 0x188(%rdi)
jne 0xaeb7
movl $0x10, %edi
callq 0x66eb
movq %rax, 0x188(%r13)
movq 0x188(%r13), %r13
movq %r12, %rdi
callq 0x6e09
andl $0xf, %eax
leaq (,%rax,8), %rax
addq %r13, %rax
movq %rax, %r13
movq (%rax), %rcx
leaq 0x18(%rcx), %rax
testq %rcx, %rcx
jne 0xaed4
movl $0x50, %edi
callq 0x66b6
movq %rax, (%r13)
movq %r12, 0x20(%rax)
movq %r15, 0x30(%rax)
movb %r14b, 0x40(%rax)
movb %bpl, 0x41(%rax)
movb %bl, 0x42(%rax)
movb 0x40(%rsp), %cl
movb %cl, 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_O1/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 0xaf5e
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x6e09
andl $0xf, %eax
movq (%r14,%rax,8), %r14
testq %r14, %r14
je 0xaf5e
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x5160
testl %eax, %eax
je 0xaf61
movq 0x18(%r14), %r14
jmp 0xaf43
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xb070
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
leaq 0x241eb(%rip), %r13     # 0x2f180
movq 0x188(%r14), %rax
movq (%rax,%r12,8), %rbp
testq %rbp, %rbp
je 0xb046
movq %rbp, %r15
movq 0x18(%rbp), %rbp
testb $0x1, 0x41(%r15)
je 0xafa0
movzbl 0x50(%r14), %eax
movq (%r13,%rax,8), %rax
movq 0x50(%rax), %rax
testq %rax, %rax
je 0xafa0
movq %r14, %rdi
movq %r15, %rsi
callq *%rax
testq %rbx, %rbx
je 0xafec
cmpq $0x0, 0x38(%r15)
jne 0xafec
movq 0x60(%rbx), %rax
cmpq $0x0, (%rax)
je 0xafec
movq %rax, 0x38(%r15)
cmpb $0x2, 0x40(%r15)
jne 0xafff
movq 0x38(%r15), %rax
movq 0x30(%rax), %rax
addq %rax, 0x30(%r15)
cmpb $0x2, 0x43(%r15)
jb 0xb011
movq %r14, %rdi
movq %r15, %rsi
callq 0xa934
movq 0x38(%r15), %rax
movq 0x18(%rax), %rdi
movl $0xb0, %eax
addq %rax, %rdi
movq %r15, %rsi
callq 0x6759
movq 0x90(%r14), %rdi
testq %rdi, %rdi
je 0xafa0
movq %r15, %rsi
callq 0x728a
jmp 0xafa0
movq 0x188(%r14), %rax
movq $0x0, (%rax,%r12,8)
incq %r12
cmpq $0x10, %r12
jne 0xaf95
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xa82c
testq %rax, %rax
je 0xb08d
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xaf21
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x40, %edi
callq 0x66b6
movq %rax, %r14
movq %r12, 0x10(%rax)
testq %r12, %r12
je 0xb281
movq 0x10(%r13), %rax
testq %rax, %rax
je 0xb281
movq 0x10(%rax), %rax
movzwl 0x3a(%rax), %eax
testb $0x1, %al
jne 0xb273
testb $0x2, %al
je 0xb281
movq %r12, %rdi
callq 0x50e0
leaq 0x2(%rax), %rdi
callq 0x6668
movq %rax, %r13
movb $0x5f, (%rax)
leaq 0x1(%rax), %rdi
movq %r12, %rsi
callq 0x5080
movq %r13, %r12
jmp 0xb27d
cmpb $0x5f, (%r12)
jne 0xb281
incq %r12
movq %r12, 0x10(%r14)
movq 0x48(%rsp), %rcx
movb 0x40(%rsp), %al
testq %r15, %r15
je 0xb295
movq %r15, 0x18(%r14)
jmp 0xb299
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_O1/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
movl $0x18, %edi
callq 0x6668
movq 0x30(%rbx), %rcx
movq $0x0, (%rax)
movw %r12w, 0x8(%rax)
movw %bp, 0xa(%rax)
movq %r15, 0x10(%rax)
testq %rcx, %rcx
je 0xb301
movq %rcx, %rdx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0xb2f4
jmp 0xb305
leaq 0x30(%rbx), %rdx
movq %rax, (%rdx)
testq %r14, %r14
je 0xb337
cmpq $0x0, (%rbx)
jne 0xb337
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 0x6759
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]vlink/targets.c
// Function: findreloc
struct Reloc *findreloc(struct Section *sec,unsigned long offset)
/* return possible relocation at offset */
{
  if (sec) {
    struct Reloc *reloc;

    for (reloc=(struct Reloc *)sec->relocs.first;
         reloc->n.next!=NULL; reloc=(struct Reloc *)reloc->n.next) {
      if (reloc->offset == offset)
        return reloc;
    }
  }
  return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0xb392
movq 0x50(%rdi), %rcx
movq %rcx, %rax
movq (%rcx), %rcx
testq %rcx, %rcx
je 0xb392
cmpq %rsi, 0x20(%rax)
jne 0xb37b
testq %rcx, %rcx
je 0xb392
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x28, %edi
callq 0x6668
movq %r13, 0x10(%rax)
movq %r12, 0x18(%rax)
testq %r12, %r12
je 0xb3de
cmpb $0x0, (%r12)
jne 0xb3de
movq $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 0x6759
// File: /workspace/github_c_makefile_star2_O1/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
cmpq $0x0, (%rax)
je 0xb42c
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0xb427
movl 0x30(%rcx), %ecx
addl %ecx, 0x24(%rax)
movq (%rax), %rax
jmp 0xb412
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x6668
movq $0x0, (%rax)
movb %r15b, 0x8(%rax)
movb %r14b, 0x9(%rax)
movw %bp, 0xa(%rax)
movq 0x88(%rbx), %rcx
testq %rcx, %rcx
je 0xb473
movq %rcx, %rbx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0xb466
jmp 0xb47a
addq $0x88, %rbx
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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), %rcx
movq (%rcx), %rax
testq %rax, %rax
je 0xb4bc
movq 0x88(%rcx), %rdi
movq %rax, %rcx
testq %rdi, %rdi
je 0xb48c
cmpb %sil, 0x8(%rdi)
jne 0xb4b7
movl $0x1, %eax
testb %dl, %dl
je 0xb4be
cmpb %dl, 0x9(%rdi)
je 0xb4be
movq (%rdi), %rdi
jmp 0xb49e
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]vlink/targets.c
// Function: readsection
lword readsection(struct GlobalVars *gv,uint8_t rtype,uint8_t *p,
                  uint16_t bpos,uint16_t bsiz,lword mask)
/* Read data from section at 'p', using bit-offset 'bpos' and a field-size
   of 'bsiz' bits. The result is denormalized using the supplied mask.
   Complex RelocInsert scenarios are not supported, but this doesn't
   matter as those relocations have their addend information available
   anyway (ELF: .rela section) and don't need to read it from a section. */
{
  lword v = 0;
  int n;

  p += bpos >> 3;
  bpos &= 7;

  if (n = (bpos + bsiz + 7) >> 3) {
    if (gv->endianess == _LITTLE_ENDIAN_) {
      p += n;
      while (n--) {
        v <<= 8;
        v |= (lword)*(--p);
      }
      v >>= bpos;  /* normalize extracted bit-field */
    }
    else {  /* _BIG_ENDIAN_ or undefined */
      while (n--) {
        v <<= 8;
        v |= (lword)*p++;
      }
      v >>= (8 - ((bpos + bsiz) & 7)) & 7; /* normalize extracted bit-field */
    }
    v &= makemask(bsiz);

    /* mask and denormalize the read value using 'mask' */
    n = lshiftcnt(mask);
    mask >>= n;
    v &= mask;
    if (rtype==R_SD || rtype==R_SD2 || rtype==R_SD21)
      v <<= n;
    else
      v = sign_extend(v,(int)bsiz) << n;  /* sign-extend */
  }

  return v;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r14d
movl %ecx, %r8d
andl $0x7, %ecx
movl %ecx, %eax
addl %r14d, %eax
je 0xb51c
movq %r9, %rbx
movl %esi, %ebp
shrl $0x3, %r8d
leal (%rcx,%r14), %esi
addl $0x7, %esi
cmpb $0x0, 0x202(%rdi)
je 0xb520
addq %r8, %rdx
shrl $0x3, %esi
xorl %ecx, %ecx
xorl %r12d, %r12d
movq %r12, %rdi
shlq $0x8, %rdi
movzbl (%rdx,%rcx), %r12d
orq %rdi, %r12
incq %rcx
cmpl %ecx, %esi
jne 0xb4fe
negb %al
andb $0x7, %al
movl %eax, %ecx
jmp 0xb547
xorl %ebx, %ebx
jmp 0xb59e
shrl $0x3, %esi
movl %esi, %eax
addq %rax, %r8
leaq (%rdx,%r8), %rax
decq %rax
xorl %r12d, %r12d
movq %r12, %rdx
shlq $0x8, %rdx
movzbl (%rax), %r12d
orq %rdx, %r12
decq %rax
decl %esi
jne 0xb532
sarq %cl, %r12
movq $-0x1, %r13
movl %r14d, %ecx
shlq %cl, %r13
notq %r13
movq %rbx, %rdi
callq 0x6e9c
movl %eax, %ecx
sarq %cl, %rbx
movl %eax, %r15d
andq %r13, %rbx
andq %r12, %rbx
cmpb $0x21, %bpl
ja 0xb58a
movzbl %bpl, %eax
movabsq $0x300000400, %rcx      # imm = 0x300000400
btq %rax, %rcx
jb 0xb598
movq %rbx, %rdi
movl %r14d, %esi
callq 0x6f17
movq %rax, %rbx
movl %r15d, %ecx
shlq %cl, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]vlink/targets.c
// Function: sort_relocs
void sort_relocs(struct list *rlist)
/* sorts a section's relocation list by their section offsets */
{
  struct Reloc *rel,**rel_ptr_array,**p;
  int cnt = 0;

  /* count relocs and make a pointer array */
  for (rel=(struct Reloc *)rlist->first; rel->n.next!=NULL;
       rel=(struct Reloc *)rel->n.next)
    cnt++;
  if (cnt > 1) {
    rel_ptr_array = alloc(cnt * sizeof(void *));
    for (rel=(struct Reloc *)rlist->first,p=rel_ptr_array;
         rel->n.next!=NULL; rel=(struct Reloc *)rel->n.next)
      *p++ = rel;

    /* sort pointer array */
    qsort(rel_ptr_array,cnt,sizeof(void *),reloc_offset_cmp);

    /* rebuild reloc list from sorted pointer array, then free it */
    initlist(rlist);
    for (p=rel_ptr_array; cnt; cnt--) {
      rel = *p++;
      addtail(rlist,&rel->n);
    }
    free(rel_ptr_array);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movl $0x1, %r12d
movq $-0x8, %rdi
movq (%rax), %rax
decq %r12
addq $0x8, %rdi
testq %rax, %rax
jne 0xb941
movl %r12d, %eax
negl %eax
cmpl $0x2, %eax
jb 0xb9cd
movq %r12, %r15
negq %r15
callq 0x6668
movq %rax, %r14
movq (%rbx), %rax
cmpq $0x0, (%rax)
je 0xb984
movq %r14, %rcx
movq %rax, (%rcx)
addq $0x8, %rcx
movq (%rax), %rax
cmpq $0x0, (%rax)
jne 0xb974
leaq 0x4e(%rip), %rcx        # 0xb9d9
movl $0x8, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x50a0
movq %rbx, %rdi
callq 0x670a
movq %r14, %r15
movq (%r15), %rsi
addq $0x8, %r15
movq %rbx, %rdi
callq 0x6759
incl %r12d
jne 0xb9a6
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5040
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]vlink/targets.c
// Function: add_priptrs
void add_priptrs(struct GlobalVars *gv,struct ObjectUnit *ou)
/* Inserts all PriPointer nodes of an object into the global list. */
/* The node's position depends on 1. section name, 2. list name, */
/* 3. priority. */
{
  struct PriPointer *newpp,*nextpp,*pp;

  while (newpp = (struct PriPointer *)remhead(&ou->pripointers)) {
    pp = (struct PriPointer *)gv->pripointers.first;

    while (nextpp = (struct PriPointer *)pp->n.next) {
      int c;

      if ((c = strcmp(newpp->secname,pp->secname)) > 0)
        break;
      if (!c) {
        if ((c = strcmp(newpp->listname,pp->listname)) > 0)
          break;
        if (!c && newpp->priority < pp->priority)
          break;
      }
      pp = nextpp;
    }

    if (pp->n.pred)
      insertbefore(&newpp->n,&pp->n);
    else
      addhead(&gv->pripointers,&newpp->n);  /* first node in list */
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
addq $0x68, %rbx
movq %rbx, %rdi
callq 0x676f
testq %rax, %rax
je 0xbaaa
movq %rax, %r15
addq $0x1a8, %r14            # imm = 0x1A8
movq (%r14), %r13
movq (%r13), %r12
testq %r12, %r12
je 0xba73
movq 0x10(%r15), %rdi
movq 0x10(%r13), %rsi
callq 0x5160
testl %eax, %eax
jle 0xba47
xorl %eax, %eax
movq %r13, %r12
jmp 0xba4b
je 0xba54
movb $0x1, %al
movq %r12, %r13
testb %al, %al
jne 0xba26
jmp 0xba76
movq 0x18(%r15), %rdi
movq 0x18(%r13), %rsi
callq 0x5160
testl %eax, %eax
jg 0xba40
jne 0xba49
movl 0x20(%r15), %eax
cmpl 0x20(%r13), %eax
jl 0xba40
jmp 0xba49
movq %r13, %r12
cmpq $0x0, 0x8(%r12)
je 0xba8b
movq %r15, %rdi
movq %r12, %rsi
callq 0x671e
jmp 0xba96
movq %r14, %rdi
movq %r15, %rsi
callq 0x6743
movq %rbx, %rdi
callq 0x676f
movq %rax, %r15
testq %rax, %rax
jne 0xba23
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq