select  
  subq_0.c1 as c0, 
  coalesce(subq_0.c0,
    subq_0.c0) as c1
from 
  (select  
        ref_0.v6 as c0, 
        ref_0.v4 as c1
      from 
        test.table1 as ref_0
      where EXISTS (
        select  
            ref_0.v4 as c0, 
            ref_0.v6 as c1, 
            ref_0.v4 as c2, 
            ref_1.v5 as c3
          from 
            test.table1 as ref_1
          where (ref_1.v1 is NULL) 
            or (ref_1.v6 is NULL))) as subq_0
where EXISTS (
  select  
      subq_0.c0 as c0, 
      subq_0.c0 as c1, 
      subq_0.c1 as c2, 
      ref_2.v1 as c3, 
      subq_0.c0 as c4, 
      subq_0.c1 as c5, 
      subq_0.c0 as c6, 
      subq_0.c0 as c7, 
      subq_0.c1 as c8
    from 
      test.table1 as ref_2
    where (EXISTS (
        select  
            ref_4.v5 as c0, 
            ref_10.v2 as c1, 
            (select v2 from test.table1)
               as c2, 
            ref_4.v4 as c3, 
            ref_4.v3 as c4
          from 
            test.table1 as ref_3
                right join test.table1 as ref_4
                on ((EXISTS (
                      select  
                          ref_4.v0 as c0, 
                          ref_3.v1 as c1
                        from 
                          test.table1 as ref_5
                        where (EXISTS (
                            select  
                                ref_5.v6 as c0, 
                                ref_4.v1 as c1
                              from 
                                test.table1 as ref_6
                              where (ref_5.v0 is not NULL) 
                                and ((EXISTS (
                                    select  
                                        ref_2.v4 as c0, 
                                        ref_5.v1 as c1, 
                                        ref_2.v2 as c2, 
                                        subq_0.c1 as c3, 
                                        ref_7.v6 as c4, 
                                        ref_2.v0 as c5, 
                                        ref_7.v2 as c6, 
                                        ref_2.v4 as c7, 
                                        ref_3.v5 as c8, 
                                        ref_2.v3 as c9
                                      from 
                                        test.table1 as ref_7
                                      where true)) 
                                  or (EXISTS (
                                    select distinct 
                                        ref_2.v2 as c0
                                      from 
                                        test.table1 as ref_8
                                      where ref_5.v5 is NULL))))) 
                          and (true))) 
                    or (((((((false) 
                                and (ref_3.v6 is NULL)) 
                              or (true)) 
                            or (((true) 
                                or ((true) 
                                  or (ref_4.v2 is NULL))) 
                              or ((EXISTS (
                                  select  
                                      (select v2 from test.table1)
                                         as c0, 
                                      ref_9.v0 as c1, 
                                      ref_9.v5 as c2, 
                                      ref_4.v1 as c3, 
                                      91 as c4, 
                                      ref_3.v1 as c5, 
                                      (select v3 from test.table1)
                                         as c6, 
                                      subq_0.c1 as c7, 
                                      ref_3.v4 as c8, 
                                      ref_4.v2 as c9, 
                                      ref_2.v1 as c10, 
                                      ref_3.v1 as c11, 
                                      (select v6 from test.table1)
                                         as c12, 
                                      subq_0.c0 as c13, 
                                      subq_0.c0 as c14, 
                                      ref_3.v5 as c15
                                    from 
                                      test.table1 as ref_9
                                    where true)) 
                                or ((select v2 from test.table1)
                                     is NULL)))) 
                          and (false)) 
                        or ((false) 
                          or (true))) 
                      and (false)))
              inner join test.table1 as ref_10
              on (((EXISTS (
                      select  
                          ref_4.v1 as c0, 
                          subq_0.c1 as c1, 
                          ref_4.v6 as c2, 
                          ref_11.v3 as c3, 
                          (select v2 from test.table1)
                             as c4, 
                          ref_11.v2 as c5, 
                          18 as c6, 
                          ref_4.v3 as c7, 
                          (select v0 from test.table1)
                             as c8, 
                          ref_2.v6 as c9, 
                          subq_0.c0 as c10, 
                          ref_11.v3 as c11, 
                          subq_0.c0 as c12, 
                          ref_3.v1 as c13, 
                          subq_0.c0 as c14, 
                          ref_3.v0 as c15, 
                          ref_2.v1 as c16
                        from 
                          test.table1 as ref_11
                        where (EXISTS (
                            select  
                                ref_10.v0 as c0
                              from 
                                test.table1 as ref_12
                              where (53 is NULL) 
                                or ((true) 
                                  or (false)))) 
                          or (false))) 
                    or (ref_2.v1 is not NULL)) 
                  and (ref_10.v3 is NULL))
          where (((true) 
                and (subq_0.c1 is NULL)) 
              or (EXISTS (
                select  
                    ref_13.v0 as c0, 
                    ref_10.v4 as c1, 
                    ref_2.v3 as c2, 
                    subq_0.c0 as c3, 
                    ref_2.v1 as c4, 
                    ref_10.v5 as c5, 
                    ref_10.v1 as c6
                  from 
                    test.table1 as ref_13
                  where ref_4.v0 is not NULL))) 
            or (false))) 
      or (EXISTS (
        select  
            ref_2.v2 as c0, 
            ref_14.v3 as c1, 
            subq_0.c0 as c2
          from 
            test.table1 as ref_14
          where ((subq_0.c1 is NULL) 
              or (true)) 
            or (((false) 
                or (((subq_0.c1 is not NULL) 
                    and (((subq_0.c1 is not NULL) 
                        and (true)) 
                      and (EXISTS (
                        select  
                            ref_15.v6 as c0, 
                            subq_0.c0 as c1, 
                            ref_14.v5 as c2, 
                            ref_2.v1 as c3, 
                            ref_2.v5 as c4, 
                            ref_2.v1 as c5, 
                            subq_0.c1 as c6
                          from 
                            test.table1 as ref_15
                          where ref_2.v6 is NULL)))) 
                  or (true))) 
              or ((true) 
                and (ref_14.v4 is NULL))))));