// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_aout.c
// Function: aout_addsymlist
void aout_addsymlist(struct GlobalVars *gv,struct LinkedSection **ls,
                     uint8_t bind,uint8_t type,int be)
/* add all symbols with specified bind and type to the a.out symbol list */
{
  int i;

  for (i=0; i<3; i++) {
    if (ls[i]) {
      struct Symbol *sym = (struct Symbol *)ls[i]->symbols.first;
      struct Symbol *nextsym;

      while (nextsym = (struct Symbol *)sym->n.next) {
        uint8_t syminfo = aout_getinfo(sym);
        uint8_t symbind = aout_getbind(sym);

        if (symbind == bind && (!type || (syminfo == type))) {
          if (!discard_symbol(gv,sym)) {
            remnode(&sym->n);
            /* add new symbol(s) */
            aout_symconvert(gv,sym,symbind,syminfo,ls,i,be);
          }
        }
        sym = nextsym;
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, 0x18(%rsp)
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, 0x38(%rsp)
movq %rdi, 0x40(%rsp)
cmpl $0x1, %edx
sete %al
leal 0xa(%rax), %ecx
movl %ecx, 0x2c(%rsp)
movq %rax, 0x30(%rsp)
addl $0x2, %eax
movl %eax, 0x28(%rsp)
movzbl %r15b, %eax
movl %eax, 0x14(%rsp)
xorl %ecx, %ecx
movl %edx, 0x1c(%rsp)
cmpq $0x3, %rcx
je 0x1afc9
movq 0x38(%rsp), %rax
movq %rcx, 0x20(%rsp)
movq (%rax,%rcx,8), %rax
testq %rax, %rax
je 0x1afbc
movq 0xb0(%rax), %r14
movq %r14, %r13
movq (%r14), %r14
testq %r14, %r14
je 0x1afbc
movzbl 0x42(%r13), %ecx
cmpl $0x5, %ecx
jae 0x1adf0
shlb $0x3, %cl
movl $0x20100, %r12d         # imm = 0x20100
shrq %cl, %r12
jmp 0x1ae00
leaq 0x7932(%rip), %rdi      # 0x22729
movl %ecx, %esi
xorl %eax, %eax
callq 0x6b2c
movzbl 0x43(%r13), %esi
leal -0x1(%rsi), %eax
cmpb $0x3, %al
jae 0x1ae23
testb %bpl, %bpl
sete %cl
cmpb %bpl, %r12b
sete %dl
cmpb %r15b, %al
jne 0x1adc9
orb %dl, %cl
jne 0x1ae3b
jmp 0x1adc9
leaq 0x7927(%rip), %rdi      # 0x22751
xorl %eax, %eax
callq 0x6b2c
testb %bpl, %bpl
je 0x1ae3b
cmpb %bpl, %r12b
jne 0x1adc9
movq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0xc408
testl %eax, %eax
jne 0x1adc9
movq %r13, %rdi
callq 0x6444
movzbl 0x42(%r13), %eax
cmpl $0x3, %eax
je 0x1adc9
movl 0x30(%r13), %edx
xorl %ebx, %ebx
movb $0x1f, %r15b
cmpl $0x4, %eax
je 0x1af66
movl 0x44(%r13), %edi
movzbl 0x40(%r13), %esi
movl 0x1c(%rsp), %r15d
cmpb $0x2, %r15b
jne 0x1aea8
cmpl $0x1, %esi
je 0x1aed4
cmpl $0x2, %esi
jne 0x1aede
leaq 0x7686(%rip), %rax      # 0x22523
movq 0x20(%rsp), %rcx
movb (%rcx,%rax), %r15b
jmp 0x1aed7
movl %edx, 0x10(%rsp)
leal -0x1(%rsi), %eax
cmpl $0x3, %eax
ja 0x1af4f
leaq 0x7651(%rip), %rcx      # 0x22510
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %edi, %ebx
movl 0x28(%rsp), %r15d
jmp 0x1af62
movb $0xe, %r15b
movl %edi, %ebx
jmp 0x1af66
xorl %r15d, %r15d
movl %edi, 0x10(%rsp)
leaq 0x7890(%rip), %rdi      # 0x2277c
xorl %eax, %eax
movl %edx, %ebx
callq 0x6b2c
movl %ebx, %edx
movl 0x10(%rsp), %ebx
jmp 0x1af66
movb $0x1, %r15b
movl %edi, %edx
jmp 0x1af66
movq 0x20(%r13), %rdi
movl 0x18(%rsp), %ebx
movl %ebx, (%rsp)
movzbl 0x2c(%rsp), %r8d
xorl %esi, %esi
movl 0x14(%rsp), %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x1b040
movq 0x28(%r13), %rdi
movl %ebx, (%rsp)
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
pushq $0x1
jmp 0x1afad
leaq 0x75e3(%rip), %rax      # 0x22520
movq 0x20(%rsp), %rcx
movb (%rcx,%rax), %r15b
orb 0x30(%rsp), %r15b
movl %edi, %ebx
jmp 0x1af62
xorl %r15d, %r15d
movl %edi, %ebx
leaq 0x7851(%rip), %rdi      # 0x227ac
xorl %eax, %eax
callq 0x6b2c
movl 0x10(%rsp), %edx
movq 0x20(%r13), %rdi
movl 0x18(%rsp), %eax
movl %eax, (%rsp)
movzbl %r12b, %r12d
movzbl %r15b, %r8d
movl %edx, %esi
movl 0x14(%rsp), %edx
movl %r12d, %ecx
xorl %r9d, %r9d
callq 0x1b040
testl %ebx, %ebx
movl 0x1c(%rsp), %r15d
je 0x1adc9
movq 0x20(%r13), %rdi
movl 0x18(%rsp), %eax
movl %eax, (%rsp)
movl %ebx, %esi
movl 0x14(%rsp), %edx
movl %r12d, %ecx
pushq $0xc
popq %r8
xorl %r9d, %r9d
callq 0x1b040
jmp 0x1adc9
movq 0x20(%rsp), %rcx
incq %rcx
jmp 0x1ada1
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq