**Describe the bug**
It's possible to rewrite CROSS JOIN TO INNER JOIN in certain conditions, but clickhouse doesn't do that when we have ```AND (cond OR cond)``` in WHERE clause.

**Does it reproduce on recent release?**
Yes

**How to reproduce**
Clickhouse version 21.2

```
EXPLAIN SYNTAX
WITH tbl AS
    (
        SELECT *
        FROM numbers(1000)
    )
SELECT count(x.number)
FROM tbl AS x
, tbl AS z
WHERE x.number = z.number

Query id: ea50c6a4-618d-4f87-a089-01ef2ba956fe

┌─explain──────────────────────────────────────┐
│ WITH tbl AS                                  │
│     (                                        │
│         SELECT *                             │
│         FROM numbers(1000)                   │
│     )                                        │
│ SELECT count(number)                         │
│ FROM tbl AS x                                │
│ ALL INNER JOIN tbl AS z ON number = z.number │
│ WHERE number = z.number                      │
└──────────────────────────────────────────────┘


EXPLAIN SYNTAX
WITH tbl AS
    (
        SELECT *
        FROM numbers(1000)
    )
SELECT count(x.number)
FROM tbl AS x
, tbl AS z
WHERE (x.number = z.number) AND ((x.number = 1) OR (x.number = 2))

Query id: 4f3f6e5a-f7fc-41c0-a2f2-675525e5d63e

┌─explain──────────────────────────────────────────────────────┐
│ WITH tbl AS                                                  │
│     (                                                        │
│         SELECT *                                             │
│         FROM numbers(1000)                                   │
│     )                                                        │
│ SELECT count(number)                                         │
│ FROM tbl AS x                                                │
│ CROSS JOIN tbl AS z                                          │
│ WHERE (number = z.number) AND ((number = 1) OR (number = 2)) │
└──────────────────────────────────────────────────────────────┘


EXPLAIN SYNTAX
WITH tbl AS
    (
        SELECT *
        FROM numbers(1000)
    )
SELECT count(x.number)
FROM tbl AS x
, tbl AS z
WHERE (x.number = z.number) AND 1

Query id: 3ba0c863-8432-441a-b04c-e06047436cbc

┌─explain─────────────────────────┐
│ WITH tbl AS                     │
│     (                           │
│         SELECT *                │
│         FROM numbers(1000)      │
│     )                           │
│ SELECT count(number)            │
│ FROM tbl AS x                   │
│ CROSS JOIN tbl AS z             │
│ WHERE (number = z.number) AND 1 │
└─────────────────────────────────┘

```

M(Milliseconds, insert_quorum_timeout, 600000, "", 0) \
    M(Bool, insert_quorum_parallel, true, "For quorum INSERT queries - enable to make parallel inserts without linearizability", 0) \
    M(UInt64, select_sequential_consistency, 0, "For SELECT queries from the replicated table, throw an exception if the replica does not have a chunk written with the quorum; do not read the parts that have not yet been written with the quorum.", 0) \
    M(UInt64, table_function_remote_max_addresses, 1000, "The maximum number of different shards and the maximum number of replicas of one shard in the `remote` function.", 0) \
    M(Milliseconds, read_backoff_min_latency_ms, 1000, "Setting to reduce the number of threads in case of slow reads. Pay attention only to reads that took at least that much time.", 0) \
    M(UInt64, read_backoff_max_throughput, 1048576, "Settings to reduce the number of threads in case of slow reads. Count events when the read bandwidth is less than that many bytes per second.", 0) \
    M(Milliseconds, read_backoff_min_interval_between_events_ms, 1000, "Settings to reduce the number of threads in case of slow reads. Do not pay attention to the event, if the previous one has passed less than a certain amount of time.", 0) \
    M(UInt64, read_backoff_min_events, 2, "Settings to reduce the number of threads in case of slow reads. The number of events after which the number of threads will be reduced.", 0) \
    \
    M(UInt64, read_backoff_min_concurrency, 1, "Settings to try keeping the minimal number of threads in case of slow reads.", 0) \
    \
    M(Float, memory_tracker_fault_probability, 0., "For testing of `exception safety` - throw an exception every time you allocate memory with the specified probability.", 0) \
    \
    M(Bool, enable_http_compression, 0, "Compress the result if the client over HTTP said that it understands data compressed by gzip or deflate.", 0) \
    M(Int64, http_zlib_compression_level, 3, "Compression level - used if the client on HTTP said that it understands data compressed by gzip or deflate.", 0) \
    \
    M(Bool, http_native_compression_disable_checksumming_on_decompress, 0, "If you uncompress the POST data from the client compressed by the native format, do not check the checksum.", 0) \
    \
    M(String, count_distinct_implementation, "uniqExact", "What aggregate function to use for implementation of count(DISTINCT ...)", 0) \
    \
    M(Bool, add_http_cors_header, false, "Write add http CORS header.", 0) \
    \
    M(UInt64, max_http_get_redirects, 0, "Max number of http GET redirects hops allowed. Make sure additional security measures are in place to prevent a malicious server to redirect your requests to unexpected services.", 0) \
    \
    M(Bool, use_client_time_zone, false, "Use client timezone for interpreting DateTime string values, instead of adopting server timezone.", 0) \
    \
    M(Bool, send_progress_in_http_headers, false, "Send progress notifications using X-ClickHouse-Progress headers. Some clients do not support high amount of HTTP headers (Python requests in particular), so it is disabled by default.", 0) \
    \
    M(UInt64, http_headers_progress_interval_ms, 100, "Do not send HTTP headers X-ClickHouse-Progress more frequently than at each specified interval.", 0) \
    \