original_code:
void umfzi_garbage_collection
(
    NumericType *Numeric,
    WorkType *Work,
    int drnew,
    int dcnew,
    int do_Fcpos
)
{
    int size, e, n_row, n_col, nrows, ncols, nrowsleft, ncolsleft, prevsize,
 csize, size2, i2, j2, i, j, cdeg, rdeg, *E, row, col,
 *Rows, *Cols, *Rows2, *Cols2, nel, e2, *Row_tuples, *Col_tuples,
 *Row_degree, *Col_degree ;
    DoubleComplex *C, *C1, *C3, *C2 ;
    Unit *psrc, *pdest, *p, *pnext ;
    Element *epsrc, *epdest ;
    Col_degree = Numeric->Cperm ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Col_tuples = Numeric->Lip ;
    E = Work->E ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    Numeric->ngarbage++ ;
    for (row = 0 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0) && Row_tuples [row])
 {
     ;
     p = Numeric->Memory + Row_tuples [row] - 1 ;
     ;
     ;
     ;
     ;
     p->header.size = -p->header.size ;
     Row_tuples [row] = 0 ;
 }
    }
    for (col = 0 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0) && Col_tuples [col])
 {
     ;
     p = Numeric->Memory + Col_tuples [col] - 1 ;
     ;
     ;
     ;
     ;
     p->header.size = -p->header.size ;
     Col_tuples [col] = 0 ;
 }
    }
    nel = Work->nel ;
    ;
    e2 = 0 ;
    for (e = 0 ; e <= nel ; e++)
    {
 if (E [e])
 {
     psrc = Numeric->Memory + E [e] ;
     psrc-- ;
     if (e > 0)
     {
  e2++ ;
     }
     ;
     psrc->header.size = e2 ;
     ;
     E [e] = 0 ;
     if (e == Work->prior_element)
     {
  Work->prior_element = e2 ;
     }
 }
    }
    Work->nel = e2 ;
    nel = Work->nel ;
    psrc = Numeric->Memory + Numeric->size - 2 ;
    pdest = psrc ;
    prevsize = psrc->header.prevsize ;
    ;
    while (prevsize > 0)
    {
 size = prevsize ;
 psrc -= (size + 1) ;
 e = psrc->header.size ;
 prevsize = psrc->header.prevsize ;
 ;
 if (e == 0)
 {
     DoubleComplex *F1, *F2, *Fsrc, *Fdst ;
     int c, r, k, dr, dc, gap, gap1, gap2, nb ;
     F1 = (DoubleComplex *) (psrc + 1) ;
     k = Work->fnpiv ;
     dr = Work->fnr_curr ;
     dc = Work->fnc_curr ;
     r = Work->fnrows ;
     c = Work->fncols ;
     nb = Work->nb ;
     ;
     ;
     if (drnew % 2 == 0)
     {
  drnew++ ;
     }
     drnew = (((dr) < (drnew)) ? (dr) : (drnew)) ;
     ;
     pnext = pdest ;
     Fsrc = Work->Flblock ;
     Fdst = Work->Flblock ;
     ;
     gap1 = dr - r ;
     gap2 = drnew - r ;
     ;
     for (j = 0 ; j < k ; j++)
     {
  for (i = 0 ; i < r ; i++)
  {
      *Fdst++ = *Fsrc++ ;
  }
  Fsrc += gap1 ;
  Fdst += gap2 ;
     }
     ;
     Fdst += drnew * (nb - k) ;
     Fsrc = Work->Fublock ;
     ;
     gap1 = dc - c ;
     gap2 = dcnew - c ;
     for (i = 0 ; i < k ; i++)
     {
  for (j = 0 ; j < c ; j++)
  {
      *Fdst++ = *Fsrc++ ;
  }
  Fsrc += gap1 ;
  Fdst += gap2 ;
     }
     ;
     Fdst += dcnew * (nb - k) ;
     Fsrc = Work->Fcblock ;
     ;
     gap1 = dr - r ;
     gap2 = drnew - r ;
     for (j = 0 ; j < c ; j++)
     {
  for (i = 0 ; i < r ; i++)
  {
      *Fdst++ = *Fsrc++ ;
  }
  Fsrc += gap1 ;
  Fdst += gap2 ;
     }
     ;
     if (do_Fcpos)
     {
  int *Fcols, *Fcpos ;
  Fcols = Work->Fcols ;
  Fcpos = Work->Fcpos ;
  for (j = 0 ; j < c ; j++)
  {
      col = Fcols [j] ;
      ;
      ;
      Fcpos [col] = j * drnew ;
  }
     }
     Work->fnr_curr = drnew ;
     Work->fnc_curr = dcnew ;
     Work->fcurr_size = (drnew + nb) * (dcnew + nb) ;
     size = (((((sizeof (DoubleComplex) * (Work->fcurr_size))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     size = (((1) > (size)) ? (1) : (size)) ;
     pnext->header.prevsize = size ;
     pdest -= (size + 1) ;
     F2 = (DoubleComplex *) (pdest + 1) ;
     ;
     ;
     ;
     Fsrc = F1 + nb*nb + drnew*nb + nb*dcnew + drnew*c ;
     Fdst = F2 + nb*nb + drnew*nb + nb*dcnew + drnew*c ;
     gap = drnew - r ;
     for (j = c-1 ; j >= 0 ; j--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (i = r-1 ; i >= 0 ; i--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     Fsrc -= dcnew * (nb - k) ;
     Fdst -= dcnew * (nb - k) ;
     ;
     ;
     gap = dcnew - c ;
     for (i = k-1 ; i >= 0 ; i--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (j = c-1 ; j >= 0 ; j--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     Fsrc -= drnew * (nb - k) ;
     Fdst -= drnew * (nb - k) ;
     ;
     ;
     gap = drnew - r ;
     for (j = k-1 ; j >= 0 ; j--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (i = r-1 ; i >= 0 ; i--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     Fsrc -= nb * (nb - k) ;
     Fdst -= nb * (nb - k) ;
     ;
     ;
     gap = nb - k ;
     for (j = k-1 ; j >= 0 ; j--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (i = k-1 ; i >= 0 ; i--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     E [0] = (pdest + 1) - Numeric->Memory ;
     Work->Flublock = (DoubleComplex *) (Numeric->Memory + E [0]) ;
     ;
     Work->Flblock = Work->Flublock + nb * nb ;
     Work->Fublock = Work->Flblock + drnew * nb ;
     Work->Fcblock = Work->Fublock + nb * dcnew ;
     pdest->header.prevsize = 0 ;
     pdest->header.size = size ;
 }
 else if (e > 0)
 {
     p = psrc + 1 ;
     { { { ; ; ; epsrc = (Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (int *) p ; } ; ncols = epsrc->ncols ; Rows = Cols + ncols ; } ; nrows = epsrc->nrows ; p += (((((sizeof (int) * (ncols + nrows))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; C = (DoubleComplex *) p ; } ;
     nrowsleft = epsrc->nrowsleft ;
     ncolsleft = epsrc->ncolsleft ;
     cdeg = epsrc->cdeg ;
     rdeg = epsrc->rdeg ;
     csize = nrowsleft * ncolsleft ;
     size2 = (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))
    + (((((sizeof (int) * (nrowsleft + ncolsleft))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))
    + (((((sizeof (DoubleComplex) * (csize))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     ;
     pnext = pdest ;
     pnext->header.prevsize = size2 ;
     pdest -= (size2 + 1) ;
     ;
     ;
     ;
     p = pdest + 1 ;
     epdest = (Element *) p ;
     p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Cols2 = (int *) p ;
     Rows2 = Cols2 + ncolsleft ;
     p += (((((sizeof (int) * (nrowsleft + ncolsleft))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     C2 = (DoubleComplex *) p ;
     ;
     ;
     ;
     ;
     ;
     if (nrowsleft < nrows || ncolsleft < ncols)
     {
  ;
  C1 = C ;
  C3 = C ;
  for (j = 0 ; j < ncols ; j++)
  {
      if (Cols [j] >= 0)
      {
   for (i = 0 ; i < nrows ; i++)
   {
       if (Rows [i] >= 0)
       {
    *C3++ = C1 [i] ;
       }
   }
      }
      C1 += nrows ;
  }
  ;
  ;
     }
     C += csize ;
     C2 += csize ;
     for (i = 0 ; i < csize ; i++)
     {
  *--C2 = *--C ;
     }
     i2 = nrowsleft ;
     for (i = nrows - 1 ; i >= 0 ; i--)
     {
  ;
  if (Rows [i] >= 0)
  {
      Rows2 [--i2] = Rows [i] ;
  }
     }
     ;
     j2 = ncolsleft ;
     for (j = ncols - 1 ; j >= 0 ; j--)
     {
  ;
  if (Cols [j] >= 0)
  {
      Cols2 [--j2] = Cols [j] ;
  }
     }
     ;
     E [e] = (pdest + 1) - Numeric->Memory ;
     epdest = (Element *) (pdest + 1) ;
     epdest->next = (-1) ;
     epdest->ncols = ncolsleft ;
     epdest->nrows = nrowsleft ;
     epdest->ncolsleft = ncolsleft ;
     epdest->nrowsleft = nrowsleft ;
     epdest->rdeg = rdeg ;
     epdest->cdeg = cdeg ;
     ;
     pdest->header.prevsize = 0 ;
     pdest->header.size = size2 ;
     ;
 }
 ;
    }
    ;
    ;
    ;
    Numeric->itail = pdest - Numeric->Memory ;
    pdest->header.prevsize = 0 ;
    Numeric->ibig = (-1) ;
    Numeric->tail_usage = Numeric->size - Numeric->itail ;
    for (e = nel+1 ; e < Work->elen ; e++)
    {
 E [e] = 0 ;
    }
    ;
}

canonical_original_code:
void umfzi_garbage_collection(struct NumericType *Numeric, struct WorkType *Work, int drnew, int dcnew, int do_Fcpos)
{
    int size; int e; int n_row; int n_col; int nrows; int ncols; int nrowsleft; int ncolsleft; int prevsize; int csize; int size2; int i2; int j2; int i; int j; int cdeg; int rdeg; int *E; int row; int col; int *Rows; int *Cols; int *Rows2; int *Cols2; int nel; int e2; int *Row_tuples; int *Col_tuples; int *Row_degree; int *Col_degree;
    struct DoubleComplex *C; struct DoubleComplex *C1; struct DoubleComplex *C3; struct DoubleComplex *C2;
    union Unit_union *psrc; union Unit_union *pdest; union Unit_union *p; union Unit_union *pnext;
    struct Element *epsrc; struct Element *epdest;
    Col_degree = Numeric->Cperm ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Col_tuples = Numeric->Lip ;
    E = Work->E ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    Numeric->ngarbage++ ;
    for (row = 0 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0) && Row_tuples [row])
 {
     ;
     p = Numeric->Memory + Row_tuples [row] - 1 ;
     ;
     ;
     ;
     ;
     p->header.size = -p->header.size ;
     Row_tuples [row] = 0 ;
 }
    }
    for (col = 0 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0) && Col_tuples [col])
 {
     ;
     p = Numeric->Memory + Col_tuples [col] - 1 ;
     ;
     ;
     ;
     ;
     p->header.size = -p->header.size ;
     Col_tuples [col] = 0 ;
 }
    }
    nel = Work->nel ;
    ;
    e2 = 0 ;
    for (e = 0 ; e <= nel ; e++)
    {
 if (E [e])
 {
     psrc = Numeric->Memory + E [e] ;
     psrc-- ;
     if (e > 0)
     {
  e2++ ;
     }
     ;
     psrc->header.size = e2 ;
     ;
     E [e] = 0 ;
     if (e == Work->prior_element)
     {
  Work->prior_element = e2 ;
     }
 }
    }
    Work->nel = e2 ;
    nel = Work->nel ;
    psrc = Numeric->Memory + Numeric->size - 2 ;
    pdest = psrc ;
    prevsize = psrc->header.prevsize ;
    ;
    while (prevsize > 0)
    {
 size = prevsize ;
 psrc -= (size + 1) ;
 e = psrc->header.size ;
 prevsize = psrc->header.prevsize ;
 ;
 if (e == 0)
 {
     struct DoubleComplex *F1; struct DoubleComplex *F2; struct DoubleComplex *Fsrc; struct DoubleComplex *Fdst;
     int c; int r; int k; int dr; int dc; int gap; int gap1; int gap2; int nb;
     F1 = (struct DoubleComplex *) (psrc + 1) ;
     k = Work->fnpiv ;
     dr = Work->fnr_curr ;
     dc = Work->fnc_curr ;
     r = Work->fnrows ;
     c = Work->fncols ;
     nb = Work->nb ;
     ;
     ;
     if (drnew % 2 == 0)
     {
  drnew++ ;
     }
     drnew = (((dr) < (drnew)) ? (dr) : (drnew)) ;
     ;
     pnext = pdest ;
     Fsrc = Work->Flblock ;
     Fdst = Work->Flblock ;
     ;
     gap1 = dr - r ;
     gap2 = drnew - r ;
     ;
     for (j = 0 ; j < k ; j++)
     {
  for (i = 0 ; i < r ; i++)
  {
      *Fdst++ = *Fsrc++ ;
  }
  Fsrc += gap1 ;
  Fdst += gap2 ;
     }
     ;
     Fdst += drnew * (nb - k) ;
     Fsrc = Work->Fublock ;
     ;
     gap1 = dc - c ;
     gap2 = dcnew - c ;
     for (i = 0 ; i < k ; i++)
     {
  for (j = 0 ; j < c ; j++)
  {
      *Fdst++ = *Fsrc++ ;
  }
  Fsrc += gap1 ;
  Fdst += gap2 ;
     }
     ;
     Fdst += dcnew * (nb - k) ;
     Fsrc = Work->Fcblock ;
     ;
     gap1 = dr - r ;
     gap2 = drnew - r ;
     for (j = 0 ; j < c ; j++)
     {
  for (i = 0 ; i < r ; i++)
  {
      *Fdst++ = *Fsrc++ ;
  }
  Fsrc += gap1 ;
  Fdst += gap2 ;
     }
     ;
     if (do_Fcpos)
     {
  int *Fcols; int *Fcpos;
  Fcols = Work->Fcols ;
  Fcpos = Work->Fcpos ;
  for (j = 0 ; j < c ; j++)
  {
      col = Fcols [j] ;
      ;
      ;
      Fcpos [col] = j * drnew ;
  }
     }
     Work->fnr_curr = drnew ;
     Work->fnc_curr = dcnew ;
     Work->fcurr_size = (drnew + nb) * (dcnew + nb) ;
     size = (((((sizeof (DoubleComplex) * (Work->fcurr_size))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     size = (((1) > (size)) ? (1) : (size)) ;
     pnext->header.prevsize = size ;
     pdest -= (size + 1) ;
     F2 = (struct DoubleComplex *) (pdest + 1) ;
     ;
     ;
     ;
     Fsrc = F1 + nb*nb + drnew*nb + nb*dcnew + drnew*c ;
     Fdst = F2 + nb*nb + drnew*nb + nb*dcnew + drnew*c ;
     gap = drnew - r ;
     for (j = c-1 ; j >= 0 ; j--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (i = r-1 ; i >= 0 ; i--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     Fsrc -= dcnew * (nb - k) ;
     Fdst -= dcnew * (nb - k) ;
     ;
     ;
     gap = dcnew - c ;
     for (i = k-1 ; i >= 0 ; i--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (j = c-1 ; j >= 0 ; j--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     Fsrc -= drnew * (nb - k) ;
     Fdst -= drnew * (nb - k) ;
     ;
     ;
     gap = drnew - r ;
     for (j = k-1 ; j >= 0 ; j--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (i = r-1 ; i >= 0 ; i--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     Fsrc -= nb * (nb - k) ;
     Fdst -= nb * (nb - k) ;
     ;
     ;
     gap = nb - k ;
     for (j = k-1 ; j >= 0 ; j--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (i = k-1 ; i >= 0 ; i--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     E [0] = (pdest + 1) - Numeric->Memory ;
     Work->Flublock = (struct DoubleComplex *) (Numeric->Memory + E [0]) ;
     ;
     Work->Flblock = Work->Flublock + nb * nb ;
     Work->Fublock = Work->Flblock + drnew * nb ;
     Work->Fcblock = Work->Fublock + nb * dcnew ;
     pdest->header.prevsize = 0 ;
     pdest->header.size = size ;
 }
 else if (e > 0)
 {
     p = psrc + 1 ;
     { { { ; ; ; epsrc = (struct Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (int *) p ; } ; ncols = epsrc->ncols ; Rows = Cols + ncols ; } ; nrows = epsrc->nrows ; p += (((((sizeof (int) * (ncols + nrows))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; C = (struct DoubleComplex *) p ; } ;
     nrowsleft = epsrc->nrowsleft ;
     ncolsleft = epsrc->ncolsleft ;
     cdeg = epsrc->cdeg ;
     rdeg = epsrc->rdeg ;
     csize = nrowsleft * ncolsleft ;
     size2 = (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))
    + (((((sizeof (int) * (nrowsleft + ncolsleft))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))
    + (((((sizeof (DoubleComplex) * (csize))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     ;
     pnext = pdest ;
     pnext->header.prevsize = size2 ;
     pdest -= (size2 + 1) ;
     ;
     ;
     ;
     p = pdest + 1 ;
     epdest = (struct Element *) p ;
     p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Cols2 = (int *) p ;
     Rows2 = Cols2 + ncolsleft ;
     p += (((((sizeof (int) * (nrowsleft + ncolsleft))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     C2 = (struct DoubleComplex *) p ;
     ;
     ;
     ;
     ;
     ;
     if (nrowsleft < nrows || ncolsleft < ncols)
     {
  ;
  C1 = C ;
  C3 = C ;
  for (j = 0 ; j < ncols ; j++)
  {
      if (Cols [j] >= 0)
      {
   for (i = 0 ; i < nrows ; i++)
   {
       if (Rows [i] >= 0)
       {
    *C3++ = C1 [i] ;
       }
   }
      }
      C1 += nrows ;
  }
  ;
  ;
     }
     C += csize ;
     C2 += csize ;
     for (i = 0 ; i < csize ; i++)
     {
  *--C2 = *--C ;
     }
     i2 = nrowsleft ;
     for (i = nrows - 1 ; i >= 0 ; i--)
     {
  ;
  if (Rows [i] >= 0)
  {
      Rows2 [--i2] = Rows [i] ;
  }
     }
     ;
     j2 = ncolsleft ;
     for (j = ncols - 1 ; j >= 0 ; j--)
     {
  ;
  if (Cols [j] >= 0)
  {
      Cols2 [--j2] = Cols [j] ;
  }
     }
     ;
     E [e] = (pdest + 1) - Numeric->Memory ;
     epdest = (struct Element *) (pdest + 1) ;
     epdest->next = (-1) ;
     epdest->ncols = ncolsleft ;
     epdest->nrows = nrowsleft ;
     epdest->ncolsleft = ncolsleft ;
     epdest->nrowsleft = nrowsleft ;
     epdest->rdeg = rdeg ;
     epdest->cdeg = cdeg ;
     ;
     pdest->header.prevsize = 0 ;
     pdest->header.size = size2 ;
     ;
 }
 ;
    }
    ;
    ;
    ;
    Numeric->itail = pdest - Numeric->Memory ;
    pdest->header.prevsize = 0 ;
    Numeric->ibig = (-1) ;
    Numeric->tail_usage = Numeric->size - Numeric->itail ;
    for (e = nel+1 ; e < Work->elen ; e++)
    {
 E [e] = 0 ;
    }
    ;
}

variable_types: struct NumericType { double flops; int scale; int valid; union Unit_union { struct { int size; } header; double xxxxxx; } *Memory; int ihead; int *Rperm; int ulen; struct DoubleComplex { double component[2]; } *D; int do_recip; double *Rs; int n_row; int tail_usage; int maxnrows; } *

variable_types: struct WorkType { int *E; struct DoubleComplex *Wx; int *Wp; int *Lpattern; int *Diagonal_map; int n_row; int *Front_new1strow; int Pivrow[64]; struct DoubleComplex *Flublock; int *Frows; } *

variable_types: drnew int

variable_types: dcnew int

variable_types: size int

variable_types: e int

variable_types: nrows int

variable_types: ncols int

variable_types: nrowsleft int

variable_types: ncolsleft int

variable_types: prevsize int

variable_types: csize int

variable_types: i int

variable_types: j int

variable_types: cdeg int

variable_types: rdeg int

variable_types:
E
int *

variable_types: row int

variable_types: col int

variable_types:
Rows
int *

variable_types:
Cols
int *

variable_types: nel int

variable_types:
epsrc
struct Element { int cdeg; } *

variable_types:
epdest
struct Element { int cdeg; } *

variable_types: c int

variable_types: r int

variable_types: k int

variable_types: dr int

variable_types: dc int

variable_types: gap int

variable_types: nb int

variable_types:
Fcols
int *

variable_types:
Fcpos
int *


original_code:
int
umfpack_di_wsolve
(
    int sys,
    const int Ap [ ],
    const int Ai [ ],
    const double Ax [ ],
    double Xx [ ],
    const double Bx [ ],
    void *NumericHandle,
    const double Control [20],
    double User_Info [90]
    , int Pattern [ ],
    double W [ ]
)
{
    double Info2 [90], stats [2] ;
    double *Info ;
    NumericType *Numeric ;
    int n, i, irstep, status ;
    umfpack_tic (stats) ;
    irstep = ((Control != (double *) ((void *)0)) ? (((Control [7]) != (Control [7])) ? 2 : Control [7]) : 2) ;
    if (User_Info != (double *) ((void *)0))
    {
 Info = User_Info ;
 for (i = 80 ; i <= 85 ; i++)
 {
     Info [i] = (-1) ;
 }
    }
    else
    {
 Info = Info2 ;
 for (i = 0 ; i < 90 ; i++)
 {
     Info [i] = (-1) ;
 }
    }
    Info [0] = (0) ;
    Info [84] = 0 ;
    Numeric = (NumericType *) NumericHandle ;
    if (!umfdi_valid_numeric (Numeric))
    {
 Info [0] = (-3) ;
 return ((-3)) ;
    }
    Info [1] = Numeric->n_row ;
    Info [16] = Numeric->n_col ;
    if (Numeric->n_row != Numeric->n_col)
    {
 Info [0] = (-13) ;
 return ((-13)) ;
    }
    n = Numeric->n_row ;
    if (Numeric->nnzpiv < n
 || ((Numeric->rcond) == 0.) || ((Numeric->rcond) != (Numeric->rcond)))
    {
 irstep = 0 ;
    }
    if (!Xx || !Bx)
    {
 Info [0] = (-5) ;
 return ((-5)) ;
    }
    if (sys >= (3))
    {
 irstep = 0 ;
    }
    if (!W || !Pattern)
    {
 Info [0] = (-5) ;
 return ((-5)) ;
    }
    status = umfdi_solve (sys, Ap, Ai, Ax, Xx, Bx,
 Numeric, irstep, Info, Pattern, W) ;
    Info [0] = status ;
    if (status >= 0)
    {
 umfpack_toc (stats) ;
 Info [86] = stats [0] ;
 Info [85] = stats [1] ;
    }
    return (status) ;
}

canonical_original_code:
int umfpack_di_wsolve(int sys, int Ap[], int Ai[], double Ax[], double Xx[], double Bx[], void *NumericHandle, double Control[20], double User_Info[90], int Pattern[], double W[])
{
    double Info2[90]; double stats[2];
    double *Info;
    struct NumericType *Numeric;
    int n; int i; int irstep; int status;
    umfpack_tic (stats) ;
    irstep = ((Control != (double *) ((void *)0)) ? (((Control [7]) != (Control [7])) ? 2 : Control [7]) : 2) ;
    if (User_Info != (double *) ((void *)0))
    {
 Info = User_Info ;
 for (i = 80 ; i <= 85 ; i++)
 {
     Info [i] = (-1) ;
 }
    }
    else
    {
 Info = Info2 ;
 for (i = 0 ; i < 90 ; i++)
 {
     Info [i] = (-1) ;
 }
    }
    Info [0] = (0) ;
    Info [84] = 0 ;
    Numeric = (struct NumericType *) NumericHandle ;
    if (!umfdi_valid_numeric (Numeric))
    {
 Info [0] = (-3) ;
 return ((-3)) ;
    }
    Info [1] = Numeric->n_row ;
    Info [16] = Numeric->n_col ;
    if (Numeric->n_row != Numeric->n_col)
    {
 Info [0] = (-13) ;
 return ((-13)) ;
    }
    n = Numeric->n_row ;
    if (Numeric->nnzpiv < n
 || ((Numeric->rcond) == 0.) || ((Numeric->rcond) != (Numeric->rcond)))
    {
 irstep = 0 ;
    }
    if (!Xx || !Bx)
    {
 Info [0] = (-5) ;
 return ((-5)) ;
    }
    if (sys >= (3))
    {
 irstep = 0 ;
    }
    if (!W || !Pattern)
    {
 Info [0] = (-5) ;
 return ((-5)) ;
    }
    status = umfdi_solve (sys, Ap, Ai, Ax, Xx, Bx,
 Numeric, irstep, Info, Pattern, W) ;
    Info [0] = status ;
    if (status >= 0)
    {
 umfpack_toc (stats) ;
 Info [86] = stats [0] ;
 Info [85] = stats [1] ;
    }
    return (status) ;
}

variable_types: sys int

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Ax
double []

variable_types:
Xx
double []

variable_types:
Bx
double []

variable_types:
NumericHandle
void *

variable_types:
Control
double [20]

variable_types:
Pattern
int []

variable_types:
W
double []

variable_types:
stats
double [2]

variable_types:
Info
double *

variable_types: struct NumericType { double flops; int scale; int valid; union Unit_union { struct { int size; } header; double xxxxxx; } *Memory; int ihead; int *Rperm; int ulen; double *D; int do_recip; double *Rs; int n_row; int tail_usage; int maxnrows; } *

variable_types: n int

variable_types: i int

variable_types: irstep int

variable_types: status int

return_type: int

user_defined_types: struct NumericType { double flops; int scale; int valid; union Unit_union *Memory; int ihead; int *Rperm; int ulen; double *D; int do_recip; double *Rs; int n_row; int tail_usage; int maxnrows; }


original_code:
long umfdl_tuple_lengths
(
    NumericType *Numeric,
    WorkType *Work,
    double *p_dusage
)
{
    double dusage ;
    long e, nrows, ncols, nel, i, *Rows, *Cols, row, col, n_row, n_col, *E,
 *Row_degree, *Row_tlen, *Col_degree, *Col_tlen, usage, n1 ;
    Element *ep ;
    Unit *p ;
    E = Work->E ;
    Row_degree = Numeric->Rperm ;
    Col_degree = Numeric->Cperm ;
    Row_tlen = Numeric->Uilen ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    n1 = Work->n1 ;
    nel = Work->nel ;
    ;
    ;
    for (e = 1 ; e <= nel ; e++)
    {
 if (E [e])
 {
     p = Numeric->Memory + E [e] ;
     { { ; ; ; ep = (Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (long *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
     nrows = ep->nrows ;
     for (i = 0 ; i < nrows ; i++)
     {
  row = Rows [i] ;
  ;
  if (row >= n1)
  {
      ;
      Row_tlen [row] ++ ;
  }
     }
     for (i = 0 ; i < ncols ; i++)
     {
  col = Cols [i] ;
  ;
  if (col >= n1)
  {
      ;
      Col_tlen [col] ++ ;
  }
     }
 }
    }
    ;
    usage = 0 ;
    dusage = 0 ;
    ;
    for (col = n1 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    *p_dusage = dusage ;
    return (usage) ;
}

canonical_original_code:
long umfdl_tuple_lengths(struct NumericType *Numeric, struct WorkType *Work, double *p_dusage)
{
    double dusage;
    long e; long nrows; long ncols; long nel; long i; long *Rows; long *Cols; long row; long col; long n_row; long n_col; long *E; long *Row_degree; long *Row_tlen; long *Col_degree; long *Col_tlen; long usage; long n1;
    struct Element *ep;
    union Unit_union *p;
    E = Work->E ;
    Row_degree = Numeric->Rperm ;
    Col_degree = Numeric->Cperm ;
    Row_tlen = Numeric->Uilen ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    n1 = Work->n1 ;
    nel = Work->nel ;
    ;
    ;
    for (e = 1 ; e <= nel ; e++)
    {
 if (E [e])
 {
     p = Numeric->Memory + E [e] ;
     { { ; ; ; ep = (struct Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (long *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
     nrows = ep->nrows ;
     for (i = 0 ; i < nrows ; i++)
     {
  row = Rows [i] ;
  ;
  if (row >= n1)
  {
      ;
      Row_tlen [row] ++ ;
  }
     }
     for (i = 0 ; i < ncols ; i++)
     {
  col = Cols [i] ;
  ;
  if (col >= n1)
  {
      ;
      Col_tlen [col] ++ ;
  }
     }
 }
    }
    ;
    usage = 0 ;
    dusage = 0 ;
    ;
    for (col = n1 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    *p_dusage = dusage ;
    return (usage) ;
}

variable_types: struct NumericType { double flops; long scale; long valid; union Unit_union { struct { long size; } header; double xxxxxx; } *Memory; long ihead; long *Rperm; long ulen; double *D; long do_recip; double *Rs; long n_row; long tail_usage; long maxnrows; } *

variable_types: struct WorkType { long *E; double *Wx; long *Wp; long *Lpattern; long *Diagonal_map; long n_row; long *Front_new1strow; long Pivrow[64]; double *Flublock; long *Frows; } *

variable_types: dusage double

variable_types: e long

variable_types: nrows long

variable_types: ncols long

variable_types: nel long

variable_types: i long

variable_types:
Rows
long *

variable_types:
Cols
long *

variable_types: row long

variable_types: col long

variable_types:
E
long *

variable_types: usage long

variable_types:
ep
struct Element { long cdeg; } *

return_type: long

user_defined_types: struct NumericType { double flops; long scale; long valid; union Unit_union *Memory; long ihead; long *Rperm; long ulen; double *D; long do_recip; double *Rs; long n_row; long tail_usage; long maxnrows; }


original_code:
void umf_i_apply_order
(
    int Front [ ],
    const int Order [ ],
    int Temp [ ],
    int nn,
    int nfr
)
{
    int i, k ;
    for (i = 0 ; i < nn ; i++)
    {
 k = Order [i] ;
 ;
 if (k != (-1))
 {
     Temp [k] = Front [i] ;
 }
    }
    for (k = 0 ; k < nfr ; k++)
    {
 Front [k] = Temp [k] ;
    }
}

canonical_original_code:
void umf_i_apply_order(int Front[], int Order[], int Temp[], int nn, int nfr)
{
    int i; int k;
    for (i = 0 ; i < nn ; i++)
    {
 k = Order [i] ;
 ;
 if (k != (-1))
 {
     Temp [k] = Front [i] ;
 }
    }
    for (k = 0 ; k < nfr ; k++)
    {
 Front [k] = Temp [k] ;
    }
}

variable_types:
Front
int []

variable_types:
Order
int []

variable_types:
Temp
int []

variable_types: nn int

variable_types: nfr int

variable_types: i int

variable_types: k int

return_type: void


original_code:
int umfzi_tuple_lengths
(
    NumericType *Numeric,
    WorkType *Work,
    double *p_dusage
)
{
    double dusage ;
    int e, nrows, ncols, nel, i, *Rows, *Cols, row, col, n_row, n_col, *E,
 *Row_degree, *Row_tlen, *Col_degree, *Col_tlen, usage, n1 ;
    Element *ep ;
    Unit *p ;
    E = Work->E ;
    Row_degree = Numeric->Rperm ;
    Col_degree = Numeric->Cperm ;
    Row_tlen = Numeric->Uilen ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    n1 = Work->n1 ;
    nel = Work->nel ;
    ;
    ;
    for (e = 1 ; e <= nel ; e++)
    {
 if (E [e])
 {
     p = Numeric->Memory + E [e] ;
     { { ; ; ; ep = (Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (int *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
     nrows = ep->nrows ;
     for (i = 0 ; i < nrows ; i++)
     {
  row = Rows [i] ;
  ;
  if (row >= n1)
  {
      ;
      Row_tlen [row] ++ ;
  }
     }
     for (i = 0 ; i < ncols ; i++)
     {
  col = Cols [i] ;
  ;
  if (col >= n1)
  {
      ;
      Col_tlen [col] ++ ;
  }
     }
 }
    }
    ;
    usage = 0 ;
    dusage = 0 ;
    ;
    for (col = n1 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    *p_dusage = dusage ;
    return (usage) ;
}

canonical_original_code:
int umfzi_tuple_lengths(struct NumericType *Numeric, struct WorkType *Work, double *p_dusage)
{
    double dusage;
    int e; int nrows; int ncols; int nel; int i; int *Rows; int *Cols; int row; int col; int n_row; int n_col; int *E; int *Row_degree; int *Row_tlen; int *Col_degree; int *Col_tlen; int usage; int n1;
    struct Element *ep;
    union Unit_union *p;
    E = Work->E ;
    Row_degree = Numeric->Rperm ;
    Col_degree = Numeric->Cperm ;
    Row_tlen = Numeric->Uilen ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    n1 = Work->n1 ;
    nel = Work->nel ;
    ;
    ;
    for (e = 1 ; e <= nel ; e++)
    {
 if (E [e])
 {
     p = Numeric->Memory + E [e] ;
     { { ; ; ; ep = (struct Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (int *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
     nrows = ep->nrows ;
     for (i = 0 ; i < nrows ; i++)
     {
  row = Rows [i] ;
  ;
  if (row >= n1)
  {
      ;
      Row_tlen [row] ++ ;
  }
     }
     for (i = 0 ; i < ncols ; i++)
     {
  col = Cols [i] ;
  ;
  if (col >= n1)
  {
      ;
      Col_tlen [col] ++ ;
  }
     }
 }
    }
    ;
    usage = 0 ;
    dusage = 0 ;
    ;
    for (col = n1 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    *p_dusage = dusage ;
    return (usage) ;
}

variable_types: struct NumericType { double flops; int scale; int valid; union Unit_union { struct { int size; } header; double xxxxxx; } *Memory; int ihead; int *Rperm; int ulen; struct DoubleComplex { double component[2]; } *D; int do_recip; double *Rs; int n_row; int tail_usage; int maxnrows; } *

variable_types: struct WorkType { int *E; struct DoubleComplex *Wx; int *Wp; int *Lpattern; int *Diagonal_map; int n_row; int *Front_new1strow; int Pivrow[64]; struct DoubleComplex *Flublock; int *Frows; } *

variable_types: dusage double

variable_types: e int

variable_types: nrows int

variable_types: ncols int

variable_types: nel int

variable_types:
Rows
int *

variable_types:
Cols
int *

variable_types: row int

variable_types: col int

variable_types:
E
int *

variable_types: usage int

variable_types:
ep
struct Element { int cdeg; } *

user_defined_types: struct NumericType { double flops; int scale; int valid; union Unit_union *Memory; int ihead; int *Rperm; int ulen; struct DoubleComplex *D; int do_recip; double *Rs; int n_row; int tail_usage; int maxnrows; }


original_code:
long umfpack_dl_triplet_to_col
(
    long n_row,
    long n_col,
    long nz,
    const long Ti [ ],
    const long Tj [ ],
    const double Tx [ ],
    long Ap [ ],
    long Ai [ ],
    double Ax [ ]
    , long Map [ ]
)
{
    long *RowCount, *Rp, *Rj, *W, nn, do_values, do_map, *Map2, status ;
    double *Rx ;
    if (!Ai || !Ap || !Ti || !Tj)
    {
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 return ((-6)) ;
    }
    if (nz < 0)
    {
 return ((-8)) ;
    }
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    Rx = (double *) ((void *)0) ;
    do_values = Ax && Tx ;
    if (do_values)
    {
 Rx = (double *) umf_l_malloc (nz+1, sizeof (double)) ;
 if (!Rx)
 {
     ;
     ;
     return ((-1)) ;
 }
    }
    do_map = (Map != (long *) ((void *)0)) ;
    Map2 = (long *) ((void *)0) ;
    if (do_map)
    {
 ;
 Map2 = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
 if (!Map2)
 {
     ;
     (void) umf_l_free ((void *) Rx) ;
     ;
     return ((-1)) ;
 }
    }
    Rj = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
    Rp = (long *) umf_l_malloc (n_row+1, sizeof (long)) ;
    RowCount = (long *) umf_l_malloc (n_row, sizeof (long)) ;
    W = (long *) umf_l_malloc (nn, sizeof (long)) ;
    if (!Rj || !Rp || !RowCount || !W)
    {
 ;
 (void) umf_l_free ((void *) Rx) ;
 (void) umf_l_free ((void *) Map2) ;
 (void) umf_l_free ((void *) Rp) ;
 (void) umf_l_free ((void *) Rj) ;
 (void) umf_l_free ((void *) RowCount) ;
 (void) umf_l_free ((void *) W) ;
 ;
 return ((-1)) ;
    }
    ;
    if (do_map)
    {
 if (do_values)
 {
     status = umfdl_triplet_map_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Tx, Ax, Rx
  , Map, Map2) ;
 }
 else
 {
     status = umfdl_triplet_map_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Map, Map2) ;
 }
    }
    else
    {
 if (do_values)
 {
     status = umfdl_triplet_nomap_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount , Tx, Ax, Rx
  ) ;
 }
 else
 {
     status = umfdl_triplet_nomap_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai,
  Rp, Rj, W, RowCount) ;
 }
    }
    (void) umf_l_free ((void *) Rx) ;
    (void) umf_l_free ((void *) Map2) ;
    (void) umf_l_free ((void *) Rp) ;
    (void) umf_l_free ((void *) Rj) ;
    (void) umf_l_free ((void *) RowCount) ;
    (void) umf_l_free ((void *) W) ;
    ;
    return (status) ;
}

canonical_original_code:
long umfpack_dl_triplet_to_col(long n_row, long n_col, long nz, long Ti[], long Tj[], double Tx[], long Ap[], long Ai[], double Ax[], long Map[])
{
    long *RowCount; long *Rp; long *Rj; long *W; long nn; long do_values; long do_map; long *Map2; long status;
    double *Rx;
    if (!Ai || !Ap || !Ti || !Tj)
    {
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 return ((-6)) ;
    }
    if (nz < 0)
    {
 return ((-8)) ;
    }
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    Rx = (double *) ((void *)0) ;
    do_values = Ax && Tx ;
    if (do_values)
    {
 Rx = (double *) umf_l_malloc (nz+1, sizeof (double)) ;
 if (!Rx)
 {
     ;
     ;
     return ((-1)) ;
 }
    }
    do_map = (Map != (long *) ((void *)0)) ;
    Map2 = (long *) ((void *)0) ;
    if (do_map)
    {
 ;
 Map2 = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
 if (!Map2)
 {
     ;
     (void) umf_l_free ((void *) Rx) ;
     ;
     return ((-1)) ;
 }
    }
    Rj = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
    Rp = (long *) umf_l_malloc (n_row+1, sizeof (long)) ;
    RowCount = (long *) umf_l_malloc (n_row, sizeof (long)) ;
    W = (long *) umf_l_malloc (nn, sizeof (long)) ;
    if (!Rj || !Rp || !RowCount || !W)
    {
 ;
 (void) umf_l_free ((void *) Rx) ;
 (void) umf_l_free ((void *) Map2) ;
 (void) umf_l_free ((void *) Rp) ;
 (void) umf_l_free ((void *) Rj) ;
 (void) umf_l_free ((void *) RowCount) ;
 (void) umf_l_free ((void *) W) ;
 ;
 return ((-1)) ;
    }
    ;
    if (do_map)
    {
 if (do_values)
 {
     status = umfdl_triplet_map_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Tx, Ax, Rx
  , Map, Map2) ;
 }
 else
 {
     status = umfdl_triplet_map_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Map, Map2) ;
 }
    }
    else
    {
 if (do_values)
 {
     status = umfdl_triplet_nomap_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount , Tx, Ax, Rx
  ) ;
 }
 else
 {
     status = umfdl_triplet_nomap_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai,
  Rp, Rj, W, RowCount) ;
 }
    }
    (void) umf_l_free ((void *) Rx) ;
    (void) umf_l_free ((void *) Map2) ;
    (void) umf_l_free ((void *) Rp) ;
    (void) umf_l_free ((void *) Rj) ;
    (void) umf_l_free ((void *) RowCount) ;
    (void) umf_l_free ((void *) W) ;
    ;
    return (status) ;
}

variable_types: nz long

variable_types:
Ti
long []

variable_types:
Tj
long []

variable_types:
Tx
double []

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
Map
long []

variable_types:
RowCount
long *

variable_types:
Rp
long *

variable_types:
Rj
long *

variable_types:
W
long *

variable_types: nn long

variable_types: status long

variable_types:
Rx
double *


original_code:
int umfdi_mem_alloc_element
(
    NumericType *Numeric,
    int nrows,
    int ncols,
    int **Rows,
    int **Cols,
    double **C,
    int *size,
    Element **epout
)
{
    Element *ep ;
    Unit *p ;
    int i ;
    ;
    ;
    *size = ((((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (int) * ((ncols) + (nrows)))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (double) * ((ncols) * (nrows)))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    if (((!((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) != (((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1))))
    {
 return (0) ;
    }
    i = umfdi_mem_alloc_tail_block (Numeric, *size) ;
    (*size)++ ;
    if (!i)
    {
 ;
 return (0) ;
    }
    p = Numeric->Memory + i ;
    ep = (Element *) p ;
    ;
    p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
    *Cols = (int *) p ;
    *Rows = *Cols + ncols ;
    p += (((((sizeof (int) * (ncols + nrows))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
    *C = (double *) p ;
    ep->nrows = nrows ;
    ep->ncols = ncols ;
    ep->nrowsleft = nrows ;
    ep->ncolsleft = ncols ;
    ep->cdeg = 0 ;
    ep->rdeg = 0 ;
    ep->next = (-1) ;
    ;
    ;
    *epout = ep ;
    return (i) ;
}

canonical_original_code:
int umfdi_mem_alloc_element(struct NumericType *Numeric, int nrows, int ncols, int **Rows, int **Cols, double **C, int *size, struct Element **epout)
{
    struct Element *ep;
    union Unit_union *p;
    int i;
    ;
    ;
    *size = ((((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (int) * ((ncols) + (nrows)))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (double) * ((ncols) * (nrows)))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    if (((!((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) != (((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1))))
    {
 return (0) ;
    }
    i = umfdi_mem_alloc_tail_block (Numeric, *size) ;
    (*size)++ ;
    if (!i)
    {
 ;
 return (0) ;
    }
    p = Numeric->Memory + i ;
    ep = (struct Element *) p ;
    ;
    p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
    *Cols = (int *) p ;
    *Rows = *Cols + ncols ;
    p += (((((sizeof (int) * (ncols + nrows))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
    *C = (double *) p ;
    ep->nrows = nrows ;
    ep->ncols = ncols ;
    ep->nrowsleft = nrows ;
    ep->ncolsleft = ncols ;
    ep->cdeg = 0 ;
    ep->rdeg = 0 ;
    ep->next = (-1) ;
    ;
    ;
    *epout = ep ;
    return (i) ;
}

variable_types: struct NumericType { double flops; int scale; int valid; union Unit_union { struct { int size; } header; double xxxxxx; } *Memory; int ihead; int *Rperm; int ulen; double *D; int do_recip; double *Rs; int n_row; int tail_usage; int maxnrows; } *

variable_types: nrows int

variable_types: ncols int

variable_types:
Rows
int **

variable_types:
Cols
int **

variable_types:
C
double **

variable_types:
size
int *

variable_types:
epout
struct Element { int cdeg; } **

variable_types: i int


original_code:
long umfzl_kernel
(
    const long Ap [ ],
    const long Ai [ ],
    const double Ax [ ],
    const double Az [ ],
    NumericType *Numeric,
    WorkType *Work,
    SymbolicType *Symbolic
)
{
    long j, f1, f2, chain, nchains, *Chain_start, status, fixQ, evaporate,
 *Front_npivcol, jmax, nb, drop ;
    if (!umfzl_kernel_init (Ap, Ai, Ax,
 Az,
 Numeric, Work, Symbolic))
    {
 ;
 return ((-11)) ;
    }
    nchains = Symbolic->nchains ;
    Chain_start = Symbolic->Chain_start ;
    Front_npivcol = Symbolic->Front_npivcol ;
    nb = Symbolic->nb ;
    fixQ = Symbolic->fixQ ;
    drop = Numeric->droptol > 0.0 ;
    for (chain = 0 ; chain < nchains ; chain++)
    {
 f1 = Chain_start [chain] ;
 f2 = Chain_start [chain+1] - 1 ;
 { if (! (umfzl_start_front (chain, Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 for (Work->frontid = f1 ; Work->frontid <= f2 ; Work->frontid++)
 {
     Work->ncand = Front_npivcol [Work->frontid] ;
     Work->lo = Work->nextcand ;
     Work->hi = Work->nextcand + Work->ncand - 1 ;
     jmax = (((128) < (Work->ncand)) ? (128) : (Work->ncand)) ;
     ;
     if (fixQ)
     {
  jmax = 1 ;
     }
     ;
     for (j = 0 ; j < jmax ; j++)
     {
  ;
  ;
  Work->Candidates [j] = Work->nextcand++ ;
     }
     Work->nCandidates = jmax ;
     ;
     while (Work->ncand > 0)
     {
  status = umfzl_local_search (Numeric, Work, Symbolic) ;
  if (status == (-11))
  {
      ;
      return ((-11)) ;
  }
  if (status == (1))
  {
      continue ;
  }
  if (Work->do_update)
  {
      umfzl_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  if (Work->do_extend)
  {
      { if (! (umfzl_extend_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  else
  {
      { if (! (umfzl_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
      { if (! (umfzl_init_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  if (fixQ)
  {
      umfzl_assemble_fixq (Numeric, Work) ;
  }
  else
  {
      umfzl_assemble (Numeric, Work) ;
  }
  umfzl_scale_column (Numeric, Work) ;
  evaporate = Work->fnrows == 0 || Work->fncols == 0 ;
  if (Work->fnpiv >= nb || evaporate)
  {
      umfzl_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  Work->pivrow_in_front = (0) ;
  Work->pivcol_in_front = (0) ;
  if (evaporate)
  {
      (void) umfzl_create_element (Numeric, Work, Symbolic) ;
      Work->fnrows = 0 ;
      Work->fncols = 0 ;
  }
     }
 }
 umfzl_blas3_update (Work) ;
 if (drop)
 {
     { if (! (umfzl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
 }
 else
 {
     { if (! (umfzl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
 }
 Work->fnrows_new = Work->fnrows ;
 Work->fncols_new = Work->fncols ;
 { if (! (umfzl_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 Work->fnrows = 0 ;
 Work->fncols = 0 ;
    }
    umfzl_kernel_wrapup (Numeric, Symbolic, Work) ;
    return ((0)) ;
}

canonical_original_code:
long umfzl_kernel(long Ap[], long Ai[], double Ax[], double Az[], struct NumericType *Numeric, struct WorkType *Work, struct SymbolicType *Symbolic)
{
    long j; long f1; long f2; long chain; long nchains; long *Chain_start; long status; long fixQ; long evaporate; long *Front_npivcol; long jmax; long nb; long drop;
    if (!umfzl_kernel_init (Ap, Ai, Ax,
 Az,
 Numeric, Work, Symbolic))
    {
 ;
 return ((-11)) ;
    }
    nchains = Symbolic->nchains ;
    Chain_start = Symbolic->Chain_start ;
    Front_npivcol = Symbolic->Front_npivcol ;
    nb = Symbolic->nb ;
    fixQ = Symbolic->fixQ ;
    drop = Numeric->droptol > 0.0 ;
    for (chain = 0 ; chain < nchains ; chain++)
    {
 f1 = Chain_start [chain] ;
 f2 = Chain_start [chain+1] - 1 ;
 { if (! (umfzl_start_front (chain, Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 for (Work->frontid = f1 ; Work->frontid <= f2 ; Work->frontid++)
 {
     Work->ncand = Front_npivcol [Work->frontid] ;
     Work->lo = Work->nextcand ;
     Work->hi = Work->nextcand + Work->ncand - 1 ;
     jmax = (((128) < (Work->ncand)) ? (128) : (Work->ncand)) ;
     ;
     if (fixQ)
     {
  jmax = 1 ;
     }
     ;
     for (j = 0 ; j < jmax ; j++)
     {
  ;
  ;
  Work->Candidates [j] = Work->nextcand++ ;
     }
     Work->nCandidates = jmax ;
     ;
     while (Work->ncand > 0)
     {
  status = umfzl_local_search (Numeric, Work, Symbolic) ;
  if (status == (-11))
  {
      ;
      return ((-11)) ;
  }
  if (status == (1))
  {
      continue ;
  }
  if (Work->do_update)
  {
      umfzl_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  if (Work->do_extend)
  {
      { if (! (umfzl_extend_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  else
  {
      { if (! (umfzl_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
      { if (! (umfzl_init_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  if (fixQ)
  {
      umfzl_assemble_fixq (Numeric, Work) ;
  }
  else
  {
      umfzl_assemble (Numeric, Work) ;
  }
  umfzl_scale_column (Numeric, Work) ;
  evaporate = Work->fnrows == 0 || Work->fncols == 0 ;
  if (Work->fnpiv >= nb || evaporate)
  {
      umfzl_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  Work->pivrow_in_front = (0) ;
  Work->pivcol_in_front = (0) ;
  if (evaporate)
  {
      (void) umfzl_create_element (Numeric, Work, Symbolic) ;
      Work->fnrows = 0 ;
      Work->fncols = 0 ;
  }
     }
 }
 umfzl_blas3_update (Work) ;
 if (drop)
 {
     { if (! (umfzl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
 }
 else
 {
     { if (! (umfzl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
 }
 Work->fnrows_new = Work->fnrows ;
 Work->fncols_new = Work->fncols ;
 { if (! (umfzl_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 Work->fnrows = 0 ;
 Work->fncols = 0 ;
    }
    umfzl_kernel_wrapup (Numeric, Symbolic, Work) ;
    return ((0)) ;
}

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
Az
double []

variable_types: struct NumericType { double flops; long scale; long valid; union Unit_union { struct { long size; } header; double xxxxxx; } *Memory; long ihead; long *Rperm; long ulen; struct DoubleComplex { double component[2]; } *D; long do_recip; double *Rs; long n_row; long tail_usage; long maxnrows; } *

variable_types: struct WorkType { long *E; struct DoubleComplex *Wx; long *Wp; long *Lpattern; long *Diagonal_map; long n_row; long *Front_new1strow; long Pivrow[64]; struct DoubleComplex *Flublock; long *Frows; } *

variable_types: struct SymbolicType { double num_mem_usage_est; long valid; } *

variable_types: j long

variable_types: chain long

variable_types: nchains long

variable_types: fixQ long

variable_types: evaporate long

variable_types: jmax long

variable_types: nb long

variable_types: drop long

user_defined_types: struct NumericType { double flops; long scale; long valid; union Unit_union *Memory; long ihead; long *Rperm; long ulen; struct DoubleComplex *D; long do_recip; double *Rs; long n_row; long tail_usage; long maxnrows; }


decompiled_code:
__int64 __fastcall umfzi_kernel(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, _DWORD *a6, __int64 a7)
{
int v9; // eax
int v10; // er15
int v11; // er14
int v12; // er13
int v13; // eax
int v14; // edx
int v15; // esi
__int64 v16; // rax
int v17; // ecx
__int64 result; // rax
bool v19; // r13
double v20; // [rsp+8h] [rbp-68h]
int v21; // [rsp+14h] [rbp-5Ch]
__int64 v22; // [rsp+18h] [rbp-58h]
__int64 v23; // [rsp+20h] [rbp-50h]
__int64 v24; // [rsp+28h] [rbp-48h]
__int64 v25; // [rsp+30h] [rbp-40h]

if ( !(unsigned int)umfzi_kernel_init(a1) )
return 4294967285LL;
v9 = *(_DWORD *)(a7 + 64);
v24 = *(_QWORD *)(a7 + 72);
v22 = *(_QWORD *)(a7 + 104);
v10 = *(_DWORD *)(a7 + 220);
v11 = *(_DWORD *)(a7 + 244);
v20 = *(double *)(a5 + 24);
if ( v9 <= 0 )
{
LABEL_37:
umfzi_kernel_wrapup(a5, a7, a6);
return 0LL;
}
v25 = (unsigned int)v9;
v23 = 0LL;
while ( 2 )
{
v12 = *(_DWORD *)(v24 + 4 * v23);
v21 = *(_DWORD *)(v24 + 4 * v23 + 4);
if ( !(unsigned int)umfzi_start_front((unsigned int)v23, a5, a6, a7) )
return 0xFFFFFFFFLL;
a6[195] = v12;
if ( v21 <= v12 )
goto LABEL_33;
while ( 2 )
{
v13 = *(_DWORD *)(v22 + 4LL * v12);
a6[181] = v13;
v14 = a6[182];
a6[183] = v14;
a6[184] = v13 + v14 - 1;
if ( v11 )
{
v15 = 1;
}
else
{
v15 = 128;
if ( v13 <= 128 )
v15 = v13;
if ( v13 <= 0 )
goto LABEL_15;
}
v16 = 0LL;
do
{
v17 = v14++;
a6[v16++ + 49] = v17;
}
while ( v15 > (int)v16 );
a6[182] = v14;
LABEL_15:
a6[177] = v15;
while ( (int)a6[181] > 0 )
{
result = umfzi_local_search(a5, a6, a7);
if ( (_DWORD)result == -11 )
return result;
if ( (_DWORD)result != 1 )
{
if ( a6[188] )
{
umfzi_blas3_update(a6);
if ( v20 <= 0.0 )
{
if ( !(unsigned int)umfzi_store_lu(a5, a6) )
return 0xFFFFFFFFLL;
}
else if ( !(unsigned int)umfzi_store_lu_drop(a5, a6) )
{
return 0xFFFFFFFFLL;
}
}
if ( a6[187] )
{
if ( !(unsigned int)umfzi_extend_front(a5, a6) )
return 0xFFFFFFFFLL;
}
else
{
if ( !(unsigned int)umfzi_create_element(a5, a6, a7) )
return 0xFFFFFFFFLL;
if ( !(unsigned int)umfzi_init_front(a5, a6) )
return 0xFFFFFFFFLL;
}
if ( v11 )
umfzi_assemble_fixq(a5, a6);
else
umfzi_assemble(a5, a6);
umfzi_scale_column(a5, a6);
if ( !a6[344] )
{
v19 = 1;
goto LABEL_26;
}
v19 = a6[345] == 0;
if ( a6[352] < v10 && a6[345] )
{
a6[358] = 0;
a6[359] = 0;
}
else
{
LABEL_26:
umfzi_blas3_update(a6);
if ( v20 <= 0.0 )
{
if ( !(unsigned int)umfzi_store_lu(a5, a6) )
return 0xFFFFFFFFLL;
}
else if ( !(unsigned int)umfzi_store_lu_drop(a5, a6) )
{
return 0xFFFFFFFFLL;
}
a6[358] = 0;
a6[359] = 0;
if ( v19 )
{
umfzi_create_element(a5, a6, a7);
a6[344] = 0;
a6[345] = 0;
}
}
}
}
v12 = a6[195] + 1;
a6[195] = v12;
if ( v21 > v12 )
continue;
break;
}
LABEL_33:
umfzi_blas3_update(a6);
if ( v20 <= 0.0 )
{
if ( !(unsigned int)umfzi_store_lu(a5, a6) )
return 0xFFFFFFFFLL;
LABEL_35:
a6[356] = a6[344];
a6[357] = a6[345];
if ( !(unsigned int)umfzi_create_element(a5, a6, a7) )
return 0xFFFFFFFFLL;
a6[344] = 0;
a6[345] = 0;
if ( v25 == ++v23 )
goto LABEL_37;
continue;
}
break;
}
if ( (unsigned int)umfzi_store_lu_drop(a5, a6) )
goto LABEL_35;
return 0xFFFFFFFFLL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, _DWORD *a6, __int64 a7)
{
int v9; // eax
int v10; // er15
int v11; // er14
int v12; // er13
int v13; // eax
int v14; // edx
int v15; // esi
__int64 v16; // rax
int v17; // ecx
__int64 result; // rax
bool v19; // r13
double v20; // [rsp+8h] [rbp-68h]
int v21; // [rsp+14h] [rbp-5Ch]
__int64 v22; // [rsp+18h] [rbp-58h]
__int64 v23; // [rsp+20h] [rbp-50h]
__int64 v24; // [rsp+28h] [rbp-48h]
__int64 v25; // [rsp+30h] [rbp-40h]

if ( !(unsigned int)umfzi_kernel_init(a1) )
return 4294967285LL;
v9 = *(_DWORD *)(a7 + 64);
v24 = *(_QWORD *)(a7 + 72);
v22 = *(_QWORD *)(a7 + 104);
v10 = *(_DWORD *)(a7 + 220);
v11 = *(_DWORD *)(a7 + 244);
v20 = *(double *)(a5 + 24);
if ( v9 <= 0 )
{
LABEL_37:
umfzi_kernel_wrapup(a5, a7, a6);
return 0LL;
}
v25 = (unsigned int)v9;
v23 = 0LL;
while ( 2 )
{
v12 = *(_DWORD *)(v24 + 4 * v23);
v21 = *(_DWORD *)(v24 + 4 * v23 + 4);
if ( !(unsigned int)umfzi_start_front((unsigned int)v23, a5, a6, a7) )
return 0xFFFFFFFFLL;
a6[195] = v12;
if ( v21 <= v12 )
goto LABEL_33;
while ( 2 )
{
v13 = *(_DWORD *)(v22 + 4LL * v12);
a6[181] = v13;
v14 = a6[182];
a6[183] = v14;
a6[184] = v13 + v14 - 1;
if ( v11 )
{
v15 = 1;
}
else
{
v15 = 128;
if ( v13 <= 128 )
v15 = v13;
if ( v13 <= 0 )
goto LABEL_15;
}
v16 = 0LL;
do
{
v17 = v14++;
a6[v16++ + 49] = v17;
}
while ( v15 > (int)v16 );
a6[182] = v14;
LABEL_15:
a6[177] = v15;
while ( (int)a6[181] > 0 )
{
result = umfzi_local_search(a5, a6, a7);
if ( (_DWORD)result == -11 )
return result;
if ( (_DWORD)result != 1 )
{
if ( a6[188] )
{
umfzi_blas3_update(a6);
if ( v20 <= 0.0 )
{
if ( !(unsigned int)umfzi_store_lu(a5, a6) )
return 0xFFFFFFFFLL;
}
else if ( !(unsigned int)umfzi_store_lu_drop(a5, a6) )
{
return 0xFFFFFFFFLL;
}
}
if ( a6[187] )
{
if ( !(unsigned int)umfzi_extend_front(a5, a6) )
return 0xFFFFFFFFLL;
}
else
{
if ( !(unsigned int)umfzi_create_element(a5, a6, a7) )
return 0xFFFFFFFFLL;
if ( !(unsigned int)umfzi_init_front(a5, a6) )
return 0xFFFFFFFFLL;
}
if ( v11 )
umfzi_assemble_fixq(a5, a6);
else
umfzi_assemble(a5, a6);
umfzi_scale_column(a5, a6);
if ( !a6[344] )
{
v19 = 1;
goto LABEL_26;
}
v19 = a6[345] == 0;
if ( a6[352] < v10 && a6[345] )
{
a6[358] = 0;
a6[359] = 0;
}
else
{
LABEL_26:
umfzi_blas3_update(a6);
if ( v20 <= 0.0 )
{
if ( !(unsigned int)umfzi_store_lu(a5, a6) )
return 0xFFFFFFFFLL;
}
else if ( !(unsigned int)umfzi_store_lu_drop(a5, a6) )
{
return 0xFFFFFFFFLL;
}
a6[358] = 0;
a6[359] = 0;
if ( v19 )
{
umfzi_create_element(a5, a6, a7);
a6[344] = 0;
a6[345] = 0;
}
}
}
}
v12 = a6[195] + 1;
a6[195] = v12;
if ( v21 > v12 )
continue;
break;
}
LABEL_33:
umfzi_blas3_update(a6);
if ( v20 <= 0.0 )
{
if ( !(unsigned int)umfzi_store_lu(a5, a6) )
return 0xFFFFFFFFLL;
LABEL_35:
a6[356] = a6[344];
a6[357] = a6[345];
if ( !(unsigned int)umfzi_create_element(a5, a6, a7) )
return 0xFFFFFFFFLL;
a6[344] = 0;
a6[345] = 0;
if ( v25 == ++v23 )
goto LABEL_37;
continue;
}
break;
}
if ( (unsigned int)umfzi_store_lu_drop(a5, a6) )
goto LABEL_35;
return 0xFFFFFFFFLL;
}

original_code:
int umfzi_kernel
(
    const int Ap [ ],
    const int Ai [ ],
    const double Ax [ ],
    const double Az [ ],
    NumericType *Numeric,
    WorkType *Work,
    SymbolicType *Symbolic
)
{
    int j, f1, f2, chain, nchains, *Chain_start, status, fixQ, evaporate,
 *Front_npivcol, jmax, nb, drop ;
    if (!umfzi_kernel_init (Ap, Ai, Ax,
 Az,
 Numeric, Work, Symbolic))
    {
 ;
 return ((-11)) ;
    }
    nchains = Symbolic->nchains ;
    Chain_start = Symbolic->Chain_start ;
    Front_npivcol = Symbolic->Front_npivcol ;
    nb = Symbolic->nb ;
    fixQ = Symbolic->fixQ ;
    drop = Numeric->droptol > 0.0 ;
    for (chain = 0 ; chain < nchains ; chain++)
    {
 f1 = Chain_start [chain] ;
 f2 = Chain_start [chain+1] - 1 ;
 { if (! (umfzi_start_front (chain, Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 for (Work->frontid = f1 ; Work->frontid <= f2 ; Work->frontid++)
 {
     Work->ncand = Front_npivcol [Work->frontid] ;
     Work->lo = Work->nextcand ;
     Work->hi = Work->nextcand + Work->ncand - 1 ;
     jmax = (((128) < (Work->ncand)) ? (128) : (Work->ncand)) ;
     ;
     if (fixQ)
     {
  jmax = 1 ;
     }
     ;
     for (j = 0 ; j < jmax ; j++)
     {
  ;
  ;
  Work->Candidates [j] = Work->nextcand++ ;
     }
     Work->nCandidates = jmax ;
     ;
     while (Work->ncand > 0)
     {
  status = umfzi_local_search (Numeric, Work, Symbolic) ;
  if (status == (-11))
  {
      ;
      return ((-11)) ;
  }
  if (status == (1))
  {
      continue ;
  }
  if (Work->do_update)
  {
      umfzi_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  if (Work->do_extend)
  {
      { if (! (umfzi_extend_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  else
  {
      { if (! (umfzi_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
      { if (! (umfzi_init_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  if (fixQ)
  {
      umfzi_assemble_fixq (Numeric, Work) ;
  }
  else
  {
      umfzi_assemble (Numeric, Work) ;
  }
  umfzi_scale_column (Numeric, Work) ;
  evaporate = Work->fnrows == 0 || Work->fncols == 0 ;
  if (Work->fnpiv >= nb || evaporate)
  {
      umfzi_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  Work->pivrow_in_front = (0) ;
  Work->pivcol_in_front = (0) ;
  if (evaporate)
  {
      (void) umfzi_create_element (Numeric, Work, Symbolic) ;
      Work->fnrows = 0 ;
      Work->fncols = 0 ;
  }
     }
 }
 umfzi_blas3_update (Work) ;
 if (drop)
 {
     { if (! (umfzi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
 }
 else
 {
     { if (! (umfzi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
 }
 Work->fnrows_new = Work->fnrows ;
 Work->fncols_new = Work->fncols ;
 { if (! (umfzi_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 Work->fnrows = 0 ;
 Work->fncols = 0 ;
    }
    umfzi_kernel_wrapup (Numeric, Symbolic, Work) ;
    return ((0)) ;
}

canonical_original_code:
int umfzi_kernel(int Ap[], int Ai[], double Ax[], double Az[], struct NumericType *Numeric, struct WorkType *Work, struct SymbolicType *Symbolic)
{
    int j; int f1; int f2; int chain; int nchains; int *Chain_start; int status; int fixQ; int evaporate; int *Front_npivcol; int jmax; int nb; int drop;
    if (!umfzi_kernel_init (Ap, Ai, Ax,
 Az,
 Numeric, Work, Symbolic))
    {
 ;
 return ((-11)) ;
    }
    nchains = Symbolic->nchains ;
    Chain_start = Symbolic->Chain_start ;
    Front_npivcol = Symbolic->Front_npivcol ;
    nb = Symbolic->nb ;
    fixQ = Symbolic->fixQ ;
    drop = Numeric->droptol > 0.0 ;
    for (chain = 0 ; chain < nchains ; chain++)
    {
 f1 = Chain_start [chain] ;
 f2 = Chain_start [chain+1] - 1 ;
 { if (! (umfzi_start_front (chain, Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 for (Work->frontid = f1 ; Work->frontid <= f2 ; Work->frontid++)
 {
     Work->ncand = Front_npivcol [Work->frontid] ;
     Work->lo = Work->nextcand ;
     Work->hi = Work->nextcand + Work->ncand - 1 ;
     jmax = (((128) < (Work->ncand)) ? (128) : (Work->ncand)) ;
     ;
     if (fixQ)
     {
  jmax = 1 ;
     }
     ;
     for (j = 0 ; j < jmax ; j++)
     {
  ;
  ;
  Work->Candidates [j] = Work->nextcand++ ;
     }
     Work->nCandidates = jmax ;
     ;
     while (Work->ncand > 0)
     {
  status = umfzi_local_search (Numeric, Work, Symbolic) ;
  if (status == (-11))
  {
      ;
      return ((-11)) ;
  }
  if (status == (1))
  {
      continue ;
  }
  if (Work->do_update)
  {
      umfzi_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  if (Work->do_extend)
  {
      { if (! (umfzi_extend_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  else
  {
      { if (! (umfzi_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
      { if (! (umfzi_init_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  if (fixQ)
  {
      umfzi_assemble_fixq (Numeric, Work) ;
  }
  else
  {
      umfzi_assemble (Numeric, Work) ;
  }
  umfzi_scale_column (Numeric, Work) ;
  evaporate = Work->fnrows == 0 || Work->fncols == 0 ;
  if (Work->fnpiv >= nb || evaporate)
  {
      umfzi_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  Work->pivrow_in_front = (0) ;
  Work->pivcol_in_front = (0) ;
  if (evaporate)
  {
      (void) umfzi_create_element (Numeric, Work, Symbolic) ;
      Work->fnrows = 0 ;
      Work->fncols = 0 ;
  }
     }
 }
 umfzi_blas3_update (Work) ;
 if (drop)
 {
     { if (! (umfzi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
 }
 else
 {
     { if (! (umfzi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
 }
 Work->fnrows_new = Work->fnrows ;
 Work->fncols_new = Work->fncols ;
 { if (! (umfzi_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 Work->fnrows = 0 ;
 Work->fncols = 0 ;
    }
    umfzi_kernel_wrapup (Numeric, Symbolic, Work) ;
    return ((0)) ;
}

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types: struct NumericType { double flops; int scale; int valid; union Unit_union { struct { int size; } header; double xxxxxx; } *Memory; int ihead; int *Rperm; int ulen; struct DoubleComplex { double component[2]; } *D; int do_recip; double *Rs; int n_row; int tail_usage; int maxnrows; } *

variable_types: struct WorkType { int *E; struct DoubleComplex *Wx; int *Wp; int *Lpattern; int *Diagonal_map; int n_row; int *Front_new1strow; int Pivrow[64]; struct DoubleComplex *Flublock; int *Frows; } *

variable_types: struct SymbolicType { double num_mem_usage_est; int valid; } *

variable_types: j int

variable_types: chain int

variable_types: nchains int

variable_types: status int

variable_types: fixQ int

variable_types: evaporate int

variable_types: jmax int

variable_types: nb int

variable_types: drop int


original_code:
int umfdi_get_memory
(
    NumericType *Numeric,
    WorkType *Work,
    int needunits,
    int r2,
    int c2,
    int do_Fcpos
)
{
    double nsize, bsize, tsize ;
    int i, minsize, newsize, newmem, costly, row, col, *Row_tlen, *Col_tlen,
 n_row, n_col, *Row_degree, *Col_degree ;
    Unit *mnew, *p ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    Row_degree = Numeric->Rperm ;
    Col_degree = Numeric->Cperm ;
    Row_tlen = Numeric->Uilen ;
    Col_tlen = Numeric->Lilen ;
    for (row = 0 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     Row_tlen [row] = 0 ;
 }
    }
    for (col = 0 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0))
 {
     Col_tlen [col] = 0 ;
 }
    }
    nsize = (double) needunits + 2 ;
    needunits += umfdi_tuple_lengths (Numeric, Work, &tsize) ;
    nsize += tsize ;
    needunits += 2 ;
    ;
    minsize = Numeric->size + needunits ;
    nsize += (double) Numeric->size ;
    bsize = ((double) 0x7fffffff) / sizeof (Unit) - 1 ;
    newsize = (int) ((1.2) * ((double) minsize)) ;
    nsize *= (1.2) ;
    nsize += 1 ;
    if (newsize < 0 || nsize > bsize)
    {
 ;
 newsize = (int) bsize ;
    }
    else
    {
 ;
 newsize = (((newsize) > (minsize)) ? (newsize) : (minsize)) ;
    }
    newsize = (((newsize) > (Numeric->size)) ? (newsize) : (Numeric->size)) ;
    ;
    Numeric->ibig = (-1) ;
    ;
    mnew = (Unit *) ((void *)0) ;
    while (!mnew)
    {
 mnew = (Unit *) umf_i_realloc (Numeric->Memory, newsize, sizeof (Unit)) ;
 if (!mnew)
 {
     if (newsize == minsize)
     {
  mnew = Numeric->Memory ;
  newsize = Numeric->size ;
     }
     else
     {
  newsize = (int) ((0.95) * ((double) newsize)) ;
  newsize = (((minsize) > (newsize)) ? (minsize) : (newsize)) ;
     }
 }
    }
    ;
    costly = (mnew != Numeric->Memory) ;
    Numeric->Memory = mnew ;
    if (Work->E [0])
    {
 int nb, dr, dc ;
 nb = Work->nb ;
 dr = Work->fnr_curr ;
 dc = Work->fnc_curr ;
 Work->Flublock = (double *) (Numeric->Memory + Work->E [0]) ;
 Work->Flblock = Work->Flublock + nb * nb ;
 Work->Fublock = Work->Flblock + dr * nb ;
 Work->Fcblock = Work->Fublock + nb * dc ;
 ;
    }
    ;
    newmem = newsize - Numeric->size ;
    ;
    if (newmem >= 2)
    {
 p = Numeric->Memory + Numeric->size - 2 ;
 p->header.size = newmem - 1 ;
 i = Numeric->size - 1 ;
 p += newmem ;
 p->header.prevsize = newmem - 1 ;
 p->header.size = 1 ;
 Numeric->size = newsize ;
 umfdi_mem_free_tail_block (Numeric, i) ;
 Numeric->nrealloc++ ;
 if (costly)
 {
     Numeric->ncostly++ ;
 }
    }
    ;
    umfdi_garbage_collection (Numeric, Work, r2, c2, do_Fcpos) ;
    return (umfdi_build_tuples (Numeric, Work)) ;
}

canonical_original_code:
int umfdi_get_memory(struct NumericType *Numeric, struct WorkType *Work, int needunits, int r2, int c2, int do_Fcpos)
{
    double nsize; double bsize; double tsize;
    int i; int minsize; int newsize; int newmem; int costly; int row; int col; int *Row_tlen; int *Col_tlen; int n_row; int n_col; int *Row_degree; int *Col_degree;
    union Unit_union *mnew; union Unit_union *p;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    Row_degree = Numeric->Rperm ;
    Col_degree = Numeric->Cperm ;
    Row_tlen = Numeric->Uilen ;
    Col_tlen = Numeric->Lilen ;
    for (row = 0 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     Row_tlen [row] = 0 ;
 }
    }
    for (col = 0 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0))
 {
     Col_tlen [col] = 0 ;
 }
    }
    nsize = (double) needunits + 2 ;
    needunits += umfdi_tuple_lengths (Numeric, Work, &tsize) ;
    nsize += tsize ;
    needunits += 2 ;
    ;
    minsize = Numeric->size + needunits ;
    nsize += (double) Numeric->size ;
    bsize = ((double) 0x7fffffff) / sizeof (Unit) - 1 ;
    newsize = (int) ((1.2) * ((double) minsize)) ;
    nsize *= (1.2) ;
    nsize += 1 ;
    if (newsize < 0 || nsize > bsize)
    {
 ;
 newsize = (int) bsize ;
    }
    else
    {
 ;
 newsize = (((newsize) > (minsize)) ? (newsize) : (minsize)) ;
    }
    newsize = (((newsize) > (Numeric->size)) ? (newsize) : (Numeric->size)) ;
    ;
    Numeric->ibig = (-1) ;
    ;
    mnew = (union Unit_union *) ((void *)0) ;
    while (!mnew)
    {
 mnew = (union Unit_union *) umf_i_realloc (Numeric->Memory, newsize, sizeof (Unit)) ;
 if (!mnew)
 {
     if (newsize == minsize)
     {
  mnew = Numeric->Memory ;
  newsize = Numeric->size ;
     }
     else
     {
  newsize = (int) ((0.95) * ((double) newsize)) ;
  newsize = (((minsize) > (newsize)) ? (minsize) : (newsize)) ;
     }
 }
    }
    ;
    costly = (mnew != Numeric->Memory) ;
    Numeric->Memory = mnew ;
    if (Work->E [0])
    {
 int nb; int dr; int dc;
 nb = Work->nb ;
 dr = Work->fnr_curr ;
 dc = Work->fnc_curr ;
 Work->Flublock = (double *) (Numeric->Memory + Work->E [0]) ;
 Work->Flblock = Work->Flublock + nb * nb ;
 Work->Fublock = Work->Flblock + dr * nb ;
 Work->Fcblock = Work->Fublock + nb * dc ;
 ;
    }
    ;
    newmem = newsize - Numeric->size ;
    ;
    if (newmem >= 2)
    {
 p = Numeric->Memory + Numeric->size - 2 ;
 p->header.size = newmem - 1 ;
 i = Numeric->size - 1 ;
 p += newmem ;
 p->header.prevsize = newmem - 1 ;
 p->header.size = 1 ;
 Numeric->size = newsize ;
 umfdi_mem_free_tail_block (Numeric, i) ;
 Numeric->nrealloc++ ;
 if (costly)
 {
     Numeric->ncostly++ ;
 }
    }
    ;
    umfdi_garbage_collection (Numeric, Work, r2, c2, do_Fcpos) ;
    return (umfdi_build_tuples (Numeric, Work)) ;
}

variable_types: struct NumericType { double flops; int scale; int valid; union Unit_union { struct { int size; } header; double xxxxxx; } *Memory; int ihead; int *Rperm; int ulen; double *D; int do_recip; double *Rs; int n_row; int tail_usage; int maxnrows; } *

variable_types: struct WorkType { int *E; double *Wx; int *Wp; int *Lpattern; int *Diagonal_map; int n_row; int *Front_new1strow; int Pivrow[64]; double *Flublock; int *Frows; } *

variable_types: needunits int

variable_types: nsize double

variable_types: bsize double

variable_types: tsize double

variable_types: i int

variable_types: minsize int

variable_types: newsize int

variable_types: newmem int

variable_types: costly int

variable_types: row int

variable_types: col int

variable_types: dr int

variable_types: dc int


original_code:
void umfzl_scale
(
    long n,
    DoubleComplex pivot,
    DoubleComplex X [ ]
)
{
    DoubleComplex x ;
    double s ;
    long i ;
    { (s) = (((((pivot).component [0]) < 0.)) ? -((pivot).component [0]) : ((pivot).component [0])) + (((((pivot).component [1]) < 0.)) ? -((pivot).component [1]) : ((pivot).component [1])) ; } ;
    if (s < 1e-12 || ((((pivot).component [0]) != ((pivot).component [0])) || (((pivot).component [1]) != ((pivot).component [1]))))
    {
 for (i = 0 ; i < n ; i++)
 {
     x = X [i] ;
     if (((((x).component [0]) != 0.) || (((x).component [1]) != 0.)))
     {
  { (void) umfpack_divcomplex ((x).component [0], (x).component [1], (pivot).component [0], (pivot).component [1], &((X [i]).component [0]), &((X [i]).component [1])) ; } ;
     }
 }
    }
    else
    {
 for (i = 0 ; i < n ; i++)
 {
     x = X [i] ;
     { (void) umfpack_divcomplex ((x).component [0], (x).component [1], (pivot).component [0], (pivot).component [1], &((X [i]).component [0]), &((X [i]).component [1])) ; } ;
 }
    }
}

canonical_original_code:
void umfzl_scale(long n, struct DoubleComplex pivot, struct DoubleComplex X[])
{
    struct DoubleComplex x;
    double s;
    long i;
    { (s) = (((((pivot).component [0]) < 0.)) ? -((pivot).component [0]) : ((pivot).component [0])) + (((((pivot).component [1]) < 0.)) ? -((pivot).component [1]) : ((pivot).component [1])) ; } ;
    if (s < 1e-12 || ((((pivot).component [0]) != ((pivot).component [0])) || (((pivot).component [1]) != ((pivot).component [1]))))
    {
 for (i = 0 ; i < n ; i++)
 {
     x = X [i] ;
     if (((((x).component [0]) != 0.) || (((x).component [1]) != 0.)))
     {
  { (void) umfpack_divcomplex ((x).component [0], (x).component [1], (pivot).component [0], (pivot).component [1], &((X [i]).component [0]), &((X [i]).component [1])) ; } ;
     }
 }
    }
    else
    {
 for (i = 0 ; i < n ; i++)
 {
     x = X [i] ;
     { (void) umfpack_divcomplex ((x).component [0], (x).component [1], (pivot).component [0], (pivot).component [1], &((X [i]).component [0]), &((X [i]).component [1])) ; } ;
 }
    }
}

variable_types: n long

variable_types: struct DoubleComplex { double component[2]; }

variable_types:
X
struct DoubleComplex []

variable_types: s double

variable_types: i long


decompiled_code:
__int64 __fastcall umfdl_report_vector(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6)
{
__int64 i; // rbx
__int64 result; // rax
__int64 v12; // r15
__int64 v13; // rbx
bool v14; // [rsp+Fh] [rbp-39h]

v14 = a4 > 3 || a5 != 0;
if ( !v14 )
goto LABEL_10;
if ( amd_printf )
amd_printf("dense vector, n = %ld. ", a1);
if ( !a5 )
{
LABEL_8:
if ( amd_printf )
amd_printf("\n");
LABEL_10:
if ( a4 == 4 )
{
v12 = 10LL;
if ( a1 <= 10 )
v12 = a1;
if ( a1 > 0 )
{
v13 = 0LL;
do
print_value(v13++, a2, a3, a6);
while ( v12 > v13 );
}
if ( a1 > v12 )
{
if ( amd_printf )
amd_printf(" ...\n");
print_value(a1 - 1, a2, a3, a6);
}
}
else
{
if ( a4 > 4 && a1 > 0 )
{
for ( i = 0LL; i != a1; ++i )
print_value(i, a2, a3, a6);
}
if ( a4 <= 3 )
{
if ( !v14 )
return 0LL;
LABEL_34:
if ( amd_printf )
amd_printf("OK\n\n");
return 0LL;
}
}
result = 0LL;
if ( !amd_printf )
return result;
amd_printf(" dense vector ");
goto LABEL_34;
}
if ( a2 )
{
if ( a1 >= 0 )
{
if ( a4 <= 3 )
goto LABEL_10;
goto LABEL_8;
}
result = -6LL;
if ( amd_printf )
{
amd_printf("ERROR: length of vector is < 0\n\n");
result = -6LL;
}
}
else
{
result = -5LL;
if ( amd_printf )
{
amd_printf("ERROR: vector not present\n\n");
result = -5LL;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6)
{
__int64 i; // rbx
__int64 result; // rax
__int64 v12; // r15
__int64 v13; // rbx
bool v14; // [rsp+Fh] [rbp-39h]

v14 = a4 > 3 || a5 != 0;
if ( !v14 )
goto LABEL_10;
if ( amd_printf )
amd_printf("dense vector, n = %ld. ", a1);
if ( !a5 )
{
LABEL_8:
if ( amd_printf )
amd_printf("\n");
LABEL_10:
if ( a4 == 4 )
{
v12 = 10LL;
if ( a1 <= 10 )
v12 = a1;
if ( a1 > 0 )
{
v13 = 0LL;
do
print_value(v13++, a2, a3, a6);
while ( v12 > v13 );
}
if ( a1 > v12 )
{
if ( amd_printf )
amd_printf(" ...\n");
print_value(a1 - 1, a2, a3, a6);
}
}
else
{
if ( a4 > 4 && a1 > 0 )
{
for ( i = 0LL; i != a1; ++i )
print_value(i, a2, a3, a6);
}
if ( a4 <= 3 )
{
if ( !v14 )
return 0LL;
LABEL_34:
if ( amd_printf )
amd_printf("OK\n\n");
return 0LL;
}
}
result = 0LL;
if ( !amd_printf )
return result;
amd_printf(" dense vector ");
goto LABEL_34;
}
if ( a2 )
{
if ( a1 >= 0 )
{
if ( a4 <= 3 )
goto LABEL_10;
goto LABEL_8;
}
result = -6LL;
if ( amd_printf )
{
amd_printf("ERROR: length of vector is < 0\n\n");
result = -6LL;
}
}
else
{
result = -5LL;
if ( amd_printf )
{
amd_printf("ERROR: vector not present\n\n");
result = -5LL;
}
}
return result;
}

original_code:
long umfdl_report_vector
(
    long n,
    const double Xx [ ],
    const double Xz [ ],
    long prl,
    long user,
    long scalar
)
{
    long n2, i ;
    if (user || prl >= 4)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("dense vector, n = ""%" "ld"". ", n) ; } ;
    }
    if (user)
    {
 if (!Xx)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: vector not present\n\n") ; } ;
     return ((-5)) ;
 }
 if (n < 0)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: length of vector is < 0\n\n") ; } ;
     return ((-6)) ;
 }
    }
    if (user || prl >= 4)
    {
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    }
    if (prl == 4)
    {
 n2 = (((10) < (n)) ? (10) : (n)) ;
 for (i = 0 ; i < n2 ; i++)
 {
     print_value (i, Xx, Xz, scalar) ;
 }
 if (n2 < n)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("    ...\n") ; } ;
     print_value (n-1, Xx, Xz, scalar) ;
 }
    }
    else if (prl > 4)
    {
 for (i = 0 ; i < n ; i++)
 {
     print_value (i, Xx, Xz, scalar) ;
 }
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    dense vector ") ; } ; } } ;
    if (user || prl >= 4)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    }
    return ((0)) ;
}

canonical_original_code:
long umfdl_report_vector(long n, double Xx[], double Xz[], long prl, long user, long scalar)
{
    long n2; long i;
    if (user || prl >= 4)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("dense vector, n = ""%" "ld"". ", n) ; } ;
    }
    if (user)
    {
 if (!Xx)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: vector not present\n\n") ; } ;
     return ((-5)) ;
 }
 if (n < 0)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: length of vector is < 0\n\n") ; } ;
     return ((-6)) ;
 }
    }
    if (user || prl >= 4)
    {
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    }
    if (prl == 4)
    {
 n2 = (((10) < (n)) ? (10) : (n)) ;
 for (i = 0 ; i < n2 ; i++)
 {
     print_value (i, Xx, Xz, scalar) ;
 }
 if (n2 < n)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("    ...\n") ; } ;
     print_value (n-1, Xx, Xz, scalar) ;
 }
    }
    else if (prl > 4)
    {
 for (i = 0 ; i < n ; i++)
 {
     print_value (i, Xx, Xz, scalar) ;
 }
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    dense vector ") ; } ; } } ;
    if (user || prl >= 4)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    }
    return ((0)) ;
}

variable_types:
Xx
double []

variable_types:
Xz
double []

variable_types: prl long

variable_types: user long

variable_types: scalar long


decompiled_code:
_BOOL8 __fastcall check_args(__int64 a1)
{
return *(_QWORD *)(a1 + 8) != 0LL;
}

canonical_decompiled_code:
_BOOL8 __fastcall func0(__int64 a1)
{
return *(_QWORD *)(a1 + 8) != 0LL;
}

original_code:
int check_args(struct arguments* args) {
    if (args->netlist_file == ((void *)0)) {
        return 0;
    }
    return 1;
}

canonical_original_code:
int check_args(struct arguments *args) {
    if (args->netlist_file == ((void *)0)) {
        return 0;
    }
    return 1;
}

variable_types: struct arguments { int verbose; char *netlist_file; int interactive_graphics; int opt_reservoirs; } *


original_code:
void set_default_args(struct arguments* args) {
    args->verbose = 0;
    args->netlist_file = ((void *)0);
    args->interactive_graphics = 0;
    args->opt_reservoirs = 0;
}

canonical_original_code:
void set_default_args(struct arguments *args) {
    args->verbose = 0;
    args->netlist_file = ((void *)0);
    args->interactive_graphics = 0;
    args->opt_reservoirs = 0;
}

user_defined_types: struct arguments { int verbose; char *netlist_file; int interactive_graphics; int opt_reservoirs; }


main

canonical_name: main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v4; // [rsp+0h] [rbp-38h] BYREF
const char *v5; // [rsp+8h] [rbp-30h]
int v6; // [rsp+10h] [rbp-28h]
int v7; // [rsp+14h] [rbp-24h]

set_default_args((__int64)&v4);
argp_parse(&argp, argc, (char **)argv, 0, 0LL, &v4);
if ( v5 )
printf("Netlist file: %s\n", v5);
else
puts("No netlist file provided");
if ( v6 )
{
puts("Interactive Graphics Enabled");
interactive_graphics = 1;
}
else
{
interactive_graphics = 0;
}
if ( v7 )
{
puts("Optimizing Reservoirs");
opt_reservoirs = 1;
}
else
{
opt_reservoirs = 0;
}
verbose = v4 != 0;
parse_netlist(v5);
*(_DWORD *)(FPGA + 32) = 3;
init_graphics("kroute graphics");
generate_rr_graph();
verify_rr_graph();
pathfinder_route();
verify_routed_netlist();
evaluate_qor();
return 0;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v4; // [rsp+0h] [rbp-38h] BYREF
const char *v5; // [rsp+8h] [rbp-30h]
int v6; // [rsp+10h] [rbp-28h]
int v7; // [rsp+14h] [rbp-24h]

func2((__int64)&v4);
argp_parse(&argp, argc, (char **)argv, 0, 0LL, &v4);
if ( v5 )
printf("Netlist file: %s\n", v5);
else
puts("No netlist file provided");
if ( v6 )
{
puts("Interactive Graphics Enabled");
interactive_graphics = 1;
}
else
{
interactive_graphics = 0;
}
if ( v7 )
{
puts("Optimizing Reservoirs");
opt_reservoirs = 1;
}
else
{
opt_reservoirs = 0;
}
verbose = v4 != 0;
parse_netlist(v5);
*(_DWORD *)(FPGA + 32) = 3;
init_graphics("kroute graphics");
generate_rr_graph();
verify_rr_graph();
pathfinder_route();
verify_routed_netlist();
evaluate_qor();
return 0;
}

original_code:
int main (int argc, char** argv) {
    struct arguments args;
    set_default_args(&args);
    argp_parse(&argp, argc, argv, 0, 0, &args);
    if (args.netlist_file == ((void *)0)) {
        printf("No netlist file provided\n");
    } else {
        printf("Netlist file: %s\n", args.netlist_file);
    }
    if (args.interactive_graphics) {
        printf("Interactive Graphics Enabled\n");
        interactive_graphics = 1;
    } else {
        interactive_graphics = 0;
    }
    if (args.opt_reservoirs) {
        printf("Optimizing Reservoirs\n");
        opt_reservoirs = 1;
    } else {
        opt_reservoirs = 0;
    }
    if (args.verbose) {
        verbose = 1;
    } else {
        verbose = 0;
    }
    parse_netlist(args.netlist_file);
    FPGA->Fs = 3;
    init_graphics("kroute graphics");
    generate_rr_graph();
    verify_rr_graph();
    pathfinder_route();
    verify_routed_netlist();
    evaluate_qor();
    return 0;
}

canonical_original_code:
int main(int argc, char **argv) {
    struct arguments args;
    set_default_args(&args);
    argp_parse(&argp, argc, argv, 0, 0, &args);
    if (args.netlist_file == ((void *)0)) {
        printf("No netlist file provided\n");
    } else {
        printf("Netlist file: %s\n", args.netlist_file);
    }
    if (args.interactive_graphics) {
        printf("Interactive Graphics Enabled\n");
        interactive_graphics = 1;
    } else {
        interactive_graphics = 0;
    }
    if (args.opt_reservoirs) {
        printf("Optimizing Reservoirs\n");
        opt_reservoirs = 1;
    } else {
        opt_reservoirs = 0;
    }
    if (args.verbose) {
        verbose = 1;
    } else {
        verbose = 0;
    }
    parse_netlist(args.netlist_file);
    FPGA->Fs = 3;
    init_graphics("kroute graphics");
    generate_rr_graph();
    verify_rr_graph();
    pathfinder_route();
    verify_routed_netlist();
    evaluate_qor();
    return 0;
}

variable_types: argc int

variable_types:
argv
char **

variable_types: struct arguments { int verbose; char *netlist_file; int interactive_graphics; int opt_reservoirs; }


decompiled_code:
double *__fastcall umfdl_scale(__int64 a1, double *a2, double a3)
{
__m128d v3; // xmm2
double *result; // rax

v3.m128d_f64[0] = a3;
v3.m128d_f64[0] = _mm_cmplt_sd(v3, (__m128d)0LL).m128d_f64[0];
if ( COERCE_DOUBLE((*(_QWORD *)&a3 ^ LC1) & *(_QWORD *)&v3.m128d_f64[0] | ~*(_QWORD *)&v3.m128d_f64[0] & *(_QWORD *)&a3) >= 1.0e-12 )
{
result = a2;
if ( a1 > 0 )
{
do
{
*result = *result / a3;
++result;
}
while ( result != &a2[a1] );
}
}
else
{
result = a2;
if ( a1 > 0 )
{
do
{
if ( *result != 0.0 )
*result = *result / a3;
++result;
}
while ( result != &a2[a1] );
}
}
return result;
}

canonical_decompiled_code:
double *__fastcall func0(__int64 a1, double *a2, double a3)
{
__m128d v3; // xmm2
double *result; // rax

v3.m128d_f64[0] = a3;
v3.m128d_f64[0] = _mm_cmplt_sd(v3, (__m128d)0LL).m128d_f64[0];
if ( COERCE_DOUBLE((*(_QWORD *)&a3 ^ LC1) & *(_QWORD *)&v3.m128d_f64[0] | ~*(_QWORD *)&v3.m128d_f64[0] & *(_QWORD *)&a3) >= 1.0e-12 )
{
result = a2;
if ( a1 > 0 )
{
do
{
*result = *result / a3;
++result;
}
while ( result != &a2[a1] );
}
}
else
{
result = a2;
if ( a1 > 0 )
{
do
{
if ( *result != 0.0 )
*result = *result / a3;
++result;
}
while ( result != &a2[a1] );
}
}
return result;
}

original_code:
void umfdl_scale
(
    long n,
    double pivot,
    double X [ ]
)
{
    double x ;
    double s ;
    long i ;
    { (s) = ((((pivot) < 0.)) ? -(pivot) : (pivot)) ; } ;
    if (s < 1e-12 || ((pivot) != (pivot)))
    {
 for (i = 0 ; i < n ; i++)
 {
     x = X [i] ;
     if (((x) != 0.))
     {
  { (X [i]) = (x) / (pivot) ; } ;
     }
 }
    }
    else
    {
 for (i = 0 ; i < n ; i++)
 {
     x = X [i] ;
     { (X [i]) = (x) / (pivot) ; } ;
 }
    }
}

canonical_original_code:
void umfdl_scale(long n, double pivot, double X[])
{
    double x;
    double s;
    long i;
    { (s) = ((((pivot) < 0.)) ? -(pivot) : (pivot)) ; } ;
    if (s < 1e-12 || ((pivot) != (pivot)))
    {
 for (i = 0 ; i < n ; i++)
 {
     x = X [i] ;
     if (((x) != 0.))
     {
  { (X [i]) = (x) / (pivot) ; } ;
     }
 }
    }
    else
    {
 for (i = 0 ; i < n ; i++)
 {
     x = X [i] ;
     { (X [i]) = (x) / (pivot) ; } ;
 }
    }
}

variable_types: pivot double

variable_types:
X
double []

variable_types: x double


decompiled_code:
__int64 __fastcall umfpack_di_col_to_triplet(int a1, unsigned int *a2, __int64 a3)
{
unsigned int v5; // ebp
int v6; // er11
__int64 v7; // r9
__int64 v8; // rsi
__int64 v9; // rbx
int v10; // edi
int v11; // edx
_DWORD *v12; // rax
_DWORD *v13; // rdx

if ( !a2 || !a3 )
return (unsigned int)-5;
if ( a1 <= 0 )
return (unsigned int)-6;
v5 = *a2;
if ( *a2 )
return (unsigned int)-8;
v6 = a2[a1];
if ( v6 < 0 )
return (unsigned int)-8;
v7 = (unsigned int)a1;
v8 = 0LL;
v9 = a3 + 4;
while ( 1 )
{
v10 = a2[v8];
v11 = a2[v8 + 1];
if ( v11 - v10 < 0 || v6 < v11 )
break;
if ( v10 < v11 )
{
v12 = (_DWORD *)(a3 + 4LL * v10);
v13 = (_DWORD *)(v9 + 4 * (v10 + (unsigned __int64)(unsigned int)(v11 - 1 - v10)));
do
*v12++ = v8;
while ( v12 != v13 );
}
if ( ++v8 == v7 )
return v5;
}
return (unsigned int)-8;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, unsigned int *a2, __int64 a3)
{
unsigned int v5; // ebp
int v6; // er11
__int64 v7; // r9
__int64 v8; // rsi
__int64 v9; // rbx
int v10; // edi
int v11; // edx
_DWORD *v12; // rax
_DWORD *v13; // rdx

if ( !a2 || !a3 )
return (unsigned int)-5;
if ( a1 <= 0 )
return (unsigned int)-6;
v5 = *a2;
if ( *a2 )
return (unsigned int)-8;
v6 = a2[a1];
if ( v6 < 0 )
return (unsigned int)-8;
v7 = (unsigned int)a1;
v8 = 0LL;
v9 = a3 + 4;
while ( 1 )
{
v10 = a2[v8];
v11 = a2[v8 + 1];
if ( v11 - v10 < 0 || v6 < v11 )
break;
if ( v10 < v11 )
{
v12 = (_DWORD *)(a3 + 4LL * v10);
v13 = (_DWORD *)(v9 + 4 * (v10 + (unsigned __int64)(unsigned int)(v11 - 1 - v10)));
do
*v12++ = v8;
while ( v12 != v13 );
}
if ( ++v8 == v7 )
return v5;
}
return (unsigned int)-8;
}

original_code:
int umfpack_di_col_to_triplet
(
    int n_col,
    const int Ap [ ],
    int Tj [ ]
)
{
    int nz, j, p, p1, p2, length ;
    if (!Ap || !Tj)
    {
 return ((-5)) ;
    }
    if (n_col <= 0)
    {
 return ((-6)) ;
    }
    if (Ap [0] != 0)
    {
 return ((-8)) ;
    }
    nz = Ap [n_col] ;
    if (nz < 0)
    {
 return ((-8)) ;
    }
    for (j = 0 ; j < n_col ; j++)
    {
 p1 = Ap [j] ;
 p2 = Ap [j+1] ;
 length = p2 - p1 ;
 if (length < 0 || p2 > nz)
 {
     return ((-8)) ;
 }
 for (p = p1 ; p < p2 ; p++)
 {
     Tj [p] = j ;
 }
    }
    return ((0)) ;
}

canonical_original_code:
int umfpack_di_col_to_triplet(int n_col, int Ap[], int Tj[])
{
    int nz; int j; int p; int p1; int p2; int length;
    if (!Ap || !Tj)
    {
 return ((-5)) ;
    }
    if (n_col <= 0)
    {
 return ((-6)) ;
    }
    if (Ap [0] != 0)
    {
 return ((-8)) ;
    }
    nz = Ap [n_col] ;
    if (nz < 0)
    {
 return ((-8)) ;
    }
    for (j = 0 ; j < n_col ; j++)
    {
 p1 = Ap [j] ;
 p2 = Ap [j+1] ;
 length = p2 - p1 ;
 if (length < 0 || p2 > nz)
 {
     return ((-8)) ;
 }
 for (p = p1 ; p < p2 ; p++)
 {
     Tj [p] = j ;
 }
    }
    return ((0)) ;
}

variable_types:
Ap
int []

variable_types:
Tj
int []

variable_types: nz int

variable_types: j int

variable_types: p int

variable_types: length int


original_code:
int amd_post_tree
(
    int root,
    int k,
    int Child [ ],
    const int Sibling [ ],
    int Order [ ],
    int Stack [ ]
)
{
    int f, head, h, i ;
    head = 0 ;
    Stack [0] = root ;
    while (head >= 0)
    {
 ;
 i = Stack [head] ;
 ;
 ;
 if (Child [i] != (-1))
 {
     for (f = Child [i] ; f != (-1) ; f = Sibling [f])
     {
  head++ ;
  ;
  ;
     }
     h = head ;
     ;
     for (f = Child [i] ; f != (-1) ; f = Sibling [f])
     {
  ;
  Stack [h--] = f ;
  ;
  ;
     }
     ;
     Child [i] = (-1) ;
 }
 else
 {
     head-- ;
     ;
     Order [i] = k++ ;
     ;
 }
    }
    return (k) ;
}

canonical_original_code:
int amd_post_tree(int root, int k, int Child[], int Sibling[], int Order[], int Stack[])
{
    int f; int head; int h; int i;
    head = 0 ;
    Stack [0] = root ;
    while (head >= 0)
    {
 ;
 i = Stack [head] ;
 ;
 ;
 if (Child [i] != (-1))
 {
     for (f = Child [i] ; f != (-1) ; f = Sibling [f])
     {
  head++ ;
  ;
  ;
     }
     h = head ;
     ;
     for (f = Child [i] ; f != (-1) ; f = Sibling [f])
     {
  ;
  Stack [h--] = f ;
  ;
  ;
     }
     ;
     Child [i] = (-1) ;
 }
 else
 {
     head-- ;
     ;
     Order [i] = k++ ;
     ;
 }
    }
    return (k) ;
}

variable_types: root int

variable_types: k int

variable_types:
Child
int []

variable_types:
Sibling
int []

variable_types:
Order
int []

variable_types:
Stack
int []

variable_types: f int

variable_types: head int

variable_types: h int

variable_types: i int


original_code:
int umfzi_triplet_map_x
(
    int n_row,
    int n_col,
    int nz,
    const int Ti [ ],
    const int Tj [ ],
    int Ap [ ],
    int Ai [ ],
    int Rp [ ],
    int Rj [ ],
    int W [ ],
    int RowCount [ ]
    , const double Tx [ ]
    , double Ax [ ]
    , double Rx [ ]
    , const double Tz [ ]
    , double Az [ ]
    , double Rz [ ]
    , int Map [ ]
    , int Map2 [ ]
)
{
    int i, j, k, p, cp, p1, p2, pdest, pj ;
    int duplicates ;
    int split = ((Tz) != (double *) ((void *)0)) && ((Az) != (double *) ((void *)0)) && ((Rz) != (double *) ((void *)0)) ;
    for (i = 0 ; i < n_row ; i++)
    {
 W [i] = 0 ;
    }
    for (k = 0 ; k < nz ; k++)
    {
 i = Ti [k] ;
 j = Tj [k] ;
 if (i < 0 || i >= n_row || j < 0 || j >= n_col)
 {
     return ((-8)) ;
 }
 W [i]++ ;
    }
    Rp [0] = 0 ;
    for (i = 0 ; i < n_row ; i++)
    {
 Rp [i+1] = Rp [i] + W [i] ;
 W [i] = Rp [i] ;
    }
    for (k = 0 ; k < nz ; k++)
    {
 p = W [Ti [k]]++ ;
 Map [k] = p ;
 Rj [p] = Tj [k] ;
 if (split)
 {
     Rx [p] = Tx [k] ;
     Rz [p] = Tz [k] ;
 }
 else
 {
     Rx [2*p ] = Tx [2*k ] ;
     Rx [2*p+1] = Tx [2*k+1] ;
 }
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = (-1) ;
    }
    duplicates = (0) ;
    for (i = 0 ; i < n_row ; i++)
    {
 p1 = Rp [i] ;
 p2 = Rp [i+1] ;
 pdest = p1 ;
 for (p = p1 ; p < p2 ; p++)
 {
     j = Rj [p] ;
     ;
     pj = W [j] ;
     if (pj >= p1)
     {
  ;
  ;
  Map2 [p] = pj ;
  duplicates = (1) ;
  if (split)
  {
      Rx [pj] += Rx [p] ;
      Rz [pj] += Rz [p] ;
  }
  else
  {
      Rx[2*pj ] += Rx[2*p ] ;
      Rx[2*pj+1] += Rx[2*p+1] ;
  }
     }
     else
     {
  W [j] = pdest ;
  Map2 [p] = pdest ;
  if (pdest != p)
  {
      Rj [pdest] = j ;
      if (split)
      {
   Rx [pdest] = Rx [p] ;
   Rz [pdest] = Rz [p] ;
      }
      else
      {
   Rx [2*pdest ] = Rx [2*p ] ;
   Rx [2*pdest+1] = Rx [2*p+1] ;
      }
  }
  pdest++ ;
     }
 }
 RowCount [i] = pdest - p1 ;
    }
    if (duplicates)
    {
 for (k = 0 ; k < nz ; k++)
 {
     Map [k] = Map2 [Map [k]] ;
 }
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = 0 ;
    }
    for (i = 0 ; i < n_row ; i++)
    {
 for (p = Rp [i] ; p < Rp [i] + RowCount [i] ; p++)
 {
     j = Rj [p] ;
     ;
     W [j]++ ;
 }
    }
    Ap [0] = 0 ;
    for (j = 0 ; j < n_col ; j++)
    {
 Ap [j+1] = Ap [j] + W [j] ;
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = Ap [j] ;
    }
    for (i = 0 ; i < n_row ; i++)
    {
 for (p = Rp [i] ; p < Rp [i] + RowCount [i] ; p++)
 {
     cp = W [Rj [p]]++ ;
     Map2 [p] = cp ;
     Ai [cp] = i ;
     if (split)
     {
  Ax [cp] = Rx [p] ;
  Az [cp] = Rz [p] ;
     }
     else
     {
  Ax [2*cp ] = Rx [2*p ] ;
  Ax [2*cp+1] = Rx [2*p+1] ;
     }
 }
    }
    for (k = 0 ; k < nz ; k++)
    {
 Map [k] = Map2 [Map [k]] ;
    }
    return ((0)) ;
}

canonical_original_code:
int umfzi_triplet_map_x(int n_row, int n_col, int nz, int Ti[], int Tj[], int Ap[], int Ai[], int Rp[], int Rj[], int W[], int RowCount[], double Tx[], double Ax[], double Rx[], double Tz[], double Az[], double Rz[], int Map[], int Map2[])
{
    int i; int j; int k; int p; int cp; int p1; int p2; int pdest; int pj;
    int duplicates;
    int split = ((Tz) != (double *) ((void *)0)) && ((Az) != (double *) ((void *)0)) && ((Rz) != (double *) ((void *)0));
    for (i = 0 ; i < n_row ; i++)
    {
 W [i] = 0 ;
    }
    for (k = 0 ; k < nz ; k++)
    {
 i = Ti [k] ;
 j = Tj [k] ;
 if (i < 0 || i >= n_row || j < 0 || j >= n_col)
 {
     return ((-8)) ;
 }
 W [i]++ ;
    }
    Rp [0] = 0 ;
    for (i = 0 ; i < n_row ; i++)
    {
 Rp [i+1] = Rp [i] + W [i] ;
 W [i] = Rp [i] ;
    }
    for (k = 0 ; k < nz ; k++)
    {
 p = W [Ti [k]]++ ;
 Map [k] = p ;
 Rj [p] = Tj [k] ;
 if (split)
 {
     Rx [p] = Tx [k] ;
     Rz [p] = Tz [k] ;
 }
 else
 {
     Rx [2*p ] = Tx [2*k ] ;
     Rx [2*p+1] = Tx [2*k+1] ;
 }
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = (-1) ;
    }
    duplicates = (0) ;
    for (i = 0 ; i < n_row ; i++)
    {
 p1 = Rp [i] ;
 p2 = Rp [i+1] ;
 pdest = p1 ;
 for (p = p1 ; p < p2 ; p++)
 {
     j = Rj [p] ;
     ;
     pj = W [j] ;
     if (pj >= p1)
     {
  ;
  ;
  Map2 [p] = pj ;
  duplicates = (1) ;
  if (split)
  {
      Rx [pj] += Rx [p] ;
      Rz [pj] += Rz [p] ;
  }
  else
  {
      Rx[2*pj ] += Rx[2*p ] ;
      Rx[2*pj+1] += Rx[2*p+1] ;
  }
     }
     else
     {
  W [j] = pdest ;
  Map2 [p] = pdest ;
  if (pdest != p)
  {
      Rj [pdest] = j ;
      if (split)
      {
   Rx [pdest] = Rx [p] ;
   Rz [pdest] = Rz [p] ;
      }
      else
      {
   Rx [2*pdest ] = Rx [2*p ] ;
   Rx [2*pdest+1] = Rx [2*p+1] ;
      }
  }
  pdest++ ;
     }
 }
 RowCount [i] = pdest - p1 ;
    }
    if (duplicates)
    {
 for (k = 0 ; k < nz ; k++)
 {
     Map [k] = Map2 [Map [k]] ;
 }
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = 0 ;
    }
    for (i = 0 ; i < n_row ; i++)
    {
 for (p = Rp [i] ; p < Rp [i] + RowCount [i] ; p++)
 {
     j = Rj [p] ;
     ;
     W [j]++ ;
 }
    }
    Ap [0] = 0 ;
    for (j = 0 ; j < n_col ; j++)
    {
 Ap [j+1] = Ap [j] + W [j] ;
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = Ap [j] ;
    }
    for (i = 0 ; i < n_row ; i++)
    {
 for (p = Rp [i] ; p < Rp [i] + RowCount [i] ; p++)
 {
     cp = W [Rj [p]]++ ;
     Map2 [p] = cp ;
     Ai [cp] = i ;
     if (split)
     {
  Ax [cp] = Rx [p] ;
  Az [cp] = Rz [p] ;
     }
     else
     {
  Ax [2*cp ] = Rx [2*p ] ;
  Ax [2*cp+1] = Rx [2*p+1] ;
     }
 }
    }
    for (k = 0 ; k < nz ; k++)
    {
 Map [k] = Map2 [Map [k]] ;
    }
    return ((0)) ;
}

variable_types:
Ti
int []

variable_types:
Ai
int []

variable_types:
Rp
int []

variable_types:
Rj
int []

variable_types:
W
int []

variable_types:
RowCount
int []

variable_types:
Tx
double []

variable_types:
Ax
double []

variable_types:
Rx
double []

variable_types:
Tz
double []

variable_types:
Az
double []

variable_types:
Rz
double []

variable_types:
Map
int []

variable_types: cp int

variable_types: pdest int

variable_types: pj int

variable_types: duplicates int

variable_types: split int


decompiled_code:
_BOOL8 __fastcall umfzi_valid_symbolic(__int64 a1)
{
_BOOL8 result; // rax

if ( !a1 )
return 0LL;
result = 0LL;
if ( *(_DWORD *)(a1 + 56) == 40927 )
{
if ( *(_QWORD *)(a1 + 136) )
{
if ( *(_QWORD *)(a1 + 144) )
{
if ( *(_QWORD *)(a1 + 104) )
{
if ( *(_QWORD *)(a1 + 112) )
{
if ( *(_QWORD *)(a1 + 120) )
{
if ( *(_QWORD *)(a1 + 128) )
{
if ( *(_QWORD *)(a1 + 72) )
{
if ( *(_QWORD *)(a1 + 80) )
{
if ( *(_QWORD *)(a1 + 88) )
{
if ( *(int *)(a1 + 208) > 0 )
result = *(_DWORD *)(a1 + 212) > 0;
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
return result;
}

canonical_decompiled_code:
_BOOL8 __fastcall func0(__int64 a1)
{
_BOOL8 result; // rax

if ( !a1 )
return 0LL;
result = 0LL;
if ( *(_DWORD *)(a1 + 56) == 40927 )
{
if ( *(_QWORD *)(a1 + 136) )
{
if ( *(_QWORD *)(a1 + 144) )
{
if ( *(_QWORD *)(a1 + 104) )
{
if ( *(_QWORD *)(a1 + 112) )
{
if ( *(_QWORD *)(a1 + 120) )
{
if ( *(_QWORD *)(a1 + 128) )
{
if ( *(_QWORD *)(a1 + 72) )
{
if ( *(_QWORD *)(a1 + 80) )
{
if ( *(_QWORD *)(a1 + 88) )
{
if ( *(int *)(a1 + 208) > 0 )
result = *(_DWORD *)(a1 + 212) > 0;
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
return result;
}

original_code:
int umfzi_valid_symbolic
(
    SymbolicType *Symbolic
)
{
    if (!Symbolic)
    {
 return ((0)) ;
    }
    if (Symbolic->valid != 40927)
    {
 return ((0)) ;
    }
    if (!Symbolic->Cperm_init || !Symbolic->Rperm_init ||
 !Symbolic->Front_npivcol || !Symbolic->Front_1strow ||
 !Symbolic->Front_leftmostdesc ||
 !Symbolic->Front_parent || !Symbolic->Chain_start ||
 !Symbolic->Chain_maxrows || !Symbolic->Chain_maxcols ||
 Symbolic->n_row <= 0 || Symbolic->n_col <= 0)
    {
 return ((0)) ;
    }
    return ((1)) ;
}

canonical_original_code:
int umfzi_valid_symbolic(struct SymbolicType *Symbolic)
{
    if (!Symbolic)
    {
 return ((0)) ;
    }
    if (Symbolic->valid != 40927)
    {
 return ((0)) ;
    }
    if (!Symbolic->Cperm_init || !Symbolic->Rperm_init ||
 !Symbolic->Front_npivcol || !Symbolic->Front_1strow ||
 !Symbolic->Front_leftmostdesc ||
 !Symbolic->Front_parent || !Symbolic->Chain_start ||
 !Symbolic->Chain_maxrows || !Symbolic->Chain_maxcols ||
 Symbolic->n_row <= 0 || Symbolic->n_col <= 0)
    {
 return ((0)) ;
    }
    return ((1)) ;
}

variable_types: struct SymbolicType { double num_mem_usage_est; int valid; } *


decompiled_code:
__int64 __fastcall umf_i_free(__int64 a1)
{
if ( a1 )
amd_free();
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1)
{
if ( a1 )
amd_free();
return 0LL;
}

original_code:
void *umf_i_free
(
    void *p
)
{
    ;
    if (p)
    {
 amd_free (p) ;
    }
    return ((void *) ((void *)0)) ;
}

canonical_original_code:
void *umf_i_free(void *p)
{
    ;
    if (p)
    {
 amd_free (p) ;
    }
    return ((void *) ((void *)0)) ;
}

variable_types:
p
void *

return_type: void *


decompiled_code:
__int64 __fastcall umfzl_mem_alloc_head_block(_QWORD *a1, __int64 a2)
{
__int64 result; // rax
__int64 v3; // rsi
__int64 v4; // rsi

result = a1[14];
if ( a1[15] - result < a2 )
return 0LL;
v3 = result + a2;
a1[14] = v3;
v4 = a1[36] + v3;
if ( v4 < a1[38] )
v4 = a1[38];
a1[38] = v4;
return result;
}

original_code:
long umfzl_mem_alloc_head_block
(
    NumericType *Numeric,
    long nunits
)
{
    long p, usage ;
    ;
    ;
    ;
    if (nunits > (Numeric->itail - Numeric->ihead))
    {
 ;
 return (0) ;
    }
    p = Numeric->ihead ;
    Numeric->ihead += nunits ;
    ;
    usage = Numeric->ihead + Numeric->tail_usage ;
    Numeric->max_usage = (((Numeric->max_usage) > (usage)) ? (Numeric->max_usage) : (usage)) ;
    return (p) ;
}

canonical_original_code:
long umfzl_mem_alloc_head_block(struct NumericType *Numeric, long nunits)
{
    long p; long usage;
    ;
    ;
    ;
    if (nunits > (Numeric->itail - Numeric->ihead))
    {
 ;
 return (0) ;
    }
    p = Numeric->ihead ;
    Numeric->ihead += nunits ;
    ;
    usage = Numeric->ihead + Numeric->tail_usage ;
    Numeric->max_usage = (((Numeric->max_usage) > (usage)) ? (Numeric->max_usage) : (usage)) ;
    return (p) ;
}

variable_types: struct NumericType { double flops; long scale; long valid; union Unit_union { struct { long size; } header; double xxxxxx; } *Memory; long ihead; long *Rperm; long ulen; struct DoubleComplex { double component[2]; } *D; long do_recip; double *Rs; long n_row; long tail_usage; long maxnrows; } *

variable_types: nunits long

variable_types: p long

variable_types: usage long