sec_asn1d_init_state_based_on_template(child);
sec_asn1d_next_in_group (sec_asn1d_state *state){    sec_asn1d_state *child;    unsigned long child_consumed;    PORT_Assert (state->place == duringGroup);    PORT_Assert (state->child != NULL);    child = state->child;    child_consumed = child->consumed;    child->consumed = 0;    state->consumed += child_consumed;    /*     * If our child was just our end-of-contents octets, we are done.     */    if (child->endofcontents) {	/* XXX I removed the PORT_Assert (child->dest == NULL) because there	 * was a bug in that a template that was a sequence of which also had	 * a child of a sequence of, in an indefinite group was not working 	 * properly.  This fix seems to work, (added the if statement below),	 * and nothing appears broken, but I am putting this note here just	 * in case. */	/*	 * XXX No matter how many times I read that comment,	 * I cannot figure out what case he was fixing.  I believe what he	 * did was deliberate, so I am loathe to touch it.  I need to	 * understand how it could ever be that child->dest != NULL but	 * child->endofcontents is true, and why it is important to check	 * that state->subitems_head is NULL.  This really needs to be	 * figured out, as I am not sure if the following code should be	 * compensating for "offset", as is done a little farther below	 * in the more normal case.	 */	PORT_Assert (state->indefinite);	PORT_Assert (state->pending == 0);	if(child->dest && !state->subitems_head) {	    sec_asn1d_add_to_subitems (state, child->dest, 0, PR_FALSE);	    child->dest = NULL;	}	child->place = notInUse;	state->place = afterGroup;	return;    }    /*      * Do the "after" field notification for next in group.     */    sec_asn1d_notify_after (state->top, child->dest, child->depth);    /*     * Save it away (unless we are not storing).     */    if (child->dest != NULL) {	void *dest;	dest = child->dest;	dest = (char *)dest - child->theTemplate->offset;	sec_asn1d_add_to_subitems (state, dest, 0, PR_FALSE);	child->dest = NULL;    }    /*     * Account for those bytes; see if we are done.     */    if (state->pending) {	PORT_Assert (!state->indefinite);	PORT_Assert (child_consumed <= state->pending);	state->pending -= child_consumed;	if (state->pending == 0) {	    child->place = notInUse;	    state->place = afterGroup;	    return;	}    }    /*     * Do the "before" field notification for next item in group.     */    sec_asn1d_notify_before (state->top, child->dest, child->depth);    /*     * Now we do the next one.     */    sec_asn1d_scrub_state (child);    state->top->current = child;}