original_code:
int cholmod_l_rowcolcounts
(
    cholmod_sparse *A,
    long *fset,
    size_t fsize,
    long *Parent,
    long *Post,
    long *RowCount,
    long *ColCount,
    long *First,
    long *Level,
    cholmod_common *Common
)
{
    double fl, ff ;
    long *Ap, *Ai, *Anz, *PrevNbr, *SetParent, *Head, *PrevLeaf, *Anext, *Ipost,
 *Iwork ;
    long 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 != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 222, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Parent) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 223, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Post) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 224, "argument missing", Common) ; } return (0) ; } } ;
    { if ((ColCount) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 225, "argument missing", Common) ; } return (0) ; } } ;
    { if ((First) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 226, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Level) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_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_l_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 228, "invalid xtype", Common) ; } return (0) ; } } ;
    stype = A->stype ;
    if (stype > 0)
    {
 cholmod_l_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_l_mult_size_t (nrow, 2, &ok) ;
    w = cholmod_l_add_size_t (w, (stype ? 0 : ncol), &ok) ;
    if (!ok)
    {
 cholmod_l_error ((-3), "../Cholesky/cholmod_rowcolcounts.c", 250, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_l_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_l_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_l_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_l_rowcolcounts(struct cholmod_sparse_struct *A, long *fset, unsigned long fsize, long *Parent, long *Post, long *RowCount, long *ColCount, long *First, long *Level, struct cholmod_common_struct *Common)
{
    double fl; double ff;
    long *Ap; long *Ai; long *Anz; long *PrevNbr; long *SetParent; long *Head; long *PrevLeaf; long *Anext; long *Ipost; long *Iwork;
    long i; long j; long r; long k; long len; long s; long p; long pend; long inew; long stype; long nf; long anz; long inode; long parent; long nrow; long ncol; long packed; long use_fset; long jj;
    unsigned long w;
    int ok = 1;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 222, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Parent) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 223, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Post) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 224, "argument missing", Common) ; } return (0) ; } } ;
    { if ((ColCount) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 225, "argument missing", Common) ; } return (0) ; } } ;
    { if ((First) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 226, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Level) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_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_l_error ((-4), "../Cholesky/cholmod_rowcolcounts.c", 228, "invalid xtype", Common) ; } return (0) ; } } ;
    stype = A->stype ;
    if (stype > 0)
    {
 cholmod_l_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_l_mult_size_t (nrow, 2, &ok) ;
    w = cholmod_l_add_size_t (w, (stype ? 0 : ncol), &ok) ;
    if (!ok)
    {
 cholmod_l_error ((-3), "../Cholesky/cholmod_rowcolcounts.c", 250, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_l_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_l_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_l_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
long *

variable_types:
fsize
unsigned long

variable_types:
Parent
long *

variable_types:
Post
long *

variable_types:
RowCount
long *

variable_types:
ColCount
long *

variable_types:
First
long *

variable_types:
Level
long *

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
long *

variable_types:
Ai
long *

variable_types:
Anz
long *

variable_types:
PrevNbr
long *

variable_types:
SetParent
long *

variable_types:
Head
long *

variable_types:
PrevLeaf
long *

variable_types:
Anext
long *

variable_types:
Ipost
long *

variable_types:
Iwork
long *

variable_types: i long

variable_types: j long

variable_types: r long

variable_types: k long

variable_types: len long

variable_types: s long

variable_types: p long

variable_types: pend long

variable_types: inew long

variable_types: stype long

variable_types: nf long

variable_types: anz long

variable_types: inode long

variable_types: parent long

variable_types: nrow long

variable_types: ncol long

variable_types: packed long

variable_types: jj long

variable_types:
w
unsigned long

variable_types: ok int


decompiled_code:
__int64 __fastcall initialize_node(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5)
{
__int64 result; // rax
__int64 v6; // rdx

result = *(_QWORD *)(a2 + 8 * a1);
v6 = *(_QWORD *)(a3 + 8 * result);
if ( v6 != -1 )
--*(_QWORD *)(a4 + 8 * v6);
*(_QWORD *)(a5 + 8 * result) = a1;
return result;
}

original_code:
static int initialize_node
(
    long k,
    long Post [ ],
    long Parent [ ],
    long ColCount [ ],
    long PrevNbr [ ]
)
{
    long 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(long k, long Post[], long Parent[], long ColCount[], long PrevNbr[])
{
    long p; long parent;
    p = Post [k] ;
    parent = Parent [p] ;
    if (parent != (-1))
    {
 ColCount [parent]-- ;
    }
    PrevNbr [p] = k ;
    return (p) ;
}

variable_types: k long

variable_types:
Post
long []

variable_types:
Parent
long []

variable_types:
ColCount
long []

variable_types:
PrevNbr
long []

return_type: int


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

result = *(_QWORD *)(a2 + 8 * a1);
if ( result != -1 )
*(_QWORD *)(a3 + 8 * a1) = result;
return result;
}

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

result = *(_QWORD *)(a2 + 8 * a1);
if ( result != -1 )
*(_QWORD *)(a3 + 8 * a1) = result;
return result;
}

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

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

variable_types: p long

variable_types:
SetParent
long []

return_type: void


original_code:
void umfdi_scale_column
(
    NumericType *Numeric,
    WorkType *Work
)
{
    double pivot_value ;
    double *Fcol, *Flublock, *Flblock, *Fublock, *Fcblock ;
    int k, k1, fnr_curr, fnrows, fncols, *Frpos, *Fcpos, pivrow, pivcol,
 *Frows, *Fcols, fnc_curr, fnpiv, *Row_tuples, nb,
 *Col_tuples, *Rperm, *Cperm, fspos, col2, row2 ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    fnpiv = Work->fnpiv ;
    Rperm = Numeric->Rperm ;
    Cperm = Numeric->Cperm ;
    Flublock = Work->Flublock ;
    Flblock = Work->Flblock ;
    Fublock = Work->Fublock ;
    Fcblock = Work->Fcblock ;
    fnr_curr = Work->fnr_curr ;
    fnc_curr = Work->fnc_curr ;
    Frpos = Work->Frpos ;
    Fcpos = Work->Fcpos ;
    Frows = Work->Frows ;
    Fcols = Work->Fcols ;
    pivrow = Work->pivrow ;
    pivcol = Work->pivcol ;
    ;
    ;
    Row_tuples = Numeric->Uip ;
    Col_tuples = Numeric->Lip ;
    nb = Work->nb ;
    fspos = Fcpos [pivcol] ;
    fncols = --(Work->fncols) ;
    if (fspos != fncols * fnr_curr)
    {
 int fs = fspos / fnr_curr ;
 ;
 ;
 {
     int i ;
     double *Fs, *Fe ;
     Fs = Fcblock + fspos ;
     Fe = Fcblock + fncols * fnr_curr ;
#pragma ivdep
     for (i = 0 ; i < fnrows ; i++)
     {
  Fs [i] = Fe [i] ;
     }
 }
 {
     int i ;
     double *Fs, *Fe ;
     Fs = Fublock + fs ;
     Fe = Fublock + fncols ;
#pragma ivdep
     for (i = 0 ; i < fnpiv ; i++)
     {
  Fs [i * fnc_curr] = Fe [i * fnc_curr] ;
     }
 }
 col2 = Fcols [fncols] ;
 Fcols [fs] = col2 ;
 Fcpos [col2] = fspos ;
    }
    Fcpos [pivcol] = (-1) ;
    fspos = Frpos [pivrow] ;
    fnrows = --(Work->fnrows) ;
    ;
    ;
    if (fspos == fnrows)
    {
 ;
 {
     int j ;
     double *Fd, *Fs ;
     Fd = Fublock + fnpiv * fnc_curr ;
     Fs = Fcblock + fspos ;
#pragma ivdep
     for (j = 0 ; j < fncols ; j++)
     {
  Fd [j] = Fs [j * fnr_curr] ;
     }
 }
 if (Work->pivrow_in_front)
 {
     int j ;
     double *Fd, *Fs ;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
#pragma ivdep
     for (j = 0 ; j <= fnpiv ; j++)
     {
  Fd [j * nb] = Fs [j * fnr_curr] ;
     }
 }
 else
 {
     int j ;
     double *Fd, *Fs ;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
#pragma ivdep
     for (j = 0 ; j < fnpiv ; j++)
     {
  ;
  { (Fd [j * nb]) = 0. ; } ;
     }
     Fd [fnpiv * nb] = Fs [fnpiv * fnr_curr] ;
 }
    }
    else
    {
 ;
 {
     double *Fd, *Fs, *Fe ;
     Fd = Fublock + fnpiv * fnc_curr ;
     Fs = Fcblock + fspos ;
     Fe = Fcblock + fnrows ;
     shift_pivot_row (Fd, Fs, Fe, fncols, fnr_curr) ;
 }
 if (Work->pivrow_in_front)
 {
     int j ;
     double *Fd, *Fs, *Fe ;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
     Fe = Flblock + fnrows ;
#pragma ivdep
     for (j = 0 ; j <= fnpiv ; j++)
     {
  Fd [j * nb] = Fs [j * fnr_curr] ;
  Fs [j * fnr_curr] = Fe [j * fnr_curr] ;
     }
 }
 else
 {
     int j ;
     double *Fd, *Fs, *Fe ;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
     Fe = Flblock + fnrows ;
#pragma ivdep
     for (j = 0 ; j < fnpiv ; j++)
     {
  ;
  { (Fd [j * nb]) = 0. ; } ;
  Fs [j * fnr_curr] = Fe [j * fnr_curr] ;
     }
     Fd [fnpiv * nb] = Fs [fnpiv * fnr_curr] ;
     Fs [fnpiv * fnr_curr] = Fe [fnpiv * fnr_curr] ;
 }
 row2 = Frows [fnrows] ;
 Frows [fspos] = row2 ;
 Frpos [row2] = fspos ;
    }
    Frpos [pivrow] = (-1) ;
    Fcol = Flblock + fnpiv * fnr_curr ;
    pivot_value = Flublock [fnpiv + fnpiv * nb] ;
    k = Work->npiv + fnpiv ;
    ;
    ;
    ;
    umfdi_scale (fnrows, pivot_value, Fcol) ;
    umfdi_mem_free_tail_block (Numeric, Row_tuples [pivrow]) ;
    umfdi_mem_free_tail_block (Numeric, Col_tuples [pivcol]) ;
    Row_tuples [pivrow] = 0 ;
    Col_tuples [pivcol] = 0 ;
    ;
    ;
    ;
    k1 = (-(k)-1) ;
    Rperm [pivrow] = k1 ;
    Cperm [pivcol] = k1 ;
    ;
    ;
    ;
    Work->Pivrow [fnpiv] = pivrow ;
    Work->Pivcol [fnpiv] = pivcol ;
    Work->fnpiv++ ;
}

canonical_original_code:
void umfdi_scale_column(struct NumericType *Numeric, struct WorkType *Work)
{
    double pivot_value;
    double *Fcol; double *Flublock; double *Flblock; double *Fublock; double *Fcblock;
    int k; int k1; int fnr_curr; int fnrows; int fncols; int *Frpos; int *Fcpos; int pivrow; int pivcol; int *Frows; int *Fcols; int fnc_curr; int fnpiv; int *Row_tuples; int nb; int *Col_tuples; int *Rperm; int *Cperm; int fspos; int col2; int row2;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    fnpiv = Work->fnpiv ;
    Rperm = Numeric->Rperm ;
    Cperm = Numeric->Cperm ;
    Flublock = Work->Flublock ;
    Flblock = Work->Flblock ;
    Fublock = Work->Fublock ;
    Fcblock = Work->Fcblock ;
    fnr_curr = Work->fnr_curr ;
    fnc_curr = Work->fnc_curr ;
    Frpos = Work->Frpos ;
    Fcpos = Work->Fcpos ;
    Frows = Work->Frows ;
    Fcols = Work->Fcols ;
    pivrow = Work->pivrow ;
    pivcol = Work->pivcol ;
    ;
    ;
    Row_tuples = Numeric->Uip ;
    Col_tuples = Numeric->Lip ;
    nb = Work->nb ;
    fspos = Fcpos [pivcol] ;
    fncols = --(Work->fncols) ;
    if (fspos != fncols * fnr_curr)
    {
 int fs = fspos / fnr_curr;
 ;
 ;
 {
     int i;
     double *Fs; double *Fe;
     Fs = Fcblock + fspos ;
     Fe = Fcblock + fncols * fnr_curr ;
#pragma ivdep
     for (i = 0 ; i < fnrows ; i++)
     {
  Fs [i] = Fe [i] ;
     }
 }
 {
     int i;
     double *Fs; double *Fe;
     Fs = Fublock + fs ;
     Fe = Fublock + fncols ;
#pragma ivdep
     for (i = 0 ; i < fnpiv ; i++)
     {
  Fs [i * fnc_curr] = Fe [i * fnc_curr] ;
     }
 }
 col2 = Fcols [fncols] ;
 Fcols [fs] = col2 ;
 Fcpos [col2] = fspos ;
    }
    Fcpos [pivcol] = (-1) ;
    fspos = Frpos [pivrow] ;
    fnrows = --(Work->fnrows) ;
    ;
    ;
    if (fspos == fnrows)
    {
 ;
 {
     int j;
     double *Fd; double *Fs;
     Fd = Fublock + fnpiv * fnc_curr ;
     Fs = Fcblock + fspos ;
#pragma ivdep
     for (j = 0 ; j < fncols ; j++)
     {
  Fd [j] = Fs [j * fnr_curr] ;
     }
 }
 if (Work->pivrow_in_front)
 {
     int j;
     double *Fd; double *Fs;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
#pragma ivdep
     for (j = 0 ; j <= fnpiv ; j++)
     {
  Fd [j * nb] = Fs [j * fnr_curr] ;
     }
 }
 else
 {
     int j;
     double *Fd; double *Fs;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
#pragma ivdep
     for (j = 0 ; j < fnpiv ; j++)
     {
  ;
  { (Fd [j * nb]) = 0. ; } ;
     }
     Fd [fnpiv * nb] = Fs [fnpiv * fnr_curr] ;
 }
    }
    else
    {
 ;
 {
     double *Fd; double *Fs; double *Fe;
     Fd = Fublock + fnpiv * fnc_curr ;
     Fs = Fcblock + fspos ;
     Fe = Fcblock + fnrows ;
     shift_pivot_row (Fd, Fs, Fe, fncols, fnr_curr) ;
 }
 if (Work->pivrow_in_front)
 {
     int j;
     double *Fd; double *Fs; double *Fe;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
     Fe = Flblock + fnrows ;
#pragma ivdep
     for (j = 0 ; j <= fnpiv ; j++)
     {
  Fd [j * nb] = Fs [j * fnr_curr] ;
  Fs [j * fnr_curr] = Fe [j * fnr_curr] ;
     }
 }
 else
 {
     int j;
     double *Fd; double *Fs; double *Fe;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
     Fe = Flblock + fnrows ;
#pragma ivdep
     for (j = 0 ; j < fnpiv ; j++)
     {
  ;
  { (Fd [j * nb]) = 0. ; } ;
  Fs [j * fnr_curr] = Fe [j * fnr_curr] ;
     }
     Fd [fnpiv * nb] = Fs [fnpiv * fnr_curr] ;
     Fs [fnpiv * fnr_curr] = Fe [fnpiv * fnr_curr] ;
 }
 row2 = Frows [fnrows] ;
 Frows [fspos] = row2 ;
 Frpos [row2] = fspos ;
    }
    Frpos [pivrow] = (-1) ;
    Fcol = Flblock + fnpiv * fnr_curr ;
    pivot_value = Flublock [fnpiv + fnpiv * nb] ;
    k = Work->npiv + fnpiv ;
    ;
    ;
    ;
    umfdi_scale (fnrows, pivot_value, Fcol) ;
    umfdi_mem_free_tail_block (Numeric, Row_tuples [pivrow]) ;
    umfdi_mem_free_tail_block (Numeric, Col_tuples [pivcol]) ;
    Row_tuples [pivrow] = 0 ;
    Col_tuples [pivcol] = 0 ;
    ;
    ;
    ;
    k1 = (-(k)-1) ;
    Rperm [pivrow] = k1 ;
    Cperm [pivcol] = k1 ;
    ;
    ;
    ;
    Work->Pivrow [fnpiv] = pivrow ;
    Work->Pivcol [fnpiv] = pivcol ;
    Work->fnpiv++ ;
}

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

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

variable_types:
Fcol
double *

variable_types:
Flublock
double *

variable_types:
Flblock
double *

variable_types:
Fublock
double *

variable_types:
Fcblock
double *

variable_types: k int

variable_types: fnrows int

variable_types: fncols int

variable_types:
Frpos
int *

variable_types:
Fcpos
int *

variable_types: pivrow int

variable_types: pivcol int

variable_types:
Frows
int *

variable_types:
Fcols
int *

variable_types: fnpiv int

variable_types: nb int

variable_types:
Rperm
int *

variable_types:
Cperm
int *

variable_types: fspos int

variable_types: fs int

variable_types: i int

variable_types:
Fs
double *

variable_types:
Fe
double *

variable_types: j int

variable_types:
Fd
double *

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:
static void shift_pivot_row (double *Fd, double *Fs, double *Fe, int len, int d)
{
    int j ;
#pragma ivdep
    for (j = 0 ; j < len ; j++)
    {
 Fd [j] = Fs [j*d] ;
 Fs [j*d] = Fe [j*d] ;
    }
}

canonical_original_code:
static void shift_pivot_row(double *Fd, double *Fs, double *Fe, int len, int d)
{
    int j;
#pragma ivdep
    for (j = 0 ; j < len ; j++)
    {
 Fd [j] = Fs [j*d] ;
 Fs [j*d] = Fe [j*d] ;
    }
}

variable_types: len int

variable_types: d int


decompiled_code:
__int64 __fastcall umfpack_zi_report_symbolic(__int64 a1, double *a2)
{
int v2; // er15
int v3; // er12
__int64 v4; // r13
unsigned int v5; // ebp
unsigned int v6; // er14
__int64 (*v7)(const char *, ...); // rdx
int v8; // eax
__int64 v9; // rdx
__int64 v10; // rdi
__int64 v11; // rbp
int v12; // er12
int v13; // er13
unsigned int v14; // er12
unsigned int v16; // ebp
__int64 v17; // r14
unsigned int v18; // er12
__int64 v19; // rsi
__int64 v20; // rdx
__int64 v21; // rdi
__int64 v22; // rax
int v23; // er12
int v24; // er13
int v25; // eax
__int64 v26; // [rsp+0h] [rbp-98h]
__int64 v27; // [rsp+8h] [rbp-90h]
unsigned int v28; // [rsp+10h] [rbp-88h]
int v29; // [rsp+10h] [rbp-88h]
unsigned int v30; // [rsp+14h] [rbp-84h]
__int64 v31; // [rsp+18h] [rbp-80h]
__int64 v32; // [rsp+20h] [rbp-78h]
__int64 v34; // [rsp+30h] [rbp-68h]
unsigned int *v35; // [rsp+38h] [rbp-60h]
__int64 v36; // [rsp+40h] [rbp-58h]
__int64 v37; // [rsp+48h] [rbp-50h]
__int64 v38; // [rsp+50h] [rbp-48h]
unsigned int v39; // [rsp+58h] [rbp-40h]
unsigned int v40; // [rsp+5Ch] [rbp-3Ch]

if ( !a2 )
return 0;
v2 = (int)*a2;
if ( v2 <= 2 )
return 0;
if ( amd_printf )
amd_printf("Symbolic object: ");
if ( !(unsigned int)umfzi_valid_symbolic(a1) )
{
if ( amd_printf )
amd_printf("ERROR: invalid\n");
return (unsigned int)-4;
}
v3 = *(_DWORD *)(a1 + 64);
v4 = *(_QWORD *)(a1 + 112);
v30 = *(_DWORD *)(a1 + 204);
v34 = *(_QWORD *)(a1 + 72);
v39 = *(_DWORD *)(a1 + 208);
v37 = *(_QWORD *)(a1 + 80);
v38 = *(_QWORD *)(a1 + 88);
v26 = *(_QWORD *)(a1 + 104);
v40 = *(_DWORD *)(a1 + 212);
v27 = *(_QWORD *)(a1 + 120);
v31 = *(_QWORD *)(a1 + 128);
if ( v2 == 3 )
goto LABEL_62;
v5 = *(_DWORD *)(a1 + 96);
v28 = *(_DWORD *)(a1 + 100);
if ( !amd_printf
|| (v6 = *(_DWORD *)(a1 + 216), amd_printf("\n matrix to be factorized:\n"), !amd_printf)
|| (amd_printf("\tn_row: %d n_col: %d\n", v39, v40), !amd_printf)
|| (amd_printf("\tnumber of entries: %d\n", v6), !amd_printf) )
{
if ( *(_DWORD *)(a1 + 236) != 3 )
goto LABEL_38;
v25 = *(_DWORD *)(a1 + 240);
if ( v25 == 1 )
goto LABEL_62;
v7 = 0LL;
if ( v25 == 2 )
goto LABEL_62;
goto LABEL_102;
}
amd_printf(" block size used for dense matrix kernels: %d\n", *(unsigned int *)(a1 + 220));
if ( !amd_printf )
{
if ( *(_DWORD *)(a1 + 236) != 3 )
goto LABEL_38;
LABEL_122:
v25 = *(_DWORD *)(a1 + 240);
if ( v25 == 1 )
goto LABEL_62;
if ( v25 == 2 )
goto LABEL_62;
v7 = 0LL;
if ( v25 == 6 )
goto LABEL_62;
LABEL_103:
if ( v25 == 3 )
{
if ( !v7 )
goto LABEL_62;
v7("metis on A");
v7 = amd_printf;
}
goto LABEL_42;
}
amd_printf(" strategy used: ");
if ( *(_DWORD *)(a1 + 236) != 3 )
{
if ( amd_printf )
{
amd_printf("unsymmetric\n");
if ( amd_printf )
{
amd_printf(" ordering used: ");
v7 = amd_printf;
v8 = *(_DWORD *)(a1 + 240);
if ( v8 == 1 )
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("colamd on A\n");
v7 = amd_printf;
goto LABEL_42;
}
if ( v8 != 2 )
{
if ( v8 == 6 )
{
LABEL_18:
if ( !v7 )
goto LABEL_62;
v7("user function");
v7 = amd_printf;
goto LABEL_42;
}
LABEL_41:
if ( v8 == 3 )
{
if ( !v7 )
goto LABEL_62;
v7("metis on A'A");
v7 = amd_printf;
}
goto LABEL_42;
}
goto LABEL_106;
}
}
LABEL_38:
v8 = *(_DWORD *)(a1 + 240);
if ( v8 == 1 )
goto LABEL_62;
if ( v8 == 2 )
goto LABEL_62;
v7 = 0LL;
if ( v8 == 6 )
goto LABEL_62;
goto LABEL_41;
}
if ( !amd_printf )
goto LABEL_122;
amd_printf("symmetric\n");
if ( !amd_printf )
goto LABEL_122;
amd_printf(" ordering used: ");
v7 = amd_printf;
v25 = *(_DWORD *)(a1 + 240);
if ( v25 != 1 )
{
if ( v25 == 2 )
{
LABEL_106:
if ( !v7 )
goto LABEL_62;
v7("user permutation");
v7 = amd_printf;
goto LABEL_42;
}
LABEL_102:
if ( v25 == 6 )
goto LABEL_18;
goto LABEL_103;
}
if ( !amd_printf )
goto LABEL_62;
amd_printf("amd on A\n");
v7 = amd_printf;
LABEL_42:
if ( v7 )
{
v7("\n");
if ( amd_printf )
{
amd_printf(" performn column etree postorder: ");
if ( *(_DWORD *)(a1 + 244) )
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("no\n");
}
else
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("yes\n");
}
if ( !amd_printf )
goto LABEL_62;
amd_printf(" prefer diagonal pivoting (attempt P=Q): ");
if ( *(_DWORD *)(a1 + 248) )
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("yes\n");
}
else
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("no\n");
}
if ( amd_printf )
{
amd_printf(" variable-size part of Numeric object:\n");
if ( amd_printf )
{
amd_printf(
"\tminimum initial size (Units): %.20g (MBytes): %.1f\n",
*(double *)(a1 + 32),
8.0 * *(double *)(a1 + 32) * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(
"\testimated peak size (Units): %.20g (MBytes): %.1f\n",
*(double *)a1,
8.0 * *(double *)a1 * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(
"\testimated final size (Units): %.20g (MBytes): %.1f\n",
*(double *)(a1 + 8),
8.0 * *(double *)(a1 + 8) * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(
" symbolic factorization memory usage (Units): %.20g (MBytes): %.1f\n",
*(double *)(a1 + 16),
8.0 * *(double *)(a1 + 16) * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(" frontal matrices / supercolumns:\n");
if ( amd_printf )
{
amd_printf("\tnumber of frontal chains: %d\n", (unsigned int)v3);
if ( amd_printf )
{
amd_printf("\tnumber of frontal matrices: %d\n", v30);
if ( amd_printf )
{
amd_printf("\tlargest frontal matrix row dimension: %d\n", v5);
if ( amd_printf )
amd_printf("\tlargest frontal matrix column dimension: %d\n", v28);
}
}
}
}
}
}
}
}
}
}
}
LABEL_62:
if ( v3 > 0 )
{
v16 = 0;
v32 = 0LL;
v35 = (unsigned int *)(v26 + 4LL * (int)v30);
v36 = v3;
while ( 1 )
{
v17 = *(int *)(v34 + 4 * v32);
v29 = *(_DWORD *)(v34 + 4 * v32 + 4) - 1;
if ( v2 != 3 )
{
if ( amd_printf )
{
amd_printf(
"\n Frontal chain: %d. Frontal matrices %d to %d\n",
(unsigned int)v32,
(unsigned int)v17,
(unsigned int)(*(_DWORD *)(v34 + 4 * v32 + 4) - 1));
if ( amd_printf )
amd_printf(
"\tLargest frontal matrix in Frontal chain: %d-by-%d\n",
*(unsigned int *)(v37 + 4 * v32),
*(unsigned int *)(v38 + 4 * v32));
}
}
if ( (int)v17 <= v29 )
break;
LABEL_85:
v20 = *v35;
if ( (_DWORD)v20 && v2 != 3 && amd_printf )
amd_printf("\tFront: %d placeholder for %d empty columns\n", v30, v20);
if ( v36 == ++v32 )
goto LABEL_90;
}
while ( 1 )
{
v18 = *(_DWORD *)(v26 + 4 * v17);
if ( v2 != 3 )
{
if ( amd_printf )
{
amd_printf(
"\tFront: %d pivot cols: %d (pivot columns %d to %d)\n",
(unsigned int)v17,
v18,
v16,
v16 + v18 - 1);
if ( amd_printf )
{
amd_printf(
"\t pivot row candidates: %d to %d\n",
*(unsigned int *)(v4 + 4LL * *(int *)(v27 + 4 * v17)),
(unsigned int)(*(_DWORD *)(v4 + 4 * v17 + 4) - 1));
if ( amd_printf )
{
amd_printf("\t leftmost descendant: %d\n", *(unsigned int *)(v27 + 4 * v17));
if ( amd_printf )
{
amd_printf("\t 1st new candidate row : %d\n", *(unsigned int *)(v4 + 4 * v17));
if ( amd_printf )
amd_printf("\t parent:");
}
}
}
}
v19 = *(unsigned int *)(v31 + 4 * v17);
if ( (_DWORD)v19 == -1 )
{
if ( amd_printf )
amd_printf(" (none)\n");
}
else if ( amd_printf )
{
amd_printf(" %d\n", v19);
}
if ( v2 == 4 && (int)v30 > 21 && (_DWORD)v17 == 20 )
break;
}
v16 += v18;
if ( v29 < (int)++v17 )
goto LABEL_85;
}
if ( amd_printf )
amd_printf("\t...\n");
v9 = *v35;
if ( !(_DWORD)v9 )
{
v10 = v40;
if ( (int)v39 >= (int)v40 )
v10 = v39;
v11 = umf_i_malloc(v10, 4LL);
if ( v11 )
goto LABEL_26;
goto LABEL_129;
}
if ( amd_printf )
amd_printf("\tFront: %d placeholder for %d empty columns\n", v30, v9);
}
LABEL_90:
v21 = v40;
if ( (int)v39 >= (int)v40 )
v21 = v39;
v22 = umf_i_malloc(v21, 4LL);
v11 = v22;
if ( v22 )
{
if ( v2 == 3 )
{
v23 = umf_i_report_perm(v40, *(_QWORD *)(a1 + 136), v22, 3LL, 0LL);
v24 = umf_i_report_perm(v39, *(_QWORD *)(a1 + 144), v11, 3LL, 0LL);
umf_i_free(v11);
if ( !(v23 | v24) )
{
LABEL_33:
if ( amd_printf )
amd_printf("OK\n\n");
return 0;
}
return (unsigned int)-4;
}
LABEL_26:
if ( amd_printf )
amd_printf("\nInitial column permutation, Q1: ");
v12 = umf_i_report_perm(v40, *(_QWORD *)(a1 + 136), v11, (unsigned int)v2, 0LL);
if ( amd_printf )
amd_printf("\nInitial row permutation, P1: ");
v13 = umf_i_report_perm(v39, *(_QWORD *)(a1 + 144), v11, (unsigned int)v2, 0LL);
umf_i_free(v11);
if ( !(v12 | v13) )
{
if ( amd_printf )
{
amd_printf(" Symbolic object: ");
goto LABEL_33;
}
return 0;
}
return (unsigned int)-4;
}
LABEL_129:
v14 = -1;
if ( amd_printf )
amd_printf("ERROR: out of memory to check Symbolic object\n\n");
return v14;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, double *a2)
{
int v2; // er15
int v3; // er12
__int64 v4; // r13
unsigned int v5; // ebp
unsigned int v6; // er14
__int64 (*v7)(const char *, ...); // rdx
int v8; // eax
__int64 v9; // rdx
__int64 v10; // rdi
__int64 v11; // rbp
int v12; // er12
int v13; // er13
unsigned int v14; // er12
unsigned int v16; // ebp
__int64 v17; // r14
unsigned int v18; // er12
__int64 v19; // rsi
__int64 v20; // rdx
__int64 v21; // rdi
__int64 v22; // rax
int v23; // er12
int v24; // er13
int v25; // eax
__int64 v26; // [rsp+0h] [rbp-98h]
__int64 v27; // [rsp+8h] [rbp-90h]
unsigned int v28; // [rsp+10h] [rbp-88h]
int v29; // [rsp+10h] [rbp-88h]
unsigned int v30; // [rsp+14h] [rbp-84h]
__int64 v31; // [rsp+18h] [rbp-80h]
__int64 v32; // [rsp+20h] [rbp-78h]
__int64 v34; // [rsp+30h] [rbp-68h]
unsigned int *v35; // [rsp+38h] [rbp-60h]
__int64 v36; // [rsp+40h] [rbp-58h]
__int64 v37; // [rsp+48h] [rbp-50h]
__int64 v38; // [rsp+50h] [rbp-48h]
unsigned int v39; // [rsp+58h] [rbp-40h]
unsigned int v40; // [rsp+5Ch] [rbp-3Ch]

if ( !a2 )
return 0;
v2 = (int)*a2;
if ( v2 <= 2 )
return 0;
if ( amd_printf )
amd_printf("Symbolic object: ");
if ( !(unsigned int)umfzi_valid_symbolic(a1) )
{
if ( amd_printf )
amd_printf("ERROR: invalid\n");
return (unsigned int)-4;
}
v3 = *(_DWORD *)(a1 + 64);
v4 = *(_QWORD *)(a1 + 112);
v30 = *(_DWORD *)(a1 + 204);
v34 = *(_QWORD *)(a1 + 72);
v39 = *(_DWORD *)(a1 + 208);
v37 = *(_QWORD *)(a1 + 80);
v38 = *(_QWORD *)(a1 + 88);
v26 = *(_QWORD *)(a1 + 104);
v40 = *(_DWORD *)(a1 + 212);
v27 = *(_QWORD *)(a1 + 120);
v31 = *(_QWORD *)(a1 + 128);
if ( v2 == 3 )
goto LABEL_62;
v5 = *(_DWORD *)(a1 + 96);
v28 = *(_DWORD *)(a1 + 100);
if ( !amd_printf
|| (v6 = *(_DWORD *)(a1 + 216), amd_printf("\n matrix to be factorized:\n"), !amd_printf)
|| (amd_printf("\tn_row: %d n_col: %d\n", v39, v40), !amd_printf)
|| (amd_printf("\tnumber of entries: %d\n", v6), !amd_printf) )
{
if ( *(_DWORD *)(a1 + 236) != 3 )
goto LABEL_38;
v25 = *(_DWORD *)(a1 + 240);
if ( v25 == 1 )
goto LABEL_62;
v7 = 0LL;
if ( v25 == 2 )
goto LABEL_62;
goto LABEL_102;
}
amd_printf(" block size used for dense matrix kernels: %d\n", *(unsigned int *)(a1 + 220));
if ( !amd_printf )
{
if ( *(_DWORD *)(a1 + 236) != 3 )
goto LABEL_38;
LABEL_122:
v25 = *(_DWORD *)(a1 + 240);
if ( v25 == 1 )
goto LABEL_62;
if ( v25 == 2 )
goto LABEL_62;
v7 = 0LL;
if ( v25 == 6 )
goto LABEL_62;
LABEL_103:
if ( v25 == 3 )
{
if ( !v7 )
goto LABEL_62;
v7("metis on A");
v7 = amd_printf;
}
goto LABEL_42;
}
amd_printf(" strategy used: ");
if ( *(_DWORD *)(a1 + 236) != 3 )
{
if ( amd_printf )
{
amd_printf("unsymmetric\n");
if ( amd_printf )
{
amd_printf(" ordering used: ");
v7 = amd_printf;
v8 = *(_DWORD *)(a1 + 240);
if ( v8 == 1 )
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("colamd on A\n");
v7 = amd_printf;
goto LABEL_42;
}
if ( v8 != 2 )
{
if ( v8 == 6 )
{
LABEL_18:
if ( !v7 )
goto LABEL_62;
v7("user function");
v7 = amd_printf;
goto LABEL_42;
}
LABEL_41:
if ( v8 == 3 )
{
if ( !v7 )
goto LABEL_62;
v7("metis on A'A");
v7 = amd_printf;
}
goto LABEL_42;
}
goto LABEL_106;
}
}
LABEL_38:
v8 = *(_DWORD *)(a1 + 240);
if ( v8 == 1 )
goto LABEL_62;
if ( v8 == 2 )
goto LABEL_62;
v7 = 0LL;
if ( v8 == 6 )
goto LABEL_62;
goto LABEL_41;
}
if ( !amd_printf )
goto LABEL_122;
amd_printf("symmetric\n");
if ( !amd_printf )
goto LABEL_122;
amd_printf(" ordering used: ");
v7 = amd_printf;
v25 = *(_DWORD *)(a1 + 240);
if ( v25 != 1 )
{
if ( v25 == 2 )
{
LABEL_106:
if ( !v7 )
goto LABEL_62;
v7("user permutation");
v7 = amd_printf;
goto LABEL_42;
}
LABEL_102:
if ( v25 == 6 )
goto LABEL_18;
goto LABEL_103;
}
if ( !amd_printf )
goto LABEL_62;
amd_printf("amd on A\n");
v7 = amd_printf;
LABEL_42:
if ( v7 )
{
v7("\n");
if ( amd_printf )
{
amd_printf(" performn column etree postorder: ");
if ( *(_DWORD *)(a1 + 244) )
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("no\n");
}
else
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("yes\n");
}
if ( !amd_printf )
goto LABEL_62;
amd_printf(" prefer diagonal pivoting (attempt P=Q): ");
if ( *(_DWORD *)(a1 + 248) )
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("yes\n");
}
else
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("no\n");
}
if ( amd_printf )
{
amd_printf(" variable-size part of Numeric object:\n");
if ( amd_printf )
{
amd_printf(
"\tminimum initial size (Units): %.20g (MBytes): %.1f\n",
*(double *)(a1 + 32),
8.0 * *(double *)(a1 + 32) * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(
"\testimated peak size (Units): %.20g (MBytes): %.1f\n",
*(double *)a1,
8.0 * *(double *)a1 * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(
"\testimated final size (Units): %.20g (MBytes): %.1f\n",
*(double *)(a1 + 8),
8.0 * *(double *)(a1 + 8) * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(
" symbolic factorization memory usage (Units): %.20g (MBytes): %.1f\n",
*(double *)(a1 + 16),
8.0 * *(double *)(a1 + 16) * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(" frontal matrices / supercolumns:\n");
if ( amd_printf )
{
amd_printf("\tnumber of frontal chains: %d\n", (unsigned int)v3);
if ( amd_printf )
{
amd_printf("\tnumber of frontal matrices: %d\n", v30);
if ( amd_printf )
{
amd_printf("\tlargest frontal matrix row dimension: %d\n", v5);
if ( amd_printf )
amd_printf("\tlargest frontal matrix column dimension: %d\n", v28);
}
}
}
}
}
}
}
}
}
}
}
LABEL_62:
if ( v3 > 0 )
{
v16 = 0;
v32 = 0LL;
v35 = (unsigned int *)(v26 + 4LL * (int)v30);
v36 = v3;
while ( 1 )
{
v17 = *(int *)(v34 + 4 * v32);
v29 = *(_DWORD *)(v34 + 4 * v32 + 4) - 1;
if ( v2 != 3 )
{
if ( amd_printf )
{
amd_printf(
"\n Frontal chain: %d. Frontal matrices %d to %d\n",
(unsigned int)v32,
(unsigned int)v17,
(unsigned int)(*(_DWORD *)(v34 + 4 * v32 + 4) - 1));
if ( amd_printf )
amd_printf(
"\tLargest frontal matrix in Frontal chain: %d-by-%d\n",
*(unsigned int *)(v37 + 4 * v32),
*(unsigned int *)(v38 + 4 * v32));
}
}
if ( (int)v17 <= v29 )
break;
LABEL_85:
v20 = *v35;
if ( (_DWORD)v20 && v2 != 3 && amd_printf )
amd_printf("\tFront: %d placeholder for %d empty columns\n", v30, v20);
if ( v36 == ++v32 )
goto LABEL_90;
}
while ( 1 )
{
v18 = *(_DWORD *)(v26 + 4 * v17);
if ( v2 != 3 )
{
if ( amd_printf )
{
amd_printf(
"\tFront: %d pivot cols: %d (pivot columns %d to %d)\n",
(unsigned int)v17,
v18,
v16,
v16 + v18 - 1);
if ( amd_printf )
{
amd_printf(
"\t pivot row candidates: %d to %d\n",
*(unsigned int *)(v4 + 4LL * *(int *)(v27 + 4 * v17)),
(unsigned int)(*(_DWORD *)(v4 + 4 * v17 + 4) - 1));
if ( amd_printf )
{
amd_printf("\t leftmost descendant: %d\n", *(unsigned int *)(v27 + 4 * v17));
if ( amd_printf )
{
amd_printf("\t 1st new candidate row : %d\n", *(unsigned int *)(v4 + 4 * v17));
if ( amd_printf )
amd_printf("\t parent:");
}
}
}
}
v19 = *(unsigned int *)(v31 + 4 * v17);
if ( (_DWORD)v19 == -1 )
{
if ( amd_printf )
amd_printf(" (none)\n");
}
else if ( amd_printf )
{
amd_printf(" %d\n", v19);
}
if ( v2 == 4 && (int)v30 > 21 && (_DWORD)v17 == 20 )
break;
}
v16 += v18;
if ( v29 < (int)++v17 )
goto LABEL_85;
}
if ( amd_printf )
amd_printf("\t...\n");
v9 = *v35;
if ( !(_DWORD)v9 )
{
v10 = v40;
if ( (int)v39 >= (int)v40 )
v10 = v39;
v11 = umf_i_malloc(v10, 4LL);
if ( v11 )
goto LABEL_26;
goto LABEL_129;
}
if ( amd_printf )
amd_printf("\tFront: %d placeholder for %d empty columns\n", v30, v9);
}
LABEL_90:
v21 = v40;
if ( (int)v39 >= (int)v40 )
v21 = v39;
v22 = umf_i_malloc(v21, 4LL);
v11 = v22;
if ( v22 )
{
if ( v2 == 3 )
{
v23 = umf_i_report_perm(v40, *(_QWORD *)(a1 + 136), v22, 3LL, 0LL);
v24 = umf_i_report_perm(v39, *(_QWORD *)(a1 + 144), v11, 3LL, 0LL);
umf_i_free(v11);
if ( !(v23 | v24) )
{
LABEL_33:
if ( amd_printf )
amd_printf("OK\n\n");
return 0;
}
return (unsigned int)-4;
}
LABEL_26:
if ( amd_printf )
amd_printf("\nInitial column permutation, Q1: ");
v12 = umf_i_report_perm(v40, *(_QWORD *)(a1 + 136), v11, (unsigned int)v2, 0LL);
if ( amd_printf )
amd_printf("\nInitial row permutation, P1: ");
v13 = umf_i_report_perm(v39, *(_QWORD *)(a1 + 144), v11, (unsigned int)v2, 0LL);
umf_i_free(v11);
if ( !(v12 | v13) )
{
if ( amd_printf )
{
amd_printf(" Symbolic object: ");
goto LABEL_33;
}
return 0;
}
return (unsigned int)-4;
}
LABEL_129:
v14 = -1;
if ( amd_printf )
amd_printf("ERROR: out of memory to check Symbolic object\n\n");
return v14;
}

original_code:
int umfpack_zi_report_symbolic
(
    void *SymbolicHandle,
    const double Control [20]
)
{
    int 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 (!umfzi_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: ""%d"" n_col: ""%d""\n", n_row, n_col) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of entries: ""%d""\n", nz) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    block size used for dense matrix kernels:   ""%d""\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: ""%d""\n", nchains) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of frontal matrices: ""%d""\n", nfr) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tlargest frontal matrix row dimension: ""%d""\n", maxnrows) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tlargest frontal matrix column dimension: ""%d""\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: ""%d"".  Frontal matrices ""%d"" to ""%d""\n", (chain), (frontid1), (frontid2)) ; } ; } } ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tLargest frontal matrix in Frontal chain: ""%d""-by-""%d""\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: ""%d""  pivot cols: ""%d"" (pivot columns ""%d"" to " "%d"")\n", (frontid), kk, (k), (k+kk-1)) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    pivot row candidates: ""%d"" to ""%d""\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: ""%d""\n", (Front_leftmostdesc [frontid])) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    1st new candidate row : ""%d""\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 (" ""%d""\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: ""%d"" placeholder for ""%d"" empty columns\n", (nfr), Front_npivcol [nfr]) ; } ; } } ;
 }
 if (done)
 {
     break ;
 }
    }
    W = (int *) umf_i_malloc ((((n_row) > (n_col)) ? (n_row) : (n_col)), sizeof (int)) ;
    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_i_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_i_report_perm (n_row, Symbolic->Rperm_init, W, prl, 0) ;
    (void) umf_i_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:
int umfpack_zi_report_symbolic(void *SymbolicHandle, double Control[20])
{
    int n_row; int n_col; int nz; int nchains; int nfr; int maxnrows; int maxncols; int prl; int k; int chain; int frontid; int frontid1; int frontid2; int kk; int *Chain_start; int *W; int *Chain_maxrows; int *Chain_maxcols; int *Front_npivcol; int *Front_1strow; int *Front_leftmostdesc; int *Front_parent; int done; int status1; int 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 (!umfzi_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: ""%d"" n_col: ""%d""\n", n_row, n_col) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of entries: ""%d""\n", nz) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    block size used for dense matrix kernels:   ""%d""\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: ""%d""\n", nchains) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of frontal matrices: ""%d""\n", nfr) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tlargest frontal matrix row dimension: ""%d""\n", maxnrows) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tlargest frontal matrix column dimension: ""%d""\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: ""%d"".  Frontal matrices ""%d"" to ""%d""\n", (chain), (frontid1), (frontid2)) ; } ; } } ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tLargest frontal matrix in Frontal chain: ""%d""-by-""%d""\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: ""%d""  pivot cols: ""%d"" (pivot columns ""%d"" to " "%d"")\n", (frontid), kk, (k), (k+kk-1)) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    pivot row candidates: ""%d"" to ""%d""\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: ""%d""\n", (Front_leftmostdesc [frontid])) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    1st new candidate row : ""%d""\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 (" ""%d""\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: ""%d"" placeholder for ""%d"" empty columns\n", (nfr), Front_npivcol [nfr]) ; } ; } } ;
 }
 if (done)
 {
     break ;
 }
    }
    W = (int *) umf_i_malloc ((((n_row) > (n_col)) ? (n_row) : (n_col)), sizeof (int)) ;
    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_i_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_i_report_perm (n_row, Symbolic->Rperm_init, W, prl, 0) ;
    (void) umf_i_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:
Control
double [20]

variable_types: nz int

variable_types: nchains int

variable_types: nfr int

variable_types: maxnrows int

variable_types: maxncols int

variable_types: prl int

variable_types: k int

variable_types: chain int

variable_types: frontid int

variable_types: kk int

variable_types:
W
int *

variable_types: done int

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


original_code:
void amd_l1
(
    long n,
    const long Ap [ ],
    const long Ai [ ],
    long P [ ],
    long Pinv [ ],
    long Len [ ],
    long slen,
    long S [ ],
    double Control [ ],
    double Info [ ]
)
{
    long i, j, k, p, pfree, iwlen, pj, p1, p2, pj2, *Iw, *Pe, *Nv, *Head,
 *Elen, *Degree, *s, *W, *Sp, *Tp ;
    ;
    iwlen = slen - 6*n ;
    s = S ;
    Pe = s ; s += n ;
    Nv = s ; s += n ;
    Head = s ; s += n ;
    Elen = s ; s += n ;
    Degree = s ; s += n ;
    W = s ; s += n ;
    Iw = s ; s += iwlen ;
    ;
    Sp = Nv ;
    Tp = W ;
    pfree = 0 ;
    for (j = 0 ; j < n ; j++)
    {
 Pe [j] = pfree ;
 Sp [j] = pfree ;
 pfree += Len [j] ;
    }
    ;
    for (k = 0 ; k < n ; k++)
    {
 ;
 p1 = Ap [k] ;
 p2 = Ap [k+1] ;
 for (p = p1 ; p < p2 ; )
 {
     j = Ai [p] ;
     ;
     if (j < k)
     {
  ;
  ;
  Iw [Sp [j]++] = k ;
  Iw [Sp [k]++] = j ;
  p++ ;
     }
     else if (j == k)
     {
  p++ ;
  break ;
     }
     else
     {
  break ;
     }
     ;
     pj2 = Ap [j+1] ;
     for (pj = Tp [j] ; pj < pj2 ; )
     {
  i = Ai [pj] ;
  ;
  if (i < k)
  {
      ;
      ;
      Iw [Sp [i]++] = j ;
      Iw [Sp [j]++] = i ;
      pj++ ;
  }
  else if (i == k)
  {
      pj++ ;
      break ;
  }
  else
  {
      break ;
  }
     }
     Tp [j] = pj ;
 }
 Tp [k] = p ;
    }
    for (j = 0 ; j < n ; j++)
    {
 for (pj = Tp [j] ; pj < Ap [j+1] ; pj++)
 {
     i = Ai [pj] ;
     ;
     ;
     ;
     Iw [Sp [i]++] = j ;
     Iw [Sp [j]++] = i ;
 }
    }
    amd_l2 (n, Pe, Iw, Len, iwlen, pfree,
 Nv, Pinv, P, Head, Elen, Degree, W, Control, Info) ;
}

canonical_original_code:
void amd_l1(long n, long Ap[], long Ai[], long P[], long Pinv[], long Len[], long slen, long S[], double Control[], double Info[])
{
    long i; long j; long k; long p; long pfree; long iwlen; long pj; long p1; long p2; long pj2; long *Iw; long *Pe; long *Nv; long *Head; long *Elen; long *Degree; long *s; long *W; long *Sp; long *Tp;
    ;
    iwlen = slen - 6*n ;
    s = S ;
    Pe = s ; s += n ;
    Nv = s ; s += n ;
    Head = s ; s += n ;
    Elen = s ; s += n ;
    Degree = s ; s += n ;
    W = s ; s += n ;
    Iw = s ; s += iwlen ;
    ;
    Sp = Nv ;
    Tp = W ;
    pfree = 0 ;
    for (j = 0 ; j < n ; j++)
    {
 Pe [j] = pfree ;
 Sp [j] = pfree ;
 pfree += Len [j] ;
    }
    ;
    for (k = 0 ; k < n ; k++)
    {
 ;
 p1 = Ap [k] ;
 p2 = Ap [k+1] ;
 for (p = p1 ; p < p2 ; )
 {
     j = Ai [p] ;
     ;
     if (j < k)
     {
  ;
  ;
  Iw [Sp [j]++] = k ;
  Iw [Sp [k]++] = j ;
  p++ ;
     }
     else if (j == k)
     {
  p++ ;
  break ;
     }
     else
     {
  break ;
     }
     ;
     pj2 = Ap [j+1] ;
     for (pj = Tp [j] ; pj < pj2 ; )
     {
  i = Ai [pj] ;
  ;
  if (i < k)
  {
      ;
      ;
      Iw [Sp [i]++] = j ;
      Iw [Sp [j]++] = i ;
      pj++ ;
  }
  else if (i == k)
  {
      pj++ ;
      break ;
  }
  else
  {
      break ;
  }
     }
     Tp [j] = pj ;
 }
 Tp [k] = p ;
    }
    for (j = 0 ; j < n ; j++)
    {
 for (pj = Tp [j] ; pj < Ap [j+1] ; pj++)
 {
     i = Ai [pj] ;
     ;
     ;
     ;
     Iw [Sp [i]++] = j ;
     Iw [Sp [j]++] = i ;
 }
    }
    amd_l2 (n, Pe, Iw, Len, iwlen, pfree,
 Nv, Pinv, P, Head, Elen, Degree, W, Control, Info) ;
}

variable_types: n long

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
P
long []

variable_types:
Pinv
long []

variable_types:
Len
long []

variable_types: slen long

variable_types:
S
long []

variable_types:
Control
double []

variable_types:
Info
double []

variable_types: i long

variable_types: j long

variable_types: k long

variable_types: p long

variable_types: pfree long

variable_types: iwlen long

variable_types: pj long

variable_types:
Iw
long *

variable_types:
Pe
long *

variable_types:
Nv
long *

variable_types:
Head
long *

variable_types:
Elen
long *

variable_types:
Degree
long *

variable_types:
s
long *

variable_types:
W
long *

variable_types:
Sp
long *

variable_types:
Tp
long *


original_code:
void amd_1
(
    int n,
    const int Ap [ ],
    const int Ai [ ],
    int P [ ],
    int Pinv [ ],
    int Len [ ],
    int slen,
    int S [ ],
    double Control [ ],
    double Info [ ]
)
{
    int i, j, k, p, pfree, iwlen, pj, p1, p2, pj2, *Iw, *Pe, *Nv, *Head,
 *Elen, *Degree, *s, *W, *Sp, *Tp ;
    ;
    iwlen = slen - 6*n ;
    s = S ;
    Pe = s ; s += n ;
    Nv = s ; s += n ;
    Head = s ; s += n ;
    Elen = s ; s += n ;
    Degree = s ; s += n ;
    W = s ; s += n ;
    Iw = s ; s += iwlen ;
    ;
    Sp = Nv ;
    Tp = W ;
    pfree = 0 ;
    for (j = 0 ; j < n ; j++)
    {
 Pe [j] = pfree ;
 Sp [j] = pfree ;
 pfree += Len [j] ;
    }
    ;
    for (k = 0 ; k < n ; k++)
    {
 ;
 p1 = Ap [k] ;
 p2 = Ap [k+1] ;
 for (p = p1 ; p < p2 ; )
 {
     j = Ai [p] ;
     ;
     if (j < k)
     {
  ;
  ;
  Iw [Sp [j]++] = k ;
  Iw [Sp [k]++] = j ;
  p++ ;
     }
     else if (j == k)
     {
  p++ ;
  break ;
     }
     else
     {
  break ;
     }
     ;
     pj2 = Ap [j+1] ;
     for (pj = Tp [j] ; pj < pj2 ; )
     {
  i = Ai [pj] ;
  ;
  if (i < k)
  {
      ;
      ;
      Iw [Sp [i]++] = j ;
      Iw [Sp [j]++] = i ;
      pj++ ;
  }
  else if (i == k)
  {
      pj++ ;
      break ;
  }
  else
  {
      break ;
  }
     }
     Tp [j] = pj ;
 }
 Tp [k] = p ;
    }
    for (j = 0 ; j < n ; j++)
    {
 for (pj = Tp [j] ; pj < Ap [j+1] ; pj++)
 {
     i = Ai [pj] ;
     ;
     ;
     ;
     Iw [Sp [i]++] = j ;
     Iw [Sp [j]++] = i ;
 }
    }
    amd_2 (n, Pe, Iw, Len, iwlen, pfree,
 Nv, Pinv, P, Head, Elen, Degree, W, Control, Info) ;
}

canonical_original_code:
void amd_1(int n, int Ap[], int Ai[], int P[], int Pinv[], int Len[], int slen, int S[], double Control[], double Info[])
{
    int i; int j; int k; int p; int pfree; int iwlen; int pj; int p1; int p2; int pj2; int *Iw; int *Pe; int *Nv; int *Head; int *Elen; int *Degree; int *s; int *W; int *Sp; int *Tp;
    ;
    iwlen = slen - 6*n ;
    s = S ;
    Pe = s ; s += n ;
    Nv = s ; s += n ;
    Head = s ; s += n ;
    Elen = s ; s += n ;
    Degree = s ; s += n ;
    W = s ; s += n ;
    Iw = s ; s += iwlen ;
    ;
    Sp = Nv ;
    Tp = W ;
    pfree = 0 ;
    for (j = 0 ; j < n ; j++)
    {
 Pe [j] = pfree ;
 Sp [j] = pfree ;
 pfree += Len [j] ;
    }
    ;
    for (k = 0 ; k < n ; k++)
    {
 ;
 p1 = Ap [k] ;
 p2 = Ap [k+1] ;
 for (p = p1 ; p < p2 ; )
 {
     j = Ai [p] ;
     ;
     if (j < k)
     {
  ;
  ;
  Iw [Sp [j]++] = k ;
  Iw [Sp [k]++] = j ;
  p++ ;
     }
     else if (j == k)
     {
  p++ ;
  break ;
     }
     else
     {
  break ;
     }
     ;
     pj2 = Ap [j+1] ;
     for (pj = Tp [j] ; pj < pj2 ; )
     {
  i = Ai [pj] ;
  ;
  if (i < k)
  {
      ;
      ;
      Iw [Sp [i]++] = j ;
      Iw [Sp [j]++] = i ;
      pj++ ;
  }
  else if (i == k)
  {
      pj++ ;
      break ;
  }
  else
  {
      break ;
  }
     }
     Tp [j] = pj ;
 }
 Tp [k] = p ;
    }
    for (j = 0 ; j < n ; j++)
    {
 for (pj = Tp [j] ; pj < Ap [j+1] ; pj++)
 {
     i = Ai [pj] ;
     ;
     ;
     ;
     Iw [Sp [i]++] = j ;
     Iw [Sp [j]++] = i ;
 }
    }
    amd_2 (n, Pe, Iw, Len, iwlen, pfree,
 Nv, Pinv, P, Head, Elen, Degree, W, Control, Info) ;
}

variable_types: n int

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
P
int []

variable_types:
Pinv
int []

variable_types:
Len
int []

variable_types: slen int

variable_types:
S
int []

variable_types:
Control
double []

variable_types:
Info
double []

variable_types: i int

variable_types: j int

variable_types: k int

variable_types: p int

variable_types: pfree int

variable_types: iwlen int

variable_types: pj int

variable_types:
Iw
int *

variable_types:
Pe
int *

variable_types:
Nv
int *

variable_types:
Head
int *

variable_types:
Elen
int *

variable_types:
Degree
int *

variable_types:
s
int *

variable_types:
W
int *

variable_types:
Sp
int *

variable_types:
Tp
int *


original_code:
int amd_valid
(
    int n_row,
    int n_col,
    const int Ap [ ],
    const int Ai [ ]
)
{
    int nz, j, p1, p2, ilast, i, p, result = 0 ;
    if (n_row < 0 || n_col < 0 || Ap == ((void *)0) || Ai == ((void *)0))
    {
 return (-2) ;
    }
    nz = Ap [n_col] ;
    if (Ap [0] != 0 || nz < 0)
    {
 ;
 return (-2) ;
    }
    for (j = 0 ; j < n_col ; j++)
    {
 p1 = Ap [j] ;
 p2 = Ap [j+1] ;
 ;
 if (p1 > p2)
 {
     ;
     return (-2) ;
 }
 ilast = (-1) ;
 for (p = p1 ; p < p2 ; p++)
 {
     i = Ai [p] ;
     ;
     if (i < 0 || i >= n_row)
     {
  ;
  return (-2) ;
     }
     if (i <= ilast)
     {
  ;
  result = 1 ;
     }
     ilast = i ;
 }
    }
    return (result) ;
}

canonical_original_code:
int amd_valid(int n_row, int n_col, int Ap[], int Ai[])
{
    int nz; int j; int p1; int p2; int ilast; int i; int p; int result = 0;
    if (n_row < 0 || n_col < 0 || Ap == ((void *)0) || Ai == ((void *)0))
    {
 return (-2) ;
    }
    nz = Ap [n_col] ;
    if (Ap [0] != 0 || nz < 0)
    {
 ;
 return (-2) ;
    }
    for (j = 0 ; j < n_col ; j++)
    {
 p1 = Ap [j] ;
 p2 = Ap [j+1] ;
 ;
 if (p1 > p2)
 {
     ;
     return (-2) ;
 }
 ilast = (-1) ;
 for (p = p1 ; p < p2 ; p++)
 {
     i = Ai [p] ;
     ;
     if (i < 0 || i >= n_row)
     {
  ;
  return (-2) ;
     }
     if (i <= ilast)
     {
  ;
  result = 1 ;
     }
     ilast = i ;
 }
    }
    return (result) ;
}

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types: nz int

variable_types: ilast int

variable_types: i int

variable_types: result int


original_code:
long umf_l_singletons
(
    long n_row,
    long n_col,
    const long Ap [ ],
    const long Ai [ ],
    const long Quser [ ],
    long strategy,
    long do_singletons,
    long Cdeg [ ],
    long Cperm [ ],
    long Rdeg [ ],
    long Rperm [ ],
    long InvRperm [ ],
    long *p_n1,
    long *p_n1c,
    long *p_n1r,
    long *p_nempty_col,
    long *p_nempty_row,
    long *p_is_sym,
    long *p_max_rdeg,
    long Rp [ ],
    long Ri [ ],
    long W [ ],
    long Next [ ]
)
{
    long n1, s, col, row, p, p1, p2, cdeg, last_row, is_sym, k,
 nempty_row, nempty_col, max_cdeg, max_rdeg, n1c, n1r ;
    if (Ap [0] != 0 || Ap [n_col] < 0)
    {
 return ((-8)) ;
    }
    for (row = 0 ; row < n_row ; row++)
    {
 Rdeg [row] = 0 ;
    }
    for (col = 0 ; col < n_col ; col++)
    {
 p1 = Ap [col] ;
 p2 = Ap [col+1] ;
 cdeg = p2 - p1 ;
 if (cdeg < 0)
 {
     return ((-8)) ;
 }
 last_row = (-1) ;
 for (p = p1 ; p < p2 ; p++)
 {
     row = Ai [p] ;
     if (row <= last_row || row >= n_row)
     {
  return ((-8)) ;
     }
     Rdeg [row]++ ;
     last_row = row ;
 }
 Cdeg [col] = cdeg ;
    }
    if (!do_singletons)
    {
        n1 = 0 ;
        n1r = 0 ;
        n1c = 0 ;
    }
    else if (Quser != (long *) ((void *)0))
    {
 if (strategy == 1)
 {
     n1 = find_user_singletons (n_row, n_col, Ap, Ai, Quser,
      Cdeg, Rdeg, Cperm, Rperm, &n1r, &n1c, Rp, Ri, W) ;
 }
 else
 {
     n1 = 0 ;
     n1r = 0 ;
     n1c = 0 ;
 }
    }
    else
    {
 n1 = find_any_singletons (n_row, n_col, Ap, Ai,
  Cdeg, Rdeg, Cperm, Rperm, &n1r, &n1c, Rp, Ri, W, Next) ;
    }
    nempty_col = finish_permutation (n1, n_col, Cdeg, Quser, Cperm, &max_cdeg) ;
    if (Quser != (long *) ((void *)0) && strategy == 3)
    {
 ;
 nempty_row = finish_permutation (n1, n_row, Rdeg, Quser, Rperm,
     &max_rdeg) ;
    }
    else
    {
 nempty_row = finish_permutation (n1, n_row, Rdeg, (long *) ((void *)0), Rperm,
     &max_rdeg) ;
    }
    for (k = 0 ; k < n_row ; k++)
    {
 ;
 InvRperm [Rperm [k]] = k ;
    }
    if (n_row == n_col && nempty_row == nempty_col)
    {
 is_sym = (1) ;
 for (s = n1 ; is_sym &&
            s < n_col - nempty_col ; s++)
 {
     if (Cperm [s] != Rperm [s])
     {
  is_sym = (0) ;
     }
 }
    }
    else
    {
 is_sym = (0) ;
    }
    ;
    ;
    ;
    *p_n1 = n1 ;
    *p_n1r = n1r ;
    *p_n1c = n1c ;
    *p_is_sym = is_sym ;
    *p_nempty_col = nempty_col ;
    *p_nempty_row = nempty_row ;
    *p_max_rdeg = max_rdeg ;
    return ((0)) ;
}

canonical_original_code:
long umf_l_singletons(long n_row, long n_col, long Ap[], long Ai[], long Quser[], long strategy, long do_singletons, long Cdeg[], long Cperm[], long Rdeg[], long Rperm[], long InvRperm[], long *p_n1, long *p_n1c, long *p_n1r, long *p_nempty_col, long *p_nempty_row, long *p_is_sym, long *p_max_rdeg, long Rp[], long Ri[], long W[], long Next[])
{
    long n1; long s; long col; long row; long p; long p1; long p2; long cdeg; long last_row; long is_sym; long k; long nempty_row; long nempty_col; long max_cdeg; long max_rdeg; long n1c; long n1r;
    if (Ap [0] != 0 || Ap [n_col] < 0)
    {
 return ((-8)) ;
    }
    for (row = 0 ; row < n_row ; row++)
    {
 Rdeg [row] = 0 ;
    }
    for (col = 0 ; col < n_col ; col++)
    {
 p1 = Ap [col] ;
 p2 = Ap [col+1] ;
 cdeg = p2 - p1 ;
 if (cdeg < 0)
 {
     return ((-8)) ;
 }
 last_row = (-1) ;
 for (p = p1 ; p < p2 ; p++)
 {
     row = Ai [p] ;
     if (row <= last_row || row >= n_row)
     {
  return ((-8)) ;
     }
     Rdeg [row]++ ;
     last_row = row ;
 }
 Cdeg [col] = cdeg ;
    }
    if (!do_singletons)
    {
        n1 = 0 ;
        n1r = 0 ;
        n1c = 0 ;
    }
    else if (Quser != (long *) ((void *)0))
    {
 if (strategy == 1)
 {
     n1 = find_user_singletons (n_row, n_col, Ap, Ai, Quser,
      Cdeg, Rdeg, Cperm, Rperm, &n1r, &n1c, Rp, Ri, W) ;
 }
 else
 {
     n1 = 0 ;
     n1r = 0 ;
     n1c = 0 ;
 }
    }
    else
    {
 n1 = find_any_singletons (n_row, n_col, Ap, Ai,
  Cdeg, Rdeg, Cperm, Rperm, &n1r, &n1c, Rp, Ri, W, Next) ;
    }
    nempty_col = finish_permutation (n1, n_col, Cdeg, Quser, Cperm, &max_cdeg) ;
    if (Quser != (long *) ((void *)0) && strategy == 3)
    {
 ;
 nempty_row = finish_permutation (n1, n_row, Rdeg, Quser, Rperm,
     &max_rdeg) ;
    }
    else
    {
 nempty_row = finish_permutation (n1, n_row, Rdeg, (long *) ((void *)0), Rperm,
     &max_rdeg) ;
    }
    for (k = 0 ; k < n_row ; k++)
    {
 ;
 InvRperm [Rperm [k]] = k ;
    }
    if (n_row == n_col && nempty_row == nempty_col)
    {
 is_sym = (1) ;
 for (s = n1 ; is_sym &&
            s < n_col - nempty_col ; s++)
 {
     if (Cperm [s] != Rperm [s])
     {
  is_sym = (0) ;
     }
 }
    }
    else
    {
 is_sym = (0) ;
    }
    ;
    ;
    ;
    *p_n1 = n1 ;
    *p_n1r = n1r ;
    *p_n1c = n1c ;
    *p_is_sym = is_sym ;
    *p_nempty_col = nempty_col ;
    *p_nempty_row = nempty_row ;
    *p_max_rdeg = max_rdeg ;
    return ((0)) ;
}

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Quser
long []

variable_types: strategy long

variable_types:
Cdeg
long []

variable_types:
Cperm
long []

variable_types:
Rdeg
long []

variable_types:
Rperm
long []

variable_types:
InvRperm
long []

variable_types:
Rp
long []

variable_types:
Ri
long []

variable_types:
W
long []

variable_types:
Next
long []

variable_types: s long

variable_types: col long

variable_types: row long

variable_types: p long

variable_types: cdeg long

variable_types: k long

return_type: long


original_code:
static void create_row_form
(
    long n_row,
    long n_col,
    const long Ap [ ],
    const long Ai [ ],
    long Rdeg [ ],
    long Rp [ ],
    long Ri [ ],
    long W [ ]
)
{
    long row, col, p, p2 ;
    Rp [0] = 0 ;
    W [0] = 0 ;
    for (row = 0 ; row < n_row ; row++)
    {
 Rp [row+1] = Rp [row] + Rdeg [row] ;
 W [row] = Rp [row] ;
    }
    for (col = 0 ; col < n_col ; col++)
    {
 p2 = Ap [col+1] ;
 for (p = Ap [col] ; p < p2 ; p++)
 {
     Ri [W [Ai [p]]++] = col ;
 }
    }
}

canonical_original_code:
static void create_row_form(long n_row, long n_col, long Ap[], long Ai[], long Rdeg[], long Rp[], long Ri[], long W[])
{
    long row; long col; long p; long p2;
    Rp [0] = 0 ;
    W [0] = 0 ;
    for (row = 0 ; row < n_row ; row++)
    {
 Rp [row+1] = Rp [row] + Rdeg [row] ;
 W [row] = Rp [row] ;
    }
    for (col = 0 ; col < n_col ; col++)
    {
 p2 = Ap [col+1] ;
 for (p = Ap [col] ; p < p2 ; p++)
 {
     Ri [W [Ai [p]]++] = col ;
 }
    }
}

variable_types:
Ap
long []

variable_types:
Ai
long []


original_code:
static int order_singletons
(
    long k,
    long head,
    long tail,
    long Next [ ],
    long Xdeg [ ], long Xperm [ ], const long Xp [ ], const long Xi [ ],
    long Ydeg [ ], long Yperm [ ], const long Yp [ ], const long Yi [ ]
)
{
    long xpivot, x, y, ypivot, p, p2, deg ;
    while (head != (-1))
    {
 xpivot = head ;
 ;
 head = Next [xpivot] ;
 if (head == (-1)) tail = (-1) ;
 ;
 if (Xdeg [xpivot] != 1)
 {
     ;
     continue ;
 }
 ypivot = (-1) ;
 p2 = Xp [xpivot+1] ;
 for (p = Xp [xpivot] ; p < p2 ; p++)
 {
     y = Xi [p] ;
     ;
     if (Ydeg [y] >= 0)
     {
  ypivot = y ;
  break ;
     }
 }
 ;
 ;
 ;
 ;
 ;
 ;
 p2 = Yp [ypivot+1] ;
 for (p = Yp [ypivot] ; p < p2 ; p++)
 {
     x = Yi [p] ;
     ;
     if (Xdeg [x] < 0) continue ;
     ;
     if (x == xpivot) continue ;
     deg = --(Xdeg [x]) ;
     ;
     if (deg == 1)
     {
  Next [x] = (-1) ;
  if (head == (-1))
  {
      head = x ;
  }
  else
  {
      ;
      Next [tail] = x ;
  }
  tail = x ;
  ;
     }
 }
 Xdeg [xpivot] = (-(1)-2) ;
 Ydeg [ypivot] = (-(Ydeg [ypivot])-2) ;
 Xperm [k] = xpivot ;
 Yperm [k] = ypivot ;
 k++ ;
    }
    return (k) ;
}

canonical_original_code:
static int order_singletons(long k, long head, long tail, long Next[], long Xdeg[], long Xperm[], long Xp[], long Xi[], long Ydeg[], long Yperm[], long Yp[], long Yi[])
{
    long xpivot; long x; long y; long ypivot; long p; long p2; long deg;
    while (head != (-1))
    {
 xpivot = head ;
 ;
 head = Next [xpivot] ;
 if (head == (-1)) tail = (-1) ;
 ;
 if (Xdeg [xpivot] != 1)
 {
     ;
     continue ;
 }
 ypivot = (-1) ;
 p2 = Xp [xpivot+1] ;
 for (p = Xp [xpivot] ; p < p2 ; p++)
 {
     y = Xi [p] ;
     ;
     if (Ydeg [y] >= 0)
     {
  ypivot = y ;
  break ;
     }
 }
 ;
 ;
 ;
 ;
 ;
 ;
 p2 = Yp [ypivot+1] ;
 for (p = Yp [ypivot] ; p < p2 ; p++)
 {
     x = Yi [p] ;
     ;
     if (Xdeg [x] < 0) continue ;
     ;
     if (x == xpivot) continue ;
     deg = --(Xdeg [x]) ;
     ;
     if (deg == 1)
     {
  Next [x] = (-1) ;
  if (head == (-1))
  {
      head = x ;
  }
  else
  {
      ;
      Next [tail] = x ;
  }
  tail = x ;
  ;
     }
 }
 Xdeg [xpivot] = (-(1)-2) ;
 Ydeg [ypivot] = (-(Ydeg [ypivot])-2) ;
 Xperm [k] = xpivot ;
 Yperm [k] = ypivot ;
 k++ ;
    }
    return (k) ;
}

variable_types: head long

variable_types: tail long

variable_types:
Xdeg
long []

variable_types:
Xperm
long []

variable_types:
Xp
long []

variable_types:
Xi
long []

variable_types:
Ydeg
long []

variable_types:
Yperm
long []

variable_types:
Yp
long []

variable_types:
Yi
long []

variable_types: xpivot long

variable_types: x long

variable_types: y long

variable_types: ypivot long

variable_types: deg long


original_code:
static long find_any_singletons
(
    long n_row,
    long n_col,
    const long Ap [ ],
    const long Ai [ ],
    long Cdeg [ ],
    long Rdeg [ ],
    long Cperm [ ],
    long Rperm [ ],
    long *p_n1r,
    long *p_n1c,
    long Rp [ ],
    long Ri [ ],
    long W [ ],
    long Next [ ]
)
{
    long n1, col, row, row_form, head, tail, n1r, n1c ;
    n1 = 0 ;
    n1r = 0 ;
    n1c = 0 ;
    row_form = (0) ;
    head = (-1) ;
    tail = (-1) ;
    for (col = n_col-1 ; col >= 0 ; col--)
    {
 if (Cdeg [col] == 1)
 {
     if (head == (-1)) tail = col ;
     Next [col] = head ;
     head = col ;
     ;
 }
    }
    if (head != (-1))
    {
 create_row_form (n_row, n_col, Ap, Ai, Rdeg, Rp, Ri, W) ;
 row_form = (1) ;
 n1 = order_singletons (0, head, tail, Next,
  Cdeg, Cperm, Ap, Ai,
  Rdeg, Rperm, Rp, Ri
  ) ;
 n1c = n1 ;
    }
    head = (-1) ;
    tail = (-1) ;
    for (row = n_row-1 ; row >= 0 ; row--)
    {
 if (Rdeg [row] == 1)
 {
     if (head == (-1)) tail = row ;
     Next [row] = head ;
     head = row ;
     ;
 }
    }
    if (head != (-1))
    {
 if (!row_form)
 {
     create_row_form (n_row, n_col, Ap, Ai, Rdeg, Rp, Ri, W) ;
 }
 n1 = order_singletons (n1, head, tail, Next,
  Rdeg, Rperm, Rp, Ri,
  Cdeg, Cperm, Ap, Ai
  ) ;
 n1r = n1 - n1c ;
    }
    ;
    *p_n1r = n1r ;
    *p_n1c = n1c ;
    return (n1) ;
}

canonical_original_code:
static long find_any_singletons(long n_row, long n_col, long Ap[], long Ai[], long Cdeg[], long Rdeg[], long Cperm[], long Rperm[], long *p_n1r, long *p_n1c, long Rp[], long Ri[], long W[], long Next[])
{
    long n1; long col; long row; long row_form; long head; long tail; long n1r; long n1c;
    n1 = 0 ;
    n1r = 0 ;
    n1c = 0 ;
    row_form = (0) ;
    head = (-1) ;
    tail = (-1) ;
    for (col = n_col-1 ; col >= 0 ; col--)
    {
 if (Cdeg [col] == 1)
 {
     if (head == (-1)) tail = col ;
     Next [col] = head ;
     head = col ;
     ;
 }
    }
    if (head != (-1))
    {
 create_row_form (n_row, n_col, Ap, Ai, Rdeg, Rp, Ri, W) ;
 row_form = (1) ;
 n1 = order_singletons (0, head, tail, Next,
  Cdeg, Cperm, Ap, Ai,
  Rdeg, Rperm, Rp, Ri
  ) ;
 n1c = n1 ;
    }
    head = (-1) ;
    tail = (-1) ;
    for (row = n_row-1 ; row >= 0 ; row--)
    {
 if (Rdeg [row] == 1)
 {
     if (head == (-1)) tail = row ;
     Next [row] = head ;
     head = row ;
     ;
 }
    }
    if (head != (-1))
    {
 if (!row_form)
 {
     create_row_form (n_row, n_col, Ap, Ai, Rdeg, Rp, Ri, W) ;
 }
 n1 = order_singletons (n1, head, tail, Next,
  Rdeg, Rperm, Rp, Ri,
  Cdeg, Cperm, Ap, Ai
  ) ;
 n1r = n1 - n1c ;
    }
    ;
    *p_n1r = n1r ;
    *p_n1c = n1c ;
    return (n1) ;
}

variable_types:
Ap
long []

variable_types:
Cdeg
long []

variable_types:
Rdeg
long []

variable_types:
Cperm
long []

variable_types:
Rperm
long []

variable_types:
Rp
long []

variable_types:
Ri
long []

variable_types:
W
long []

variable_types:
Next
long []

variable_types: col long

variable_types: row long


original_code:
static long find_user_singletons
(
    long n_row,
    long n_col,
    const long Ap [ ],
    const long Ai [ ],
    const long Quser [ ],
    long Cdeg [ ],
    long Rdeg [ ],
    long Cperm [ ],
    long Rperm [ ],
    long *p_n1r,
    long *p_n1c,
    long Rp [ ],
    long Ri [ ],
    long W [ ]
)
{
    long n1, col, row, p, p2, pivcol, pivrow, found, k, n1r, n1c ;
    n1 = 0 ;
    n1r = 0 ;
    n1c = 0 ;
    *p_n1r = 0 ;
    *p_n1c = 0 ;
    pivcol = Quser [0] ;
    found = (Cdeg [pivcol] == 1) ;
    ;
    if (!found)
    {
 for (p = Ap [pivcol] ; p < Ap [pivcol+1] ; p++)
 {
     if (Rdeg [Ai [p]] == 1)
     {
  ;
  found = (1) ;
  break ;
     }
 }
    }
    if (!found)
    {
 return (0) ;
    }
    create_row_form (n_row, n_col, Ap, Ai, Rdeg, Rp, Ri, W) ;
    n1 = 0 ;
    for (k = 0 ; k < n_col ; k++)
    {
 pivcol = Quser [k] ;
 pivrow = (-1) ;
 found = (Cdeg [pivcol] == 1) ;
 if (found)
 {
     ;
     p2 = Ap [pivcol+1] ;
     for (p = Ap [pivcol] ; p < p2 ; p++)
     {
  row = Ai [p] ;
  ;
  if (Rdeg [row] >= 0)
  {
      pivrow = row ;
      break ;
  }
     }
     ;
     ;
     ;
     ;
     ;
     ;
     p2 = Rp [pivrow+1] ;
     for (p = Rp [pivrow] ; p < p2 ; p++)
     {
  col = Ri [p] ;
  ;
  if (Cdeg [col] < 0) continue ;
  ;
  Cdeg [col]-- ;
  ;
     }
     Cdeg [pivcol] = (-(1)-2) ;
     Rdeg [pivrow] = (-(Rdeg [pivrow])-2) ;
     n1c++ ;
 }
 else
 {
     p2 = Ap [pivcol+1] ;
     for (p = Ap [pivcol] ; p < p2 ; p++)
     {
  pivrow = Ai [p] ;
  if (Rdeg [pivrow] == 1)
  {
      ;
      found = (1) ;
      break ;
  }
     }
     if (!found)
     {
  ;
  break ;
     }
     ;
     ;
     ;
     ;
     ;
     p2 = Ap [pivcol+1] ;
     for (p = Ap [pivcol] ; p < p2 ; p++)
     {
  row = Ai [p] ;
  ;
  if (Rdeg [row] < 0) continue ;
  ;
  Rdeg [row]-- ;
  ;
     }
     Cdeg [pivcol] = (-(Cdeg [pivcol])-2) ;
     Rdeg [pivrow] = (-(1)-2) ;
     n1r++ ;
 }
 Cperm [k] = pivcol ;
 Rperm [k] = pivrow ;
 n1++ ;
    }
    ;
    ;
    *p_n1r = n1r ;
    *p_n1c = n1c ;
    return (n1) ;
}

canonical_original_code:
static long find_user_singletons(long n_row, long n_col, long Ap[], long Ai[], long Quser[], long Cdeg[], long Rdeg[], long Cperm[], long Rperm[], long *p_n1r, long *p_n1c, long Rp[], long Ri[], long W[])
{
    long n1; long col; long row; long p; long p2; long pivcol; long pivrow; long found; long k; long n1r; long n1c;
    n1 = 0 ;
    n1r = 0 ;
    n1c = 0 ;
    *p_n1r = 0 ;
    *p_n1c = 0 ;
    pivcol = Quser [0] ;
    found = (Cdeg [pivcol] == 1) ;
    ;
    if (!found)
    {
 for (p = Ap [pivcol] ; p < Ap [pivcol+1] ; p++)
 {
     if (Rdeg [Ai [p]] == 1)
     {
  ;
  found = (1) ;
  break ;
     }
 }
    }
    if (!found)
    {
 return (0) ;
    }
    create_row_form (n_row, n_col, Ap, Ai, Rdeg, Rp, Ri, W) ;
    n1 = 0 ;
    for (k = 0 ; k < n_col ; k++)
    {
 pivcol = Quser [k] ;
 pivrow = (-1) ;
 found = (Cdeg [pivcol] == 1) ;
 if (found)
 {
     ;
     p2 = Ap [pivcol+1] ;
     for (p = Ap [pivcol] ; p < p2 ; p++)
     {
  row = Ai [p] ;
  ;
  if (Rdeg [row] >= 0)
  {
      pivrow = row ;
      break ;
  }
     }
     ;
     ;
     ;
     ;
     ;
     ;
     p2 = Rp [pivrow+1] ;
     for (p = Rp [pivrow] ; p < p2 ; p++)
     {
  col = Ri [p] ;
  ;
  if (Cdeg [col] < 0) continue ;
  ;
  Cdeg [col]-- ;
  ;
     }
     Cdeg [pivcol] = (-(1)-2) ;
     Rdeg [pivrow] = (-(Rdeg [pivrow])-2) ;
     n1c++ ;
 }
 else
 {
     p2 = Ap [pivcol+1] ;
     for (p = Ap [pivcol] ; p < p2 ; p++)
     {
  pivrow = Ai [p] ;
  if (Rdeg [pivrow] == 1)
  {
      ;
      found = (1) ;
      break ;
  }
     }
     if (!found)
     {
  ;
  break ;
     }
     ;
     ;
     ;
     ;
     ;
     p2 = Ap [pivcol+1] ;
     for (p = Ap [pivcol] ; p < p2 ; p++)
     {
  row = Ai [p] ;
  ;
  if (Rdeg [row] < 0) continue ;
  ;
  Rdeg [row]-- ;
  ;
     }
     Cdeg [pivcol] = (-(Cdeg [pivcol])-2) ;
     Rdeg [pivrow] = (-(1)-2) ;
     n1r++ ;
 }
 Cperm [k] = pivcol ;
 Rperm [k] = pivrow ;
 n1++ ;
    }
    ;
    ;
    *p_n1r = n1r ;
    *p_n1c = n1c ;
    return (n1) ;
}

variable_types:
Ai
long []

variable_types:
Quser
long []

variable_types: p long

variable_types: pivcol long

variable_types: pivrow long

variable_types: found long

variable_types: k long


original_code:
static long finish_permutation
(
    long n1,
    long nx,
    long Xdeg [ ],
    const long Xuser [ ],
    long Xperm [ ],
    long *p_max_deg
)
{
    long nempty, x, deg, s, max_deg, k ;
    nempty = 0 ;
    s = n1 ;
    max_deg = 0 ;
    ;
    for (k = 0 ; k < nx ; k++)
    {
 x = (Xuser != (long *) ((void *)0)) ? Xuser [k] : k ;
 ;
 deg = Xdeg [x] ;
 if (deg == 0)
 {
     ;
     ;
     nempty++ ;
     Xperm [nx - nempty] = x ;
 }
 else if (deg > 0)
 {
     ;
     Xperm [s++] = x ;
     max_deg = (((max_deg) > (deg)) ? (max_deg) : (deg)) ;
 }
 else
 {
     Xdeg [x] = (-(deg)-2) ;
 }
    }
    ;
    *p_max_deg = max_deg ;
    return (nempty) ;
}

canonical_original_code:
static long finish_permutation(long n1, long nx, long Xdeg[], long Xuser[], long Xperm[], long *p_max_deg)
{
    long nempty; long x; long deg; long s; long max_deg; long k;
    nempty = 0 ;
    s = n1 ;
    max_deg = 0 ;
    ;
    for (k = 0 ; k < nx ; k++)
    {
 x = (Xuser != (long *) ((void *)0)) ? Xuser [k] : k ;
 ;
 deg = Xdeg [x] ;
 if (deg == 0)
 {
     ;
     ;
     nempty++ ;
     Xperm [nx - nempty] = x ;
 }
 else if (deg > 0)
 {
     ;
     Xperm [s++] = x ;
     max_deg = (((max_deg) > (deg)) ? (max_deg) : (deg)) ;
 }
 else
 {
     Xdeg [x] = (-(deg)-2) ;
 }
    }
    ;
    *p_max_deg = max_deg ;
    return (nempty) ;
}

variable_types: nx long

variable_types:
Xdeg
long []

variable_types:
Xuser
long []

variable_types:
Xperm
long []

variable_types: nempty long

variable_types: x long

variable_types: deg long

variable_types: s long


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

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

variable_types:
Ap
long []

variable_types:
Tj
long []

variable_types: nz long

variable_types: j long

variable_types: length long