// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/t_elf32ppcbe.c
// Function: amiga_lnksym
static struct Symbol *amiga_lnksym(struct GlobalVars *gv,
                                     struct Section *sec,
                                     struct Reloc *xref)
{
  struct Symbol *sym;

  if (!gv->dest_object && !gv->use_ldscript) {
    if (!strcmp(linkerdb,xref->xrefname)) {  /* _LinkerDB */
      sym = addlnksymbol(gv,linkerdb,(lword)fff[gv->dest_format]->baseoff,
                         SYM_RELOC,SYMF_LNKSYM,SYMI_OBJECT,SYMB_GLOBAL,0);
      sym->extra = SYMX_SPECIAL|LINKERDB;
      if (findlnksymbol(gv,sdabase_name) == NULL) {
        /* Reference to _LinkerDB creates _SDA_BASE_ */
        struct Symbol *sdabase = addlnksymbol(gv,sdabase_name,
                                              (lword)fff[gv->dest_format]->baseoff,
                                              SYM_ABS,SYMF_LNKSYM,
                                              SYMI_OBJECT,SYMB_GLOBAL,0);
        sdabase->type = SYM_RELOC;
        sdabase->extra = SDABASE;
      }
      if (findlnksymbol(gv,r13init_name) == NULL) {
        /* Reference to _LinkerDB creates __r13_init */
        struct Symbol *r13init = addlnksymbol(gv,r13init_name,
                                              (lword)fff[gv->dest_format]->baseoff,
                                              SYM_ABS,SYMF_LNKSYM,
                                              SYMI_OBJECT,SYMB_GLOBAL,0);
        r13init->type = SYM_RELOC;
        r13init->extra = SYMX_SPECIAL|R13INIT;
      }
      return (sym);  /* new linker symbol created */
    }

    else if (!strcmp(r13init_name,xref->xrefname)) {  /* __r13_init */
      sym = addlnksymbol(gv,r13init_name,(lword)fff[gv->dest_format]->baseoff,
                         SYM_RELOC,SYMF_LNKSYM,SYMI_OBJECT,SYMB_GLOBAL,0);
      sym->extra = SYMX_SPECIAL|R13INIT;
      return (sym);  /* new linker symbol created */
    }

    else if (!strcmp(sdatasize,xref->xrefname)) {  /* __sdata_size */
      sym = addlnksymbol(gv,sdatasize,0,
                         SYM_ABS,SYMF_LNKSYM,SYMI_OBJECT,SYMB_GLOBAL,0);
      sym->extra = SYMX_SPECIAL|SDATASIZE;
      return (sym);  /* new linker symbol created */
    }

    else if (!strcmp(sbsssize,xref->xrefname)) {  /* __sbss_size */
      sym = addlnksymbol(gv,sbsssize,0,
                         SYM_ABS,SYMF_LNKSYM,SYMI_OBJECT,SYMB_GLOBAL,0);
      sym->extra = SYMX_SPECIAL|SBSSSIZE;
      return (sym);  /* new linker symbol created */
    }

    else if (!strcmp(ddrelocs,xref->xrefname)) {  /* __datadata_relocs */
      sym = addlnksymbol(gv,ddrelocs,0,
                         SYM_RELOC,SYMF_LNKSYM,SYMI_OBJECT,SYMB_GLOBAL,0);
      sym->extra = SYMX_SPECIAL|DDRELOCS;
      return (sym);  /* new linker symbol created */
    }

    else if (!strcmp(textsize,xref->xrefname)) {  /* __text_size */
      sym = addlnksymbol(gv,textsize,0,
                         SYM_ABS,SYMF_LNKSYM,SYMI_OBJECT,SYMB_GLOBAL,0);
      sym->extra = SYMX_SPECIAL|TEXTSIZE;
      return (sym);  /* new linker symbol created */
    }
  }

  return (elf32_lnksym(gv,sec,xref));
}

// 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 0x28289
movq 0x38(%rsp), %rax
cmpl $0x0, 0x244(%rax)
jne 0x28289
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rsi
leaq 0x18b6c(%rip), %rdi     # 0x40a40
callq 0x5130
cmpl $0x0, %eax
jne 0x28047
movq 0x38(%rsp), %rdi
movq 0x38(%rsp), %rax
movzbl 0x50(%rax), %eax
movl %eax, %ecx
leaq 0x17b37(%rip), %rax     # 0x3fa30
movq (%rax,%rcx,8), %rax
movslq 0x9c(%rax), %rdx
leaq 0x18b35(%rip), %rsi     # 0x40a40
movl $0x2, %ecx
movl $0x1, %r9d
xorl %eax, %eax
movl %r9d, %r8d
movl $0x2, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x101f0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movl $0x80000000, 0x48(%rax) # imm = 0x80000000
movq 0x38(%rsp), %rdi
leaq 0xd699(%rip), %rsi      # 0x355e5
callq 0x10350
cmpq $0x0, %rax
jne 0x27fbc
movq 0x38(%rsp), %rdi
movq 0x38(%rsp), %rax
movzbl 0x50(%rax), %eax
movl %eax, %ecx
leaq 0x17ac2(%rip), %rax     # 0x3fa30
movq (%rax,%rcx,8), %rax
movslq 0x9c(%rax), %rdx
leaq 0xd665(%rip), %rsi      # 0x355e5
movl $0x1, %r9d
xorl %eax, %eax
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x2, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x101f0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movb $0x2, 0x40(%rax)
movq 0x18(%rsp), %rax
movl $0x0, 0x48(%rax)
movq 0x38(%rsp), %rdi
leaq 0xd67d(%rip), %rsi      # 0x35645
callq 0x10350
cmpq $0x0, %rax
jne 0x28038
movq 0x38(%rsp), %rdi
movq 0x38(%rsp), %rax
movzbl 0x50(%rax), %eax
movl %eax, %ecx
leaq 0x17a46(%rip), %rax     # 0x3fa30
movq (%rax,%rcx,8), %rax
movslq 0x9c(%rax), %rdx
leaq 0xd649(%rip), %rsi      # 0x35645
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 $0x80000001, 0x48(%rax) # imm = 0x80000001
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x282a2
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rsi
leaq 0xd5ee(%rip), %rdi      # 0x35645
callq 0x5130
cmpl $0x0, %eax
jne 0x280ce
movq 0x38(%rsp), %rdi
movq 0x38(%rsp), %rax
movzbl 0x50(%rax), %eax
movl %eax, %ecx
leaq 0x179b8(%rip), %rax     # 0x3fa30
movq (%rax,%rcx,8), %rax
movslq 0x9c(%rax), %rdx
leaq 0xd5bb(%rip), %rsi      # 0x35645
movl $0x2, %ecx
movl $0x1, %r9d
xorl %eax, %eax
movl %r9d, %r8d
movl $0x2, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x101f0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movl $0x80000001, 0x48(%rax) # imm = 0x80000001
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x282a2
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rsi
leaq 0x1896c(%rip), %rdi     # 0x40a4a
callq 0x5130
cmpl $0x0, %eax
jne 0x2813a
movq 0x38(%rsp), %rdi
leaq 0x18956(%rip), %rsi     # 0x40a4a
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)
movq 0x20(%rsp), %rax
movl $0x80000002, 0x48(%rax) # imm = 0x80000002
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x282a2
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rsi
leaq 0x1890d(%rip), %rdi     # 0x40a57
callq 0x5130
cmpl $0x0, %eax
jne 0x281a6
movq 0x38(%rsp), %rdi
leaq 0x188f7(%rip), %rsi     # 0x40a57
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)
movq 0x20(%rsp), %rax
movl $0x80000003, 0x48(%rax) # imm = 0x80000003
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x282a2
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rsi
leaq 0x188ba(%rip), %rdi     # 0x40a70
callq 0x5130
cmpl $0x0, %eax
jne 0x28214
movq 0x38(%rsp), %rdi
leaq 0x188a4(%rip), %rsi     # 0x40a70
xorl %eax, %eax
movl %eax, %edx
movl $0x2, %ecx
movl $0x1, %r9d
xorl %eax, %eax
movl %r9d, %r8d
movl $0x2, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x101f0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movl $0x80000004, 0x48(%rax) # imm = 0x80000004
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x282a2
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rsi
leaq 0x1885e(%rip), %rdi     # 0x40a82
callq 0x5130
cmpl $0x0, %eax
jne 0x2827d
movq 0x38(%rsp), %rdi
leaq 0x18848(%rip), %rsi     # 0x40a82
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)
movq 0x20(%rsp), %rax
movl $0x80000005, 0x48(%rax) # imm = 0x80000005
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x282a2
jmp 0x2827f
jmp 0x28281
jmp 0x28283
jmp 0x28285
jmp 0x28287
jmp 0x28289
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x21fb0
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax)