// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, 0x28(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
movzbl 0x38(%rsi), %eax
leaq 0x136a8(%rip), %r14     # 0x2f180
movq (%r14,%rax,8), %rax
movb 0xaa(%rax), %bpl
testb %bpl, %bpl
jns 0x1bb21
movb 0x202(%r15), %bpl
testb %bpl, %bpl
jns 0x1bb21
callq 0x693f
movl %eax, %ebp
movb %al, 0x202(%r15)
movq 0x10(%rbx), %rsi
movsbq %al, %rax
leaq 0x1364f(%rip), %rcx     # 0x2f160
movq (%rcx,%rax,8), %rdx
movl $0x80, %edi
xorl %eax, %eax
callq 0x6f84
movq %r15, 0x40(%rsp)
cmpb $0x8, 0x39(%rbx)
jne 0x1bbd1
movzbl 0x38(%rbx), %eax
movq (%r14,%rax,8), %r15
movq 0x10(%rbx), %r14
movq 0x28(%rsp), %rdi
callq 0x695d
shrl $0x10, %eax
andl $0x3ff, %eax            # imm = 0x3FF
cmpl 0xa4(%r15), %eax
je 0x1bb72
movq 0x28(%rsp), %rdi
callq 0x695d
testl $0x3ff0000, %eax        # imm = 0x3FF0000
je 0x1bb72
movq (%r15), %rdx
movl $0x29, %edi
jmp 0x1bbc7
movq 0x28(%rsp), %rdi
callq 0x695d
movzwl %ax, %eax
cmpl $0x107, %eax            # imm = 0x107
jg 0x1bb9a
cmpl $0xcc, %eax
je 0x1c59e
cmpl $0x107, %eax            # imm = 0x107
je 0x1bbd1
jmp 0x1bb68
cmpl $0x10b, %eax            # imm = 0x10B
je 0x1bba8
cmpl $0x108, %eax            # imm = 0x108
jne 0x1bb68
movq 0x28(%rsp), %rdi
callq 0x695d
btl $0x1a, %eax
movq (%r15), %rdx
jb 0x1bbc2
movl $0x28, %edi
jmp 0x1bbc7
movl $0x27, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x6f84
movsbl %bpl, %r12d
movq 0x20(%rbx), %rdx
movq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0xbf5e
movq %rax, %r13
movq 0x28(%rsp), %r15
leaq 0x4(%r15), %rsi
movl %r12d, %edi
movq %rsi, 0x78(%rsp)
callq 0x69b3
testl %eax, %eax
je 0x1bc1e
leaq 0x20(%r15), %rdx
movl %eax, %ecx
leaq 0x6990(%rip), %rsi      # 0x225a0
movq %r13, %rdi
movl $0x1, %r8d
callq 0x1d940
leaq 0x8(%r15), %r14
movl %r12d, %edi
movq %r14, %rsi
callq 0x69b3
testl %eax, %eax
je 0x1bc5a
movl %eax, %ebx
movq %r15, %rdi
movl %r12d, %esi
callq 0x1d9dc
movl %eax, %edx
addq %r15, %rdx
movl %ebx, %ecx
leaq 0x695a(%rip), %rsi      # 0x225a6
movq %r13, %rdi
movl $0x2, %r8d
callq 0x1d940
leaq 0xc(%r15), %rsi
movl %r12d, %edi
callq 0x69b3
testl %eax, %eax
movq %r14, 0x70(%rsp)
je 0x1bcc5
movl %eax, %ebx
movq %r15, %rdi
movl %r12d, %esi
callq 0x1d9dc
movl %eax, %r14d
movl %r12d, %edi
movq 0x70(%rsp), %rsi
callq 0x69b3
addl %eax, %r14d
addq %r15, %r14
movl %ebx, %ecx
subq $0x8, %rsp
leaq 0x690d(%rip), %rsi      # 0x225ac
movq %r13, %rdi
movq %r14, %rdx
movq 0x78(%rsp), %r14
movl $0x3, %r8d
movl $0x3, %r9d
pushq $0x0
pushq $0x2
pushq $0x3
callq 0xc1c8
addq $0x20, %rsp
movq %r13, 0x20(%rsp)
movq 0x10(%r13), %rbp
movq %r15, %rdi
movl %r12d, %esi
callq 0x1c5b2
movl %eax, %ebx
leaq 0x1c(%r15), %rsi
movl %r12d, %edi
movq %rsi, 0x88(%rsp)
callq 0x69b3
movl %eax, %r13d
addl %ebx, %r13d
addq %r15, %r13
leaq 0x10(%r15), %rsi
movl %r12d, %edi
callq 0x69b3
movl %eax, %ebx
movq %r15, %rdi
callq 0x695d
movzwl %ax, %eax
cmpl $0x10b, %eax            # imm = 0x10B
sete 0x8(%rsp)
movl %r12d, %edi
movq 0x78(%rsp), %rsi
callq 0x69b3
movl %eax, 0x30(%rsp)
movl %r12d, %edi
movq %r14, %rsi
movq %rbp, %r14
callq 0x69b3
movl %eax, 0x1c(%rsp)
movq 0x28(%rbp), %rax
movl %ebx, %r15d
cmpq %rax, %r13
jb 0x1bd57
leaq (%r15,%r13), %rcx
addq 0x30(%r14), %rax
cmpq %rax, %rcx
jbe 0x1bd72
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0x59a9(%rip), %rdx      # 0x2170f
movl $0x55, %edi
xorl %eax, %eax
callq 0x6f84
movq %r15, 0x68(%rsp)
imull $0xaaaaaaab, %ebx, %eax # imm = 0xAAAAAAAB
rorl $0x2, %eax
cmpl $0x15555556, %eax       # imm = 0x15555556
jb 0x1bda8
movq 0x10(%r14), %rsi
movq 0x20(%r14), %rcx
leaq 0x5979(%rip), %rdx      # 0x2170f
movl $0xc, %r8d
movl $0x56, %edi
xorl %eax, %eax
callq 0x6f84
movq 0x28(%rsp), %rbp
movq %rbp, %rdi
movl %r12d, %esi
callq 0x1d900
movq %r14, %r15
movl %eax, %r14d
addq %rbp, %r14
cmpq 0x28(%r15), %r14
jb 0x1bde4
movl %r12d, %edi
movq %r14, %rsi
callq 0x69b3
movl %eax, %eax
addq %r14, %rax
movq 0x28(%r15), %rcx
addq 0x30(%r15), %rcx
cmpq %rcx, %rax
jbe 0x1bdff
movq 0x10(%r15), %rsi
movq 0x20(%r15), %rcx
leaq 0x76eb(%rip), %rdx      # 0x234de
movl $0x55, %edi
xorl %eax, %eax
callq 0x6f84
movq %r15, 0x48(%rsp)
cmpl $0xc, %ebx
movq 0x28(%rsp), %rbp
jae 0x1bf01
movq %rbp, %rdi
movl %r12d, %esi
callq 0x1d9dc
movq %rbp, %r13
movl %eax, %ebx
movl %r12d, %edi
movq 0x70(%rsp), %rsi
callq 0x69b3
addl %eax, %ebx
addq %rbp, %rbx
leaq 0x18(%rbp), %rsi
movl %r12d, %edi
callq 0x69b3
movl %eax, %r14d
movq 0x20(%rsp), %rbp
movq %rbp, %rdi
movl $0x1, %esi
movl $0x5, %edx
callq 0xbe23
movq 0x40(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movl %r12d, %ecx
movq %rbx, %r8
movl %r14d, %r9d
pushq $0x0
pushq %rax
callq 0x1b3a8
addq $0x10, %rsp
movq %r13, %rdi
movl %r12d, %esi
callq 0x1c5b2
movl %eax, %ebx
addq %r13, %rbx
movl %r12d, %edi
movq 0x88(%rsp), %rsi
callq 0x69b3
movl %eax, 0x8(%rsp)
movq %rbp, %rdi
movl $0x2, %esi
movl $0x3, %edx
callq 0xbe23
movq %rax, %r14
movl %r12d, %edi
movq 0x78(%rsp), %rsi
callq 0x69b3
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movl %r12d, %ecx
movq %rbx, %r8
movl 0x8(%rsp), %r9d
pushq %rax
pushq %r14
callq 0x1b3a8
addq $0x10, %rsp
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc040
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq 0x68(%rsp), %rcx
xorl %eax, %eax
movb 0x8(%rsp), %dl
movb %dl, %al
shrq $0x23, %rcx
movq %rcx, 0x68(%rsp)
shll $0x5, %eax
movl %eax, 0x34(%rsp)
movl 0x1c(%rsp), %eax
addl 0x30(%rsp), %eax
movl %eax, 0x1c(%rsp)
xorl %r14d, %r14d
movl %r12d, 0x14(%rsp)
leaq 0x8(%r13), %rsi
movl %r12d, %edi
callq 0x69b3
movl %eax, %ebx
movl %r12d, %edi
movq %r13, %rsi
callq 0x69b3
movq 0x48(%rsp), %rdi
movq %rbp, %rsi
movl %r12d, %edx
movl %eax, %ecx
callq 0x1da0c
movq %rax, %r9
movzbl 0x5(%r13), %eax
movl %eax, %edx
andl $0xf, %edx
movl %edx, %ecx
shll $0x3, %ecx
movl $0x2020100, %r15d       # imm = 0x2020100
shrl %cl, %r15d
cmpb $0x4, %dl
movl $0x0, %ecx
cmovael %ecx, %r15d
movb 0x4(%r13), %sil
andb $0x1, %sil
incb %sil
shrl $0x4, %eax
cmpl $0x2, %eax
jb 0x1bffa
jne 0x1bfa4
movb $0x3, %sil
jmp 0x1bffa
movq 0x48(%rsp), %rcx
movb %sil, 0x8(%rsp)
movq 0x10(%rcx), %rsi
movq 0x20(%rcx), %r8
movl $0x58, %edi
movq %r9, %rdx
movl %eax, %ecx
xorl %eax, %eax
movq %r13, 0x38(%rsp)
movl %r15d, %r13d
movq %r14, %r15
movq %rbp, %r14
movl %r12d, %ebp
movq %rbx, %r12
movq %r9, %rbx
callq 0x6f84
movb 0x8(%rsp), %sil
movq %rbx, %r9
movq %r12, %rbx
movl %ebp, %r12d
movq %r14, %rbp
movq %r15, %r14
movl %r13d, %r15d
movq 0x38(%rsp), %r13
movzbl 0x4(%r13), %ecx
cmpl $0x20, %ecx
jae 0x1c02b
movq %r9, 0x50(%rsp)
jae 0x1c33a
movl %ecx, %eax
leaq 0x8868(%rip), %rdx      # 0x24880
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movb %sil, 0x8(%rsp)
jmp 0x1c374
movq 0x40(%rsp), %rax
cmpb $0x0, 0x6c(%rax)
jne 0x1c552
andl $0x1e, %ecx
cmpl $0x8, %ecx
movq %r9, 0x50(%rsp)
movq %rbx, 0x60(%rsp)
je 0x1c170
cmpl $0x6, %ecx
je 0x1c11e
cmpl $0x4, %ecx
jne 0x1c1c7
movq 0x20(%rsp), %r15
movq %r15, %rdi
movl $0x1, %esi
movl $0x5, %edx
callq 0xbe23
testq %rax, %rax
jne 0x1c0ab
subq $0x8, %rsp
movq %r15, %rdi
leaq 0x6514(%rip), %rsi      # 0x225a0
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq $0x0
pushq $0x2
pushq $0x5
callq 0xc1c8
addq $0x20, %rsp
movq %rax, %rbx
movl 0x34(%rsp), %eax
jmp 0x1c1c0
movb %sil, 0x8(%rsp)
jmp 0x1c22c
movq 0x20(%rsp), %rdi
movb %sil, 0x8(%rsp)
callq 0xc30c
movq %rax, 0x38(%rsp)
leaq 0xc(%r13), %rsi
movl %r12d, %edi
callq 0x69b3
movq 0x48(%rsp), %rdi
movq %rbp, %rsi
movl %r12d, %edx
movl %eax, %ecx
callq 0x1da0c
movq 0x38(%rsp), %r11
movb 0x8(%rsp), %sil
movq %rax, %rcx
xorl %r8d, %r8d
movb $0x4, %dl
jmp 0x1c333
movb %sil, 0x8(%rsp)
jmp 0x1c391
movb %sil, 0x8(%rsp)
jmp 0x1c294
movq 0x20(%rsp), %r15
movq %r15, %rdi
movl $0x2, %esi
movl $0x3, %edx
callq 0xbe23
testq %rax, %rax
jne 0x1c167
subq $0x8, %rsp
movq %r15, %rdi
leaq 0x645e(%rip), %rsi      # 0x225a6
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq $0x0
pushq $0x2
pushq $0x3
callq 0xc1c8
addq $0x20, %rsp
movq %rax, %rbx
movl 0x30(%rsp), %eax
jmp 0x1c1c0
movq 0x20(%rsp), %r15
movq %r15, %rdi
movl $0x3, %esi
movl $0x3, %edx
callq 0xbe23
testq %rax, %rax
jne 0x1c1b9
subq $0x8, %rsp
movq %r15, %rdi
leaq 0x6412(%rip), %rsi      # 0x225ac
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x3, %r8d
movl $0x3, %r9d
pushq $0x0
pushq $0x2
pushq $0x3
callq 0xc1c8
addq $0x20, %rsp
movq %rax, %rbx
movl 0x1c(%rsp), %eax
movq %rax, 0x8(%rsp)
jmp 0x1c1d2
movq $0x0, 0x8(%rsp)
xorl %ebx, %ebx
movzbl 0x4(%r13), %r15d
movsbl 0x5(%r13), %ebp
leaq 0x6(%r13), %rsi
movl 0x14(%rsp), %r12d
movl %r12d, %edi
callq 0x6993
movq 0x60(%rsp), %r10
subl 0x8(%rsp), %r10d
subq $0x8, %rsp
movswl %ax, %r9d
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq 0x58(%rsp), %rdx
movl %r15d, %ecx
movl %ebp, %r8d
pushq %r10
callq 0xb395
addq $0x10, %rsp
movq 0x28(%rsp), %rbp
jmp 0x1c552
movb $0x3, 0x8(%rsp)
movq 0x20(%rsp), %r12
movq %r12, %rdi
movl $0x3, %esi
movl $0x3, %edx
callq 0xbe23
movb $0x2, %dl
testq %rax, %rax
je 0x1c251
movq %rax, %r11
xorl %ecx, %ecx
jmp 0x1c285
subq $0x8, %rsp
movq %r12, %rdi
leaq 0x634d(%rip), %rsi      # 0x225ac
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x3, %r8d
movl $0x3, %r9d
pushq $0x0
pushq $0x2
pushq $0x3
callq 0xc1c8
movb $0x2, %dl
xorl %ecx, %ecx
addq $0x20, %rsp
movq %rax, %r11
movl 0x1c(%rsp), %r8d
jmp 0x1c3ef
movb $0x3, 0x8(%rsp)
movq 0x20(%rsp), %r12
movq %r12, %rdi
movl $0x2, %esi
movl $0x3, %edx
callq 0xbe23
movb $0x2, %dl
testq %rax, %rax
je 0x1c2b9
movq %rax, %r11
xorl %ecx, %ecx
jmp 0x1c2ed
subq $0x8, %rsp
movq %r12, %rdi
leaq 0x62df(%rip), %rsi      # 0x225a6
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq $0x0
pushq $0x2
pushq $0x3
callq 0xc1c8
movb $0x2, %dl
xorl %ecx, %ecx
addq $0x20, %rsp
movq %rax, %r11
movl 0x30(%rsp), %r8d
jmp 0x1c3ef
movq 0x48(%rsp), %rax
movb %sil, 0x8(%rsp)
movq 0x10(%rax), %rsi
movq 0x20(%rax), %rcx
movl $0x60, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x6f84
jmp 0x1c35c
movq 0x20(%rsp), %rdi
callq 0xc30c
movq %rax, %r11
xorl %ecx, %ecx
movb $0x4, %r15b
movb $0x1, %dl
movb $0x1, %sil
xorl %r8d, %r8d
xorl %eax, %eax
jmp 0x1c43e
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdx
andl $0x1e, %ecx
leaq 0x877e(%rip), %rdi      # 0x24acb
movb %sil, 0x8(%rsp)
movq %r9, %rsi
xorl %eax, %eax
callq 0x52b0
xorl %ecx, %ecx
movb 0x8(%rsp), %sil
movb $0x2, %dl
xorl %r8d, %r8d
xorl %eax, %eax
jmp 0x1c43b
movb $0x3, 0x8(%rsp)
movq 0x20(%rsp), %rdi
callq 0xc30c
movq %rax, %r11
xorl %ecx, %ecx
movb $0x1, %dl
xorl %r8d, %r8d
xorl %eax, %eax
jmp 0x1c3f6
movb $0x3, 0x8(%rsp)
movq 0x20(%rsp), %r12
movq %r12, %rdi
movl $0x1, %esi
movl $0x5, %edx
callq 0xbe23
movb $0x2, %dl
testq %rax, %rax
je 0x1c3b6
movq %rax, %r11
xorl %ecx, %ecx
jmp 0x1c3ea
subq $0x8, %rsp
movq %r12, %rdi
leaq 0x61dc(%rip), %rsi      # 0x225a0
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq $0x0
pushq $0x2
pushq $0x5
callq 0xc1c8
movb $0x2, %dl
xorl %ecx, %ecx
addq $0x20, %rsp
movq %rax, %r11
movl 0x34(%rsp), %r8d
xorl %eax, %eax
movl 0x14(%rsp), %r12d
movb 0x8(%rsp), %sil
jmp 0x1c43e
movb $0x3, %sil
testl %ebx, %ebx
je 0x1c430
movq 0x40(%rsp), %rdi
movb %sil, 0x8(%rsp)
movq 0x20(%rsp), %rsi
callq 0xc242
movb 0x8(%rsp), %sil
movq %rax, %r11
xorl %ecx, %ecx
movb $0x3, %dl
xorl %r8d, %r8d
movl %ebx, %eax
movl $0x2, %ebx
jmp 0x1c43e
xorl %ecx, %ecx
movb $0x2, %dl
xorl %r8d, %r8d
xorl %eax, %eax
xorl %ebx, %ebx
xorl %r11d, %r11d
testq %r11, %r11
je 0x1c552
leal 0x1(%r14), %r12d
cmpl 0x68(%rsp), %r12d
jge 0x1c4ec
movb 0x10(%r13), %dil
andb $0x1e, %dil
cmpb $0xc, %dil
jne 0x1c4ec
movl %r8d, 0x5c(%rsp)
movq %rax, 0x90(%rsp)
movq %r11, 0x38(%rsp)
movb %dl, 0x1b(%rsp)
movq %rcx, 0x60(%rsp)
movb %sil, 0x8(%rsp)
leaq 0xc(%r13), %rsi
movl 0x14(%rsp), %ebp
movl %ebp, %edi
movq %rsi, 0x80(%rsp)
callq 0x69b3
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rsi
movl %ebp, %edx
movl %eax, %ecx
callq 0x1da0c
movq 0x50(%rsp), %rdi
movq %rax, %rsi
callq 0x5160
testl %eax, %eax
je 0x1c569
movl %r14d, %r12d
movb 0x8(%rsp), %sil
movq 0x60(%rsp), %rcx
movb 0x1b(%rsp), %dl
movq 0x38(%rsp), %r11
movq 0x90(%rsp), %rax
movl 0x5c(%rsp), %r8d
jmp 0x1c4ef
movl %r14d, %r12d
subl %r8d, %ebx
movslq %ebx, %r8
movzbl %r15b, %ebx
movzbl %dl, %r9d
subq $0x8, %rsp
cmpb $0x1, %sil
jne 0x1c523
movq 0x48(%rsp), %rdi
movq %r11, %rsi
movq 0x58(%rsp), %rdx
pushq %rax
pushq %rbx
pushq $0x0
callq 0xadae
addq $0x20, %rsp
jmp 0x1c545
movzbl %sil, %r10d
movq 0x48(%rsp), %rdi
movq %r11, %rsi
movq 0x58(%rsp), %rdx
pushq $0x1
pushq %rax
pushq %r10
pushq %rbx
pushq $0x0
callq 0xaba4
addq $0x30, %rsp
movl %r12d, %r14d
movq 0x28(%rsp), %rbp
movl 0x14(%rsp), %r12d
incl %r14d
addq $0xc, %r13
cmpl 0x68(%rsp), %r14d
jl 0x1bf38
jmp 0x1be12
addq $0x14, %r13
movl 0x14(%rsp), %edi
movq %r13, %rsi
callq 0x69b3
movb 0x8(%rsp), %sil
movq 0x60(%rsp), %rcx
movb 0x1b(%rsp), %dl
movq 0x38(%rsp), %r11
movl 0x5c(%rsp), %r8d
movq 0x80(%rsp), %r13
jmp 0x1c4ef
movl $0x54, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x6f84
jmp 0x1bbd1