+prepare_for_splicing' ::
+ Graph m l -> (ZTail m l -> a) -> (ZTail m l -> ZHead m -> BlockEnv (Block m l) -> a)
+ -> a
+prepare_for_splicing' (Graph etail gblocks) single multi =
+ if isNullUFM gblocks then
+ case lastTail etail of
+ LastExit -> single etail
+ _ -> panic "bad single block"
+ else
+ case splitp_blocks is_exit gblocks of
+ Nothing -> panic "Can't find an exit block"
+ Just (gexit, gblocks) ->
+ let (gh, gl) = goto_end $ unzip gexit in
+ case gl of LastExit -> multi etail gh gblocks
+ _ -> panic "exit is not exit?!"
+