select * from
  (select sample_1.f1 as c0
      from int4_tbl as sample_1) as subq_0,
  lateral (select  1
      from
 (select
  subq_0.c0 as c3,
  subq_5.c0 as c7,
  sample_2.q2 as c9
       from
  int8_tbl as sample_2,
  lateral (select
        subq_3.c1 as c0
      from
        int4_tbl as sample_3,
        lateral (select
       sample_2.q1 as c0,
       sample_3.f1 as c1
     from
       public.rtest_interface as ref_0
     ) as subq_1,
        lateral (select
       subq_1.c1 as c1
     from
       int4_tbl as ref_1
     ) as subq_3
      ) as subq_5) as subq_6
   right join int4_tbl as sample_6
   on (true)
      where subq_6.c7 = subq_6.c3) as subq_7;
