// File: /workspace/github_c_makefile_star2_O3/deplinenoise[P]vlink/t_elf32.c
// Function: elf32_writeobject
void elf32_writeobject(struct GlobalVars *gv,FILE *f,uint16_t m,int8_t endian,
                       uint8_t (*reloc_vlink2elf)(struct Reloc *))
/* creates an ELF32 relocatable object file */
{
  uint32_t sh_off,shstrndx,stabndx;

  elf32_initoutput(gv,sizeof(struct Elf32_Ehdr),endian);
  elf32_makestabs(gv);
  elf32_stdsymtab(gv,STB_LOCAL,STT_FILE);

  elf32_makeshdrs(gv);
  elf32_stdsymtab(gv,STB_LOCAL,0);
  elf32symlist.global_index = elf32symlist.nextindex;
  elf32_stdsymtab(gv,STB_WEAK,0);
  elf32_stdsymtab(gv,STB_GLOBAL,0);
  elf32_addrelocs(gv,reloc_vlink2elf);

  elf32_makestabstr();
  shstrndx = elf32shdridx;
  elf32_makeshstrtab();
  sh_off = elf32offset;
  stabndx = elf32shdridx;
  elf32offset += (elf32shdridx+2) * sizeof(struct Elf32_Shdr);
  elf32_makesymtab(elf32shdridx+1);
  elf32_makestrtab();

  elf32_header(f,ET_REL,m,0,0,sh_off,0,0,elf32shdridx,
               shstrndx,endian==_BIG_ENDIAN_);
  elf32_writesections(gv,f);
  elf32_writestabstr(f);
  elf32_writestrtab(f,&elf32shstrlist);
  fwrite_align(f,2,ftell(f));
  elf32_writeshdrs(gv,f,elf32offset,stabndx);
  elf32_writesymtab(f,&elf32symlist);
  elf32_writestrtab(f,&elf32stringlist);
  fwrite_align(f,2,ftell(f));
  elf32_writerelocs(gv,f);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r13
movl %ecx, %r12d
movl %edx, 0x4(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
movl $0x34, %esi
movl %ecx, %edx
callq 0x18383
movq %r14, %rdi
callq 0x17f61
leaq 0x16ff3(%rip), %r15     # 0x2f720
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
movl $0x4, %ecx
callq 0x16ec3
movq %r14, %rdi
callq 0x17437
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x16ec3
movl 0x16fec(%rip), %eax     # 0x2f748
movl %eax, 0x16fea(%rip)     # 0x2f74c
movq %r14, %rdi
movq %r15, %rsi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x16ec3
movq %r14, %rdi
movq %r15, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x16ec3
movq %r14, %rdi
movq %r13, %rsi
callq 0x1793a
callq 0x17e63
movzwl 0x1b182(%rip), %r15d    # 0x33920
callq 0x17d8f
movq 0x1b17e(%rip), %rbp     # 0x33928
movl 0x1b16f(%rip), %r13d    # 0x33920
leal 0x2(%r13), %eax
leaq (%rax,%rax,4), %rax
leaq (,%rax,8), %rax
addq %rbp, %rax
movq %rax, 0x1b15d(%rip)     # 0x33928
leal 0x1(%r13), %edi
callq 0x17eff
callq 0x17df9
movzwl 0x1b140(%rip), %eax     # 0x33920
xorl %r10d, %r10d
cmpb $0x1, %r12b
sete %r10b
subq $0x8, %rsp
movq %rbx, %rdi
movl $0x1, %esi
movl 0xc(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %r10
pushq %r15
pushq %rax
xorl %eax, %eax
pushq %rax
pushq %rax
callq 0x1697e
addq $0x30, %rsp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18575
movq %rbx, %rdi
callq 0x1862e
leaq 0x16fb1(%rip), %rsi     # 0x2f7e0
movq %rbx, %rdi
callq 0x185f0
movq %rbx, %rdi
callq 0x5190
movq %rbx, %rdi
movl $0x2, %esi
movl %eax, %edx
callq 0x6ce0
movl 0x1b0d4(%rip), %edx     # 0x33928
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %ecx
callq 0x16c4d
movq %rbx, %rdi
leaq 0x16eb4(%rip), %rsi     # 0x2f720
callq 0x18668
leaq 0x16f08(%rip), %rsi     # 0x2f780
movq %rbx, %rdi
callq 0x185f0
movq %rbx, %rdi
callq 0x5190
movq %rbx, %rdi
movl $0x2, %esi
movl %eax, %edx
callq 0x6ce0
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x186a0