\begin{picture}(512,500)(23,9)
  \gasset{Nadjust=n}
  \node[Nadjust=w](block1)(463,425){$\mathtt{zero\_mod\_3}$}
  \node[Nadjust=w](block2)(449,323){$\mathtt{one\_mod\_3}$}
  \node[Nadjust=w](block3)(350,122){$\mathtt{even}$}
  \node[Nadjust=w](block4)(287,263){$\mathtt{tree\_3n\_plus\_2}$}
  \node[Nadjust=wh](block5)(238,190){${\scriptstyle\wedge}$}
  \node[Nadjust=w](block6)(457,127){$\mathtt{odd}$}
  \node[Nadjust=wh](block7)(243,38){$\scriptstyle a$}
  \node[Nadjust=w](block8)(458,230){$\mathtt{two\_mod\_3}$}
  \node[Nadjust=n](block9)(118,78){$\mathtt{q}$}
  \node[Nadjust=n](block10)(312,19){$\mathtt{r}$}
  \node[Nadjust=wh](block11)(391,164){${\scriptstyle\wedge}$}
  \node[Nadjust=w](block12)(189,221){$\mathtt{list\_even}$}
  \node[Nadjust=wh](block13)(285,171){${\scriptstyle\wedge}$}
  \gasset{Nadjust=n,Nw=1,Nh=20,Nmr=0,fillgray=0} % black rectangle
  \gasset{ExtNL=y,NLdist=3,NLangle=45} % external label right and above the node
  \node(trans16)(395,41){$\mathtt{s}$}
  \node(trans1)(117,272){$\mathtt{nil}$}
  \node(trans6)(33,70){$\mathtt{nil}$}
  \node(trans10)(223,316){$\mathtt{nil}$}
  \gasset{Nadjust=n,Nw=20,Nh=1,Nmr=0,fillgray=0} % black rectangle
  \gasset{ExtNL=y,NLdist=3,NLangle=135} % external label right and above the node
  \node(trans14)(509,320){$\mathtt{s}$}
  \node(trans2)(280,202){$\mathtt{cons}$}
  \gasset{Nadjust=n,Nw=1,Nh=20,Nmr=0,fillgray=0} % black rectangle
  \gasset{ExtNL=y,NLdist=3,NLangle=225} % external label right and above the node
  \node(trans11)(265,345){$\mathtt{cons}$}
  \node(trans3)(405,69){$\mathtt{o}$}
  \node(trans7)(193,130){$\mathtt{cons}$}
  \node(trans9)(368,309){$\mathtt{s}$}
  \node(trans4)(450,79){$\mathtt{s}$}
  \gasset{Nadjust=n,Nw=20,Nh=1,Nmr=0,fillgray=0} % black rectangle
  \gasset{ExtNL=y,NLdist=3,NLangle=315} % external label right and above the node
  \node(trans13)(447,499){$\mathtt{o}$}
  \node(trans15)(315,114){}
  \node(trans5)(287,128){}
  \node(trans12)(525,253){$\mathtt{s}$}
  \node(trans8)(478,389){$\mathtt{s}$}
  \gasset{ELpos=85,ELdistC=y,ELdist=0} % put (argument number) labels on the edge, toward the end
  \drawqbedge[eyo=5](block4,345,345,trans11){\tiny 1}
  \drawqbedge[eyo=-5](block4,305,345,trans11){\tiny 2}
  \drawqbedge(trans11,205,345,block4){}
  \drawqbedge(trans3,345,69,block3){}
  \drawqbedge[eyo=5](block13,273,130,trans7){\tiny 1}
  \drawedge(block3,block13){}
  \drawedge(block4,block13){}
  \drawqbedge[eyo=-5](block5,233,130,trans7){\tiny 2}
  \drawedge(block12,block5){}
  \drawedge(block4,block5){}
  \drawqbedge(trans7,133,130,block9){}
  \drawqbedge[eyo=0](block3,335,41,trans16){}
  \drawqbedge(trans16,455,41,block6){}
  \drawqbedge(trans1,177,272,block12){}
  \drawqbedge[eyo=0](block2,428,309,trans9){}
  \drawqbedge(trans9,308,309,block4){}
  \drawqbedge[exo=0](block8,509,260,trans14){}
  \drawqbedge(trans14,509,380,block1){}
  \drawqbedge(trans13,447,439,block1){}
  \drawqbedge[exo=-5](block11,315,154,trans15){\tiny 1}
  \drawedge(block8,block11){}
  \drawedge(block6,block11){}
  \drawqbedge[exo=5](block5,315,194,trans15){\tiny 2}
  \drawedge(block12,block5){}
  \drawedge(block4,block5){}
  \drawqbedge(trans15,315,54,block10){}
  \drawqbedge[exo=-5](block5,287,168,trans5){\tiny 1}
  \drawedge(block12,block5){}
  \drawedge(block4,block5){}
  \drawqbedge[exo=5](block11,287,208,trans5){\tiny 2}
  \drawedge(block8,block11){}
  \drawedge(block6,block11){}
  \drawqbedge(trans5,287,68,block7){}
  \drawqbedge(trans6,93,70,block9){}
  \drawqbedge[exo=5](block3,280,162,trans2){\tiny 1}
  \drawqbedge[exo=-5](block12,280,122,trans2){\tiny 2}
  \drawqbedge(trans2,280,262,block12){}
  \drawqbedge(trans10,283,316,block4){}
  \drawqbedge[exo=0](block2,525,313,trans12){}
  \drawqbedge(trans12,525,193,block8){}
  \drawqbedge[eyo=0](block6,510,79,trans4){}
  \drawqbedge(trans4,390,79,block3){}
  \drawqbedge[exo=0](block1,478,449,trans8){}
  \drawqbedge(trans8,478,329,block2){}
\end{picture}
