def _TMP_admissible_plane_tree_iterator(a, verbose=False):
    """
    Iterator through plane trees with at most nmax vertices.

    INPUT:

    - ``a`` - the angle at the vertices divided by pi.

    OUTPUT:

    - ``(t,n,l)`` - ``t`` is a tree, ``n`` its number of nodes and ``l`` its
      number of leaves.

    ALGORITHM:

    variables in the algorithm

    t : the current tree
    b : the current branch explored in the tree of trees
    n : number of nodes of t except the root
    l : number of leaves of t

    the tree is valid if 2n >= a and 2n-l <= a
    """
    t = [0]
    b = []
    n = 0
    l = 1
    while True:
        if verbose:
            print(t)
            print('n = %2d,   l = %2d' % (n, l))
        if 2 * n >= a and 2 * n - l <= a:
            if verbose:
                print('yield')
            t.append(0)
            yield t, n, l
            t.pop(-1)
        if n <= a and 2 * n - l < a:
            if verbose:
                print('go down')
                print('  append: %d' % (t[-1] + 1))
            t.append(t[-1] + 1)
            b.append(t[-1])
            n += 1
        else:
            if verbose:
                print('go up')
            while b and b[-1] == 1:
                if verbose:
                    print(' pop')
                b.pop(-1)
                t.pop(-1)
                n -= 1
                l -= 1
            if b == []:
                break
            if verbose:
                print(' modify last')
            if len(t) > 1 and t[-2] == t[-1] - 1:
                l += 1
            b[-1] -= 1
            t[-1] = b[-1]
        if verbose:
            print()
