def METHOD_NAME(
    hash_entries: t.Iterable[tuple[bytes, str]],
    begin,
    end,
) -> None:
    """Regenerate bl_check.c with given hash entries."""
    bl_check_new = []
    with open(BL_CHECK_C) as f:
        # read up to AUTO-BEGIN
        for line in f:
            bl_check_new.append(line)
            if line == begin:
                break
        # generate new sections
        for digest, comment in hash_entries:
            bl_check_new.append(
                BL_CHECK_PATTERN.format(
                    line1=cstrify(digest[:16]),
                    line2=cstrify(digest[16:]),
                    comment=comment,
                )
            )
        # consume up to AUTO-END
        for line in f:
            if line == end:
                bl_check_new.append(line)
                break
        # add rest of the file contents
        bl_check_new.extend(f)
    BL_CHECK_C.write_text("".join(bl_check_new))