join(): generate the entire transform code unrolling two loops, removing two runtime variables. The merge function is this yet inlined