// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/linker.c
// Function: merge_sec_attrs
static void merge_sec_attrs(struct LinkedSection *lsn,struct Section *sec,
                            uint8_t target_flags)
{
  if (lsn->type == ST_UNDEFINED) {
    lsn->type = sec->type;
    lsn->flags = sec->flags;
  }
  else {
    lsn->flags &= SF_PORTABLE_MASK;
    lsn->flags |= (sec->flags&SF_SMALLDATA) | target_flags;
  }

  if (lsn->protection != sec->protection) {
    if (lsn->protection!=0 &&
        (lsn->protection & sec->protection)!=sec->protection &&
        !listempty(&lsn->sections)) {
      /* merge protection-flags of the two sections */
      char prot1[5],prot2[5];
      strncpy(prot1,protstring(lsn->protection),5);
      strncpy(prot2,protstring(lsn->protection|sec->protection),5);
      strcpy(namebuf2,getobjname(((struct Section *)lsn->sections.last)->obj));
      error(22,lsn->name,prot1,namebuf2,prot2,getobjname(sec->obj));
    }
    lsn->protection |= sec->protection;
  }

  if (sec->alignment > lsn->alignment) {
    /* increase alignment to fit the needs of the new section */
    #if 0 /* @@@ no longer report about alignment corrections */
    if (lsn->alignment && !listempty(&lsn->sections)) {
      strcpy(namebuf2,getobjname(((struct Section *)lsn->sections.last)->obj));
      error(23,lsn->name,1<<lsn->alignment,namebuf2,
            1<<sec->alignment,getobjname(sec->obj));
    }
    #endif
    lsn->alignment = sec->alignment;
  }
}

// Assembly:
subq $0x48, %rsp
movb %dl, %al
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movb %al, 0x37(%rsp)
movq 0x40(%rsp), %rax
movzbl 0x20(%rax), %eax
cmpl $0x0, %eax
jne 0xc144
movq 0x38(%rsp), %rax
movb 0x2c(%rax), %cl
movq 0x40(%rsp), %rax
movb %cl, 0x20(%rax)
movq 0x38(%rsp), %rax
movb 0x2d(%rax), %cl
movq 0x40(%rsp), %rax
movb %cl, 0x21(%rax)
jmp 0xc174
movq 0x40(%rsp), %rax
movzbl 0x21(%rax), %ecx
andl $0x1f, %ecx
movb %cl, 0x21(%rax)
movq 0x38(%rsp), %rax
movzbl 0x2d(%rax), %edx
andl $0x4, %edx
movzbl 0x37(%rsp), %eax
orl %eax, %edx
movq 0x40(%rsp), %rax
movzbl 0x21(%rax), %ecx
orl %edx, %ecx
movb %cl, 0x21(%rax)
movq 0x40(%rsp), %rax
movzbl 0x22(%rax), %eax
movq 0x38(%rsp), %rcx
movzbl 0x2e(%rcx), %ecx
cmpl %ecx, %eax
je 0xc2c5
movq 0x40(%rsp), %rax
movzbl 0x22(%rax), %eax
cmpl $0x0, %eax
je 0xc2ae
movq 0x40(%rsp), %rax
movzbl 0x22(%rax), %eax
movq 0x38(%rsp), %rcx
movzbl 0x2e(%rcx), %ecx
andl %ecx, %eax
movq 0x38(%rsp), %rcx
movzbl 0x2e(%rcx), %ecx
cmpl %ecx, %eax
je 0xc2ae
movq 0x40(%rsp), %rax
movq 0x60(%rax), %rax
cmpq $0x0, (%rax)
je 0xc2ae
leaq 0x32(%rsp), %rax
movq %rax, (%rsp)
movq 0x40(%rsp), %rax
movzbl 0x22(%rax), %edi
callq 0xf200
movq (%rsp), %rdi
movq %rax, %rsi
movl $0x5, %edx
callq 0x5040
leaq 0x2d(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rax
movzbl 0x22(%rax), %eax
movq 0x38(%rsp), %rcx
movzbl 0x2e(%rcx), %ecx
orl %ecx, %eax
movzbl %al, %edi
callq 0xf200
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movl $0x5, %edx
callq 0x5040
movq 0x40(%rsp), %rax
movq 0x70(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x8f00
movq %rax, %rsi
leaq 0x3837c(%rip), %rdi     # 0x445d0
callq 0x5060
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x10(%rsp)
leaq 0x32(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x2d(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x8f00
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %r8
movq %rax, %r9
movl $0x16, %edi
leaq 0x38329(%rip), %rcx     # 0x445d0
movb $0x0, %al
callq 0x8c00
movq 0x38(%rsp), %rax
movzbl 0x2e(%rax), %edx
movq 0x40(%rsp), %rax
movzbl 0x22(%rax), %ecx
orl %edx, %ecx
movb %cl, 0x22(%rax)
movq 0x38(%rsp), %rax
movzbl 0x2f(%rax), %eax
movq 0x40(%rsp), %rcx
movzbl 0x23(%rcx), %ecx
cmpl %ecx, %eax
jle 0xc2eb
movq 0x38(%rsp), %rax
movb 0x2f(%rax), %cl
movq 0x40(%rsp), %rax
movb %cl, 0x23(%rax)
addq $0x48, %rsp
retq