def METHOD_NAME(partition_table_offset, bootloader_offset, binary_file):  # type: (int, int, IO) -> None
    max_size = partition_table_offset - bootloader_offset
    bootloader_size = _file_size(binary_file)
    if bootloader_size > max_size:
        msg = ('Bootloader binary size {:#x} bytes is too large for partition table offset {:#02x}. ' +
               'Bootloader binary can be maximum {:#x} ({}) bytes unless the partition table offset ' +
               'is increased in the Partition Table section of the project configuration menu.').format(
                   bootloader_size, partition_table_offset, max_size, max_size)
        _fail(msg)
    free_size = max_size - bootloader_size
    print('Bootloader binary size {:#x} bytes. {:#x} bytes ({}%) free.'.format(
          bootloader_size, free_size, round(free_size * 100 / max_size)))