def METHOD_NAME(footer_offset: int, file: File) -> int:
    file.seek(footer_offset - BACKWARD_SIZE_LEN, io.SEEK_SET)
    backward_bytes = file.read(BACKWARD_SIZE_LEN)
    stored_backward_size = convert_int32(backward_bytes, Endian.LITTLE)
    real_backward_size = (stored_backward_size + 1) * 4
    if real_backward_size > footer_offset - CRC32_LEN - BACKWARD_SIZE_LEN:
        raise InvalidInputFormat("Invalid backward size.")
    # skip backwards to the end of the Index
    file.seek(-CRC32_LEN - BACKWARD_SIZE_LEN, io.SEEK_CUR)
    # skip backwards of backward size to the start of index
    file.seek(-real_backward_size, io.SEEK_CUR)
    index_size = 0
    index_indicator = convert_int8(file.read(1), Endian.LITTLE)
    # index indicator must be 0, per xz standard
    if index_indicator != 0:
        raise InvalidInputFormat("Invalid index indicator")
    index_size += 1
    # read Index 'Number of Records'
    size, num_records = read_multibyte_int(file)
    index_size += size
    # read Record 'Unpadded Size' and 'Uncompressed Size' for every Record
    blocks_size = 0
    for _ in range(0, num_records):
        size, unpadded_size = read_multibyte_int(file)
        index_size += size
        size, _ = read_multibyte_int(file)
        index_size += size
        blocks_size += round_up(unpadded_size, XZ_PADDING)
    index_size += CRC32_LEN
    return round_up(
        (STREAM_HEADER_LEN + blocks_size + index_size + STREAM_FOOTER_LEN),
        XZ_PADDING,
    )