// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/t_amigahunk.c
// Function: ados_lnksym
static struct Symbol *ados_lnksym(struct GlobalVars *gv,struct Section *sec,
                                  struct Reloc *xref)
/* Checks, if undefined symbol is an ADOS-linker symbol */
{
  struct Symbol *sym;
  int i;

  if (!gv->dest_object) {
    for (i=0; i<=LAST_LNKSYM; i++) {
      if (!strcmp(ados_symnames[i],xref->xrefname)) {
        if (i==SASCT || i==SASDT) {
          /* map to ___CTOR_LIST__ / ___DTOR_LIST__ */
          return (findlnksymbol(gv,(i == SASCT) ?
                                   "___CTOR_LIST__" : "___DTOR_LIST__"));
        }
        else {
          sym = addlnksymbol(gv,ados_symnames[i],0,SYM_ABS,
                             SYMF_LNKSYM,SYMI_OBJECT,SYMB_GLOBAL,0);
          if (i==PHXDB || i==SASPT || i==SASBB || i==DICDB ||
              i==ELFSD || i==ELFS2) {
            sym->type = SYM_RELOC;
          }
          if ((i==SASPT || i==PHXDB || i==DICDB) &&
              findlnksymbol(gv,sdabase_name)==NULL) {
            /* Reference to _LinkerDB, _DATA_BAS_ or __DATA_BAS
               creates _SDA_BASE_ */
            struct Symbol *sdabase = addlnksymbol(gv,sdabase_name,0,SYM_ABS,
                                                  SYMF_LNKSYM,SYMI_OBJECT,
                                                  SYMB_GLOBAL,0);
            sdabase->type = SYM_RELOC;
            sdabase->extra = ELFSD;
          }
          sym->extra = i;  /* for easy identification in ados_setlnksym */
          return (sym);  /* new linker symbol created */
        }
      }
    }
  }
  return (NULL);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x38(%rsp), %rax
cmpl $0x0, 0x54(%rax)
jne 0x1be5e
movl $0x0, 0x1c(%rsp)
cmpl $0x11, 0x1c(%rsp)
jg 0x1be5c
movslq 0x1c(%rsp), %rcx
leaq 0x2444f(%rip), %rax     # 0x40140
movq (%rax,%rcx,8), %rdi
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x5130
cmpl $0x0, %eax
jne 0x1be4a
cmpl $0x6, 0x1c(%rsp)
je 0x1bd1a
cmpl $0x7, 0x1c(%rsp)
jne 0x1bd47
movq 0x38(%rsp), %rdi
movl 0x1c(%rsp), %ecx
leaq 0x19b5a(%rip), %rsi     # 0x35884
leaq 0x19b44(%rip), %rax     # 0x35875
cmpl $0x6, %ecx
cmoveq %rax, %rsi
callq 0x10350
movq %rax, 0x40(%rsp)
jmp 0x1be67
movq 0x38(%rsp), %rdi
movslq 0x1c(%rsp), %rcx
leaq 0x243e8(%rip), %rax     # 0x40140
movq (%rax,%rcx,8), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %r9d
xorl %eax, %eax
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x2, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x101f0
movq %rax, 0x20(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0x1bdb1
cmpl $0x3, 0x1c(%rsp)
je 0x1bdb1
cmpl $0x4, 0x1c(%rsp)
je 0x1bdb1
cmpl $0x8, 0x1c(%rsp)
je 0x1bdb1
cmpl $0x10, 0x1c(%rsp)
je 0x1bdb1
cmpl $0x11, 0x1c(%rsp)
jne 0x1bdba
movq 0x20(%rsp), %rax
movb $0x2, 0x40(%rax)
cmpl $0x3, 0x1c(%rsp)
je 0x1bdcf
cmpl $0x0, 0x1c(%rsp)
je 0x1bdcf
cmpl $0x8, 0x1c(%rsp)
jne 0x1be32
movq 0x38(%rsp), %rdi
leaq 0x1980a(%rip), %rsi     # 0x355e5
callq 0x10350
cmpq $0x0, %rax
jne 0x1be32
movq 0x38(%rsp), %rdi
leaq 0x197f3(%rip), %rsi     # 0x355e5
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %r9d
xorl %eax, %eax
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x2, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x101f0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movb $0x2, 0x40(%rax)
movq 0x10(%rsp), %rax
movl $0x10, 0x48(%rax)
movl 0x1c(%rsp), %ecx
movq 0x20(%rsp), %rax
movl %ecx, 0x48(%rax)
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x1be67
jmp 0x1be4c
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x1bcda
jmp 0x1be5e
movq $0x0, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)