LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
movq 0x180(%r14), %r15
movq %r12, %rdi
callq 0x6e09
movzwl %ax, %eax
movq (%r15,%rax,8), %r13
testq %r13, %r13
sete %bpl
je 0x11d88
xorl %r15d, %r15d
movq 0x20(%r13), %rsi
movq %r12, %rdi
callq 0x5160
testl %eax, %eax
jne 0x11d79
testq %r15, %r15
cmoveq %r13, %r15
testq %rbx, %rbx
je 0x11d8b
cmpb $0x2, 0x40(%r13)
jne 0x11d8b
movq 0x38(%r13), %rax
movb 0x2d(%rax), %al
xorb 0x2d(%rbx), %al
testb $0x20, %al
je 0x11d8b
movq 0x10(%r13), %r13
testq %r13, %r13
sete %bpl
jne 0x11d48
jmp 0x11d8b
xorl %r15d, %r15d
testq %r15, %r15
cmoveq %r13, %r15
testb $0x1, %bpl
cmoveq %r13, %r15
testq %r15, %r15
je 0x11daf
cmpb $0x4, 0x40(%r15)
jne 0x11daf
movq 0x28(%r15), %r12
jmp 0x11d26
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_O1/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 0x12008
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x48(%rsi), %eax
leal -0x6(%rax), %ecx
cmpl $0x2, %ecx
jae 0x11f27
xorl %eax, %eax
jmp 0x11f7e
cmpl $0x11, %eax
jne 0x11f6e
leaq 0x1068b(%rip), %rsi     # 0x225be
movq %r14, %rdi
movl $0x2, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xbeb0
testq %rax, %rax
jne 0x11f76
leaq 0x10672(%rip), %rsi     # 0x225c6
movq %r14, %rdi
movl $0x3, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xbeb0
testq %rax, %rax
jne 0x11f76
movq %r14, %rdi
callq 0xca33
movq 0x60(%rax), %rcx
movq %rcx, 0x38(%rbx)
movl 0x48(%rbx), %ecx
decl %ecx
cmpl $0x10, %ecx
ja 0x11ffd
leaq 0x10fed(%rip), %rdx     # 0x22f7c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x50(%rax), %rcx
jmp 0x11ff9
movzbl 0x50(%r14), %eax
leaq 0x1d1d6(%rip), %rcx     # 0x2f180
movq (%rcx,%rax,8), %rax
movslq 0x9c(%rax), %rcx
jmp 0x11ff9
movq 0x48(%rax), %rcx
subq 0x50(%rax), %rcx
jmp 0x11ff9
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
jmp 0x11fe3
movq %r14, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x11fe3
movq %r14, %rdi
xorl %esi, %esi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xbeb0
testq %rax, %rax
je 0x11ffd
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_O1/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 0x12a70
movq 0x18(%rbx), %rsi
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f84
movq 0x8(%rbx), %rdi
callq 0x695d
addq $0x4, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x12a9b
movq 0x18(%rbx), %rsi
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f84
movq 0x8(%rbx), %rdi
callq 0x6955
addq $0x2, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
callq 0x12a55
andl $0xffffff, %eax         # imm = 0xFFFFFF
je 0x12b36
movl %eax, %r14d
shll $0x2, %r14d
leal 0x4(,%rax,4), %edi
callq 0x66b6
movq %rax, %r15
movq 0x8(%rbx), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x5060
subq %r14, 0x10(%rbx)
jns 0x12b30
movq 0x18(%rbx), %rsi
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f84
addq %r14, 0x8(%rbx)
jmp 0x12b39
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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
xorl %eax, %eax
cmpl $0x18, %r8d
setne %r12b
movl $0x6, %r14d
cmovnel %eax, %r14d
testq %rdx, %rdx
je 0x12c7c
movl %r8d, %r15d
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, 0x30(%rsp)
movq %rsi, %rdi
callq 0x12a55
movq %r13, 0x10(%rsp)
movq %r13, %rdi
callq 0x12a55
movl %eax, %r13d
movl $0x1, %eax
testl %r13d, %r13d
je 0x12c7c
movq %rbx, 0x18(%rsp)
xorl %eax, %eax
movb %r12b, %al
negl %eax
orq $-0x4, %rax
movq %rax, 0x28(%rsp)
movzbl %bpl, %eax
movq %rax, 0x20(%rsp)
movzwl %r14w, %eax
movl %eax, 0x4(%rsp)
movzwl %r15w, %eax
movl %eax, (%rsp)
movq 0x10(%rsp), %r12
movq 0x30(%rsp), %r15
movq 0x20(%rsp), %r14
movl 0x4(%rsp), %ebp
movq 0x28(%rsp), %rbx
movq %r12, %rdi
callq 0x12a55
movl %eax, 0x8(%rsp)
movl %r13d, 0xc(%rsp)
movq %r12, %rdi
callq 0x12a55
movl %eax, %r12d
movq 0x18(%rsp), %r13
movq 0x40(%r13), %rdx
addq %r12, %rdx
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %ecx
movl (%rsp), %r8d
movq %rbx, %r9
callq 0xb4bf
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl 0x8(%rsp), %r8d
movq %r12, %r9
movq 0x10(%rsp), %r12
pushq %rax
pushq %r14
callq 0xb202
addq $0x10, %rsp
movq %r13, %rdi
movl 0xc(%rsp), %r13d
movq %rax, %rsi
movl %ebp, %edx
movl (%rsp), %ecx
movq %rbx, %r8
callq 0xb2b7
decl %r13d
jne 0x12bf4
movq %r12, %rdi
callq 0x12a55
movl %eax, %r13d
testl %eax, %eax
jne 0x12be8
movl $0x1, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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:
testq %rdx, %rdx
je 0x12d56
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
callq 0x12a55
movq %rbx, %rdi
callq 0x12a80
testw %ax, %ax
je 0x12d3a
movzwl %ax, %r13d
movq %rbx, %rdi
callq 0x12a80
movzwl %ax, %ebp
movq %rbx, %rdi
callq 0x12a80
movzwl %ax, %r12d
movq 0x40(%r14), %rdx
addq %r12, %rdx
movq %r15, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
movl $0x20, %r8d
movq $-0x1, %r9
callq 0xb4bf
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
movq %r12, %r9
pushq %rax
pushq $0x1
callq 0xb202
addq $0x10, %rsp
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
movl $0x20, %ecx
movq $-0x1, %r8
callq 0xb2b7
decl %r13d
jne 0x12ccc
jmp 0x12cb0
movq %rbx, %rdi
callq 0x12aab
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rax
movl %r9d, %r15d
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdx, %rbx
movq %rsi, %r12
xorl %r10d, %r10d
cmpl $0x3, %r8d
movq %rdi, (%rsp)
jne 0x12d9f
movq 0x10(%r12), %rsi
movq (%rsp), %rdi
callq 0xc242
xorl %r10d, %r10d
movq (%rsp), %rdi
movq %rax, %r12
movl $0x4, %eax
jmp 0x12da5
movl %r14d, %eax
xorl %r14d, %r14d
movslq %eax, %r13
subq $0x8, %rsp
movzbl %r15b, %eax
movzbl %bpl, %r9d
movq %r12, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
movq %r13, %r8
pushq %r10
pushq %r14
pushq %rax
pushq %r10
pushq %r10
callq 0xaba4
addq $0x30, %rsp
testq %rax, %rax
je 0x12e16
cmpb $0x2, %r15b
jne 0x12e16
cmpb $0x2, 0x43(%rax)
je 0x12e16
movq %r13, 0x30(%rax)
movq %r12, 0x38(%rax)
movb %bpl, 0x40(%rax)
movw $0x0, 0x41(%rax)
movb $0x2, 0x43(%rax)
movl %r14d, 0x44(%rax)
movq (%rsp), %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa934
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]vlink/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, %r14
movq %rsi, %r15
movq %rdi, 0x28(%rsp)
movq %rsi, %rdi
callq 0x12a55
movl %eax, %esi
xorl %edx, %edx
cmpl $0x18, %r12d
setne %cl
movl $0x6, %eax
cmovnel %edx, %eax
testl %esi, %esi
je 0x12f1b
xorl %edx, %edx
movb %cl, %dl
negl %edx
orq $-0x4, %rdx
movq %rdx, 0x20(%rsp)
movzbl %bl, %ecx
movq %rcx, 0x18(%rsp)
movzwl %ax, %eax
movl %eax, 0x8(%rsp)
movzwl %r12w, %eax
movl %eax, 0x4(%rsp)
movq %r15, 0x10(%rsp)
movl 0x8(%rsp), %ebp
movq 0x20(%rsp), %r12
movl %esi, 0xc(%rsp)
movq %r15, %rdi
callq 0x12a55
movl %eax, %r13d
movq 0x40(%r14), %rdx
addq %r13, %rdx
movq 0x28(%rsp), %r15
movq %r15, %rdi
movq %r14, %rbx
movq 0x18(%rsp), %r14
movl %r14d, %esi
movl %ebp, %ecx
movl 0x4(%rsp), %r8d
movq %r12, %r9
callq 0xb4bf
movq %r15, %rdi
movq %rbx, %rsi
movq 0x30(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r13, %r9
movq 0x10(%rsp), %r15
pushq %rax
pushq %r14
movq %rbx, %r14
callq 0xb202
addq $0x10, %rsp
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
movl 0x4(%rsp), %ecx
movq %r12, %r8
callq 0xb2b7
movl 0xc(%rsp), %esi
decl %esi
jne 0x12ea0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x6c5d
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x6c1a
movq %r14, %rdi
movl $0x2, %esi
movl %r15d, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x6d55
// File: /workspace/github_c_makefile_star2_O1/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 0x80(%rsi), %r15
cmpq $0x0, (%r15)
je 0x13740
movq %rsi, %rbx
movq %rdi, %r14
movq 0x78(%rbx), %rsi
addq 0x20(%r15), %rsi
movq 0x28(%r15), %rcx
movq %r14, %rdi
movq %r15, %rdx
callq 0xb5b0
movq (%r15), %r15
cmpq $0x0, (%r15)
jne 0x13720
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
movq %r14, %rdi
callq 0x676f
testq %rax, %rax
je 0x13b5d
movq %rax, %r10
leaq 0x1b7db(%rip), %r15     # 0x2f2f0
movq 0x1ba9c(%rip), %rsi     # 0x2f5b8
movzbl 0x38(%r10), %eax
movq (%r15,%rax,8), %rdx
movq 0x30(%r10), %rax
movzwl 0x8(%rax), %ecx
movzwl 0xa(%rax), %r8d
movq 0x10(%rax), %r9
movl $0x20, %edi
xorl %eax, %eax
pushq 0x20(%r10)
pushq 0x18(%rbx)
callq 0x6f84
addq $0x10, %rsp
movq %r14, %rdi
callq 0x676f
movq %rax, %r10
testq %rax, %rax
jne 0x13b15
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0xb0, %rbx
movq %rbx, %rdi
callq 0x676f
testq %rax, %rax
je 0x13d6c
leaq 0x1b5ae(%rip), %r14     # 0x2f2d0
leaq 0x1b547(%rip), %r15     # 0x2f270
leaq 0x1b570(%rip), %r12     # 0x2f2a0
movq 0x1b881(%rip), %rsi     # 0x2f5b8
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 $0x21, %edi
xorl %eax, %eax
callq 0x6f84
movq %rbx, %rdi
callq 0x676f
testq %rax, %rax
jne 0x13d30
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x60(%rsi), %r14
movq (%r14), %rax
testq %rax, %rax
je 0x13e6a
movq %rdi, %rbx
movq %rax, (%rsp)
movq 0x88(%r14), %r12
testq %r12, %r12
je 0x13e5a
cmpb $0x1, 0x8(%r12)
jne 0x13e51
cmpb $0x1, 0x9(%r12)
jne 0x13e51
movq %rbx, %rdi
movl $0x3f1, %esi            # imm = 0x3F1
callq 0x6c5d
movq 0x10(%r12), %rdi
callq 0x50e0
addl $0x3, %eax
sarl $0x2, %eax
movl 0x18(%r12), %ecx
leal (%rax,%rcx,2), %esi
addl $0x3, %esi
movq %rbx, %rdi
callq 0x6c5d
movl 0x38(%r14), %esi
movq %rbx, %rdi
callq 0x6c5d
movq %rbx, %rdi
movl $0x4c494e45, %esi       # imm = 0x4C494E45
callq 0x6c5d
movq 0x10(%r12), %rsi
movq %rbx, %rdi
callq 0x136bf
cmpl $0x0, 0x18(%r12)
je 0x13e51
movq 0x20(%r12), %r13
movq 0x28(%r12), %rbp
xorl %r15d, %r15d
movl (%r13,%r15,4), %esi
movq %rbx, %rdi
callq 0x6c5d
movl (%rbp,%r15,4), %esi
movq %rbx, %rdi
callq 0x6c5d
incq %r15
cmpl 0x18(%r12), %r15d
jb 0x13e2d
movq (%r12), %r12
jmp 0x13da1
movq (%rsp), %r14
movq (%r14), %rax
testq %rax, %rax
jne 0x13d96
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]vlink/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 0x6993
testw %ax, %ax
je 0x1429c
movzwl %ax, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x142ac
movq %rax, %r15
leaq 0x4(%rax), %rsi
movl %ebp, %edi
callq 0x69b3
cmpl $0x3, %eax
je 0x1424e
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rdx
movl $0x2d, %edi
xorl %eax, %eax
callq 0x6f84
leaq 0x10(%r15), %rsi
movl %ebp, %edi
callq 0x69b3
movl %eax, %eax
addq %rax, %rbx
cmpq 0x28(%r14), %rbx
jb 0x14284
addq $0x14, %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x69b3
movl %eax, %eax
addq %rbx, %rax
movq 0x28(%r14), %rcx
addq 0x30(%r14), %rcx
cmpq %rcx, %rax
jbe 0x1429e
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rdx
xorl %ebx, %ebx
movl $0x2e, %edi
xorl %eax, %eax
callq 0x6f84
jmp 0x1429e
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x6993
cmpw %bx, %ax
jbe 0x14333
leaq 0x20(%r12), %rsi
movl %ebp, %edi
callq 0x69b3
movl %eax, 0x4(%rsp)
leaq 0x2e(%r12), %r13
movl %ebp, %edi
movq %r13, %rsi
callq 0x6993
movzwl %ax, %r15d
imull %ebx, %r15d
addl 0x4(%rsp), %r15d
addq %r12, %r15
movl $0x2c, %r12d
cmpq 0x28(%r14), %r15
jb 0x1433c
movl %ebp, %edi
movq %r13, %rsi
callq 0x6993
movzwl %ax, %eax
addq %r15, %rax
movq 0x28(%r14), %rcx
addq 0x30(%r14), %rcx
cmpq %rcx, %rax
ja 0x1433c
jmp 0x14350
movl $0x2b, %r12d
xorl %r15d, %r15d
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
movl %r12d, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x6f84
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_O1/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 0x142ac
movq %rax, %r15
leaq 0x4(%rax), %rsi
movl %ebp, %edi
callq 0x69b3
cmpl $0x3, %eax
je 0x143af
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0xf13b(%rip), %rdx      # 0x234de
movl $0x32, %edi
xorl %eax, %eax
callq 0x6f84
leaq 0x10(%r15), %rsi
movl %ebp, %edi
callq 0x69b3
movl %eax, %eax
addq %rax, %rbx
cmpq 0x28(%r14), %rbx
jb 0x143e5
addq $0x14, %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x69b3
movl %eax, %eax
addq %rbx, %rax
movq 0x28(%r14), %rcx
addq 0x30(%r14), %rcx
cmpq %rcx, %rax
jbe 0x14400
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0xf0ea(%rip), %rdx      # 0x234de
movl $0x33, %edi
xorl %eax, %eax
callq 0x6f84
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x142ac
movq %rax, %r15
leaq 0x4(%rax), %rsi
movl %ebp, %edi
callq 0x69b3
cmpl $0x2, %eax
je 0x14460
cmpl $0xb, %eax
je 0x14460
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0xd2bb(%rip), %rdx      # 0x2170f
movl $0x32, %edi
xorl %eax, %eax
callq 0x6f84
leaq 0x10(%r15), %rsi
movl %ebp, %edi
callq 0x69b3
movl %eax, %eax
addq %rax, %rbx
cmpq 0x28(%r14), %rbx
jb 0x14496
addq $0x14, %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x69b3
movl %eax, %eax
addq %rbx, %rax
movq 0x28(%r14), %rcx
addq 0x30(%r14), %rcx
cmpq %rcx, %rax
jbe 0x144b1
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0xd26a(%rip), %rdx      # 0x2170f
movl $0x33, %edi
xorl %eax, %eax
callq 0x6f84
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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)
jne 0x15958
movq %rdi, %rbx
movq 0x10(%rdx), %r15
leaq 0x19ee8(%rip), %r12     # 0x2f820
xorl %r14d, %r14d
movq (%r12), %rdi
movq %r15, %rsi
callq 0x5160
testl %eax, %eax
je 0x15966
incq %r14
addq $0x8, %r12
cmpq $0x7, %r14
jne 0x1593b
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x15979
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movslq %esi, %r14
leaq 0x19e91(%rip), %r15     # 0x2f820
movq (%r15,%r14,8), %rsi
xorl %edx, %edx
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq $0x0
pushq $0x2
callq 0xae7f
addq $0x10, %rsp
movl %r14d, 0x48(%rax)
cmpl $0x2, %r14d
jb 0x159d4
cmpl $0x4, %ebp
je 0x159f4
cmpl $0x5, %ebp
jne 0x15a19
movq (%r15,%r14,8), %rcx
movq %rcx, 0x238(%rbx)
jmp 0x15a19
movb $0x2, 0x40(%rax)
movzbl 0x50(%rbx), %ecx
leaq 0x1979d(%rip), %rdx     # 0x2f180
movq (%rdx,%rcx,8), %rcx
movslq 0x9c(%rcx), %rcx
movq %rcx, 0x30(%rax)
jmp 0x15a19
movzbl 0x50(%rbx), %ecx
leaq 0x19781(%rip), %rdx     # 0x2f180
movq (%rdx,%rcx,8), %rcx
movslq 0xa0(%rcx), %rcx
movq %rcx, 0x30(%rax)
movq (%r15,%r14,8), %rcx
movq %rcx, 0x230(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x1e0(%rdi), %r14
movzbl 0x50(%rdi), %eax
leaq 0x1961a(%rip), %rcx     # 0x2f180
movq (%rcx,%rax,8), %rax
movb 0xaa(%rax), %al
movb %al, 0x19c9a(%rip)      # 0x2f810
leaq 0x1dd43(%rip), %rdi     # 0x338c0
callq 0x670a
cmpl $0x0, 0x58(%rbx)
jne 0x15bca
movq 0xe8(%rbx), %r15
movq %r15, %rdi
callq 0x50e0
leaq 0x1(%rax), %rcx
subq $0x8, %rsp
movl $0x1, %eax
leaq 0xd139(%rip), %rsi      # 0x22ce4
movq %r14, %rdi
movq %r15, %rdx
movl $0x2, %r8d
movl $0x1, %r9d
pushq %rax
pushq $0x0
pushq %rax
callq 0xc1c8
addq $0x20, %rsp
subq $0x8, %rsp
movl $0x1, %r13d
movl $0x2, %r15d
leaq 0xd816(%rip), %rsi      # 0x233f7
xorl %r12d, %r12d
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq %r13
pushq %r15
pushq %r13
callq 0xc1c8
addq $0x18, %rsp
leaq 0xd7f0(%rip), %rsi      # 0x233fd
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq %r13
pushq %r15
pushq %r13
callq 0xc1c8
addq $0x18, %rsp
leaq 0xd7cf(%rip), %rsi      # 0x23405
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq %r13
pushq %r12
pushq %r13
callq 0xc1c8
addq $0x18, %rsp
leaq 0xd78f(%rip), %rsi      # 0x233ee
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq %r13
pushq %r15
pushq $0x3
callq 0xc1c8
addq $0x20, %rsp
movq %rax, 0x1dc50(%rip)     # 0x338d8
movq 0x19bc1(%rip), %rsi     # 0x2f850
movq %rbx, %rdi
xorl %edx, %edx
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq %r12
pushq %r15
callq 0xae7f
addq $0x10, %rsp
movl $0x6, 0x48(%rax)
orb $-0x80, 0x41(%rax)
movq %rax, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x15cce
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %rbx
movb 0x41(%rdi), %al
testb $0x40, %al
jne 0x15cfe
testb %al, %al
js 0x15d31
movq 0x20(%rbx), %rsi
leaq 0xd867(%rip), %rdi      # 0x23556
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x52b0
movq 0x20(%rbx), %rdx
xorl %eax, %eax
leaq 0x19a45(%rip), %rdi     # 0x2f750
leaq 0x19a9e(%rip), %rsi     # 0x2f7b0
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
pushq %rax
pushq %rax
callq 0x15f0e
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x6668
movq %rax, %r14
movq 0x20(%rbx), %r15
movl 0x44(%rbx), %ebp
movzbl 0x43(%rbx), %esi
leal -0x1(%rsi), %r12d
cmpb $0x3, %r12b
jb 0x15d64
leaq 0xd93f(%rip), %rdi      # 0x23699
xorl %eax, %eax
callq 0x52b0
movb $0x1, %r12b
movq %rbx, %rdi
callq 0x16084
movzbl %al, %eax
movzbl %r12b, %r9d
leaq 0x199d6(%rip), %rdi     # 0x2f750
leaq 0x19a2f(%rip), %rsi     # 0x2f7b0
movq %r15, %rdx
xorl %ecx, %ecx
movl %ebp, %r8d
pushq $0x0
pushq %rax
callq 0x15f0e
addq $0x10, %rsp
movl %eax, 0x18(%r14)
movq %rbx, 0x10(%r14)
leaq 0x1db1c(%rip), %rdi     # 0x338c0
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6759
// File: /workspace/github_c_makefile_star2_O1/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 $0x18, %rsp
movl %r9d, %ebx
movl %r8d, %r13d
movl %ecx, 0xc(%rsp)
movq %rdx, %r12
movq %rsi, 0x10(%rsp)
xorl %ebp, %ebp
cmpb $0x1, 0x198d9(%rip)     # 0x2f810
movq %rdi, %r14
sete %r15b
cmpq $0x0, 0x18(%rdi)
jne 0x15f82
movq %r14, %rdi
callq 0x670a
movq 0x20(%r14), %rdi
shlq $0x3, %rdi
callq 0x66b6
movq %rax, 0x18(%r14)
xorl %eax, %eax
leaq 0xc6e9(%rip), %rdx      # 0x22650
movq %r14, %rdi
movq 0x10(%rsp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rax
pushq %rax
callq 0x15f0e
addq $0x10, %rsp
testq %r12, %r12
je 0x16052
movl %r13d, 0x4(%rsp)
movl %ebx, 0x8(%rsp)
movb 0x50(%rsp), %r13b
movb %r15b, %bpl
movq 0x18(%r14), %rbx
movq %r12, %rdi
callq 0x6e09
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 0x15fb2
movl $0x38, %edi
callq 0x66b6
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 0x6759
leaq 0x20(%r15), %r14
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x169a2
movl %ebp, %edi
movq %r14, %rsi
movl %eax, %edx
callq 0x6a19
leaq 0x24(%r15), %rsi
movl %ebp, %edi
movl 0xc(%rsp), %edx
callq 0x6a19
leaq 0x28(%r15), %rsi
movl %ebp, %edi
movl 0x4(%rsp), %edx
callq 0x6a19
movl 0x8(%rsp), %eax
shlb $0x4, %al
andb $0xf, %r13b
orb %al, %r13b
movb %r13b, 0x2c(%r15)
leaq 0x2e(%r15), %rsi
movzwl 0x58(%rsp), %edx
movl %ebp, %edi
callq 0x6a05
movl 0x30(%r15), %eax
jmp 0x16054
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]vlink/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 0x162ec
movb $0x40, %r15b
leaq 0xd0eb(%rip), %rcx      # 0x233ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $-0x80, %r15b
xorl %eax, %eax
testl %ebp, %ebp
setne %al
leaq 0x19585(%rip), %rcx     # 0x2f860
movq (%rcx,%rax,8), %rsi
orb $-0x80, 0x39(%rbx)
leaq 0x1d60e(%rip), %r12     # 0x338f8
jmp 0x16332
cmpl $0x1, %edx
je 0x163a6
movl %edx, %eax
leaq 0x18ff2(%rip), %rcx     # 0x2f2f0
movq (%rcx,%rax,8), %rsi
leaq 0xd64e(%rip), %rdi      # 0x23957
xorl %eax, %eax
callq 0x52b0
movb $0x40, %r15b
jmp 0x16332
xorl %eax, %eax
testl %ebp, %ebp
setne %al
leaq 0x1954d(%rip), %rcx     # 0x2f870
movq (%rcx,%rax,8), %rsi
orb $0x40, 0x39(%rbx)
leaq 0x1d5be(%rip), %r12     # 0x338f0
cmpq $0x0, (%r12)
jne 0x16366
subq $0x8, %rsp
movl $0x1, %eax
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq %rax
pushq $0x2
pushq %rax
callq 0xc1c8
addq $0x20, %rsp
movq %rax, (%r12)
xorl %eax, %eax
testl %ebp, %ebp
setne %al
movq (%r12), %rcx
movq 0x48(%rcx), %rdx
leaq (%rdx,%rax,4), %rax
addq $0x8, %rax
movq %rax, 0x48(%rcx)
cmpq $0x0, 0x10(%rbx)
je 0x163a6
movq 0x18(%rbx), %rdi
movb 0x41(%rdi), %al
cmpb $0x3f, %al
ja 0x163a6
orb %r15b, %al
movb %al, 0x41(%rdi)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x15cce
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, 0x1e0(%rdi)
jne 0x163d5
leaq 0xd208(%rip), %rdi      # 0x235d6
xorl %eax, %eax
callq 0x52b0
movq 0x1e0(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xcd54
testq %rax, %rax
je 0x1644c
movq %rax, %r14
movq 0x20(%rax), %rdx
movq 0x38(%rax), %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq $0xe
callq 0xb202
addq $0x10, %rsp
movq %rax, %r15
movq %r14, 0x18(%rax)
movq 0x38(%r14), %rdi
movq %rax, %rsi
xorl %edx, %edx
movl $0x20, %ecx
movq $-0x1, %r8
callq 0xb2b7
movq 0x38(%r14), %rax
movq 0x10(%rax), %rdi
xorl %edx, %edx
cmpb $0x2, 0x6e(%rbx)
sete %dl
movq %r15, %rsi
callq 0x1629b
movq %r14, %r15
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1d47c(%rip), %rax     # 0x338d8
testq %rax, %rax
je 0x1652e
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, 0x1938c(%rip)     # 0x2f810
sete %r12b
movq 0x48(%rax), %r15
movq %rsp, %rsi
movl %r12d, %edi
callq 0x6a19
leaq 0x4(%rsp), %r13
movl %r12d, %edi
movq %r13, %rsi
movl %ebp, %edx
callq 0x6a19
movq 0x1d428(%rip), %rax     # 0x338d8
movq 0x40(%rax), %rdi
movq 0x48(%rax), %rsi
addq $0x8, %rsi
callq 0x668f
movq 0x1d410(%rip), %rsi     # 0x338d8
movq %rax, 0x40(%rsi)
movq -0x4(%r13), %rcx
movq %rcx, (%rax,%r15)
addq $0x8, 0x48(%rsi)
testq %rbx, %rbx
je 0x1651f
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 0xb202
addq $0x10, %rsp
orb $0x10, 0x39(%rax)
movq 0x1d3cf(%rip), %rdi     # 0x338d8
movq %rax, %rsi
xorl %edx, %edx
movl $0x20, %ecx
movq $-0x1, %r8
callq 0xb2b7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd0bd(%rip), %rdi      # 0x235f2
xorl %eax, %eax
jmp 0x52b0
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_headersize
unsigned long elf32_headersize(struct GlobalVars *gv)
{
  int segcnt = 0;
  struct Phdr *p = gv->phdrlist;

  while (p) {
    if (p->flags & PHDR_USED)
      segcnt++;
    p = p->next;
  }
  return sizeof(struct Elf32_Ehdr) + segcnt * sizeof(struct Elf32_Phdr);
}

// Assembly:
movq 0x1f8(%rdi), %rax
testq %rax, %rax
je 0x1699c
xorl %ecx, %ecx
btl $0x4, 0x24(%rax)
adcl $0x0, %ecx
movq (%rax), %rax
testq %rax, %rax
jne 0x16980
movslq %ecx, %rax
shlq $0x5, %rax
addq $0x34, %rax
retq
movl $0x34, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_addstrlist
static uint32_t elf32_addstrlist(struct StrTabList *sl,const char *s)
/* add a new string to an ELF string table and return its index */
{
  struct StrTabNode **chain,*sn;

  if (sl->hashtab == NULL) {
    /* initialize an unused string list */
    initlist(&sl->l);
    sl->hashtab = alloczero(sl->htabsize * sizeof(struct StrTabNode *));
    elf32_addstrlist(sl,noname);
  }
  chain = &sl->hashtab[elf_hash(s) % sl->htabsize];

  /* search string in hash table */
  while (sn = *chain) {
    if (!strcmp(s,sn->str))
      return sn->index;  /* it's already in, return index */
    chain = &sn->hashchain;
  }

  /* new string table entry */
  *chain = sn = alloc(sizeof(struct StrTabNode));
  sn->hashchain = NULL;
  sn->str = s;
  sn->index = sl->nextindex;
  addtail(&sl->l,&sn->n);
  sl->nextindex += (uint32_t)strlen(s) + 1;

  return sn->index;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, 0x18(%rdi)
jne 0x169dc
movq %rbx, %rdi
callq 0x670a
movq 0x20(%rbx), %rdi
shlq $0x3, %rdi
callq 0x66b6
movq %rax, 0x18(%rbx)
leaq 0xbc7c(%rip), %rsi      # 0x22650
movq %rbx, %rdi
callq 0x169a2
movq 0x18(%rbx), %r15
movq %r14, %rdi
callq 0x6e09
xorl %edx, %edx
divq 0x20(%rbx)
movq (%r15,%rdx,8), %rax
testq %rax, %rax
je 0x16a19
movq %rax, %r15
movq 0x18(%rax), %rsi
movq %r14, %rdi
callq 0x5160
testl %eax, %eax
je 0x16a5f
movq 0x10(%r15), %rax
testq %rax, %rax
jne 0x169f7
addq $0x10, %r15
jmp 0x16a1d
leaq (%r15,%rdx,8), %r15
movl $0x28, %edi
callq 0x6668
movq %rax, (%r15)
movq $0x0, 0x10(%rax)
movq %r14, 0x18(%rax)
movl 0x28(%rbx), %ecx
leaq 0x20(%rax), %r15
movl %ecx, 0x20(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x6759
movq %r14, %rdi
callq 0x50e0
movl 0x28(%rbx), %ecx
addl %ecx, %eax
incl %eax
movl %eax, 0x28(%rbx)
jmp 0x16a63
addq $0x20, %r15
movl (%r15), %eax
popq %rbx
popq %r14
popq %r15
retq