original_code:
double cholmod_l_norm_dense
(
    cholmod_dense *X,
    int norm,
    cholmod_common *Common
)
{
    double xnorm, s, x, z ;
    double *Xx, *Xz, *W ;
    long nrow, ncol, d, i, j, use_workspace, xtype ;
    { if (Common == ((void *)0)) { return ((-1)) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return ((-1)) ; } } ;
    { if ((X) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_norm.c", 86, "argument missing", Common) ; } return ((-1)) ; } } ;
    { if ((X)->xtype < (1) || (X)->xtype > (3) || ((X)->xtype != 0 && ((X)->x) == ((void *)0)) || ((X)->xtype == 3 && ((X)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_norm.c", 87, "invalid xtype", Common) ; } return ((-1)) ; } } ;
    Common->status = 0 ;
    ncol = X->ncol ;
    if (norm < 0 || norm > 2 || (norm == 2 && ncol > 1))
    {
 cholmod_l_error ((-4), "../MatrixOps/cholmod_norm.c", 92, "invalid norm", Common) ;
 return ((-1)) ;
    }
    nrow = X->nrow ;
    d = X->d ;
    Xx = X->x ;
    Xz = X->z ;
    xtype = X->xtype ;
    W = ((void *)0) ;
    use_workspace = (norm == 0 && ncol > 4) ;
    if (use_workspace)
    {
 cholmod_l_allocate_work (0, 0, nrow, Common) ;
 W = Common->Xwork ;
 if (Common->status < 0)
 {
     use_workspace = 0 ;
 }
    }
    xnorm = 0 ;
    if (use_workspace)
    {
 ;
 for (j = 0 ; j < ncol ; j++)
 {
     for (i = 0 ; i < nrow ; i++)
     {
  W [i] += abs_value (xtype, Xx, Xz, i+j*d, Common) ;
     }
 }
 for (i = 0 ; i < nrow ; i++)
 {
     s = W [i] ;
     if ((((s) != (s)) || s > xnorm) && !((xnorm) != (xnorm)))
     {
  xnorm = s ;
     }
     W [i] = 0 ;
 }
    }
    else if (norm == 0)
    {
 for (i = 0 ; i < nrow ; i++)
 {
     s = 0 ;
     for (j = 0 ; j < ncol ; j++)
     {
  s += abs_value (xtype, Xx, Xz, i+j*d, Common) ;
     }
     if ((((s) != (s)) || s > xnorm) && !((xnorm) != (xnorm)))
     {
  xnorm = s ;
     }
 }
    }
    else if (norm == 1)
    {
 for (j = 0 ; j < ncol ; j++)
 {
     s = 0 ;
     for (i = 0 ; i < nrow ; i++)
     {
  s += abs_value (xtype, Xx, Xz, i+j*d, Common) ;
     }
     if ((((s) != (s)) || s > xnorm) && !((xnorm) != (xnorm)))
     {
  xnorm = s ;
     }
 }
    }
    else
    {
 switch (xtype)
 {
     case 1:
  for (i = 0 ; i < nrow ; i++)
  {
      x = Xx [i] ;
      xnorm += x*x ;
  }
  break ;
     case 2:
  for (i = 0 ; i < nrow ; i++)
  {
      x = Xx [2*i ] ;
      z = Xx [2*i+1] ;
      xnorm += x*x + z*z ;
  }
  break ;
     case 3:
  for (i = 0 ; i < nrow ; i++)
  {
      x = Xx [i] ;
      z = Xz [i] ;
      xnorm += x*x + z*z ;
  }
  break ;
 }
 xnorm = sqrt (xnorm) ;
    }
    return (xnorm) ;
}

canonical_original_code:
double cholmod_l_norm_dense(struct cholmod_dense_struct *X, int norm, struct cholmod_common_struct *Common)
{
    double xnorm; double s; double x; double z;
    double *Xx; double *Xz; double *W;
    long nrow; long ncol; long d; long i; long j; long use_workspace; long xtype;
    { if (Common == ((void *)0)) { return ((-1)) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return ((-1)) ; } } ;
    { if ((X) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_norm.c", 86, "argument missing", Common) ; } return ((-1)) ; } } ;
    { if ((X)->xtype < (1) || (X)->xtype > (3) || ((X)->xtype != 0 && ((X)->x) == ((void *)0)) || ((X)->xtype == 3 && ((X)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_norm.c", 87, "invalid xtype", Common) ; } return ((-1)) ; } } ;
    Common->status = 0 ;
    ncol = X->ncol ;
    if (norm < 0 || norm > 2 || (norm == 2 && ncol > 1))
    {
 cholmod_l_error ((-4), "../MatrixOps/cholmod_norm.c", 92, "invalid norm", Common) ;
 return ((-1)) ;
    }
    nrow = X->nrow ;
    d = X->d ;
    Xx = X->x ;
    Xz = X->z ;
    xtype = X->xtype ;
    W = ((void *)0) ;
    use_workspace = (norm == 0 && ncol > 4) ;
    if (use_workspace)
    {
 cholmod_l_allocate_work (0, 0, nrow, Common) ;
 W = Common->Xwork ;
 if (Common->status < 0)
 {
     use_workspace = 0 ;
 }
    }
    xnorm = 0 ;
    if (use_workspace)
    {
 ;
 for (j = 0 ; j < ncol ; j++)
 {
     for (i = 0 ; i < nrow ; i++)
     {
  W [i] += abs_value (xtype, Xx, Xz, i+j*d, Common) ;
     }
 }
 for (i = 0 ; i < nrow ; i++)
 {
     s = W [i] ;
     if ((((s) != (s)) || s > xnorm) && !((xnorm) != (xnorm)))
     {
  xnorm = s ;
     }
     W [i] = 0 ;
 }
    }
    else if (norm == 0)
    {
 for (i = 0 ; i < nrow ; i++)
 {
     s = 0 ;
     for (j = 0 ; j < ncol ; j++)
     {
  s += abs_value (xtype, Xx, Xz, i+j*d, Common) ;
     }
     if ((((s) != (s)) || s > xnorm) && !((xnorm) != (xnorm)))
     {
  xnorm = s ;
     }
 }
    }
    else if (norm == 1)
    {
 for (j = 0 ; j < ncol ; j++)
 {
     s = 0 ;
     for (i = 0 ; i < nrow ; i++)
     {
  s += abs_value (xtype, Xx, Xz, i+j*d, Common) ;
     }
     if ((((s) != (s)) || s > xnorm) && !((xnorm) != (xnorm)))
     {
  xnorm = s ;
     }
 }
    }
    else
    {
 switch (xtype)
 {
     case 1:
  for (i = 0 ; i < nrow ; i++)
  {
      x = Xx [i] ;
      xnorm += x*x ;
  }
  break ;
     case 2:
  for (i = 0 ; i < nrow ; i++)
  {
      x = Xx [2*i ] ;
      z = Xx [2*i+1] ;
      xnorm += x*x + z*z ;
  }
  break ;
     case 3:
  for (i = 0 ; i < nrow ; i++)
  {
      x = Xx [i] ;
      z = Xz [i] ;
      xnorm += x*x + z*z ;
  }
  break ;
 }
 xnorm = sqrt (xnorm) ;
    }
    return (xnorm) ;
}

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: norm int

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

variable_types: xnorm double

variable_types: s double

variable_types: x double

variable_types: z double

variable_types:
Xx
double *

variable_types:
Xz
double *

variable_types:
W
double *

variable_types: nrow long

variable_types: ncol long

variable_types: d long

variable_types: i long

variable_types: j long

variable_types: xtype long


original_code:
static double abs_value
(
    int xtype,
    double *Ax,
    double *Az,
    long p,
    cholmod_common *Common
)
{
    double s = 0 ;
    switch (xtype)
    {
 case 0:
     s = 1 ;
     break ;
 case 1:
     s = fabs (Ax [p]) ;
     break ;
 case 2:
     s = Common->hypotenuse (Ax [2*p], Ax [2*p+1]) ;
     break ;
 case 3:
     s = Common->hypotenuse (Ax [p], Az [p]) ;
     break ;
    }
    return (s) ;
}

canonical_original_code:
static double abs_value(int xtype, double *Ax, double *Az, long p, struct cholmod_common_struct *Common)
{
    double s = 0;
    switch (xtype)
    {
 case 0:
     s = 1 ;
     break ;
 case 1:
     s = fabs (Ax [p]) ;
     break ;
 case 2:
     s = Common->hypotenuse (Ax [2*p], Ax [2*p+1]) ;
     break ;
 case 3:
     s = Common->hypotenuse (Ax [p], Az [p]) ;
     break ;
    }
    return (s) ;
}

variable_types: xtype int

variable_types:
Ax
double *

variable_types:
Az
double *

variable_types: p long

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

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:
int cholmod_l_defaults
(
    cholmod_common *Common
)
{
    long i ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->dbound = 0.0 ;
    Common->grow0 = 1.2 ;
    Common->grow1 = 1.2 ;
    Common->grow2 = 5 ;
    Common->maxrank = 8 ;
    Common->final_asis = 1 ;
    Common->final_super = 1 ;
    Common->final_ll = 0 ;
    Common->final_pack = 1 ;
    Common->final_monotonic = 1 ;
    Common->final_resymbol = 0 ;
    Common->supernodal = 1 ;
    Common->supernodal_switch = 40 ;
    Common->nrelax [0] = 4 ;
    Common->nrelax [1] = 16 ;
    Common->nrelax [2] = 48 ;
    Common->zrelax [0] = 0.8 ;
    Common->zrelax [1] = 0.1 ;
    Common->zrelax [2] = 0.05 ;
    Common->prefer_zomplex = 0 ;
    Common->prefer_upper = 1 ;
    Common->prefer_binary = 0 ;
    Common->quick_return_if_not_posdef = 0 ;
    Common->metis_memory = 0.0 ;
    Common->metis_nswitch = 3000 ;
    Common->metis_dswitch = 0.66 ;
    Common->print = 3 ;
    Common->precise = 0 ;
    Common->nmethods = 0 ;
    Common->default_nesdis = 0 ;
    Common->current = 0 ;
    Common->selected = 0 ;
    for (i = 0 ; i <= 9 ; i++)
    {
 Common->method [i].ordering = 2 ;
 Common->method [i].prune_dense = 10.0 ;
 Common->method [i].prune_dense2 = -1 ;
 Common->method [i].aggressive = 1 ;
 Common->method [i].order_for_lu = 0 ;
 Common->method [i].nd_small = 200 ;
 Common->method [i].nd_compress = 1 ;
 Common->method [i].nd_camd = 1 ;
 Common->method [i].nd_components = 0 ;
 Common->method [i].nd_oksep = 1.0 ;
 Common->method [i].fl = (-1) ;
 Common->method [i].lnz = (-1) ;
    }
    Common->postorder = 1 ;
    Common->method [0].ordering = 1 ;
    Common->method [1].ordering = 2 ;
    Common->method [2].ordering = 3 ;
    Common->method [3].ordering = 4 ;
    Common->method [4].ordering = 0 ;
    Common->method [5].ordering = 4 ;
    Common->method [5].nd_small = 20000 ;
    Common->method [6].ordering = 4 ;
    Common->method [6].nd_small = 4 ;
    Common->method [6].nd_camd = 0 ;
    Common->method [7].ordering = 4 ;
    Common->method [7].prune_dense = -1. ;
    Common->method [8].ordering = 5 ;
    return (1) ;
}

canonical_original_code:
int cholmod_l_defaults(struct cholmod_common_struct *Common)
{
    long i;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->dbound = 0.0 ;
    Common->grow0 = 1.2 ;
    Common->grow1 = 1.2 ;
    Common->grow2 = 5 ;
    Common->maxrank = 8 ;
    Common->final_asis = 1 ;
    Common->final_super = 1 ;
    Common->final_ll = 0 ;
    Common->final_pack = 1 ;
    Common->final_monotonic = 1 ;
    Common->final_resymbol = 0 ;
    Common->supernodal = 1 ;
    Common->supernodal_switch = 40 ;
    Common->nrelax [0] = 4 ;
    Common->nrelax [1] = 16 ;
    Common->nrelax [2] = 48 ;
    Common->zrelax [0] = 0.8 ;
    Common->zrelax [1] = 0.1 ;
    Common->zrelax [2] = 0.05 ;
    Common->prefer_zomplex = 0 ;
    Common->prefer_upper = 1 ;
    Common->prefer_binary = 0 ;
    Common->quick_return_if_not_posdef = 0 ;
    Common->metis_memory = 0.0 ;
    Common->metis_nswitch = 3000 ;
    Common->metis_dswitch = 0.66 ;
    Common->print = 3 ;
    Common->precise = 0 ;
    Common->nmethods = 0 ;
    Common->default_nesdis = 0 ;
    Common->current = 0 ;
    Common->selected = 0 ;
    for (i = 0 ; i <= 9 ; i++)
    {
 Common->method [i].ordering = 2 ;
 Common->method [i].prune_dense = 10.0 ;
 Common->method [i].prune_dense2 = -1 ;
 Common->method [i].aggressive = 1 ;
 Common->method [i].order_for_lu = 0 ;
 Common->method [i].nd_small = 200 ;
 Common->method [i].nd_compress = 1 ;
 Common->method [i].nd_camd = 1 ;
 Common->method [i].nd_components = 0 ;
 Common->method [i].nd_oksep = 1.0 ;
 Common->method [i].fl = (-1) ;
 Common->method [i].lnz = (-1) ;
    }
    Common->postorder = 1 ;
    Common->method [0].ordering = 1 ;
    Common->method [1].ordering = 2 ;
    Common->method [2].ordering = 3 ;
    Common->method [3].ordering = 4 ;
    Common->method [4].ordering = 0 ;
    Common->method [5].ordering = 4 ;
    Common->method [5].nd_small = 20000 ;
    Common->method [6].ordering = 4 ;
    Common->method [6].nd_small = 4 ;
    Common->method [6].nd_camd = 0 ;
    Common->method [7].ordering = 4 ;
    Common->method [7].prune_dense = -1. ;
    Common->method [8].ordering = 5 ;
    return (1) ;
}

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

return_type: int


original_code:
int cholmod_l_start
(
    cholmod_common *Common
)
{
    int k ;
    if (Common == ((void *)0))
    {
 return (0) ;
    }
    Common->error_handler = ((void *)0) ;
    Common->itype = 2 ;
    Common->dtype = 0 ;
    cholmod_l_defaults (Common) ;
    Common->try_catch = 0 ;
    Common->malloc_memory = malloc ;
    Common->free_memory = free ;
    Common->realloc_memory = realloc ;
    Common->calloc_memory = calloc ;
    Common->complex_divide = cholmod_l_divcomplex ;
    Common->hypotenuse = cholmod_l_hypot ;
    Common->print_function = printf ;
    Common->nrow = 0 ;
    Common->mark = (-1) ;
    Common->xworksize = 0 ;
    Common->iworksize = 0 ;
    Common->Flag = ((void *)0) ;
    Common->Head = ((void *)0) ;
    Common->Iwork = ((void *)0) ;
    Common->Xwork = ((void *)0) ;
    Common->no_workspace_reallocate = 0 ;
    Common->fl = (-1) ;
    Common->lnz = (-1) ;
    Common->modfl = (-1) ;
    Common->status = 0 ;
    Common->malloc_count = 0 ;
    Common->memory_usage = 0 ;
    Common->memory_inuse = 0 ;
    Common->nrealloc_col = 0 ;
    Common->nrealloc_factor = 0 ;
    Common->ndbounds_hit = 0 ;
    Common->rowfacfl = 0 ;
    Common->aatfl = (-1) ;
    Common->called_nd = 0 ;
    Common->blas_ok = 1 ;
    for (k = 0 ; k < 4 ; k++) Common->SPQR_xstat [k] = 0 ;
    for (k = 0 ; k < 10 ; k++) Common->SPQR_istat [k] = 0 ;
    for (k = 0 ; k < 10 ; k++) Common->other1 [k] = 0 ;
    for (k = 0 ; k < 6 ; k++) Common->other2 [k] = 0 ;
    for (k = 0 ; k < 10 ; k++) Common->other3 [k] = 0 ;
    for (k = 0 ; k < 16 ; k++) Common->other4 [k] = 0 ;
    for (k = 0 ; k < 16 ; k++) Common->other5 [k] = (void *) ((void *)0) ;
    Common->SPQR_grain = 1 ;
    Common->SPQR_small = 1e6 ;
    Common->SPQR_shrink = 1 ;
    Common->SPQR_nthreads = 0 ;
    ;
    return (1) ;
}

canonical_original_code:
int cholmod_l_start(struct cholmod_common_struct *Common)
{
    int k;
    if (Common == ((void *)0))
    {
 return (0) ;
    }
    Common->error_handler = ((void *)0) ;
    Common->itype = 2 ;
    Common->dtype = 0 ;
    cholmod_l_defaults (Common) ;
    Common->try_catch = 0 ;
    Common->malloc_memory = malloc ;
    Common->free_memory = free ;
    Common->realloc_memory = realloc ;
    Common->calloc_memory = calloc ;
    Common->complex_divide = cholmod_l_divcomplex ;
    Common->hypotenuse = cholmod_l_hypot ;
    Common->print_function = printf ;
    Common->nrow = 0 ;
    Common->mark = (-1) ;
    Common->xworksize = 0 ;
    Common->iworksize = 0 ;
    Common->Flag = ((void *)0) ;
    Common->Head = ((void *)0) ;
    Common->Iwork = ((void *)0) ;
    Common->Xwork = ((void *)0) ;
    Common->no_workspace_reallocate = 0 ;
    Common->fl = (-1) ;
    Common->lnz = (-1) ;
    Common->modfl = (-1) ;
    Common->status = 0 ;
    Common->malloc_count = 0 ;
    Common->memory_usage = 0 ;
    Common->memory_inuse = 0 ;
    Common->nrealloc_col = 0 ;
    Common->nrealloc_factor = 0 ;
    Common->ndbounds_hit = 0 ;
    Common->rowfacfl = 0 ;
    Common->aatfl = (-1) ;
    Common->called_nd = 0 ;
    Common->blas_ok = 1 ;
    for (k = 0 ; k < 4 ; k++) Common->SPQR_xstat [k] = 0 ;
    for (k = 0 ; k < 10 ; k++) Common->SPQR_istat [k] = 0 ;
    for (k = 0 ; k < 10 ; k++) Common->other1 [k] = 0 ;
    for (k = 0 ; k < 6 ; k++) Common->other2 [k] = 0 ;
    for (k = 0 ; k < 10 ; k++) Common->other3 [k] = 0 ;
    for (k = 0 ; k < 16 ; k++) Common->other4 [k] = 0 ;
    for (k = 0 ; k < 16 ; k++) Common->other5 [k] = (void *) ((void *)0) ;
    Common->SPQR_grain = 1 ;
    Common->SPQR_small = 1e6 ;
    Common->SPQR_shrink = 1 ;
    Common->SPQR_nthreads = 0 ;
    ;
    return (1) ;
}

variable_types: k int


original_code:
int cholmod_l_free_work
(
    cholmod_common *Common
)
{
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->Flag = cholmod_l_free (Common->nrow, sizeof (long),
     Common->Flag, Common) ;
    Common->Head = cholmod_l_free (Common->nrow+1, sizeof (long),
     Common->Head, Common) ;
    Common->Iwork = cholmod_l_free (Common->iworksize, sizeof (long),
     Common->Iwork, Common) ;
    Common->Xwork = cholmod_l_free (Common->xworksize, sizeof (double),
     Common->Xwork, Common) ;
    Common->nrow = 0 ;
    Common->iworksize = 0 ;
    Common->xworksize = 0 ;
    return (1) ;
}

canonical_original_code:
int cholmod_l_free_work(struct cholmod_common_struct *Common)
{
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->Flag = cholmod_l_free (Common->nrow, sizeof (long),
     Common->Flag, Common) ;
    Common->Head = cholmod_l_free (Common->nrow+1, sizeof (long),
     Common->Head, Common) ;
    Common->Iwork = cholmod_l_free (Common->iworksize, sizeof (long),
     Common->Iwork, Common) ;
    Common->Xwork = cholmod_l_free (Common->xworksize, sizeof (double),
     Common->Xwork, Common) ;
    Common->nrow = 0 ;
    Common->iworksize = 0 ;
    Common->xworksize = 0 ;
    return (1) ;
}


decompiled_code:
__int64 __fastcall cholmod_l_finish(__int64 a1)
{
return cholmod_l_free_work(a1);
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1)
{
return func2(a1);
}

original_code:
int cholmod_l_finish
(
    cholmod_common *Common
)
{
    return (cholmod_l_free_work (Common)) ;
}

canonical_original_code:
int cholmod_l_finish(struct cholmod_common_struct *Common)
{
    return (cholmod_l_free_work (Common)) ;
}


original_code:
long cholmod_l_clear_flag
(
    cholmod_common *Common
)
{
    long i, nrow, *Flag ;
    { if (Common == ((void *)0)) { return (-1) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (-1) ; } } ;
    Common->mark++ ;
    if (Common->mark <= 0)
    {
 nrow = Common->nrow ;
 Flag = Common->Flag ;
 ;
 ;
 for (i = 0 ; i < nrow ; i++)
 {
     Flag [i] = (-1) ;
 }
 Common->mark = 0 ;
    }
    return (Common->mark) ;
}

canonical_original_code:
long cholmod_l_clear_flag(struct cholmod_common_struct *Common)
{
    long i; long nrow; long *Flag;
    { if (Common == ((void *)0)) { return (-1) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (-1) ; } } ;
    Common->mark++ ;
    if (Common->mark <= 0)
    {
 nrow = Common->nrow ;
 Flag = Common->Flag ;
 ;
 ;
 for (i = 0 ; i < nrow ; i++)
 {
     Flag [i] = (-1) ;
 }
 Common->mark = 0 ;
    }
    return (Common->mark) ;
}

variable_types:
Flag
long *

return_type: long


original_code:
int cholmod_l_allocate_work
(
    size_t nrow,
    size_t iworksize,
    size_t xworksize,
    cholmod_common *Common
)
{
    double *W ;
    long *Head ;
    long i ;
    size_t nrow1 ;
    int ok = 1 ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->status = 0 ;
    nrow = (((1) > (nrow)) ? (1) : (nrow)) ;
    nrow1 = cholmod_l_add_size_t (nrow, 1, &ok) ;
    if (!ok)
    {
 Common->status = (-3) ;
 cholmod_l_free_work (Common) ;
 return (0) ;
    }
    if (nrow > Common->nrow)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 Common->Flag = cholmod_l_free (Common->nrow, sizeof (long), Common->Flag,
  Common) ;
 Common->Head = cholmod_l_free (Common->nrow+1,sizeof (long), Common->Head,
  Common) ;
 Common->Flag = cholmod_l_malloc (nrow, sizeof (long), Common) ;
 Common->Head = cholmod_l_malloc (nrow1, sizeof (long), Common) ;
 Common->nrow = nrow ;
 if (Common->status < 0)
 {
     cholmod_l_free_work (Common) ;
     return (0) ;
 }
 Common->mark = (-1) ;
 cholmod_l_clear_flag (Common) ;
 Head = Common->Head ;
 for (i = 0 ; i <= (long) (nrow) ; i++)
 {
     Head [i] = (-1) ;
 }
    }
    iworksize = (((1) > (iworksize)) ? (1) : (iworksize)) ;
    if (iworksize > Common->iworksize)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 cholmod_l_free (Common->iworksize, sizeof (long), Common->Iwork, Common) ;
 Common->Iwork = cholmod_l_malloc (iworksize, sizeof (long), Common) ;
 Common->iworksize = iworksize ;
 if (Common->status < 0)
 {
     cholmod_l_free_work (Common) ;
     return (0) ;
 }
    }
    xworksize = (((1) > (xworksize)) ? (1) : (xworksize)) ;
    if (xworksize > Common->xworksize)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 cholmod_l_free (Common->xworksize, sizeof (double), Common->Xwork,
  Common) ;
 Common->Xwork = cholmod_l_malloc (xworksize, sizeof (double), Common) ;
 Common->xworksize = xworksize ;
 if (Common->status < 0)
 {
     cholmod_l_free_work (Common) ;
     return (0) ;
 }
 W = Common->Xwork ;
 for (i = 0 ; i < (long) xworksize ; i++)
 {
     W [i] = 0. ;
 }
    }
    return (1) ;
}

canonical_original_code:
int cholmod_l_allocate_work(unsigned long nrow, unsigned long iworksize, unsigned long xworksize, struct cholmod_common_struct *Common)
{
    double *W;
    long *Head;
    long i;
    unsigned long nrow1;
    int ok = 1;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->status = 0 ;
    nrow = (((1) > (nrow)) ? (1) : (nrow)) ;
    nrow1 = cholmod_l_add_size_t (nrow, 1, &ok) ;
    if (!ok)
    {
 Common->status = (-3) ;
 cholmod_l_free_work (Common) ;
 return (0) ;
    }
    if (nrow > Common->nrow)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 Common->Flag = cholmod_l_free (Common->nrow, sizeof (long), Common->Flag,
  Common) ;
 Common->Head = cholmod_l_free (Common->nrow+1,sizeof (long), Common->Head,
  Common) ;
 Common->Flag = cholmod_l_malloc (nrow, sizeof (long), Common) ;
 Common->Head = cholmod_l_malloc (nrow1, sizeof (long), Common) ;
 Common->nrow = nrow ;
 if (Common->status < 0)
 {
     cholmod_l_free_work (Common) ;
     return (0) ;
 }
 Common->mark = (-1) ;
 cholmod_l_clear_flag (Common) ;
 Head = Common->Head ;
 for (i = 0 ; i <= (long) (nrow) ; i++)
 {
     Head [i] = (-1) ;
 }
    }
    iworksize = (((1) > (iworksize)) ? (1) : (iworksize)) ;
    if (iworksize > Common->iworksize)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 cholmod_l_free (Common->iworksize, sizeof (long), Common->Iwork, Common) ;
 Common->Iwork = cholmod_l_malloc (iworksize, sizeof (long), Common) ;
 Common->iworksize = iworksize ;
 if (Common->status < 0)
 {
     cholmod_l_free_work (Common) ;
     return (0) ;
 }
    }
    xworksize = (((1) > (xworksize)) ? (1) : (xworksize)) ;
    if (xworksize > Common->xworksize)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 cholmod_l_free (Common->xworksize, sizeof (double), Common->Xwork,
  Common) ;
 Common->Xwork = cholmod_l_malloc (xworksize, sizeof (double), Common) ;
 Common->xworksize = xworksize ;
 if (Common->status < 0)
 {
     cholmod_l_free_work (Common) ;
     return (0) ;
 }
 W = Common->Xwork ;
 for (i = 0 ; i < (long) xworksize ; i++)
 {
     W [i] = 0. ;
 }
    }
    return (1) ;
}

variable_types:
nrow
unsigned long

variable_types:
iworksize
unsigned long

variable_types:
xworksize
unsigned long

variable_types:
Head
long *

variable_types: ok int


decompiled_code:
unsigned __int64 __fastcall cholmod_l_maxrank(__int64 a1, __int64 a2)
{
unsigned __int64 result; // rax
unsigned __int64 v3; // rcx
unsigned __int64 v4; // rdi

if ( !a2 )
return 0LL;
if ( *(_QWORD *)(a2 + 2016) == 2LL )
{
v3 = *(_QWORD *)(a2 + 32);
if ( a1 )
{
v4 = 8 * a1;
if ( v3 > 0xFFFFFFFFFFFFFFFFLL / v4 )
v3 = 0xFFFFFFFFFFFFFFFFLL / v4;
}
result = 2LL;
if ( v3 > 2 )
result = (-(__int64)(v3 < 5) & 0xFFFFFFFFFFFFFFFCLL) + 8;
}
else
{
*(_DWORD *)(a2 + 2028) = -4;
result = 0LL;
}
return result;
}

canonical_decompiled_code:
unsigned __int64 __fastcall func6(__int64 a1, __int64 a2)
{
unsigned __int64 result; // rax
unsigned __int64 v3; // rcx
unsigned __int64 v4; // rdi

if ( !a2 )
return 0LL;
if ( *(_QWORD *)(a2 + 2016) == 2LL )
{
v3 = *(_QWORD *)(a2 + 32);
if ( a1 )
{
v4 = 8 * a1;
if ( v3 > 0xFFFFFFFFFFFFFFFFLL / v4 )
v3 = 0xFFFFFFFFFFFFFFFFLL / v4;
}
result = 2LL;
if ( v3 > 2 )
result = (-(__int64)(v3 < 5) & 0xFFFFFFFFFFFFFFFCLL) + 8;
}
else
{
*(_DWORD *)(a2 + 2028) = -4;
result = 0LL;
}
return result;
}

original_code:
size_t cholmod_l_maxrank
(
    size_t n,
    cholmod_common *Common
)
{
    size_t maxrank ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    maxrank = Common->maxrank ;
    if (n > 0)
    {
 maxrank = (((maxrank) < (((size_t) (-1)) / (n * sizeof (double)))) ? (maxrank) : (((size_t) (-1)) / (n * sizeof (double)))) ;
    }
    if (maxrank <= 2)
    {
 maxrank = 2 ;
    }
    else if (maxrank <= 4)
    {
 maxrank = 4 ;
    }
    else
    {
 maxrank = 8 ;
    }
    return (maxrank) ;
}

canonical_original_code:
unsigned long cholmod_l_maxrank(unsigned long n, struct cholmod_common_struct *Common)
{
    unsigned long maxrank;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    maxrank = Common->maxrank ;
    if (n > 0)
    {
 maxrank = (((maxrank) < (((unsigned long) (-1)) / (n * sizeof (double)))) ? (maxrank) : (((unsigned long) (-1)) / (n * sizeof (double)))) ;
    }
    if (maxrank <= 2)
    {
 maxrank = 2 ;
    }
    else if (maxrank <= 4)
    {
 maxrank = 4 ;
    }
    else
    {
 maxrank = 8 ;
    }
    return (maxrank) ;
}

variable_types:
n
unsigned long

variable_types:
maxrank
unsigned long

return_type: unsigned long


decompiled_code:
double __fastcall cholmod_l_dbound(__int64 a1, double a2)
{
double v2; // rbx

if ( !a1 )
return *(double *)&LC0;
if ( *(_QWORD *)(a1 + 2016) == 2LL )
{
v2 = *(double *)a1;
if ( a2 < 0.0 )
{
*(_QWORD *)&v2 ^= LC11;
if ( a2 <= v2 )
{
v2 = a2;
}
else
{
*(double *)(a1 + 2104) = *(double *)(a1 + 2104) + 1.0;
if ( !*(_DWORD *)(a1 + 2028) )
cholmod_l_error(2LL, "../Core/cholmod_common.c", 683LL, "diagonal below threshold", a1);
}
}
else if ( v2 <= a2 )
{
v2 = a2;
}
else
{
*(double *)(a1 + 2104) = *(double *)(a1 + 2104) + 1.0;
if ( !*(_DWORD *)(a1 + 2028) )
cholmod_l_error(2LL, "../Core/cholmod_common.c", 695LL, "diagonal below threshold", a1);
}
}
else
{
*(_DWORD *)(a1 + 2028) = -4;
v2 = *(double *)&LC0;
}
return v2;
}

canonical_decompiled_code:
double __fastcall func7(__int64 a1, double a2)
{
double v2; // rbx

if ( !a1 )
return *(double *)&LC0;
if ( *(_QWORD *)(a1 + 2016) == 2LL )
{
v2 = *(double *)a1;
if ( a2 < 0.0 )
{
*(_QWORD *)&v2 ^= LC11;
if ( a2 <= v2 )
{
v2 = a2;
}
else
{
*(double *)(a1 + 2104) = *(double *)(a1 + 2104) + 1.0;
if ( !*(_DWORD *)(a1 + 2028) )
cholmod_l_error(2LL, "../Core/cholmod_common.c", 683LL, "diagonal below threshold", a1);
}
}
else if ( v2 <= a2 )
{
v2 = a2;
}
else
{
*(double *)(a1 + 2104) = *(double *)(a1 + 2104) + 1.0;
if ( !*(_DWORD *)(a1 + 2028) )
cholmod_l_error(2LL, "../Core/cholmod_common.c", 695LL, "diagonal below threshold", a1);
}
}
else
{
*(_DWORD *)(a1 + 2028) = -4;
v2 = *(double *)&LC0;
}
return v2;
}

original_code:
double cholmod_l_dbound
(
    double dj,
    cholmod_common *Common
)
{
    double dbound ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    if (!((dj) != (dj)))
    {
 dbound = Common->dbound ;
 if (dj < 0)
 {
     if (dj > -dbound)
     {
  dj = -dbound ;
  Common->ndbounds_hit++ ;
  if (Common->status == 0)
  {
      cholmod_l_error ((2), "../Core/cholmod_common.c", 683, "diagonal below threshold", Common) ;
  }
     }
 }
 else
 {
     if (dj < dbound)
     {
  dj = dbound ;
  Common->ndbounds_hit++ ;
  if (Common->status == 0)
  {
      cholmod_l_error ((2), "../Core/cholmod_common.c", 695, "diagonal below threshold", Common) ;
  }
     }
 }
    }
    return (dj) ;
}

canonical_original_code:
double cholmod_l_dbound(double dj, struct cholmod_common_struct *Common)
{
    double dbound;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    if (!((dj) != (dj)))
    {
 dbound = Common->dbound ;
 if (dj < 0)
 {
     if (dj > -dbound)
     {
  dj = -dbound ;
  Common->ndbounds_hit++ ;
  if (Common->status == 0)
  {
      cholmod_l_error ((2), "../Core/cholmod_common.c", 683, "diagonal below threshold", Common) ;
  }
     }
 }
 else
 {
     if (dj < dbound)
     {
  dj = dbound ;
  Common->ndbounds_hit++ ;
  if (Common->status == 0)
  {
      cholmod_l_error ((2), "../Core/cholmod_common.c", 695, "diagonal below threshold", Common) ;
  }
     }
 }
    }
    return (dj) ;
}

variable_types: dj double

variable_types: dbound double


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

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

variable_types: chain int

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

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

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

variable_types: maxbytes double

variable_types: fsize int

variable_types: maxfrsize int

variable_types: overflow int

variable_types: nb int

variable_types: f int

variable_types: cdeg int

variable_types: col int

variable_types: tpi int

variable_types: e int

variable_types:
E
int *

variable_types:
Cols
int *

variable_types:
tp
struct Tuple { int e; } *

variable_types:
tpend
struct Tuple { int e; } *

variable_types:
ep
struct Element { int cdeg; } *

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


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

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

variable_types: struct NumericType { double flops; 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: s double

variable_types: j int

variable_types: i int

variable_types:
Fcpos
int *

variable_types:
Fcols
int *

variable_types: minsize int

variable_types: newsize int

variable_types: fnrows int

variable_types: fncols int

variable_types: eloc int

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

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

variable_types: nz int

variable_types:
Ti
int []

variable_types:
Tj
int []

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Rp
int []

variable_types:
Rj
int []

variable_types:
W
int []

variable_types:
RowCount
int []

variable_types:
Tx
double []

variable_types:
Ax
double []

variable_types:
Rx
double []

variable_types:
Map
int []

variable_types: k int

variable_types: p int

variable_types: cp int

variable_types: pdest int

variable_types: pj int

variable_types: duplicates int


original_code:
int umfdi_transpose
(
    int n_row,
    int n_col,
    const int Ap [ ],
    const int Ai [ ],
    const double Ax [ ],
    const int P [ ],
    const int Q [ ],
    int nq,
    int Rp [ ],
    int Ri [ ],
    double Rx [ ],
    int W [ ],
    int check
)
{
    int i, j, k, p, bp, newj, do_values ;
    if (check)
    {
 if (!Ai || !Ap || !Ri || !Rp || !W)
 {
     return ((-5)) ;
 }
 if (n_row <= 0 || n_col <= 0)
 {
     return ((-6)) ;
 }
 if (!umf_i_is_permutation (P, W, n_row, n_row) ||
     !umf_i_is_permutation (Q, W, nq, nq))
 {
     return ((-15)) ;
 }
 if (amd_valid (n_row, n_col, Ap, Ai) != 0)
 {
     return ((-8)) ;
 }
    }
    for (i = 0 ; i < n_row ; i++)
    {
 W [i] = 0 ;
 Rp [i] = 0 ;
    }
    if (Q != (int *) ((void *)0))
    {
 for (newj = 0 ; newj < nq ; newj++)
 {
     j = Q [newj] ;
     ;
     for (p = Ap [j] ; p < Ap [j+1] ; p++)
     {
  i = Ai [p] ;
  ;
  W [i]++ ;
     }
 }
    }
    else
    {
 for (j = 0 ; j < n_col ; j++)
 {
     for (p = Ap [j] ; p < Ap [j+1] ; p++)
     {
  i = Ai [p] ;
  ;
  W [i]++ ;
     }
 }
    }
    if (P != (int *) ((void *)0))
    {
 Rp [0] = 0 ;
 for (k = 0 ; k < n_row ; k++)
 {
     i = P [k] ;
     ;
     Rp [k+1] = Rp [k] + W [i] ;
 }
 for (k = 0 ; k < n_row ; k++)
 {
     i = P [k] ;
     ;
     W [i] = Rp [k] ;
 }
    }
    else
    {
 Rp [0] = 0 ;
 for (i = 0 ; i < n_row ; i++)
 {
     Rp [i+1] = Rp [i] + W [i] ;
 }
 for (i = 0 ; i < n_row ; i++)
 {
     W [i] = Rp [i] ;
 }
    }
    ;
    do_values = Ax && Rx ;
    {
 if (Q != (int *) ((void *)0))
 {
     if (do_values)
     {
  {
      for (newj = 0 ; newj < nq ; newj++)
      {
   j = Q [newj] ;
   ;
   for (p = Ap [j] ; p < Ap [j+1] ; p++)
   {
       bp = W [Ai [p]]++ ;
       Ri [bp] = newj ;
       Rx [bp] = Ax [p] ;
   }
      }
  }
     }
     else
     {
  for (newj = 0 ; newj < nq ; newj++)
  {
      j = Q [newj] ;
      ;
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   Ri [W [Ai [p]]++] = newj ;
      }
  }
     }
 }
 else
 {
     if (do_values)
     {
  {
      for (j = 0 ; j < n_col ; j++)
      {
   for (p = Ap [j] ; p < Ap [j+1] ; p++)
   {
       bp = W [Ai [p]]++ ;
       Ri [bp] = j ;
       Rx [bp] = Ax [p] ;
   }
      }
  }
     }
     else
     {
  for (j = 0 ; j < n_col ; j++)
  {
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   Ri [W [Ai [p]]++] = j ;
      }
  }
     }
 }
    }
    return ((0)) ;
}

canonical_original_code:
int umfdi_transpose(int n_row, int n_col, int Ap[], int Ai[], double Ax[], int P[], int Q[], int nq, int Rp[], int Ri[], double Rx[], int W[], int check)
{
    int i; int j; int k; int p; int bp; int newj; int do_values;
    if (check)
    {
 if (!Ai || !Ap || !Ri || !Rp || !W)
 {
     return ((-5)) ;
 }
 if (n_row <= 0 || n_col <= 0)
 {
     return ((-6)) ;
 }
 if (!umf_i_is_permutation (P, W, n_row, n_row) ||
     !umf_i_is_permutation (Q, W, nq, nq))
 {
     return ((-15)) ;
 }
 if (amd_valid (n_row, n_col, Ap, Ai) != 0)
 {
     return ((-8)) ;
 }
    }
    for (i = 0 ; i < n_row ; i++)
    {
 W [i] = 0 ;
 Rp [i] = 0 ;
    }
    if (Q != (int *) ((void *)0))
    {
 for (newj = 0 ; newj < nq ; newj++)
 {
     j = Q [newj] ;
     ;
     for (p = Ap [j] ; p < Ap [j+1] ; p++)
     {
  i = Ai [p] ;
  ;
  W [i]++ ;
     }
 }
    }
    else
    {
 for (j = 0 ; j < n_col ; j++)
 {
     for (p = Ap [j] ; p < Ap [j+1] ; p++)
     {
  i = Ai [p] ;
  ;
  W [i]++ ;
     }
 }
    }
    if (P != (int *) ((void *)0))
    {
 Rp [0] = 0 ;
 for (k = 0 ; k < n_row ; k++)
 {
     i = P [k] ;
     ;
     Rp [k+1] = Rp [k] + W [i] ;
 }
 for (k = 0 ; k < n_row ; k++)
 {
     i = P [k] ;
     ;
     W [i] = Rp [k] ;
 }
    }
    else
    {
 Rp [0] = 0 ;
 for (i = 0 ; i < n_row ; i++)
 {
     Rp [i+1] = Rp [i] + W [i] ;
 }
 for (i = 0 ; i < n_row ; i++)
 {
     W [i] = Rp [i] ;
 }
    }
    ;
    do_values = Ax && Rx ;
    {
 if (Q != (int *) ((void *)0))
 {
     if (do_values)
     {
  {
      for (newj = 0 ; newj < nq ; newj++)
      {
   j = Q [newj] ;
   ;
   for (p = Ap [j] ; p < Ap [j+1] ; p++)
   {
       bp = W [Ai [p]]++ ;
       Ri [bp] = newj ;
       Rx [bp] = Ax [p] ;
   }
      }
  }
     }
     else
     {
  for (newj = 0 ; newj < nq ; newj++)
  {
      j = Q [newj] ;
      ;
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   Ri [W [Ai [p]]++] = newj ;
      }
  }
     }
 }
 else
 {
     if (do_values)
     {
  {
      for (j = 0 ; j < n_col ; j++)
      {
   for (p = Ap [j] ; p < Ap [j+1] ; p++)
   {
       bp = W [Ai [p]]++ ;
       Ri [bp] = j ;
       Rx [bp] = Ax [p] ;
   }
      }
  }
     }
     else
     {
  for (j = 0 ; j < n_col ; j++)
  {
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   Ri [W [Ai [p]]++] = j ;
      }
  }
     }
 }
    }
    return ((0)) ;
}

variable_types:
P
int []

variable_types:
Q
int []

variable_types: nq int

variable_types:
Ri
int []

variable_types: check int

variable_types: i int

variable_types: j int

variable_types: bp int

variable_types: newj int


decompiled_code:
void __fastcall umfpack_tic(double *a1)
{
double v1; // xmm0_8

v1 = SuiteSparse_time();
*a1 = v1;
a1[1] = v1;
}

canonical_decompiled_code:
void __fastcall func0(double *a1)
{
double v1; // xmm0_8

v1 = SuiteSparse_time();
*a1 = v1;
a1[1] = v1;
}

original_code:
void umfpack_tic (double stats [2])
{
    stats [0] = SuiteSparse_time ( ) ;
    stats [1] = stats [0] ;
}

canonical_original_code:
void umfpack_tic(double stats[2])
{
    stats [0] = SuiteSparse_time ( ) ;
    stats [1] = stats [0] ;
}

variable_types:
stats
double [2]

return_type: void


decompiled_code:
void __fastcall umfpack_toc(double *a1)
{
double v1; // xmm0_8

v1 = SuiteSparse_time() - *a1;
*a1 = v1;
a1[1] = v1;
}

canonical_decompiled_code:
void __fastcall func1(double *a1)
{
double v1; // xmm0_8

v1 = SuiteSparse_time() - *a1;
*a1 = v1;
a1[1] = v1;
}

original_code:
void umfpack_toc (double stats [2])
{
    stats [0] = SuiteSparse_time ( ) - stats [0] ;
    stats [1] = stats [0] ;
}

canonical_original_code:
void umfpack_toc(double stats[2])
{
    stats [0] = SuiteSparse_time ( ) - stats [0] ;
    stats [1] = stats [0] ;
}


original_code:
double umfzl_lsolve
(
    NumericType *Numeric,
    DoubleComplex X [ ],
    long Pattern [ ]
)
{
    DoubleComplex xk ;
    DoubleComplex *xp, *Lval ;
    long k, deg, *ip, j, row, *Lpos, *Lilen, *Lip, llen, lp, newLchain,
 pos, npiv, n1, *Li ;
    if (Numeric->n_row != Numeric->n_col) return (0.) ;
    npiv = Numeric->npiv ;
    Lpos = Numeric->Lpos ;
    Lilen = Numeric->Lilen ;
    Lip = Numeric->Lip ;
    n1 = Numeric->n1 ;
    for (k = 0 ; k < n1 ; k++)
    {
 ;
 xk = X [k] ;
 deg = Lilen [k] ;
 if (deg > 0 && ((((xk).component [0]) != 0.) || (((xk).component [1]) != 0.)))
 {
     lp = Lip [k] ;
     Li = (long *) (Numeric->Memory + lp) ;
     lp += (((((sizeof (long) * (deg))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Lval = (DoubleComplex *) (Numeric->Memory + lp) ;
     for (j = 0 ; j < deg ; j++)
     {
  ;
  ;
  ;
  { ; (X [Li [j]]).component [0] -= (xk).component [0] * (Lval [j]).component [0] - (xk).component [1] * (Lval [j]).component [1] ; (X [Li [j]]).component [1] -= (xk).component [1] * (Lval [j]).component [0] + (xk).component [0] * (Lval [j]).component [1] ; } ;
     }
 }
    }
    deg = 0 ;
    for (k = n1 ; k < npiv ; k++)
    {
 lp = Lip [k] ;
 newLchain = (lp < 0) ;
 if (newLchain)
 {
     lp = -lp ;
     deg = 0 ;
     ;
 }
 pos = Lpos [k] ;
 if (pos != (-1))
 {
     ;
     ;
     ;
     ;
     ;
     Pattern [pos] = Pattern [--deg] ;
 }
 ip = (long *) (Numeric->Memory + lp) ;
 llen = Lilen [k] ;
 for (j = 0 ; j < llen ; j++)
 {
     row = *ip++ ;
     ;
     ;
     Pattern [deg++] = row ;
 }
 xk = X [k] ;
 if (((((xk).component [0]) != 0.) || (((xk).component [1]) != 0.)))
 {
     xp = (DoubleComplex *) (Numeric->Memory + lp + (((((sizeof (long) * (llen))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     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++ ;
     }
 }
    }
    return (8. * ((double) Numeric->lnz)) ;
}

canonical_original_code:
double umfzl_lsolve(struct NumericType *Numeric, struct DoubleComplex X[], long Pattern[])
{
    struct DoubleComplex xk;
    struct DoubleComplex *xp; struct DoubleComplex *Lval;
    long k; long deg; long *ip; long j; long row; long *Lpos; long *Lilen; long *Lip; long llen; long lp; long newLchain; long pos; long npiv; long n1; long *Li;
    if (Numeric->n_row != Numeric->n_col) return (0.) ;
    npiv = Numeric->npiv ;
    Lpos = Numeric->Lpos ;
    Lilen = Numeric->Lilen ;
    Lip = Numeric->Lip ;
    n1 = Numeric->n1 ;
    for (k = 0 ; k < n1 ; k++)
    {
 ;
 xk = X [k] ;
 deg = Lilen [k] ;
 if (deg > 0 && ((((xk).component [0]) != 0.) || (((xk).component [1]) != 0.)))
 {
     lp = Lip [k] ;
     Li = (long *) (Numeric->Memory + lp) ;
     lp += (((((sizeof (long) * (deg))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Lval = (struct DoubleComplex *) (Numeric->Memory + lp) ;
     for (j = 0 ; j < deg ; j++)
     {
  ;
  ;
  ;
  { ; (X [Li [j]]).component [0] -= (xk).component [0] * (Lval [j]).component [0] - (xk).component [1] * (Lval [j]).component [1] ; (X [Li [j]]).component [1] -= (xk).component [1] * (Lval [j]).component [0] + (xk).component [0] * (Lval [j]).component [1] ; } ;
     }
 }
    }
    deg = 0 ;
    for (k = n1 ; k < npiv ; k++)
    {
 lp = Lip [k] ;
 newLchain = (lp < 0) ;
 if (newLchain)
 {
     lp = -lp ;
     deg = 0 ;
     ;
 }
 pos = Lpos [k] ;
 if (pos != (-1))
 {
     ;
     ;
     ;
     ;
     ;
     Pattern [pos] = Pattern [--deg] ;
 }
 ip = (long *) (Numeric->Memory + lp) ;
 llen = Lilen [k] ;
 for (j = 0 ; j < llen ; j++)
 {
     row = *ip++ ;
     ;
     ;
     Pattern [deg++] = row ;
 }
 xk = X [k] ;
 if (((((xk).component [0]) != 0.) || (((xk).component [1]) != 0.)))
 {
     xp = (struct DoubleComplex *) (Numeric->Memory + lp + (((((sizeof (long) * (llen))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     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++ ;
     }
 }
    }
    return (8. * ((double) Numeric->lnz)) ;
}

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:
X
struct DoubleComplex []

variable_types:
Pattern
long []

variable_types: k long

variable_types: deg long

variable_types:
ip
long *

variable_types: j long

variable_types: row long

variable_types:
Lpos
long *

variable_types:
Lilen
long *

variable_types:
Lip
long *

variable_types: llen long

variable_types: lp long

variable_types: newLchain long

variable_types: pos long

variable_types: npiv long

variable_types:
Li
long *

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


decompiled_code:
__int64 __fastcall umfpack_zi_transpose(unsigned int a1, unsigned int a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, __int64 a7, __int64 a8, __int64 a9, __int64 a10, __int64 a11, __int64 a12, unsigned int a13)
{
bool v17; // cc
__int64 v18; // rdi
__int64 v19; // rax
__int64 v20; // r12
unsigned int v21; // ebx

v17 = (int)a1 <= 0;
v18 = 1LL;
if ( !v17 )
v18 = a1;
if ( (int)v18 < (int)a2 )
v18 = a2;
v19 = umf_i_malloc(v18, 4LL);
if ( !v19 )
return (unsigned int)-1;
v20 = v19;
v21 = umfzi_transpose(a1, a2, a3, a4, a5, a7, a8, a2, a9, a10, a11, v19, 1LL, a6, a12, a13);
umf_i_free(v20);
return v21;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1, unsigned int a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, __int64 a7, __int64 a8, __int64 a9, __int64 a10, __int64 a11, __int64 a12, unsigned int a13)
{
bool v17; // cc
__int64 v18; // rdi
__int64 v19; // rax
__int64 v20; // r12
unsigned int v21; // ebx

v17 = (int)a1 <= 0;
v18 = 1LL;
if ( !v17 )
v18 = a1;
if ( (int)v18 < (int)a2 )
v18 = a2;
v19 = umf_i_malloc(v18, 4LL);
if ( !v19 )
return (unsigned int)-1;
v20 = v19;
v21 = umfzi_transpose(a1, a2, a3, a4, a5, a7, a8, a2, a9, a10, a11, v19, 1LL, a6, a12, a13);
umf_i_free(v20);
return v21;
}

original_code:
int umfpack_zi_transpose
(
    int n_row,
    int n_col,
    const int Ap [ ],
    const int Ai [ ],
    const double Ax [ ],
    const double Az [ ],
    const int P [ ],
    const int Q [ ],
    int Rp [ ],
    int Ri [ ],
    double Rx [ ]
    , double Rz [ ]
    , int do_conjugate
)
{
    int status, *W, nn ;
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    nn = (((nn) > (1)) ? (nn) : (1)) ;
    W = (int *) umf_i_malloc (nn, sizeof (int)) ;
    if (!W)
    {
 ;
 ;
 return ((-1)) ;
    }
    ;
    status = umfzi_transpose (n_row, n_col, Ap, Ai, Ax, P, Q, n_col, Rp, Ri, Rx,
 W, (1)
 , Az, Rz, do_conjugate
 ) ;
    (void) umf_i_free ((void *) W) ;
    ;
    return (status) ;
}

canonical_original_code:
int umfpack_zi_transpose(int n_row, int n_col, int Ap[], int Ai[], double Ax[], double Az[], int P[], int Q[], int Rp[], int Ri[], double Rx[], double Rz[], int do_conjugate)
{
    int status; int *W; int nn;
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    nn = (((nn) > (1)) ? (nn) : (1)) ;
    W = (int *) umf_i_malloc (nn, sizeof (int)) ;
    if (!W)
    {
 ;
 ;
 return ((-1)) ;
    }
    ;
    status = umfzi_transpose (n_row, n_col, Ap, Ai, Ax, P, Q, n_col, Rp, Ri, Rx,
 W, (1)
 , Az, Rz, do_conjugate
 ) ;
    (void) umf_i_free ((void *) W) ;
    ;
    return (status) ;
}

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Ax
double []

variable_types:
Az
double []

variable_types:
P
int []

variable_types:
Q
int []

variable_types:
Rp
int []

variable_types:
Ri
int []

variable_types:
Rx
double []

variable_types:
Rz
double []

variable_types: status int

variable_types:
W
int *

variable_types: nn int


original_code:
long amd_l_order
(
    long n,
    const long Ap [ ],
    const long Ai [ ],
    long P [ ],
    double Control [ ],
    double Info [ ]
)
{
    long *Len, *S, nz, i, *Pinv, info, status, *Rp, *Ri, *Cp, *Ci, ok ;
    size_t nzaat, slen ;
    double mem = 0 ;
    info = Info != (double *) ((void *)0) ;
    if (info)
    {
 for (i = 0 ; i < 20 ; i++)
 {
     Info [i] = (-1) ;
 }
 Info [1] = n ;
 Info [0] = 0 ;
    }
    if (Ai == (long *) ((void *)0) || Ap == (long *) ((void *)0) || P == (long *) ((void *)0) || n < 0)
    {
 if (info) Info [0] = -2 ;
 return (-2) ;
    }
    if (n == 0)
    {
 return (0) ;
    }
    nz = Ap [n] ;
    if (info)
    {
 Info [2] = nz ;
    }
    if (nz < 0)
    {
 if (info) Info [0] = -2 ;
 return (-2) ;
    }
    if (((size_t) n) >= ((size_t) (-1)) / sizeof (long)
     || ((size_t) nz) >= ((size_t) (-1)) / sizeof (long))
    {
 if (info) Info [0] = -1 ;
 return (-1) ;
    }
    status = amd_l_valid (n, n, Ap, Ai) ;
    if (status == -2)
    {
 if (info) Info [0] = -2 ;
 return (-2) ;
    }
    Len = amd_malloc (n * sizeof (long)) ;
    Pinv = amd_malloc (n * sizeof (long)) ;
    mem += n ;
    mem += n ;
    if (!Len || !Pinv)
    {
 amd_free (Len) ;
 amd_free (Pinv) ;
 if (info) Info [0] = -1 ;
 return (-1) ;
    }
    if (status == 1)
    {
 ;
 Rp = amd_malloc ((n+1) * sizeof (long)) ;
 Ri = amd_malloc ((((nz) > (1)) ? (nz) : (1)) * sizeof (long)) ;
 mem += (n+1) ;
 mem += (((nz) > (1)) ? (nz) : (1)) ;
 if (!Rp || !Ri)
 {
     amd_free (Rp) ;
     amd_free (Ri) ;
     amd_free (Len) ;
     amd_free (Pinv) ;
     if (info) Info [0] = -1 ;
     return (-1) ;
 }
 amd_l_preprocess (n, Ap, Ai, Rp, Ri, Len, Pinv) ;
 Cp = Rp ;
 Ci = Ri ;
    }
    else
    {
 Rp = ((void *)0) ;
 Ri = ((void *)0) ;
 Cp = (long *) Ap ;
 Ci = (long *) Ai ;
    }
    nzaat = amd_l_aat (n, Cp, Ci, Len, P, Info) ;
    ;
    ;
    S = ((void *)0) ;
    slen = nzaat ;
    ok = ((slen + nzaat/5) >= slen) ;
    slen += nzaat/5 ;
    for (i = 0 ; ok && i < 7 ; i++)
    {
 ok = ((slen + n) > slen) ;
 slen += n ;
    }
    mem += slen ;
    ok = ok && (slen < ((size_t) (-1)) / sizeof (long)) ;
    ok = ok && (slen < 0x7fffffffffffffffL) ;
    if (ok)
    {
 S = amd_malloc (slen * sizeof (long)) ;
    }
    ;
    if (!S)
    {
 amd_free (Rp) ;
 amd_free (Ri) ;
 amd_free (Len) ;
 amd_free (Pinv) ;
 if (info) Info [0] = -1 ;
 return (-1) ;
    }
    if (info)
    {
 Info [7] = mem * sizeof (long) ;
    }
    amd_l1 (n, Cp, Ci, P, Pinv, Len, slen, S, Control, Info) ;
    amd_free (Rp) ;
    amd_free (Ri) ;
    amd_free (Len) ;
    amd_free (Pinv) ;
    amd_free (S) ;
    if (info) Info [0] = status ;
    return (status) ;
}

canonical_original_code:
long amd_l_order(long n, long Ap[], long Ai[], long P[], double Control[], double Info[])
{
    long *Len; long *S; long nz; long i; long *Pinv; long info; long status; long *Rp; long *Ri; long *Cp; long *Ci; long ok;
    unsigned long nzaat; unsigned long slen;
    double mem = 0;
    info = Info != (double *) ((void *)0) ;
    if (info)
    {
 for (i = 0 ; i < 20 ; i++)
 {
     Info [i] = (-1) ;
 }
 Info [1] = n ;
 Info [0] = 0 ;
    }
    if (Ai == (long *) ((void *)0) || Ap == (long *) ((void *)0) || P == (long *) ((void *)0) || n < 0)
    {
 if (info) Info [0] = -2 ;
 return (-2) ;
    }
    if (n == 0)
    {
 return (0) ;
    }
    nz = Ap [n] ;
    if (info)
    {
 Info [2] = nz ;
    }
    if (nz < 0)
    {
 if (info) Info [0] = -2 ;
 return (-2) ;
    }
    if (((unsigned long) n) >= ((unsigned long) (-1)) / sizeof (long)
     || ((unsigned long) nz) >= ((unsigned long) (-1)) / sizeof (long))
    {
 if (info) Info [0] = -1 ;
 return (-1) ;
    }
    status = amd_l_valid (n, n, Ap, Ai) ;
    if (status == -2)
    {
 if (info) Info [0] = -2 ;
 return (-2) ;
    }
    Len = amd_malloc (n * sizeof (long)) ;
    Pinv = amd_malloc (n * sizeof (long)) ;
    mem += n ;
    mem += n ;
    if (!Len || !Pinv)
    {
 amd_free (Len) ;
 amd_free (Pinv) ;
 if (info) Info [0] = -1 ;
 return (-1) ;
    }
    if (status == 1)
    {
 ;
 Rp = amd_malloc ((n+1) * sizeof (long)) ;
 Ri = amd_malloc ((((nz) > (1)) ? (nz) : (1)) * sizeof (long)) ;
 mem += (n+1) ;
 mem += (((nz) > (1)) ? (nz) : (1)) ;
 if (!Rp || !Ri)
 {
     amd_free (Rp) ;
     amd_free (Ri) ;
     amd_free (Len) ;
     amd_free (Pinv) ;
     if (info) Info [0] = -1 ;
     return (-1) ;
 }
 amd_l_preprocess (n, Ap, Ai, Rp, Ri, Len, Pinv) ;
 Cp = Rp ;
 Ci = Ri ;
    }
    else
    {
 Rp = ((void *)0) ;
 Ri = ((void *)0) ;
 Cp = (long *) Ap ;
 Ci = (long *) Ai ;
    }
    nzaat = amd_l_aat (n, Cp, Ci, Len, P, Info) ;
    ;
    ;
    S = ((void *)0) ;
    slen = nzaat ;
    ok = ((slen + nzaat/5) >= slen) ;
    slen += nzaat/5 ;
    for (i = 0 ; ok && i < 7 ; i++)
    {
 ok = ((slen + n) > slen) ;
 slen += n ;
    }
    mem += slen ;
    ok = ok && (slen < ((unsigned long) (-1)) / sizeof (long)) ;
    ok = ok && (slen < 0x7fffffffffffffffL) ;
    if (ok)
    {
 S = amd_malloc (slen * sizeof (long)) ;
    }
    ;
    if (!S)
    {
 amd_free (Rp) ;
 amd_free (Ri) ;
 amd_free (Len) ;
 amd_free (Pinv) ;
 if (info) Info [0] = -1 ;
 return (-1) ;
    }
    if (info)
    {
 Info [7] = mem * sizeof (long) ;
    }
    amd_l1 (n, Cp, Ci, P, Pinv, Len, slen, S, Control, Info) ;
    amd_free (Rp) ;
    amd_free (Ri) ;
    amd_free (Len) ;
    amd_free (Pinv) ;
    amd_free (S) ;
    if (info) Info [0] = status ;
    return (status) ;
}

variable_types: n long

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
P
long []

variable_types:
Control
double []

variable_types:
Info
double []

variable_types:
Len
long *

variable_types:
S
long *

variable_types: nz long

variable_types: i long

variable_types:
Pinv
long *

variable_types: info long

variable_types: status long

variable_types:
Rp
long *

variable_types:
Ri
long *

variable_types:
Cp
long *

variable_types:
Ci
long *

variable_types: ok long

variable_types:
nzaat
unsigned long

variable_types:
slen
unsigned long

variable_types: mem double


decompiled_code:
int __fastcall verify_routed_net(__int64 *a1)
{
__int64 v2; // rax
__int64 v3; // rdi
int v4; // edx
_QWORD *v5; // r8
int v6; // ebp
_QWORD *v7; // rsi
_QWORD *v8; // rax
__int64 v9; // rcx
_QWORD *v10; // r12
int v11; // edx
_QWORD *v12; // rax
__int64 v13; // rcx
_QWORD *v14; // rdi
int v15; // ebp
_QWORD *v16; // r13
__int64 v17; // rax
__int64 v18; // r9
int v19; // er10
__int64 v20; // r11
__int64 v21; // r8
int v22; // edi
_QWORD *v23; // r14
const char *v24; // rbp
const char *v25; // rax
_QWORD *v26; // rdx
_QWORD *v27; // rax
_QWORD *v28; // rbx
_QWORD *v30; // [rsp+8h] [rbp-40h]

v2 = *a1;
v3 = a1[1];
v4 = *(_DWORD *)(v2 + 24);
if ( v4 <= 0 )
goto LABEL_11;
v5 = (_QWORD *)a1[3];
v6 = *((_DWORD *)a1 + 8);
v7 = (_QWORD *)v5[v6 - 1];
v8 = *(_QWORD **)(v2 + 16);
v9 = (__int64)&v8[(unsigned int)(v4 - 1) + 1];
v10 = 0LL;
do
{
if ( v7 == (_QWORD *)*v8 )
{
if ( v10 )
_assert_fail("0", "SRC/base/verify.c", 0x39u, "verify_routed_net");
v10 = (_QWORD *)*v8;
}
++v8;
}
while ( v8 != (_QWORD *)v9 );
if ( !v10 )
{
LABEL_11:
LODWORD(v12) = printf("\tError: Could not find source wire segment for net '%d'\n", *((unsigned int *)a1 + 4));
return (int)v12;
}
v11 = *(_DWORD *)(v3 + 24);
if ( v11 <= 0 )
{
v15 = v6 - 2;
v30 = 0LL;
LABEL_20:
v16 = 0LL;
while ( 1 )
{
v17 = find_all_adjacent_segs(v10);
v18 = v17;
v19 = *(_DWORD *)(v17 + 8);
if ( v19 <= 0 )
goto LABEL_39;
v20 = *(_QWORD *)v17;
v21 = 0LL;
v22 = 0;
v23 = 0LL;
do
{
v26 = (_QWORD *)*(unsigned int *)(v20 + 4 * v21);
if ( (int)v26 > 0 )
{
v27 = *(_QWORD **)(*(_QWORD *)(v18 + 16) + 8 * v21);
v7 = &v27[(int)v26 - 1];
while ( 1 )
{
v28 = (_QWORD *)*v27;
if ( *v27 != (_QWORD)v16 && *v27 != (_QWORD)v10 && v28 != v23 && *(_QWORD **)(a1[3] + 8LL * v15) == v28 )
{
if ( v22 )
{
v24 = (const char *)short_wire_name(v23);
v25 = (const char *)short_wire_name(v28);
printf("\n\tError, found multiple adjacent wires '%s' & '%s' with the same associated net\n", v25, v24);
_assert_fail("0", "SRC/base/verify.c", 0x7Du, "verify_routed_net");
}
if ( v15 < 0 )
_assert_fail("associated_wire_index - 1 >= -1", "SRC/base/verify.c", 0x79u, "verify_routed_net");
--v15;
v23 = (_QWORD *)*v27;
v22 = 1;
}
v26 = v27 + 1;
if ( v27 == v7 )
break;
++v27;
}
}
++v21;
}
while ( v21 != v19 );
if ( !v22 )
{
LABEL_39:
printf("\n\tError: could not find next routing segment for net %d\n", *((unsigned int *)a1 + 4));
_assert_fail("0", "SRC/base/verify.c", 0x89u, "verify_routed_net");
}
LODWORD(v12) = free_adjacent_segs(v18, v7, v26);
if ( v30 == v23 )
return (int)v12;
v16 = v10;
v10 = v23;
}
}
v7 = (_QWORD *)*v5;
v12 = *(_QWORD **)(v3 + 16);
v13 = (__int64)&v12[(unsigned int)(v11 - 1) + 1];
v14 = 0LL;
do
{
if ( v7 == (_QWORD *)*v12 )
{
if ( v14 )
_assert_fail("0", "SRC/base/verify.c", 0x4Du, "verify_routed_net");
v14 = (_QWORD *)*v12;
}
++v12;
}
while ( v12 != (_QWORD *)v13 );
v30 = v14;
if ( v10 != v14 )
{
v15 = v6 - 2;
goto LABEL_20;
}
return (int)v12;
}

canonical_decompiled_code:
int __fastcall func0(__int64 *a1)
{
__int64 v2; // rax
__int64 v3; // rdi
int v4; // edx
_QWORD *v5; // r8
int v6; // ebp
_QWORD *v7; // rsi
_QWORD *v8; // rax
__int64 v9; // rcx
_QWORD *v10; // r12
int v11; // edx
_QWORD *v12; // rax
__int64 v13; // rcx
_QWORD *v14; // rdi
int v15; // ebp
_QWORD *v16; // r13
__int64 v17; // rax
__int64 v18; // r9
int v19; // er10
__int64 v20; // r11
__int64 v21; // r8
int v22; // edi
_QWORD *v23; // r14
const char *v24; // rbp
const char *v25; // rax
_QWORD *v26; // rdx
_QWORD *v27; // rax
_QWORD *v28; // rbx
_QWORD *v30; // [rsp+8h] [rbp-40h]

v2 = *a1;
v3 = a1[1];
v4 = *(_DWORD *)(v2 + 24);
if ( v4 <= 0 )
goto LABEL_11;
v5 = (_QWORD *)a1[3];
v6 = *((_DWORD *)a1 + 8);
v7 = (_QWORD *)v5[v6 - 1];
v8 = *(_QWORD **)(v2 + 16);
v9 = (__int64)&v8[(unsigned int)(v4 - 1) + 1];
v10 = 0LL;
do
{
if ( v7 == (_QWORD *)*v8 )
{
if ( v10 )
_assert_fail("0", "SRC/base/verify.c", 0x39u, "verify_routed_net");
v10 = (_QWORD *)*v8;
}
++v8;
}
while ( v8 != (_QWORD *)v9 );
if ( !v10 )
{
LABEL_11:
LODWORD(v12) = printf("\tError: Could not find source wire segment for net '%d'\n", *((unsigned int *)a1 + 4));
return (int)v12;
}
v11 = *(_DWORD *)(v3 + 24);
if ( v11 <= 0 )
{
v15 = v6 - 2;
v30 = 0LL;
LABEL_20:
v16 = 0LL;
while ( 1 )
{
v17 = find_all_adjacent_segs(v10);
v18 = v17;
v19 = *(_DWORD *)(v17 + 8);
if ( v19 <= 0 )
goto LABEL_39;
v20 = *(_QWORD *)v17;
v21 = 0LL;
v22 = 0;
v23 = 0LL;
do
{
v26 = (_QWORD *)*(unsigned int *)(v20 + 4 * v21);
if ( (int)v26 > 0 )
{
v27 = *(_QWORD **)(*(_QWORD *)(v18 + 16) + 8 * v21);
v7 = &v27[(int)v26 - 1];
while ( 1 )
{
v28 = (_QWORD *)*v27;
if ( *v27 != (_QWORD)v16 && *v27 != (_QWORD)v10 && v28 != v23 && *(_QWORD **)(a1[3] + 8LL * v15) == v28 )
{
if ( v22 )
{
v24 = (const char *)short_wire_name(v23);
v25 = (const char *)short_wire_name(v28);
printf("\n\tError, found multiple adjacent wires '%s' & '%s' with the same associated net\n", v25, v24);
_assert_fail("0", "SRC/base/verify.c", 0x7Du, "verify_routed_net");
}
if ( v15 < 0 )
_assert_fail("associated_wire_index - 1 >= -1", "SRC/base/verify.c", 0x79u, "verify_routed_net");
--v15;
v23 = (_QWORD *)*v27;
v22 = 1;
}
v26 = v27 + 1;
if ( v27 == v7 )
break;
++v27;
}
}
++v21;
}
while ( v21 != v19 );
if ( !v22 )
{
LABEL_39:
printf("\n\tError: could not find next routing segment for net %d\n", *((unsigned int *)a1 + 4));
_assert_fail("0", "SRC/base/verify.c", 0x89u, "verify_routed_net");
}
LODWORD(v12) = free_adjacent_segs(v18, v7, v26);
if ( v30 == v23 )
return (int)v12;
v16 = v10;
v10 = v23;
}
}
v7 = (_QWORD *)*v5;
v12 = *(_QWORD **)(v3 + 16);
v13 = (__int64)&v12[(unsigned int)(v11 - 1) + 1];
v14 = 0LL;
do
{
if ( v7 == (_QWORD *)*v12 )
{
if ( v14 )
_assert_fail("0", "SRC/base/verify.c", 0x4Du, "verify_routed_net");
v14 = (_QWORD *)*v12;
}
++v12;
}
while ( v12 != (_QWORD *)v13 );
v30 = v14;
if ( v10 != v14 )
{
v15 = v6 - 2;
goto LABEL_20;
}
return (int)v12;
}

original_code:
void verify_routed_net(t_net* net) {
    t_pin* source_pin = net->source_pin;
    t_pin* sink_pin = net->sink_pin;
    t_wire* source_wire = ((void *)0);
    t_wire* sink_wire = ((void *)0);
    int source_net_index;
    for(source_net_index = 0; source_net_index < source_pin->num_adjacent_wires; source_net_index++) {
        t_wire* tmp_wire = source_pin->array_of_adjacent_wires[source_net_index];
        if(tmp_wire == net->associated_wires[net->num_associated_wires - 1]) {
            if(source_wire == ((void *)0)) {
                source_wire = tmp_wire;
            } else {
                ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "SRC/base/verify.c", 57, __extension__ __PRETTY_FUNCTION__); }));
            }
        }
    }
    if (source_wire == ((void *)0)) {
        printf("\tError: Could not find source wire segment for net '%d'\n", net->net_num);
        return;
    }
    int sink_net_index;
    for(sink_net_index = 0; sink_net_index < sink_pin->num_adjacent_wires; sink_net_index++) {
        t_wire* tmp_wire = sink_pin->array_of_adjacent_wires[sink_net_index];
        if(tmp_wire == net->associated_wires[0]) {
            if(sink_wire == ((void *)0)) {
                sink_wire = tmp_wire;
            } else {
                ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "SRC/base/verify.c", 77, __extension__ __PRETTY_FUNCTION__); }));
            }
        }
    }
    if (source_wire == ((void *)0)) {
        printf("\tError: Could not find sink wire segment for net '%d'\n", net->net_num);
        return;
    }
    int associated_wire_index = net->num_associated_wires - 2;
    t_wire* prev_seg = ((void *)0);
    t_wire* current_seg = source_wire;
    t_wire* next_seg = ((void *)0);
    while(current_seg != sink_wire) {
        t_boolean found_next_seg = FALSE;
        t_adjacent_segs* adjacent_segs = find_all_adjacent_segs(current_seg);
        int sb_index;
        int adjacent_wire_cnt;
        for(sb_index = 0; sb_index < adjacent_segs->num_sb; sb_index++) {
            for(adjacent_wire_cnt = 0; adjacent_wire_cnt < adjacent_segs->num_segs[sb_index]; adjacent_wire_cnt++) {
                t_wire* tmp_seg = adjacent_segs->array_of_segs[sb_index][adjacent_wire_cnt];
                if(tmp_seg == prev_seg) {
                    continue;
                }
                if(tmp_seg == current_seg) {
                    continue;
                }
                if(tmp_seg == next_seg) {
                    continue;
                }
                if(tmp_seg == net->associated_wires[associated_wire_index]) {
                    if(found_next_seg == FALSE) {
                        next_seg = tmp_seg;
                        found_next_seg = TRUE;
                        ((void) sizeof ((associated_wire_index - 1 >= -1) ? 1 : 0), __extension__ ({ if (associated_wire_index - 1 >= -1) ; else __assert_fail ("associated_wire_index - 1 >= -1", "SRC/base/verify.c", 121, __extension__ __PRETTY_FUNCTION__); }));
                        associated_wire_index--;
                    } else {
                        printf("\n\tError, found multiple adjacent wires '%s' & '%s' with the same associated net\n", short_wire_name(tmp_seg), short_wire_name(next_seg));
                        ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "SRC/base/verify.c", 125, __extension__ __PRETTY_FUNCTION__); }));
                    }
                }
            }
        }
        if(found_next_seg) {
            prev_seg = current_seg;
            current_seg = next_seg;
            next_seg = ((void *)0);
        } else {
            printf("\n\tError: could not find next routing segment for net %d\n", net->net_num);
            ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "SRC/base/verify.c", 137, __extension__ __PRETTY_FUNCTION__); }));
        }
        free_adjacent_segs(adjacent_segs);
    }
}

canonical_original_code:
void verify_routed_net(struct s_net *net) {
    struct s_pin *source_pin = net->source_pin;
    struct s_pin *sink_pin = net->sink_pin;
    struct s_wire *source_wire = ((void *)0);
    struct s_wire *sink_wire = ((void *)0);
    int source_net_index;
    for(source_net_index = 0; source_net_index < source_pin->num_adjacent_wires; source_net_index++) {
        struct s_wire *tmp_wire = source_pin->array_of_adjacent_wires[source_net_index];
        if(tmp_wire == net->associated_wires[net->num_associated_wires - 1]) {
            if(source_wire == ((void *)0)) {
                source_wire = tmp_wire;
            } else {
                ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "SRC/base/verify.c", 57, __extension__ __PRETTY_FUNCTION__); }));
            }
        }
    }
    if (source_wire == ((void *)0)) {
        printf("\tError: Could not find source wire segment for net '%d'\n", net->net_num);
        return;
    }
    int sink_net_index;
    for(sink_net_index = 0; sink_net_index < sink_pin->num_adjacent_wires; sink_net_index++) {
        struct s_wire *tmp_wire = sink_pin->array_of_adjacent_wires[sink_net_index];
        if(tmp_wire == net->associated_wires[0]) {
            if(sink_wire == ((void *)0)) {
                sink_wire = tmp_wire;
            } else {
                ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "SRC/base/verify.c", 77, __extension__ __PRETTY_FUNCTION__); }));
            }
        }
    }
    if (source_wire == ((void *)0)) {
        printf("\tError: Could not find sink wire segment for net '%d'\n", net->net_num);
        return;
    }
    int associated_wire_index = net->num_associated_wires - 2;
    struct s_wire *prev_seg = ((void *)0);
    struct s_wire *current_seg = source_wire;
    struct s_wire *next_seg = ((void *)0);
    while(current_seg != sink_wire) {
        enum e_boolean found_next_seg = FALSE;
        struct s_adjacent_segs *adjacent_segs = find_all_adjacent_segs(current_seg);
        int sb_index;
        int adjacent_wire_cnt;
        for(sb_index = 0; sb_index < adjacent_segs->num_sb; sb_index++) {
            for(adjacent_wire_cnt = 0; adjacent_wire_cnt < adjacent_segs->num_segs[sb_index]; adjacent_wire_cnt++) {
                struct s_wire *tmp_seg = adjacent_segs->array_of_segs[sb_index][adjacent_wire_cnt];
                if(tmp_seg == prev_seg) {
                    continue;
                }
                if(tmp_seg == current_seg) {
                    continue;
                }
                if(tmp_seg == next_seg) {
                    continue;
                }
                if(tmp_seg == net->associated_wires[associated_wire_index]) {
                    if(found_next_seg == FALSE) {
                        next_seg = tmp_seg;
                        found_next_seg = TRUE;
                        ((void) sizeof ((associated_wire_index - 1 >= -1) ? 1 : 0), __extension__ ({ if (associated_wire_index - 1 >= -1) ; else __assert_fail ("associated_wire_index - 1 >= -1", "SRC/base/verify.c", 121, __extension__ __PRETTY_FUNCTION__); }));
                        associated_wire_index--;
                    } else {
                        printf("\n\tError, found multiple adjacent wires '%s' & '%s' with the same associated net\n", short_wire_name(tmp_seg), short_wire_name(next_seg));
                        ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "SRC/base/verify.c", 125, __extension__ __PRETTY_FUNCTION__); }));
                    }
                }
            }
        }
        if(found_next_seg) {
            prev_seg = current_seg;
            current_seg = next_seg;
            next_seg = ((void *)0);
        } else {
            printf("\n\tError: could not find next routing segment for net %d\n", net->net_num);
            ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "SRC/base/verify.c", 137, __extension__ __PRETTY_FUNCTION__); }));
        }
        free_adjacent_segs(adjacent_segs);
    }
}

variable_types: struct s_net { struct s_pin { struct s_block { int x_coord; int y_coord; struct s_pin **array_of_pins; int num_pins; } *block; int pin_num; struct s_wire { int channel_x_coord; int channel_y_coord; struct s_switchblock { int x_coord; int y_coord; struct s_wire ***adjacency_list; int *num_adjacencies; int *occupancy_list; } **array_of_adjacent_switchblocks; int num_switchblocks; struct s_pin **array_of_adjacent_pins; int num_adjacent_pins; int channel_pair_num; struct s_wire *reservoir_wire; int wire_num; double occupancy; double present_cost; double history_cost; enum e_ROUTING_LABEL { NONE=-1, TARGET=0, SOURCE=1, USED=2, CURRENT_EXPANSION=3 } label_type; double label_value; int counted; } **array_of_adjacent_wires; int num_adjacent_wires; struct s_net *associated_net; } *source_pin; struct s_pin *sink_pin; int net_num; struct s_wire **associated_wires; int num_associated_wires; } *

variable_types: struct s_pin { struct s_block { int x_coord; int y_coord; struct s_pin **array_of_pins; int num_pins; } *block; int pin_num; struct s_wire { int channel_x_coord; int channel_y_coord; struct s_switchblock { int x_coord; int y_coord; struct s_wire ***adjacency_list; int *num_adjacencies; int *occupancy_list; } **array_of_adjacent_switchblocks; int num_switchblocks; struct s_pin **array_of_adjacent_pins; int num_adjacent_pins; int channel_pair_num; struct s_wire *reservoir_wire; int wire_num; double occupancy; double present_cost; double history_cost; enum e_ROUTING_LABEL { NONE=-1, TARGET=0, SOURCE=1, USED=2, CURRENT_EXPANSION=3 } label_type; double label_value; int counted; } **array_of_adjacent_wires; int num_adjacent_wires; struct s_net { struct s_pin *source_pin; struct s_pin *sink_pin; int net_num; struct s_wire **associated_wires; int num_associated_wires; } *associated_net; } *

variable_types: struct s_adjacent_segs { int *num_segs; int num_sb; struct s_wire { int channel_x_coord; int channel_y_coord; struct s_switchblock { int x_coord; int y_coord; struct s_wire ***adjacency_list; int *num_adjacencies; int *occupancy_list; } **array_of_adjacent_switchblocks; int num_switchblocks; struct s_pin { struct s_block { int x_coord; int y_coord; struct s_pin **array_of_pins; int num_pins; } *block; int pin_num; struct s_wire **array_of_adjacent_wires; int num_adjacent_wires; struct s_net { struct s_pin *source_pin; struct s_pin *sink_pin; int net_num; struct s_wire **associated_wires; int num_associated_wires; } *associated_net; } **array_of_adjacent_pins; int num_adjacent_pins; int channel_pair_num; struct s_wire *reservoir_wire; int wire_num; double occupancy; double present_cost; double history_cost; enum e_ROUTING_LABEL { NONE=-1, TARGET=0, SOURCE=1, USED=2, CURRENT_EXPANSION=3 } label_type; double label_value; int counted; } ***array_of_segs; } *

user_defined_types: struct s_pin { struct s_block *block; int pin_num; struct s_wire **array_of_adjacent_wires; int num_adjacent_wires; struct s_net *associated_net; }

user_defined_types: struct s_wire { int channel_x_coord; int channel_y_coord; struct s_switchblock **array_of_adjacent_switchblocks; int num_switchblocks; struct s_pin **array_of_adjacent_pins; int num_adjacent_pins; int channel_pair_num; struct s_wire *reservoir_wire; int wire_num; double occupancy; double present_cost; double history_cost; enum e_ROUTING_LABEL label_type; double label_value; int counted; }

user_defined_types: struct s_adjacent_segs { int *num_segs; int num_sb; struct s_wire ***array_of_segs; }