} else if (state.pushmap[old_i] == OP_DONE) {  varbits = ~0U;
stmt_to_code(Stmt * stmt, GState * gstate){    State state;    Bytecodes bc;    int old_i, new_i, fix_i;#ifdef BYTECODE_REDUCE_REF    int *bbd, n_bbd;	/* basic block delimiters */    unsigned varbits;		/* variables we've seen */#if NUM_READY_VARS > 32#error assumed NUM_READY_VARS was 32#endif#endif /* BYTECODE_REDUCE_REF */    Fixup *fixup;    init_state(&state, gstate);    generate_stmt(stmt, &state);    emit_byte(OP_DONE, &state);    if (state.cur_stack != 0)	panic("Stack not entirely popped in STMT_TO_CODE()");    if (state.saved_stack != UINT_MAX)	panic("Still a saved stack index in STMT_TO_CODE()");    /* The max()ing here with gstate->* is wrong (since that's a global     * cumulative count, and thus unrelated to the local maximum), but required     * in order to maintain the validity of old program counters stored for     * suspended tasks... */    bc.numbytes_literal = ref_size(max(state.max_literal,				       gstate->num_literals));    bc.numbytes_fork = ref_size(max(state.max_fork,				    gstate->num_fork_vectors));    bc.numbytes_var_name = ref_size(max(state.max_var_ref,					gstate->total_var_refs));    bc.size = state.num_bytes	+ (bc.numbytes_literal - 1) * state.num_literals	+ (bc.numbytes_fork - 1) * state.num_forks	+ (bc.numbytes_var_name - 1) * state.num_var_refs;    if (bc.size <= 256)	bc.numbytes_label = 1;    else if (bc.size + state.num_labels <= 256 * 256)	bc.numbytes_label = 2;    else	bc.numbytes_label = 4;    bc.size += (bc.numbytes_label - 1) * state.num_labels;    bc.max_stack = state.max_stack;    bc.numbytes_stack = ref_size(state.max_stack);    bc.vector = mymalloc(sizeof(Byte) * bc.size, M_BYTECODES);#ifdef BYTECODE_REDUCE_REF    /*     * Create a sorted array filled with the bytecode offsets of     * beginnings of each basic block of code.  These are sequences     * of bytecodes which are guaranteed to execute in order (so if     * you start at the top, you will reach the bottom).  As such they     * are delimited by conditional and unconditional jump operations,     * each of which has an associated fixup.  If you also want to     * limit the blocks to those which have the property "if you get to     * the bottom you had to have started at the top", include the     * *destinations* of the jumps (hence the qsort).     */    bbd = mymalloc(sizeof(*bbd) * (state.num_fixups + 2), M_CODE_GEN);    n_bbd = 0;    bbd[n_bbd++] = 0;    bbd[n_bbd++] = state.num_bytes;    for (fixup = state.fixups, fix_i = 0; fix_i < state.num_fixups; ++fix_i, ++fixup)	if (fixup->kind == FIXUP_LABEL)	    bbd[n_bbd++] = fixup->pc;    qsort(bbd, n_bbd, sizeof(*bbd), bbd_cmp);    /*     * For every basic block, search backwards for PUT ops.  The first     * PUSH we find for each variable slot (looking backwards, remember)     * after each PUT becomes a PUSH_CLEAR, while the rest remain PUSHs.     * In other words, the last use of a variable before it is replaced     * is identified, so that during interpretation the code can avoid     * holding spurious references to it.     */    while (n_bbd-- > 1) {	varbits = 0;        for (old_i = bbd[n_bbd] - 1; old_i >= bbd[n_bbd - 1]; --old_i) {	    if (state.pushmap[old_i] == OP_PUSH) {		int id = PUSH_n_INDEX(state.bytes[old_i]);		if (varbits & (1 << id)) {			varbits &= ~(1 << id);			state.bytes[old_i] += OP_PUSH_CLEAR - OP_PUSH;		}	    } else if (state.pushmap[old_i] == OP_PUT) {		int id = PUT_n_INDEX(state.bytes[old_i]);		varbits |= 1 << id;	    }	}    }    myfree(bbd, M_CODE_GEN);#endif /* BYTECODE_REDUCE_REF */    fixup = state.fixups;    fix_i = 0;    for (old_i = new_i = 0; old_i < state.num_bytes; old_i++) {	if (fix_i < state.num_fixups && fixup->pc == old_i) {	    unsigned value, size = 0;	/* initialized to silence warning */	    value = fixup->value;	    switch (fixup->kind) {	    case FIXUP_LITERAL:		size = bc.numbytes_literal;		break;	    case FIXUP_FORK:		size = bc.numbytes_fork;		break;	    case FIXUP_VAR_REF:		size = bc.numbytes_var_name;		break;	    case FIXUP_STACK:		size = bc.numbytes_stack;		break;	    case FIXUP_LABEL:		value += fixup->prev_literals * (bc.numbytes_literal - 1)		    + fixup->prev_forks * (bc.numbytes_fork - 1)		    + fixup->prev_var_refs * (bc.numbytes_var_name - 1)		    + fixup->prev_labels * (bc.numbytes_label - 1)		    + fixup->prev_stacks * (bc.numbytes_stack - 1);		size = bc.numbytes_label;		break;	    default:		panic("Can't happen #1 in STMT_TO_CODE()");	    }	    switch (size) {	    case 4:		bc.vector[new_i++] = value >> 24;		bc.vector[new_i++] = value >> 16;	    case 2:		bc.vector[new_i++] = value >> 8;	    case 1:		bc.vector[new_i++] = value;		break;	    default:		panic("Can't happen #2 in STMT_TO_CODE()");	    }	    fixup++;	    fix_i++;	} else	    bc.vector[new_i++] = state.bytes[old_i];    }    free_state(state);    return bc;}