// File: /workspace/github_c_makefile_star2_O2/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, %r15
movl %ecx, %r13d
movl %edx, 0x4(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x34
popq %rsi
movl %ecx, %edx
callq 0x16fc0
movq %r14, %rdi
callq 0x16bef
pushq $0x4
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x15c40
movq %r14, %rdi
callq 0x1618f
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x15c40
movl 0x18425(%rip), %eax     # 0x2f758
movl %eax, 0x18423(%rip)     # 0x2f75c
pushq $0x2
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x15c40
pushq $0x1
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x15c40
movq %r14, %rdi
movq %r15, %rsi
callq 0x165e9
callq 0x16af1
movzwl 0x1c9a6(%rip), %ebp     # 0x33d10
callq 0x16a0d
movq 0x1c9a2(%rip), %r12     # 0x33d18
movl 0x1c993(%rip), %r15d    # 0x33d10
leal 0x2(%r15), %eax
imulq $0x28, %rax, %rax
addq %r12, %rax
movq %rax, 0x1c989(%rip)     # 0x33d18
leal 0x1(%r15), %edi
callq 0x16b8f
callq 0x16a7f
movzwl 0x1c96c(%rip), %eax     # 0x33d10
xorl %r10d, %r10d
cmpb $0x1, %r13b
sete %r10b
subq $0x8, %rsp
movq %rbx, %rdi
pushq $0x1
popq %rsi
movl 0xc(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %r12d, %r9d
pushq %r10
pushq %rbp
pushq %rax
pushq $0x0
pushq $0x0
callq 0x15748
addq $0x30, %rsp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x17190
movq %rbx, %rdi
callq 0x1722b
leaq 0x18400(%rip), %rsi     # 0x2f7f0
movq %rbx, %rdi
callq 0x171f0
movq %rbx, %rdi
callq 0x5190
movq %rbx, %rdi
pushq $0x2
popq %rbp
movl %ebp, %esi
movl %eax, %edx
callq 0x693c
movl 0x1c903(%rip), %edx     # 0x33d18
movq %r14, %rdi
movq %rbx, %rsi
movl %r15d, %ecx
callq 0x15a0f
movq %rbx, %rdi
leaq 0x18303(%rip), %rsi     # 0x2f730
callq 0x17261
leaq 0x18357(%rip), %rsi     # 0x2f790
movq %rbx, %rdi
callq 0x171f0
movq %rbx, %rdi
callq 0x5190
movq %rbx, %rdi
movl %ebp, %esi
movl %eax, %edx
callq 0x693c
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17297