// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]vlink/t_aout.c
// Function: aoutstd_read
void aoutstd_read(struct GlobalVars *gv,struct LinkFile *lf,
                  struct aout_hdr *hdr)
/* read an a.out file with standard relocations */
{
  /*int so = (GETFLAGS(hdr)&EX_DPMASK) == (EX_DYNAMIC|EX_PIC);*/
  int be;
  struct ObjectUnit *u;

  /* determine endianess */
  if (fff[lf->format]->endianess < 0) {
    if (gv->endianess < 0) {
      /* unknown endianess, default to BE */
      be = gv->endianess = host_endianess();
      error(128,lf->pathname,endian_name[be]);
    }
    else
      be = gv->endianess;
  }
  else
    be = fff[lf->format]->endianess;

  if (lf->type == ID_LIBARCH)  /* check ar-member for correct format */
    aout_check_ar_type(fff[lf->format],lf->pathname,hdr);

  u = create_objunit(gv,lf,lf->objname);

  aout_make_sections(u,hdr,be);   /* create up to 3 sections */
  aout_symbols(gv,u,hdr,be);      /* read all symbols */

  aoutstd_relocs(gv,u,hdr,be,(struct relocation_info *)    /* .text relocs */
                 (((uint8_t *)hdr)+aout_treloffset(hdr,be)),
                 read32(be,&hdr->a_trsize),
                 find_sect_type(u,ST_CODE,SP_READ|SP_EXEC),0);
  aoutstd_relocs(gv,u,hdr,be,(struct relocation_info *)    /* .data relocs */
                 (((uint8_t *)hdr)+aout_dreloffset(hdr,be)),
                 read32(be,&hdr->a_drsize),
                 find_sect_type(u,ST_DATA,SP_READ|SP_WRITE),
                 read32(be,hdr->a_text));

  /* add new object unit to the appropriate list */
  add_objunit(gv,u,FALSE);
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movq %rdx, 0xa0(%rsp)
movq 0xa8(%rsp), %rax
movzbl 0x38(%rax), %eax
movl %eax, %ecx
leaq 0x13c6c(%rip), %rax     # 0x3fa30
movq (%rax,%rcx,8), %rax
movsbl 0xaa(%rax), %eax
cmpl $0x0, %eax
jge 0x2be4a
movq 0xb0(%rsp), %rax
movsbl 0x202(%rax), %eax
cmpl $0x0, %eax
jge 0x2be32
callq 0x7890
movq 0xb0(%rsp), %rcx
movb %al, 0x202(%rcx)
movsbl %al, %eax
movl %eax, 0x9c(%rsp)
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rsi
movslq 0x9c(%rsp), %rcx
leaq 0x13330(%rip), %rax     # 0x3f150
movq (%rax,%rcx,8), %rdx
movl $0x80, %edi
movb $0x0, %al
callq 0x8c00
jmp 0x2be48
movq 0xb0(%rsp), %rax
movsbl 0x202(%rax), %eax
movl %eax, 0x9c(%rsp)
jmp 0x2be71
movq 0xa8(%rsp), %rax
movzbl 0x38(%rax), %eax
movl %eax, %ecx
leaq 0x13bd1(%rip), %rax     # 0x3fa30
movq (%rax,%rcx,8), %rax
movsbl 0xaa(%rax), %eax
movl %eax, 0x9c(%rsp)
movq 0xa8(%rsp), %rax
movzbl 0x39(%rax), %eax
cmpl $0x8, %eax
jne 0x2beb4
movq 0xa8(%rsp), %rax
movzbl 0x38(%rax), %eax
movl %eax, %ecx
leaq 0x13b99(%rip), %rax     # 0x3fa30
movq (%rax,%rcx,8), %rdi
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0xa0(%rsp), %rdx
callq 0x2c100
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movq 0xa8(%rsp), %rax
movq 0x20(%rax), %rdx
callq 0x12270
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movl 0x9c(%rsp), %edx
callq 0x2c220
movq 0xb0(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movl 0x9c(%rsp), %ecx
callq 0x2c3c0
movq 0xb0(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x30(%rsp)
movl 0x9c(%rsp), %eax
movl %eax, 0x3c(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xa0(%rsp), %rdi
movl 0x9c(%rsp), %esi
callq 0x2cfb0
movl %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
movl 0x9c(%rsp), %edi
movq 0xa0(%rsp), %rsi
addq $0x18, %rsi
callq 0x8060
movl %eax, 0x4c(%rsp)
movq 0x90(%rsp), %rdi
movl $0x1, %esi
movl $0x5, %edx
callq 0x11f40
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movl 0x3c(%rsp), %ecx
movq 0x40(%rsp), %r8
movl 0x4c(%rsp), %r9d
xorl %r10d, %r10d
movq %rax, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x2b000
movq 0xb0(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x68(%rsp)
movl 0x9c(%rsp), %eax
movl %eax, 0x74(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0xa0(%rsp), %rdi
movl 0x9c(%rsp), %esi
callq 0x2cfd0
movl %eax, %ecx
movq 0x50(%rsp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, 0x78(%rsp)
movl 0x9c(%rsp), %edi
movq 0xa0(%rsp), %rsi
addq $0x1c, %rsi
callq 0x8060
movl %eax, 0x84(%rsp)
movq 0x90(%rsp), %rdi
movl $0x2, %esi
movl $0x3, %edx
callq 0x11f40
movq %rax, 0x88(%rsp)
movl 0x9c(%rsp), %edi
movq 0xa0(%rsp), %rsi
addq $0x4, %rsi
callq 0x8060
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movl 0x74(%rsp), %ecx
movq 0x78(%rsp), %r8
movl 0x84(%rsp), %r9d
movq 0x88(%rsp), %r10
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x2b000
movq 0xb0(%rsp), %rdi
movq 0x90(%rsp), %rsi
xorl %edx, %edx
callq 0x123e0
addq $0xb8, %rsp
retq
nopw %cs:(%rax,%rax)