// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]vlink/t_aout.c
// Function: aoutstd_writeobject
void aoutstd_writeobject(struct GlobalVars *gv,FILE *f)
/* creates a standard a.out relocatable object file */
{
  uint32_t mid = fff[gv->dest_format]->id;
  int be = (int)fff[gv->dest_format]->endianess;
  struct LinkedSection *sections[3];
  uint32_t trsize,drsize;
  unsigned long a = MIN_ALIGNMENT;

  if (be < 0)
    be = gv->endianess;
  aout_initwrite(gv,sections);
  aout_addsymlist(gv,sections,BIND_GLOBAL,0,be);
  aout_addsymlist(gv,sections,BIND_WEAK,0,be);
  aout_addsymlist(gv,sections,BIND_LOCAL,0,be);
  aout_debugsyms(gv,be);
  trsize = aout_addrelocs(gv,sections,0,&treloclist,aoutstd_getrinfo,be);
  drsize = aout_addrelocs(gv,sections,1,&dreloclist,aoutstd_getrinfo,be);

  aout_header(f,OMAGIC,mid,isPIC(sections) ? EX_PIC : 0,
              sections[0] ? sections[0]->size+align(sections[0]->size,a) : 0,
              sections[1] ? sections[1]->size+align(sections[0]->size,a) : 0,
              sections[2] ? sections[2]->size : 0,
              aoutsymlist.nextindex * sizeof(struct nlist32),
              0,trsize,drsize,be);
  aout_writesection(f,sections[0],(uint8_t)a);
  aout_writesection(f,sections[1],(uint8_t)a);
  aout_writerelocs(f,&treloclist);
  aout_writerelocs(f,&dreloclist);
  aout_writesymbols(f);
  aout_writestrings(f,be);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r13
movzbl 0x50(%rdi), %eax
leaq 0x138a1(%rip), %rcx     # 0x2f190
movq (%rcx,%rax,8), %rax
movb 0xaa(%rax), %cl
testb %cl, %cl
jns 0x1b904
movb 0x202(%r13), %cl
movl 0xa4(%rax), %eax
movl %eax, 0xc(%rsp)
movsbl %cl, %r14d
leaq 0x10(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x1acd9
pushq $0x1
popq %rdx
xorl %r15d, %r15d
movq %r13, %rdi
movq %rbp, %rsi
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x1ad58
pushq $0x2
popq %rdx
movq %r13, %rdi
movq %rbp, %rsi
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x1ad58
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x1ad58
movq %r13, %rdi
movl %r14d, %esi
callq 0x1afd8
leaq 0x185d1(%rip), %rcx     # 0x33f40
leaq 0x13e(%rip), %r12       # 0x1bab4
movq %r13, %rdi
movq %rbp, %rsi
xorl %edx, %edx
movq %r12, %r8
movl %r14d, %r9d
callq 0x1b1c1
movq %rax, 0x30(%rsp)
leaq 0x185c3(%rip), %rcx     # 0x33f58
movq %r13, %rdi
movq %rbp, %rsi
pushq $0x1
popq %rdx
movq %r12, %r8
movl %r14d, %r9d
callq 0x1b1c1
movl %eax, %r13d
movq %rbp, %rdi
callq 0x1bc38
movl %eax, %r12d
movq (%rbp), %rax
movl $0x0, %ebp
testq %rax, %rax
je 0x1b9d6
movq 0x48(%rax), %rbp
pushq $0x2
popq %rsi
movq %rbp, %rdi
callq 0x6a1e
addl %eax, %ebp
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x1ba07
movl %r12d, %r15d
movq %r13, %r12
movl 0x48(%rax), %r13d
movq 0x10(%rsp), %rax
movq 0x48(%rax), %rdi
pushq $0x2
popq %rsi
callq 0x6a1e
addl %r13d, %eax
movq %r12, %r13
movl %r15d, %r12d
movq %rax, %r15
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x1ba16
movl 0x48(%rax), %eax
jmp 0x1ba18
xorl %eax, %eax
xorl %ecx, %ecx
testl %r12d, %r12d
setne %cl
shll $0x4, %ecx
imull $0xc, 0x1850d(%rip), %r10d # 0x33f38
movq %rbx, %rdi
movl $0x107, %esi            # imm = 0x107
movl 0xc(%rsp), %edx
movl %ebp, %r8d
movl %r15d, %r9d
pushq %r14
pushq %r13
pushq 0x40(%rsp)
pushq $0x0
pushq %r10
pushq %rax
callq 0x1b53f
addq $0x30, %rsp
movq 0x10(%rsp), %rsi
pushq $0x2
popq %rbp
movq %rbx, %rdi
movl %ebp, %edx
callq 0x1b7be
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x1b7be
leaq 0x184c5(%rip), %rsi     # 0x33f40
movq %rbx, %rdi
callq 0x1b7f1
leaq 0x184ce(%rip), %rsi     # 0x33f58
movq %rbx, %rdi
callq 0x1b7f1
movq %rbx, %rdi
callq 0x1b827
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1b861
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq