#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct coff_Section {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ align4_table(struct coff_Section *const);
int /*<<< orphan*/ section_write32(struct coff_Section *const, int);
int /*<<< orphan*/ write_filename_table(struct coff_Section *const);
int /*<<< orphan*/ write_linenumber_table(struct coff_Section *const);
int /*<<< orphan*/ write_sourcefile_table(struct coff_Section *const);
int /*<<< orphan*/ write_symbolinfo_table(struct coff_Section *const);
void build_symbol_table(struct coff_Section *const sect) {
  section_write32(sect, 0x00000004);
  write_filename_table(sect);
  align4_table(sect);
  write_sourcefile_table(sect);
  align4_table(sect);
  write_linenumber_table(sect);
  align4_table(sect);
  write_symbolinfo_table(sect);
  align4_table(sect);
}


x86 assembly (clang, -O0):
<build_symbol_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1080 <section_write32@plt>
mov    -0x8(%rbp),%rdi
call   1070 <write_filename_table@plt>
mov    -0x8(%rbp),%rdi
call   1040 <align4_table@plt>
mov    -0x8(%rbp),%rdi
call   1030 <write_sourcefile_table@plt>
mov    -0x8(%rbp),%rdi
call   1040 <align4_table@plt>
mov    -0x8(%rbp),%rdi
call   1060 <write_linenumber_table@plt>
mov    -0x8(%rbp),%rdi
call   1040 <align4_table@plt>
mov    -0x8(%rbp),%rdi
call   1050 <write_symbolinfo_table@plt>
mov    -0x8(%rbp),%rdi
call   1040 <align4_table@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_symbol_table>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%esi
call   1080 <section_write32@plt>
mov    %rbx,%rdi
call   1070 <write_filename_table@plt>
mov    %rbx,%rdi
call   1040 <align4_table@plt>
mov    %rbx,%rdi
call   1030 <write_sourcefile_table@plt>
mov    %rbx,%rdi
call   1040 <align4_table@plt>
mov    %rbx,%rdi
call   1060 <write_linenumber_table@plt>
mov    %rbx,%rdi
call   1040 <align4_table@plt>
mov    %rbx,%rdi
call   1050 <write_symbolinfo_table@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <align4_table@plt>

LLVM IR (-O0):
%struct.coff_Section = type { i32 }
define void @build_symbol_table(%struct.coff_Section* %0) {
%2 = alloca %struct.coff_Section*
store %struct.coff_Section* %0, %struct.coff_Section** %2
%3 = load %struct.coff_Section*, %struct.coff_Section** %2
%4 = call i32 @section_write32(%struct.coff_Section* %3, i32 4)
%5 = load %struct.coff_Section*, %struct.coff_Section** %2
%6 = call i32 @write_filename_table(%struct.coff_Section* %5)
%7 = load %struct.coff_Section*, %struct.coff_Section** %2
%8 = call i32 @align4_table(%struct.coff_Section* %7)
%9 = load %struct.coff_Section*, %struct.coff_Section** %2
%10 = call i32 @write_sourcefile_table(%struct.coff_Section* %9)
%11 = load %struct.coff_Section*, %struct.coff_Section** %2
%12 = call i32 @align4_table(%struct.coff_Section* %11)
%13 = load %struct.coff_Section*, %struct.coff_Section** %2
%14 = call i32 @write_linenumber_table(%struct.coff_Section* %13)
%15 = load %struct.coff_Section*, %struct.coff_Section** %2
%16 = call i32 @align4_table(%struct.coff_Section* %15)
%17 = load %struct.coff_Section*, %struct.coff_Section** %2
%18 = call i32 @write_symbolinfo_table(%struct.coff_Section* %17)
%19 = load %struct.coff_Section*, %struct.coff_Section** %2
%20 = call i32 @align4_table(%struct.coff_Section* %19)
ret void
}

LLVM IR (-O2):
%struct.coff_Section = type { i32 }
define void @build_symbol_table(%struct.coff_Section* %0) {
%2 = tail call i32 @section_write32(%struct.coff_Section* %0, i32 4)
%3 = tail call i32 @write_filename_table(%struct.coff_Section* %0)
%4 = tail call i32 @align4_table(%struct.coff_Section* %0)
%5 = tail call i32 @write_sourcefile_table(%struct.coff_Section* %0)
%6 = tail call i32 @align4_table(%struct.coff_Section* %0)
%7 = tail call i32 @write_linenumber_table(%struct.coff_Section* %0)
%8 = tail call i32 @align4_table(%struct.coff_Section* %0)
%9 = tail call i32 @write_symbolinfo_table(%struct.coff_Section* %0)
%10 = tail call i32 @align4_table(%struct.coff_Section* %0)
ret void
}