// File: /workspace/github_c_makefile_star2_O3/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_check_ar_type
void elf32_check_ar_type(struct FFFuncs *ff,const char *name,
                         struct Elf32_Ehdr *ehdr,unsigned char class,
                         unsigned char endian,uint32_t ver,int nmach,...)
/* check all library archive members before conversion */
{
  bool be = (endian == ELFDATA2MSB);
  uint16_t m = read16(be,ehdr->e_machine);
  va_list vl;

  va_start(vl,nmach);
  if (!strncmp(ehdr->e_ident,ELFid,4)) {
    /* ELF identification found */
    if (ehdr->e_ident[EI_CLASS]==class && ehdr->e_ident[EI_DATA]==endian &&
        ehdr->e_ident[EI_VERSION]==(unsigned char)ver &&
        read32(be,ehdr->e_version)==ver && nmach>0) {
      while (nmach--) {
        if (va_arg(vl,int) == m)
          m = 0;
      }
      if (m == 0) {
        switch (read16(be,ehdr->e_type)) {
          case ET_REL:
            goto check_ar_exit;
          case ET_EXEC:  /* no executables in library archives */
            error(40,name,ff->tname);
            break;
          case ET_DYN:  /* no shared objects in library archives */
            error(39,name,ff->tname);
            break;
          default:  /* illegal fmt. / file corrupted */
            break;
        }
      }
    }
  }
  error(41,name,ff->tname);

check_ar_exit:
  va_end(vl);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %r9d, %r13d
movl %r8d, %ebx
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, 0x8(%rsp)
movq %rdi, (%rsp)
testb %al, %al
je 0x13f2e
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
xorl %ebp, %ebp
cmpl $0x2, %r8d
sete %bpl
leaq 0x12(%rdx), %rsi
movl %ebp, %edi
callq 0x695f
movl %eax, %r12d
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x128(%rsp), %rax
movq %rax, 0x18(%rsp)
movabsq $0x3000000030, %rax     # imm = 0x3000000030
movq %rax, 0x10(%rsp)
leaq 0x1b90d(%rip), %rsi     # 0x2f880
movl $0x4, %edx
movq %r15, %rdi
callq 0x5070
testl %eax, %eax
jne 0x14054
cmpb %r14b, 0x4(%r15)
jne 0x14054
cmpb %bl, 0x5(%r15)
jne 0x14054
cmpb %r13b, 0x6(%r15)
jne 0x14054
movl 0x120(%rsp), %ebx
leaq 0x14(%r15), %rsi
movl %ebp, %edi
callq 0x696f
testl %ebx, %ebx
jle 0x14054
cmpl %r13d, %eax
jne 0x14054
movl 0x10(%rsp), %eax
movq 0x20(%rsp), %rcx
movq 0x18(%rsp), %rdx
cmpl $0x28, %eax
ja 0x13fed
movq %rdx, %rsi
movl %eax, %edx
addq %rcx, %rdx
addl $0x8, %eax
movl %eax, 0x10(%rsp)
jmp 0x13ff6
leaq 0x8(%rdx), %rsi
movq %rsi, 0x18(%rsp)
movzwl %r12w, %r8d
xorl %edi, %edi
cmpl %r8d, (%rdx)
je 0x14004
movl %r12d, %edi
movl %edi, %r12d
movq %rsi, %rdx
decl %ebx
jne 0x13fd7
testw %r12w, %r12w
jne 0x14054
addq $0x10, %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x695f
cmpw $0x1, %ax
je 0x1406c
movzwl %ax, %eax
cmpl $0x2, %eax
je 0x1403c
cmpl $0x3, %eax
jne 0x14054
movl $0x27, %edi
jmp 0x14041
movl $0x28, %edi
movq (%rsp), %rax
movq (%rax), %rdx
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x6f14
movq (%rsp), %rax
movq (%rax), %rdx
movl $0x29, %edi
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x6f14
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq