LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: find_sect_type
struct Section *find_sect_type(struct ObjectUnit *ou,uint8_t type,uint8_t prot)
/* find a section in current object unit with approp. type and protection */
{
  struct Section *sec;

  for (sec=(struct Section *)ou->sections.first;
       sec->n.next!=NULL; sec=(struct Section *)sec->n.next) {
    if (sec->type==type && (sec->protection&prot)==prot
        && (sec->flags & SF_ALLOC))
      return sec;
  }
  return NULL;
}

// Assembly:
movb %dl, %al
movb %sil, %cl
movq %rdi, -0x10(%rsp)
movb %cl, -0x11(%rsp)
movb %al, -0x12(%rsp)
movq -0x10(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rsp)
movq -0x20(%rsp), %rax
cmpq $0x0, (%rax)
je 0x11fc4
movq -0x20(%rsp), %rax
movzbl 0x2c(%rax), %eax
movzbl -0x11(%rsp), %ecx
cmpl %ecx, %eax
jne 0x11fb3
movq -0x20(%rsp), %rax
movzbl 0x2e(%rax), %eax
movzbl -0x12(%rsp), %ecx
andl %ecx, %eax
movzbl -0x12(%rsp), %ecx
cmpl %ecx, %eax
jne 0x11fb3
movq -0x20(%rsp), %rax
movzbl 0x2d(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x11fb3
movq -0x20(%rsp), %rax
movq %rax, -0x8(%rsp)
jmp 0x11fcd
jmp 0x11fb5
movq -0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rsp)
jmp 0x11f60
movq $0x0, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: find_sect_id
struct Section *find_sect_id(struct ObjectUnit *ou,uint32_t id)
/* find a section by its identification value */
{
  struct Section *sec;

  for (sec=(struct Section *)ou->sections.first;
       sec->n.next!=NULL; sec=(struct Section *)sec->n.next) {
    if (sec->id == id)
      return sec;
  }
  return NULL;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movl %esi, -0x14(%rsp)
movq -0x10(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rsp)
movq -0x20(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1202d
movq -0x20(%rsp), %rax
movl 0x28(%rax), %eax
cmpl -0x14(%rsp), %eax
jne 0x1201c
movq -0x20(%rsp), %rax
movq %rax, -0x8(%rsp)
jmp 0x12036
jmp 0x1201e
movq -0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rsp)
jmp 0x11ff7
movq $0x0, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: find_sect_name
struct Section *find_sect_name(struct ObjectUnit *ou,const char *name)
/* find a section by its name */
{
  struct Section *sec;

  for (sec=(struct Section *)ou->sections.first;
       sec->n.next!=NULL; sec=(struct Section *)sec->n.next) {
    if (!strcmp(name,sec->name))
      return sec;
  }
  return NULL;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1209c
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rsi
callq 0x5130
cmpl $0x0, %eax
jne 0x1208b
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x120a5
jmp 0x1208d
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0x1205c
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: find_first_bss_sec
struct Section *find_first_bss_sec(struct LinkedSection *ls)
/* returns pointer to first BSS-type section in list, or zero */
{
  struct Section *sec;

  for (sec=(struct Section *)ls->sections.first;
       sec->n.next!=NULL; sec=(struct Section *)sec->n.next) {
    if (sec->flags & SF_UNINITIALIZED)
      return sec;
  }
  return NULL;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq -0x10(%rsp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
cmpq $0x0, (%rax)
je 0x120fc
movq -0x18(%rsp), %rax
movzbl 0x2d(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x120eb
movq -0x18(%rsp), %rax
movq %rax, -0x8(%rsp)
jmp 0x12105
jmp 0x120ed
movq -0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rsp)
jmp 0x120c3
movq $0x0, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: find_lnksec
struct LinkedSection *find_lnksec(struct GlobalVars *gv,const char *name,
                                  uint8_t type,uint8_t flags,uint8_t fmask,
                                  uint8_t prot)
/* Return pointer to the first section which fits the passed */
/* name-, type- and flags-conditions. If a condition is 0, then */
/* it is ignored. If no appropriate section was found, return NULL. */
{
  struct LinkedSection *ls = (struct LinkedSection *)gv->lnksec.first;
  struct LinkedSection *nextls;

  while (nextls = (struct LinkedSection *)ls->n.next) {
    bool found = TRUE;

    if (name)
      if (strcmp(ls->name,name))
        found = FALSE;
    if (type)
      if (ls->type != type)
        found = FALSE;
    if (fmask)
      if ((ls->flags&fmask) != (flags&fmask))
        found = FALSE;
    if (prot)
      if ((ls->protection & prot) != prot)
        found = FALSE;
    if (found)
      return ls;
    ls = nextls;
  }
  return NULL;
}

// Assembly:
subq $0x58, %rsp
movl %r8d, 0xc(%rsp)
movl %ecx, %eax
movl 0xc(%rsp), %ecx
movl %eax, 0x10(%rsp)
movl %edx, %eax
movl 0x10(%rsp), %edx
movl %eax, 0x14(%rsp)
movq %rsi, %rax
movl 0x14(%rsp), %esi
movq %rax, 0x18(%rsp)
movq %rdi, %r8
movq 0x18(%rsp), %rdi
movb %r9b, %al
movq %r8, 0x48(%rsp)
movq %rdi, 0x40(%rsp)
movb %sil, 0x3f(%rsp)
movb %dl, 0x3e(%rsp)
movb %cl, 0x3d(%rsp)
movb %al, 0x3c(%rsp)
movq 0x48(%rsp), %rax
movq 0x1c0(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
je 0x12259
movl $0x1, 0x24(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x121b9
movq 0x30(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x40(%rsp), %rsi
callq 0x5130
cmpl $0x0, %eax
je 0x121b7
movl $0x0, 0x24(%rsp)
jmp 0x121b9
cmpb $0x0, 0x3f(%rsp)
je 0x121dc
movq 0x30(%rsp), %rax
movzbl 0x20(%rax), %eax
movzbl 0x3f(%rsp), %ecx
cmpl %ecx, %eax
je 0x121da
movl $0x0, 0x24(%rsp)
jmp 0x121dc
cmpb $0x0, 0x3d(%rsp)
je 0x1220d
movq 0x30(%rsp), %rax
movzbl 0x21(%rax), %eax
movzbl 0x3d(%rsp), %ecx
andl %ecx, %eax
movzbl 0x3e(%rsp), %ecx
movzbl 0x3d(%rsp), %edx
andl %edx, %ecx
cmpl %ecx, %eax
je 0x1220b
movl $0x0, 0x24(%rsp)
jmp 0x1220d
cmpb $0x0, 0x3c(%rsp)
je 0x12237
movq 0x30(%rsp), %rax
movzbl 0x22(%rax), %eax
movzbl 0x3c(%rsp), %ecx
andl %ecx, %eax
movzbl 0x3c(%rsp), %ecx
cmpl %ecx, %eax
je 0x12235
movl $0x0, 0x24(%rsp)
jmp 0x12237
cmpl $0x0, 0x24(%rsp)
je 0x1224a
movq 0x30(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x12262
movq 0x28(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x12170
movq $0x0, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: create_objunit
struct ObjectUnit *create_objunit(struct GlobalVars *gv,
                                  struct LinkFile *lf,const char *objname)
/* creates and initializes an ObjectUnit node */
{
  struct ObjectUnit *ou = alloc(sizeof(struct ObjectUnit));

  ou->lnkfile = lf;
  if (objname)
    ou->objname = objname;
  else
    ou->objname = noname;
  initlist(&ou->sections);  /* empty section list */
  ou->common = ou->scommon = NULL;
  ou->objsyms = alloc_hashtable(OBJSYMHTABSIZE);
  initlist(&ou->stabs);  /* empty stabs list */
  initlist(&ou->pripointers);  /* empty PriPointer list */
  ou->flags = 0;
  ou->min_alignment = gv->min_alignment;
  return ou;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl $0x88, %edi
callq 0x71f0
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
cmpq $0x0, 0x10(%rsp)
je 0x122b8
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x122c8
movq 0x8(%rsp), %rax
leaq 0x2338c(%rip), %rcx     # 0x35650
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rdi
addq $0x20, %rdi
callq 0x7330
movq 0x8(%rsp), %rax
movq $0x0, 0x40(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x38(%rax)
movl $0x20, %edi
callq 0x7310
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0x8(%rsp), %rdi
addq $0x50, %rdi
callq 0x7330
movq 0x8(%rsp), %rdi
addq $0x68, %rdi
callq 0x7330
movq 0x8(%rsp), %rax
movw $0x0, 0x80(%rax)
movq 0x20(%rsp), %rax
movb 0x88(%rax), %cl
movq 0x8(%rsp), %rax
movb %cl, 0x82(%rax)
movq 0x8(%rsp), %rax
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: art_objunit
struct ObjectUnit *art_objunit(struct GlobalVars *gv,const char *n,
                               uint8_t *d,unsigned long len)
/* creates and initializes an artificial linker-object */
{
  struct LinkFile *lf = alloczero(sizeof(struct LinkFile));

  lf->pathname = lf->filename = lf->objname = n;
  lf->data = d;
  lf->length = len;
  lf->format = gv->dest_format;
  lf->type = ID_ARTIFICIAL;
  return create_objunit(gv,lf,n);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movl $0x40, %edi
callq 0x7290
movq %rax, (%rsp)
movq 0x18(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x20(%rax)
movq (%rsp), %rax
movq %rcx, 0x18(%rax)
movq (%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x8(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x20(%rsp), %rax
movb 0x50(%rax), %cl
movq (%rsp), %rax
movb %cl, 0x38(%rax)
movq (%rsp), %rax
movb $0x3, 0x39(%rax)
movq 0x20(%rsp), %rdi
movq (%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x12270
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: create_section
struct Section *create_section(struct ObjectUnit *ou,const char *name,
                               uint8_t *data,unsigned long size)
/* creates and initializes a Section node */
{
  static uint32_t idcnt = 0;
  struct Section *s = alloczero(sizeof(struct Section));

  if (name)
    s->name = name;
  else
    s->name = noname;
  s->data = data;
  s->size = size;
  s->obj = ou;
  s->id = idcnt++;       /* target dependant - ELF replaces this with shndx */
  initlist(&s->relocs);  /* empty relocation list */
  initlist(&s->xrefs);   /* empty xref list */
  return s;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movl $0x98, %edi
callq 0x7290
movq %rax, (%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x125ed
movq 0x18(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x125fc
movq (%rsp), %rax
leaq 0x23058(%rip), %rcx     # 0x35650
movq %rcx, 0x20(%rax)
movq 0x10(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x8(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x48(%rax)
movq 0x20(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rax)
movl 0x323ab(%rip), %ecx     # 0x449d4
movl %ecx, %eax
addl $0x1, %eax
movl %eax, 0x323a0(%rip)     # 0x449d4
movq (%rsp), %rax
movl %ecx, 0x28(%rax)
movq (%rsp), %rdi
addq $0x50, %rdi
callq 0x7330
movq (%rsp), %rdi
addq $0x68, %rdi
callq 0x7330
movq (%rsp), %rax
addq $0x28, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: add_section
struct Section *add_section(struct ObjectUnit *ou,const char *name,
                            uint8_t *data,unsigned long size,
                            uint8_t type,uint8_t flags,uint8_t protection,
                            uint8_t align,bool inv)
/* create a new section and add it to the object ou */
{
  struct Section *sec = create_section(ou,name,data,size);

  sec->type = type;
  sec->flags = flags;
  sec->protection = protection;
  sec->alignment = ou->min_alignment>align ? ou->min_alignment : align;
  if (inv)
    sec->id = INVALID;
  if (type != ST_TMP)  /* TMP sections must not be part of the link process */
    addtail(&ou->sections,&sec->n);
  return sec;
}

// Assembly:
subq $0x58, %rsp
movl %r8d, 0xc(%rsp)
movq %rcx, %rax
movl 0xc(%rsp), %ecx
movq %rax, 0x10(%rsp)
movq %rdx, %rax
movq 0x10(%rsp), %rdx
movq %rax, 0x18(%rsp)
movq %rsi, %rax
movq 0x18(%rsp), %rsi
movq %rax, 0x20(%rsp)
movq %rdi, %r8
movq 0x20(%rsp), %rdi
movb %r9b, %al
movl 0x70(%rsp), %r9d
movb 0x68(%rsp), %r9b
movb 0x60(%rsp), %r9b
movq %r8, 0x50(%rsp)
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movb %cl, 0x37(%rsp)
movb %al, 0x36(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rcx
callq 0x125b0
movq %rax, 0x28(%rsp)
movb 0x37(%rsp), %cl
movq 0x28(%rsp), %rax
movb %cl, 0x2c(%rax)
movb 0x36(%rsp), %cl
movq 0x28(%rsp), %rax
movb %cl, 0x2d(%rax)
movb 0x60(%rsp), %cl
movq 0x28(%rsp), %rax
movb %cl, 0x2e(%rax)
movq 0x50(%rsp), %rax
movzbl 0x82(%rax), %eax
movzbl 0x68(%rsp), %ecx
cmpl %ecx, %eax
jle 0x1272e
movq 0x50(%rsp), %rax
movzbl 0x82(%rax), %eax
movl %eax, 0x8(%rsp)
jmp 0x12737
movzbl 0x68(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
movb %al, %cl
movq 0x28(%rsp), %rax
movb %cl, 0x2f(%rax)
cmpl $0x0, 0x70(%rsp)
je 0x12758
movq 0x28(%rsp), %rax
movl $0xffffffff, 0x28(%rax) # imm = 0xFFFFFFFF
movzbl 0x37(%rsp), %eax
cmpl $0x4, %eax
je 0x12775
movq 0x50(%rsp), %rdi
addq $0x20, %rdi
movq 0x28(%rsp), %rsi
callq 0x7470
movq 0x28(%rsp), %rax
addq $0x58, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: common_section
struct Section *common_section(struct GlobalVars *gv,struct ObjectUnit *ou)
/* returns the dummy section for COMMON symbols, or creates it */
{
  struct Section *s;

  if (!(s = ou->common)) {
    s = add_section(ou,gv->common_sec_name,NULL,0,ST_UDATA,
                    SF_ALLOC|SF_UNINITIALIZED,SP_READ|SP_WRITE,0,TRUE);
    ou->common = s;
  }
  return s;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
jne 0x127f4
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rax
movq 0x220(%rax), %rsi
xorl %eax, %eax
movl %eax, %ecx
movl $0x3, %r9d
xorl %eax, %eax
movq %rcx, %rdx
movl %r9d, %r8d
movl $0x3, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
callq 0x12660
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x20(%rsp), %rax
addq $0x38, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: scommon_section
struct Section *scommon_section(struct GlobalVars *gv,struct ObjectUnit *ou)
/* returns the dummy section for small-data COMMON symbols, or creates it */
{
  struct Section *s;

  if (!(s = ou->scommon)) {
    s = add_section(ou,gv->scommon_sec_name,NULL,0,ST_UDATA,
                    SF_ALLOC|SF_UNINITIALIZED,SP_READ|SP_WRITE,0,TRUE);
    if (ou->common)
      s->alignment = ou->common->alignment;  /* inherit .common alignment */
    ou->scommon = s;
  }
  return s;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
jne 0x12894
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rax
movq 0x228(%rax), %rsi
xorl %eax, %eax
movl %eax, %ecx
movl $0x3, %r9d
xorl %eax, %eax
movq %rcx, %rdx
movl %r9d, %r8d
movl $0x3, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
callq 0x12660
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x12886
movq 0x28(%rsp), %rax
movq 0x38(%rax), %rax
movb 0x2f(%rax), %cl
movq 0x20(%rsp), %rax
movb %cl, 0x2f(%rax)
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x20(%rsp), %rax
addq $0x38, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: abs_section
struct Section *abs_section(struct ObjectUnit *ou)
/* return first section available or create a new one */
{
  struct Section *s;

  if (listempty(&ou->sections))
    s = add_section(ou,noname,NULL,0,ST_UDATA,
                    SF_ALLOC|SF_UNINITIALIZED,SP_READ|SP_WRITE,0,TRUE);
  else
    s = (struct Section *)ou->sections.first;

  return s;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, (%rax)
jne 0x128f9
movq 0x20(%rsp), %rdi
leaq 0x22d8c(%rip), %rsi     # 0x35650
xorl %eax, %eax
movl %eax, %ecx
movl $0x3, %r9d
xorl %eax, %eax
movq %rcx, %rdx
movl %r9d, %r8d
movl $0x3, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
callq 0x12660
movq %rax, 0x18(%rsp)
jmp 0x12907
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: dummy_section
struct Section *dummy_section(struct GlobalVars *gv,struct ObjectUnit *ou)
/* Make a dummy section already attached to a dummy-LinkedSection, which
   won't appear in any section lists.
   Can be used for relocatable linker symbols, which need a specific value. */
{
  struct Section *s;

  if (!(s = gv->dummysec)) {
    struct LinkedSection *ls = alloczero(sizeof(struct LinkedSection));

    s = add_section(ou,"*linker*",NULL,0,ST_TMP,
                    SF_ALLOC|SF_UNINITIALIZED,SP_READ|SP_WRITE,0,TRUE);
    s->lnksec = ls;
    ls->name = s->name;
    ls->type = s->type;
    ls->flags = s->flags;
    ls->protection = s->protection;
    ls->index = INVALID;
    initlist(&ls->sections);
    initlist(&ls->relocs);
    initlist(&ls->xrefs);
    initlist(&ls->symbols);
    gv->dummysec = s;
  }
  return s;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq 0x1f0(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
jne 0x12a48
movl $0xc8, %edi
callq 0x7290
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x22f80(%rip), %rsi     # 0x358e4
xorl %eax, %eax
movl %eax, %ecx
movl $0x4, %r8d
movl $0x3, %r9d
xorl %eax, %eax
movq %rcx, %rdx
movl $0x3, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
callq 0x12660
movq %rax, 0x20(%rsp)
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x20(%rsp), %rax
movb 0x2c(%rax), %cl
movq 0x18(%rsp), %rax
movb %cl, 0x20(%rax)
movq 0x20(%rsp), %rax
movb 0x2d(%rax), %cl
movq 0x18(%rsp), %rax
movb %cl, 0x21(%rax)
movq 0x20(%rsp), %rax
movb 0x2e(%rax), %cl
movq 0x18(%rsp), %rax
movb %cl, 0x22(%rax)
movq 0x18(%rsp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq 0x18(%rsp), %rdi
addq $0x60, %rdi
callq 0x7330
movq 0x18(%rsp), %rdi
addq $0x80, %rdi
callq 0x7330
movq 0x18(%rsp), %rdi
addq $0x98, %rdi
callq 0x7330
movq 0x18(%rsp), %rdi
addq $0xb0, %rdi
callq 0x7330
movq 0x20(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x1f0(%rax)
movq 0x20(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: create_lnksect
struct LinkedSection *create_lnksect(struct GlobalVars *gv,const char *name,
                                     uint8_t type,uint8_t flags,
                                     uint8_t protection,uint8_t alignment)
/* create and initialize a LinkedSection node and include */
/* it in the global list */
{
  struct LinkedSection *ls = alloczero(sizeof(struct LinkedSection));

  ls->index = gv->nsecs++;
  ls->name = name;
  ls->type = type;
  ls->flags = flags;
  ls->protection = protection;
  ls->alignment = alignment;
  initlist(&ls->sections);
  initlist(&ls->relocs);
  initlist(&ls->xrefs);
  initlist(&ls->symbols);
  addtail(&gv->lnksec,&ls->n);
  return ls;
}

// Assembly:
subq $0x38, %rsp
movl %r8d, 0x4(%rsp)
movl %ecx, %eax
movl 0x4(%rsp), %ecx
movl %eax, 0x8(%rsp)
movl %edx, %eax
movl 0x8(%rsp), %edx
movl %eax, 0xc(%rsp)
movq %rsi, %rax
movl 0xc(%rsp), %esi
movq %rax, 0x10(%rsp)
movq %rdi, %r8
movq 0x10(%rsp), %rdi
movb %r9b, %al
movq %r8, 0x30(%rsp)
movq %rdi, 0x28(%rsp)
movb %sil, 0x27(%rsp)
movb %dl, 0x26(%rsp)
movb %cl, 0x25(%rsp)
movb %al, 0x24(%rsp)
movl $0xc8, %edi
callq 0x7290
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
movl 0x1d8(%rax), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x1d8(%rax)
movq 0x18(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x28(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x18(%rax)
movb 0x27(%rsp), %cl
movq 0x18(%rsp), %rax
movb %cl, 0x20(%rax)
movb 0x26(%rsp), %cl
movq 0x18(%rsp), %rax
movb %cl, 0x21(%rax)
movb 0x25(%rsp), %cl
movq 0x18(%rsp), %rax
movb %cl, 0x22(%rax)
movb 0x24(%rsp), %cl
movq 0x18(%rsp), %rax
movb %cl, 0x23(%rax)
movq 0x18(%rsp), %rdi
addq $0x60, %rdi
callq 0x7330
movq 0x18(%rsp), %rdi
addq $0x80, %rdi
callq 0x7330
movq 0x18(%rsp), %rdi
addq $0x98, %rdi
callq 0x7330
movq 0x18(%rsp), %rdi
addq $0xb0, %rdi
callq 0x7330
movq 0x30(%rsp), %rdi
addq $0x1c0, %rdi            # imm = 0x1C0
movq 0x18(%rsp), %rsi
callq 0x7470
movq 0x18(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: smalldata_section
struct LinkedSection *smalldata_section(struct GlobalVars *gv)
/* Return pointer to first small data LinkedSection. If not existing, */
/* return first data/bss section or the first section. */
{
  struct LinkedSection *ls = (struct LinkedSection *)gv->lnksec.first;
  struct LinkedSection *ldls=NULL,*firstls=NULL,*nextls;

  while (nextls = (struct LinkedSection *)ls->n.next) {
    if ((ls->flags & SF_ALLOC) && ls->size!=0) {
      if (firstls == NULL)
        firstls = ls;
      if (ls->type==ST_DATA || ls->type==ST_UDATA && ldls==NULL)
        ldls = ls;
      if (ls->flags & SF_SMALLDATA)  /* first SD section found! */
        return ls;
    }
    ls = nextls;
  }
  return ldls ? ldls : firstls;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq -0x10(%rsp), %rax
movq 0x1c0(%rax), %rax
movq %rax, -0x18(%rsp)
movq $0x0, -0x20(%rsp)
movq $0x0, -0x28(%rsp)
movq -0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rsp)
cmpq $0x0, %rax
je 0x1337a
movq -0x18(%rsp), %rax
movzbl 0x21(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1336b
movq -0x18(%rsp), %rax
cmpq $0x0, 0x48(%rax)
je 0x1336b
cmpq $0x0, -0x28(%rsp)
jne 0x1331e
movq -0x18(%rsp), %rax
movq %rax, -0x28(%rsp)
movq -0x18(%rsp), %rax
movzbl 0x20(%rax), %eax
cmpl $0x2, %eax
je 0x13342
movq -0x18(%rsp), %rax
movzbl 0x20(%rax), %eax
cmpl $0x3, %eax
jne 0x1334c
cmpq $0x0, -0x20(%rsp)
jne 0x1334c
movq -0x18(%rsp), %rax
movq %rax, -0x20(%rsp)
movq -0x18(%rsp), %rax
movzbl 0x21(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x13369
movq -0x18(%rsp), %rax
movq %rax, -0x8(%rsp)
jmp 0x133a2
jmp 0x1336b
movq -0x30(%rsp), %rax
movq %rax, -0x18(%rsp)
jmp 0x132d8
cmpq $0x0, -0x20(%rsp)
je 0x1338e
movq -0x20(%rsp), %rax
movq %rax, -0x38(%rsp)
jmp 0x13398
movq -0x28(%rsp), %rax
movq %rax, -0x38(%rsp)
movq -0x38(%rsp), %rax
movq %rax, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: text_data_bss_gaps
void text_data_bss_gaps(struct LinkedSection **sections)
/* calculate gap size between text-data and data-bss */
{
  if (sections[0]) {
    unsigned long nextsecbase = sections[1] ? sections[1]->base :
                                (sections[2] ? sections[2]->base : 0);
    if (nextsecbase) {
      sections[0]->gapsize = nextsecbase -
                             (sections[0]->base + sections[0]->size);
    }
  }
  if (sections[1] && sections[2]) {
    sections[1]->gapsize = sections[2]->base -
                           (sections[1]->base + sections[1]->filesize);
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
cmpq $0x0, (%rax)
je 0x13607
movq -0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x13594
movq -0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x40(%rax), %rax
movq %rax, -0x18(%rsp)
jmp 0x135c7
movq -0x8(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x135b4
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x40(%rax), %rax
movq %rax, -0x20(%rsp)
jmp 0x135bd
xorl %eax, %eax
movq %rax, -0x20(%rsp)
jmp 0x135bd
movq -0x20(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
movq %rax, -0x10(%rsp)
cmpq $0x0, -0x10(%rsp)
je 0x13605
movq -0x10(%rsp), %rcx
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq 0x40(%rax), %rax
movq -0x8(%rsp), %rdx
movq (%rdx), %rdx
addq 0x48(%rdx), %rax
subq %rax, %rcx
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq %rcx, 0x58(%rax)
jmp 0x13607
movq -0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x13656
movq -0x8(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x13656
movq -0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x40(%rax), %rcx
movq -0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x40(%rax), %rax
movq -0x8(%rsp), %rdx
movq 0x8(%rdx), %rdx
addq 0x50(%rdx), %rax
subq %rax, %rcx
movq -0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x58(%rax)
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: discard_symbol
bool discard_symbol(struct GlobalVars *gv,struct Symbol *sym)
/* checks if symbol can be discarded and excluded from the output file */
{
  if (sym->flags & SYMF_PROTECTED)
    return FALSE;

  if (gv->strip_symbols < STRIP_ALL) {
    if (sym->bind!=SYMB_LOCAL || gv->discard_local==DISLOC_NONE)
      return FALSE;

    if (gv->discard_local==DISLOC_TMP) {
      char c = sym->name[0];

      if (!((c=='L' || c=='l' || c=='.') && isdigit((unsigned)sym->name[1])))
        return FALSE;
    }
  }
  return TRUE;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movzbl 0x41(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1368c
movl $0x0, 0x24(%rsp)
jmp 0x1373b
movq 0x18(%rsp), %rax
movzbl 0x6c(%rax), %eax
cmpl $0x2, %eax
jge 0x13733
movq 0x10(%rsp), %rax
movzbl 0x43(%rax), %eax
cmpl $0x1, %eax
jne 0x136ba
movq 0x18(%rsp), %rax
movzbl 0x6d(%rax), %eax
cmpl $0x0, %eax
jne 0x136c4
movl $0x0, 0x24(%rsp)
jmp 0x1373b
movq 0x18(%rsp), %rax
movzbl 0x6d(%rax), %eax
cmpl $0x1, %eax
jne 0x13731
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movb (%rax), %al
movb %al, 0xf(%rsp)
movsbl 0xf(%rsp), %eax
cmpl $0x4c, %eax
je 0x136ff
movsbl 0xf(%rsp), %eax
cmpl $0x6c, %eax
je 0x136ff
movsbl 0xf(%rsp), %eax
cmpl $0x2e, %eax
jne 0x13725
callq 0x5260
movq (%rax), %rax
movq 0x10(%rsp), %rcx
movq 0x20(%rcx), %rcx
movsbl 0x1(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x1372f
movl $0x0, 0x24(%rsp)
jmp 0x1373b
jmp 0x13731
jmp 0x13733
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: entry_address
lword entry_address(struct GlobalVars *gv)
/* returns address of entry point for executables */
{
  struct Symbol *sym;
  struct LinkedSection *ls;

  if (gv->entry_name) {
    lword entry = 0;

    if (sym = findsymbol(gv,NULL,gv->entry_name)) {
      return (lword)sym->value;
    }
    else if (isdigit((unsigned char)*gv->entry_name)) {
      if (sscanf(gv->entry_name,"%lli",&entry) == 1)
        return entry;
    }
  }

  /* plan b: search for _start symbol: */
  if (sym = findsymbol(gv,NULL,"_start"))
      return (lword)sym->value;

  /* plan c: search for first executable section */
  if (ls = find_lnksec(gv,NULL,ST_CODE,SF_ALLOC,SF_ALLOC|SF_UNINITIALIZED,
                       SP_READ|SP_EXEC))
    return (lword)ls->base;

  return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq $0x0, 0xd0(%rax)
je 0x13807
movq $0x0, (%rsp)
movq 0x18(%rsp), %rdi
movq 0x18(%rsp), %rax
movq 0xd0(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0xf580
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x137ac
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x1387c
callq 0x5260
movq (%rax), %rax
movq 0x18(%rsp), %rcx
movq 0xd0(%rcx), %rcx
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x13803
movq 0x18(%rsp), %rax
movq 0xd0(%rax), %rdi
leaq 0x1fa55(%rip), %rsi     # 0x3323c
movq %rsp, %rdx
movb $0x0, %al
callq 0x51c0
cmpl $0x1, %eax
jne 0x13801
movq (%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x1387c
jmp 0x13803
jmp 0x13805
jmp 0x13807
movq 0x18(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x2216d(%rip), %rdx     # 0x35984
callq 0xf580
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x13837
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x1387c
movq 0x18(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %ecx
movl $0x3, %r8d
movl $0x5, %r9d
movl %ecx, %edx
callq 0x12110
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x13873
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x1387c
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: bss_entry
struct Symbol *bss_entry(struct ObjectUnit *ou,const char *secname,
                         struct Symbol *xdef)
/* Create a BSS section in the object ou with space for xdef's size. 
   The symbol will be changed to the base address of this section and
   enqueued in the section's object symbol list.
   A size of 0 will leave the symbol untouched (no need to copy), which
   is indicated by returning NULL.
   This function is called for R_COPY objects, used for dynamic linking. */
{
  if (xdef->size) {
    /* change xdef to point to our new object in sec */
    unlink_objsymbol(xdef);
    xdef->value = 0;
    xdef->relsect = add_section(ou,secname,NULL,xdef->size,ST_UDATA,
                                SF_ALLOC|SF_UNINITIALIZED,
                                SP_READ|SP_WRITE,2,TRUE);
    add_objsymbol(ou,xdef);
    return xdef;
  }

  return NULL;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpl $0x0, 0x44(%rax)
je 0x13929
movq 0x18(%rsp), %rdi
callq 0x13940
movq 0x18(%rsp), %rax
movq $0x0, 0x30(%rax)
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rax
movl 0x44(%rax), %eax
movl %eax, %ecx
xorl %eax, %eax
movl %eax, %edx
movl $0x3, %r9d
movl %r9d, %r8d
movl $0x3, (%rsp)
movl $0x2, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
callq 0x12660
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x38(%rax)
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x13a60
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x13932
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: unlink_objsymbol
static void unlink_objsymbol(struct Symbol *delsym)
/* unlink a symbol from an object unit's hash chain */
{
  const char *fn = "unlink_objsymbol():";
  struct ObjectUnit *ou = delsym->relsect ? delsym->relsect->obj : NULL;

  if (ou) {
    struct Symbol **chain = &ou->objsyms[elf_hash(delsym->name)%OBJSYMHTABSIZE];
    struct Symbol *sym;

    while (sym = *chain) {
      if (sym == delsym)
        break;
      chain = &sym->obj_chain;
    }
    if (sym) {
      /* unlink the symbol node from the chain */
      *chain = delsym->obj_chain;
      delsym->obj_chain = NULL;
    }
    else
      ierror("%s %s could not be found in any object",fn,delsym->name);
  }
  else
    ierror("%s %s has no object or section",fn,delsym->name);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
leaq 0x2208f(%rip), %rax     # 0x359df
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x13975
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0x1397e
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x1397e
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0x13a3d
movq 0x20(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, (%rsp)
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x8760
movq %rax, %rcx
movq (%rsp), %rax
andq $0x1f, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x139f7
movq 0x10(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x139e7
jmp 0x139f7
movq 0x10(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x18(%rsp)
jmp 0x139c6
cmpq $0x0, 0x10(%rsp)
je 0x13a1f
movq 0x30(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x30(%rsp), %rax
movq $0x0, 0x18(%rax)
jmp 0x13a3b
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rdx
leaq 0x21fbf(%rip), %rdi     # 0x359f3
movb $0x0, %al
callq 0x8ae0
jmp 0x13a59
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rdx
leaq 0x21fc8(%rip), %rdi     # 0x35a1a
movb $0x0, %al
callq 0x8ae0
addq $0x38, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: add_objsymbol
static void add_objsymbol(struct ObjectUnit *ou,struct Symbol *newsym)
/* Add a symbol to an object unit's symbol table. The symbol name
   must be unique within the object, otherwise an internal error
   will occur! */
{
  struct Symbol *sym;
  struct Symbol **chain = &ou->objsyms[elf_hash(newsym->name)%OBJSYMHTABSIZE];

  while (sym = *chain) {
    if (!strcmp(newsym->name,sym->name))
      ierror("add_objsymbol(): %s defined twice",newsym->name);
    chain = &sym->obj_chain;
  }
  *chain = newsym;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x8760
movq %rax, %rcx
movq (%rsp), %rax
andq $0x1f, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x13af6
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rsi
callq 0x5130
cmpl $0x0, %eax
jne 0x13ae6
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rsi
leaq 0x21f5a(%rip), %rdi     # 0x35a39
movb $0x0, %al
callq 0x8ae0
movq 0x10(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x8(%rsp)
jmp 0x13aa0
movq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: new_priptr
static void new_priptr(struct ObjectUnit *ou,const char *sec,const char *label,
                       int pri,const char *xref,lword addend)
/* Inserts a new longword into the object's PriPointers list. */
{
  struct PriPointer *newpp = alloc(sizeof(struct PriPointer));

  newpp->secname = sec;
  newpp->listname = label;
  newpp->priority = pri;
  newpp->xrefname = xref;
  newpp->addend = addend;
  addtail(&ou->pripointers,&newpp->n);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movl %ecx, 0x1c(%rsp)
movq %r8, 0x10(%rsp)
movq %r9, 0x8(%rsp)
movl $0x38, %edi
callq 0x71f0
movq %rax, (%rsp)
movq 0x28(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x20(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x18(%rax)
movl 0x1c(%rsp), %ecx
movq (%rsp), %rax
movl %ecx, 0x20(%rax)
movq 0x10(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x8(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x30(%rsp), %rdi
addq $0x68, %rdi
movq (%rsp), %rsi
callq 0x7470
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: vbcc_xtors_pri
static int vbcc_xtors_pri(const char *s)
/* Return priority of a vbcc constructor/destructor function name.
   Its priority may be specified by a number behind the 2nd underscore.
   Example: _INIT_9_OpenLibs (constructor with priority 9) */
{
  if (*s++ == '_')
    if (isdigit((unsigned)*s))
      return atoi(s);
  return 0;
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rsp)
movsbl (%rax), %eax
cmpl $0x5f, %eax
jne 0x13bf5
callq 0x5260
movq (%rax), %rax
movq 0x8(%rsp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x13bf3
movq 0x8(%rsp), %rdi
callq 0x5220
movl %eax, 0x14(%rsp)
jmp 0x13bfd
jmp 0x13bf5
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: unlink_lnksymbol
static void unlink_lnksymbol(struct GlobalVars *gv,struct Symbol *sym)
/* remove a linker-symbol from its list */
{
  static const char *fn = "unlink_lnksymbol(): ";

  if (gv->lnksyms) {
    struct Symbol *cptr;
    struct Symbol **chain = &gv->lnksyms[elf_hash(sym->name)%LNKSYMHTABSIZE];

    while (cptr = *chain) {
      if (cptr == sym)
        break;
      chain = &cptr->obj_chain;
    }
    if (cptr) {
      /* delete the symbol node from the chain */
      *chain = sym->obj_chain;
      sym->obj_chain = NULL;
    }
    else
      ierror("%s%s could not be found in linker-symbols list",fn,sym->name);
  }
  else
    ierror("%slnksyms==NULL",fn);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x188(%rax)
je 0x13d3f
movq 0x20(%rsp), %rax
movq 0x188(%rax), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x8760
movq %rax, %rcx
movq (%rsp), %rax
andq $0xf, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x13cf7
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
jne 0x13ce7
jmp 0x13cf7
movq 0x10(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x8(%rsp)
jmp 0x13cc6
cmpq $0x0, 0x10(%rsp)
je 0x13d1f
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0x18(%rax)
jmp 0x13d3d
movq 0x2bfb2(%rip), %rsi     # 0x3fcd8
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rdx
leaq 0x21c6a(%rip), %rdi     # 0x359a0
movb $0x0, %al
callq 0x8ae0
jmp 0x13d54
movq 0x2bf92(%rip), %rsi     # 0x3fcd8
leaq 0x21c82(%rip), %rdi     # 0x359cf
movb $0x0, %al
callq 0x8ae0
addq $0x28, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/ar.c
// Function: ar_init
bool ar_init(struct ar_info *ai,char *p,unsigned long plen,const char *name)
/* check for valid archive header and initialize ar_info, if successful */
{
  /* check for "!<arch>\n" id */
  if (plen<SARMAG || strncmp(p,ARMAG,SARMAG))
    return FALSE;

  memset(ai,0,sizeof(struct ar_hdr));
  ai->arname = (char *)name;
  ai->next = (struct ar_hdr *)(p+SARMAG);
  ai->arlen = plen - SARMAG;
  return TRUE;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rcx, (%rsp)
cmpq $0x8, 0x8(%rsp)
jb 0x13d9a
movq 0x10(%rsp), %rdi
leaq 0x21cd0(%rip), %rsi     # 0x35a5b
movl $0x8, %edx
callq 0x5050
cmpl $0x0, %eax
je 0x13da4
movl $0x0, 0x24(%rsp)
jmp 0x13ded
movq 0x18(%rsp), %rdi
xorl %esi, %esi
movl $0x3c, %edx
callq 0x5100
movq (%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rcx
addq $0x8, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x8(%rsp), %rcx
subq $0x8, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/ldscript.c
// Function: sf_addr
static int sf_addr(struct GlobalVars *gv,lword addr,lword *res)
{
  struct LinkedSection *ls;

  if (startofblock('(')) {
    if (ls = getsection(gv))
      *res = ls->base;
    endofblock('(',')');
  }
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl $0x28, %edi
callq 0x17e00
cmpl $0x0, %eax
je 0x14327
movq 0x20(%rsp), %rdi
callq 0x17e70
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x14318
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movl $0x28, %edi
movl $0x29, %esi
callq 0x17f10
movl $0x1, %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/ldscript.c
// Function: sf_align
static int sf_align(struct GlobalVars *gv,lword addr,lword *res)
{
  lword a = term_absexp();

  addr += a - 1;
  *res = addr - addr % a;
  return 0;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
callq 0x17f90
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
subq $0x1, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rcx
movq 0x18(%rsp), %rax
cqto
idivq 0x8(%rsp)
subq %rdx, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
xorl %eax, %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/ldscript.c
// Function: sf_loadaddr
static int sf_loadaddr(struct GlobalVars *gv,lword addr,lword *res)
{
  struct LinkedSection *ls;

  if (startofblock('(')) {
    if (ls = getsection(gv))
      *res = ls->copybase;
    endofblock('(',')');
  }
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl $0x28, %edi
callq 0x17e00
cmpl $0x0, %eax
je 0x143f7
movq 0x20(%rsp), %rdi
callq 0x17e70
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x143e8
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movl $0x28, %edi
movl $0x29, %esi
callq 0x17f10
movl $0x1, %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/ldscript.c
// Function: sf_sizeof
static int sf_sizeof(struct GlobalVars *gv,lword addr,lword *res)
{
  struct LinkedSection *ls;

  if (startofblock('(')) {
    if (ls = getsection(gv))
      *res = ls->size;
    endofblock('(',')');
  }
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl $0x28, %edi
callq 0x17e00
cmpl $0x0, %eax
je 0x14467
movq 0x20(%rsp), %rdi
callq 0x17e70
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x14458
movq 0x8(%rsp), %rax
movq 0x48(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movl $0x28, %edi
movl $0x29, %esi
callq 0x17f10
movl $0x1, %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/ldscript.c
// Function: sf_sizeofheaders
static int sf_sizeofheaders(struct GlobalVars *gv,lword addr,lword *res)
{
  /* SIZEOF_HEADERS means that we want to include File- and PHDR in
     the first ELF segment */
  if (!find_phdr(gv,defhdr,defmem,defmem))
    add_phdr(gv,defhdr,PT_PHDR,PHDR_PHDRS,ADDR_NONE,defmem,defmem);

  *res = fff[gv->dest_format]->headersize(gv);
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movq 0x2ba09(%rip), %rsi     # 0x3fea8
movq 0x3055a(%rip), %rdx     # 0x44a00
movq 0x30553(%rip), %rcx     # 0x44a00
callq 0x16130
cmpq $0x0, %rax
jne 0x144ec
movq 0x20(%rsp), %rdi
movq 0x2b9e4(%rip), %rsi     # 0x3fea8
movq 0x30535(%rip), %r9      # 0x44a00
movq 0x3052e(%rip), %rax     # 0x44a00
movl $0x6, %edx
movl $0x400, %ecx            # imm = 0x400
movq $-0x1, %r8
movq %rax, (%rsp)
callq 0x17660
movq 0x20(%rsp), %rax
movzbl 0x50(%rax), %eax
movl %eax, %ecx
leaq 0x2b532(%rip), %rax     # 0x3fa30
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movq 0x20(%rsp), %rdi
callq *%rax
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movl $0x1, %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/ldscript.c
// Function: sc_entry
static void sc_entry(struct GlobalVars *gv)
/* ENTRY(symbol or address) */
{
  if (startofblock('(')) {
    char *entryname;

    if (entryname = getalnum()) {
      if (gv->entry_name == NULL)
        gv->entry_name = allocstring(entryname);
    }
    else
      error(78,scriptname,getlineno());
    endofblock('(',')');
  }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x28, %edi
callq 0x17e00
cmpl $0x0, %eax
je 0x145d3
callq 0x18100
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x145a2
movq 0x10(%rsp), %rax
cmpq $0x0, 0xd0(%rax)
jne 0x145a0
movq 0x8(%rsp), %rdi
callq 0x72d0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0xd0(%rax)
jmp 0x145c4
movq 0x30447(%rip), %rax     # 0x449f0
movq %rax, (%rsp)
callq 0x18f50
movq (%rsp), %rsi
movl %eax, %edx
movl $0x4e, %edi
movb $0x0, %al
callq 0x8c00
movl $0x28, %edi
movl $0x29, %esi
callq 0x17f10
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/ldscript.c
// Function: sc_extern
static void sc_extern(struct GlobalVars *gv)
/* EXTERN(symbol [symbol...]) */
{
  if (startofblock('(')) {
    char c;

    do {
      char *name = getword();

      if (*name)
        add_symnames(&gv->undef_syms,allocstring(name));
      else
        error(78,scriptname,getlineno());   /* missing argument */

      if (c = getchr())
        back(1);
    }
    while (c!='\0' && c!=')');

    endofblock('(',')');
  }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl $0x28, %edi
callq 0x17e00
cmpl $0x0, %eax
je 0x146b2
jmp 0x145fe
callq 0x167b0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpb $0x0, (%rax)
je 0x1463b
movq 0x30(%rsp), %rax
addq $0xb8, %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rdi
callq 0x72d0
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x8a50
jmp 0x1465f
movq 0x303ae(%rip), %rax     # 0x449f0
movq %rax, 0x10(%rsp)
callq 0x18f50
movq 0x10(%rsp), %rsi
movl %eax, %edx
movl $0x4e, %edi
movb $0x0, %al
callq 0x8c00
callq 0x18790
movb %al, 0x2f(%rsp)
cmpb $0x0, %al
je 0x14676
movl $0x1, %edi
callq 0x18830
jmp 0x14678
movsbl 0x2f(%rsp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0xf(%rsp)
je 0x14697
movsbl 0x2f(%rsp), %eax
cmpl $0x29, %eax
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x145fe
movl $0x28, %edi
movl $0x29, %esi
callq 0x17f10
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/ldscript.c
// Function: sc_fill
static void sc_fill(struct GlobalVars *gv)
/* FILL(data16) */
{
  if (startofblock('(')) {
    lword val;

    if (parse_expr(preparse ? -1 : 0,&val))
      gv->filldata = (uint16_t)(val & 0xffff);
    else
      error(67,scriptname,getlineno());  /* Absolute number expected */
    endofblock('(',')');
  }
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x28, %edi
callq 0x17e00
cmpl $0x0, %eax
je 0x1474a
movl 0x30352(%rip), %edx     # 0x44a30
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x0, %edx
cmovnel %ecx, %eax
movslq %eax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x18a10
cmpl $0x0, %eax
je 0x14719
movq 0x8(%rsp), %rax
andq $0xffff, %rax           # imm = 0xFFFF
movw %ax, %cx
movq 0x10(%rsp), %rax
movw %cx, 0x200(%rax)
jmp 0x1473b
movq 0x302d0(%rip), %rax     # 0x449f0
movq %rax, (%rsp)
callq 0x18f50
movq (%rsp), %rsi
movl %eax, %edx
movl $0x43, %edi
movb $0x0, %al
callq 0x8c00
movl $0x28, %edi
movl $0x29, %esi
callq 0x17f10
addq $0x18, %rsp
retq
nop