original_code:
long umfdl_grow_front
(
    NumericType *Numeric,
    long fnr2,
    long fnc2,
    WorkType *Work,
    long do_what
)
{
    double s ;
    double *Fcold, *Fcnew ;
    long j, i, col, *Fcpos, *Fcols, fnrows_max, fncols_max, fnr_curr, nb,
 fnrows_new, fncols_new, fnr_min, fnc_min, minsize,
 newsize, fnrows, fncols, *E, eloc ;
    Fcols = Work->Fcols ;
    Fcpos = Work->Fcpos ;
    E = Work->E ;
    nb = Work->nb ;
    fnrows_max = Work->fnrows_max + nb ;
    fncols_max = Work->fncols_max + nb ;
    ;
    ;
    ;
    ;
    ;
    fnrows_new = Work->fnrows_new + 1 ;
    fncols_new = Work->fncols_new + 1 ;
    ;
    if (fnrows_new % 2 == 0) fnrows_new++ ;
    fnrows_new += nb ;
    fncols_new += nb ;
    fnr_min = (((fnrows_new) < (fnrows_max)) ? (fnrows_new) : (fnrows_max)) ;
    fnc_min = (((fncols_new) < (fncols_max)) ? (fncols_new) : (fncols_max)) ;
    minsize = fnr_min * fnc_min ;
    if (((!(((double) fnr_min * (double) fnc_min * sizeof (double)) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || (((double) fnr_min * (double) fnc_min * sizeof (double)) != ((double) fnr_min * (double) fnc_min * sizeof (double)))))
    {
 return ((0)) ;
    }
    ;
    ;
    ;
    ;
    fnr2 += nb ;
    fnc2 += nb ;
    ;
    if (fnr2 % 2 == 0) fnr2++ ;
    fnr2 = (((fnr2) > (fnr_min)) ? (fnr2) : (fnr_min)) ;
    fnc2 = (((fnc2) > (fnc_min)) ? (fnc2) : (fnc_min)) ;
    fnr2 = (((fnr2) < (fnrows_max)) ? (fnr2) : (fnrows_max)) ;
    fnc2 = (((fnc2) < (fncols_max)) ? (fnc2) : (fncols_max)) ;
    ;
    ;
    ;
    s = ((double) fnr2) * ((double) fnc2) ;
    if (((!((s * sizeof (double)) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || ((s * sizeof (double)) != (s * sizeof (double)))))
    {
 double a = 0.9 * sqrt ((0x7fffffffffffffffL / sizeof (double)) / s) ;
 fnr2 = (((fnr_min) > (a * fnr2)) ? (fnr_min) : (a * fnr2)) ;
 fnc2 = (((fnc_min) > (a * fnc2)) ? (fnc_min) : (a * fnc2)) ;
 newsize = fnr2 * fnc2 ;
 ;
 if (fnr2 % 2 == 0) fnr2++ ;
 fnc2 = newsize / fnr2 ;
    }
    fnr2 = (((fnr2) > (fnr_min)) ? (fnr2) : (fnr_min)) ;
    fnc2 = (((fnc2) > (fnc_min)) ? (fnc2) : (fnc_min)) ;
    newsize = fnr2 * fnc2 ;
    ;
    ;
    ;
    ;
    ;
    if (E [0] && do_what != 1)
    {
 ;
 umfdl_mem_free_tail_block (Numeric, E [0]) ;
 E [0] = 0 ;
 Work->Flublock = (double *) ((void *)0) ;
 Work->Flblock = (double *) ((void *)0) ;
 Work->Fublock = (double *) ((void *)0) ;
 Work->Fcblock = (double *) ((void *)0) ;
    }
    ;
    eloc = umfdl_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    if (!eloc)
    {
 ;
 if (!umfdl_get_memory (Numeric, Work, 1 + (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))),
     Work->fnrows, Work->fncols, (0)))
 {
     return ((0)) ;
 }
 ;
 eloc = umfdl_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    }
    while ((fnr2 != fnr_min || fnc2 != fnc_min) && !eloc)
    {
 fnr2 = (((fnr2 - 2) < (fnr2 * (0.95))) ? (fnr2 - 2) : (fnr2 * (0.95))) ;
 fnc2 = (((fnc2 - 2) < (fnc2 * (0.95))) ? (fnc2 - 2) : (fnc2 * (0.95))) ;
 ;
 ;
 fnr2 = (((fnr_min) > (fnr2)) ? (fnr_min) : (fnr2)) ;
 fnc2 = (((fnc_min) > (fnc2)) ? (fnc_min) : (fnc2)) ;
 ;
 if (fnr2 % 2 == 0) fnr2++ ;
 newsize = fnr2 * fnc2 ;
 ;
 eloc = umfdl_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    }
    if (!eloc)
    {
 fnr2 = fnr_min ;
 fnc2 = fnc_min ;
 newsize = minsize ;
 ;
 eloc = umfdl_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    }
    if (!eloc)
    {
 return ((0)) ;
    }
    ;
    ;
    ;
    fnr_curr = Work->fnr_curr ;
    ;
    ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    Fcold = Work->Fcblock ;
    fnr2 -= nb ;
    fnc2 -= nb ;
    Work->Flublock = (double *) (Numeric->Memory + eloc) ;
    Work->Flblock = Work->Flublock + nb * nb ;
    Work->Fublock = Work->Flblock + nb * fnr2 ;
    Work->Fcblock = Work->Fublock + nb * fnc2 ;
    Fcnew = Work->Fcblock ;
    if (E [0])
    {
 for (j = 0 ; j < fncols ; j++)
 {
     col = Fcols [j] ;
     ;
     ;
     for (i = 0 ; i < fnrows ; i++)
     {
  Fcnew [i] = Fcold [i] ;
     }
     Fcnew += fnr2 ;
     Fcold += fnr_curr ;
     ;
     Fcpos [col] = j * fnr2 ;
 }
    }
    else if (do_what == 2)
    {
 for (j = 0 ; j < fncols ; j++)
 {
     col = Fcols [j] ;
     ;
     Fcpos [col] = j * fnr2 ;
 }
    }
    umfdl_mem_free_tail_block (Numeric, E [0]) ;
    E [0] = eloc ;
    Work->fnr_curr = fnr2 ;
    Work->fnc_curr = fnc2 ;
    Work->fcurr_size = newsize ;
    Work->do_grow = (0) ;
    ;
    ;
    ;
    return ((1)) ;
}

canonical_original_code:
long umfdl_grow_front(struct NumericType *Numeric, long fnr2, long fnc2, struct WorkType *Work, long do_what)
{
    double s;
    double *Fcold; double *Fcnew;
    long j; long i; long col; long *Fcpos; long *Fcols; long fnrows_max; long fncols_max; long fnr_curr; long nb; long fnrows_new; long fncols_new; long fnr_min; long fnc_min; long minsize; long newsize; long fnrows; long fncols; long *E; long eloc;
    Fcols = Work->Fcols ;
    Fcpos = Work->Fcpos ;
    E = Work->E ;
    nb = Work->nb ;
    fnrows_max = Work->fnrows_max + nb ;
    fncols_max = Work->fncols_max + nb ;
    ;
    ;
    ;
    ;
    ;
    fnrows_new = Work->fnrows_new + 1 ;
    fncols_new = Work->fncols_new + 1 ;
    ;
    if (fnrows_new % 2 == 0) fnrows_new++ ;
    fnrows_new += nb ;
    fncols_new += nb ;
    fnr_min = (((fnrows_new) < (fnrows_max)) ? (fnrows_new) : (fnrows_max)) ;
    fnc_min = (((fncols_new) < (fncols_max)) ? (fncols_new) : (fncols_max)) ;
    minsize = fnr_min * fnc_min ;
    if (((!(((double) fnr_min * (double) fnc_min * sizeof (double)) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || (((double) fnr_min * (double) fnc_min * sizeof (double)) != ((double) fnr_min * (double) fnc_min * sizeof (double)))))
    {
 return ((0)) ;
    }
    ;
    ;
    ;
    ;
    fnr2 += nb ;
    fnc2 += nb ;
    ;
    if (fnr2 % 2 == 0) fnr2++ ;
    fnr2 = (((fnr2) > (fnr_min)) ? (fnr2) : (fnr_min)) ;
    fnc2 = (((fnc2) > (fnc_min)) ? (fnc2) : (fnc_min)) ;
    fnr2 = (((fnr2) < (fnrows_max)) ? (fnr2) : (fnrows_max)) ;
    fnc2 = (((fnc2) < (fncols_max)) ? (fnc2) : (fncols_max)) ;
    ;
    ;
    ;
    s = ((double) fnr2) * ((double) fnc2) ;
    if (((!((s * sizeof (double)) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || ((s * sizeof (double)) != (s * sizeof (double)))))
    {
 double a = 0.9 * sqrt ((0x7fffffffffffffffL / sizeof (double)) / s);
 fnr2 = (((fnr_min) > (a * fnr2)) ? (fnr_min) : (a * fnr2)) ;
 fnc2 = (((fnc_min) > (a * fnc2)) ? (fnc_min) : (a * fnc2)) ;
 newsize = fnr2 * fnc2 ;
 ;
 if (fnr2 % 2 == 0) fnr2++ ;
 fnc2 = newsize / fnr2 ;
    }
    fnr2 = (((fnr2) > (fnr_min)) ? (fnr2) : (fnr_min)) ;
    fnc2 = (((fnc2) > (fnc_min)) ? (fnc2) : (fnc_min)) ;
    newsize = fnr2 * fnc2 ;
    ;
    ;
    ;
    ;
    ;
    if (E [0] && do_what != 1)
    {
 ;
 umfdl_mem_free_tail_block (Numeric, E [0]) ;
 E [0] = 0 ;
 Work->Flublock = (double *) ((void *)0) ;
 Work->Flblock = (double *) ((void *)0) ;
 Work->Fublock = (double *) ((void *)0) ;
 Work->Fcblock = (double *) ((void *)0) ;
    }
    ;
    eloc = umfdl_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    if (!eloc)
    {
 ;
 if (!umfdl_get_memory (Numeric, Work, 1 + (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))),
     Work->fnrows, Work->fncols, (0)))
 {
     return ((0)) ;
 }
 ;
 eloc = umfdl_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    }
    while ((fnr2 != fnr_min || fnc2 != fnc_min) && !eloc)
    {
 fnr2 = (((fnr2 - 2) < (fnr2 * (0.95))) ? (fnr2 - 2) : (fnr2 * (0.95))) ;
 fnc2 = (((fnc2 - 2) < (fnc2 * (0.95))) ? (fnc2 - 2) : (fnc2 * (0.95))) ;
 ;
 ;
 fnr2 = (((fnr_min) > (fnr2)) ? (fnr_min) : (fnr2)) ;
 fnc2 = (((fnc_min) > (fnc2)) ? (fnc_min) : (fnc2)) ;
 ;
 if (fnr2 % 2 == 0) fnr2++ ;
 newsize = fnr2 * fnc2 ;
 ;
 eloc = umfdl_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    }
    if (!eloc)
    {
 fnr2 = fnr_min ;
 fnc2 = fnc_min ;
 newsize = minsize ;
 ;
 eloc = umfdl_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    }
    if (!eloc)
    {
 return ((0)) ;
    }
    ;
    ;
    ;
    fnr_curr = Work->fnr_curr ;
    ;
    ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    Fcold = Work->Fcblock ;
    fnr2 -= nb ;
    fnc2 -= nb ;
    Work->Flublock = (double *) (Numeric->Memory + eloc) ;
    Work->Flblock = Work->Flublock + nb * nb ;
    Work->Fublock = Work->Flblock + nb * fnr2 ;
    Work->Fcblock = Work->Fublock + nb * fnc2 ;
    Fcnew = Work->Fcblock ;
    if (E [0])
    {
 for (j = 0 ; j < fncols ; j++)
 {
     col = Fcols [j] ;
     ;
     ;
     for (i = 0 ; i < fnrows ; i++)
     {
  Fcnew [i] = Fcold [i] ;
     }
     Fcnew += fnr2 ;
     Fcold += fnr_curr ;
     ;
     Fcpos [col] = j * fnr2 ;
 }
    }
    else if (do_what == 2)
    {
 for (j = 0 ; j < fncols ; j++)
 {
     col = Fcols [j] ;
     ;
     Fcpos [col] = j * fnr2 ;
 }
    }
    umfdl_mem_free_tail_block (Numeric, E [0]) ;
    E [0] = eloc ;
    Work->fnr_curr = fnr2 ;
    Work->fnc_curr = fnc2 ;
    Work->fcurr_size = newsize ;
    Work->do_grow = (0) ;
    ;
    ;
    ;
    return ((1)) ;
}

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: s double

variable_types:
Fcold
double *

variable_types:
Fcnew
double *

variable_types: j long

variable_types: i long

variable_types: col long

variable_types:
Fcpos
long *

variable_types:
Fcols
long *

variable_types: nb long

variable_types: minsize long

variable_types: newsize long

variable_types: fnrows long

variable_types: fncols long

variable_types:
E
long *

variable_types: eloc long

variable_types: a double

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:
long umfdl_triplet_map_nox
(
    long n_row,
    long n_col,
    long nz,
    const long Ti [ ],
    const long Tj [ ],
    long Ap [ ],
    long Ai [ ],
    long Rp [ ],
    long Rj [ ],
    long W [ ],
    long RowCount [ ]
    , long Map [ ]
    , long Map2 [ ]
)
{
    long i, j, k, p, cp, p1, p2, pdest, pj ;
    long duplicates ;
    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] ;
    }
    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) ;
     }
     else
     {
  W [j] = pdest ;
  Map2 [p] = pdest ;
  if (pdest != p)
  {
      Rj [pdest] = j ;
  }
  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 ;
 }
    }
    for (k = 0 ; k < nz ; k++)
    {
 Map [k] = Map2 [Map [k]] ;
    }
    return ((0)) ;
}

canonical_original_code:
long umfdl_triplet_map_nox(long n_row, long n_col, long nz, long Ti[], long Tj[], long Ap[], long Ai[], long Rp[], long Rj[], long W[], long RowCount[], long Map[], long Map2[])
{
    long i; long j; long k; long p; long cp; long p1; long p2; long pdest; long pj;
    long duplicates;
    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] ;
    }
    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) ;
     }
     else
     {
  W [j] = pdest ;
  Map2 [p] = pdest ;
  if (pdest != p)
  {
      Rj [pdest] = j ;
  }
  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 ;
 }
    }
    for (k = 0 ; k < nz ; k++)
    {
 Map [k] = Map2 [Map [k]] ;
    }
    return ((0)) ;
}

variable_types: nz long

variable_types:
Ti
long []

variable_types:
Tj
long []

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Rp
long []

variable_types:
Rj
long []

variable_types:
W
long []

variable_types:
RowCount
long []

variable_types:
Map
long []

variable_types: k long

variable_types: p long

variable_types: cp long

variable_types: pdest long

variable_types: pj long

variable_types: duplicates long

return_type: long


original_code:
long umfdl_triplet_nomap_x
(
    long n_row,
    long n_col,
    long nz,
    const long Ti [ ],
    const long Tj [ ],
    long Ap [ ],
    long Ai [ ],
    long Rp [ ],
    long Rj [ ],
    long W [ ],
    long RowCount [ ]
    , const double Tx [ ]
    , double Ax [ ]
    , double Rx [ ]
)
{
    long i, j, k, p, cp, p1, p2, pdest, pj ;
    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]]++ ;
 Rj [p] = Tj [k] ;
 Rx [p] = Tx [k] ;
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = (-1) ;
    }
    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)
     {
  ;
  ;
  Rx [pj] += Rx [p] ;
     }
     else
     {
  W [j] = pdest ;
  if (pdest != p)
  {
      Rj [pdest] = j ;
      Rx [pdest] = Rx [p] ;
  }
  pdest++ ;
     }
 }
 RowCount [i] = pdest - p1 ;
    }
    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]]++ ;
     Ai [cp] = i ;
     Ax [cp] = Rx [p] ;
 }
    }
    return ((0)) ;
}

canonical_original_code:
long umfdl_triplet_nomap_x(long n_row, long n_col, long nz, long Ti[], long Tj[], long Ap[], long Ai[], long Rp[], long Rj[], long W[], long RowCount[], double Tx[], double Ax[], double Rx[])
{
    long i; long j; long k; long p; long cp; long p1; long p2; long pdest; long pj;
    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]]++ ;
 Rj [p] = Tj [k] ;
 Rx [p] = Tx [k] ;
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = (-1) ;
    }
    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)
     {
  ;
  ;
  Rx [pj] += Rx [p] ;
     }
     else
     {
  W [j] = pdest ;
  if (pdest != p)
  {
      Rj [pdest] = j ;
      Rx [pdest] = Rx [p] ;
  }
  pdest++ ;
     }
 }
 RowCount [i] = pdest - p1 ;
    }
    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]]++ ;
     Ai [cp] = i ;
     Ax [cp] = Rx [p] ;
 }
    }
    return ((0)) ;
}

variable_types:
Tx
double []

variable_types:
Ax
double []

variable_types:
Rx
double []

variable_types: i long

variable_types: j long


decompiled_code:
__int64 __fastcall umfdi_mem_alloc_head_block(unsigned int *a1, int a2)
{
__int64 result; // rax
signed int v3; // edx
unsigned int v4; // esi
signed int v5; // esi

result = a1[26];
if ( (int)(a1[27] - result) < a2 )
return 0LL;
v3 = a1[63];
v4 = result + a2;
a1[26] = v4;
v5 = a1[61] + v4;
if ( v5 < v3 )
v5 = v3;
a1[63] = v5;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int *a1, int a2)
{
__int64 result; // rax
signed int v3; // edx
unsigned int v4; // esi
signed int v5; // esi

result = a1[26];
if ( (int)(a1[27] - result) < a2 )
return 0LL;
v3 = a1[63];
v4 = result + a2;
a1[26] = v4;
v5 = a1[61] + v4;
if ( v5 < v3 )
v5 = v3;
a1[63] = v5;
return result;
}

original_code:
int umfdi_mem_alloc_head_block
(
    NumericType *Numeric,
    int nunits
)
{
    int 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:
int umfdi_mem_alloc_head_block(struct NumericType *Numeric, int nunits)
{
    int p; int 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; 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: nunits int

variable_types: p int

variable_types: usage 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:
int cholmod_l_symmetry
(
    cholmod_sparse *A,
    int option,
    long *p_xmatched,
    long *p_pmatched,
    long *p_nzoffdiag,
    long *p_nzdiag,
    cholmod_common *Common
)
{
    double aij_real = 0, aij_imag = 0, aji_real = 0, aji_imag = 0 ;
    double *Ax, *Az ;
    long *Ap, *Ai, *Anz, *munch ;
    long packed, nrow, ncol, xtype, is_symmetric, is_skew, is_hermitian, posdiag,
 j, p, pend, i, piend, result, xmatched, pmatched, nzdiag, i2, found ;
    { if (Common == ((void *)0)) { return ((-1)) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return ((-1)) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_symmetry.c", 202, "argument missing", Common) ; } return ((-1)) ; } } ;
    { if ((A)->xtype < (0) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_symmetry.c", 203, "invalid xtype", Common) ; } return ((-1)) ; } } ;
    Common->status = 0 ;
    ;
    if (p_xmatched == ((void *)0) || p_pmatched == ((void *)0)
 || p_nzoffdiag == ((void *)0) || p_nzdiag == ((void *)0))
    {
 option = (((option) > (1)) ? (option) : (1)) ;
    }
    Ap = A->p ;
    Ai = A->i ;
    Ax = A->x ;
    Az = A->z ;
    Anz = A->nz ;
    packed = A->packed ;
    ncol = A->ncol ;
    nrow = A->nrow ;
    xtype = A->xtype ;
    if (nrow != ncol)
    {
 return (1) ;
    }
    if (!(A->sorted) || A->stype != 0)
    {
 return ((-1)) ;
    }
    cholmod_l_allocate_work (0, ncol, 0, Common) ;
    if (Common->status < 0)
    {
 return ((-1)) ;
    }
    munch = Common->Iwork ;
    is_hermitian = (xtype >= 2) ;
    is_symmetric = 1 ;
    is_skew = (xtype != 0) ;
    posdiag = 1 ;
    for (j = 0 ; j < ncol ; j++)
    {
 munch [j] = Ap [j] ;
    }
    xmatched = 0 ;
    pmatched = 0 ;
    nzdiag = 0 ;
    for (j = 0 ; j < ncol ; j++)
    {
 p = munch [j] ;
 pend = (packed) ? (Ap [j+1]) : (Ap [j] + Anz [j]) ;
 for ( ; p < pend ; p++)
 {
     i = Ai [p] ;
     if (i < j)
     {
  is_hermitian = 0 ;
  is_symmetric = 0 ;
  is_skew = 0 ;
     }
     else if (i == j)
     {
  get_value (Ax, Az, p, xtype, &aij_real, &aij_imag) ;
  if (aij_real != 0. || aij_imag != 0.)
  {
      nzdiag++ ;
      is_skew = 0 ;
  }
  if (aij_real <= 0. || aij_imag != 0.)
  {
      posdiag = 0 ;
  }
  if (aij_imag != 0.)
  {
      is_hermitian = 0 ;
  }
     }
     else
     {
  piend = (packed) ? (Ap [i+1]) : (Ap [i] + Anz [i]) ;
  found = 0 ;
  for ( ; munch [i] < piend ; munch [i]++)
  {
      i2 = Ai [munch [i]] ;
      if (i2 < j)
      {
   is_hermitian = 0 ;
   is_symmetric = 0 ;
   is_skew = 0 ;
      }
      else if (i2 == j)
      {
   pmatched += 2 ;
   found = 1 ;
   get_value (Ax, Az, p, xtype, &aij_real, &aij_imag) ;
   get_value (Ax, Az, munch [i],
       xtype, &aji_real, &aji_imag) ;
   if (aij_real != aji_real || aij_imag != aji_imag)
   {
       is_symmetric = 0 ;
   }
   if (aij_real != -aji_real || aij_imag != aji_imag)
   {
       is_skew = 0 ;
   }
   if (aij_real != aji_real || aij_imag != -aji_imag)
   {
       is_hermitian = 0 ;
   }
   else
   {
       xmatched += 2 ;
   }
      }
      else
      {
   break ;
      }
  }
  if (!found)
  {
      is_hermitian = 0 ;
      is_symmetric = 0 ;
      is_skew = 0 ;
  }
     }
     if (option < 2 && !(is_symmetric || is_skew || is_hermitian))
     {
  return (2) ;
     }
 }
 if (option < 1 && (!posdiag || nzdiag < ncol))
 {
     return (2) ;
 }
    }
    if (nzdiag < ncol)
    {
        posdiag = 0 ;
    }
    if (option >= 2)
    {
 *p_xmatched = xmatched ;
 *p_pmatched = pmatched ;
 *p_nzoffdiag = cholmod_l_nnz (A, Common) - nzdiag ;
 *p_nzdiag = nzdiag ;
    }
    result = 2 ;
    if (is_hermitian)
    {
 result = posdiag ? 7 : 4 ;
    }
    else if (is_symmetric)
    {
 result = posdiag ? 6 : 3 ;
    }
    else if (is_skew)
    {
 result = 5 ;
    }
    return (result) ;
}

canonical_original_code:
int cholmod_l_symmetry(struct cholmod_sparse_struct *A, int option, long *p_xmatched, long *p_pmatched, long *p_nzoffdiag, long *p_nzdiag, struct cholmod_common_struct *Common)
{
    double aij_real = 0; double aij_imag = 0; double aji_real = 0; double aji_imag = 0;
    double *Ax; double *Az;
    long *Ap; long *Ai; long *Anz; long *munch;
    long packed; long nrow; long ncol; long xtype; long is_symmetric; long is_skew; long is_hermitian; long posdiag; long j; long p; long pend; long i; long piend; long result; long xmatched; long pmatched; long nzdiag; long i2; long found;
    { if (Common == ((void *)0)) { return ((-1)) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return ((-1)) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_symmetry.c", 202, "argument missing", Common) ; } return ((-1)) ; } } ;
    { if ((A)->xtype < (0) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_symmetry.c", 203, "invalid xtype", Common) ; } return ((-1)) ; } } ;
    Common->status = 0 ;
    ;
    if (p_xmatched == ((void *)0) || p_pmatched == ((void *)0)
 || p_nzoffdiag == ((void *)0) || p_nzdiag == ((void *)0))
    {
 option = (((option) > (1)) ? (option) : (1)) ;
    }
    Ap = A->p ;
    Ai = A->i ;
    Ax = A->x ;
    Az = A->z ;
    Anz = A->nz ;
    packed = A->packed ;
    ncol = A->ncol ;
    nrow = A->nrow ;
    xtype = A->xtype ;
    if (nrow != ncol)
    {
 return (1) ;
    }
    if (!(A->sorted) || A->stype != 0)
    {
 return ((-1)) ;
    }
    cholmod_l_allocate_work (0, ncol, 0, Common) ;
    if (Common->status < 0)
    {
 return ((-1)) ;
    }
    munch = Common->Iwork ;
    is_hermitian = (xtype >= 2) ;
    is_symmetric = 1 ;
    is_skew = (xtype != 0) ;
    posdiag = 1 ;
    for (j = 0 ; j < ncol ; j++)
    {
 munch [j] = Ap [j] ;
    }
    xmatched = 0 ;
    pmatched = 0 ;
    nzdiag = 0 ;
    for (j = 0 ; j < ncol ; j++)
    {
 p = munch [j] ;
 pend = (packed) ? (Ap [j+1]) : (Ap [j] + Anz [j]) ;
 for ( ; p < pend ; p++)
 {
     i = Ai [p] ;
     if (i < j)
     {
  is_hermitian = 0 ;
  is_symmetric = 0 ;
  is_skew = 0 ;
     }
     else if (i == j)
     {
  get_value (Ax, Az, p, xtype, &aij_real, &aij_imag) ;
  if (aij_real != 0. || aij_imag != 0.)
  {
      nzdiag++ ;
      is_skew = 0 ;
  }
  if (aij_real <= 0. || aij_imag != 0.)
  {
      posdiag = 0 ;
  }
  if (aij_imag != 0.)
  {
      is_hermitian = 0 ;
  }
     }
     else
     {
  piend = (packed) ? (Ap [i+1]) : (Ap [i] + Anz [i]) ;
  found = 0 ;
  for ( ; munch [i] < piend ; munch [i]++)
  {
      i2 = Ai [munch [i]] ;
      if (i2 < j)
      {
   is_hermitian = 0 ;
   is_symmetric = 0 ;
   is_skew = 0 ;
      }
      else if (i2 == j)
      {
   pmatched += 2 ;
   found = 1 ;
   get_value (Ax, Az, p, xtype, &aij_real, &aij_imag) ;
   get_value (Ax, Az, munch [i],
       xtype, &aji_real, &aji_imag) ;
   if (aij_real != aji_real || aij_imag != aji_imag)
   {
       is_symmetric = 0 ;
   }
   if (aij_real != -aji_real || aij_imag != aji_imag)
   {
       is_skew = 0 ;
   }
   if (aij_real != aji_real || aij_imag != -aji_imag)
   {
       is_hermitian = 0 ;
   }
   else
   {
       xmatched += 2 ;
   }
      }
      else
      {
   break ;
      }
  }
  if (!found)
  {
      is_hermitian = 0 ;
      is_symmetric = 0 ;
      is_skew = 0 ;
  }
     }
     if (option < 2 && !(is_symmetric || is_skew || is_hermitian))
     {
  return (2) ;
     }
 }
 if (option < 1 && (!posdiag || nzdiag < ncol))
 {
     return (2) ;
 }
    }
    if (nzdiag < ncol)
    {
        posdiag = 0 ;
    }
    if (option >= 2)
    {
 *p_xmatched = xmatched ;
 *p_pmatched = pmatched ;
 *p_nzoffdiag = cholmod_l_nnz (A, Common) - nzdiag ;
 *p_nzdiag = nzdiag ;
    }
    result = 2 ;
    if (is_hermitian)
    {
 result = posdiag ? 7 : 4 ;
    }
    else if (is_symmetric)
    {
 result = posdiag ? 6 : 3 ;
    }
    else if (is_skew)
    {
 result = 5 ;
    }
    return (result) ;
}

variable_types: struct cholmod_sparse_struct { unsigned long nrow; unsigned long ncol; unsigned long nzmax; void *p; void *i; void *nz; void *x; void *z; int stype; int itype; int xtype; int dtype; int sorted; int packed; } *

variable_types: option int

variable_types: struct cholmod_common_struct { double dbound; double grow0; double grow1; unsigned long grow2; unsigned long maxrank; double supernodal_switch; int supernodal; int final_asis; int final_super; int final_ll; int final_pack; int final_monotonic; int final_resymbol; double zrelax[3]; unsigned long nrelax[3]; int prefer_zomplex; int prefer_upper; int quick_return_if_not_posdef; int print; int precise; int (*print_function)(char *, ...); int try_catch; void (*error_handler)(int status, char *file, int line, char *message); int nmethods; int current; int selected; struct cholmod_method_struct { double lnz; double fl; double prune_dense; double prune_dense2; double nd_oksep; double other_1[4]; unsigned long nd_small; unsigned long other_2[4]; int aggressive; int order_for_lu; int nd_compress; int nd_camd; int nd_components; int ordering; unsigned long other_3[4]; } method[-1]; int postorder; void *(*malloc_memory)(unsigned long); void *(*realloc_memory)(void *, unsigned long); void (*free_memory)(void *); void *(*calloc_memory)(unsigned long, unsigned long); int (*complex_divide)(double ax, double az, double bx, double bz, double *cx, double *cz); double (*hypotenuse)(double x, double y); double metis_memory; double metis_dswitch; unsigned long metis_nswitch; unsigned long nrow; long mark; unsigned long iworksize; unsigned long xworksize; void *Flag; void *Head; void *Xwork; void *Iwork; int itype; int dtype; int no_workspace_reallocate; int status; double fl; double lnz; double anz; double modfl; unsigned long malloc_count; unsigned long memory_usage; unsigned long memory_inuse; double nrealloc_col; double nrealloc_factor; double ndbounds_hit; double rowfacfl; double aatfl; double other1[10]; double SPQR_xstat[4]; double SPQR_grain; double SPQR_small; long SPQR_istat[10]; long other2[6]; int other3[10]; int prefer_binary; int default_nesdis; int called_nd; int blas_ok; int SPQR_shrink; int SPQR_nthreads; unsigned long other4[16]; void *other5[16]; } *

variable_types:
Ax
double *

variable_types:
Az
double *

variable_types:
Ap
long *

variable_types:
Ai
long *

variable_types:
Anz
long *

variable_types:
munch
long *

variable_types: packed long

variable_types: nrow long

variable_types: ncol long

variable_types: xtype long

variable_types: posdiag long

variable_types: pend long

variable_types: piend long

variable_types: result long

variable_types: xmatched long

variable_types: pmatched long

variable_types: nzdiag long

variable_types: found long

user_defined_types: struct cholmod_common_struct { double dbound; double grow0; double grow1; unsigned long grow2; unsigned long maxrank; double supernodal_switch; int supernodal; int final_asis; int final_super; int final_ll; int final_pack; int final_monotonic; int final_resymbol; double zrelax[3]; unsigned long nrelax[3]; int prefer_zomplex; int prefer_upper; int quick_return_if_not_posdef; int print; int precise; int (*print_function)(char *, ...); int try_catch; void (*error_handler)(int status, char *file, int line, char *message); int nmethods; int current; int selected; struct cholmod_method_struct method[-1]; int postorder; void *(*malloc_memory)(unsigned long); void *(*realloc_memory)(void *, unsigned long); void (*free_memory)(void *); void *(*calloc_memory)(unsigned long, unsigned long); int (*complex_divide)(double ax, double az, double bx, double bz, double *cx, double *cz); double (*hypotenuse)(double x, double y); double metis_memory; double metis_dswitch; unsigned long metis_nswitch; unsigned long nrow; long mark; unsigned long iworksize; unsigned long xworksize; void *Flag; void *Head; void *Xwork; void *Iwork; int itype; int dtype; int no_workspace_reallocate; int status; double fl; double lnz; double anz; double modfl; unsigned long malloc_count; unsigned long memory_usage; unsigned long memory_inuse; double nrealloc_col; double nrealloc_factor; double ndbounds_hit; double rowfacfl; double aatfl; double other1[10]; double SPQR_xstat[4]; double SPQR_grain; double SPQR_small; long SPQR_istat[10]; long other2[6]; int other3[10]; int prefer_binary; int default_nesdis; int called_nd; int blas_ok; int SPQR_shrink; int SPQR_nthreads; unsigned long other4[16]; void *other5[16]; }


original_code:
int umfzi_triplet_nomap_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 i, j, k, p, cp, p1, p2, pdest, pj ;
    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]]++ ;
 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) ;
    }
    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)
     {
  ;
  ;
  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 ;
  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 ;
    }
    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]]++ ;
     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] ;
     }
 }
    }
    return ((0)) ;
}

canonical_original_code:
int umfzi_triplet_nomap_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 i; int j; int k; int p; int cp; int p1; int p2; int pdest; int pj;
    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]]++ ;
 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) ;
    }
    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)
     {
  ;
  ;
  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 ;
  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 ;
    }
    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]]++ ;
     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] ;
     }
 }
    }
    return ((0)) ;
}

variable_types: nz int

variable_types:
Ti
int []

variable_types:
Tj
int []

variable_types:
Ap
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: i int

variable_types: j int

variable_types: k int

variable_types: p int

variable_types: cp int

variable_types: pdest int

variable_types: pj int

variable_types: split int


original_code:
long umfpack_zl_get_lunz
(
    long *lnz,
    long *unz,
    long *n_row,
    long *n_col,
    long *nz_udiag,
    void *NumericHandle
)
{
    NumericType *Numeric ;
    Numeric = (NumericType *) NumericHandle ;
    if (!umfzl_valid_numeric (Numeric))
    {
 return ((-3)) ;
    }
    if (!lnz || !unz || !n_row || !n_col || !nz_udiag)
    {
 return ((-5)) ;
    }
    *n_row = Numeric->n_row ;
    *n_col = Numeric->n_col ;
    *lnz = Numeric->lnz + (((Numeric->n_row) < (Numeric->n_col)) ? (Numeric->n_row) : (Numeric->n_col)) ;
    *unz = Numeric->unz + Numeric->nnzpiv ;
    *nz_udiag = Numeric->nnzpiv ;
    return ((0)) ;
}

canonical_original_code:
long umfpack_zl_get_lunz(long *lnz, long *unz, long *n_row, long *n_col, long *nz_udiag, void *NumericHandle)
{
    struct NumericType *Numeric;
    Numeric = (struct NumericType *) NumericHandle ;
    if (!umfzl_valid_numeric (Numeric))
    {
 return ((-3)) ;
    }
    if (!lnz || !unz || !n_row || !n_col || !nz_udiag)
    {
 return ((-5)) ;
    }
    *n_row = Numeric->n_row ;
    *n_col = Numeric->n_col ;
    *lnz = Numeric->lnz + (((Numeric->n_row) < (Numeric->n_col)) ? (Numeric->n_row) : (Numeric->n_col)) ;
    *unz = Numeric->unz + Numeric->nnzpiv ;
    *nz_udiag = Numeric->nnzpiv ;
    return ((0)) ;
}

variable_types:
lnz
long *

variable_types:
unz
long *

variable_types:
NumericHandle
void *

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; } *

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; }


original_code:
double umfdi_symbolic_usage
(
    int n_row,
    int n_col,
    int nchains,
    int nfr,
    int esize,
    int prefer_diagonal
)
{
    double units ;
    units =
 (ceil ((sizeof (SymbolicType) * ((double) 1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (int) * ((double) n_col+1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (int) * ((double) n_row+1)) / sizeof (Unit)))
 + 3 * (ceil ((sizeof (int) * ((double) nchains+1)) / sizeof (Unit)))
 + 4 * (ceil ((sizeof (int) * ((double) nfr+1)) / sizeof (Unit))) ;
    units += (ceil ((sizeof (int) * ((double) esize)) / sizeof (Unit))) ;
    if (prefer_diagonal)
    {
 units += (ceil ((sizeof (int) * ((double) n_col+1)) / sizeof (Unit))) ;
    }
    return (units) ;
}

canonical_original_code:
double umfdi_symbolic_usage(int n_row, int n_col, int nchains, int nfr, int esize, int prefer_diagonal)
{
    double units;
    units =
 (ceil ((sizeof (SymbolicType) * ((double) 1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (int) * ((double) n_col+1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (int) * ((double) n_row+1)) / sizeof (Unit)))
 + 3 * (ceil ((sizeof (int) * ((double) nchains+1)) / sizeof (Unit)))
 + 4 * (ceil ((sizeof (int) * ((double) nfr+1)) / sizeof (Unit))) ;
    units += (ceil ((sizeof (int) * ((double) esize)) / sizeof (Unit))) ;
    if (prefer_diagonal)
    {
 units += (ceil ((sizeof (int) * ((double) n_col+1)) / sizeof (Unit))) ;
    }
    return (units) ;
}

variable_types: nchains int

variable_types: nfr int

variable_types: esize int

variable_types: units double

return_type: double


original_code:
long
umfpack_zl_wsolve
(
    long sys,
    const long Ap [ ],
    const long Ai [ ],
    const double Ax [ ],
    const double Az [ ],
    double Xx [ ],
    double Xz [ ],
    const double Bx [ ],
    const double Bz [ ],
    void *NumericHandle,
    const double Control [20],
    double User_Info [90]
    , long Pattern [ ],
    double W [ ]
)
{
    double Info2 [90], stats [2] ;
    double *Info ;
    NumericType *Numeric ;
    long 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 (!umfzl_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 = umfzl_solve (sys, Ap, Ai, Ax, Xx, Bx,
 Az, Xz, Bz,
 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:
long umfpack_zl_wsolve(long sys, long Ap[], long Ai[], double Ax[], double Az[], double Xx[], double Xz[], double Bx[], double Bz[], void *NumericHandle, double Control[20], double User_Info[90], long Pattern[], double W[])
{
    double Info2[90]; double stats[2];
    double *Info;
    struct NumericType *Numeric;
    long n; long i; long irstep; long 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 (!umfzl_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 = umfzl_solve (sys, Ap, Ai, Ax, Xx, Bx,
 Az, Xz, Bz,
 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 long

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
Az
double []

variable_types:
Xx
double []

variable_types:
Xz
double []

variable_types:
Bx
double []

variable_types:
Bz
double []

variable_types:
Control
double [20]

variable_types:
Pattern
long []

variable_types:
W
double []

variable_types:
stats
double [2]

variable_types:
Info
double *

variable_types: n long

variable_types: i long

variable_types: irstep long

variable_types: status long

user_defined_types: union Unit_union { struct { long size; } header; double xxxxxx; }

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


original_code:
long umfpack_zl_report_symbolic
(
    void *SymbolicHandle,
    const double Control [20]
)
{
    long n_row, n_col, nz, nchains, nfr, maxnrows, maxncols, prl,
 k, chain, frontid, frontid1, frontid2, kk, *Chain_start, *W,
 *Chain_maxrows, *Chain_maxcols, *Front_npivcol, *Front_1strow,
 *Front_leftmostdesc, *Front_parent, done, status1, status2 ;
    SymbolicType *Symbolic ;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    { if (amd_printf != ((void *)0)) (void) amd_printf ("Symbolic object: ") ; } ;
    Symbolic = (SymbolicType *) SymbolicHandle ;
    if (!umfzl_valid_symbolic (Symbolic))
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid\n") ; } ;
 return ((-4)) ;
    }
    n_row = Symbolic->n_row ;
    n_col = Symbolic->n_col ;
    nz = Symbolic->nz ;
    nchains = Symbolic->nchains ;
    nfr = Symbolic->nfr ;
    maxnrows = Symbolic->maxnrows ;
    maxncols = Symbolic->maxncols ;
    Chain_start = Symbolic->Chain_start ;
    Chain_maxrows = Symbolic->Chain_maxrows ;
    Chain_maxcols = Symbolic->Chain_maxcols ;
    Front_npivcol = Symbolic->Front_npivcol ;
    Front_1strow = Symbolic->Front_1strow ;
    Front_leftmostdesc = Symbolic->Front_leftmostdesc ;
    Front_parent = Symbolic->Front_parent ;
    if (prl >= 4)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\n    matrix to be factorized:\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tn_row: ""%" "ld"" n_col: ""%" "ld""\n", n_row, n_col) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of entries: ""%" "ld""\n", nz) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    block size used for dense matrix kernels:   ""%" "ld""\n", Symbolic->nb) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    strategy used:                              ") ; } ;
 if (Symbolic->strategy == 3)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("symmetric\n") ; } ;
            { if (amd_printf != ((void *)0)) (void) amd_printf ("    ordering used:                              ") ; } ;
            if (Symbolic->ordering == 1)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("amd on A\n") ; } ;
            }
            else if (Symbolic->ordering == 2)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user permutation") ; } ;
            }
            else if (Symbolic->ordering == 6)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user function") ; } ;
            }
            else if (Symbolic->ordering == 3)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("metis on A") ; } ;
            }
 }
 else
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("unsymmetric\n") ; } ;
            { if (amd_printf != ((void *)0)) (void) amd_printf ("    ordering used:                              ") ; } ;
            if (Symbolic->ordering == 1)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("colamd on A\n") ; } ;
            }
            else if (Symbolic->ordering == 2)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user permutation") ; } ;
            }
            else if (Symbolic->ordering == 6)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user function") ; } ;
            }
            else if (Symbolic->ordering == 3)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("metis on A'A") ; } ;
            }
 }
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    performn column etree postorder:            ") ; } ;
 if (Symbolic->fixQ)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("no\n") ; } ;
 }
 else
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("yes\n") ; } ;
 }
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    prefer diagonal pivoting (attempt P=Q):     ") ; } ;
 if (Symbolic->prefer_diagonal)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("yes\n") ; } ;
 }
 else
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("no\n") ; } ;
 }
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    variable-size part of Numeric object:\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tminimum initial size (Units): %.20g  (MBytes): %.1f\n", Symbolic->dnum_mem_init_usage, (((Symbolic->dnum_mem_init_usage) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\testimated peak size (Units):  %.20g  (MBytes): %.1f\n", Symbolic->num_mem_usage_est, (((Symbolic->num_mem_usage_est) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\testimated final size (Units): %.20g  (MBytes): %.1f\n", Symbolic->num_mem_size_est, (((Symbolic->num_mem_size_est) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    symbolic factorization memory usage (Units):" " %.20g  (MBytes): %.1f\n", Symbolic->peak_sym_usage, (((Symbolic->peak_sym_usage) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    frontal matrices / supercolumns:\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of frontal chains: ""%" "ld""\n", nchains) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of frontal matrices: ""%" "ld""\n", nfr) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tlargest frontal matrix row dimension: ""%" "ld""\n", maxnrows) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tlargest frontal matrix column dimension: ""%" "ld""\n",maxncols) ; };
    }
    k = 0 ;
    done = (0) ;
    for (chain = 0 ; chain < nchains ; chain++)
    {
 frontid1 = Chain_start [chain] ;
 frontid2 = Chain_start [chain+1] - 1 ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n    Frontal chain: ""%" "ld"".  Frontal matrices ""%" "ld"" to ""%" "ld""\n", (chain), (frontid1), (frontid2)) ; } ; } } ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tLargest frontal matrix in Frontal chain: ""%" "ld""-by-""%" "ld""\n", Chain_maxrows [chain], Chain_maxcols [chain]) ; } ; } } ;
 for (frontid = frontid1 ; frontid <= frontid2 ; frontid++)
 {
     kk = Front_npivcol [frontid] ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tFront: ""%" "ld""  pivot cols: ""%" "ld"" (pivot columns ""%" "ld"" to " "%" "ld"")\n", (frontid), kk, (k), (k+kk-1)) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    pivot row candidates: ""%" "ld"" to ""%" "ld""\n", (Front_1strow [Front_leftmostdesc [frontid]]), (Front_1strow [frontid+1]-1)) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    leftmost descendant: ""%" "ld""\n", (Front_leftmostdesc [frontid])) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    1st new candidate row : ""%" "ld""\n", (Front_1strow [frontid])) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    parent:") ; } ; } } ;
     if (Front_parent [frontid] == (-1))
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" (none)\n") ; } ; } } ;
     }
     else
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" ""%" "ld""\n", (Front_parent [frontid])) ; } ; } } ;
     }
     done = (frontid == 20 && frontid < nfr-1 && prl == 4) ;
     if (done)
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t...\n") ; } ; } } ;
  break ;
     }
     k += kk ;
 }
 if (Front_npivcol [nfr] != 0)
 {
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tFront: ""%" "ld"" placeholder for ""%" "ld"" empty columns\n", (nfr), Front_npivcol [nfr]) ; } ; } } ;
 }
 if (done)
 {
     break ;
 }
    }
    W = (long *) umf_l_malloc ((((n_row) > (n_col)) ? (n_row) : (n_col)), sizeof (long)) ;
    if (!W)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: out of memory to check Symbolic object\n\n") ; } ;
 return ((-1)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\nInitial column permutation, Q1: ") ; } ; } } ;
    status1 = umf_l_report_perm (n_col, Symbolic->Cperm_init, W, prl, 0) ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\nInitial row permutation, P1: ") ; } ; } } ;
    status2 = umf_l_report_perm (n_row, Symbolic->Rperm_init, W, prl, 0) ;
    (void) umf_l_free ((void *) W) ;
    if (status1 != (0) || status2 != (0))
    {
 return ((-4)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    Symbolic object:  ") ; } ; } } ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    return ((0)) ;
}

canonical_original_code:
long umfpack_zl_report_symbolic(void *SymbolicHandle, double Control[20])
{
    long n_row; long n_col; long nz; long nchains; long nfr; long maxnrows; long maxncols; long prl; long k; long chain; long frontid; long frontid1; long frontid2; long kk; long *Chain_start; long *W; long *Chain_maxrows; long *Chain_maxcols; long *Front_npivcol; long *Front_1strow; long *Front_leftmostdesc; long *Front_parent; long done; long status1; long status2;
    struct SymbolicType *Symbolic;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    { if (amd_printf != ((void *)0)) (void) amd_printf ("Symbolic object: ") ; } ;
    Symbolic = (struct SymbolicType *) SymbolicHandle ;
    if (!umfzl_valid_symbolic (Symbolic))
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid\n") ; } ;
 return ((-4)) ;
    }
    n_row = Symbolic->n_row ;
    n_col = Symbolic->n_col ;
    nz = Symbolic->nz ;
    nchains = Symbolic->nchains ;
    nfr = Symbolic->nfr ;
    maxnrows = Symbolic->maxnrows ;
    maxncols = Symbolic->maxncols ;
    Chain_start = Symbolic->Chain_start ;
    Chain_maxrows = Symbolic->Chain_maxrows ;
    Chain_maxcols = Symbolic->Chain_maxcols ;
    Front_npivcol = Symbolic->Front_npivcol ;
    Front_1strow = Symbolic->Front_1strow ;
    Front_leftmostdesc = Symbolic->Front_leftmostdesc ;
    Front_parent = Symbolic->Front_parent ;
    if (prl >= 4)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\n    matrix to be factorized:\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tn_row: ""%" "ld"" n_col: ""%" "ld""\n", n_row, n_col) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of entries: ""%" "ld""\n", nz) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    block size used for dense matrix kernels:   ""%" "ld""\n", Symbolic->nb) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    strategy used:                              ") ; } ;
 if (Symbolic->strategy == 3)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("symmetric\n") ; } ;
            { if (amd_printf != ((void *)0)) (void) amd_printf ("    ordering used:                              ") ; } ;
            if (Symbolic->ordering == 1)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("amd on A\n") ; } ;
            }
            else if (Symbolic->ordering == 2)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user permutation") ; } ;
            }
            else if (Symbolic->ordering == 6)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user function") ; } ;
            }
            else if (Symbolic->ordering == 3)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("metis on A") ; } ;
            }
 }
 else
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("unsymmetric\n") ; } ;
            { if (amd_printf != ((void *)0)) (void) amd_printf ("    ordering used:                              ") ; } ;
            if (Symbolic->ordering == 1)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("colamd on A\n") ; } ;
            }
            else if (Symbolic->ordering == 2)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user permutation") ; } ;
            }
            else if (Symbolic->ordering == 6)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user function") ; } ;
            }
            else if (Symbolic->ordering == 3)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("metis on A'A") ; } ;
            }
 }
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    performn column etree postorder:            ") ; } ;
 if (Symbolic->fixQ)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("no\n") ; } ;
 }
 else
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("yes\n") ; } ;
 }
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    prefer diagonal pivoting (attempt P=Q):     ") ; } ;
 if (Symbolic->prefer_diagonal)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("yes\n") ; } ;
 }
 else
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("no\n") ; } ;
 }
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    variable-size part of Numeric object:\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tminimum initial size (Units): %.20g  (MBytes): %.1f\n", Symbolic->dnum_mem_init_usage, (((Symbolic->dnum_mem_init_usage) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\testimated peak size (Units):  %.20g  (MBytes): %.1f\n", Symbolic->num_mem_usage_est, (((Symbolic->num_mem_usage_est) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\testimated final size (Units): %.20g  (MBytes): %.1f\n", Symbolic->num_mem_size_est, (((Symbolic->num_mem_size_est) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    symbolic factorization memory usage (Units):" " %.20g  (MBytes): %.1f\n", Symbolic->peak_sym_usage, (((Symbolic->peak_sym_usage) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    frontal matrices / supercolumns:\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of frontal chains: ""%" "ld""\n", nchains) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of frontal matrices: ""%" "ld""\n", nfr) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tlargest frontal matrix row dimension: ""%" "ld""\n", maxnrows) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tlargest frontal matrix column dimension: ""%" "ld""\n",maxncols) ; };
    }
    k = 0 ;
    done = (0) ;
    for (chain = 0 ; chain < nchains ; chain++)
    {
 frontid1 = Chain_start [chain] ;
 frontid2 = Chain_start [chain+1] - 1 ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n    Frontal chain: ""%" "ld"".  Frontal matrices ""%" "ld"" to ""%" "ld""\n", (chain), (frontid1), (frontid2)) ; } ; } } ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tLargest frontal matrix in Frontal chain: ""%" "ld""-by-""%" "ld""\n", Chain_maxrows [chain], Chain_maxcols [chain]) ; } ; } } ;
 for (frontid = frontid1 ; frontid <= frontid2 ; frontid++)
 {
     kk = Front_npivcol [frontid] ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tFront: ""%" "ld""  pivot cols: ""%" "ld"" (pivot columns ""%" "ld"" to " "%" "ld"")\n", (frontid), kk, (k), (k+kk-1)) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    pivot row candidates: ""%" "ld"" to ""%" "ld""\n", (Front_1strow [Front_leftmostdesc [frontid]]), (Front_1strow [frontid+1]-1)) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    leftmost descendant: ""%" "ld""\n", (Front_leftmostdesc [frontid])) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    1st new candidate row : ""%" "ld""\n", (Front_1strow [frontid])) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    parent:") ; } ; } } ;
     if (Front_parent [frontid] == (-1))
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" (none)\n") ; } ; } } ;
     }
     else
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" ""%" "ld""\n", (Front_parent [frontid])) ; } ; } } ;
     }
     done = (frontid == 20 && frontid < nfr-1 && prl == 4) ;
     if (done)
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t...\n") ; } ; } } ;
  break ;
     }
     k += kk ;
 }
 if (Front_npivcol [nfr] != 0)
 {
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tFront: ""%" "ld"" placeholder for ""%" "ld"" empty columns\n", (nfr), Front_npivcol [nfr]) ; } ; } } ;
 }
 if (done)
 {
     break ;
 }
    }
    W = (long *) umf_l_malloc ((((n_row) > (n_col)) ? (n_row) : (n_col)), sizeof (long)) ;
    if (!W)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: out of memory to check Symbolic object\n\n") ; } ;
 return ((-1)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\nInitial column permutation, Q1: ") ; } ; } } ;
    status1 = umf_l_report_perm (n_col, Symbolic->Cperm_init, W, prl, 0) ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\nInitial row permutation, P1: ") ; } ; } } ;
    status2 = umf_l_report_perm (n_row, Symbolic->Rperm_init, W, prl, 0) ;
    (void) umf_l_free ((void *) W) ;
    if (status1 != (0) || status2 != (0))
    {
 return ((-4)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    Symbolic object:  ") ; } ; } } ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    return ((0)) ;
}

variable_types:
SymbolicHandle
void *

variable_types: nz long

variable_types: nchains long

variable_types: nfr long

variable_types: maxnrows long

variable_types: maxncols long

variable_types: prl long

variable_types: k long

variable_types: chain long

variable_types: frontid long

variable_types: kk long

variable_types:
W
long *

variable_types: done long

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


original_code:
long umfdl_start_front
(
    long chain,
    NumericType *Numeric,
    WorkType *Work,
    SymbolicType *Symbolic
)
{
    double maxbytes ;
    long fnrows_max, fncols_max, fnr2, fnc2, fsize, fcurr_size, maxfrsize,
 overflow, nb, f, cdeg ;
    nb = Symbolic->nb ;
    fnrows_max = Symbolic->Chain_maxrows [chain] ;
    fncols_max = Symbolic->Chain_maxcols [chain] ;
    ;
    Work->fnrows_max = fnrows_max ;
    Work->fncols_max = fncols_max ;
    Work->any_skip = (0) ;
    maxbytes = sizeof (double) *
 (double) (fnrows_max + nb) * (double) (fncols_max + nb) ;
    fcurr_size = Work->fcurr_size ;
    if (Symbolic->prefer_diagonal)
    {
 long col, tpi, e, *E, *Col_tuples, *Col_tlen, *Cols ;
 Tuple *tp, *tpend ;
 Unit *Memory, *p ;
 Element *ep ;
 E = Work->E ;
 Memory = Numeric->Memory ;
 Col_tuples = Numeric->Lip ;
 Col_tlen = Numeric->Lilen ;
 col = Work->nextcand ;
 tpi = Col_tuples [col] ;
 tp = (Tuple *) Memory + tpi ;
 tpend = tp + Col_tlen [col] ;
 cdeg = 0 ;
 ;
 for ( ; tp < tpend ; tp++)
 {
     ;
     e = tp->e ;
     if (!E [e]) continue ;
     f = tp->f ;
     p = Memory + E [e] ;
     ep = (Element *) p ;
     p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Cols = (long *) p ;
     if (Cols [f] == (-1)) continue ;
     ;
     cdeg += ep->nrowsleft ;
 }
 if (Symbolic->amd_dmax > 0)
 {
     cdeg = (((cdeg) < (Symbolic->amd_dmax)) ? (cdeg) : (Symbolic->amd_dmax)) ;
 }
 cdeg += 2 ;
 cdeg = (((cdeg) < (fnrows_max)) ? (cdeg) : (fnrows_max)) ;
    }
    else
    {
 cdeg = 0 ;
    }
    ;
    ;
    ;
    ;
    overflow = ((!((maxbytes) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || ((maxbytes) != (maxbytes))) ;
    if (overflow)
    {
 maxfrsize = 0x7fffffffffffffffL / sizeof (double) ;
    }
    else
    {
 maxfrsize = (fnrows_max + nb) * (fncols_max + nb) ;
    }
    ;
    if (Numeric->front_alloc_init < 0)
    {
 fsize = -Numeric->front_alloc_init ;
 fsize = (((1) > (fsize)) ? (1) : (fsize)) ;
    }
    else
    {
 if (((!((Numeric->front_alloc_init * maxbytes) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || ((Numeric->front_alloc_init * maxbytes) != (Numeric->front_alloc_init * maxbytes))))
 {
     fsize = 0x7fffffffffffffffL / sizeof (double) ;
 }
 else
 {
     fsize = Numeric->front_alloc_init * maxfrsize ;
 }
 if (cdeg > 0)
 {
     long fsize2 ;
     cdeg += nb ;
     if (((!((((double) cdeg * (double) cdeg) * sizeof (double)) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || ((((double) cdeg * (double) cdeg) * sizeof (double)) != (((double) cdeg * (double) cdeg) * sizeof (double)))))
     {
  fsize2 = 0x7fffffffffffffffL / sizeof (double) ;
     }
     else
     {
  fsize2 = (((cdeg * cdeg) > (fcurr_size)) ? (cdeg * cdeg) : (fcurr_size)) ;
     }
     fsize = (((fsize) < (fsize2)) ? (fsize) : (fsize2)) ;
 }
    }
    fsize = (((fsize) > (2*nb*nb)) ? (fsize) : (2*nb*nb)) ;
    ;
    Work->fnrows_new = 0 ;
    Work->fncols_new = 0 ;
    ;
    ;
    if (fsize >= maxfrsize && !overflow)
    {
 fnr2 = fnrows_max + nb ;
 fnc2 = fncols_max + nb ;
 fsize = maxfrsize ;
 ;
    }
    else
    {
 if (fnrows_max <= fncols_max)
 {
     fnr2 = (long) sqrt ((double) fsize) ;
     fnr2 = (((fnr2) > (1)) ? (fnr2) : (1)) ;
     if (fnr2 % 2 == 0) fnr2++ ;
     fnr2 = (((fnr2) < (fnrows_max + nb)) ? (fnr2) : (fnrows_max + nb)) ;
     fnc2 = fsize / fnr2 ;
 }
 else
 {
     fnc2 = (long) sqrt ((double) fsize) ;
     fnc2 = (((fnc2) < (fncols_max + nb)) ? (fnc2) : (fncols_max + nb)) ;
     fnr2 = fsize / fnc2 ;
     fnr2 = (((fnr2) > (1)) ? (fnr2) : (1)) ;
     if (fnr2 % 2 == 0)
     {
  fnr2++ ;
  fnc2 = fsize / fnr2 ;
     }
 }
 ;
    }
    fnr2 = (((fnr2) < (fnrows_max + nb)) ? (fnr2) : (fnrows_max + nb)) ;
    fnc2 = (((fnc2) < (fncols_max + nb)) ? (fnc2) : (fncols_max + nb)) ;
    ;
    ;
    fnr2 -= nb ;
    fnc2 -= nb ;
    ;
    ;
    if (fsize > fcurr_size)
    {
 ;
 Work->do_grow = (1) ;
 if (!umfdl_grow_front (Numeric, fnr2, fnc2, Work, -1))
 {
     ;
     return ((0)) ;
 }
    }
    else
    {
 ;
 Work->fnr_curr = fnr2 ;
 Work->fnc_curr = fnc2 ;
 Work->Flblock = Work->Flublock + nb * nb ;
 Work->Fublock = Work->Flblock + nb * fnr2 ;
 Work->Fcblock = Work->Fublock + nb * fnc2 ;
    }
    ;
    ;
    ;
    return ((1)) ;
}

canonical_original_code:
long umfdl_start_front(long chain, struct NumericType *Numeric, struct WorkType *Work, struct SymbolicType *Symbolic)
{
    double maxbytes;
    long fnrows_max; long fncols_max; long fnr2; long fnc2; long fsize; long fcurr_size; long maxfrsize; long overflow; long nb; long f; long cdeg;
    nb = Symbolic->nb ;
    fnrows_max = Symbolic->Chain_maxrows [chain] ;
    fncols_max = Symbolic->Chain_maxcols [chain] ;
    ;
    Work->fnrows_max = fnrows_max ;
    Work->fncols_max = fncols_max ;
    Work->any_skip = (0) ;
    maxbytes = sizeof (double) *
 (double) (fnrows_max + nb) * (double) (fncols_max + nb) ;
    fcurr_size = Work->fcurr_size ;
    if (Symbolic->prefer_diagonal)
    {
 long col; long tpi; long e; long *E; long *Col_tuples; long *Col_tlen; long *Cols;
 struct Tuple *tp; struct Tuple *tpend;
 union Unit_union *Memory; union Unit_union *p;
 struct Element *ep;
 E = Work->E ;
 Memory = Numeric->Memory ;
 Col_tuples = Numeric->Lip ;
 Col_tlen = Numeric->Lilen ;
 col = Work->nextcand ;
 tpi = Col_tuples [col] ;
 tp = (struct Tuple *) Memory + tpi ;
 tpend = tp + Col_tlen [col] ;
 cdeg = 0 ;
 ;
 for ( ; tp < tpend ; tp++)
 {
     ;
     e = tp->e ;
     if (!E [e]) continue ;
     f = tp->f ;
     p = Memory + E [e] ;
     ep = (struct Element *) p ;
     p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Cols = (long *) p ;
     if (Cols [f] == (-1)) continue ;
     ;
     cdeg += ep->nrowsleft ;
 }
 if (Symbolic->amd_dmax > 0)
 {
     cdeg = (((cdeg) < (Symbolic->amd_dmax)) ? (cdeg) : (Symbolic->amd_dmax)) ;
 }
 cdeg += 2 ;
 cdeg = (((cdeg) < (fnrows_max)) ? (cdeg) : (fnrows_max)) ;
    }
    else
    {
 cdeg = 0 ;
    }
    ;
    ;
    ;
    ;
    overflow = ((!((maxbytes) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || ((maxbytes) != (maxbytes))) ;
    if (overflow)
    {
 maxfrsize = 0x7fffffffffffffffL / sizeof (double) ;
    }
    else
    {
 maxfrsize = (fnrows_max + nb) * (fncols_max + nb) ;
    }
    ;
    if (Numeric->front_alloc_init < 0)
    {
 fsize = -Numeric->front_alloc_init ;
 fsize = (((1) > (fsize)) ? (1) : (fsize)) ;
    }
    else
    {
 if (((!((Numeric->front_alloc_init * maxbytes) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || ((Numeric->front_alloc_init * maxbytes) != (Numeric->front_alloc_init * maxbytes))))
 {
     fsize = 0x7fffffffffffffffL / sizeof (double) ;
 }
 else
 {
     fsize = Numeric->front_alloc_init * maxfrsize ;
 }
 if (cdeg > 0)
 {
     long fsize2;
     cdeg += nb ;
     if (((!((((double) cdeg * (double) cdeg) * sizeof (double)) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || ((((double) cdeg * (double) cdeg) * sizeof (double)) != (((double) cdeg * (double) cdeg) * sizeof (double)))))
     {
  fsize2 = 0x7fffffffffffffffL / sizeof (double) ;
     }
     else
     {
  fsize2 = (((cdeg * cdeg) > (fcurr_size)) ? (cdeg * cdeg) : (fcurr_size)) ;
     }
     fsize = (((fsize) < (fsize2)) ? (fsize) : (fsize2)) ;
 }
    }
    fsize = (((fsize) > (2*nb*nb)) ? (fsize) : (2*nb*nb)) ;
    ;
    Work->fnrows_new = 0 ;
    Work->fncols_new = 0 ;
    ;
    ;
    if (fsize >= maxfrsize && !overflow)
    {
 fnr2 = fnrows_max + nb ;
 fnc2 = fncols_max + nb ;
 fsize = maxfrsize ;
 ;
    }
    else
    {
 if (fnrows_max <= fncols_max)
 {
     fnr2 = (long) sqrt ((double) fsize) ;
     fnr2 = (((fnr2) > (1)) ? (fnr2) : (1)) ;
     if (fnr2 % 2 == 0) fnr2++ ;
     fnr2 = (((fnr2) < (fnrows_max + nb)) ? (fnr2) : (fnrows_max + nb)) ;
     fnc2 = fsize / fnr2 ;
 }
 else
 {
     fnc2 = (long) sqrt ((double) fsize) ;
     fnc2 = (((fnc2) < (fncols_max + nb)) ? (fnc2) : (fncols_max + nb)) ;
     fnr2 = fsize / fnc2 ;
     fnr2 = (((fnr2) > (1)) ? (fnr2) : (1)) ;
     if (fnr2 % 2 == 0)
     {
  fnr2++ ;
  fnc2 = fsize / fnr2 ;
     }
 }
 ;
    }
    fnr2 = (((fnr2) < (fnrows_max + nb)) ? (fnr2) : (fnrows_max + nb)) ;
    fnc2 = (((fnc2) < (fncols_max + nb)) ? (fnc2) : (fncols_max + nb)) ;
    ;
    ;
    fnr2 -= nb ;
    fnc2 -= nb ;
    ;
    ;
    if (fsize > fcurr_size)
    {
 ;
 Work->do_grow = (1) ;
 if (!umfdl_grow_front (Numeric, fnr2, fnc2, Work, -1))
 {
     ;
     return ((0)) ;
 }
    }
    else
    {
 ;
 Work->fnr_curr = fnr2 ;
 Work->fnc_curr = fnc2 ;
 Work->Flblock = Work->Flublock + nb * nb ;
 Work->Fublock = Work->Flblock + nb * fnr2 ;
 Work->Fcblock = Work->Fublock + nb * fnc2 ;
    }
    ;
    ;
    ;
    return ((1)) ;
}

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: maxbytes double

variable_types: fsize long

variable_types: maxfrsize long

variable_types: overflow long

variable_types: nb long

variable_types: f long

variable_types: cdeg long

variable_types: col long

variable_types: tpi long

variable_types: e long

variable_types:
E
long *

variable_types:
Cols
long *

variable_types:
tp
struct Tuple { long e; } *

variable_types:
tpend
struct Tuple { long e; } *

variable_types:
ep
struct Element { long cdeg; } *

user_defined_types: struct SymbolicType { double num_mem_usage_est; long valid; }


decompiled_code:
__int64 __fastcall umfpack_dl_report_vector(__int64 a1, __int64 a2, double *a3)
{
unsigned __int64 v3; // rcx
__int64 result; // rax

if ( a3 && (v3 = (unsigned int)(int)*a3, v3 > 2) )
result = umfdl_report_vector(a1, a2, 0LL, v3, 1LL, 0LL);
else
result = 0LL;
return result;
}

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

if ( a3 && (v3 = (unsigned int)(int)*a3, v3 > 2) )
result = umfdl_report_vector(a1, a2, 0LL, v3, 1LL, 0LL);
else
result = 0LL;
return result;
}

original_code:
long umfpack_dl_report_vector
(
    long n,
    const double Xx [ ],
    const double Control [20]
)
{
    long prl ;
    double *Xz = (double *) ((void *)0) ;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    return (umfdl_report_vector (n, Xx, Xz, prl, (1), (0))) ;
}

canonical_original_code:
long umfpack_dl_report_vector(long n, double Xx[], double Control[20])
{
    long prl;
    double *Xz = (double *) ((void *)0);
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    return (umfdl_report_vector (n, Xx, Xz, prl, (1), (0))) ;
}

variable_types: n long

variable_types:
Xx
double []

variable_types:
Control
double [20]

variable_types: prl long

variable_types:
Xz
double *


original_code:
int cholmod_rowcolcounts
(
    cholmod_sparse *A,
    int *fset,
    size_t fsize,
    int *Parent,
    int *Post,
    int *RowCount,
    int *ColCount,
    int *First,
    int *Level,
    cholmod_common *Common
)
{
    double fl, ff ;
    int *Ap, *Ai, *Anz, *PrevNbr, *SetParent, *Head, *PrevLeaf, *Anext, *Ipost,
 *Iwork ;
    int i, j, r, k, len, s, p, pend, inew, stype, nf, anz, inode, parent,
 nrow, ncol, packed, use_fset, jj ;
    size_t w ;
    int ok = 1 ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 222, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Parent) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 223, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Post) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 224, "argument missing", Common) ; } return (0) ; } } ;
    { if ((ColCount) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 225, "argument missing", Common) ; } return (0) ; } } ;
    { if ((First) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 226, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Level) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 227, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (0) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 228, "invalid xtype", Common) ; } return (0) ; } } ;
    stype = A->stype ;
    if (stype > 0)
    {
 cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 233, "symmetric upper not supported", Common) ;
 return (0) ;
    }
    Common->status = 0 ;
    nrow = A->nrow ;
    ncol = A->ncol ;
    w = cholmod_mult_size_t (nrow, 2, &ok) ;
    w = cholmod_add_size_t (w, (stype ? 0 : ncol), &ok) ;
    if (!ok)
    {
 cholmod_error ((-3), "../Cholesky/cholmod_rowcolcounts.c", 250, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_allocate_work (nrow, w, 0, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    ;
    ;
    Ap = A->p ;
    Ai = A->i ;
    Anz = A->nz ;
    packed = A->packed ;
    ;
    Iwork = Common->Iwork ;
    SetParent = Iwork ;
    PrevNbr = Iwork + nrow ;
    Anext = Iwork + 2*((size_t) nrow) ;
    PrevLeaf = Common->Flag ;
    Head = Common->Head ;
    for (i = 0 ; i < nrow ; i++)
    {
 First [i] = (-1) ;
    }
    for (k = 0 ; k < nrow ; k++)
    {
 i = Post [k] ;
 ColCount [i] = (First [i] == (-1)) ? 1 : 0 ;
 len = 0 ;
 for (r = i ; (r != (-1)) && (First [r] == (-1)) ; r = Parent [r])
 {
     First [r] = k ;
     len++ ;
 }
 if (r == (-1))
 {
     len-- ;
 }
 else
 {
     len += Level [r] ;
 }
 for (s = i ; s != r ; s = Parent [s])
 {
     Level [s] = len-- ;
 }
    }
    fl = 0.0 ;
    if (stype == 0)
    {
 Ipost = PrevNbr ;
 for (k = 0 ; k < nrow ; k++)
 {
     Ipost [Post [k]] = k ;
 }
 use_fset = (fset != ((void *)0)) ;
 if (use_fset)
 {
     nf = fsize ;
     for (j = 0 ; j < ncol ; j++)
     {
  Anext [j] = -2 ;
     }
     for (jj = 0 ; jj < nf ; jj++)
     {
  j = fset [jj] ;
  if (j < 0 || j > ncol || Anext [j] != -2)
  {
      cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 362, "fset invalid", Common) ;
      return (0) ;
  }
  Anext [j] = (-1) ;
     }
     ;
 }
 else
 {
     nf = ncol ;
 }
 for (jj = 0 ; jj < nf ; jj++)
 {
     j = (use_fset) ? (fset [jj]) : jj ;
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     ff = (double) (((0) > (pend - p)) ? (0) : (pend - p)) ;
     fl += ff*ff + ff ;
     if (pend > p)
     {
  k = Ipost [Ai [p]] ;
  for ( ; p < pend ; p++)
  {
      inew = Ipost [Ai [p]] ;
      k = (((k) < (inew)) ? (k) : (inew)) ;
  }
  ;
  Anext [j] = Head [k] ;
  Head [k] = j ;
     }
 }
    }
    if (RowCount != ((void *)0))
    {
 for (i = 0 ; i < nrow ; i++)
 {
     RowCount [i] = 1 ;
 }
    }
    for (i = 0 ; i < nrow ; i++)
    {
 PrevLeaf [i] = (-1) ;
 PrevNbr [i] = (-1) ;
 SetParent [i] = i ;
    }
    if (stype != 0)
    {
 anz = nrow ;
 for (k = 0 ; k < nrow ; k++)
 {
     j = initialize_node (k, Post, Parent, ColCount, PrevNbr) ;
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  i = Ai [p] ;
  if (i > j)
  {
      anz++ ;
      process_edge (j, i, k, First, PrevNbr, ColCount,
       PrevLeaf, RowCount, SetParent, Level) ;
  }
     }
     finalize_node (j, Parent, SetParent) ;
 }
 Common->anz = anz ;
    }
    else
    {
 for (k = 0 ; k < nrow ; k++)
 {
     inode = initialize_node (k, Post, Parent, ColCount, PrevNbr) ;
     for (j = Head [k] ; j != (-1) ; j = Anext [j])
     {
  p = Ap [j] ;
  pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
  for ( ; p < pend ; p++)
  {
      i = Ai [p] ;
      if (PrevNbr [i] < k)
      {
   process_edge (inode, i, k, First, PrevNbr, ColCount,
    PrevLeaf, RowCount, SetParent, Level) ;
      }
  }
     }
     Head [k] = (-1) ;
     finalize_node (inode, Parent, SetParent) ;
 }
    }
    for (j = 0 ; j < nrow ; j++)
    {
 parent = Parent [j] ;
 if (parent != (-1))
 {
     ColCount [parent] += ColCount [j] ;
 }
    }
    Common->mark = (-1) ;
    { Common->mark++ ; if (Common->mark <= 0) { Common->mark = (-1) ; cholmod_clear_flag (Common) ; } } ;
    ;
    Common->aatfl = fl ;
    Common->lnz = 0. ;
    fl = 0 ;
    for (j = 0 ; j < nrow ; j++)
    {
 ff = (double) (ColCount [j]) ;
 Common->lnz += ff ;
 fl += ff*ff ;
    }
    Common->fl = fl ;
    ;
    return (1) ;
}

canonical_original_code:
int cholmod_rowcolcounts(struct cholmod_sparse_struct *A, int *fset, unsigned long fsize, int *Parent, int *Post, int *RowCount, int *ColCount, int *First, int *Level, struct cholmod_common_struct *Common)
{
    double fl; double ff;
    int *Ap; int *Ai; int *Anz; int *PrevNbr; int *SetParent; int *Head; int *PrevLeaf; int *Anext; int *Ipost; int *Iwork;
    int i; int j; int r; int k; int len; int s; int p; int pend; int inew; int stype; int nf; int anz; int inode; int parent; int nrow; int ncol; int packed; int use_fset; int jj;
    unsigned long w;
    int ok = 1;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 222, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Parent) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 223, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Post) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 224, "argument missing", Common) ; } return (0) ; } } ;
    { if ((ColCount) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 225, "argument missing", Common) ; } return (0) ; } } ;
    { if ((First) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 226, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Level) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 227, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (0) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 228, "invalid xtype", Common) ; } return (0) ; } } ;
    stype = A->stype ;
    if (stype > 0)
    {
 cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 233, "symmetric upper not supported", Common) ;
 return (0) ;
    }
    Common->status = 0 ;
    nrow = A->nrow ;
    ncol = A->ncol ;
    w = cholmod_mult_size_t (nrow, 2, &ok) ;
    w = cholmod_add_size_t (w, (stype ? 0 : ncol), &ok) ;
    if (!ok)
    {
 cholmod_error ((-3), "../Cholesky/cholmod_rowcolcounts.c", 250, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_allocate_work (nrow, w, 0, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    ;
    ;
    Ap = A->p ;
    Ai = A->i ;
    Anz = A->nz ;
    packed = A->packed ;
    ;
    Iwork = Common->Iwork ;
    SetParent = Iwork ;
    PrevNbr = Iwork + nrow ;
    Anext = Iwork + 2*((unsigned long) nrow) ;
    PrevLeaf = Common->Flag ;
    Head = Common->Head ;
    for (i = 0 ; i < nrow ; i++)
    {
 First [i] = (-1) ;
    }
    for (k = 0 ; k < nrow ; k++)
    {
 i = Post [k] ;
 ColCount [i] = (First [i] == (-1)) ? 1 : 0 ;
 len = 0 ;
 for (r = i ; (r != (-1)) && (First [r] == (-1)) ; r = Parent [r])
 {
     First [r] = k ;
     len++ ;
 }
 if (r == (-1))
 {
     len-- ;
 }
 else
 {
     len += Level [r] ;
 }
 for (s = i ; s != r ; s = Parent [s])
 {
     Level [s] = len-- ;
 }
    }
    fl = 0.0 ;
    if (stype == 0)
    {
 Ipost = PrevNbr ;
 for (k = 0 ; k < nrow ; k++)
 {
     Ipost [Post [k]] = k ;
 }
 use_fset = (fset != ((void *)0)) ;
 if (use_fset)
 {
     nf = fsize ;
     for (j = 0 ; j < ncol ; j++)
     {
  Anext [j] = -2 ;
     }
     for (jj = 0 ; jj < nf ; jj++)
     {
  j = fset [jj] ;
  if (j < 0 || j > ncol || Anext [j] != -2)
  {
      cholmod_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 362, "fset invalid", Common) ;
      return (0) ;
  }
  Anext [j] = (-1) ;
     }
     ;
 }
 else
 {
     nf = ncol ;
 }
 for (jj = 0 ; jj < nf ; jj++)
 {
     j = (use_fset) ? (fset [jj]) : jj ;
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     ff = (double) (((0) > (pend - p)) ? (0) : (pend - p)) ;
     fl += ff*ff + ff ;
     if (pend > p)
     {
  k = Ipost [Ai [p]] ;
  for ( ; p < pend ; p++)
  {
      inew = Ipost [Ai [p]] ;
      k = (((k) < (inew)) ? (k) : (inew)) ;
  }
  ;
  Anext [j] = Head [k] ;
  Head [k] = j ;
     }
 }
    }
    if (RowCount != ((void *)0))
    {
 for (i = 0 ; i < nrow ; i++)
 {
     RowCount [i] = 1 ;
 }
    }
    for (i = 0 ; i < nrow ; i++)
    {
 PrevLeaf [i] = (-1) ;
 PrevNbr [i] = (-1) ;
 SetParent [i] = i ;
    }
    if (stype != 0)
    {
 anz = nrow ;
 for (k = 0 ; k < nrow ; k++)
 {
     j = initialize_node (k, Post, Parent, ColCount, PrevNbr) ;
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  i = Ai [p] ;
  if (i > j)
  {
      anz++ ;
      process_edge (j, i, k, First, PrevNbr, ColCount,
       PrevLeaf, RowCount, SetParent, Level) ;
  }
     }
     finalize_node (j, Parent, SetParent) ;
 }
 Common->anz = anz ;
    }
    else
    {
 for (k = 0 ; k < nrow ; k++)
 {
     inode = initialize_node (k, Post, Parent, ColCount, PrevNbr) ;
     for (j = Head [k] ; j != (-1) ; j = Anext [j])
     {
  p = Ap [j] ;
  pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
  for ( ; p < pend ; p++)
  {
      i = Ai [p] ;
      if (PrevNbr [i] < k)
      {
   process_edge (inode, i, k, First, PrevNbr, ColCount,
    PrevLeaf, RowCount, SetParent, Level) ;
      }
  }
     }
     Head [k] = (-1) ;
     finalize_node (inode, Parent, SetParent) ;
 }
    }
    for (j = 0 ; j < nrow ; j++)
    {
 parent = Parent [j] ;
 if (parent != (-1))
 {
     ColCount [parent] += ColCount [j] ;
 }
    }
    Common->mark = (-1) ;
    { Common->mark++ ; if (Common->mark <= 0) { Common->mark = (-1) ; cholmod_clear_flag (Common) ; } } ;
    ;
    Common->aatfl = fl ;
    Common->lnz = 0. ;
    fl = 0 ;
    for (j = 0 ; j < nrow ; j++)
    {
 ff = (double) (ColCount [j]) ;
 Common->lnz += ff ;
 fl += ff*ff ;
    }
    Common->fl = fl ;
    ;
    return (1) ;
}

variable_types: struct cholmod_sparse_struct { unsigned long nrow; unsigned long ncol; unsigned long nzmax; void *p; void *i; void *nz; void *x; void *z; int stype; int itype; int xtype; int dtype; int sorted; int packed; } *

variable_types:
fset
int *

variable_types:
fsize
unsigned long

variable_types:
Parent
int *

variable_types:
Post
int *

variable_types:
RowCount
int *

variable_types:
ColCount
int *

variable_types:
First
int *

variable_types:
Level
int *

variable_types: struct cholmod_common_struct { double dbound; double grow0; double grow1; unsigned long grow2; unsigned long maxrank; double supernodal_switch; int supernodal; int final_asis; int final_super; int final_ll; int final_pack; int final_monotonic; int final_resymbol; double zrelax[3]; unsigned long nrelax[3]; int prefer_zomplex; int prefer_upper; int quick_return_if_not_posdef; int print; int precise; int (*print_function)(char *, ...); int try_catch; void (*error_handler)(int status, char *file, int line, char *message); int nmethods; int current; int selected; struct cholmod_method_struct { double lnz; double fl; double prune_dense; double prune_dense2; double nd_oksep; double other_1[4]; unsigned long nd_small; unsigned long other_2[4]; int aggressive; int order_for_lu; int nd_compress; int nd_camd; int nd_components; int ordering; unsigned long other_3[4]; } method[-1]; int postorder; void *(*malloc_memory)(unsigned long); void *(*realloc_memory)(void *, unsigned long); void (*free_memory)(void *); void *(*calloc_memory)(unsigned long, unsigned long); int (*complex_divide)(double ax, double az, double bx, double bz, double *cx, double *cz); double (*hypotenuse)(double x, double y); double metis_memory; double metis_dswitch; unsigned long metis_nswitch; unsigned long nrow; long mark; unsigned long iworksize; unsigned long xworksize; void *Flag; void *Head; void *Xwork; void *Iwork; int itype; int dtype; int no_workspace_reallocate; int status; double fl; double lnz; double anz; double modfl; unsigned long malloc_count; unsigned long memory_usage; unsigned long memory_inuse; double nrealloc_col; double nrealloc_factor; double ndbounds_hit; double rowfacfl; double aatfl; double other1[10]; double SPQR_xstat[4]; double SPQR_grain; double SPQR_small; long SPQR_istat[10]; long other2[6]; int other3[10]; int prefer_binary; int default_nesdis; int called_nd; int blas_ok; int SPQR_shrink; int SPQR_nthreads; unsigned long other4[16]; void *other5[16]; } *

variable_types: fl double

variable_types: ff double

variable_types:
Ap
int *

variable_types:
Ai
int *

variable_types:
Anz
int *

variable_types:
PrevNbr
int *

variable_types:
SetParent
int *

variable_types:
Head
int *

variable_types:
PrevLeaf
int *

variable_types:
Anext
int *

variable_types:
Ipost
int *

variable_types:
Iwork
int *

variable_types: i int

variable_types: j int

variable_types: r int

variable_types: k int

variable_types: len int

variable_types: s int

variable_types: p int

variable_types: pend int

variable_types: inew int

variable_types: stype int

variable_types: nf int

variable_types: anz int

variable_types: inode int

variable_types: parent int

variable_types: nrow int

variable_types: ncol int

variable_types: packed int

variable_types: jj int

variable_types:
w
unsigned long

variable_types: ok int


original_code:
static int initialize_node
(
    int k,
    int Post [ ],
    int Parent [ ],
    int ColCount [ ],
    int PrevNbr [ ]
)
{
    int p, parent ;
    p = Post [k] ;
    parent = Parent [p] ;
    if (parent != (-1))
    {
 ColCount [parent]-- ;
    }
    PrevNbr [p] = k ;
    return (p) ;
}

canonical_original_code:
static int initialize_node(int k, int Post[], int Parent[], int ColCount[], int PrevNbr[])
{
    int p; int parent;
    p = Post [k] ;
    parent = Parent [p] ;
    if (parent != (-1))
    {
 ColCount [parent]-- ;
    }
    PrevNbr [p] = k ;
    return (p) ;
}

variable_types: k int

variable_types:
Post
int []

variable_types:
Parent
int []

variable_types:
ColCount
int []

variable_types:
PrevNbr
int []


original_code:
static void process_edge
(
    int p,
    int u,
    int k,
    int First [ ],
    int PrevNbr [ ],
    int ColCount [ ],
    int PrevLeaf [ ],
    int RowCount [ ],
    int SetParent [ ],
    int Level [ ]
)
{
    int prevleaf, q, s, sparent ;
    if (First [p] > PrevNbr [u])
    {
 ColCount [p]++ ;
 prevleaf = PrevLeaf [u] ;
 if (prevleaf == (-1))
 {
     q = u ;
 }
 else
 {
     for (q = prevleaf ; q != SetParent [q] ; q = SetParent [q])
     {
  ;
     }
     s = prevleaf ;
     for (s = prevleaf ; s != q ; s = sparent)
     {
  sparent = SetParent [s] ;
  SetParent [s] = q ;
     }
     ColCount [q]-- ;
 }
 if (RowCount != ((void *)0))
 {
     RowCount [u] += (Level [p] - Level [q]) ;
 }
 PrevLeaf [u] = p ;
    }
    PrevNbr [u] = k ;
}

canonical_original_code:
static void process_edge(int p, int u, int k, int First[], int PrevNbr[], int ColCount[], int PrevLeaf[], int RowCount[], int SetParent[], int Level[])
{
    int prevleaf; int q; int s; int sparent;
    if (First [p] > PrevNbr [u])
    {
 ColCount [p]++ ;
 prevleaf = PrevLeaf [u] ;
 if (prevleaf == (-1))
 {
     q = u ;
 }
 else
 {
     for (q = prevleaf ; q != SetParent [q] ; q = SetParent [q])
     {
  ;
     }
     s = prevleaf ;
     for (s = prevleaf ; s != q ; s = sparent)
     {
  sparent = SetParent [s] ;
  SetParent [s] = q ;
     }
     ColCount [q]-- ;
 }
 if (RowCount != ((void *)0))
 {
     RowCount [u] += (Level [p] - Level [q]) ;
 }
 PrevLeaf [u] = p ;
    }
    PrevNbr [u] = k ;
}

variable_types: p int

variable_types: u int

variable_types:
First
int []

variable_types:
PrevLeaf
int []

variable_types:
RowCount
int []

variable_types:
SetParent
int []

variable_types:
Level
int []

variable_types: prevleaf int

variable_types: q int

variable_types: s int

variable_types: sparent int

return_type: void


decompiled_code:
__int64 __fastcall finalize_node(int a1, __int64 a2, __int64 a3)
{
__int64 result; // rax

result = *(unsigned int *)(a2 + 4LL * a1);
if ( (_DWORD)result != -1 )
*(_DWORD *)(a3 + 4LL * a1) = result;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(int a1, __int64 a2, __int64 a3)
{
__int64 result; // rax

result = *(unsigned int *)(a2 + 4LL * a1);
if ( (_DWORD)result != -1 )
*(_DWORD *)(a3 + 4LL * a1) = result;
return result;
}

original_code:
static void finalize_node
(
    int p,
    int Parent [ ],
    int SetParent [ ]
)
{
    if (Parent [p] != (-1))
    {
 SetParent [p] = Parent [p] ;
    }
}

canonical_original_code:
static void finalize_node(int p, int Parent[], int SetParent[])
{
    if (Parent [p] != (-1))
    {
 SetParent [p] = Parent [p] ;
    }
}