LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x6d94
movzwl %ax, %eax
movq (%r15,%rax,8), %r13
movb $0x1, %bpl
testq %r13, %r13
je 0x11bdf
xorl %r15d, %r15d
movq 0x20(%r13), %rsi
movq %r12, %rdi
callq 0x5160
testl %eax, %eax
jne 0x11bd1
testq %r15, %r15
cmoveq %r13, %r15
testq %rbx, %rbx
je 0x11be7
cmpb $0x2, 0x40(%r13)
jne 0x11be7
movq 0x38(%r13), %rax
movb 0x2d(%rax), %al
xorb 0x2d(%rbx), %al
testb $0x20, %al
je 0x11be7
movq 0x10(%r13), %r13
testq %r13, %r13
jne 0x11ba0
xorl %r13d, %r13d
jmp 0x11be9
xorl %r13d, %r13d
xorl %r15d, %r15d
jmp 0x11be9
xorl %ebp, %ebp
testq %r15, %r15
cmoveq %r13, %r15
testb %bpl, %bpl
cmoveq %r13, %r15
testq %r15, %r15
je 0x11c0c
cmpb $0x4, 0x40(%r15)
jne 0x11c0c
movq 0x28(%r15), %r12
jmp 0x11b7f
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_O3/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 0x11e65
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x48(%rsi), %ecx
leal -0x6(%rcx), %eax
cmpl $0x2, %eax
jae 0x11d84
xorl %eax, %eax
jmp 0x11dde
cmpl $0x11, %ecx
jne 0x11dcb
leaq 0x1081e(%rip), %rsi     # 0x225ae
movq %r14, %rdi
movl $0x2, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xbe13
testq %rax, %rax
jne 0x11dd3
leaq 0x10805(%rip), %rsi     # 0x225b6
movq %r14, %rdi
movl $0x3, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xbe13
testq %rax, %rax
jne 0x11dd3
movq %r14, %rdi
callq 0xc9b2
movq 0x60(%rax), %rcx
movq %rcx, 0x38(%rbx)
movl 0x48(%rbx), %ecx
decl %ecx
cmpl $0x10, %ecx
ja 0x11e5a
leaq 0x11170(%rip), %rdx     # 0x22f5c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x50(%rax), %rcx
jmp 0x11e56
movzbl 0x50(%r14), %eax
leaq 0x1d379(%rip), %rcx     # 0x2f180
movq (%rcx,%rax,8), %rax
movslq 0x9c(%rax), %rcx
jmp 0x11e56
movq 0x48(%rax), %rcx
subq 0x50(%rax), %rcx
jmp 0x11e56
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
jmp 0x11e40
movq %r14, %rdi
xorl %esi, %esi
movl $0x3, %edx
jmp 0x11e40
movq %r14, %rdi
xorl %esi, %esi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xbe13
testq %rax, %rax
je 0x11e5a
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_O3/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 0x128f8
movq 0x18(%rbx), %rsi
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f14
movq 0x8(%rbx), %rdi
callq 0x6929
addq $0x4, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x12923
movq 0x18(%rbx), %rsi
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f14
movq 0x8(%rbx), %rdi
callq 0x6921
addq $0x2, 0x8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x128dd
andl $0xffffff, %eax         # imm = 0xFFFFFF
je 0x129cb
movl %eax, %r14d
shll $0x2, %r14d
leal 0x4(,%rax,4), %edi
callq 0x6686
movq %rax, %r15
movq 0x8(%rbx), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x5060
subq %r14, 0x10(%rbx)
jns 0x129c5
movq 0x18(%rbx), %rsi
movl $0xd, %edi
xorl %eax, %eax
callq 0x6f14
addq %r14, 0x8(%rbx)
jmp 0x129ce
xorl %r15d, %r15d
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x12b11
movl %r8d, %r15d
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, 0x30(%rsp)
movq %rsi, %rdi
callq 0x128dd
movq %r13, 0x10(%rsp)
movq %r13, %rdi
callq 0x128dd
movl %eax, %r13d
movl $0x1, %eax
testl %r13d, %r13d
je 0x12b11
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 0x128dd
movl %eax, 0x8(%rsp)
movl %r13d, 0xc(%rsp)
movq %r12, %rdi
callq 0x128dd
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 0xb3fc
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 0xb13c
addq $0x10, %rsp
movq %r13, %rdi
movl 0xc(%rsp), %r13d
movq %rax, %rsi
movl %ebp, %edx
movl (%rsp), %ecx
movq %rbx, %r8
callq 0xb1f1
decl %r13d
jne 0x12a89
movq %r12, %rdi
callq 0x128dd
movl %eax, %r13d
testl %eax, %eax
jne 0x12a7d
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_O3/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 0x12beb
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 0x128dd
movq %rbx, %rdi
callq 0x12908
testw %ax, %ax
je 0x12bcf
movzwl %ax, %r13d
movq %rbx, %rdi
callq 0x12908
movzwl %ax, %ebp
movq %rbx, %rdi
callq 0x12908
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 0xb3fc
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
movq %r12, %r9
pushq %rax
pushq $0x1
callq 0xb13c
addq $0x10, %rsp
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
movl $0x20, %ecx
movq $-0x1, %r8
callq 0xb1f1
decl %r13d
jne 0x12b61
jmp 0x12b45
movq %rbx, %rdi
callq 0x12933
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_O3/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 0x12c34
movq 0x10(%r12), %rsi
movq (%rsp), %rdi
callq 0xc195
xorl %r10d, %r10d
movq (%rsp), %rdi
movq %rax, %r12
movl $0x4, %eax
jmp 0x12c3a
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 0xaad4
addq $0x30, %rsp
testq %rax, %rax
je 0x12cab
cmpb $0x2, %r15b
jne 0x12cab
cmpb $0x2, 0x43(%rax)
je 0x12cab
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 0xa82b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x128dd
movl %eax, %esi
xorl %edx, %edx
cmpl $0x18, %r12d
setne %cl
movl $0x6, %eax
cmovnel %edx, %eax
testl %esi, %esi
je 0x12db0
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 0x128dd
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 0xb3fc
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 0xb13c
addq $0x10, %rsp
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
movl 0x4(%rsp), %ecx
movq %r12, %r8
callq 0xb1f1
movl 0xc(%rsp), %esi
decl %esi
jne 0x12d35
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x6be8
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x6ba5
movq %r14, %rdi
movl $0x2, %esi
movl %r15d, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x6ce0
// File: /workspace/github_c_makefile_star2_O3/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 0x135f6
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 0xb4ed
movq (%r15), %r15
cmpq $0x0, (%r15)
jne 0x135d6
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x673f
testq %rax, %rax
je 0x139ea
movq %rax, %r10
leaq 0x1b94e(%rip), %r15     # 0x2f2f0
movq 0x1bc0f(%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 0x6f14
addq $0x10, %rsp
movq %r14, %rdi
callq 0x673f
movq %rax, %r10
testq %rax, %rax
jne 0x139a2
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x673f
testq %rax, %rax
je 0x13bfe
leaq 0x1b71c(%rip), %r14     # 0x2f2d0
leaq 0x1b6b5(%rip), %r15     # 0x2f270
leaq 0x1b6de(%rip), %r12     # 0x2f2a0
movq 0x1b9ef(%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 0x6f14
movq %rbx, %rdi
callq 0x673f
testq %rax, %rax
jne 0x13bc2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movq (%rsi), %rax
testq %rax, %rax
je 0x13d09
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rax, (%rsp)
movq 0x88(%r14), %r12
testq %r12, %r12
je 0x13ceb
cmpb $0x1, 0x8(%r12)
jne 0x13ce2
cmpb $0x1, 0x9(%r12)
jne 0x13ce2
movq %rbx, %rdi
movl $0x3f1, %esi            # imm = 0x3F1
callq 0x6be8
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 0x6be8
movl 0x38(%r14), %esi
movq %rbx, %rdi
callq 0x6be8
movq %rbx, %rdi
movl $0x4c494e45, %esi       # imm = 0x4C494E45
callq 0x6be8
movq 0x10(%r12), %rsi
movq %rbx, %rdi
callq 0x13575
cmpl $0x0, 0x18(%r12)
je 0x13ce2
movq 0x20(%r12), %r13
movq 0x28(%r12), %rbp
xorl %r15d, %r15d
movl (%r13,%r15,4), %esi
movq %rbx, %rdi
callq 0x6be8
movl (%rbp,%r15,4), %esi
movq %rbx, %rdi
callq 0x6be8
incq %r15
cmpl 0x18(%r12), %r15d
jb 0x13cbe
movq (%r12), %r12
jmp 0x13c32
movq (%rsp), %r14
movq (%r14), %rax
testq %rax, %rax
jne 0x13c27
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x695f
testw %ax, %ax
je 0x1412c
movzwl %ax, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1413c
movq %rax, %r15
leaq 0x4(%rax), %rsi
movl %ebp, %edi
callq 0x696f
cmpl $0x3, %eax
je 0x140de
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rdx
movl $0x2d, %edi
xorl %eax, %eax
callq 0x6f14
leaq 0x10(%r15), %rsi
movl %ebp, %edi
callq 0x696f
movl %eax, %eax
addq %rax, %rbx
cmpq 0x28(%r14), %rbx
jb 0x14114
addq $0x14, %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x696f
movl %eax, %eax
addq %rbx, %rax
movq 0x28(%r14), %rcx
addq 0x30(%r14), %rcx
cmpq %rcx, %rax
jbe 0x1412e
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rdx
xorl %ebx, %ebx
movl $0x2e, %edi
xorl %eax, %eax
callq 0x6f14
jmp 0x1412e
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x695f
cmpw %bx, %ax
jbe 0x141c3
leaq 0x20(%r12), %rsi
movl %ebp, %edi
callq 0x696f
movl %eax, 0x4(%rsp)
leaq 0x2e(%r12), %r13
movl %ebp, %edi
movq %r13, %rsi
callq 0x695f
movzwl %ax, %r15d
imull %ebx, %r15d
addl 0x4(%rsp), %r15d
addq %r12, %r15
movl $0x2c, %r12d
cmpq 0x28(%r14), %r15
jb 0x141cc
movl %ebp, %edi
movq %r13, %rsi
callq 0x695f
movzwl %ax, %eax
addq %r15, %rax
movq 0x28(%r14), %rcx
addq 0x30(%r14), %rcx
cmpq %rcx, %rax
ja 0x141cc
jmp 0x141e0
movl $0x2b, %r12d
xorl %r15d, %r15d
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
movl %r12d, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x6f14
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_O3/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 0x1413c
movq %rax, %r15
leaq 0x4(%rax), %rsi
movl %ebp, %edi
callq 0x696f
cmpl $0x3, %eax
je 0x1423f
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0xf28b(%rip), %rdx      # 0x234be
movl $0x32, %edi
xorl %eax, %eax
callq 0x6f14
leaq 0x10(%r15), %rsi
movl %ebp, %edi
callq 0x696f
movl %eax, %eax
addq %rax, %rbx
cmpq 0x28(%r14), %rbx
jb 0x14275
addq $0x14, %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x696f
movl %eax, %eax
addq %rbx, %rax
movq 0x28(%r14), %rcx
addq 0x30(%r14), %rcx
cmpq %rcx, %rax
jbe 0x14290
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0xf23a(%rip), %rdx      # 0x234be
movl $0x33, %edi
xorl %eax, %eax
callq 0x6f14
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1413c
movq %rax, %r15
leaq 0x4(%rax), %rsi
movl %ebp, %edi
callq 0x696f
cmpl $0x2, %eax
je 0x142f0
cmpl $0xb, %eax
je 0x142f0
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0xd420(%rip), %rdx      # 0x21704
movl $0x32, %edi
xorl %eax, %eax
callq 0x6f14
leaq 0x10(%r15), %rsi
movl %ebp, %edi
callq 0x696f
movl %eax, %eax
addq %rax, %rbx
cmpq 0x28(%r14), %rbx
jb 0x14326
addq $0x14, %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x696f
movl %eax, %eax
addq %rbx, %rax
movq 0x28(%r14), %rcx
addq 0x30(%r14), %rcx
cmpq %rcx, %rax
jbe 0x14341
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0xd3cf(%rip), %rdx      # 0x21704
movl $0x33, %edi
xorl %eax, %eax
callq 0x6f14
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1579c
movq %rdi, %rbx
movq 0x10(%rdx), %r15
leaq 0x1a0a4(%rip), %r12     # 0x2f820
xorl %r14d, %r14d
movq (%r12), %rdi
movq %r15, %rsi
callq 0x5160
testl %eax, %eax
je 0x157aa
incq %r14
addq $0x8, %r12
cmpq $0x7, %r14
jne 0x1577f
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 0x157bd
// File: /workspace/github_c_makefile_star2_O3/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 0x1a04d(%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 0xadaf
addq $0x10, %rsp
movl %r14d, 0x48(%rax)
cmpl $0x2, %r14d
jb 0x15818
cmpl $0x4, %ebp
je 0x15838
cmpl $0x5, %ebp
jne 0x1585d
movq (%r15,%r14,8), %rcx
movq %rcx, 0x238(%rbx)
jmp 0x1585d
movb $0x2, 0x40(%rax)
movzbl 0x50(%rbx), %ecx
leaq 0x19959(%rip), %rdx     # 0x2f180
movq (%rdx,%rcx,8), %rcx
movslq 0x9c(%rcx), %rcx
movq %rcx, 0x30(%rax)
jmp 0x1585d
movzbl 0x50(%rbx), %ecx
leaq 0x1993d(%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_O3/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 0x197d6(%rip), %rcx     # 0x2f180
movq (%rcx,%rax,8), %rax
movb 0xaa(%rax), %al
movb %al, 0x19e56(%rip)      # 0x2f810
leaq 0x1deff(%rip), %rdi     # 0x338c0
callq 0x66da
cmpl $0x0, 0x58(%rbx)
jne 0x15a0e
movq 0xe8(%rbx), %r15
movq %r15, %rdi
callq 0x50e0
leaq 0x1(%rax), %rcx
subq $0x8, %rsp
movl $0x1, %eax
leaq 0xd2d6(%rip), %rsi      # 0x22cc5
movq %r14, %rdi
movq %r15, %rdx
movl $0x2, %r8d
movl $0x1, %r9d
pushq %rax
pushq $0x0
pushq %rax
callq 0xc11b
addq $0x20, %rsp
subq $0x8, %rsp
movl $0x1, %r13d
movl $0x2, %r15d
leaq 0xd9b2(%rip), %rsi      # 0x233d7
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 0xc11b
addq $0x18, %rsp
leaq 0xd98c(%rip), %rsi      # 0x233dd
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq %r13
pushq %r15
pushq %r13
callq 0xc11b
addq $0x18, %rsp
leaq 0xd96b(%rip), %rsi      # 0x233e5
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq %r13
pushq %r12
pushq %r13
callq 0xc11b
addq $0x18, %rsp
leaq 0xd92b(%rip), %rsi      # 0x233ce
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq %r13
pushq %r15
pushq $0x3
callq 0xc11b
addq $0x20, %rsp
movq %rax, 0x1de0c(%rip)     # 0x338d8
movq 0x19d7d(%rip), %rsi     # 0x2f850
movq %rbx, %rdi
xorl %edx, %edx
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq %r12
pushq %r15
callq 0xadaf
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 0x15b12
// File: /workspace/github_c_makefile_star2_O3/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 0x15b42
testb %al, %al
js 0x15b75
movq 0x20(%rbx), %rsi
leaq 0xda03(%rip), %rdi      # 0x23536
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x52b0
movq 0x20(%rbx), %rdx
xorl %eax, %eax
leaq 0x19c01(%rip), %rdi     # 0x2f750
leaq 0x19c5a(%rip), %rsi     # 0x2f7b0
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
pushq %rax
pushq %rax
callq 0x15d58
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x6638
movq %rax, %r14
movq 0x20(%rbx), %r15
movl 0x44(%rbx), %ebp
movzbl 0x43(%rbx), %esi
leal -0x1(%rsi), %r12d
cmpb $0x3, %r12b
jb 0x15ba8
leaq 0xdadb(%rip), %rdi      # 0x23679
xorl %eax, %eax
callq 0x52b0
movb $0x1, %r12b
movq %rbx, %rdi
callq 0x15ece
movzbl %al, %eax
movzbl %r12b, %r9d
leaq 0x19b92(%rip), %rdi     # 0x2f750
leaq 0x19beb(%rip), %rsi     # 0x2f7b0
movq %r15, %rdx
xorl %ecx, %ecx
movl %ebp, %r8d
pushq $0x0
pushq %rax
callq 0x15d58
addq $0x10, %rsp
movl %eax, 0x18(%r14)
movq %rbx, 0x10(%r14)
leaq 0x1dcd8(%rip), %rdi     # 0x338c0
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6729
// File: /workspace/github_c_makefile_star2_O3/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, 0x19a8f(%rip)     # 0x2f810
movq %rdi, %r14
sete %r15b
cmpq $0x0, 0x18(%rdi)
jne 0x15dcc
movq %r14, %rdi
callq 0x66da
movq 0x20(%r14), %rdi
shlq $0x3, %rdi
callq 0x6686
movq %rax, 0x18(%r14)
xorl %eax, %eax
leaq 0xc88f(%rip), %rdx      # 0x22640
movq %r14, %rdi
movq 0x10(%rsp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rax
pushq %rax
callq 0x15d58
addq $0x10, %rsp
testq %r12, %r12
je 0x15e9c
movl %r13d, 0x4(%rsp)
movl %ebx, 0x8(%rsp)
movb 0x50(%rsp), %r13b
movb %r15b, %bpl
movq 0x18(%r14), %rbx
movq %r12, %rdi
callq 0x6d94
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 0x15dfc
movl $0x38, %edi
callq 0x6686
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 0x6729
leaq 0x20(%r15), %r14
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x167f2
movl %ebp, %edi
movq %r14, %rsi
movl %eax, %edx
callq 0x69a0
leaq 0x24(%r15), %rsi
movl %ebp, %edi
movl 0xc(%rsp), %edx
callq 0x69a0
leaq 0x28(%r15), %rsi
movl %ebp, %edi
movl 0x4(%rsp), %edx
callq 0x69a0
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 0x698b
movl 0x30(%r15), %eax
jmp 0x15e9e
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_O3/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 0x16136
movb $0x40, %r15b
leaq 0xd281(%rip), %rcx      # 0x2338c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $-0x80, %r15b
xorl %eax, %eax
testl %ebp, %ebp
setne %al
leaq 0x1973b(%rip), %rcx     # 0x2f860
movq (%rcx,%rax,8), %rsi
orb $-0x80, 0x39(%rbx)
leaq 0x1d7c4(%rip), %r12     # 0x338f8
jmp 0x1617c
cmpl $0x1, %edx
je 0x161ee
movl %edx, %eax
leaq 0x191a8(%rip), %rcx     # 0x2f2f0
movq (%rcx,%rax,8), %rsi
leaq 0xd7e4(%rip), %rdi      # 0x23937
xorl %eax, %eax
callq 0x52b0
movb $0x40, %r15b
jmp 0x1617c
xorl %eax, %eax
testl %ebp, %ebp
setne %al
leaq 0x19703(%rip), %rcx     # 0x2f870
movq (%rcx,%rax,8), %rsi
orb $0x40, 0x39(%rbx)
leaq 0x1d774(%rip), %r12     # 0x338f0
movq (%r12), %rax
testq %rax, %rax
jne 0x161b2
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 0xc11b
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 0x161ee
movq 0x18(%rbx), %rdi
movb 0x41(%rdi), %al
cmpb $0x3f, %al
ja 0x161ee
orb %r15b, %al
movb %al, 0x41(%rdi)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x15b12
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movq 0x1e0(%rdi), %rdi
testq %rdi, %rdi
jne 0x16226
leaq 0xd39e(%rip), %rdi      # 0x235b6
xorl %eax, %eax
callq 0x52b0
movq 0x1e0(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xcca4
testq %rax, %rax
je 0x16296
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 0xb13c
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 0xb1f1
movq 0x38(%r14), %rax
movq 0x10(%rax), %rdi
xorl %edx, %edx
cmpb $0x2, 0x6e(%rbx)
sete %dl
movq %r15, %rsi
callq 0x160e5
movq %r14, %r15
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1d632(%rip), %rax     # 0x338d8
testq %rax, %rax
je 0x16378
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, 0x19542(%rip)     # 0x2f810
sete %r12b
movq 0x48(%rax), %r15
movq %rsp, %rsi
movl %r12d, %edi
callq 0x69a0
leaq 0x4(%rsp), %r13
movl %r12d, %edi
movq %r13, %rsi
movl %ebp, %edx
callq 0x69a0
movq 0x1d5de(%rip), %rax     # 0x338d8
movq 0x40(%rax), %rdi
movq 0x48(%rax), %rsi
addq $0x8, %rsi
callq 0x665f
movq 0x1d5c6(%rip), %rsi     # 0x338d8
movq %rax, 0x40(%rsi)
movq -0x4(%r13), %rcx
movq %rcx, (%rax,%r15)
addq $0x8, 0x48(%rsi)
testq %rbx, %rbx
je 0x16369
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 0xb13c
addq $0x10, %rsp
orb $0x10, 0x39(%rax)
movq 0x1d585(%rip), %rdi     # 0x338d8
movq %rax, %rsi
xorl %edx, %edx
movl $0x20, %ecx
movq $-0x1, %r8
callq 0xb1f1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd253(%rip), %rdi      # 0x235d2
xorl %eax, %eax
jmp 0x52b0
// File: /workspace/github_c_makefile_star2_O3/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 0x167ec
xorl %ecx, %ecx
btl $0x4, 0x24(%rax)
adcl $0x0, %ecx
movq (%rax), %rax
testq %rax, %rax
jne 0x167d0
movslq %ecx, %rax
shlq $0x5, %rax
addq $0x34, %rax
retq
movl $0x34, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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
movq 0x18(%rdi), %r15
testq %r15, %r15
jne 0x16832
movq %rbx, %rdi
callq 0x66da
movq 0x20(%rbx), %rdi
shlq $0x3, %rdi
callq 0x6686
movq %rax, 0x18(%rbx)
leaq 0xbe1a(%rip), %rsi      # 0x22640
movq %rbx, %rdi
callq 0x167f2
movq 0x18(%rbx), %r15
movq %r14, %rdi
callq 0x6d94
xorl %edx, %edx
divq 0x20(%rbx)
movq (%r15,%rdx,8), %rax
testq %rax, %rax
je 0x1686b
movq %rax, %r15
movq 0x18(%rax), %rsi
movq %r14, %rdi
callq 0x5160
testl %eax, %eax
je 0x168b1
movq 0x10(%r15), %rax
testq %rax, %rax
jne 0x16849
addq $0x10, %r15
jmp 0x1686f
leaq (%r15,%rdx,8), %r15
movl $0x28, %edi
callq 0x6638
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 0x6729
movq %r14, %rdi
callq 0x50e0
movl 0x28(%rbx), %ecx
addl %ecx, %eax
incl %eax
movl %eax, 0x28(%rbx)
jmp 0x168b5
addq $0x20, %r15
movl (%r15), %eax
popq %rbx
popq %r14
popq %r15
retq