// File: /workspace/github_c_makefile_star2_O2/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 0x12e50
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 0x663d
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 0x1c9fb(%rip), %rsi     # 0x2f890
pushq $0x4
popq %rdx
movq %r15, %rdi
callq 0x5070
testl %eax, %eax
jne 0x12f72
cmpb %r14b, 0x4(%r15)
jne 0x12f72
cmpb %bl, 0x5(%r15)
jne 0x12f72
cmpb %r13b, 0x6(%r15)
jne 0x12f72
movl 0x120(%rsp), %ebx
leaq 0x14(%r15), %rsi
movl %ebp, %edi
callq 0x664d
testl %ebx, %ebx
jle 0x12f72
cmpl %r13d, %eax
jne 0x12f72
movl 0x10(%rsp), %eax
movq 0x20(%rsp), %rcx
movq 0x18(%rsp), %rdx
subl $0x1, %ebx
jb 0x12f31
cmpl $0x28, %eax
ja 0x12f12
movq %rdx, %rsi
movl %eax, %edx
addq %rcx, %rdx
addl $0x8, %eax
movl %eax, 0x10(%rsp)
jmp 0x12f1b
leaq 0x8(%rdx), %rsi
movq %rsi, 0x18(%rsp)
movzwl %r12w, %r8d
xorl %edi, %edi
cmpl %r8d, (%rdx)
je 0x12f29
movl %r12d, %edi
movq %rsi, %rdx
movl %edi, %r12d
jmp 0x12ef7
testw %r12w, %r12w
jne 0x12f72
addq $0x10, %r15
movl %ebp, %edi
movq %r15, %rsi
callq 0x663d
cmpw $0x1, %ax
je 0x12f88
movzwl %ax, %eax
cmpl $0x2, %eax
je 0x12f5c
cmpl $0x3, %eax
jne 0x12f72
pushq $0x27
jmp 0x12f5e
pushq $0x28
popq %rdi
movq (%rsp), %rax
movq (%rax), %rdx
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x6c19
movq (%rsp), %rax
movq (%rax), %rdx
pushq $0x29
popq %rdi
movq 0x8(%rsp), %rsi
xorl %eax, %eax
callq 0x6c19
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq