def subtract_offset(sequence, offset):
    """Subtracts an offset from the sequence number while considering wraparound"""
    new_sequence = sequence - offset
    if new_sequence < 0:
        new_sequence += 0x100000000
    return new_sequence