\begin{algorithm}
\caption{Build-CFG}
\begin{algorithmic}
\INPUT a set $B$ of $k$ basic blocks.
\OUTPUT all edges in CFG derived from $B$.
\FORALL{basic block $b$ \textbf{in} $B$ }
\IF{$b.last.type =$ JUMP}
\STATE $targetStmt = b.last.target$ \COMMENT{ 跳转语句的目标语句 }
\STATE Let $targetBlock$ be the basic block containing $targetStmt$.
\STATE \textbf{output} $b\to targetBlock$
\ENDIF
\IF{$b.last.type \ne$ UCONDITIONAL-JUMP }
\STATE $nextStmt = b.last.next$
\STATE Let $nextBlock$ be the basic block containing $nextStmt$.
\STATE \textbf{output} $b\to nextBlock$
\ENDIF
\ENDFOR
\end{algorithmic}
\end{algorithm}