Return a list of IR blocks as a copy of the original, with EndOptional blocks removed.

def remove_end_optionals(ir_blocks):
    """Return a list of IR blocks as a copy of the original, with EndOptional blocks removed."""
    new_ir_blocks = []
    for block in ir_blocks:
        if not isinstance(block, EndOptional):
            new_ir_blocks.append(block)
    return new_ir_blocks