     (prn (str (:type edge) " " (hex-format (:src edge)) " -> " (hex-format (:dst edge))))))
 
 
-(defn layout-bbs
-  "
-   Using the given layout, merge the x and y coordinates onto the given basic blocks.
-
-   Params:
-    layout (map): from int basic block address to position map, with keys :x and :y.
-    bbs (sequence): the basic blocks.
-
-
-   Example::
-
-       (let [nodes       (klay/get-nodes result)
-             nodes-by-id (cmn/index-by :id nodes)
-             laid-out    (layout-bbs nodes-by-id basic-blocks)]
-         ...
-
-  "
-  [layout bbs]
-  (for [bb bbs]
-    (let [pos (get layout (:addr bb))]
-      (merge bb {:x (:x pos)
-                 :y (:y pos)}))))
-
-
 (defn layout-cfg-dagre
   [basic-blocks s e]
   (when (< 0 (count (remove nil? basic-blocks)))

          g (klay/make)
          g (reduce klay/add-node g bbs)
          g (reduce klay/add-edge g edges)]
      (cmn/d g)
      (klay/layout g
                   (fn [r]
                     (s {:nodes (cmn/index-by :id (klay/get-nodes r))
                         :edges (klay/get-edges r)}))
                   (fn [err]
                     (e {:msg "klay: error"

            (:basic-blocks args))))


(defmethod action-handler :set-function-layout
  [key model args]
  (let [fva (:function args)
        nodes (:nodes args)
        edges (:edges args)]
    (update-in model [:functions fva] assoc :layout {:nodes (cmn/index-by :id nodes)
                                                     :edges edges})))


