def de9im_match(pattern: str, target_pattern: str) -> bool:
    """
    Check a DE-9IM pattern `pattern` against a target DE-9IM pattern.

    Note:
        To enable maximal speed, patterns are not parsed for correctness. For
        correct patterns consult https://en.wikipedia.org/wiki/DE-9IM.

    Args:
        pattern (str): DE-9IM pattern to check as string
        target_pattern (str): DE-9IM pattern against which to check as string

    Returns:
        bool: True, iff pattern matches with target_pattern
    """
    for char, target_char in zip(pattern, target_pattern):
        if target_char == "*":
            continue
        elif target_char == "T" and char in "012":
            continue
        elif char == target_char:
            continue
        else:
            return False
    return True