/////////////////////////////////////////////////////////////////////////////
// This C file has been created automatically. Do not edit!!!
/////////////////////////////////////////////////////////////////////////////

// %%COMMENT
// TODO: comment this!!!!

#include "mm_op7.h"   
   






// %%EXPORT px
uint32_t mm_op7_word(uint_mmv_t *v, uint32_t *g, int32_t len_g, int32_t e, uint_mmv_t *work)
{
     uint32_t status;
     uint_mmv_t *p0 = v, *p1 = work, *pt;
     mm_group_iter_t s_it;

     #define h (s_it.data)
     mm_group_iter_start(&s_it, g, len_g, e);
     do {
         status = mm_group_iter_next(&s_it);
         if (h[0]) {
             mm_op7_xi(p0, h[0], p1); 
             pt = p0; p0 = p1; p1 = pt;
         }
         if (h[1]) {
             mm_op7_t(p0, h[1], p1);
             pt = p0; p0 = p1; p1 = pt;
         }
         if (h[2] | h[3]) {
             mm_op7_xy(p0, h[2], h[3], h[4], p1);
             h[4] = 0;
             pt = p0; p0 = p1; p1 = pt;
         }
         if (h[5]) {
             mm_op7_pi(p0, h[4], h[5], p1);
             pt = p0; p0 = p1; p1 = pt;
         } else if (h[4]) {
             mm_op7_delta(p0, h[4], p1);
             pt = p0; p0 = p1; p1 = pt;
         }
     } while (status == 0);
     #undef h
     
     if (p0 != v) mm_op7_copy(work, v);
     return status - 1;
}


// %%EXPORT px
int32_t mm_op7_word_tag_A(uint_mmv_t *v, uint32_t *g, int32_t len_g, int32_t e)
{
     uint32_t status;
     mm_group_iter_t s_it;

     #define h (s_it.data)
     mm_group_iter_start(&s_it, g, len_g, e);
     do {
         status = mm_group_iter_next(&s_it);
         if (h[0])  mm_op7_xi_tag_A(v, h[0]); 
         if (h[1])  return -1;
         if (h[2])  mm_op7_y_tag_A(v, h[2]);
         if (h[5])  mm_op7_pi_tag_A(v, h[5]);
     } while (status == 0);
     #undef h
     if (mm_aux_reduce_mmv_fields(7, v, MM_AUX_OFS_B) < 0) return -1;
     return status - 1;
}


