// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: collect_constructors
void collect_constructors(struct GlobalVars *gv)
/* Scan all selected and unselected object modules for constructor-
   and destructor functions of the required type. */
{
  if (!gv->dest_object) {
    const char *vbcc_ctor = "__INIT";
    const char *vbcc_dtor = "__EXIT";
    const char *ctor_label = "___CTOR_LIST__";
    const char *dtor_label = "___DTOR_LIST__";
    const char *csec = xtors_secname(gv,ctors_name);
    const char *dsec = xtors_secname(gv,dtors_name);

    switch (gv->collect_ctors_type) {

      case CCDT_NONE:
        break;

      case CCDT_GNU:
        break;  /* @@@ already put into .ctors/.dtors anyway? */

      case CCDT_VBCC_ELF:  /* no leading underscores */
        vbcc_ctor++;
        vbcc_dtor++;
        ctor_label++;
        dtor_label++;
      case CCDT_VBCC:
        add_xtor_sym(gv,1,ctor_label);  /* define __CTOR_LIST__ */
        add_vbcc_xtors(gv,&gv->selobjects,
                       vbcc_ctor,vbcc_dtor,csec,dsec,ctor_label,dtor_label);
        add_xtor_sym(gv,0,dtor_label);  /* define __DTOR_LIST__ */
        add_vbcc_xtors(gv,&gv->libobjects,
                       vbcc_ctor,vbcc_dtor,csec,dsec,ctor_label,dtor_label);
        break;

      default:
        ierror("collect_constructors(): Unsupported type: %u\n",
               gv->collect_ctors_type);
        break;
    }
  }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rax
cmpl $0x0, 0x54(%rax)
jne 0x11bd3
leaq 0x23e18(%rip), %rax     # 0x35867
movq %rax, 0x48(%rsp)
leaq 0x23e13(%rip), %rax     # 0x3586e
movq %rax, 0x40(%rsp)
leaq 0x23e0e(%rip), %rax     # 0x35875
movq %rax, 0x38(%rsp)
leaq 0x23e11(%rip), %rax     # 0x35884
movq %rax, 0x30(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x23b49(%rip), %rsi     # 0x355cd
callq 0x11be0
movq %rax, 0x28(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x23b3a(%rip), %rsi     # 0x355d4
callq 0x11be0
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rax
movzbl 0x203(%rax), %eax
movq %rax, 0x18(%rsp)
subq $0x3, %rax
ja 0x11bb7
movq 0x18(%rsp), %rax
leaq 0x23ab5(%rip), %rcx     # 0x35580
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x11bd1
jmp 0x11bd1
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x50(%rsp), %rdi
movq 0x38(%rsp), %rdx
movl $0x1, %esi
callq 0x11c60
movq 0x50(%rsp), %rdi
movq 0x50(%rsp), %rsi
addq $0x138, %rsi            # imm = 0x138
movq 0x48(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x20(%rsp), %r9
movq 0x38(%rsp), %r10
movq 0x30(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x11d20
movq 0x50(%rsp), %rdi
movq 0x30(%rsp), %rdx
xorl %esi, %esi
callq 0x11c60
movq 0x50(%rsp), %rdi
movq 0x50(%rsp), %rsi
addq $0x150, %rsi            # imm = 0x150
movq 0x48(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x20(%rsp), %r9
movq 0x38(%rsp), %r10
movq 0x30(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x11d20
jmp 0x11bd1
movq 0x50(%rsp), %rax
movzbl 0x203(%rax), %esi
leaq 0x23cc9(%rip), %rdi     # 0x35893
movb $0x0, %al
callq 0x8ae0
jmp 0x11bd3
addq $0x58, %rsp
retq
nopl (%rax,%rax)