 SYMBOL: current-word
 SYMBOL: current-label
 SYMBOL: loops
+SYMBOL: first-basic-block
 
 ! Basic block after prologue, makes recursion faster
 SYMBOL: current-label-start

    ##prologue
    ##branch
    begin-basic-block
    current-label get remember-loop ;

: (build-cfg) ( nodes word label -- )
    [

: emit-call ( word -- next )
    finalize-phantoms
    {
        { [ dup loops get key? ] [ loops get at local-recursive-call ] }
        { [ tail-call? not ] [ ##simple-stack-frame ##call iterate-next ] }
        { [ dup current-label get eq? ] [ drop first-basic-block get local-recursive-call ] }
        [ ##epilogue ##jump stop-iterating ]
    } cond ;

