LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: targetlink
static int targetlink(struct GlobalVars *gv,struct LinkedSection *ls,
                      struct Section *s)
/* returns 1, if target requires the combination of the two sections, */
/* returns -1, if target doesn't want to combine them, */
/* returns 0, if target doesn't care - standard linking rules are used. */
{
  static char *merged = "__MERGED";

  /* AmigaDOS doesn't merge unnamed sections, unless the Small- */
  /* Data/Code option was set */
  if (!(gv->small_code && s->type==ST_CODE) &&
      !(gv->small_data && (s->type==ST_DATA || s->type==ST_UDATA)))
    if (*(ls->name)==0 && *(s->name)==0)
      return (-1);

  /* sections with name "_NOMERGE" are never combined */
  if (!strcmp(s->name,"_NOMERGE"))
    return (-1);

  /* Executable only: */
  if (!gv->dest_object) {
    if (!strcmp(ls->name,merged) && !strcmp(s->name,merged)) {
      /* data and bss section with name __MERGED are always combined */
      if (s->type == ST_CODE)
        error(57,getobjname(s->obj)); /* Merging code section "__MERGED" */
      return (1);
    }
  }

  return (0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
cmpl $0x0, 0x70(%rdi)
pushq $-0x1
popq %rbx
je 0x10d75
cmpb $0x1, 0x2c(%r14)
je 0x10d99
cmpl $0x0, 0x74(%r12)
je 0x10d87
movb 0x2c(%r14), %al
andb $-0x2, %al
cmpb $0x2, %al
je 0x10d99
movq 0x18(%r15), %rax
cmpb $0x0, (%rax)
jne 0x10d99
movq 0x20(%r14), %rax
cmpb $0x0, (%rax)
je 0x10e01
movq 0x20(%r14), %r13
leaq 0x103cd(%rip), %rsi     # 0x21171
movq %r13, %rdi
callq 0x5160
testl %eax, %eax
je 0x10e01
xorl %ebx, %ebx
cmpl $0x0, 0x54(%r12)
jne 0x10e01
movq 0x18(%r15), %rdi
leaq 0x103a3(%rip), %rsi     # 0x21168
callq 0x5160
testl %eax, %eax
jne 0x10e01
leaq 0x10393(%rip), %rsi     # 0x21168
movq %r13, %rdi
callq 0x5160
testl %eax, %eax
jne 0x10e01
pushq $0x1
popq %rbx
cmpb $0x1, 0x2c(%r14)
jne 0x10e01
movq 0x10(%r14), %rdi
callq 0x6e1c
pushq $0x39
popq %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x6c19
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: ehf_findsymbol
static struct Symbol *ehf_findsymbol(struct GlobalVars *gv,
                                     struct Section *sec,const char *name)
{
  struct Symbol *sym = gv->symbols[elf_hash(name)%SYMHTABSIZE];
  struct Symbol *second_choice = NULL;

  while (sym) {
    if (!strcmp(name,sym->name)) {
      if (second_choice == NULL)
        second_choice = sym;

      if (sec!=NULL && sym->type==SYM_RELOC) {
        /* we prefer symbols from a section which has the same CPU-flags
           as the caller's section */
        if ((sec->flags & SF_EHFPPC) == (sym->relsect->flags & SF_EHFPPC))
          break;
      }
      else
        break;
    }
    sym = sym->glob_chain;
  }

  /* accept symbol from a section for a different CPU, if it's the only one */
  if (!sym && second_choice)
    sym = second_choice;

  if (sym)
    if (sym->type == SYM_INDIR)
      return (ehf_findsymbol(gv,sec,sym->indir_name));

  return (sym);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
movq 0x180(%r14), %r15
movq %r12, %rdi
callq 0x69ee
movzwl %ax, %eax
leaq (%r15,%rax,8), %r13
xorl %r15d, %r15d
movq (%r13), %r13
testq %r13, %r13
je 0x10e78
movq 0x20(%r13), %rsi
movq %r12, %rdi
callq 0x5160
testl %eax, %eax
jne 0x10e72
testq %r15, %r15
cmoveq %r13, %r15
testq %rbx, %rbx
je 0x10e78
cmpb $0x2, 0x40(%r13)
jne 0x10e78
movq 0x38(%r13), %rax
movb 0x2d(%rax), %al
xorb 0x2d(%rbx), %al
testb $0x20, %al
je 0x10e78
addq $0x10, %r13
jmp 0x10e38
testq %r15, %r15
cmoveq %r13, %r15
testq %r13, %r13
cmovneq %r13, %r15
testq %r15, %r15
je 0x10e98
cmpb $0x4, 0x40(%r15)
jne 0x10e98
movq 0x28(%r15), %r12
jmp 0x10e1f
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: ados_setlnksym
static void ados_setlnksym(struct GlobalVars *gv,struct Symbol *xdef)
/* Initialize ADOS linker symbol structure during resolve_xref() */
{
  if (xdef->flags & SYMF_LNKSYM) {
    struct LinkedSection *ls,*sdsec=NULL;

    if (xdef->extra == ELFS2) {
      if (!(sdsec = find_lnksec(gv,sdata2_name,ST_DATA,0,0,0)))
        if (!(sdsec = find_lnksec(gv,sbss2_name,ST_UDATA,0,0,0)))
          sdsec = smalldata_section(gv);
      xdef->relsect = (struct Section *)sdsec->sections.first;
    }
    else if (xdef->extra!=SASCT && xdef->extra!=SASDT) {
      sdsec = smalldata_section(gv);
      xdef->relsect = (struct Section *)sdsec->sections.first;
    }
    switch (xdef->extra) {
      case PHXDL:
      case SASBB:
      case DICDL:
        xdef->value = (lword)sdsec->filesize;
        break;
      case PHXBL:
      case SASBL:
      case DICBL:
        xdef->value = (lword)(sdsec->size - sdsec->filesize);
        break;
      case SASPT:
      case ELFSD:
      case ELFS2:
        xdef->value = (lword)fff[gv->dest_format]->baseoff;
        break;
      case GNUTL:
        if (ls = find_lnksec(gv,NULL,ST_CODE,0,0,0))
          xdef->value = (lword)ls->size;
        break;
      case GNUDL:
        if (ls = find_lnksec(gv,NULL,ST_DATA,0,0,0))
          xdef->value = (lword)ls->size;
        break;
      case GNUBL:
        if (ls = find_lnksec(gv,NULL,ST_UDATA,0,0,0))
          xdef->value = (lword)ls->size;
        break;        
    }
    xdef->flags &= ~SYMF_LNKSYM;  /* do not init again */
  }
}

// Assembly:
testb $0x1, 0x41(%rsi)
je 0x110ce
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x48(%rsi), %ecx
leal -0x6(%rcx), %eax
cmpl $0x2, %eax
jae 0x11003
xorl %eax, %eax
jmp 0x11059
cmpl $0x11, %ecx
jne 0x11046
leaq 0xf5af(%rip), %rsi      # 0x205be
pushq $0x2
popq %rdx
movq %r14, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xb7e9
testq %rax, %rax
jne 0x1104e
leaq 0xf598(%rip), %rsi      # 0x205c6
pushq $0x3
popq %rdx
movq %r14, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xb7e9
testq %rax, %rax
jne 0x1104e
movq %r14, %rdi
callq 0xc25a
movq 0x60(%rax), %rcx
movq %rcx, 0x38(%rbx)
movl 0x48(%rbx), %ecx
decl %ecx
cmpl $0x10, %ecx
ja 0x110c3
leaq 0xff05(%rip), %rdx      # 0x20f6c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x50(%rax), %rcx
jmp 0x110bf
movzbl 0x50(%r14), %eax
leaq 0x1e10e(%rip), %rcx     # 0x2f190
movq (%rcx,%rax,8), %rax
movslq 0x9c(%rax), %rcx
jmp 0x110bf
movq 0x48(%rax), %rcx
subq 0x50(%rax), %rcx
jmp 0x110bf
pushq $0x2
jmp 0x110a3
pushq $0x3
jmp 0x110a3
pushq $0x1
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xb7e9
testq %rax, %rax
je 0x110c3
movq 0x48(%rax), %rcx
movq %rcx, 0x30(%rbx)
andb $-0x2, 0x41(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: movehunkptr32
static void movehunkptr32(struct HunkInfo *hi,uint32_t n)
/* skip n 32-bit words */
{
  long offset = (long)n << 2;

  if ((hi->hunkcnt -= offset) < 0)
    error(13,hi->filename);  /* File format corrupted */
  hi->hunkptr += offset;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %r14d
shlq $0x2, %r14
subq %r14, 0x10(%rdi)
jns 0x119ab
movq 0x18(%rbx), %rsi
pushq $0xd
popq %rdi
xorl %eax, %eax
callq 0x6c19
addq %r14, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: nextword32
static uint32_t nextword32(struct HunkInfo *hi)
/* read next 32-bit word */
{
  uint32_t w;

  if ((hi->hunkcnt -= sizeof(uint32_t)) < 0)
    error(13,hi->filename);  /* File format corrupted */
  w = read32be(hi->hunkptr);
  hi->hunkptr += sizeof(uint32_t);
  return (w);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $-0x4, 0x10(%rdi)
jns 0x119d0
movq 0x18(%rbx), %rsi
pushq $0xd
popq %rdi
xorl %eax, %eax
callq 0x6c19
movq 0x8(%rbx), %rdi
callq 0x6607
addq $0x4, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: nextword16
static uint16_t nextword16(struct HunkInfo *hi)
/* read next 16-bit word */
{
  uint16_t w;

  if ((hi->hunkcnt -= sizeof(uint16_t)) < 0)
    error(13,hi->filename);  /* File format corrupted */
  w = read16be(hi->hunkptr);
  hi->hunkptr += sizeof(uint16_t);
  return (w);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $-0x2, 0x10(%rdi)
jns 0x119f9
movq 0x18(%rbx), %rsi
pushq $0xd
popq %rdi
xorl %eax, %eax
callq 0x6c19
movq 0x8(%rbx), %rdi
callq 0x65ff
addq $0x2, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: movehunkptr16
static void movehunkptr16(struct HunkInfo *hi,uint32_t n)
/* skip n 16-bit words */
{
  long offset = (long)n << 1;

  if ((hi->hunkcnt -= offset) < 0)
    error(13,hi->filename);  /* File format corrupted */
  hi->hunkptr += offset;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %r14d
addq %r14, %r14
subq %r14, 0x10(%rdi)
jns 0x11a2a
movq 0x18(%rbx), %rsi
pushq $0xd
popq %rdi
xorl %eax, %eax
callq 0x6c19
addq %r14, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: gethunkname
static char *gethunkname(struct HunkInfo *hi)
/* read 32-bit aligned name, the most significant byte of the */
/* length specifier is ignored (for HUNK_EXT names, for example) */
{
  uint32_t n;
  char *s=NULL;

  if (n = nextword32(hi) & 0xffffff) {  /* name given? */
    s = alloczero((n+1)<<2);
    strncpy(s,(char *)hi->hunkptr,n<<2);
    movehunkptr32(hi,n);
  }
  return (s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x119b7
movl %eax, %r14d
andl $0xffffff, %r14d        # imm = 0xFFFFFF
je 0x11aa8
leal (,%r14,4), %r12d
leal 0x4(,%r14,4), %edi
callq 0x638a
movq %rax, %r15
movq 0x8(%rbx), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x5060
movq %rbx, %rdi
movl %r14d, %esi
callq 0x11989
jmp 0x11aab
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: addlongrelocs
static bool addlongrelocs(struct GlobalVars *gv,struct HunkInfo *hi,
                          struct Section *s,uint8_t type,uint16_t size)
/* convert an amigahunk/ehf relocation hunk into an internal Reloc node */
{
  uint32_t n,id,offs;
  uint16_t pos = 0;
  lword mask = -1;
  struct Reloc *r;

  if (size == 24) {  /* EHF/PPC 26-bit branch */
    pos = 6;
    mask = ~3;  /* 0xfffffffc */
  }
  if (s) {
    nextword32(hi);
    while (n = nextword32(hi)) {
      id = nextword32(hi);  /* add base addr. of section with this index */
      while (n--) {
        offs = nextword32(hi);
        r = newreloc(gv,s,NULL,NULL,id,offs,type,
                     readsection(gv,type,s->data+offs,pos,size,mask));
        addreloc(s,r,pos,size,mask);
      }
    }
    return (TRUE);
  }
  return (FALSE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %ebp
movq %rsi, %r12
movq %rdi, 0x30(%rsp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl $0x18, %r8d
setne %sil
pushq $0x6
popq %r15
cmovnel %eax, %r15d
movq %rdx, 0x28(%rsp)
testq %rdx, %rdx
je 0x11bc5
movl %r8d, %r14d
movb %sil, %cl
negl %ecx
orq $-0x4, %rcx
movq %rcx, 0x20(%rsp)
movq %r12, %rdi
callq 0x119b7
movzbl %bpl, %eax
movq %rax, 0x18(%rsp)
movzwl %r15w, %eax
movl %eax, 0x8(%rsp)
movzwl %r14w, %eax
movl %eax, 0x4(%rsp)
movq %r12, 0x10(%rsp)
movq 0x28(%rsp), %r13
movq 0x30(%rsp), %rbp
movq 0x18(%rsp), %rbx
movq 0x20(%rsp), %r14
movq %r12, %rdi
callq 0x119b7
testl %eax, %eax
je 0x11bc2
movl %eax, %r15d
movq %r12, %rdi
callq 0x119b7
movl %eax, 0xc(%rsp)
subl $0x1, %r15d
jb 0x11b3f
movq %r12, %rdi
callq 0x119b7
movl %eax, %r12d
movq 0x40(%r13), %rdx
addq %r12, %rdx
movq %rbp, %rdi
movl %ebx, %esi
movl 0x8(%rsp), %ecx
movl 0x4(%rsp), %r8d
movq %r14, %r9
callq 0xae9b
movq %rbp, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl 0xc(%rsp), %r8d
movq %r12, %r9
movq 0x10(%rsp), %r12
pushq %rax
pushq %rbx
callq 0xabec
addq $0x10, %rsp
movq %r13, %rdi
movq %rax, %rsi
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
movq %r14, %r8
callq 0xac9f
jmp 0x11b5a
pushq $0x1
popq %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: addshortrelocs32
static bool addshortrelocs32(struct GlobalVars *gv,struct HunkInfo *hi,
                             struct Section *s)
/* convert an amigahunk/ehf abs-reloc32 hunk into an internal Reloc node */
{
  uint32_t n,id,offs;
  struct Reloc *r;

  if (s) {
    nextword32(hi);
    while (n = (uint32_t)nextword16(hi)) {
      id = (uint32_t)nextword16(hi); /* add base addr. of sec. with this idx. */
      while (n--) {
        offs = (uint32_t)nextword16(hi);
        r = newreloc(gv,s,NULL,NULL,id,offs,R_ABS,
                     readsection(gv,R_ABS,s->data+offs,0,32,-1));
        addreloc(s,r,0,32,-1);  /* standard 32-bit reloc */
      }
    }
    alignhunkptr(hi);
    return (TRUE);
  }
  return (FALSE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
testq %rdx, %rdx
je 0x11ca5
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x119b7
movq %rbx, 0x10(%rsp)
movq 0x18(%rsp), %r13
movq 0x20(%rsp), %r14
pushq $0x20
popq %rbp
pushq $-0x1
popq %r15
movq %rbx, %rdi
callq 0x119e0
testw %ax, %ax
je 0x11c98
movzwl %ax, %r12d
movq %rbx, %rdi
callq 0x119e0
movzwl %ax, %eax
movl %eax, 0xc(%rsp)
subl $0x1, %r12d
jb 0x11c16
movq %rbx, %rdi
callq 0x119e0
movzwl %ax, %ebx
movq 0x40(%r13), %rdx
addq %rbx, %rdx
movq %r14, %rdi
pushq $0x1
popq %rsi
xorl %ecx, %ecx
movl %ebp, %r8d
movq %r15, %r9
callq 0xae9b
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl 0xc(%rsp), %r8d
movq %rbx, %r9
movq 0x10(%rsp), %rbx
pushq %rax
pushq $0x1
callq 0xabec
addq $0x10, %rsp
movq %r13, %rdi
movq %rax, %rsi
xorl %edx, %edx
movl %ebp, %ecx
movq %r15, %r8
callq 0xac9f
jmp 0x11c36
movq %rbx, %rdi
callq 0x11a36
pushq $0x1
popq %rax
jmp 0x11ca7
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: create_xdef
static void create_xdef(struct GlobalVars *gv,struct Section *s,
                        char *name,int32_t val,uint8_t type,uint8_t bind)
/* add new symbol to the symbols list of the current object unit */
{
  struct Symbol *sym;
  uint32_t size = 0;

  if (type == SYM_COMMON) {
    /* Oh, a common symbol? A rare guest! :) */
    size = val;  /* its size was stored in val */
    val = 4;     /* how about a 32-bit alignment? */
    s = common_section(gv,s->obj);
  }

  if (sym = addsymbol(gv,s,name,NULL,(lword)val,
                      type,0,SYMI_NOTYPE,bind,size,FALSE)) {
    /* Symbol already defined. If defined globally, ignore it. */
    /* Otherwise, change into a global definition. */
    if (sym->bind != SYMB_GLOBAL) {
      if (bind == SYMB_GLOBAL) {
        sym->value = (lword)val;  /* redefine as global (xdef) symbol */
        sym->relsect = s;
        sym->type = type;
        sym->flags = 0;
        sym->info = SYMI_NOTYPE;
        sym->bind = SYMB_GLOBAL;
        sym->size = size;
        addglobsym(gv,sym);
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %r15d
movl %r8d, %ebp
movl %ecx, %r14d
movq %rsi, %r12
movq %rdi, %rbx
cmpl $0x3, %r8d
jne 0x11cf4
movq 0x10(%r12), %rsi
movq %rbx, %rdi
movq %rdx, %r12
callq 0xbb2a
movq %r12, %rdx
movq %rax, %r12
pushq $0x4
popq %rax
jmp 0x11cfa
movl %r14d, %eax
xorl %r14d, %r14d
movslq %eax, %r13
andl $0x0, 0x20(%rsp)
movl %r14d, 0x18(%rsp)
andl $0x0, 0x8(%rsp)
movzbl %r15b, %eax
andl $0x0, (%rsp)
movl %eax, 0x10(%rsp)
movzbl %bpl, %r9d
movq %rbx, %rdi
movq %r12, %rsi
xorl %ecx, %ecx
movq %r13, %r8
callq 0xa5d5
testq %rax, %rax
je 0x11d6f
cmpb $0x2, %r15b
jne 0x11d6f
cmpb $0x2, 0x43(%rax)
je 0x11d6f
movq %r13, 0x30(%rax)
movq %r12, 0x38(%rax)
movb %bpl, 0x40(%rax)
andw $0x0, 0x41(%rax)
movb $0x2, 0x43(%rax)
movl %r14d, 0x44(%rax)
movq %rbx, %rdi
movq %rax, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa32a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: create_xrefs
static void create_xrefs(struct GlobalVars *gv,struct HunkInfo *hi,
                         struct Section *s,char *name,
                         uint8_t rtype,uint16_t size)
/* add new unresolved symbol reference to the current section */
{
  uint32_t n = nextword32(hi);  /* number of references */
  uint32_t offs;
  uint16_t pos = 0;
  lword mask = -1;
  struct Reloc *r;

  if (size == 24) {  /* EHF/PPC 26-bit branch */
    pos = 6;
    mask = ~3;  /* 0xfffffffc */
  }
  while (n--) {
    offs = nextword32(hi);
    r = newreloc(gv,s,name,NULL,0,offs,rtype,
                 readsection(gv,rtype,s->data+offs,pos,size,mask));
    addreloc(s,r,pos,size,mask);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, %r12d
movl %r8d, %ebx
movq %rcx, 0x30(%rsp)
movq %rdx, 0x8(%rsp)
movq %rdi, 0x20(%rsp)
movq %rsi, 0x28(%rsp)
movq %rsi, %rdi
callq 0x119b7
movl %eax, %ebp
xorl %eax, %eax
xorl %edx, %edx
cmpl $0x18, %r12d
setne %dl
pushq $0x6
popq %rcx
cmovnel %eax, %ecx
negl %edx
orq $-0x4, %rdx
movq %rdx, 0x18(%rsp)
movzbl %bl, %eax
movq %rax, 0x10(%rsp)
movzwl %cx, %eax
movl %eax, 0x4(%rsp)
movzwl %r12w, %eax
movl %eax, (%rsp)
movq 0x8(%rsp), %r14
movq 0x20(%rsp), %rbx
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r15
subl $0x1, %ebp
jb 0x11e5b
movq 0x28(%rsp), %rdi
callq 0x119b7
movl %eax, %r13d
movq 0x40(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movl %r12d, %esi
movl 0x4(%rsp), %ecx
movl (%rsp), %r8d
movq %r15, %r9
callq 0xae9b
movq %rbx, %rdi
movq %r14, %rsi
movq 0x30(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r13, %r9
pushq %rax
pushq %r12
callq 0xabec
addq $0x10, %rsp
movq %r14, %rdi
movq %rax, %rsi
movl 0x4(%rsp), %edx
movl (%rsp), %ecx
movq %r15, %r8
callq 0xac9f
jmp 0x11df6
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: hunk_name_len
static void hunk_name_len(FILE *f,const char *name)
/* writes a string in hunk-format style, i.e. first longword contains */
/* strlen in longwords and then follows the string itself, long-aligned */
{
  size_t l=strlen(name);

  fwrite32be(f,l?((l+3)>>2):0);
  fwritex(f,name,l);
  fwrite_align(f,2,l);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x50e0
movq %rax, %r15
leaq 0x3(%rax), %rsi
shrq $0x2, %rsi
movq %r14, %rdi
callq 0x6856
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x6817
pushq $0x2
popq %rsi
movq %r14, %rdi
movl %r15d, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x693c
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: fix_reloc_addends
static void fix_reloc_addends(struct GlobalVars *gv,struct LinkedSection *ls)
{
  struct Reloc *rel;

  for (rel=(struct Reloc *)ls->relocs.first;
       rel->n.next!=NULL; rel=(struct Reloc *)rel->n.next) {
    writesection(gv,ls->data+rel->offset,rel,rel->addend);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x80(%rsi), %r15
movq (%r15), %r15
cmpq $0x0, (%r15)
je 0x125cd
movq 0x78(%rbx), %rsi
addq 0x20(%r15), %rsi
movq 0x28(%r15), %rcx
movq %r14, %rdi
movq %r15, %rdx
callq 0xaf7b
jmp 0x125ab
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: unsupp_relocs
static void unsupp_relocs(struct LinkedSection *sec)
{
  struct Reloc *rel;

  while (rel = (struct Reloc *)remhead(&sec->relocs)) {
    error(32,fff_amigahunk.tname,reloc_name[rel->rtype],
          (int)rel->insert->bpos,(int)rel->insert->bsiz,
          rel->insert->mask,sec->name,rel->offset);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x1c9e9(%rip), %r15     # 0x2f300
pushq $0x20
popq %rbp
movq %r14, %rdi
callq 0x642a
testq %rax, %rax
je 0x1295e
movq %rax, %r10
movq 0x1cc97(%rip), %rsi     # 0x2f5c8
movzbl 0x38(%rax), %eax
movq (%r15,%rax,8), %rdx
movq 0x30(%r10), %rax
movzwl 0x8(%rax), %ecx
movzwl 0xa(%rax), %r8d
movq 0x10(%rax), %r9
movl %ebp, %edi
xorl %eax, %eax
pushq 0x20(%r10)
pushq 0x18(%rbx)
callq 0x6c19
popq %rax
popq %rcx
jmp 0x1291a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: unsupp_symbols
static void unsupp_symbols(struct LinkedSection *sec)
{
  struct Symbol *sym;

  while (sym = (struct Symbol *)remhead(&sec->symbols)) {
    error(33,fff_amigahunk.tname,sym->name,sym_bind[sym->bind],
          sym_type[sym->type],sym_info[sym->info]);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
addq $0xb0, %rbx
leaq 0x1c7ec(%rip), %r14     # 0x2f2e0
leaq 0x1c785(%rip), %r15     # 0x2f280
leaq 0x1c7ae(%rip), %r12     # 0x2f2b0
pushq $0x21
popq %rbp
movq %rbx, %rdi
callq 0x642a
testq %rax, %rax
je 0x12b40
movq 0x1caaf(%rip), %rsi     # 0x2f5c8
movq 0x20(%rax), %rdx
movzbl 0x43(%rax), %ecx
movq (%r14,%rcx,8), %rcx
movzbl 0x40(%rax), %edi
movq (%r15,%rdi,8), %r8
movzbl 0x42(%rax), %eax
movq (%r12,%rax,8), %r9
movl %ebp, %edi
xorl %eax, %eax
callq 0x6c19
jmp 0x12b05
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_amigahunk.c
// Function: linedebug_hunks
static void linedebug_hunks(struct GlobalVars *gv,FILE *f,
                            struct LinkedSection *ls)
{
  struct Section *sec = (struct Section *)ls->sections.first;
  struct Section *nextsec;
  struct LineDebug *ldb;

  while (nextsec = (struct Section *)sec->n.next) {
    if (ldb = (struct LineDebug *)sec->special) {
      do {
        if (ldb->tgext.id==TGEXT_AMIGAOS && ldb->tgext.sub_id==SUBID_LINE) {
          uint32_t i,*lptr,*optr;

          fwrite32be(f,HUNK_DEBUG);
          fwrite32be(f,3 + strlen32(ldb->source_name) +
                     (ldb->num_entries<<1));
          fwrite32be(f,(uint32_t)sec->offset);
          fwrite32be(f,0x4c494e45);  /* "LINE" */
          hunk_name_len(f,ldb->source_name);
          for (i=0,lptr=ldb->lines,optr=ldb->offsets;
               i<ldb->num_entries; i++) {
            fwrite32be(f,*lptr++);
            fwrite32be(f,*optr++);
          }
        }
      }
      while (ldb = (struct LineDebug *)ldb->tgext.next);
    }
    sec = nextsec;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x60(%rsi), %rax
movq %rax, %r15
movq (%rax), %rax
testq %rax, %rax
je 0x12c2b
movq 0x88(%r15), %r12
testq %r12, %r12
je 0x12b5b
movq %rax, (%rsp)
cmpb $0x1, 0x8(%r12)
jne 0x12c15
cmpb $0x1, 0x9(%r12)
jne 0x12c15
movq %rbx, %rdi
movl $0x3f1, %esi            # imm = 0x3F1
callq 0x6856
movq 0x10(%r12), %rdi
callq 0x12c3a
movl 0x18(%r12), %ecx
leal (%rax,%rcx,2), %esi
addl $0x3, %esi
movq %rbx, %rdi
callq 0x6856
movl 0x38(%r15), %esi
movq %rbx, %rdi
callq 0x6856
movq %rbx, %rdi
movl $0x4c494e45, %esi       # imm = 0x4C494E45
callq 0x6856
movq 0x10(%r12), %rsi
movq %rbx, %rdi
callq 0x12552
movq 0x20(%r12), %r13
movq 0x28(%r12), %rbp
xorl %r14d, %r14d
cmpl 0x18(%r12), %r14d
jae 0x12c15
movl (%r13,%r14,4), %esi
movq %rbx, %rdi
callq 0x6856
movl (%rbp,%r14,4), %esi
movq %rbx, %rdi
callq 0x6856
incq %r14
jmp 0x12bef
movq (%r12), %r12
testq %r12, %r12
jne 0x12b7a
movq (%rsp), %rax
jmp 0x12b5b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_shstrtab
char *elf32_shstrtab(struct LinkFile *lf,struct Elf32_Ehdr *ehdr)
/* returns a pointer to the section header string table, if present, */
/* or NULL, otherwise */
{
  bool be = (ehdr->e_ident[EI_DATA] == ELFDATA2MSB);
  uint16_t i;
  struct Elf32_Shdr *shdr;
  char *stab;

  if (i = read16(be,ehdr->e_shstrndx)) {
    shdr = elf32_shdr(lf,ehdr,i);
    if (read32(be,shdr->sh_type) != SHT_STRTAB)
      error(45,lf->pathname,lf->objname);  /* illegal type */
    stab = ((char *)ehdr) + read32(be,shdr->sh_offset);
    if (((uint8_t *)stab < lf->data) || 
        ((uint8_t *)stab + read32(be,shdr->sh_size) > lf->data + lf->length))
      error(46,lf->pathname,lf->objname);  /* illegal offset */
    else
      return stab;
  }
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
cmpb $0x2, 0x5(%rsi)
sete %bpl
addq $0x32, %rsi
movl %ebp, %edi
callq 0x663d
testw %ax, %ax
je 0x13040
movzwl %ax, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x13050
movq %rax, %r15
leaq 0x4(%rax), %rsi
movl %ebp, %edi
callq 0x664d
cmpl $0x3, %eax
je 0x12ff4
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rdx
pushq $0x2d
popq %rdi
xorl %eax, %eax
callq 0x6c19
leaq 0x10(%r15), %rsi
movl %ebp, %edi
callq 0x664d
movl %eax, %eax
addq %rax, %rbx
cmpq 0x28(%r14), %rbx
jb 0x1302a
addq $0x14, %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x664d
movl %eax, %eax
addq %rbx, %rax
movq 0x28(%r14), %rcx
addq 0x30(%r14), %rcx
cmpq %rcx, %rax
jbe 0x13042
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rdx
xorl %ebx, %ebx
pushq $0x2e
popq %rdi
xorl %eax, %eax
callq 0x6c19
jmp 0x13042
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_shdr
struct Elf32_Shdr *elf32_shdr(struct LinkFile *lf,struct Elf32_Ehdr *ehdr,
                              uint16_t idx)
/* return pointer to section header #idx */
{
  bool be = (ehdr->e_ident[EI_DATA] == ELFDATA2MSB);
  struct Elf32_Shdr *shdr;

  if (idx < read16(be,ehdr->e_shnum)) {
    shdr = (struct Elf32_Shdr *)(((char *)ehdr) + ((read32(be,ehdr->e_shoff) +
           (uint32_t)read16(be,ehdr->e_shentsize) * (uint32_t)idx)));
    if (((uint8_t *)shdr < lf->data) ||
        (((uint8_t *)shdr)+read16(be,ehdr->e_shentsize) > lf->data+lf->length))
      /* section header #x has illegal offset */
      error(44,lf->pathname,(int)idx,lf->objname);
    return shdr;
  }
  else  /* Invalid ELF section header index */
    error(43,lf->pathname,(int)idx,lf->objname);
  return NULL;  /* not reached, for compiler's sake */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, %r14
xorl %ebp, %ebp
cmpb $0x2, 0x5(%rsi)
sete %bpl
addq $0x30, %rsi
movl %ebp, %edi
callq 0x663d
cmpw %bx, %ax
jbe 0x130d5
leaq 0x20(%r12), %rsi
movl %ebp, %edi
callq 0x664d
movl %eax, 0x4(%rsp)
leaq 0x2e(%r12), %r13
movl %ebp, %edi
movq %r13, %rsi
callq 0x663d
movzwl %ax, %r15d
imull %ebx, %r15d
addl 0x4(%rsp), %r15d
addq %r12, %r15
pushq $0x2c
popq %r12
cmpq 0x28(%r14), %r15
jb 0x130dc
movl %ebp, %edi
movq %r13, %rsi
callq 0x663d
movzwl %ax, %eax
addq %r15, %rax
movq 0x28(%r14), %rcx
addq 0x30(%r14), %rcx
cmpq %rcx, %rax
ja 0x130dc
jmp 0x130f0
pushq $0x2b
popq %r12
xorl %r15d, %r15d
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
movl %r12d, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x6c19
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_strtab
char *elf32_strtab(struct LinkFile *lf,struct Elf32_Ehdr *ehdr,int idx)
/* returns a pointer to the string table */
{
  static char *tabname = "string";
  bool be = (ehdr->e_ident[EI_DATA] == ELFDATA2MSB);
  struct Elf32_Shdr *shdr;
  char *stab;

  shdr = elf32_shdr(lf,ehdr,idx);
  if (read32(be,shdr->sh_type) != SHT_STRTAB)
     error(50,lf->pathname,tabname,lf->objname);  /* illegal type */
  stab = ((char *)ehdr) + read32(be,shdr->sh_offset);
  if (((uint8_t *)stab < lf->data) || 
      ((uint8_t *)stab + read32(be,shdr->sh_size) > lf->data + lf->length))
    error(51,lf->pathname,tabname,lf->objname);  /* illegal offset */
  return stab;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
cmpb $0x2, 0x5(%rsi)
sete %bpl
movzwl %dx, %edx
callq 0x13050
movq %rax, %r15
leaq 0x4(%rax), %rsi
movl %ebp, %edi
callq 0x664d
cmpl $0x3, %eax
je 0x1314d
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0xe39b(%rip), %rdx      # 0x214de
pushq $0x32
popq %rdi
xorl %eax, %eax
callq 0x6c19
leaq 0x10(%r15), %rsi
movl %ebp, %edi
callq 0x664d
movl %eax, %eax
addq %rax, %rbx
cmpq 0x28(%r14), %rbx
jb 0x13183
addq $0x14, %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x664d
movl %eax, %eax
addq %rbx, %rax
movq 0x28(%r14), %rcx
addq 0x30(%r14), %rcx
cmpq %rcx, %rax
jbe 0x1319c
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0xe34c(%rip), %rdx      # 0x214de
pushq $0x33
popq %rdi
xorl %eax, %eax
callq 0x6c19
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_symtab
struct Elf32_Sym *elf32_symtab(struct LinkFile *lf,struct Elf32_Ehdr *ehdr,
                               int idx)
/* returns a pointer to the symbol table */
{
  static char *tabname = "symbol";
  bool be = (ehdr->e_ident[EI_DATA] == ELFDATA2MSB);
  struct Elf32_Shdr *shdr;
  struct Elf32_Sym *symtab;
  uint32_t shtype;

  shdr = elf32_shdr(lf,ehdr,idx);
  shtype = read32(be,shdr->sh_type);
  if (shtype!=SHT_SYMTAB && shtype!=SHT_DYNSYM)
     error(50,lf->pathname,tabname,lf->objname);  /* illegal type */
  symtab = (struct Elf32_Sym *)((uint8_t *)ehdr + read32(be,shdr->sh_offset));
  if (((uint8_t *)symtab < lf->data) || 
      ((uint8_t *)symtab + read32(be,shdr->sh_size) > lf->data + lf->length))
    error(51,lf->pathname,tabname,lf->objname);  /* illegal offset */
  return symtab;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %ebp, %ebp
cmpb $0x2, 0x5(%rsi)
sete %bpl
movzwl %dx, %edx
callq 0x13050
movq %rax, %r15
leaq 0x4(%rax), %rsi
movl %ebp, %edi
callq 0x664d
cmpl $0x2, %eax
je 0x131fa
cmpl $0xb, %eax
je 0x131fa
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0xc514(%rip), %rdx      # 0x1f704
pushq $0x32
popq %rdi
xorl %eax, %eax
callq 0x6c19
leaq 0x10(%r15), %rsi
movl %ebp, %edi
callq 0x664d
movl %eax, %eax
addq %rax, %rbx
cmpq 0x28(%r14), %rbx
jb 0x13230
addq $0x14, %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x664d
movl %eax, %eax
addq %rbx, %rax
movq 0x28(%r14), %rcx
addq 0x30(%r14), %rcx
cmpq %rcx, %rax
jbe 0x13249
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0xc4c5(%rip), %rdx      # 0x1f704
pushq $0x33
popq %rdi
xorl %eax, %eax
callq 0x6c19
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_lnksym
struct Symbol *elf32_lnksym(struct GlobalVars *gv,struct Section *sec,
                            struct Reloc *xref)
/* Check for common ELF32 linker symbols. */
{
  int i;

  if (!gv->dest_object) {
    for (i=0; i<(sizeof(elf32_symnames)/sizeof(elf32_symnames[0])); i++) {
      if (!strcmp(elf32_symnames[i],xref->xrefname))
        return elf32_makelnksym(gv,i);  /* new linker symbol created */
    }
  }
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x54(%rdi)
je 0x14633
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rdi, %rbx
movq 0x10(%rdx), %r15
leaq 0x1b1ef(%rip), %r12     # 0x2f830
xorl %r14d, %r14d
cmpq $0x7, %r14
je 0x14625
movq (%r12), %rdi
movq %r15, %rsi
callq 0x5160
testl %eax, %eax
je 0x14663
incq %r14
addq $0x8, %r12
jmp 0x14644
movq %rbx, %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x14676
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_makelnksym
static struct Symbol *elf32_makelnksym(struct GlobalVars *gv,int idx)
{
  struct Symbol *sym = addlnksymbol(gv,elf32_symnames[idx],0,SYM_ABS,
                                    SYMF_LNKSYM,SYMI_OBJECT,SYMB_GLOBAL,0);

  sym->extra = idx;  /* for easy ident. in elf32_setlnksym */
  switch (idx) {
    case SDABASE:
    case SDA2BASE:
      sym->type = SYM_RELOC;
      sym->value = (lword)fff[gv->dest_format]->baseoff;
      break;
    case GLOBOFFSTAB:
      sym->value = fff[gv->dest_format]->gotoff;
      gv->got_base_name = elf32_symnames[idx];
      break;
    case PROCLINKTAB:
      gv->plt_base_name = elf32_symnames[idx];
      break;
  }
  return sym;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movslq %esi, %r14
leaq 0x1b1a1(%rip), %r15     # 0x2f830
movq (%r15,%r14,8), %rsi
andl $0x0, 0x8(%rsp)
movl $0x2, (%rsp)
pushq $0x1
popq %rcx
xorl %edx, %edx
movl %ecx, %r8d
movl %ecx, %r9d
callq 0xa880
movl %r14d, 0x48(%rax)
cmpl $0x2, %r14d
jb 0x146d0
cmpl $0x4, %ebp
je 0x146f0
cmpl $0x5, %ebp
jne 0x14715
movq (%r15,%r14,8), %rcx
movq %rcx, 0x238(%rbx)
jmp 0x14715
movb $0x2, 0x40(%rax)
movzbl 0x50(%rbx), %ecx
leaq 0x1aab1(%rip), %rdx     # 0x2f190
movq (%rdx,%rcx,8), %rcx
movslq 0x9c(%rcx), %rcx
movq %rcx, 0x30(%rax)
jmp 0x14715
movzbl 0x50(%rbx), %ecx
leaq 0x1aa95(%rip), %rdx     # 0x2f190
movq (%rdx,%rcx,8), %rcx
movslq 0xa0(%rcx), %rcx
movq %rcx, 0x30(%rax)
movq (%r15,%r14,8), %rcx
movq %rcx, 0x230(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_initdynlink
void elf32_initdynlink(struct GlobalVars *gv)
{
  struct ObjectUnit *ou = gv->dynobj;
  struct Symbol *sym;

  /* set endianess for output file */
  elf32_endianess = fff[gv->dest_format]->endianess;

  /* init dynamic symbol list */
  initlist(&dynsym_list);

  /* allocate .interp section for dynamically linked executables only */
  if (!gv->dest_sharedobj)
    add_section(ou,".interp",(uint8_t *)gv->interp_path,
                strlen(gv->interp_path)+1,ST_DATA,SF_ALLOC,SP_READ,0,TRUE);

  /* .hash, .dynsym, .dynstr and .dynamic are always present.
     Set them to an initial size. They will grow with dynamic symbols added. */
  add_section(ou,hash_name,NULL,0,ST_DATA,SF_ALLOC,SP_READ,2,TRUE);
  add_section(ou,dynsym_name,NULL,0,ST_DATA,SF_ALLOC,SP_READ,2,TRUE);
  add_section(ou,dynstr_name,NULL,0,ST_DATA,SF_ALLOC,SP_READ,0,TRUE);
  dynamic = add_section(ou,dyn_name,NULL,0,ST_DATA,SF_ALLOC,
                        SP_READ|SP_WRITE,2,TRUE);

  /* assign symbol _DYNAMIC the address of the .dynamic section */
  sym = elf32_makelnksym(gv,DYNAMICSYM);
  sym->flags |= SYMF_DYNEXPORT;
  elf32_adddynsym(sym);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1e0(%rdi), %r14
movzbl 0x50(%rdi), %eax
leaq 0x1a935(%rip), %rcx     # 0x2f190
movq (%rcx,%rax,8), %rax
movb 0xaa(%rax), %al
movb %al, 0x1afb5(%rip)      # 0x2f820
leaq 0x1f43e(%rip), %rdi     # 0x33cb0
callq 0x63c8
cmpl $0x0, 0x58(%rbx)
pushq $0x1
popq %r15
jne 0x148bb
movq 0xe8(%rbx), %r12
movq %r12, %rdi
callq 0x50e0
leaq 0x1(%rax), %rcx
subq $0x8, %rsp
leaq 0xc436(%rip), %rsi      # 0x20cd5
pushq $0x2
popq %r8
movq %r14, %rdi
movq %r12, %rdx
movl %r15d, %r9d
pushq %r15
pushq $0x0
pushq %r15
callq 0xbab3
addq $0x20, %rsp
subq $0x8, %rsp
pushq $0x2
popq %r12
leaq 0xcb2d(%rip), %rsi      # 0x213f7
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r12d, %r8d
movl %r15d, %r9d
pushq %r15
pushq %r12
pushq %r15
callq 0xbab3
addq $0x18, %rsp
leaq 0xcb10(%rip), %rsi      # 0x213fd
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r12d, %r8d
movl %r15d, %r9d
pushq %r15
pushq %r12
pushq %r15
callq 0xbab3
addq $0x18, %rsp
leaq 0xcaf5(%rip), %rsi      # 0x21405
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r12d, %r8d
movl %r15d, %r9d
pushq %r15
pushq $0x0
pushq %r15
callq 0xbab3
addq $0x18, %rsp
leaq 0xcabb(%rip), %rsi      # 0x213ee
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r12d, %r8d
movl %r15d, %r9d
pushq %r15
pushq %r12
pushq $0x3
callq 0xbab3
addq $0x20, %rsp
movq %rax, 0x1f372(%rip)     # 0x33cc8
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0x14676
orb $-0x80, 0x41(%rax)
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x14978
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_adddynsym
void elf32_adddynsym(struct Symbol *sym)
{
  if (sym->flags & SYMF_DYNIMPORT) {
    elf32_addsym(&elf32dsymlist,&elf32dstrlist,sym->name,0,0,
                 STB_GLOBAL,STT_NOTYPE,SHN_UNDEF);
  }
  else if (sym->flags & SYMF_DYNEXPORT) {
    struct DynSymNode *dsn = alloc(sizeof(struct DynSymNode));

    /* section index and value need to be fixed later for these entries! */
    dsn->idx = elf32_addsym(&elf32dsymlist,&elf32dstrlist,sym->name,0,
                            sym->size,elf32_getbind(sym),elf32_getinfo(sym),0);
    dsn->sym = sym;
    addtail(&dynsym_list,&dsn->n);
  }
  else
    ierror("elf32_adddynsym(): <%s> was not flagged as dynamic",sym->name);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movb 0x41(%rdi), %al
testb $0x40, %al
jne 0x149b0
testb %al, %al
js 0x149e6
movq 0x20(%rbx), %rsi
leaq 0xcbb9(%rip), %rdi      # 0x21556
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6b2c
movq 0x20(%rbx), %rdx
andl $0x0, 0x8(%rsp)
andl $0x0, (%rsp)
leaq 0x1ad9c(%rip), %rdi     # 0x2f760
leaq 0x1adf5(%rip), %rsi     # 0x2f7c0
pushq $0x1
popq %r9
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x14bb2
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x6340
movq %rax, %r14
movq 0x20(%rbx), %r15
movl 0x44(%rbx), %ebp
movq %rbx, %rdi
callq 0x14d06
movl %eax, %r12d
movq %rbx, %rdi
callq 0x14d27
movzbl %al, %eax
movl %eax, (%rsp)
andl $0x0, 0x8(%rsp)
movzbl %r12b, %r9d
leaq 0x1ad3f(%rip), %rdi     # 0x2f760
leaq 0x1ad98(%rip), %rsi     # 0x2f7c0
movq %r15, %rdx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x14bb2
movl %eax, 0x18(%r14)
movq %rbx, 0x10(%r14)
leaq 0x1f26c(%rip), %rdi     # 0x33cb0
movq %r14, %rsi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6414
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_addsym
uint32_t elf32_addsym(struct SymTabList *sl,struct StrTabList *strl,
                      const char *name,uint32_t value,uint32_t size,
                      uint8_t bind,uint8_t type,uint16_t shndx)
/* add a new ELF symbol, return its symbol table index */
{
  bool be = elf32_endianess == _BIG_ENDIAN_;
  struct SymbolNode **chain,*sym;

  if (sl->hashtab == NULL) {
    /* initialize an unused symbol list */
    initlist(&sl->l);
    sl->hashtab = alloczero(sl->htabsize * sizeof(struct SymbolNode *));
    elf32_addsym(sl,strl,noname,0,0,0,0,SHN_UNDEF);
  }

  if (name == NULL)  /* do nothing, return first index */
    return 0;

  chain = &sl->hashtab[elf_hash(name) % sl->htabsize];

  while (sym = *chain)
    chain = &sym->hashchain;
  /* new symbol table entry */
  *chain = sym = alloczero(sizeof(struct SymbolNode));
  sym->name = name;
  sym->index = sl->nextindex++;
  addtail(&sl->l,&sym->n);
  write32(be,sym->s.st_name,elf32_addstrlist(strl,name));
  write32(be,sym->s.st_value,value);
  write32(be,sym->s.st_size,size);
  *sym->s.st_info = ELF32_ST_INFO(bind,type);
  write16(be,sym->s.st_shndx,shndx);
  return sym->index;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %ebx
movl %r8d, %r13d
movl %ecx, 0x1c(%rsp)
movq %rdx, %r12
movq %rsi, 0x20(%rsp)
xorl %ebp, %ebp
cmpb $0x1, 0x1ac45(%rip)     # 0x2f820
movq %rdi, %r14
sete %r15b
cmpq $0x0, 0x18(%rdi)
jne 0x14c27
movq %r14, %rdi
callq 0x63c8
movq 0x20(%r14), %rdi
shlq $0x3, %rdi
callq 0x638a
movq %rax, 0x18(%r14)
andl $0x0, 0x8(%rsp)
andl $0x0, (%rsp)
leaq 0xba3e(%rip), %rdx      # 0x20650
movq %r14, %rdi
movq 0x20(%rsp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x14bb2
testq %r12, %r12
je 0x14cf5
movl %r13d, 0x14(%rsp)
movl %ebx, 0x18(%rsp)
movb 0x60(%rsp), %r13b
movb %r15b, %bpl
movq 0x18(%r14), %rbx
movq %r12, %rdi
callq 0x69ee
xorl %edx, %edx
divq 0x20(%r14)
leaq (%rbx,%rdx,8), %rax
movq %rax, %rbx
movq (%rax), %rcx
leaq 0x10(%rcx), %rax
testq %rcx, %rcx
jne 0x14c57
pushq $0x38
popq %rdi
callq 0x638a
movq %rax, %r15
movq %rax, (%rbx)
movq %r12, 0x18(%rax)
movl 0x28(%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x28(%r14)
movl %eax, 0x30(%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x6414
leaq 0x20(%r15), %r14
movq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x155c2
movl %ebp, %edi
movq %r14, %rsi
movl %eax, %edx
callq 0x6681
leaq 0x24(%r15), %rsi
movl %ebp, %edi
movl 0x1c(%rsp), %edx
callq 0x6681
leaq 0x28(%r15), %rsi
movl %ebp, %edi
movl 0x14(%rsp), %edx
callq 0x6681
movl 0x18(%rsp), %eax
shlb $0x4, %al
andb $0xf, %r13b
orb %al, %r13b
movb %r13b, 0x2c(%r15)
leaq 0x2e(%r15), %rsi
movzwl 0x68(%rsp), %edx
movl %ebp, %edi
callq 0x666c
movl 0x30(%r15), %eax
jmp 0x14cf7
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_dynreloc
static void elf32_dynreloc(struct ObjectUnit *ou,struct Reloc *r,int rela)
{
  const char *secname;
  struct Section **secp;
  uint8_t dynflag = SYMF_DYNIMPORT;

  switch (r->rtype) {
    case R_COPY:
      dynflag = SYMF_DYNEXPORT;
      /* fall through */
    case R_GLOBDAT:
    case R_LOADREL:
      secp = &dynrelocs;
      secname = dynrel_name[rela?1:0];
      r->flags |= RELF_DYN;
      break;
    case R_JMPSLOT:
      secp = &pltrelocs;
      secname = pltrel_name[rela?1:0];
      r->flags |= RELF_PLT;
      break;
    case R_ABS:
      return;
    default:
      ierror("elf32_dynreloc(): wrong rtype %s (%d)",
             reloc_name[r->rtype],(int)r->rtype);
      break;
  }

  /* make sure that dynamic relocation section exists */
  if (*secp == NULL)
    *secp = add_section(ou,secname,NULL,0,ST_DATA,SF_ALLOC,SP_READ,2,TRUE);

  /* increase size for new entry */
  (*secp)->size += rela ? 12 : 8;
  
  /* allocate referenced symbol in .dynsym and .dynstr */
  if (r->xrefname) {
    struct Symbol *sym = r->relocsect.symbol;

    if (!(sym->flags & SYMF_DYNLINK)) {
      /* add symbol to .dynsym symbol list, if not already present */
      sym->flags |= dynflag;
      elf32_adddynsym(sym);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movzbl 0x38(%rsi), %edx
leal -0x6(%rdx), %eax
cmpl $0x9, %eax
ja 0x14f7d
movb $0x40, %r15b
leaq 0xc45a(%rip), %rcx      # 0x213ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $-0x80, %r15b
xorl %eax, %eax
testl %ebp, %ebp
setne %al
leaq 0x1a904(%rip), %rcx     # 0x2f870
movq (%rcx,%rax,8), %rsi
orb $-0x80, 0x39(%rbx)
leaq 0x1ed6d(%rip), %r12     # 0x33ce8
jmp 0x14fc3
cmpl $0x1, %edx
je 0x1502e
movl %edx, %eax
leaq 0x1a371(%rip), %rcx     # 0x2f300
movq (%rcx,%rax,8), %rsi
leaq 0xc9bd(%rip), %rdi      # 0x21957
xorl %eax, %eax
callq 0x6b2c
movb $0x40, %r15b
jmp 0x14fc3
xorl %eax, %eax
testl %ebp, %ebp
setne %al
leaq 0x1a8cc(%rip), %rcx     # 0x2f880
movq (%rcx,%rax,8), %rsi
orb $0x40, 0x39(%rbx)
leaq 0x1ed1d(%rip), %r12     # 0x33ce0
movq (%r12), %rax
testq %rax, %rax
jne 0x14ff2
subq $0x8, %rsp
pushq $0x1
popq %r9
pushq $0x2
popq %r8
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
pushq %r9
pushq $0x2
pushq %r9
callq 0xbab3
addq $0x20, %rsp
movq %rax, (%r12)
xorl %ecx, %ecx
testl %ebp, %ebp
setne %cl
movq 0x48(%rax), %rdx
leaq (%rdx,%rcx,4), %rcx
addq $0x8, %rcx
movq %rcx, 0x48(%rax)
cmpq $0x0, 0x10(%rbx)
je 0x1502e
movq 0x18(%rbx), %rdi
movb 0x41(%rdi), %al
cmpb $0x3f, %al
ja 0x1502e
orb %r15b, %al
movb %al, 0x41(%rdi)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x14978
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_bssentry
struct Symbol *elf32_bssentry(struct GlobalVars *gv,const char *secname,
                              struct Symbol *xdef)
/* Allocate space for a copy-object in a .bss or .sbss section and create
   a R_COPY relocation to the original symbol in the shared object. */
{
  struct Symbol *newxdef;

  if (gv->dynobj == NULL)
    ierror("elf32_bssentry(): no dynobj");
  newxdef = bss_entry(gv->dynobj,secname,xdef);

  if (newxdef) {
    /* entry in BSS was done, so we need a R_COPY relocation */
    struct Reloc *r;

    xdef = newxdef;
    r = newreloc(gv,xdef->relsect,xdef->name,NULL,0,0,R_COPY,0);
    r->relocsect.symbol = xdef;
    addreloc(xdef->relsect,r,0,32,-1);  /* mask/size irrelevant for R_COPY */
    elf32_dynreloc(xdef->relsect->obj,r,gv->reloctab_format==RTAB_ADDEND);
  }

  return xdef;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x1e0(%rdi), %rdi
testq %rdi, %rdi
jne 0x1506a
leaq 0xc57a(%rip), %rdi      # 0x215d6
xorl %eax, %eax
callq 0x6b2c
movq 0x1e0(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xc518
testq %rax, %rax
je 0x150da
movq %rax, %r14
movq 0x20(%rax), %rdx
movq 0x38(%rax), %rsi
andq $0x0, 0x8(%rsp)
movl $0xe, (%rsp)
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xabec
movq %rax, %r15
movq %r14, 0x18(%rax)
movq 0x38(%r14), %rdi
pushq $0x20
popq %rcx
pushq $-0x1
popq %r8
movq %rax, %rsi
xorl %edx, %edx
callq 0xac9f
movq 0x38(%r14), %rax
movq 0x10(%rax), %rdi
xorl %edx, %edx
cmpb $0x2, 0x6e(%rbx)
sete %dl
movq %r15, %rsi
callq 0x14f2c
movq %r14, %r15
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_dynamicentry
void elf32_dynamicentry(struct GlobalVars *gv,uint32_t tag,uint32_t val,
                        struct Section *relsec)
/* store another entry into the .dynamic section, make new relocation with
   relsec in value-field, when nonzero */
{
  if (dynamic) {
    bool be = elf32_endianess == _BIG_ENDIAN_;
    struct Elf32_Dyn dyn;
    unsigned long offs = dynamic->size;

    write32(be,dyn.d_tag,tag);
    write32(be,dyn.d_val,val);
    dynamic->data = re_alloc(dynamic->data,
                             dynamic->size+sizeof(struct Elf32_Dyn));
    memcpy(dynamic->data+offs,&dyn,sizeof(struct Elf32_Dyn));
    dynamic->size += sizeof(struct Elf32_Dyn);

    if (relsec) {
      /* we need a 32-bit R_ABS relocation for d_val */
      struct Reloc *r;
      int o = offsetof(struct Elf32_Dyn,d_val);

      r = newreloc(gv,dynamic,NULL,relsec,0,
                   offs+offsetof(struct Elf32_Dyn,d_val),R_ABS,(lword)val);
      r->flags |= RELF_INTERNAL;  /* just for calculating the address */
      addreloc(dynamic,r,0,32,-1);
    }
  }
  else
    ierror("elf32_dynamicentry(): .dynamic was never created");
}

// Assembly:
movq 0x1ebda(%rip), %rax     # 0x33cc8
testq %rax, %rax
je 0x151bb
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %edx
movq %rdi, %r14
xorl %r12d, %r12d
cmpb $0x1, 0x1a70a(%rip)     # 0x2f820
sete %r12b
movq 0x48(%rax), %r15
movq %rsp, %rsi
movl %r12d, %edi
callq 0x6681
leaq 0x4(%rsp), %r13
movl %r12d, %edi
movq %r13, %rsi
movl %ebp, %edx
callq 0x6681
movq 0x1eb86(%rip), %rax     # 0x33cc8
movq 0x40(%rax), %rdi
movq 0x48(%rax), %rsi
addq $0x8, %rsi
callq 0x6365
movq 0x1eb6e(%rip), %rsi     # 0x33cc8
movq %rax, 0x40(%rsi)
movq -0x4(%r13), %rcx
movq %rcx, (%rax,%r15)
addq $0x8, 0x48(%rsi)
testq %rbx, %rbx
je 0x151ac
addq $0x4, %r15
movl %ebp, %eax
movq %r14, %rdi
xorl %edx, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
movq %r15, %r9
pushq %rax
pushq $0x1
callq 0xabec
addq $0x10, %rsp
orb $0x10, 0x39(%rax)
movq 0x1eb2d(%rip), %rdi     # 0x33cc8
pushq $0x20
popq %rcx
pushq $-0x1
popq %r8
movq %rax, %rsi
xorl %edx, %edx
callq 0xac9f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc430(%rip), %rdi      # 0x215f2
xorl %eax, %eax
jmp 0x6b2c