void bios_linker_loader_add_pointer(BIOSLinker *linker,

                                    const char *dest_file,

                                    const char *src_file,

                                    void *pointer,

                                    uint8_t pointer_size)

{

    BiosLinkerLoaderEntry entry;

    const BiosLinkerFileEntry *file = bios_linker_find_file(linker, dest_file);

    ptrdiff_t offset = (gchar *)pointer - file->blob->data;



    assert(offset >= 0);

    assert(offset + pointer_size <= file->blob->len);



    memset(&entry, 0, sizeof entry);

    strncpy(entry.pointer.dest_file, dest_file,

            sizeof entry.pointer.dest_file - 1);

    strncpy(entry.pointer.src_file, src_file,

            sizeof entry.pointer.src_file - 1);

    entry.command = cpu_to_le32(BIOS_LINKER_LOADER_COMMAND_ADD_POINTER);

    entry.pointer.offset = cpu_to_le32(offset);

    entry.pointer.size = pointer_size;

    assert(pointer_size == 1 || pointer_size == 2 ||

           pointer_size == 4 || pointer_size == 8);



    g_array_append_vals(linker->cmd_blob, &entry, sizeof entry);

}

void bios_linker_loader_add_pointer(BIOSLinker *linker,

                                    const char *dest_file,

                                    const char *src_file,

                                    void *pointer,

                                    uint8_t pointer_size)

{

    BiosLinkerLoaderEntry entry;

    const BiosLinkerFileEntry *file = bios_linker_find_file(linker, dest_file);

    ptrdiff_t offset = (gchar *)pointer - file->blob->data;



    assert(offset >= 0);

    assert(offset + pointer_size <= file->blob->len);



    memset(&entry, 0, sizeof entry);

    strncpy(entry.pointer.dest_file, dest_file,

            sizeof entry.pointer.dest_file - 1);

    strncpy(entry.pointer.src_file, src_file,

            sizeof entry.pointer.src_file - 1);

    entry.command = cpu_to_le32(BIOS_LINKER_LOADER_COMMAND_ADD_POINTER);

    entry.pointer.offset = cpu_to_le32(offset);

    entry.pointer.size = pointer_size;

    assert(pointer_size == 1 || pointer_size == 2 ||

           pointer_size == 4 || pointer_size == 8);



    g_array_append_vals(linker->cmd_blob, &entry, sizeof entry);

}

void FUNC_0(BIOSLinker *VAR_0,

                                    const char *VAR_1,

                                    const char *VAR_2,

                                    void *VAR_3,

                                    uint8_t VAR_4)

{

    BiosLinkerLoaderEntry entry;

    const BiosLinkerFileEntry *VAR_5 = bios_linker_find_file(VAR_0, VAR_1);

    ptrdiff_t offset = (gchar *)VAR_3 - VAR_5->blob->data;



    assert(offset >= 0);

    assert(offset + VAR_4 <= VAR_5->blob->len);



    memset(&entry, 0, sizeof entry);

    strncpy(entry.VAR_3.VAR_1, VAR_1,

            sizeof entry.VAR_3.VAR_1 - 1);

    strncpy(entry.VAR_3.VAR_2, VAR_2,

            sizeof entry.VAR_3.VAR_2 - 1);

    entry.command = cpu_to_le32(BIOS_LINKER_LOADER_COMMAND_ADD_POINTER);

    entry.VAR_3.offset = cpu_to_le32(offset);

    entry.VAR_3.size = VAR_4;

    assert(VAR_4 == 1 || VAR_4 == 2 ||

           VAR_4 == 4 || VAR_4 == 8);



    g_array_append_vals(VAR_0->cmd_blob, &entry, sizeof entry);

}

void FUNC_0(BIOSLinker *VAR_0,
const char *VAR_1,
const char *VAR_2,
void *VAR_3,
uint8_t VAR_4)
{ BiosLinkerLoaderEntry entry; const BiosLinkerFileEntry *VAR_5 = bios_linker_find_file(VAR_0, VAR_1); ptrdiff_t offset = (gchar *)VAR_3 - VAR_5->blob->data; assert(offset >= 0); assert(offset + VAR_4 <= VAR_5->blob->len); memset(&entry, 0, sizeof entry); strncpy(entry.VAR_3.VAR_1, VAR_1,
sizeof entry.VAR_3.VAR_1 - 1); strncpy(entry.VAR_3.VAR_2, VAR_2,
sizeof entry.VAR_3.VAR_2 - 1); entry.command = cpu_to_le32(BIOS_LINKER_LOADER_COMMAND_ADD_POINTER); entry.VAR_3.offset = cpu_to_le32(offset); entry.VAR_3.size = VAR_4; assert(VAR_4 == 1 || VAR_4 == 2 ||
VAR_4 == 4 || VAR_4 == 8); g_array_append_vals(VAR_0->cmd_blob, &entry, sizeof entry); }