// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x0, 0x20(%rdi)
je 0x8b7a
movb 0x21(%rbx), %al
andb $0x1f, %al
movb %al, 0x21(%rbx)
movb 0x2d(%r14), %cl
andb $0x4, %cl
orb %dl, %cl
orb %al, %cl
movb %cl, 0x21(%rbx)
jmp 0x8b88
movb 0x2c(%r14), %al
movb %al, 0x20(%rbx)
movb 0x2d(%r14), %al
movb %al, 0x21(%rbx)
movzbl 0x22(%rbx), %ebp
movb 0x2e(%r14), %r13b
cmpb %r13b, %bpl
je 0x8cc6
testl %ebp, %ebp
sete %al
movl %ebp, %ecx
notb %cl
testb %cl, %r13b
sete %cl
orb %al, %cl
jne 0x8cbf
movq 0x60(%rbx), %rax
cmpq $0x0, (%rax)
je 0x8cbf
movd %ebp, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
pand 0x194d1(%rip), %xmm0    # 0x220a0
pxor %xmm1, %xmm1
pcmpeqd %xmm1, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
movdqa %xmm0, %xmm1
pandn 0x194c5(%rip), %xmm1    # 0x220b0
pand 0x194cd(%rip), %xmm0    # 0x220c0
por %xmm1, %xmm0
movd %xmm0, 0x26571(%rip)    # 0x2f170
leaq 0x2656a(%rip), %r12     # 0x2f170
leaq 0x13(%rsp), %r15
movl $0x5, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x5060
orb %bpl, %r13b
movzbl %r13b, %eax
movd %eax, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
pand 0x1946d(%rip), %xmm0    # 0x220a0
pcmpeqd 0x19495(%rip), %xmm0    # 0x220d0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
movdqa %xmm0, %xmm1
pandn 0x19461(%rip), %xmm1    # 0x220b0
pand 0x19469(%rip), %xmm0    # 0x220c0
por %xmm1, %xmm0
movd %xmm0, 0x2650d(%rip)    # 0x2f170
leaq 0xe(%rsp), %r13
movl $0x5, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x5060
movq 0x70(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x7174
leaq 0x2a574(%rip), %r12     # 0x33200
movq %r12, %rdi
movq %rax, %rsi
callq 0x5080
movq 0x18(%rbx), %rbp
movq 0x10(%r14), %rdi
callq 0x7174
movl $0x16, %edi
movq %rbp, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x6f84
movb 0x2e(%r14), %al
orb %al, 0x22(%rbx)
movb 0x2f(%r14), %al
cmpb 0x23(%rbx), %al
jbe 0x8cd2
movb %al, 0x23(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq