// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/targets.c
// Function: get_text_data_bss
void get_text_data_bss(struct GlobalVars *gv,struct LinkedSection **sections)
/* find exactly one ST_CODE, ST_DATA and ST_UDATA section, which
   will become .text, .data and .bss */
{
  static const char *fn = "get_text_data_bss(): ";
  struct LinkedSection *ls;

  sections[0] = sections[1] = sections[2] = NULL;
  for (ls=(struct LinkedSection *)gv->lnksec.first;
       ls->n.next!=NULL; ls=(struct LinkedSection *)ls->n.next) {
    if (ls->flags & SF_ALLOC) {
      switch (ls->type) {
        case ST_UNDEFINED:
          /* @@@ discard undefined sections - they are empty anyway */
          ls->flags &= ~SF_ALLOC;
          break;
        case ST_CODE:
          if (sections[0]==NULL)
            sections[0] = ls;
          else
            ierror("%sMultiple code sections (%s)",fn,ls->name);
          break;
        case ST_DATA:
          if (sections[1]==NULL)
            sections[1] = ls;
          else
            ierror("%sMultiple data sections (%s)",fn,ls->name);
          break;
        case ST_UDATA:
          if (sections[2]==NULL)
            sections[2] = ls;
          else
            ierror("%sMultiple bss sections (%s)",fn,ls->name);
          break;
        default:
          ierror("%sIllegal section type %d (%s)",fn,(int)ls->type,ls->name);
          break;
      }
    }
  }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0x8(%rax)
movq 0x18(%rsp), %rax
movq $0x0, (%rax)
movq 0x20(%rsp), %rax
movq 0x1c0(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1354c
movq 0x10(%rsp), %rax
movzbl 0x21(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x13538
movq 0x10(%rsp), %rax
movzbl 0x20(%rax), %eax
movq %rax, 0x8(%rsp)
subq $0x3, %rax
ja 0x1350f
movq 0x8(%rsp), %rax
leaq 0x22153(%rip), %rcx     # 0x35590
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%rsp), %rax
movzbl 0x21(%rax), %ecx
andl $-0x2, %ecx
movb %cl, 0x21(%rax)
jmp 0x13536
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x13474
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
jmp 0x13492
movq 0x2c855(%rip), %rsi     # 0x3fcd0
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdx
leaq 0x22481(%rip), %rdi     # 0x3590c
movb $0x0, %al
callq 0x8ae0
jmp 0x13536
movq 0x18(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x134b3
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x134d1
movq 0x2c816(%rip), %rsi     # 0x3fcd0
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdx
leaq 0x22460(%rip), %rdi     # 0x3592a
movb $0x0, %al
callq 0x8ae0
jmp 0x13536
movq 0x18(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x134ef
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x1350d
movq 0x2c7da(%rip), %rsi     # 0x3fcd0
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rdx
leaq 0x22442(%rip), %rdi     # 0x35948
movb $0x0, %al
callq 0x8ae0
jmp 0x13536
movq 0x2c7ba(%rip), %rsi     # 0x3fcd0
movq 0x10(%rsp), %rax
movzbl 0x20(%rax), %edx
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rcx
leaq 0x22436(%rip), %rdi     # 0x35965
movb $0x0, %al
callq 0x8ae0
jmp 0x13538
jmp 0x1353a
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x133f5
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)