\newcounter{xCord}
\newcounter{yCord}
\newcommand{\UStaticConsCell}[3]{%
        \put(#1, #2){\dashbox(40, 20){}}%
        \setcounter{xCord}{#1}%
        \addtocounter{xCord}{20}%
        \put(\value{xCord}, #2){\line(0, 1){20}}%
        \addtocounter{xCord}{10}%
        \setcounter{yCord}{#2}%
        \addtocounter{yCord}{10}%
        \put(\value{xCord}, \value{yCord}){\circle*{3}}%
        %\put(#3, #4){\makebox(0, 0){#5}}%
        \addtocounter{yCord}{-15}%
        \put(#1, \value{yCord}){{#3}}}
\newcommand{\StaticConsCell}[3]{%
        \put(#1, #2){\framebox(40, 20){}}%
        \setcounter{xCord}{#1}%
        \addtocounter{xCord}{20}%
        \put(\value{xCord}, #2){\line(0, 1){20}}%
        \addtocounter{xCord}{10}%
        \setcounter{yCord}{#2}%
        \addtocounter{yCord}{10}%
        \put(\value{xCord}, \value{yCord}){\circle*{3}}%
        %\put(#3, #4){\makebox(0, 0){#5}}%
        \addtocounter{yCord}{-15}%
        \put(#1, \value{yCord}){{#3}}}
\newcommand{\LogicConsCell}[4]{%
        \put(#1, #2){\framebox(40, 20){}}%
        \setcounter{xCord}{#1}%
        \addtocounter{xCord}{20}%
        \put(\value{xCord}, #2){\line(0, 1){20}}%
        \addtocounter{xCord}{10}%
        \setcounter{yCord}{#2}%
        \addtocounter{yCord}{10}%
        \put(\value{xCord}, \value{yCord}){\circle*{3}}% 
        \addtocounter{xCord}{-50}%
        \put(\value{xCord}, \value{yCord}){#3}%
        \addtocounter{xCord}{50}%
        \addtocounter{yCord}{-20}
        \put(#1, \value{yCord}){{#4}}}
\newcommand{\ConsCell}[3]{%
        \put(#1, #2){\framebox(20, 20){}}%
        \setcounter{xCord}{#1}%
        \addtocounter{xCord}{10}%
        \put(\value{xCord}, #2){\line(0, 1){20}}%
        \addtocounter{xCord}{5}%
        \setcounter{yCord}{#2}%
        \addtocounter{yCord}{10}%
        \put(\value{xCord}, \value{yCord}){\circle*{3}}%
        %\put(#3, #4){\makebox(0, 0){#5}}%
        \addtocounter{yCord}{-18}%
        \put(#1, \value{yCord}){{#3}}}
\newcommand{\TwoWayConsCell}[3]{%
        \put(#1, #2){\framebox(20, 20){}}%
        \setcounter{xCord}{#1}%
        \addtocounter{xCord}{10}%
        \put(\value{xCord}, #2){\line(0, 1){20}}%
        \addtocounter{xCord}{5}%
        \setcounter{yCord}{#2}%
        \addtocounter{yCord}{7}%
        \put(\value{xCord}, \value{yCord}){\circle*{3}}%
        \addtocounter{xCord}{-10}%
        \addtocounter{yCord}{6}%
        \put(\value{xCord}, \value{yCord}){\circle*{3}}%
        %\put(#3, #4){\makebox(0, 0){#5}}%
        \addtocounter{yCord}{-21}%
        \put(#1, \value{yCord}){{#3}}}
%different kinds of cells in heap and store
\newcommand{\heapcell}[3]{\put(#1, #2){\circle{20}}%
    \put(#1, #2){\makebox(0, 0){$_{#3}$}}}
%%% This macro need to be fixed to dotted circle!!. 
\newcommand{\USheapcell}[3]{\put(#1, #2){\circle{25}}%
     \setcounter{xCord}{#1}
     \setcounter{yCord}{#2}
     \addtocounter{yCord}{10}
    \put(\value{xCord},\value{yCord}){\makebox(0, 0){$_{sm}$}}%
    \put(#1, #2){\circle{18}}%
    \put(#1, #2){\makebox(0, 0){$_{#3}$}}}
\newcommand{\Sheapcell}[3]{\put(#1, #2){\circle{25}}%
    \put(#1, #2){\circle{20}}%
    \put(#1, #2){\makebox(0, 0){$_{#3}$}}}
\newcommand{\USSheapcell}[3]{\put(#1, #2){\circle{35}}%
    \put(#1, #2){\circle{15}}%
     \setcounter{xCord}{#1}
     \setcounter{yCord}{#2}
     \addtocounter{yCord}{10}
    \put(\value{xCord},\value{yCord}){\makebox(0, 0){$_{sm}$}}%
     \addtocounter{yCord}{6}
    \put(\value{xCord},\value{yCord}){\makebox(0, 0){$_{is}$}}%
   \put(#1, #2){\circle{25}}%
    \put(#1, #2){\makebox(0, 0){$_{#3}$}}}
\newcommand{\variable}[3]{\put(#1,#2){\makebox(0,0){$_{#3}$}}}

%different kinds of simple edges: 
\newcommand{\leftedge}[2]{\put(#1,#2){\makebox(0,0){\vector(-1,0){20}}}}
\newcommand{\rightedge}[2]{\put(#1,#2){\makebox(0,10){\vector(1,0){20}}}}
\newcommand{\longrightedge}[2]{\put(#1,#2){\makebox(0,10){\vector(1,0){30}}}}
\newcommand{\longleftedge}[2]{\put(#1,#2){\makebox(0,0){\vector(-1,0){30}}}}
\newcommand{\upedge}[2]{\put(#1,#2){\makebox(0,0){\vector(0,1){30}}}}
\newcommand{\downedge}[2]{\put(#1,#2){\makebox(0,-3){\vector(0,-1){20}}}}
%Named Selector Edges
\newcommand{\rightseledge}[3]{\put(#1,#2){\makebox(0,10){\vector(1,0){20}}}
                \setcounter{xCord}{#1}
                \addtocounter{xCord}{-5}
                \setcounter{yCord}{#2}
                \addtocounter{yCord}{5}
                \put(\value{xCord}, \value{yCord}){{#3}}}
\newcommand{\longrightseledge}[3]{\put(#1,#2){\makebox(0,10){\vector(1,0){30}}}
                \setcounter{xCord}{#1}
                \addtocounter{xCord}{0}
                \setcounter{yCord}{#2}
                \addtocounter{yCord}{5}
                \put(\value{xCord}, \value{yCord}){{#3}}}
\newcommand{\upseledge}[3]{\put(#1,#2){\makebox(0,0){\vector(0,1){30}}}
                \setcounter{yCord}{#2}
                \addtocounter{yCord}{15}
                \put(#1, \value{yCord}){\makebox(0, 0){#3}}}
\newcommand{\downseledge}[3]{\put(#1,#2){\makebox(0,0){\vector(0,-1){20}}}
                \setcounter{xCord}{#1}
                \addtocounter{xCord}{-10}
                \setcounter{yCord}{#2}
                \put(\value{xCord}, \value{yCord}){{#3}}}

%different kinds of crossedges:
\newcommand{\downcrossedge}[2]{\put(#1,#2){\qbezier(-10,0)(15,-10)(15,-35)
            \put(15,-32){\vector(0,-1){3}}}}
\newcommand{\upcrossedge}[2]{\put(#1,#2){\qbezier(-10,0)(15,10)(15,32)
            \put(15,32){\vector(0,1){3}}}}
\newcommand{\longdowncrossedge}[2]{\put(#1,#2){\qbezier(-10,0)(45,0)(54,-14)
            \put(52,-11){\vector(1,-1){3}}}}
\newcommand{\longupcrossedge}[2]{\put(#1,#2){\qbezier(-10,0)(45,0)(54,14)
            \put(52,11){\vector(1,1){3}}}}
\newcommand{\longcrossedge}[2]{\put(#1,#2){\qbezier(-10,0)(45,-10)(55,-35)
            \put(53,-30){\vector(1,-2){3}}}}

%selfedges
\newcommand{\selfedge}[2]{\put(#1,#2){\makebox(0,-40)
           {\qbezier(0,0)(-7,-20)(3,-20)
            \qbezier(3,-20)(13,-20)(6,0)\put(8,-5){\vector(-1,2){3}}}}}
\newcommand{\altselfedge}[2]{\put(#1,#2){\makebox(0,30)
           {\qbezier(0,0)(-7,20)(3,20)
            \qbezier(3,20)(13,20)(6,0)\put(8,5){\vector(-1,-2){3}}}}}

%dotted edges 
\newcommand{\dotrightedge}[2]{\put(#1,#2){\makebox(15,10)
           {\qbezier[20](10,0)(20,0)(30,0)\put(27,0){\vector(1,0){3}}}}}
\newcommand{\dotleftedge}[2]{\put(#1,#2){\makebox(0,0)
           {\qbezier[20](-10,0)(-20,0)(-30,0)\put(-27,0){\vector(-1,0){3}}}}}
\newcommand{\dotdownedge}[2]{\put(#1,#2){\makebox(0,-50)
           {\qbezier[20](0,0)(0,10)(0,27)\vector(0,-1){3}}}}
\newcommand{\dotdowncrossedge}[2]{\put(#1,#2)
           {\qbezier[20](-10,0)(15,-10)(15,-35)
            \put(15,-32){\vector(0,-1){3}}}}
\newcommand{\dotupcrossedge}[2]{\put(#1,#2){\qbezier[20](-25,5)(-15,30)(10,37)
            \put(6,35){\vector(2,1){3}}}}
\newcommand{\dotupcrossdownedge}[2]{\put(#1,#2){\qbezier[20](-25,5)(85,5)(120,-5)
            \put(6,35){\vector(1,-1){3}}}}
\newcommand{\dotselfedge}[2]{\put(#1,#2){\makebox(0,-40)
           {\qbezier[20](0,0)(-7,-20)(3,-20)
            \qbezier[20](3,-20)(13,-20)(6,0)\put(8,-5){\vector(-1,2){3}}}}}
\newcommand{\xyShapeGraph[2]}{
     \framebox{
     \begin{tabular}{ll}  
            \xymatrix{#1} &% \mbox{#2}
     \end{tabular}}}
%%% Nodes
\newcommand{\xySharedSummaryNode}[1]{*++[o][F=]{is(#1)}}
\newcommand{\xySummaryNode}[1]{*++[o][F=]{#1}}
\newcommand{\xySummaryNodeLarge}[1]{*+++[o][F=]{#1}}
\newcommand{\xyNonSummaryNode}[1]{*++[o][F]{#1}}
\newcommand{\xySharedNonSummaryNode}[1]{*++[o][F]{is(#1)}}
%%% Unlabled Edges
\newcommand{\xyEdge}{\ar[r]}
\newcommand{\xyRightEdge}{\ar[r]}
\newcommand{\xyLeftEdge}{\ar[l]}
\newcommand{\xyDownEdge}{\ar[d]}
\newcommand{\xyUpEdge}{\ar[u]}
\newcommand{\xySelfEdge}{\ar@(ur, ul)[]|{}}
\newcommand{\xyDottedEdge}{\ar@{.>}[r]}
\newcommand{\xyDottedRightEdge}{\ar@{.>}[r]}
\newcommand{\xyDottedLeftEdge}{\ar@{.>}[l]}
\newcommand{\xyDottedDownEdge}{\ar@{.>}[d]}
\newcommand{\xyDottedUpEdge}{\ar@{.>}[u]}
\newcommand{\xyDottedSelfEdge}{\ar@{.>}@(ur, ul)[]|{}}
%% Labeled Edges
\newcommand{\xyLabeledEdge}[1]{\ar@[r]^{#1}}
\newcommand{\xyLabeledRightEdge}[1]{\ar@[r]^{#1}}
\newcommand{\xyLabeledLeftEdge}[1]{\ar@[l]^{#1}}
\newcommand{\xyLabeledDownEdge}[1]{\ar@[d]_{#1}}
\newcommand{\xyLabeledUpEdge}[1]{\ar@[u]_{#1}}
\newcommand{\xyDottedLabeledEdge}[1]{\ar@{.>}[r]^{#1}}
\newcommand{\xyDottedLabeledRightEdge}[1]{\ar@{.>}[r]^{#1}}
\newcommand{\xyDottedLabeledLeftEdge}[1]{\ar@{.>}[l]^{#1}}
\newcommand{\xyDottedLabeledDownEdge}[1]{\ar@{.>}[d]_{#1}}
\newcommand{\xyDottedLabeledUpEdge}[1]{\ar@{.>}[u]_{#1}}
\newcommand{\xyLabeledSelfEdge}[1]{\ar@(ur, ul)[]|{#1}}
\newcommand{\xyDottedLabeledSelfEdge}[1]{\ar@{.>}@(ur, ul)[]|{#1}}
