select  
  subq_0.c7 as c0, 
  subq_0.c7 as c1, 
  subq_0.c7 as c2, 
  subq_0.c7 as c3
from 
  (select  
        ref_3.v58 as c0, 
        ref_1.v6 as c1, 
        ref_5.v55 as c2, 
        (select v107 from test.table97)
           as c3, 
        ref_6.v91 as c4, 
        ref_5.v27 as c5, 
        ref_1.v35 as c6, 
        ref_2.v46 as c7
      from 
        test.table97 as ref_0
          inner join test.table97 as ref_1
            left join test.table97 as ref_2
              inner join test.table97 as ref_3
                  left join test.table97 as ref_4
                  on (ref_3.v8 is NULL)
                left join test.table97 as ref_5
                  left join test.table97 as ref_6
                  on ((((((true) 
                              and (false)) 
                            or (((ref_6.v19 is NULL) 
                                or (((select v127 from test.table97)
                                       is NULL) 
                                  or ((false) 
                                    or ((ref_5.v126 is not NULL) 
                                      or ((EXISTS (
                                          select  
                                              (select v51 from test.table97)
                                                 as c0, 
                                              ref_7.v103 as c1, 
                                              ref_6.v23 as c2
                                            from 
                                              test.table97 as ref_7
                                            where true)) 
                                        or ((ref_5.v8 is NULL) 
                                          or (true))))))) 
                              and (ref_5.v95 is NULL))) 
                          and (false)) 
                        and ((true) 
                          or ((ref_5.v107 is not NULL) 
                            or (true)))) 
                      and (true))
                on ((true) 
                    or ((select v123 from test.table97)
                         is not NULL))
              on (false)
            on (EXISTS (
                select  
                    ref_1.v5 as c0, 
                    ref_5.v29 as c1
                  from 
                    test.table97 as ref_8
                  where ref_8.v16 is NULL))
          on (((EXISTS (
                  select  
                      ref_4.v88 as c0, 
                      ref_2.v86 as c1
                    from 
                      test.table97 as ref_9
                    where true)) 
                or (EXISTS (
                  select  
                      ref_3.v103 as c0, 
                      ref_5.v77 as c1, 
                      ref_4.v35 as c2, 
                      ref_2.v56 as c3
                    from 
                      test.table97 as ref_10
                    where false))) 
              and (true))
      where ((false) 
          or (((((ref_3.v66 is not NULL) 
                  or ((EXISTS (
                      select  
                          ref_1.v112 as c0, 
                          ref_0.v55 as c1, 
                          ref_4.v110 as c2, 
                          ref_5.v25 as c3, 
                          ref_4.v121 as c4
                        from 
                          test.table97 as ref_11
                        where ((false) 
                            and ((ref_4.v44 is NULL) 
                              and (((ref_11.v122 is NULL) 
                                  and (ref_11.v72 is not NULL)) 
                                and (ref_4.v71 is not NULL)))) 
                          or (ref_4.v128 is NULL))) 
                    and (ref_2.v92 is not NULL))) 
                and (EXISTS (
                  select  
                      (select v95 from test.table97)
                         as c0, 
                      ref_4.v47 as c1
                    from 
                      test.table97 as ref_12
                    where (false) 
                      and (ref_1.v96 is not NULL)))) 
              or (ref_4.v75 is NULL)) 
            or ((EXISTS (
                select  
                    (select v80 from test.table97)
                       as c0, 
                    ref_13.v112 as c1, 
                    ref_4.v88 as c2, 
                    ref_5.v115 as c3, 
                    ref_4.v35 as c4, 
                    ref_2.v114 as c5
                  from 
                    test.table97 as ref_13
                  where EXISTS (
                    select  
                        ref_3.v30 as c0, 
                        ref_3.v13 as c1, 
                        ref_13.v57 as c2
                      from 
                        test.table97 as ref_14
                      where true))) 
              or ((ref_1.v43 is NULL) 
                or (ref_0.v107 is not NULL))))) 
        and (EXISTS (
          select  
              ref_6.v109 as c0, 
              ref_5.v78 as c1, 
              ref_15.v48 as c2, 
              ref_0.v1 as c3, 
              ref_5.v125 as c4, 
              ref_4.v94 as c5, 
              ref_2.v109 as c6, 
              42 as c7, 
              ref_5.v117 as c8, 
              ref_5.v33 as c9, 
              ref_5.v99 as c10
            from 
              test.table97 as ref_15
            where EXISTS (
              select  
                  ref_16.v90 as c0, 
                  ref_0.v46 as c1, 
                  (select v43 from test.table97)
                     as c2, 
                  ref_0.v49 as c3
                from 
                  test.table97 as ref_16
                where (((true) 
                      and ((ref_2.v85 is not NULL) 
                        or (ref_15.v133 is NULL))) 
                    or ((((false) 
                          or ((false) 
                            or ((((false) 
                                  and (true)) 
                                or (((true) 
                                    and ((true) 
                                      and (ref_1.v84 is not NULL))) 
                                  and ((false) 
                                    or ((true) 
                                      or (ref_2.v73 is not NULL))))) 
                              and (EXISTS (
                                select  
                                    ref_5.v65 as c0, 
                                    12 as c1, 
                                    ref_16.v100 as c2, 
                                    ref_2.v87 as c3, 
                                    ref_5.v4 as c4, 
                                    ref_17.v40 as c5, 
                                    ref_17.v10 as c6, 
                                    ref_6.v96 as c7, 
                                    ref_16.v74 as c8, 
                                    ref_5.v84 as c9, 
                                    ref_1.v135 as c10, 
                                    ref_2.v47 as c11, 
                                    ref_5.v90 as c12, 
                                    ref_4.v75 as c13, 
                                    ref_5.v24 as c14, 
                                    ref_5.v78 as c15, 
                                    ref_0.v38 as c16
                                  from 
                                    test.table97 as ref_17
                                  where (true) 
                                    or (ref_5.v49 is not NULL)))))) 
                        or (((EXISTS (
                              select  
                                  (select v51 from test.table97)
                                     as c0, 
                                  ref_2.v82 as c1, 
                                  ref_15.v106 as c2, 
                                  ref_18.v35 as c3
                                from 
                                  test.table97 as ref_18
                                where EXISTS (
                                  select  
                                      (select v105 from test.table97)
                                         as c0, 
                                      ref_3.v56 as c1, 
                                      ref_4.v98 as c2, 
                                      ref_4.v46 as c3, 
                                      ref_4.v1 as c4, 
                                      ref_5.v57 as c5, 
                                      ref_16.v118 as c6, 
                                      92 as c7, 
                                      ref_3.v0 as c8, 
                                      ref_1.v130 as c9, 
                                      ref_0.v76 as c10, 
                                      (select v69 from test.table97)
                                         as c11
                                    from 
                                      test.table97 as ref_19
                                    where (((true) 
                                          or ((EXISTS (
                                              select  
                                                  ref_6.v100 as c0, 
                                                  ref_1.v30 as c1, 
                                                  (select v81 from test.table97)
                                                     as c2, 
                                                  ref_18.v43 as c3
                                                from 
                                                  test.table97 as ref_20
                                                where ((EXISTS (
                                                      select  
                                                          ref_4.v12 as c0, 
                                                          ref_0.v24 as c1, 
                                                          ref_3.v105 as c2, 
                                                          ref_15.v128 as c3, 
                                                          ref_2.v21 as c4, 
                                                          ref_19.v105 as c5, 
                                                          ref_15.v59 as c6, 
                                                          ref_1.v76 as c7, 
                                                          ref_15.v67 as c8, 
                                                          100 as c9, 
                                                          ref_1.v32 as c10
                                                        from 
                                                          test.table97 as ref_21
                                                        where ref_4.v62 is NULL)) 
                                                    and ((((true) 
                                                          and ((ref_2.v81 is not NULL) 
                                                            and (false))) 
                                                        and (true)) 
                                                      and (true))) 
                                                  and (false))) 
                                            and (ref_16.v74 is NULL))) 
                                        or ((true) 
                                          and (false))) 
                                      and (false)))) 
                            and (EXISTS (
                              select  
                                  ref_0.v45 as c0, 
                                  ref_15.v119 as c1, 
                                  ref_4.v52 as c2, 
                                  ref_4.v20 as c3
                                from 
                                  test.table97 as ref_22
                                where EXISTS (
                                  select  
                                      ref_6.v113 as c0, 
                                      ref_2.v12 as c1, 
                                      ref_0.v84 as c2, 
                                      ref_23.v112 as c3, 
                                      ref_4.v66 as c4, 
                                      ref_0.v102 as c5, 
                                      ref_4.v56 as c6, 
                                      (select v103 from test.table97)
                                         as c7, 
                                      ref_16.v27 as c8, 
                                      ref_1.v137 as c9, 
                                      ref_2.v105 as c10, 
                                      ref_6.v31 as c11, 
                                      (select v3 from test.table97)
                                         as c12, 
                                      ref_16.v112 as c13, 
                                      ref_6.v14 as c14, 
                                      ref_6.v61 as c15, 
                                      ref_2.v28 as c16
                                    from 
                                      test.table97 as ref_23
                                    where false)))) 
                          or ((EXISTS (
                              select  
                                  ref_6.v14 as c0, 
                                  ref_16.v62 as c1, 
                                  2 as c2, 
                                  ref_6.v35 as c3
                                from 
                                  test.table97 as ref_24
                                where ref_15.v27 is not NULL)) 
                            or (true)))) 
                      and (true))) 
                  and (true))))) as subq_0
where (EXISTS (
    select  
        ref_25.v58 as c0, 
        subq_0.c0 as c1, 
        ref_25.v46 as c2, 
        ref_25.v22 as c3, 
        ref_25.v13 as c4, 
        ref_25.v90 as c5, 
        subq_0.c4 as c6
      from 
        test.table97 as ref_25
      where (EXISTS (
          select  
              subq_0.c0 as c0
            from 
              test.table97 as ref_26
            where ref_26.v34 is not NULL)) 
        or ((ref_25.v88 is not NULL) 
          or (true)))) 
  and (true);