void copy_to_buffer(const closure_t &closure, const prectable_t *prectbl,
    stacmd_t *stacmd, kernel_t *buffer)
{
    const size_t n = closure.size();
    buffer->size = n;
    buffer->prectbl = prectbl;
    if (!stadfa) {
        for (size_t i = 0; i < n; ++i) {
            const clos_t &c = closure[i];
            buffer->state[i] = c.state;
            buffer->tvers[i] = c.tvers;
            buffer->thist[i] = c.thist;
        }
    }
    else {
        for (size_t i = 0; i < n; ++i) {
            const clos_t &c = closure[i];
            buffer->state[i] = c.state;
            buffer->thist[i] = c.thist;
        }
        buffer->stacmd = stacmd;
    }
}
void copy_to_buffer(const closure_t &closure, const prectable_t *prectbl,
    stacmd_t *stacmd, kernel_t *buffer)
{
    const size_t n = closure.size();
    buffer->size = n;
    buffer->prectbl = prectbl;
    if (!stadfa) {
        for (size_t i = 0; i < n; ++i) {
            const clos_t &c = closure[i];
            buffer->state[i] = c.state;
            buffer->tvers[i] = c.tvers;
            buffer->thist[i] = c.thist;
        }
    }
    else {
        for (size_t i = 0; i < n; ++i) {
            const clos_t &c = closure[i];
            buffer->state[i] = c.state;
            buffer->thist[i] = c.thist;
        }
        buffer->stacmd = stacmd;
    }
}