original_code:
double cholmod_l_rcond
(
    cholmod_factor *L,
    cholmod_common *Common
)
{
    double lmin, lmax, rcond ;
    double *Lx ;
    long *Lpi, *Lpx, *Super, *Lp ;
    long n, e, nsuper, s, k1, k2, psi, psend, psx, nsrow, nscol, jj, j ;
    { if (Common == ((void *)0)) { return ((-1)) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return ((-1)) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rcond.c", 85, "argument missing", Common) ; } return ((-1)) ; } } ;
    { if ((L)->xtype < (1) || (L)->xtype > (3) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rcond.c", 86, "invalid xtype", Common) ; } return ((-1)) ; } } ;
    Common->status = 0 ;
    n = L->n ;
    if (n == 0)
    {
 return (1) ;
    }
    if (L->minor < L->n)
    {
 return (0) ;
    }
    e = (L->xtype == 2) ? 2 : 1 ;
    if (L->is_super)
    {
 nsuper = L->nsuper ;
 Lpi = L->pi ;
 Lpx = L->px ;
 Super = L->super ;
 Lx = L->x ;
 { double ljj = Lx [0] ; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
 for (s = 0 ; s < nsuper ; s++)
 {
     k1 = Super [s] ;
     k2 = Super [s+1] ;
     psi = Lpi [s] ;
     psend = Lpi [s+1] ;
     psx = Lpx [s] ;
     nsrow = psend - psi ;
     nscol = k2 - k1 ;
     for (jj = 0 ; jj < nscol ; jj++)
     {
  { double ljj = Lx [e * (psx + jj + jj*nsrow)] ; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    else
    {
 Lp = L->p ;
 Lx = L->x ;
 if (L->is_ll)
 {
     { double ljj = Lx [Lp [0]] ; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = Lx [e * Lp [j]] ; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
 else
 {
     { double ljj = fabs (Lx [Lp [0]]) ; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = fabs (Lx [e * Lp [j]]) ; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    rcond = lmin / lmax ;
    if (L->is_ll)
    {
 rcond = rcond*rcond ;
    }
    return (rcond) ;
}

canonical_original_code:
double cholmod_l_rcond(struct cholmod_factor_struct *L, struct cholmod_common_struct *Common)
{
    double lmin; double lmax; double rcond;
    double *Lx;
    long *Lpi; long *Lpx; long *Super; long *Lp;
    long n; long e; long nsuper; long s; long k1; long k2; long psi; long psend; long psx; long nsrow; long nscol; long jj; long j;
    { if (Common == ((void *)0)) { return ((-1)) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return ((-1)) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rcond.c", 85, "argument missing", Common) ; } return ((-1)) ; } } ;
    { if ((L)->xtype < (1) || (L)->xtype > (3) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rcond.c", 86, "invalid xtype", Common) ; } return ((-1)) ; } } ;
    Common->status = 0 ;
    n = L->n ;
    if (n == 0)
    {
 return (1) ;
    }
    if (L->minor < L->n)
    {
 return (0) ;
    }
    e = (L->xtype == 2) ? 2 : 1 ;
    if (L->is_super)
    {
 nsuper = L->nsuper ;
 Lpi = L->pi ;
 Lpx = L->px ;
 Super = L->super ;
 Lx = L->x ;
 { double ljj = Lx [0]; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
 for (s = 0 ; s < nsuper ; s++)
 {
     k1 = Super [s] ;
     k2 = Super [s+1] ;
     psi = Lpi [s] ;
     psend = Lpi [s+1] ;
     psx = Lpx [s] ;
     nsrow = psend - psi ;
     nscol = k2 - k1 ;
     for (jj = 0 ; jj < nscol ; jj++)
     {
  { double ljj = Lx [e * (psx + jj + jj*nsrow)]; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    else
    {
 Lp = L->p ;
 Lx = L->x ;
 if (L->is_ll)
 {
     { double ljj = Lx [Lp [0]]; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = Lx [e * Lp [j]]; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
 else
 {
     { double ljj = fabs (Lx [Lp [0]]); if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = fabs (Lx [e * Lp [j]]); if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    rcond = lmin / lmax ;
    if (L->is_ll)
    {
 rcond = rcond*rcond ;
    }
    return (rcond) ;
}

variable_types: struct cholmod_factor_struct { unsigned long n; unsigned long minor; void *Perm; void *ColCount; unsigned long nzmax; void *p; void *i; void *x; void *z; void *nz; void *next; void *prev; unsigned long nsuper; unsigned long ssize; unsigned long xsize; unsigned long maxcsize; unsigned long maxesize; void *super; void *pi; void *px; void *s; int ordering; int is_ll; int is_super; int is_monotonic; int itype; int xtype; int dtype; } *

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

variable_types: lmax double

variable_types: rcond double

variable_types:
Lx
double *

variable_types:
Lpi
long *

variable_types:
Lpx
long *

variable_types:
Super
long *

variable_types:
Lp
long *

variable_types: e long

variable_types: nsuper long

variable_types: s long

variable_types: psi long

variable_types: psend long

variable_types: psx long

variable_types: nsrow long

variable_types: nscol long

variable_types: jj long

variable_types: j long

variable_types: ljj double

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 cholmod_l_rowdel_mark
(
    size_t kdel,
    cholmod_sparse *R,
    double yk [2],
    long *colmark,
    cholmod_factor *L,
    cholmod_dense *X,
    cholmod_dense *DeltaB,
    cholmod_common *Common
)
{
    double dk, sqrt_dk, xk, dj, fl ;
    double *Lx, *Cx, *W, *Xx, *Nx ;
    long *Li, *Lp, *Lnz, *Ci, *Rj, *Rp, *Iwork ;
    cholmod_sparse *C, Cmatrix ;
    long j, p, pend, kk, lnz, n, Cp [2], do_solve, do_update, left, k,
 right, middle, i, klast, given_row, rnz ;
    size_t s ;
    int ok = 1 ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 130, "argument missing", Common) ; } return (0) ; } } ;
    { if ((L)->xtype < (0) || (L)->xtype > (1) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 131, "invalid xtype", Common) ; } return (0) ; } } ;
    n = L->n ;
    k = kdel ;
    if (kdel >= L->n || k < 0)
    {
 cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 136, "k invalid", Common) ;
 return (0) ;
    }
    if (R == ((void *)0))
    {
 Rj = ((void *)0) ;
 rnz = (-1) ;
    }
    else
    {
 { if ((R)->xtype < (0) || (R)->xtype > (3) || ((R)->xtype != 0 && ((R)->x) == ((void *)0)) || ((R)->xtype == 3 && ((R)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 146, "invalid xtype", Common) ; } return (0) ; } } ;
 if (R->ncol != 1 || R->nrow != L->n)
 {
     cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 149, "R invalid", Common) ;
     return (0) ;
 }
 Rj = R->i ;
 Rp = R->p ;
 rnz = Rp [1] ;
    }
    do_solve = (X != ((void *)0)) && (DeltaB != ((void *)0)) ;
    if (do_solve)
    {
 { if ((X)->xtype < (1) || (X)->xtype > (1) || ((X)->xtype != 0 && ((X)->x) == ((void *)0)) || ((X)->xtype == 3 && ((X)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 159, "invalid xtype", Common) ; } return (0) ; } } ;
 { if ((DeltaB)->xtype < (1) || (DeltaB)->xtype > (1) || ((DeltaB)->xtype != 0 && ((DeltaB)->x) == ((void *)0)) || ((DeltaB)->xtype == 3 && ((DeltaB)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 160, "invalid xtype", Common) ; } return (0) ; } } ;
 Xx = X->x ;
 Nx = DeltaB->x ;
 if (X->nrow != L->n || X->ncol != 1 || DeltaB->nrow != L->n ||
  DeltaB->ncol != 1 || Xx == ((void *)0) || Nx == ((void *)0))
 {
     cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 166, "X and/or DeltaB invalid", Common) ;
     return (0) ;
 }
    }
    else
    {
 Xx = ((void *)0) ;
 Nx = ((void *)0) ;
    }
    Common->status = 0 ;
    s = cholmod_l_mult_size_t (n, 2, &ok) ;
    if (!ok)
    {
 cholmod_l_error ((-3), "../Modify/cholmod_rowdel.c", 185, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_l_allocate_work (n, s, s, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    ;
    if (L->xtype == 0 || L->is_super || L->is_ll)
    {
 cholmod_l_change_factor (1, 0, 0, 0, 0, L,
  Common) ;
 if (Common->status < 0)
 {
     return (0) ;
 }
    }
    Lp = L->p ;
    Lnz = L->nz ;
    Li = L->i ;
    Lx = L->x ;
    ;
    W = Common->Xwork ;
    Cx = W + n ;
    Iwork = Common->Iwork ;
    Ci = Iwork + n ;
    given_row = (rnz >= 0) ;
    klast = given_row ? rnz : k ;
    ;
    for (kk = 0 ; kk < klast ; kk++)
    {
 j = given_row ? (Rj [kk]) : (kk) ;
 if (j < 0 || j >= k)
 {
     cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 251, "R invalid", Common) ;
     return (0) ;
 }
 ;
 lnz = Lnz [j] ;
 dj = Lx [Lp [j]] ;
 ;
 if (lnz > 1)
 {
     left = Lp [j] ;
     pend = left + lnz ;
     right = pend - 1 ;
     i = Li [right] ;
     if (i < k)
     {
  continue ;
     }
     else if (i == k)
     {
  if (do_solve)
  {
      Xx [j] -= yk [0] * dj * Lx [right] ;
  }
  Lx [right] = 0 ;
     }
     else
     {
  ;
  while (left < right)
  {
      middle = (left + right) / 2 ;
      ;
      if (k > Li [middle])
      {
   left = middle + 1 ;
      }
      else
      {
   right = middle ;
      }
  }
  ;
  if (k == Li [left])
  {
      if (do_solve)
      {
   Xx [j] -= yk [0] * dj * Lx [left] ;
      }
      Lx [left] = 0 ;
  }
     }
 }
    }
    lnz = Lnz [k] - 1 ;
    ;
    ;
    p = Lp [k] ;
    pend = p + lnz + 1 ;
    dk = Lx [p] ;
    Lx [p++] = 1 ;
    ;
    ok = 1 ;
    fl = 0 ;
    if (lnz > 0)
    {
 if (do_solve)
 {
     xk = Xx [k] - yk [0] * dk ;
     for ( ; p < pend ; p++)
     {
  Nx [Li [p]] += Lx [p] * xk ;
     }
 }
 do_update = ((dk) > 0.) ;
 if (!do_update)
 {
     dk = -dk ;
 }
 sqrt_dk = sqrt (dk) ;
 p = Lp [k] + 1 ;
 for (kk = 0 ; kk < lnz ; kk++, p++)
 {
     Ci [kk] = Li [p] ;
     Cx [kk] = Lx [p] * sqrt_dk ;
     Lx [p] = 0 ;
 }
 fl = lnz + 1 ;
 C = &Cmatrix ;
 C->nrow = n ;
 C->ncol = 1 ;
 C->nzmax = lnz ;
 C->sorted = 1 ;
 C->packed = 1 ;
 C->p = Cp ;
 C->i = Ci ;
 C->x = Cx ;
 C->nz = ((void *)0) ;
 C->itype = L->itype ;
 C->xtype = L->xtype ;
 C->dtype = L->dtype ;
 C->z = ((void *)0) ;
 C->stype = 0 ;
 Cp [0] = 0 ;
 Cp [1] = lnz ;
 ok = cholmod_l_updown_mark (do_update ? (1) : (0), C, colmark,
  L, X, DeltaB, Common) ;
 for (kk = 0 ; kk < lnz ; kk++)
 {
     Cx [kk] = 0 ;
 }
    }
    Common->modfl += fl ;
    if (do_solve)
    {
 Xx [k] = yk [0] ;
    }
    ;
    ;
    return (ok) ;
}

canonical_original_code:
int cholmod_l_rowdel_mark(unsigned long kdel, struct cholmod_sparse_struct *R, double yk[2], long *colmark, struct cholmod_factor_struct *L, struct cholmod_dense_struct *X, struct cholmod_dense_struct *DeltaB, struct cholmod_common_struct *Common)
{
    double dk; double sqrt_dk; double xk; double dj; double fl;
    double *Lx; double *Cx; double *W; double *Xx; double *Nx;
    long *Li; long *Lp; long *Lnz; long *Ci; long *Rj; long *Rp; long *Iwork;
    struct cholmod_sparse_struct *C; struct cholmod_sparse_struct Cmatrix;
    long j; long p; long pend; long kk; long lnz; long n; long Cp[2]; long do_solve; long do_update; long left; long k; long right; long middle; long i; long klast; long given_row; long rnz;
    unsigned long s;
    int ok = 1;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 130, "argument missing", Common) ; } return (0) ; } } ;
    { if ((L)->xtype < (0) || (L)->xtype > (1) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 131, "invalid xtype", Common) ; } return (0) ; } } ;
    n = L->n ;
    k = kdel ;
    if (kdel >= L->n || k < 0)
    {
 cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 136, "k invalid", Common) ;
 return (0) ;
    }
    if (R == ((void *)0))
    {
 Rj = ((void *)0) ;
 rnz = (-1) ;
    }
    else
    {
 { if ((R)->xtype < (0) || (R)->xtype > (3) || ((R)->xtype != 0 && ((R)->x) == ((void *)0)) || ((R)->xtype == 3 && ((R)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 146, "invalid xtype", Common) ; } return (0) ; } } ;
 if (R->ncol != 1 || R->nrow != L->n)
 {
     cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 149, "R invalid", Common) ;
     return (0) ;
 }
 Rj = R->i ;
 Rp = R->p ;
 rnz = Rp [1] ;
    }
    do_solve = (X != ((void *)0)) && (DeltaB != ((void *)0)) ;
    if (do_solve)
    {
 { if ((X)->xtype < (1) || (X)->xtype > (1) || ((X)->xtype != 0 && ((X)->x) == ((void *)0)) || ((X)->xtype == 3 && ((X)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 159, "invalid xtype", Common) ; } return (0) ; } } ;
 { if ((DeltaB)->xtype < (1) || (DeltaB)->xtype > (1) || ((DeltaB)->xtype != 0 && ((DeltaB)->x) == ((void *)0)) || ((DeltaB)->xtype == 3 && ((DeltaB)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 160, "invalid xtype", Common) ; } return (0) ; } } ;
 Xx = X->x ;
 Nx = DeltaB->x ;
 if (X->nrow != L->n || X->ncol != 1 || DeltaB->nrow != L->n ||
  DeltaB->ncol != 1 || Xx == ((void *)0) || Nx == ((void *)0))
 {
     cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 166, "X and/or DeltaB invalid", Common) ;
     return (0) ;
 }
    }
    else
    {
 Xx = ((void *)0) ;
 Nx = ((void *)0) ;
    }
    Common->status = 0 ;
    s = cholmod_l_mult_size_t (n, 2, &ok) ;
    if (!ok)
    {
 cholmod_l_error ((-3), "../Modify/cholmod_rowdel.c", 185, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_l_allocate_work (n, s, s, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    ;
    if (L->xtype == 0 || L->is_super || L->is_ll)
    {
 cholmod_l_change_factor (1, 0, 0, 0, 0, L,
  Common) ;
 if (Common->status < 0)
 {
     return (0) ;
 }
    }
    Lp = L->p ;
    Lnz = L->nz ;
    Li = L->i ;
    Lx = L->x ;
    ;
    W = Common->Xwork ;
    Cx = W + n ;
    Iwork = Common->Iwork ;
    Ci = Iwork + n ;
    given_row = (rnz >= 0) ;
    klast = given_row ? rnz : k ;
    ;
    for (kk = 0 ; kk < klast ; kk++)
    {
 j = given_row ? (Rj [kk]) : (kk) ;
 if (j < 0 || j >= k)
 {
     cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 251, "R invalid", Common) ;
     return (0) ;
 }
 ;
 lnz = Lnz [j] ;
 dj = Lx [Lp [j]] ;
 ;
 if (lnz > 1)
 {
     left = Lp [j] ;
     pend = left + lnz ;
     right = pend - 1 ;
     i = Li [right] ;
     if (i < k)
     {
  continue ;
     }
     else if (i == k)
     {
  if (do_solve)
  {
      Xx [j] -= yk [0] * dj * Lx [right] ;
  }
  Lx [right] = 0 ;
     }
     else
     {
  ;
  while (left < right)
  {
      middle = (left + right) / 2 ;
      ;
      if (k > Li [middle])
      {
   left = middle + 1 ;
      }
      else
      {
   right = middle ;
      }
  }
  ;
  if (k == Li [left])
  {
      if (do_solve)
      {
   Xx [j] -= yk [0] * dj * Lx [left] ;
      }
      Lx [left] = 0 ;
  }
     }
 }
    }
    lnz = Lnz [k] - 1 ;
    ;
    ;
    p = Lp [k] ;
    pend = p + lnz + 1 ;
    dk = Lx [p] ;
    Lx [p++] = 1 ;
    ;
    ok = 1 ;
    fl = 0 ;
    if (lnz > 0)
    {
 if (do_solve)
 {
     xk = Xx [k] - yk [0] * dk ;
     for ( ; p < pend ; p++)
     {
  Nx [Li [p]] += Lx [p] * xk ;
     }
 }
 do_update = ((dk) > 0.) ;
 if (!do_update)
 {
     dk = -dk ;
 }
 sqrt_dk = sqrt (dk) ;
 p = Lp [k] + 1 ;
 for (kk = 0 ; kk < lnz ; kk++, p++)
 {
     Ci [kk] = Li [p] ;
     Cx [kk] = Lx [p] * sqrt_dk ;
     Lx [p] = 0 ;
 }
 fl = lnz + 1 ;
 C = &Cmatrix ;
 C->nrow = n ;
 C->ncol = 1 ;
 C->nzmax = lnz ;
 C->sorted = 1 ;
 C->packed = 1 ;
 C->p = Cp ;
 C->i = Ci ;
 C->x = Cx ;
 C->nz = ((void *)0) ;
 C->itype = L->itype ;
 C->xtype = L->xtype ;
 C->dtype = L->dtype ;
 C->z = ((void *)0) ;
 C->stype = 0 ;
 Cp [0] = 0 ;
 Cp [1] = lnz ;
 ok = cholmod_l_updown_mark (do_update ? (1) : (0), C, colmark,
  L, X, DeltaB, Common) ;
 for (kk = 0 ; kk < lnz ; kk++)
 {
     Cx [kk] = 0 ;
 }
    }
    Common->modfl += fl ;
    if (do_solve)
    {
 Xx [k] = yk [0] ;
    }
    ;
    ;
    return (ok) ;
}

variable_types:
kdel
unsigned long

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:
yk
double [2]

variable_types:
colmark
long *

variable_types: struct cholmod_factor_struct { unsigned long n; unsigned long minor; void *Perm; void *ColCount; unsigned long nzmax; void *p; void *i; void *x; void *z; void *nz; void *next; void *prev; unsigned long nsuper; unsigned long ssize; unsigned long xsize; unsigned long maxcsize; unsigned long maxesize; void *super; void *pi; void *px; void *s; int ordering; int is_ll; int is_super; int is_monotonic; int itype; int xtype; int dtype; } *

variable_types: struct cholmod_dense_struct { unsigned long nrow; unsigned long ncol; unsigned long nzmax; unsigned long d; void *x; void *z; int xtype; int dtype; } *

variable_types:
DeltaB
struct cholmod_dense_struct *

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

variable_types: xk double

variable_types: dj double

variable_types: fl double

variable_types:
Cx
double *

variable_types:
W
double *

variable_types:
Xx
double *

variable_types:
Nx
double *

variable_types:
Li
long *

variable_types:
Lnz
long *

variable_types:
Ci
long *

variable_types:
Rj
long *

variable_types:
Rp
long *

variable_types:
Iwork
long *

variable_types: p long

variable_types: pend long

variable_types: kk long

variable_types: lnz long

variable_types: n long

variable_types:
Cp
long [2]

variable_types: left long

variable_types: k long

variable_types: right long

variable_types: middle long

variable_types: i long

variable_types: klast long

variable_types: rnz long

variable_types:
s
unsigned long

variable_types: ok int

return_type: int


decompiled_code:
__int64 __fastcall cholmod_l_rowdel(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
__int64 v5[3]; // [rsp+0h] [rbp-18h] BYREF

v5[0] = 0LL;
v5[1] = 0LL;
return cholmod_l_rowdel_mark(a1, a2, (double *)v5, 0LL, a3, 0LL, 0LL, a4);
}

original_code:
int cholmod_l_rowdel
(
    size_t k,
    cholmod_sparse *R,
    cholmod_factor *L,
    cholmod_common *Common
)
{
    double yk [2] ;
    yk [0] = 0. ;
    yk [1] = 0. ;
    return (cholmod_l_rowdel_mark (k, R, yk, ((void *)0), L, ((void *)0), ((void *)0), Common)) ;
}

canonical_original_code:
int cholmod_l_rowdel(unsigned long k, struct cholmod_sparse_struct *R, struct cholmod_factor_struct *L, struct cholmod_common_struct *Common)
{
    double yk[2];
    yk [0] = 0. ;
    yk [1] = 0. ;
    return (cholmod_l_rowdel_mark (k, R, yk, ((void *)0), L, ((void *)0), ((void *)0), Common)) ;
}

variable_types:
k
unsigned long

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: struct cholmod_factor_struct { unsigned long n; unsigned long minor; void *Perm; void *ColCount; unsigned long nzmax; void *p; void *i; void *x; void *z; void *nz; void *next; void *prev; unsigned long nsuper; unsigned long ssize; unsigned long xsize; unsigned long maxcsize; unsigned long maxesize; void *super; void *pi; void *px; void *s; int ordering; int is_ll; int is_super; int is_monotonic; int itype; int xtype; int dtype; } *

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:
yk
double [2]


decompiled_code:
__int64 __fastcall cholmod_l_rowdel_solve(__int64 a1, __int64 a2, double *a3, __int64 a4, __int64 a5, __int64 a6, __int64 a7)
{
return cholmod_l_rowdel_mark(a1, a2, a3, 0LL, a4, a5, a6, a7);
}

original_code:
int cholmod_l_rowdel_solve
(
    size_t k,
    cholmod_sparse *R,
    double yk [2],
    cholmod_factor *L,
    cholmod_dense *X,
    cholmod_dense *DeltaB,
    cholmod_common *Common
)
{
    return (cholmod_l_rowdel_mark (k, R, yk, ((void *)0), L, X, DeltaB, Common)) ;
}

canonical_original_code:
int cholmod_l_rowdel_solve(unsigned long k, struct cholmod_sparse_struct *R, double yk[2], struct cholmod_factor_struct *L, struct cholmod_dense_struct *X, struct cholmod_dense_struct *DeltaB, struct cholmod_common_struct *Common)
{
    return (cholmod_l_rowdel_mark (k, R, yk, ((void *)0), L, X, DeltaB, Common)) ;
}

variable_types: struct cholmod_dense_struct { unsigned long nrow; unsigned long ncol; unsigned long nzmax; unsigned long d; void *x; void *z; int xtype; int dtype; } *

variable_types:
DeltaB
struct cholmod_dense_struct *

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

user_defined_types: struct cholmod_factor_struct { unsigned long n; unsigned long minor; void *Perm; void *ColCount; unsigned long nzmax; void *p; void *i; void *x; void *z; void *nz; void *next; void *prev; unsigned long nsuper; unsigned long ssize; unsigned long xsize; unsigned long maxcsize; unsigned long maxesize; void *super; void *pi; void *px; void *s; int ordering; int is_ll; int is_super; int is_monotonic; int itype; int xtype; int dtype; }

user_defined_types: 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]; }


original_code:
long umfzl_build_tuples
(
    NumericType *Numeric,
    WorkType *Work
)
{
    long e, nrows, ncols, nel, *Rows, *Cols, row, col, n_row, n_col, *E,
 *Row_tuples, *Row_degree, *Row_tlen,
 *Col_tuples, *Col_degree, *Col_tlen, n1 ;
    Element *ep ;
    Unit *p ;
    Tuple tuple, *tp ;
    E = Work->E ;
    Col_degree = Numeric->Cperm ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Row_tlen = Numeric->Uilen ;
    Col_tuples = Numeric->Lip ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    nel = Work->nel ;
    n1 = Work->n1 ;
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     Row_tuples [row] = umfzl_mem_alloc_tail_block (Numeric,
  (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     if (!Row_tuples [row])
     {
  ;
  return ((0)) ;
     }
     Row_tlen [row] = 0 ;
 }
    }
    for (col = n_col-1 ; col >= n1 ; col--)
    {
 if ((Col_degree [col] >= 0))
 {
     Col_tuples [col] = umfzl_mem_alloc_tail_block (Numeric,
  (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     if (!Col_tuples [col])
     {
  ;
  return ((0)) ;
     }
     Col_tlen [col] = 0 ;
 }
    }
    for (e = 1 ; e <= nel ; e++)
    {
 ;
 ;
 p = Numeric->Memory + E [e] ;
 { { ; ; ; ep = (Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (long *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
 nrows = ep->nrows ;
 ;
 ;
 ;
 tuple.e = e ;
 for (tuple.f = 0 ; tuple.f < ncols ; tuple.f++)
 {
     col = Cols [tuple.f] ;
     ;
     ;
     ;
     tp = ((Tuple *) (Numeric->Memory + Col_tuples [col]))
  + Col_tlen [col]++ ;
     *tp = tuple ;
 }
 for (tuple.f = 0 ; tuple.f < nrows ; tuple.f++)
 {
     row = Rows [tuple.f] ;
     ;
     ;
     ;
     tp = ((Tuple *) (Numeric->Memory + Row_tuples [row]))
  + Row_tlen [row]++ ;
     *tp = tuple ;
 }
    }
    ;
    return ((1)) ;
}

canonical_original_code:
long umfzl_build_tuples(struct NumericType *Numeric, struct WorkType *Work)
{
    long e; long nrows; long ncols; long nel; long *Rows; long *Cols; long row; long col; long n_row; long n_col; long *E; long *Row_tuples; long *Row_degree; long *Row_tlen; long *Col_tuples; long *Col_degree; long *Col_tlen; long n1;
    struct Element *ep;
    union Unit_union *p;
    struct Tuple tuple; struct Tuple *tp;
    E = Work->E ;
    Col_degree = Numeric->Cperm ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Row_tlen = Numeric->Uilen ;
    Col_tuples = Numeric->Lip ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    nel = Work->nel ;
    n1 = Work->n1 ;
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     Row_tuples [row] = umfzl_mem_alloc_tail_block (Numeric,
  (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     if (!Row_tuples [row])
     {
  ;
  return ((0)) ;
     }
     Row_tlen [row] = 0 ;
 }
    }
    for (col = n_col-1 ; col >= n1 ; col--)
    {
 if ((Col_degree [col] >= 0))
 {
     Col_tuples [col] = umfzl_mem_alloc_tail_block (Numeric,
  (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     if (!Col_tuples [col])
     {
  ;
  return ((0)) ;
     }
     Col_tlen [col] = 0 ;
 }
    }
    for (e = 1 ; e <= nel ; e++)
    {
 ;
 ;
 p = Numeric->Memory + E [e] ;
 { { ; ; ; ep = (struct Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (long *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
 nrows = ep->nrows ;
 ;
 ;
 ;
 tuple.e = e ;
 for (tuple.f = 0 ; tuple.f < ncols ; tuple.f++)
 {
     col = Cols [tuple.f] ;
     ;
     ;
     ;
     tp = ((struct Tuple *) (Numeric->Memory + Col_tuples [col]))
  + Col_tlen [col]++ ;
     *tp = tuple ;
 }
 for (tuple.f = 0 ; tuple.f < nrows ; tuple.f++)
 {
     row = Rows [tuple.f] ;
     ;
     ;
     ;
     tp = ((struct Tuple *) (Numeric->Memory + Row_tuples [row]))
  + Row_tlen [row]++ ;
     *tp = tuple ;
 }
    }
    ;
    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; struct DoubleComplex { double component[2]; } *D; long do_recip; double *Rs; long n_row; long tail_usage; long maxnrows; } *

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

variable_types: e long

variable_types: nrows long

variable_types: ncols long

variable_types: nel long

variable_types:
Rows
long *

variable_types:
Cols
long *

variable_types: row long

variable_types: col long

variable_types:
E
long *

variable_types:
ep
struct Element { long cdeg; } *

variable_types:
tuple
struct Tuple { long e; }

variable_types:
tp
struct Tuple { long e; } *

return_type: long

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


original_code:
double
umfzi_uhsolve
(
    NumericType *Numeric,
    DoubleComplex X [ ],
    int Pattern [ ]
)
{
    DoubleComplex xk ;
    DoubleComplex *xp, *D, *Uval ;
    int k, deg, j, *ip, col, *Upos, *Uilen, kstart, kend, up,
 *Uip, n, uhead, ulen, pos, npiv, n1, *Ui ;
    if (Numeric->n_row != Numeric->n_col) return (0.) ;
    n = Numeric->n_row ;
    npiv = Numeric->npiv ;
    Upos = Numeric->Upos ;
    Uilen = Numeric->Uilen ;
    Uip = Numeric->Uip ;
    D = Numeric->D ;
    kend = 0 ;
    n1 = Numeric->n1 ;
    for (k = 0 ; k < n1 ; k++)
    {
 ;
 { (void) umfpack_divcomplex ((X [k]).component [0], (X [k]).component [1], (D [k]).component [0], (-(D [k]).component [1]), &((xk).component [0]), &((xk).component [1])) ; } ;
 X [k] = xk ;
 deg = Uilen [k] ;
 if (deg > 0 && ((((xk).component [0]) != 0.) || (((xk).component [1]) != 0.)))
 {
     up = Uip [k] ;
     Ui = (int *) (Numeric->Memory + up) ;
     up += (((((sizeof (int) * (deg))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Uval = (DoubleComplex *) (Numeric->Memory + up) ;
     for (j = 0 ; j < deg ; j++)
     {
  ;
  ;
  ;
  { ; (X [Ui [j]]).component [0] -= (xk).component [0] * (Uval [j]).component [0] + (xk).component [1] * (Uval [j]).component [1] ; (X [Ui [j]]).component [1] -= (xk).component [1] * (Uval [j]).component [0] - (xk).component [0] * (Uval [j]).component [1] ; } ;
     }
 }
    }
    for (kstart = n1 ; kstart < npiv ; kstart = kend + 1)
    {
 ;
 kend = kstart ;
 while (kend < npiv && Uip [kend+1] > 0)
 {
     kend++ ;
 }
 k = kend+1 ;
 ;
 if (k == npiv)
 {
     deg = Numeric->ulen ;
     if (deg > 0)
     {
  for (j = 0 ; j < deg ; j++)
  {
      Pattern [j] = Numeric->Upattern [j] ;
  }
     }
 }
 else
 {
     ;
     up = -Uip [k] ;
     ;
     deg = Uilen [k] ;
     ;
     ip = (int *) (Numeric->Memory + up) ;
     for (j = 0 ; j < deg ; j++)
     {
  col = *ip++ ;
  ;
  ;
  Pattern [j] = col ;
     }
 }
 uhead = n ;
 for (k = kend ; k > kstart ; k--)
 {
     ;
     ulen = Uilen [k] ;
     for (j = 0 ; j < ulen ; j++)
     {
  ;
  Pattern [--uhead] = Pattern [--deg] ;
     }
     ;
     ;
     pos = Upos [k] ;
     if (pos != (-1))
     {
  ;
  ;
  Pattern [deg++] = Pattern [pos] ;
  Pattern [pos] = k ;
     }
 }
 ;
 for (k = kstart ; k <= kend ; k++)
 {
     ;
     pos = Upos [k] ;
     if (pos != (-1))
     {
  ;
  ;
  ;
  ;
  Pattern [pos] = Pattern [--deg] ;
     }
     up = Uip [k] ;
     ulen = Uilen [k] ;
     if (k > kstart)
     {
  for (j = 0 ; j < ulen ; j++)
  {
      ;
      Pattern [deg++] = Pattern [uhead++] ;
  }
  ;
  ;
     }
     { (void) umfpack_divcomplex ((X [k]).component [0], (X [k]).component [1], (D [k]).component [0], (-(D [k]).component [1]), &((xk).component [0]), &((xk).component [1])) ; } ;
     X [k] = xk ;
     if (((((xk).component [0]) != 0.) || (((xk).component [1]) != 0.)))
     {
  if (k == kstart)
  {
      up = -up ;
      xp = (DoubleComplex *) (Numeric->Memory + up + (((((sizeof (int) * (ulen))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
  }
  else
  {
      xp = (DoubleComplex *) (Numeric->Memory + up) ;
  }
  for (j = 0 ; j < deg ; j++)
  {
      ;
      ;
      ;
      { ; (X [Pattern [j]]).component [0] -= (xk).component [0] * (*xp).component [0] + (xk).component [1] * (*xp).component [1] ; (X [Pattern [j]]).component [1] -= (xk).component [1] * (*xp).component [0] - (xk).component [0] * (*xp).component [1] ; } ;
      xp++ ;
  }
     }
 }
 ;
    }
    for (k = npiv ; k < n ; k++)
    {
 ;
 { (void) umfpack_divcomplex ((X [k]).component [0], (X [k]).component [1], (D [k]).component [0], (D [k]).component [1], &((xk).component [0]), &((xk).component [1])) ; } ;
 X [k] = xk ;
    }
    return (9. * ((double) n) + 8. * ((double) Numeric->unz));
}

canonical_original_code:
double umfzi_uhsolve(struct NumericType *Numeric, struct DoubleComplex X[], int Pattern[])
{
    struct DoubleComplex xk;
    struct DoubleComplex *xp; struct DoubleComplex *D; struct DoubleComplex *Uval;
    int k; int deg; int j; int *ip; int col; int *Upos; int *Uilen; int kstart; int kend; int up; int *Uip; int n; int uhead; int ulen; int pos; int npiv; int n1; int *Ui;
    if (Numeric->n_row != Numeric->n_col) return (0.) ;
    n = Numeric->n_row ;
    npiv = Numeric->npiv ;
    Upos = Numeric->Upos ;
    Uilen = Numeric->Uilen ;
    Uip = Numeric->Uip ;
    D = Numeric->D ;
    kend = 0 ;
    n1 = Numeric->n1 ;
    for (k = 0 ; k < n1 ; k++)
    {
 ;
 { (void) umfpack_divcomplex ((X [k]).component [0], (X [k]).component [1], (D [k]).component [0], (-(D [k]).component [1]), &((xk).component [0]), &((xk).component [1])) ; } ;
 X [k] = xk ;
 deg = Uilen [k] ;
 if (deg > 0 && ((((xk).component [0]) != 0.) || (((xk).component [1]) != 0.)))
 {
     up = Uip [k] ;
     Ui = (int *) (Numeric->Memory + up) ;
     up += (((((sizeof (int) * (deg))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Uval = (struct DoubleComplex *) (Numeric->Memory + up) ;
     for (j = 0 ; j < deg ; j++)
     {
  ;
  ;
  ;
  { ; (X [Ui [j]]).component [0] -= (xk).component [0] * (Uval [j]).component [0] + (xk).component [1] * (Uval [j]).component [1] ; (X [Ui [j]]).component [1] -= (xk).component [1] * (Uval [j]).component [0] - (xk).component [0] * (Uval [j]).component [1] ; } ;
     }
 }
    }
    for (kstart = n1 ; kstart < npiv ; kstart = kend + 1)
    {
 ;
 kend = kstart ;
 while (kend < npiv && Uip [kend+1] > 0)
 {
     kend++ ;
 }
 k = kend+1 ;
 ;
 if (k == npiv)
 {
     deg = Numeric->ulen ;
     if (deg > 0)
     {
  for (j = 0 ; j < deg ; j++)
  {
      Pattern [j] = Numeric->Upattern [j] ;
  }
     }
 }
 else
 {
     ;
     up = -Uip [k] ;
     ;
     deg = Uilen [k] ;
     ;
     ip = (int *) (Numeric->Memory + up) ;
     for (j = 0 ; j < deg ; j++)
     {
  col = *ip++ ;
  ;
  ;
  Pattern [j] = col ;
     }
 }
 uhead = n ;
 for (k = kend ; k > kstart ; k--)
 {
     ;
     ulen = Uilen [k] ;
     for (j = 0 ; j < ulen ; j++)
     {
  ;
  Pattern [--uhead] = Pattern [--deg] ;
     }
     ;
     ;
     pos = Upos [k] ;
     if (pos != (-1))
     {
  ;
  ;
  Pattern [deg++] = Pattern [pos] ;
  Pattern [pos] = k ;
     }
 }
 ;
 for (k = kstart ; k <= kend ; k++)
 {
     ;
     pos = Upos [k] ;
     if (pos != (-1))
     {
  ;
  ;
  ;
  ;
  Pattern [pos] = Pattern [--deg] ;
     }
     up = Uip [k] ;
     ulen = Uilen [k] ;
     if (k > kstart)
     {
  for (j = 0 ; j < ulen ; j++)
  {
      ;
      Pattern [deg++] = Pattern [uhead++] ;
  }
  ;
  ;
     }
     { (void) umfpack_divcomplex ((X [k]).component [0], (X [k]).component [1], (D [k]).component [0], (-(D [k]).component [1]), &((xk).component [0]), &((xk).component [1])) ; } ;
     X [k] = xk ;
     if (((((xk).component [0]) != 0.) || (((xk).component [1]) != 0.)))
     {
  if (k == kstart)
  {
      up = -up ;
      xp = (struct DoubleComplex *) (Numeric->Memory + up + (((((sizeof (int) * (ulen))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
  }
  else
  {
      xp = (struct DoubleComplex *) (Numeric->Memory + up) ;
  }
  for (j = 0 ; j < deg ; j++)
  {
      ;
      ;
      ;
      { ; (X [Pattern [j]]).component [0] -= (xk).component [0] * (*xp).component [0] + (xk).component [1] * (*xp).component [1] ; (X [Pattern [j]]).component [1] -= (xk).component [1] * (*xp).component [0] - (xk).component [0] * (*xp).component [1] ; } ;
      xp++ ;
  }
     }
 }
 ;
    }
    for (k = npiv ; k < n ; k++)
    {
 ;
 { (void) umfpack_divcomplex ((X [k]).component [0], (X [k]).component [1], (D [k]).component [0], (D [k]).component [1], &((xk).component [0]), &((xk).component [1])) ; } ;
 X [k] = xk ;
    }
    return (9. * ((double) n) + 8. * ((double) Numeric->unz));
}

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

variable_types:
X
struct DoubleComplex []

variable_types:
Pattern
int []

variable_types: k int

variable_types: deg int

variable_types: j int

variable_types:
ip
int *

variable_types: col int

variable_types:
Upos
int *

variable_types:
Uilen
int *

variable_types: kstart int

variable_types: kend int

variable_types: up int

variable_types:
Uip
int *

variable_types: n int

variable_types: uhead int

variable_types: ulen int

variable_types: pos int

variable_types: npiv int

variable_types:
Ui
int *

return_type: double

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


original_code:
double cholmod_rcond
(
    cholmod_factor *L,
    cholmod_common *Common
)
{
    double lmin, lmax, rcond ;
    double *Lx ;
    int *Lpi, *Lpx, *Super, *Lp ;
    int n, e, nsuper, s, k1, k2, psi, psend, psx, nsrow, nscol, jj, j ;
    { if (Common == ((void *)0)) { return ((-1)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return ((-1)) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rcond.c", 85, "argument missing", Common) ; } return ((-1)) ; } } ;
    { if ((L)->xtype < (1) || (L)->xtype > (3) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rcond.c", 86, "invalid xtype", Common) ; } return ((-1)) ; } } ;
    Common->status = 0 ;
    n = L->n ;
    if (n == 0)
    {
 return (1) ;
    }
    if (L->minor < L->n)
    {
 return (0) ;
    }
    e = (L->xtype == 2) ? 2 : 1 ;
    if (L->is_super)
    {
 nsuper = L->nsuper ;
 Lpi = L->pi ;
 Lpx = L->px ;
 Super = L->super ;
 Lx = L->x ;
 { double ljj = Lx [0] ; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
 for (s = 0 ; s < nsuper ; s++)
 {
     k1 = Super [s] ;
     k2 = Super [s+1] ;
     psi = Lpi [s] ;
     psend = Lpi [s+1] ;
     psx = Lpx [s] ;
     nsrow = psend - psi ;
     nscol = k2 - k1 ;
     for (jj = 0 ; jj < nscol ; jj++)
     {
  { double ljj = Lx [e * (psx + jj + jj*nsrow)] ; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    else
    {
 Lp = L->p ;
 Lx = L->x ;
 if (L->is_ll)
 {
     { double ljj = Lx [Lp [0]] ; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = Lx [e * Lp [j]] ; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
 else
 {
     { double ljj = fabs (Lx [Lp [0]]) ; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = fabs (Lx [e * Lp [j]]) ; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    rcond = lmin / lmax ;
    if (L->is_ll)
    {
 rcond = rcond*rcond ;
    }
    return (rcond) ;
}

canonical_original_code:
double cholmod_rcond(struct cholmod_factor_struct *L, struct cholmod_common_struct *Common)
{
    double lmin; double lmax; double rcond;
    double *Lx;
    int *Lpi; int *Lpx; int *Super; int *Lp;
    int n; int e; int nsuper; int s; int k1; int k2; int psi; int psend; int psx; int nsrow; int nscol; int jj; int j;
    { if (Common == ((void *)0)) { return ((-1)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return ((-1)) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rcond.c", 85, "argument missing", Common) ; } return ((-1)) ; } } ;
    { if ((L)->xtype < (1) || (L)->xtype > (3) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rcond.c", 86, "invalid xtype", Common) ; } return ((-1)) ; } } ;
    Common->status = 0 ;
    n = L->n ;
    if (n == 0)
    {
 return (1) ;
    }
    if (L->minor < L->n)
    {
 return (0) ;
    }
    e = (L->xtype == 2) ? 2 : 1 ;
    if (L->is_super)
    {
 nsuper = L->nsuper ;
 Lpi = L->pi ;
 Lpx = L->px ;
 Super = L->super ;
 Lx = L->x ;
 { double ljj = Lx [0]; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
 for (s = 0 ; s < nsuper ; s++)
 {
     k1 = Super [s] ;
     k2 = Super [s+1] ;
     psi = Lpi [s] ;
     psend = Lpi [s+1] ;
     psx = Lpx [s] ;
     nsrow = psend - psi ;
     nscol = k2 - k1 ;
     for (jj = 0 ; jj < nscol ; jj++)
     {
  { double ljj = Lx [e * (psx + jj + jj*nsrow)]; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    else
    {
 Lp = L->p ;
 Lx = L->x ;
 if (L->is_ll)
 {
     { double ljj = Lx [Lp [0]]; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = Lx [e * Lp [j]]; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
 else
 {
     { double ljj = fabs (Lx [Lp [0]]); if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = fabs (Lx [e * Lp [j]]); if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    rcond = lmin / lmax ;
    if (L->is_ll)
    {
 rcond = rcond*rcond ;
    }
    return (rcond) ;
}

variable_types: struct cholmod_factor_struct { unsigned long n; unsigned long minor; void *Perm; void *ColCount; unsigned long nzmax; void *p; void *i; void *x; void *z; void *nz; void *next; void *prev; unsigned long nsuper; unsigned long ssize; unsigned long xsize; unsigned long maxcsize; unsigned long maxesize; void *super; void *pi; void *px; void *s; int ordering; int is_ll; int is_super; int is_monotonic; int itype; int xtype; int dtype; } *

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

variable_types: lmax double

variable_types: rcond double

variable_types:
Lx
double *

variable_types:
Lpi
int *

variable_types:
Lpx
int *

variable_types:
Super
int *

variable_types:
Lp
int *

variable_types: e int

variable_types: nsuper int

variable_types: s int

variable_types: psi int

variable_types: psend int

variable_types: psx int

variable_types: nsrow int

variable_types: nscol int

variable_types: jj int

variable_types: ljj double


original_code:
void umf_i_fsize
(
    int nn,
    int Fsize [ ],
    int Fnrows [ ],
    int Fncols [ ],
    int Parent [ ],
    int Npiv [ ]
)
{
    int j, parent, frsize, r, c ;
    for (j = 0 ; j < nn ; j++)
    {
 Fsize [j] = (-1) ;
    }
    ;
    for (j = 0 ; j < nn ; j++)
    {
 if (Npiv [j] > 0)
 {
     parent = Parent [j] ;
     r = Fnrows [j] ;
     c = Fncols [j] ;
     frsize = r * c ;
     if (((!((((double) r) * ((double) c)) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((((double) r) * ((double) c)) != (((double) r) * ((double) c)))))
     {
  frsize = 0x7fffffff ;
     }
     ;
     Fsize [j] = (((Fsize [j]) > (frsize)) ? (Fsize [j]) : (frsize)) ;
     ;
     if (parent != (-1))
     {
  ;
  ;
  Fsize [parent] = (((Fsize [parent]) > (Fsize [j])) ? (Fsize [parent]) : (Fsize [j])) ;
  ;
     }
 }
    }
}

canonical_original_code:
void umf_i_fsize(int nn, int Fsize[], int Fnrows[], int Fncols[], int Parent[], int Npiv[])
{
    int j; int parent; int frsize; int r; int c;
    for (j = 0 ; j < nn ; j++)
    {
 Fsize [j] = (-1) ;
    }
    ;
    for (j = 0 ; j < nn ; j++)
    {
 if (Npiv [j] > 0)
 {
     parent = Parent [j] ;
     r = Fnrows [j] ;
     c = Fncols [j] ;
     frsize = r * c ;
     if (((!((((double) r) * ((double) c)) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((((double) r) * ((double) c)) != (((double) r) * ((double) c)))))
     {
  frsize = 0x7fffffff ;
     }
     ;
     Fsize [j] = (((Fsize [j]) > (frsize)) ? (Fsize [j]) : (frsize)) ;
     ;
     if (parent != (-1))
     {
  ;
  ;
  Fsize [parent] = (((Fsize [parent]) > (Fsize [j])) ? (Fsize [parent]) : (Fsize [j])) ;
  ;
     }
 }
    }
}

variable_types: nn int

variable_types:
Fsize
int []

variable_types:
Fnrows
int []

variable_types:
Fncols
int []

variable_types:
Parent
int []

variable_types:
Npiv
int []

variable_types: j int

variable_types: parent int

variable_types: frsize int

variable_types: r int

variable_types: c int

return_type: void


original_code:
int umf_i_analyze
(
    int n_row,
    int n_col,
    int Ai [ ],
    int Ap [ ],
    int Up [ ],
    int fixQ,
    int W [ ],
    int Link [ ],
    int Front_ncols [ ],
    int Front_nrows [ ],
    int Front_npivcol [ ],
    int Front_parent [ ],
    int *nfr_out,
    int *p_ncompactions
)
{
    int j, j3, col, k, row, parent, j2, pdest, p, p2, thickness, npivots, nfr,
 i, *Winv, kk, npiv, jnext, krow, knext, pfirst, jlast, ncompactions,
 *Front_stack, *Front_order, *Front_child, *Front_sibling,
 Wflag, npivcol, fallrows, fallcols, fpiv, frows, fcols, *Front_size ;
    nfr = 0 ;
    ;
#pragma ivdep
    for (j = 0 ; j < n_col ; j++)
    {
 Link [j] = (-1) ;
 W [j] = (-1) ;
 Up [j] = (-1) ;
 Front_npivcol [j] = 0 ;
 Front_nrows [j] = 0 ;
 Front_ncols [j] = 0 ;
 Front_parent [j] = (-1) ;
    }
    krow = 0 ;
    pfirst = Ap [0] ;
    jlast = (-1) ;
    jnext = (-1) ;
    Wflag = 0 ;
    ;
    pdest = 0 ;
    ncompactions = 0 ;
    for (j = 0 ; j < n_col ; j = jnext)
    {
 ;
 if (pdest + (n_col-j) > pfirst)
 {
     pdest = 0 ;
     ncompactions++ ;
     for (row = 0 ; row < j ; row++)
     {
  if (Up [row] != (-1))
  {
      ;
      ;
      p = Up [row] ;
      ;
      p2 = p + (Front_ncols [row] - Front_npivcol [row]) ;
      Up [row] = pdest ;
      for ( ; p < p2 ; p++)
      {
   ;
   ;
   ;
   Ai [pdest++] = Ai [p] ;
   ;
      }
      ;
  }
     }
 }
 if (pdest + (n_col-j) > pfirst)
 {
     return ((0)) ;
 }
 if (jlast != (-1) && Link [j] == jlast)
 {
     ;
     ;
     Up [j] = Up [jlast] ;
     Up [jlast] = (-1) ;
     parent = n_col ;
     for (p = Up [j] ; p < pdest ; )
     {
  j3 = Ai [p] ;
  ;
  ;
  ;
  ;
  if (j == j3)
  {
      ;
      Ai [p] = Ai [--pdest] ;
  }
  else
  {
      if (j3 < parent)
      {
   parent = j3 ;
      }
      p++ ;
  }
     }
     Link [j] = Link [jlast] ;
     ;
     thickness = (Front_nrows [jlast] - Front_npivcol [jlast]) ;
     ;
 }
 else
 {
     Up [j] = pdest ;
     parent = n_col ;
     thickness = 0 ;
     Wflag = j ;
 }
 ;
 W [j] = Wflag ;
 ;
 ;
 jnext = n_col ;
 for (knext = krow ; knext < n_row ; knext++)
 {
     ;
     ;
     jnext = Ai [Ap [knext]] ;
     ;
     if (jnext != j)
     {
  break ;
     }
 }
 if (knext == n_row)
 {
     jnext = n_col ;
 }
 ;
 ;
 for (k = krow ; k < knext ; k++)
 {
     p = Ap [k] ;
     p2 = Ap [k+1] ;
     ;
     ;
     ;
     ;
     ;
     ;
     ;
     for ( ; p < p2 ; p++)
     {
  col = Ai [p] ;
  ;
  ;
  if (W [col] != Wflag)
  {
      Ai [pdest++] = col ;
      ;
      W [col] = Wflag ;
      if (col < parent)
      {
   parent = col ;
      }
  }
     }
     ;
     thickness++ ;
 }
 krow = knext ;
 pfirst = Ap [knext] ;
 for (k = Link [j] ; k != (-1) ; k = Link [k])
 {
     ;
     ;
     ;
     p = Up [k] ;
     ;
     p2 = p + (Front_ncols [k] - Front_npivcol [k]) ;
     ;
     ;
     ;
     for ( ; p < p2 ; p++)
     {
  col = Ai [p] ;
  ;
  ;
  if (W [col] != Wflag)
  {
      Ai [pdest++] = col ;
      ;
      W [col] = Wflag ;
      if (col < parent)
      {
   parent = col ;
      }
  }
     }
     ;
     Up [k] = (-1) ;
     ;
     thickness += (Front_nrows [k] - Front_npivcol [k]) ;
     ;
 }
 for (j2 = j+1 ; j2 < jnext ; j2++)
 {
     ;
     if (W [j2] != Wflag || Link [j2] != (-1))
     {
  break ;
     }
 }
 ;
 ;
 jnext = j2 ;
 j2-- ;
 ;
 ;
 npivots = j2-j+1 ;
 ;
 if (j2 > j)
 {
     ;
     ;
     ;
     parent = n_col ;
     p2 = pdest ;
     pdest = Up [j] ;
     for (p = Up [j] ; p < p2 ; p++)
     {
  col = Ai [p] ;
  ;
  ;
  if (col > j2)
  {
      Ai [pdest++] = col ;
      if (col < parent)
      {
   parent = col ;
      }
  }
     }
 }
 ;
 ;
 if (parent == n_col)
 {
     parent = (-1) ;
 }
 npivcol = npivots ;
 fallrows = thickness ;
 fallcols = npivots + pdest - Up [j] ;
 fpiv = (((npivcol) < (fallrows)) ? (npivcol) : (fallrows)) ;
 frows = fallrows - fpiv ;
 fcols = fallcols - fpiv ;
 if (frows == 0 || fcols == 0)
 {
     ;
     Up [j] = (-1) ;
     parent = (-1) ;
 }
 Front_npivcol [j] = npivots ;
 Front_nrows [j] = fallrows ;
 Front_ncols [j] = fallcols ;
 Front_parent [j] = parent ;
 ;
 ;
 nfr++ ;
 if (parent != (-1))
 {
     Link [j] = Link [parent] ;
     Link [parent] = j ;
 }
 ;
 jlast = j ;
    }
    *nfr_out = nfr ;
    Front_order = W ;
    if (fixQ)
    {
 ;
 k = 0 ;
#pragma novector
 for (j = 0 ; j < n_col ; j++)
 {
     if (Front_npivcol [j] > 0)
     {
  Front_order [j] = k++ ;
  ;
     }
     else
     {
  Front_order [j] = (-1) ;
     }
 }
    }
    else
    {
 Front_child = Ap ;
 Front_sibling = Link ;
 Front_stack = Ai ;
 Front_size = Front_stack + n_col ;
 umf_i_fsize (n_col, Front_size, Front_nrows, Front_ncols,
     Front_parent, Front_npivcol) ;
 amd_postorder (n_col, Front_parent, Front_npivcol, Front_size,
     Front_order, Front_child, Front_sibling, Front_stack) ;
 Winv = Ai ;
 for (k = 0 ; k < nfr ; k++)
 {
     Winv [k] = (-1) ;
 }
 ;
 for (i = 0 ; i < n_col ; i++)
 {
     k = Front_order [i] ;
     if (k != (-1))
     {
  ;
  ;
  ;
  Winv [k] = i ;
     }
 }
 kk = 0 ;
 for (k = 0 ; k < nfr ; k++)
 {
     i = Winv [k] ;
     ;
     ;
     ;
     for (npiv = 0 ; npiv < Front_npivcol [i] ; npiv++)
     {
  Up [kk] = i + npiv ;
  ;
  kk++ ;
     }
 }
 ;
    }
    umf_i_apply_order (Front_npivcol, Front_order, Ai, n_col, nfr) ;
    umf_i_apply_order (Front_nrows, Front_order, Ai, n_col, nfr) ;
    umf_i_apply_order (Front_ncols, Front_order, Ai, n_col, nfr) ;
    umf_i_apply_order (Front_parent, Front_order, Ai, n_col, nfr) ;
    for (i = 0 ; i < nfr ; i++)
    {
 parent = Front_parent [i] ;
 if (parent != (-1))
 {
     ;
     ;
     Front_parent [i] = Front_order [parent] ;
 }
    }
    *p_ncompactions = ncompactions ;
    return ((1)) ;
}

canonical_original_code:
int umf_i_analyze(int n_row, int n_col, int Ai[], int Ap[], int Up[], int fixQ, int W[], int Link[], int Front_ncols[], int Front_nrows[], int Front_npivcol[], int Front_parent[], int *nfr_out, int *p_ncompactions)
{
    int j; int j3; int col; int k; int row; int parent; int j2; int pdest; int p; int p2; int thickness; int npivots; int nfr; int i; int *Winv; int kk; int npiv; int jnext; int krow; int knext; int pfirst; int jlast; int ncompactions; int *Front_stack; int *Front_order; int *Front_child; int *Front_sibling; int Wflag; int npivcol; int fallrows; int fallcols; int fpiv; int frows; int fcols; int *Front_size;
    nfr = 0 ;
    ;
#pragma ivdep
    for (j = 0 ; j < n_col ; j++)
    {
 Link [j] = (-1) ;
 W [j] = (-1) ;
 Up [j] = (-1) ;
 Front_npivcol [j] = 0 ;
 Front_nrows [j] = 0 ;
 Front_ncols [j] = 0 ;
 Front_parent [j] = (-1) ;
    }
    krow = 0 ;
    pfirst = Ap [0] ;
    jlast = (-1) ;
    jnext = (-1) ;
    Wflag = 0 ;
    ;
    pdest = 0 ;
    ncompactions = 0 ;
    for (j = 0 ; j < n_col ; j = jnext)
    {
 ;
 if (pdest + (n_col-j) > pfirst)
 {
     pdest = 0 ;
     ncompactions++ ;
     for (row = 0 ; row < j ; row++)
     {
  if (Up [row] != (-1))
  {
      ;
      ;
      p = Up [row] ;
      ;
      p2 = p + (Front_ncols [row] - Front_npivcol [row]) ;
      Up [row] = pdest ;
      for ( ; p < p2 ; p++)
      {
   ;
   ;
   ;
   Ai [pdest++] = Ai [p] ;
   ;
      }
      ;
  }
     }
 }
 if (pdest + (n_col-j) > pfirst)
 {
     return ((0)) ;
 }
 if (jlast != (-1) && Link [j] == jlast)
 {
     ;
     ;
     Up [j] = Up [jlast] ;
     Up [jlast] = (-1) ;
     parent = n_col ;
     for (p = Up [j] ; p < pdest ; )
     {
  j3 = Ai [p] ;
  ;
  ;
  ;
  ;
  if (j == j3)
  {
      ;
      Ai [p] = Ai [--pdest] ;
  }
  else
  {
      if (j3 < parent)
      {
   parent = j3 ;
      }
      p++ ;
  }
     }
     Link [j] = Link [jlast] ;
     ;
     thickness = (Front_nrows [jlast] - Front_npivcol [jlast]) ;
     ;
 }
 else
 {
     Up [j] = pdest ;
     parent = n_col ;
     thickness = 0 ;
     Wflag = j ;
 }
 ;
 W [j] = Wflag ;
 ;
 ;
 jnext = n_col ;
 for (knext = krow ; knext < n_row ; knext++)
 {
     ;
     ;
     jnext = Ai [Ap [knext]] ;
     ;
     if (jnext != j)
     {
  break ;
     }
 }
 if (knext == n_row)
 {
     jnext = n_col ;
 }
 ;
 ;
 for (k = krow ; k < knext ; k++)
 {
     p = Ap [k] ;
     p2 = Ap [k+1] ;
     ;
     ;
     ;
     ;
     ;
     ;
     ;
     for ( ; p < p2 ; p++)
     {
  col = Ai [p] ;
  ;
  ;
  if (W [col] != Wflag)
  {
      Ai [pdest++] = col ;
      ;
      W [col] = Wflag ;
      if (col < parent)
      {
   parent = col ;
      }
  }
     }
     ;
     thickness++ ;
 }
 krow = knext ;
 pfirst = Ap [knext] ;
 for (k = Link [j] ; k != (-1) ; k = Link [k])
 {
     ;
     ;
     ;
     p = Up [k] ;
     ;
     p2 = p + (Front_ncols [k] - Front_npivcol [k]) ;
     ;
     ;
     ;
     for ( ; p < p2 ; p++)
     {
  col = Ai [p] ;
  ;
  ;
  if (W [col] != Wflag)
  {
      Ai [pdest++] = col ;
      ;
      W [col] = Wflag ;
      if (col < parent)
      {
   parent = col ;
      }
  }
     }
     ;
     Up [k] = (-1) ;
     ;
     thickness += (Front_nrows [k] - Front_npivcol [k]) ;
     ;
 }
 for (j2 = j+1 ; j2 < jnext ; j2++)
 {
     ;
     if (W [j2] != Wflag || Link [j2] != (-1))
     {
  break ;
     }
 }
 ;
 ;
 jnext = j2 ;
 j2-- ;
 ;
 ;
 npivots = j2-j+1 ;
 ;
 if (j2 > j)
 {
     ;
     ;
     ;
     parent = n_col ;
     p2 = pdest ;
     pdest = Up [j] ;
     for (p = Up [j] ; p < p2 ; p++)
     {
  col = Ai [p] ;
  ;
  ;
  if (col > j2)
  {
      Ai [pdest++] = col ;
      if (col < parent)
      {
   parent = col ;
      }
  }
     }
 }
 ;
 ;
 if (parent == n_col)
 {
     parent = (-1) ;
 }
 npivcol = npivots ;
 fallrows = thickness ;
 fallcols = npivots + pdest - Up [j] ;
 fpiv = (((npivcol) < (fallrows)) ? (npivcol) : (fallrows)) ;
 frows = fallrows - fpiv ;
 fcols = fallcols - fpiv ;
 if (frows == 0 || fcols == 0)
 {
     ;
     Up [j] = (-1) ;
     parent = (-1) ;
 }
 Front_npivcol [j] = npivots ;
 Front_nrows [j] = fallrows ;
 Front_ncols [j] = fallcols ;
 Front_parent [j] = parent ;
 ;
 ;
 nfr++ ;
 if (parent != (-1))
 {
     Link [j] = Link [parent] ;
     Link [parent] = j ;
 }
 ;
 jlast = j ;
    }
    *nfr_out = nfr ;
    Front_order = W ;
    if (fixQ)
    {
 ;
 k = 0 ;
#pragma novector
 for (j = 0 ; j < n_col ; j++)
 {
     if (Front_npivcol [j] > 0)
     {
  Front_order [j] = k++ ;
  ;
     }
     else
     {
  Front_order [j] = (-1) ;
     }
 }
    }
    else
    {
 Front_child = Ap ;
 Front_sibling = Link ;
 Front_stack = Ai ;
 Front_size = Front_stack + n_col ;
 umf_i_fsize (n_col, Front_size, Front_nrows, Front_ncols,
     Front_parent, Front_npivcol) ;
 amd_postorder (n_col, Front_parent, Front_npivcol, Front_size,
     Front_order, Front_child, Front_sibling, Front_stack) ;
 Winv = Ai ;
 for (k = 0 ; k < nfr ; k++)
 {
     Winv [k] = (-1) ;
 }
 ;
 for (i = 0 ; i < n_col ; i++)
 {
     k = Front_order [i] ;
     if (k != (-1))
     {
  ;
  ;
  ;
  Winv [k] = i ;
     }
 }
 kk = 0 ;
 for (k = 0 ; k < nfr ; k++)
 {
     i = Winv [k] ;
     ;
     ;
     ;
     for (npiv = 0 ; npiv < Front_npivcol [i] ; npiv++)
     {
  Up [kk] = i + npiv ;
  ;
  kk++ ;
     }
 }
 ;
    }
    umf_i_apply_order (Front_npivcol, Front_order, Ai, n_col, nfr) ;
    umf_i_apply_order (Front_nrows, Front_order, Ai, n_col, nfr) ;
    umf_i_apply_order (Front_ncols, Front_order, Ai, n_col, nfr) ;
    umf_i_apply_order (Front_parent, Front_order, Ai, n_col, nfr) ;
    for (i = 0 ; i < nfr ; i++)
    {
 parent = Front_parent [i] ;
 if (parent != (-1))
 {
     ;
     ;
     Front_parent [i] = Front_order [parent] ;
 }
    }
    *p_ncompactions = ncompactions ;
    return ((1)) ;
}

variable_types:
Ai
int []

variable_types:
Ap
int []

variable_types:
Up
int []

variable_types: fixQ int

variable_types:
W
int []

variable_types:
Link
int []

variable_types: col int

variable_types: k int

variable_types: row int

variable_types: pdest int

variable_types: p int

variable_types: thickness int

variable_types: npivots int

variable_types: nfr int

variable_types: i int

variable_types:
Winv
int *

variable_types: kk int

variable_types: npiv int

variable_types: jnext int

variable_types: krow int

variable_types: knext int

variable_types: pfirst int

variable_types: jlast int

variable_types: ncompactions int

variable_types: Wflag int

variable_types: npivcol int

variable_types: fallrows int

variable_types: fallcols int

variable_types: fpiv int

variable_types: frows int

variable_types: fcols int


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

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

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

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

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

variable_types: nunits long

variable_types: p long

variable_types: usage long

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


decompiled_code:
__int64 __fastcall umfzi_row_search(__int64 a1, __int64 *a2, __int64 a3, int a4, int a5, int *a6, __int64 a7, int *a8, int *a9, __int64 a10, __int64 a11, _DWORD *a12, double *a13, int a14, _DWORD *a15)
{
__int64 *v17; // rdi
double *v18; // r15
__int64 v19; // rbx
__int64 v20; // r10
__int64 v21; // rdx
int v22; // ebp
int v23; // er14
int v24; // er12
double *v25; // rdx
double v26; // xmm3_8
double v27; // xmm0_8
double v28; // xmm1_8
double v29; // xmm1_8
double v30; // xmm0_8
double v31; // xmm4_8
__int64 v32; // rdx
double *v33; // rdx
double v34; // xmm1_8
double v35; // xmm3_8
double v36; // xmm1_8
double *v37; // rdx
double v38; // xmm6_8
double *v39; // r12
double *v40; // r13
double v41; // xmm0_8
double v42; // xmm1_8
double v43; // xmm0_8
__int64 v44; // r14
int v45; // er13
double v46; // xmm6_8
int *v47; // rdx
double *v48; // rax
unsigned __int64 v49; // rsi
double v50; // xmm0_8
double v51; // xmm1_8
double v52; // xmm0_8
__int64 v53; // r11
int v54; // er9
int v55; // eax
unsigned int v56; // er9
int v57; // eax
__int64 result; // rax
int v59; // eax
__int64 v60; // r12
int v61; // edx
int v62; // ebp
__int64 v63; // rax
__int64 v64; // rdx
int *v65; // rax
int *v66; // rbx
int *v67; // r15
__int64 v68; // r13
__int64 v69; // rax
__int64 v70; // rdx
__int64 v71; // r8
int *v72; // rax
__int64 v73; // r8
int v74; // edx
_DWORD *v75; // rdi
__int64 v76; // rsi
__int64 v77; // r13
int v78; // er8
__int64 v79; // rax
__int64 v80; // rdx
__int64 v81; // rax
int *v82; // rdx
unsigned __int64 v83; // r13
unsigned __int64 v84; // r12
int *v85; // rbp
int *v86; // r11
__int64 v87; // rax
__int64 v88; // rdx
__int64 v89; // rbx
int *v90; // rax
__int64 v91; // r9
int v92; // edx
_DWORD *v93; // rsi
__int64 v94; // rsi
__int64 v95; // rdx
int v96; // esi
__int64 v97; // rax
__int64 v98; // r9
__int64 v99; // rbp
int v100; // er11
int *v101; // r12
int v102; // eax
int *v103; // rdx
int *v104; // rax
int *v105; // rdx
int v106; // eax
int *v107; // r9
__int64 v108; // rdx
int v109; // esi
int v110; // eax
int v111; // edx
int *v112; // rax
__int64 v113; // rdx
int v114; // er9
int v115; // esi
int v116; // edx
__int64 v117; // rax
int *v118; // rax
double v119; // xmm6_8
double v120; // xmm7_8
double v121; // xmm0_8
double v122; // xmm1_8
double v123; // xmm0_8
__int64 v124; // rsi
int v125; // er9
int v126; // er11
int v127; // esi
int v128; // edx
__int64 v129; // [rsp+0h] [rbp-78h]
int v130; // [rsp+8h] [rbp-70h]
int *v131; // [rsp+8h] [rbp-70h]
__int64 v132; // [rsp+10h] [rbp-68h]
int *v133; // [rsp+18h] [rbp-60h]
__int64 *v134; // [rsp+18h] [rbp-60h]
__int64 v135; // [rsp+20h] [rbp-58h]
__int64 v136; // [rsp+28h] [rbp-50h]
__int64 v137; // [rsp+30h] [rbp-48h]
int v138; // [rsp+30h] [rbp-48h]
int v139; // [rsp+3Ch] [rbp-3Ch]

v17 = a2;
v18 = a13;
v19 = *(_QWORD *)(a1 + 120);
v20 = a2[4];
v132 = *(_QWORD *)(a1 + 168);
v133 = a6;
v135 = *(_QWORD *)(a1 + 176);
v137 = a2[170];
v136 = *a2;
v129 = *(_QWORD *)(a1 + 96);
v130 = *((_DWORD *)a2 + 344);
v21 = a2[15];
if ( v21 )
{
v22 = *(_DWORD *)(v21 + 4LL * a14);
if ( v22 >= 0 )
{
v23 = *((_DWORD *)a2 + 350);
v24 = 0;
if ( a5 <= 0 )
{
v29 = *(double *)(a1 + 16);
v26 = 0.0;
v30 = *(double *)(a1 + 8) * 0.0;
goto LABEL_53;
}
LABEL_4:
v25 = a13;
v26 = 0.0;
do
{
v27 = *v25;
if ( *v25 < 0.0 )
*(_QWORD *)&v27 ^= LC1;
v28 = v25[1];
if ( v28 < 0.0 )
*(_QWORD *)&v28 ^= LC1;
v25 += 2;
v26 = fmax(v26, v27 + v28);
}
while ( &a13[2 * (unsigned int)(a5 - 1) + 2] != v25 );
v29 = *(double *)(a1 + 16);
v30 = *(double *)(a1 + 8) * v26;
if ( v24 )
goto LABEL_11;
LABEL_53:
v31 = v30;
v30 = v26 * v29;
goto LABEL_12;
}
v24 = 1;
v22 = -2 - v22;
}
else
{
v22 = -1;
v24 = -1;
}
v23 = *((_DWORD *)a2 + 350);
if ( a5 > 0 )
goto LABEL_4;
v30 = *(double *)(a1 + 8) * 0.0;
LABEL_11:
v31 = v30;
LABEL_12:
if ( *(_DWORD *)(a3 + 248) )
{
v32 = *(int *)(a7 + 4LL * v22);
if ( (int)v32 >= 0 )
{
v33 = &a13[2 * v32];
v34 = *v33;
if ( *v33 < 0.0 )
*(_QWORD *)&v34 ^= LC1;
v35 = v33[1];
if ( v35 < 0.0 )
*(_QWORD *)&v35 ^= LC1;
v36 = v34 + v35;
if ( v36 != 0.0 && v36 >= v30 )
{
v128 = *(_DWORD *)(v137 + 4LL * v22);
if ( v128 < 0 || v128 >= v130 )
{
*a8 = -1;
a8[1] = v22;
if ( a5 > 0 )
{
v57 = v22;
goto LABEL_114;
}
goto LABEL_55;
}
*a8 = v22;
a8[1] = -1;
goto LABEL_54;
}
}
}
if ( a4 <= 0 )
{
if ( a5 > 0 )
{
v118 = a6;
v119 = 0.0;
v120 = 0.0;
do
{
v121 = *v18;
if ( *v18 < 0.0 )
*(_QWORD *)&v121 ^= LC1;
v122 = v18[1];
if ( v122 < 0.0 )
*(_QWORD *)&v122 ^= LC1;
v123 = v121 + v122;
if ( v123 != 0.0 && v123 >= v31 )
{
v124 = *v118;
v125 = *(_DWORD *)(v19 + 4 * v124);
v126 = *v118;
v127 = *(_DWORD *)(v137 + 4 * v124);
if ( v127 < v130 && v127 >= 0 )
{
if ( *a9 > v125 || *a9 == v125 && v123 > v120 )
{
v120 = v123;
*a8 = v126;
*a9 = v125;
}
}
else if ( a9[1] > v125 || a9[1] == v125 && v123 > v119 )
{
v119 = v123;
a8[1] = v126;
a9[1] = v125;
}
}
v18 += 2;
++v118;
}
while ( &a13[2 * (unsigned int)(a5 - 1) + 2] != v18 );
goto LABEL_44;
}
LABEL_55:
if ( a5 )
{
v59 = *a8;
}
else if ( v130 <= 0 )
{
v95 = *((int *)a2 + 195);
v96 = *(_DWORD *)(a1 + 232);
v97 = *(_QWORD *)(a3 + 120);
v98 = v17[99];
v99 = *(int *)(a3 + 204);
v100 = *(_DWORD *)(*(_QWORD *)(a3 + 112) + 4 * v95 + 4);
v101 = (int *)(v98 + 4LL * *(int *)(v97 + 4 * v95));
v102 = *v101;
if ( v100 <= *v101 )
{
v100 = *v101;
}
else
{
v103 = (int *)(v19 + 4LL * v102);
while ( *v103 < 0 )
{
++v102;
++v103;
if ( v100 == v102 )
goto LABEL_104;
}
v100 = v102;
a8[1] = v102;
}
LABEL_104:
v104 = a8;
*v101 = v100;
if ( a8[1] == -1 )
{
v105 = (int *)(v98 + 4 * v99);
v106 = *v105;
if ( v96 <= *v105 )
{
v96 = *v105;
}
else
{
v107 = (int *)(v19 + 4LL * v106);
while ( *v107 < 0 )
{
++v106;
++v107;
if ( v96 == v106 )
goto LABEL_111;
}
v96 = v106;
a8[1] = v106;
}
LABEL_111:
v104 = a8;
*v105 = v96;
v56 = 1;
if ( a8[1] == -1 )
return v56;
}
v59 = *v104;
}
else
{
v59 = *(_DWORD *)a2[168];
*a8 = v59;
}
if ( v59 != -1 )
goto LABEL_59;
LABEL_78:
v56 = 0;
v57 = a8[1];
if ( v57 == -1 )
return v56;
goto LABEL_79;
}
v139 = v23;
v37 = a13;
v38 = 0.0;
v39 = &a13[2 * (unsigned int)(a4 - 1)];
while ( 1 )
{
v41 = *v37;
if ( *v37 < 0.0 )
*(_QWORD *)&v41 ^= LC1;
v42 = v37[1];
if ( v42 < 0.0 )
*(_QWORD *)&v42 ^= LC1;
v43 = v41 + v42;
if ( v43 != 0.0 && v43 >= v31 )
{
v44 = *a6;
v45 = *(_DWORD *)(v19 + 4 * v44);
if ( *a9 > v45 || *a9 == v45 && v43 > v38 )
break;
}
v40 = v37 + 2;
++a6;
if ( v39 == v37 )
goto LABEL_32;
LABEL_23:
v37 = v40;
}
v38 = v43;
++a6;
*a8 = v44;
*a9 = v45;
v40 = v37 + 2;
if ( v39 != v37 )
goto LABEL_23;
LABEL_32:
v23 = v139;
if ( a5 <= a4 )
{
LABEL_54:
if ( a5 > 0 )
goto LABEL_44;
goto LABEL_55;
}
v46 = 0.0;
v47 = &v133[a4];
v48 = &a13[2 * a4];
v49 = (unsigned __int64)&a13[2 * a4 + 2 + 2 * (unsigned __int64)(unsigned int)(a5 + ~a4)];
do
{
while ( 1 )
{
v50 = *v48;
if ( *v48 < 0.0 )
*(_QWORD *)&v50 ^= LC1;
v51 = v48[1];
if ( v51 < 0.0 )
*(_QWORD *)&v51 ^= LC1;
v52 = v50 + v51;
if ( v52 != 0.0 && v52 >= v31 )
{
v53 = *v47;
v54 = *(_DWORD *)(v19 + 4 * v53);
if ( a9[1] > v54 || a9[1] == v54 && v52 > v46 )
break;
}
v48 += 2;
++v47;
if ( (double *)v49 == v48 )
goto LABEL_44;
}
v48 += 2;
v46 = v52;
++v47;
a8[1] = v53;
a9[1] = v54;
}
while ( (double *)v49 != v48 );
LABEL_44:
v55 = *a8;
if ( *a8 == -1 )
{
v57 = a8[1];
LABEL_114:
if ( v57 != -1 )
goto LABEL_79;
v108 = *v133;
v109 = *(_DWORD *)(v19 + 4 * v108);
v110 = *v133;
v111 = *(_DWORD *)(v137 + 4 * v108);
if ( v111 < v130 && v111 >= 0 )
{
*a8 = v110;
*a9 = v109;
}
else
{
a8[1] = v110;
a9[1] = v109;
}
if ( a5 > 1 )
{
v112 = v133 + 1;
do
{
v113 = *v112;
v114 = *(_DWORD *)(v19 + 4 * v113);
v115 = *v112;
v116 = *(_DWORD *)(v137 + 4 * v113);
if ( v116 >= 0 && v116 < v130 )
{
if ( *a9 > v114 || *a9 == v114 && v22 == v115 )
{
*a8 = v115;
*a9 = v114;
}
}
else if ( a9[1] > v114 || a9[1] == v114 && v22 == v115 )
{
a8[1] = v115;
a9[1] = v114;
}
++v112;
}
while ( &v133[a5 - 2 + 2] != v112 );
}
v55 = *a8;
if ( *a8 != -1 )
goto LABEL_45;
goto LABEL_78;
}
LABEL_45:
if ( *a12 == v55 && a5 > 0 )
{
v56 = 0;
*a15 = 1;
v57 = a8[1];
if ( v57 == -1 )
return v56;
LABEL_79:
if ( a12[1] == v57 && a5 > 0 )
{
a15[1] = 1;
result = 0LL;
}
else
{
a15[1] = 0;
v78 = *((_DWORD *)v17 + 41);
a9[1] = 0;
if ( v23 <= 0 )
return 4294967285LL;
*(_DWORD *)(v20 + 4LL * a14) = v78;
v79 = a9[1];
a9[1] = v79 + 1;
*(_DWORD *)(a11 + 4 * v79) = a14;
v80 = 4LL * a8[1];
v81 = *(int *)(v132 + v80);
if ( (_DWORD)v81 )
{
v82 = (int *)(v135 + v80);
v83 = v129 + 8 * v81;
v84 = v83 + 8LL * *v82;
if ( v83 >= v84 )
{
*v82 = 0;
}
else
{
v85 = (int *)(v129 + 8 * v81);
v86 = v85;
do
{
v87 = *(int *)(v136 + 4LL * *v86);
if ( (_DWORD)v87 )
{
v88 = v129 + 8 * v87;
v89 = *(int *)(v88 + 20);
v90 = (int *)(v88 + 32);
if ( *(_DWORD *)(v88 + 4 * (v89 + v86[1]) + 32) != -1 )
{
if ( (int)v89 > 0 )
{
v91 = v88 + 4LL * (unsigned int)(v89 - 1) + 36;
do
{
v92 = *v90;
if ( *v90 >= 0 )
{
v93 = (_DWORD *)(v20 + 4LL * v92);
if ( *v93 != v78 )
{
if ( v23 <= a9[1] )
return 4294967285LL;
*v93 = v78;
v94 = a9[1];
a9[1] = v94 + 1;
*(_DWORD *)(a11 + 4 * v94) = v92;
}
}
++v90;
}
while ( v90 != (int *)v91 );
}
v85 += 2;
*((_QWORD *)v85 - 1) = *(_QWORD *)v86;
}
}
v86 += 2;
}
while ( v84 > (unsigned __int64)v86 );
*(_DWORD *)(v135 + 4LL * a8[1]) = (__int64)((__int64)v85 - v83) >> 3;
}
}
++*((_DWORD *)v17 + 41);
result = 0LL;
}
return result;
}
LABEL_59:
v60 = v17[171];
*a15 = 0;
v61 = *((_DWORD *)v17 + 345);
v62 = *((_DWORD *)v17 + 41);
*a9 = v61;
if ( *(int *)(v60 + 4LL * a14) < 0 )
{
if ( v23 <= v61 )
return 4294967285LL;
*(_DWORD *)(v20 + 4LL * a14) = v62;
v117 = *a9;
*a9 = v117 + 1;
*(_DWORD *)(a10 + 4 * v117) = a14;
}
v63 = 4LL * *a8;
v64 = *(int *)(v132 + v63);
if ( !(_DWORD)v64 )
{
LABEL_77:
++*((_DWORD *)v17 + 41);
goto LABEL_78;
}
v65 = (int *)(v135 + v63);
v66 = (int *)(v129 + 8 * v64);
v131 = v66;
v67 = &v66[2 * *v65];
if ( v66 >= v67 )
{
LODWORD(v77) = 0;
LABEL_76:
*v65 = v77;
goto LABEL_77;
}
v134 = v17;
v68 = v129 + 8 * v64;
v138 = a5;
while ( 1 )
{
v69 = *(int *)(v136 + 4LL * *v66);
if ( !(_DWORD)v69 )
goto LABEL_74;
v70 = v129 + 8 * v69;
v71 = *(int *)(v70 + 20);
v72 = (int *)(v70 + 32);
if ( *(_DWORD *)(v70 + 4 * (v71 + v66[1]) + 32) == -1 )
goto LABEL_74;
if ( (int)v71 > 0 )
break;
LABEL_73:
v68 += 8LL;
*(_QWORD *)(v68 - 8) = *(_QWORD *)v66;
LABEL_74:
v66 += 2;
if ( v67 <= v66 )
{
v17 = v134;
a5 = v138;
v77 = (v68 - (__int64)v131) >> 3;
v65 = (int *)(v135 + 4LL * *a8);
goto LABEL_76;
}
}
v73 = v70 + 4LL * (unsigned int)(v71 - 1) + 36;
while ( 1 )
{
while ( 1 )
{
v74 = *v72;
if ( *v72 >= 0 )
{
v75 = (_DWORD *)(v20 + 4LL * v74);
if ( *v75 != v62 && *(int *)(v60 + 4LL * v74) < 0 )
break;
}
if ( (int *)v73 == ++v72 )
goto LABEL_73;
}
if ( v23 <= *a9 )
return 4294967285LL;
*v75 = v62;
v76 = *a9;
++v72;
*a9 = v76 + 1;
*(_DWORD *)(a10 + 4 * v76) = v74;
if ( (int *)v73 == v72 )
goto LABEL_73;
}
}

original_code:
int umfzi_row_search
(
    NumericType *Numeric,
    WorkType *Work,
    SymbolicType *Symbolic,
    int cdeg0,
    int cdeg1,
    const int Pattern [ ],
    const int Pos [ ],
    int pivrow [2],
    int rdeg [2],
    int W_i [ ],
    int W_o [ ],
    int prior_pivrow [2],
    const DoubleComplex Wxy [ ],
    int pivcol,
    int freebie [ ]
)
{
    double maxval, toler, toler2, value, pivot [2] ;
    int i, row, deg, col, *Frpos, fnrows, *E, j, ncols, *Cols, *Rows,
 e, f, Wrpflag, *Fcpos, fncols, tpi, max_rdeg, nans_in_col, was_offdiag,
 diag_row, prefer_diagonal, *Wrp, found, *Diagonal_map ;
    Tuple *tp, *tpend, *tp1, *tp2 ;
    Unit *Memory, *p ;
    Element *ep ;
    int *Row_tuples, *Row_degree, *Row_tlen ;
    pivot [0] = 0. ;
    pivot [1] = 0. ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Row_tlen = Numeric->Uilen ;
    Wrp = Work->Wrp ;
    Frpos = Work->Frpos ;
    E = Work->E ;
    Memory = Numeric->Memory ;
    fnrows = Work->fnrows ;
    prefer_diagonal = Symbolic->prefer_diagonal ;
    Diagonal_map = Work->Diagonal_map ;
    if (Diagonal_map)
    {
 diag_row = Diagonal_map [pivcol] ;
 was_offdiag = diag_row < 0 ;
 if (was_offdiag)
 {
     diag_row = (-(diag_row)-2) ;
 }
 ;
    }
    else
    {
 diag_row = (-1) ;
 was_offdiag = (-1) ;
    }
    max_rdeg = Work->fncols_max ;
    maxval = 0.0 ;
    nans_in_col = (0) ;
    for (i = 0 ; i < cdeg1 ; i++)
    {
 { (value) = (((((Wxy [i]).component [0]) < 0.)) ? -((Wxy [i]).component [0]) : ((Wxy [i]).component [0])) + (((((Wxy [i]).component [1]) < 0.)) ? -((Wxy [i]).component [1]) : ((Wxy [i]).component [1])) ; } ;
 if (((value) != (value)))
 {
     nans_in_col = (1) ;
     maxval = value ;
     break ;
 }
 maxval = (((maxval) > (value)) ? (maxval) : (value)) ;
    }
    toler = Numeric->relpt * maxval ;
    toler2 = Numeric->relpt2 * maxval ;
    toler2 = was_offdiag ? toler : toler2 ;
    ;
    if (((toler) != (toler)) || ((toler2) != (toler2)))
    {
 nans_in_col = (1) ;
    }
    if (!nans_in_col)
    {
 found = (0) ;
 ;
 if (prefer_diagonal)
 {
     ;
     i = Pos [diag_row] ;
     if (i >= 0)
     {
  double a ;
  ;
  ;
  { (a) = (((((Wxy [i]).component [0]) < 0.)) ? -((Wxy [i]).component [0]) : ((Wxy [i]).component [0])) + (((((Wxy [i]).component [1]) < 0.)) ? -((Wxy [i]).component [1]) : ((Wxy [i]).component [1])) ; } ;
  ;
  ;
  if (((a) != 0.) && a >= toler2)
  {
      ;
      found = (1) ;
      if (Frpos [diag_row] >= 0 && Frpos [diag_row] < fnrows)
      {
   pivrow [0] = diag_row ;
   pivrow [1] = (-1) ;
      }
      else
      {
   pivrow [0] = (-1) ;
   pivrow [1] = diag_row ;
      }
  }
     }
 }
 if (!found)
 {
     if (cdeg0 > 0)
     {
  for (i = 0 ; i < cdeg0 ; i++)
  {
      double a ;
      { (a) = (((((Wxy [i]).component [0]) < 0.)) ? -((Wxy [i]).component [0]) : ((Wxy [i]).component [0])) + (((((Wxy [i]).component [1]) < 0.)) ? -((Wxy [i]).component [1]) : ((Wxy [i]).component [1])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   ;
   ;
   ;
   if (deg < rdeg [0]
          || (deg == rdeg [0] && a > pivot [0])
      )
   {
       pivrow [0] = row ;
       rdeg [0] = deg ;
       pivot [0] = a ;
   }
      }
  }
  for ( ; i < cdeg1 ; i++)
  {
      double a ;
      { (a) = (((((Wxy [i]).component [0]) < 0.)) ? -((Wxy [i]).component [0]) : ((Wxy [i]).component [0])) + (((((Wxy [i]).component [1]) < 0.)) ? -((Wxy [i]).component [1]) : ((Wxy [i]).component [1])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   ;
   ;
   if (deg < rdeg [1]
          || (deg == rdeg [1] && a > pivot [1])
      )
   {
       pivrow [1] = row ;
       rdeg [1] = deg ;
       pivot [1] = a ;
   }
      }
  }
     }
     else
     {
  for (i = 0 ; i < cdeg1 ; i++)
  {
      double a ;
      { (a) = (((((Wxy [i]).component [0]) < 0.)) ? -((Wxy [i]).component [0]) : ((Wxy [i]).component [0])) + (((((Wxy [i]).component [1]) < 0.)) ? -((Wxy [i]).component [1]) : ((Wxy [i]).component [1])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   if (Frpos [row] >= 0 && Frpos [row] < fnrows)
   {
       ;
       if (deg < rdeg [0]
          || (deg == rdeg [0] && a > pivot [0])
          )
       {
    pivrow [0] = row ;
    rdeg [0] = deg ;
    pivot [0] = a ;
       }
   }
   else
   {
       ;
       if (deg < rdeg [1]
          || (deg == rdeg[1] && a > pivot [1])
          )
       {
    pivrow [1] = row ;
    rdeg [1] = deg ;
    pivot [1] = a ;
       }
   }
      }
  }
     }
 }
    }
    if (cdeg1 > 0 && pivrow [0] == (-1) && pivrow [1] == (-1))
    {
 ;
 row = Pattern [0] ;
 deg = Row_degree [row] ;
 if (Frpos [row] >= 0 && Frpos [row] < fnrows)
 {
     ;
     pivrow [0] = row ;
     rdeg [0] = deg ;
 }
 else
 {
     ;
     pivrow [1] = row ;
     rdeg [1] = deg ;
 }
 for (i = 1 ; i < cdeg1 ; i++)
 {
     row = Pattern [i] ;
     deg = Row_degree [row] ;
     if (Frpos [row] >= 0 && Frpos [row] < fnrows)
     {
  ;
  if (deg < rdeg [0] || (deg == rdeg [0] && row == diag_row))
  {
      pivrow [0] = row ;
      rdeg [0] = deg ;
  }
     }
     else
     {
  ;
  if (deg < rdeg [1] || (deg == rdeg [1] && row == diag_row))
  {
      pivrow [1] = row ;
      rdeg [1] = deg ;
  }
     }
 }
    }
    ;
    ;
    if (cdeg1 == 0)
    {
 if (fnrows > 0)
 {
     pivrow [0] = Work->Frows [0] ;
     ;
 }
 else
 {
     int *Front_leftmostdesc, *Front_1strow, *Front_new1strow, row1,
  row2, fleftmost, nfr, n_row, frontid ;
     ;
     Front_leftmostdesc = Symbolic->Front_leftmostdesc ;
     Front_1strow = Symbolic->Front_1strow ;
     Front_new1strow = Work->Front_new1strow ;
     nfr = Symbolic->nfr ;
     n_row = Numeric->n_row ;
     frontid = Work->frontid ;
     ;
     fleftmost = Front_leftmostdesc [frontid] ;
     row1 = Front_new1strow [fleftmost] ;
     row2 = Front_1strow [frontid+1] - 1 ;
     ;
     for (row = row1 ; row <= row2 ; row++)
     {
  ;
  if ((Row_degree [row] >= 0))
  {
      ;
      ;
      pivrow [1] = row ;
      ;
      break ;
  }
     }
     Front_new1strow [fleftmost] = row ;
     if (pivrow [1] == (-1))
     {
  row1 = Front_new1strow [nfr] ;
  row2 = n_row-1 ;
  ;
  for (row = row1 ; row <= row2 ; row++)
  {
      ;
      if ((Row_degree [row] >= 0))
      {
   ;
   ;
   pivrow [1] = row ;
   ;
   break ;
      }
  }
  Front_new1strow [nfr] = row ;
     }
     if (pivrow [1] == (-1))
     {
  ;
  ;
  return ((1)) ;
     }
 }
    }
    if (pivrow [0] != (-1))
    {
 freebie [0] = (pivrow [0] == prior_pivrow [0]) && (cdeg1 > 0) ;
 ;
 if (!freebie [0])
 {
     Fcpos = Work->Fcpos ;
     fncols = Work->fncols ;
     Wrpflag = Work->Wrpflag ;
     rdeg [0] = fncols ;
     ;
     ;
     ;
     if (Fcpos [pivcol] < 0)
     {
  ;
  if (rdeg [0] >= max_rdeg)
  {
      return ((-11)) ;
  }
  Wrp [pivcol] = Wrpflag ;
  W_i [rdeg [0]++] = pivcol ;
     }
     tpi = Row_tuples [pivrow [0]] ;
     if (tpi)
     {
  tp = (Tuple *) (Memory + tpi) ;
  tp1 = tp ;
  tp2 = tp ;
  tpend = tp + Row_tlen [pivrow [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 = (int *) p ;
      ncols = ep->ncols ;
      Rows = Cols + ncols ;
      if (Rows [f] == (-1))
      {
   continue ;
      }
      ;
      for (j = 0 ; j < ncols ; j++)
      {
   col = Cols [j] ;
   ;
   if ((col >= 0) && (Wrp [col] != Wrpflag)
       && Fcpos [col] <0)
   {
       ;
       if (rdeg [0] >= max_rdeg)
       {
    ;
    return ((-11)) ;
       }
       Wrp [col] = Wrpflag ;
       W_i [rdeg [0]++] = col ;
   }
      }
      *tp2++ = *tp ;
  }
  Row_tlen [pivrow [0]] = tp2 - tp1 ;
     }
     Work->Wrpflag++ ;
 }
    }
    if (pivrow [1] != (-1))
    {
 freebie [1] = (pivrow [1] == prior_pivrow [1]) && cdeg1 > 0 ;
 ;
 if (!freebie [1])
 {
     Wrpflag = Work->Wrpflag ;
     rdeg [1] = 0 ;
     ;
     ;
     ;
     ;
     if (rdeg [1] >= max_rdeg)
     {
  return ((-11)) ;
     }
     Wrp [pivcol] = Wrpflag ;
     W_o [rdeg [1]++] = pivcol ;
     tpi = Row_tuples [pivrow [1]] ;
     if (tpi)
     {
  tp = (Tuple *) (Memory + tpi) ;
  tp1 = tp ;
  tp2 = tp ;
  tpend = tp + Row_tlen [pivrow [1]] ;
  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 = (int *) p ;
      ncols = ep->ncols ;
      Rows = Cols + ncols ;
      if (Rows [f] == (-1))
      {
   continue ;
      }
      ;
      for (j = 0 ; j < ncols ; j++)
      {
   col = Cols [j] ;
   ;
   if ((col >= 0) && (Wrp [col] != Wrpflag))
   {
       ;
       if (rdeg [1] >= max_rdeg)
       {
    ;
    return ((-11)) ;
       }
       Wrp [col] = Wrpflag ;
       W_o [rdeg [1]++] = col ;
   }
      }
      *tp2++ = *tp ;
  }
  Row_tlen [pivrow [1]] = tp2 - tp1 ;
     }
     Work->Wrpflag++ ;
 }
    }
    ;
    return ((0)) ;
}

canonical_original_code:
int umfzi_row_search(struct NumericType *Numeric, struct WorkType *Work, struct SymbolicType *Symbolic, int cdeg0, int cdeg1, int Pattern[], int Pos[], int pivrow[2], int rdeg[2], int W_i[], int W_o[], int prior_pivrow[2], struct DoubleComplex Wxy[], int pivcol, int freebie[])
{
    double maxval; double toler; double toler2; double value; double pivot[2];
    int i; int row; int deg; int col; int *Frpos; int fnrows; int *E; int j; int ncols; int *Cols; int *Rows; int e; int f; int Wrpflag; int *Fcpos; int fncols; int tpi; int max_rdeg; int nans_in_col; int was_offdiag; int diag_row; int prefer_diagonal; int *Wrp; int found; int *Diagonal_map;
    struct Tuple *tp; struct Tuple *tpend; struct Tuple *tp1; struct Tuple *tp2;
    union Unit_union *Memory; union Unit_union *p;
    struct Element *ep;
    int *Row_tuples; int *Row_degree; int *Row_tlen;
    pivot [0] = 0. ;
    pivot [1] = 0. ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Row_tlen = Numeric->Uilen ;
    Wrp = Work->Wrp ;
    Frpos = Work->Frpos ;
    E = Work->E ;
    Memory = Numeric->Memory ;
    fnrows = Work->fnrows ;
    prefer_diagonal = Symbolic->prefer_diagonal ;
    Diagonal_map = Work->Diagonal_map ;
    if (Diagonal_map)
    {
 diag_row = Diagonal_map [pivcol] ;
 was_offdiag = diag_row < 0 ;
 if (was_offdiag)
 {
     diag_row = (-(diag_row)-2) ;
 }
 ;
    }
    else
    {
 diag_row = (-1) ;
 was_offdiag = (-1) ;
    }
    max_rdeg = Work->fncols_max ;
    maxval = 0.0 ;
    nans_in_col = (0) ;
    for (i = 0 ; i < cdeg1 ; i++)
    {
 { (value) = (((((Wxy [i]).component [0]) < 0.)) ? -((Wxy [i]).component [0]) : ((Wxy [i]).component [0])) + (((((Wxy [i]).component [1]) < 0.)) ? -((Wxy [i]).component [1]) : ((Wxy [i]).component [1])) ; } ;
 if (((value) != (value)))
 {
     nans_in_col = (1) ;
     maxval = value ;
     break ;
 }
 maxval = (((maxval) > (value)) ? (maxval) : (value)) ;
    }
    toler = Numeric->relpt * maxval ;
    toler2 = Numeric->relpt2 * maxval ;
    toler2 = was_offdiag ? toler : toler2 ;
    ;
    if (((toler) != (toler)) || ((toler2) != (toler2)))
    {
 nans_in_col = (1) ;
    }
    if (!nans_in_col)
    {
 found = (0) ;
 ;
 if (prefer_diagonal)
 {
     ;
     i = Pos [diag_row] ;
     if (i >= 0)
     {
  double a;
  ;
  ;
  { (a) = (((((Wxy [i]).component [0]) < 0.)) ? -((Wxy [i]).component [0]) : ((Wxy [i]).component [0])) + (((((Wxy [i]).component [1]) < 0.)) ? -((Wxy [i]).component [1]) : ((Wxy [i]).component [1])) ; } ;
  ;
  ;
  if (((a) != 0.) && a >= toler2)
  {
      ;
      found = (1) ;
      if (Frpos [diag_row] >= 0 && Frpos [diag_row] < fnrows)
      {
   pivrow [0] = diag_row ;
   pivrow [1] = (-1) ;
      }
      else
      {
   pivrow [0] = (-1) ;
   pivrow [1] = diag_row ;
      }
  }
     }
 }
 if (!found)
 {
     if (cdeg0 > 0)
     {
  for (i = 0 ; i < cdeg0 ; i++)
  {
      double a;
      { (a) = (((((Wxy [i]).component [0]) < 0.)) ? -((Wxy [i]).component [0]) : ((Wxy [i]).component [0])) + (((((Wxy [i]).component [1]) < 0.)) ? -((Wxy [i]).component [1]) : ((Wxy [i]).component [1])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   ;
   ;
   ;
   if (deg < rdeg [0]
          || (deg == rdeg [0] && a > pivot [0])
      )
   {
       pivrow [0] = row ;
       rdeg [0] = deg ;
       pivot [0] = a ;
   }
      }
  }
  for ( ; i < cdeg1 ; i++)
  {
      double a;
      { (a) = (((((Wxy [i]).component [0]) < 0.)) ? -((Wxy [i]).component [0]) : ((Wxy [i]).component [0])) + (((((Wxy [i]).component [1]) < 0.)) ? -((Wxy [i]).component [1]) : ((Wxy [i]).component [1])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   ;
   ;
   if (deg < rdeg [1]
          || (deg == rdeg [1] && a > pivot [1])
      )
   {
       pivrow [1] = row ;
       rdeg [1] = deg ;
       pivot [1] = a ;
   }
      }
  }
     }
     else
     {
  for (i = 0 ; i < cdeg1 ; i++)
  {
      double a;
      { (a) = (((((Wxy [i]).component [0]) < 0.)) ? -((Wxy [i]).component [0]) : ((Wxy [i]).component [0])) + (((((Wxy [i]).component [1]) < 0.)) ? -((Wxy [i]).component [1]) : ((Wxy [i]).component [1])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   if (Frpos [row] >= 0 && Frpos [row] < fnrows)
   {
       ;
       if (deg < rdeg [0]
          || (deg == rdeg [0] && a > pivot [0])
          )
       {
    pivrow [0] = row ;
    rdeg [0] = deg ;
    pivot [0] = a ;
       }
   }
   else
   {
       ;
       if (deg < rdeg [1]
          || (deg == rdeg[1] && a > pivot [1])
          )
       {
    pivrow [1] = row ;
    rdeg [1] = deg ;
    pivot [1] = a ;
       }
   }
      }
  }
     }
 }
    }
    if (cdeg1 > 0 && pivrow [0] == (-1) && pivrow [1] == (-1))
    {
 ;
 row = Pattern [0] ;
 deg = Row_degree [row] ;
 if (Frpos [row] >= 0 && Frpos [row] < fnrows)
 {
     ;
     pivrow [0] = row ;
     rdeg [0] = deg ;
 }
 else
 {
     ;
     pivrow [1] = row ;
     rdeg [1] = deg ;
 }
 for (i = 1 ; i < cdeg1 ; i++)
 {
     row = Pattern [i] ;
     deg = Row_degree [row] ;
     if (Frpos [row] >= 0 && Frpos [row] < fnrows)
     {
  ;
  if (deg < rdeg [0] || (deg == rdeg [0] && row == diag_row))
  {
      pivrow [0] = row ;
      rdeg [0] = deg ;
  }
     }
     else
     {
  ;
  if (deg < rdeg [1] || (deg == rdeg [1] && row == diag_row))
  {
      pivrow [1] = row ;
      rdeg [1] = deg ;
  }
     }
 }
    }
    ;
    ;
    if (cdeg1 == 0)
    {
 if (fnrows > 0)
 {
     pivrow [0] = Work->Frows [0] ;
     ;
 }
 else
 {
     int *Front_leftmostdesc; int *Front_1strow; int *Front_new1strow; int row1; int row2; int fleftmost; int nfr; int n_row; int frontid;
     ;
     Front_leftmostdesc = Symbolic->Front_leftmostdesc ;
     Front_1strow = Symbolic->Front_1strow ;
     Front_new1strow = Work->Front_new1strow ;
     nfr = Symbolic->nfr ;
     n_row = Numeric->n_row ;
     frontid = Work->frontid ;
     ;
     fleftmost = Front_leftmostdesc [frontid] ;
     row1 = Front_new1strow [fleftmost] ;
     row2 = Front_1strow [frontid+1] - 1 ;
     ;
     for (row = row1 ; row <= row2 ; row++)
     {
  ;
  if ((Row_degree [row] >= 0))
  {
      ;
      ;
      pivrow [1] = row ;
      ;
      break ;
  }
     }
     Front_new1strow [fleftmost] = row ;
     if (pivrow [1] == (-1))
     {
  row1 = Front_new1strow [nfr] ;
  row2 = n_row-1 ;
  ;
  for (row = row1 ; row <= row2 ; row++)
  {
      ;
      if ((Row_degree [row] >= 0))
      {
   ;
   ;
   pivrow [1] = row ;
   ;
   break ;
      }
  }
  Front_new1strow [nfr] = row ;
     }
     if (pivrow [1] == (-1))
     {
  ;
  ;
  return ((1)) ;
     }
 }
    }
    if (pivrow [0] != (-1))
    {
 freebie [0] = (pivrow [0] == prior_pivrow [0]) && (cdeg1 > 0) ;
 ;
 if (!freebie [0])
 {
     Fcpos = Work->Fcpos ;
     fncols = Work->fncols ;
     Wrpflag = Work->Wrpflag ;
     rdeg [0] = fncols ;
     ;
     ;
     ;
     if (Fcpos [pivcol] < 0)
     {
  ;
  if (rdeg [0] >= max_rdeg)
  {
      return ((-11)) ;
  }
  Wrp [pivcol] = Wrpflag ;
  W_i [rdeg [0]++] = pivcol ;
     }
     tpi = Row_tuples [pivrow [0]] ;
     if (tpi)
     {
  tp = (struct Tuple *) (Memory + tpi) ;
  tp1 = tp ;
  tp2 = tp ;
  tpend = tp + Row_tlen [pivrow [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 = (int *) p ;
      ncols = ep->ncols ;
      Rows = Cols + ncols ;
      if (Rows [f] == (-1))
      {
   continue ;
      }
      ;
      for (j = 0 ; j < ncols ; j++)
      {
   col = Cols [j] ;
   ;
   if ((col >= 0) && (Wrp [col] != Wrpflag)
       && Fcpos [col] <0)
   {
       ;
       if (rdeg [0] >= max_rdeg)
       {
    ;
    return ((-11)) ;
       }
       Wrp [col] = Wrpflag ;
       W_i [rdeg [0]++] = col ;
   }
      }
      *tp2++ = *tp ;
  }
  Row_tlen [pivrow [0]] = tp2 - tp1 ;
     }
     Work->Wrpflag++ ;
 }
    }
    if (pivrow [1] != (-1))
    {
 freebie [1] = (pivrow [1] == prior_pivrow [1]) && cdeg1 > 0 ;
 ;
 if (!freebie [1])
 {
     Wrpflag = Work->Wrpflag ;
     rdeg [1] = 0 ;
     ;
     ;
     ;
     ;
     if (rdeg [1] >= max_rdeg)
     {
  return ((-11)) ;
     }
     Wrp [pivcol] = Wrpflag ;
     W_o [rdeg [1]++] = pivcol ;
     tpi = Row_tuples [pivrow [1]] ;
     if (tpi)
     {
  tp = (struct Tuple *) (Memory + tpi) ;
  tp1 = tp ;
  tp2 = tp ;
  tpend = tp + Row_tlen [pivrow [1]] ;
  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 = (int *) p ;
      ncols = ep->ncols ;
      Rows = Cols + ncols ;
      if (Rows [f] == (-1))
      {
   continue ;
      }
      ;
      for (j = 0 ; j < ncols ; j++)
      {
   col = Cols [j] ;
   ;
   if ((col >= 0) && (Wrp [col] != Wrpflag))
   {
       ;
       if (rdeg [1] >= max_rdeg)
       {
    ;
    return ((-11)) ;
       }
       Wrp [col] = Wrpflag ;
       W_o [rdeg [1]++] = col ;
   }
      }
      *tp2++ = *tp ;
  }
  Row_tlen [pivrow [1]] = tp2 - tp1 ;
     }
     Work->Wrpflag++ ;
 }
    }
    ;
    return ((0)) ;
}

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

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

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

variable_types:
Pattern
int []

variable_types:
Pos
int []

variable_types:
pivrow
int [2]

variable_types:
rdeg
int [2]

variable_types:
Wxy
struct DoubleComplex []

variable_types: pivcol int

variable_types:
freebie
int []

variable_types: maxval double

variable_types: toler double

variable_types: value double

variable_types:
pivot
double [2]

variable_types: i int

variable_types: row int

variable_types: deg int

variable_types: col int

variable_types:
Frpos
int *

variable_types: fnrows int

variable_types:
E
int *

variable_types: j int

variable_types: ncols int

variable_types:
Cols
int *

variable_types:
Rows
int *

variable_types: e int

variable_types: f int

variable_types: Wrpflag int

variable_types:
Fcpos
int *

variable_types: fncols int

variable_types: tpi int

variable_types:
Wrp
int *

variable_types: found int

variable_types:
tp
struct Tuple { int e; } *

variable_types:
tpend
struct Tuple { int e; } *

variable_types:
ep
struct Element { int cdeg; } *

variable_types: a double

variable_types: fleftmost int

variable_types: nfr int

variable_types: frontid int