// File: /workspace/github_c_makefile_star2_O0/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 %r14
pushq %rbx
subq $0xc0, %rsp
movq %rdi, 0xb8(%rsp)
movq %rsi, 0xb0(%rsp)
movq 0xb8(%rsp), %rax
movzbl 0x50(%rax), %eax
movl %eax, %ecx
leaq 0x11490(%rip), %rax     # 0x3fa30
movq (%rax,%rcx,8), %rax
movl 0xa4(%rax), %eax
movl %eax, 0xac(%rsp)
movq 0xb8(%rsp), %rax
movzbl 0x50(%rax), %eax
movl %eax, %ecx
leaq 0x1146a(%rip), %rax     # 0x3fa30
movq (%rax,%rcx,8), %rax
movsbl 0xaa(%rax), %eax
movl %eax, 0xa8(%rsp)
movq $0x2, 0x80(%rsp)
cmpl $0x0, 0xa8(%rsp)
jge 0x2e604
movq 0xb8(%rsp), %rax
movsbl 0x202(%rax), %eax
movl %eax, 0xa8(%rsp)
movq 0xb8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x2d100
movq 0xb8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movl 0xa8(%rsp), %r8d
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x2d190
movq 0xb8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movl 0xa8(%rsp), %r8d
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x2d190
movq 0xb8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movl 0xa8(%rsp), %r8d
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x2d190
movq 0xb8(%rsp), %rdi
movl 0xa8(%rsp), %esi
callq 0x2d600
movq 0xb8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movl 0xa8(%rsp), %r9d
xorl %edx, %edx
leaq 0x16869(%rip), %rcx     # 0x44f20
leaq 0x262(%rip), %r8        # 0x2e920
callq 0x2d890
movl %eax, 0x8c(%rsp)
movq 0xb8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movl 0xa8(%rsp), %r9d
movl $0x1, %edx
leaq 0x1684a(%rip), %rcx     # 0x44f38
leaq 0x22b(%rip), %r8        # 0x2e920
callq 0x2d890
movl %eax, 0x88(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x70(%rsp)
movl 0xac(%rsp), %eax
movl %eax, 0x78(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x2ec00
movl %eax, %edx
xorl %eax, %eax
movl $0x10, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, 0x7c(%rsp)
cmpq $0x0, 0x90(%rsp)
je 0x2e780
movq 0x90(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x90(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0x80(%rsp), %rsi
callq 0x87f0
movq %rax, %rcx
movq 0x60(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x68(%rsp)
jmp 0x2e789
xorl %eax, %eax
movq %rax, 0x68(%rsp)
jmp 0x2e789
movq 0x68(%rsp), %rax
movl %eax, 0x5c(%rsp)
cmpq $0x0, 0x98(%rsp)
je 0x2e7d9
movq 0x98(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x90(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0x80(%rsp), %rsi
callq 0x87f0
movq %rax, %rcx
movq 0x48(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x50(%rsp)
jmp 0x2e7e2
xorl %eax, %eax
movq %rax, 0x50(%rsp)
jmp 0x2e7e2
movq 0x50(%rsp), %rax
movl %eax, 0x44(%rsp)
cmpq $0x0, 0xa0(%rsp)
je 0x2e809
movq 0xa0(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, 0x38(%rsp)
jmp 0x2e812
xorl %eax, %eax
movq %rax, 0x38(%rsp)
jmp 0x2e812
movl 0x44(%rsp), %r9d
movl 0x5c(%rsp), %r8d
movl 0x7c(%rsp), %ecx
movl 0x78(%rsp), %edx
movq 0x70(%rsp), %rdi
movq 0x38(%rsp), %rax
movl %eax, %ebp
movl 0x166e2(%rip), %eax     # 0x44f18
imulq $0xc, %rax, %rax
movl %eax, %ebx
movl 0x8c(%rsp), %r11d
movl 0x88(%rsp), %r10d
movl 0xa8(%rsp), %eax
movl $0x107, %esi            # imm = 0x107
xorl %r14d, %r14d
movl %ebp, (%rsp)
movl %ebx, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl %r11d, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
callq 0x2df90
movq 0xb0(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0x80(%rsp), %rax
movzbl %al, %edx
callq 0x2e3f0
movq 0xb0(%rsp), %rdi
movq 0x98(%rsp), %rsi
movq 0x80(%rsp), %rax
movzbl %al, %edx
callq 0x2e3f0
movq 0xb0(%rsp), %rdi
leaq 0x16654(%rip), %rsi     # 0x44f20
callq 0x2e450
movq 0xb0(%rsp), %rdi
leaq 0x16658(%rip), %rsi     # 0x44f38
callq 0x2e450
movq 0xb0(%rsp), %rdi
callq 0x2e490
movq 0xb0(%rsp), %rdi
movl 0xa8(%rsp), %esi
callq 0x2e4d0
addq $0xc0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopw %cs:(%rax,%rax)