import struct


def unpack_extent_record(record):
    """Extract up to three (first_block, block_count) tuples from a 12-byte extent record"""
    a, b, c, d, e, f = struct.unpack('>6H', record)
    l = []
    if b: l.append((a, b))
    if d: l.append((c, d))
    if f: l.append((e, f))
    return l