original_code:
cholmod_sparse *cholmod_l_ssmult
(
    cholmod_sparse *A,
    cholmod_sparse *B,
    int stype,
    int values,
    int sorted,
    cholmod_common *Common
)
{
    double bjt ;
    double *Ax, *Bx, *Cx, *W ;
    long *Ap, *Anz, *Ai, *Bp, *Bnz, *Bi, *Cp, *Ci, *Flag ;
    cholmod_sparse *C, *A2, *B2, *A3, *B3, *C2 ;
    long apacked, bpacked, j, i, pa, paend, pb, pbend, ncol, mark, cnz, t, p,
 nrow, anz, bnz, do_swap_and_transpose, n1, n2 ;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_ssmult.c", 71, "argument missing", Common) ; } return (((void *)0)) ; } } ;
    { if ((B) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_ssmult.c", 72, "argument missing", Common) ; } return (((void *)0)) ; } } ;
    values = values &&
 (A->xtype != 0) && (B->xtype != 0) ;
    { if ((A)->xtype < (0) || (A)->xtype > (values ? 1 : 3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_ssmult.c", 75, "invalid xtype", Common) ; } return (((void *)0)) ; } } ;
    { if ((B)->xtype < (0) || (B)->xtype > (values ? 1 : 3) || ((B)->xtype != 0 && ((B)->x) == ((void *)0)) || ((B)->xtype == 3 && ((B)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_ssmult.c", 77, "invalid xtype", Common) ; } return (((void *)0)) ; } } ;
    if (A->ncol != B->nrow)
    {
 cholmod_l_error ((-4), "../MatrixOps/cholmod_ssmult.c", 82, "A and B inner dimensions must match", Common) ;
 return (((void *)0)) ;
    }
    Common->status = 0 ;
    if (A->nrow <= 1)
    {
 sorted = 0 ;
    }
    if (sorted)
    {
 n1 = (((A->nrow) > (B->ncol)) ? (A->nrow) : (B->ncol)) ;
    }
    else
    {
 n1 = A->nrow ;
    }
    n2 = (((A->ncol) > (A->nrow)) ? ((((A->ncol) > (B->nrow)) ? ((((A->ncol) > (B->ncol)) ? (A->ncol) : (B->ncol))) : ((((B->nrow) > (B->ncol)) ? (B->nrow) : (B->ncol))))) : ((((A->nrow) > (B->nrow)) ? ((((A->nrow) > (B->ncol)) ? (A->nrow) : (B->ncol))) : ((((B->nrow) > (B->ncol)) ? (B->nrow) : (B->ncol)))))) ;
    cholmod_l_allocate_work (n1, n2, values ? n1 : 0, Common) ;
    if (Common->status < 0)
    {
 return (((void *)0)) ;
    }
    ;
    A2 = ((void *)0) ;
    B2 = ((void *)0) ;
    if (A->stype)
    {
 A2 = cholmod_l_copy (A, 0, values, Common) ;
 if (Common->status < 0)
 {
     ;
     return (((void *)0)) ;
 }
 A = A2 ;
    }
    if (B->stype)
    {
 B2 = cholmod_l_copy (B, 0, values, Common) ;
 if (Common->status < 0)
 {
     cholmod_l_free_sparse (&A2, Common) ;
     ;
     return (((void *)0)) ;
 }
 B = B2 ;
    }
    ;
    ;
    Ap = A->p ;
    Anz = A->nz ;
    Ai = A->i ;
    Ax = A->x ;
    apacked = A->packed ;
    Bp = B->p ;
    Bnz = B->nz ;
    Bi = B->i ;
    Bx = B->x ;
    bpacked = B->packed ;
    nrow = A->nrow ;
    ncol = B->ncol ;
    W = Common->Xwork ;
    Flag = Common->Flag ;
    cnz = 0 ;
    for (j = 0 ; j < ncol ; j++)
    {
 { Common->mark++ ; if (Common->mark <= 0) { Common->mark = (-1) ; cholmod_l_clear_flag (Common) ; } } ;
 mark = Common->mark ;
 pb = Bp [j] ;
 pbend = (bpacked) ? (Bp [j+1]) : (pb + Bnz [j]) ;
 for ( ; pb < pbend ; pb++)
 {
     t = Bi [pb] ;
     pa = Ap [t] ;
     paend = (apacked) ? (Ap [t+1]) : (pa + Anz [t]) ;
     for ( ; pa < paend ; pa++)
     {
  i = Ai [pa] ;
  if (Flag [i] != mark)
  {
      Flag [i] = mark ;
      cnz++ ;
  }
     }
 }
 if (cnz < 0)
 {
     break ;
 }
    }
    { Common->mark++ ; if (Common->mark <= 0) { Common->mark = (-1) ; cholmod_l_clear_flag (Common) ; } } ;
    mark = Common->mark ;
    if (cnz < 0)
    {
 cholmod_l_error ((-3), "../MatrixOps/cholmod_ssmult.c", 224, "problem too large", Common) ;
 cholmod_l_free_sparse (&A2, Common) ;
 cholmod_l_free_sparse (&B2, Common) ;
 ;
 return (((void *)0)) ;
    }
    do_swap_and_transpose = 0 ;
    if (sorted)
    {
 anz = cholmod_l_nnz (A, Common) ;
 bnz = cholmod_l_nnz (B, Common) ;
 do_swap_and_transpose = (anz + bnz < cnz) ;
 if (do_swap_and_transpose)
 {
     A3 = cholmod_l_ptranspose (A, values, ((void *)0), ((void *)0), 0, Common) ;
     cholmod_l_free_sparse (&A2, Common) ;
     A2 = A3 ;
     if (Common->status < 0)
     {
  cholmod_l_free_sparse (&A2, Common) ;
  cholmod_l_free_sparse (&B2, Common) ;
  ;
  return (((void *)0)) ;
     }
     B3 = cholmod_l_ptranspose (B, values, ((void *)0), ((void *)0), 0, Common) ;
     cholmod_l_free_sparse (&B2, Common) ;
     B2 = B3 ;
     if (Common->status < 0)
     {
  cholmod_l_free_sparse (&A2, Common) ;
  cholmod_l_free_sparse (&B2, Common) ;
  ;
  return (((void *)0)) ;
     }
     A = B2 ;
     B = A2 ;
     Ap = A->p ;
     Anz = A->nz ;
     Ai = A->i ;
     Ax = A->x ;
     apacked = A->packed ;
     Bp = B->p ;
     Bnz = B->nz ;
     Bi = B->i ;
     Bx = B->x ;
     bpacked = B->packed ;
     nrow = A->nrow ;
     ncol = B->ncol ;
 }
    }
    C = cholmod_l_allocate_sparse (nrow, ncol, cnz, 0, 1, 0,
     values ? A->xtype : 0, Common) ;
    if (Common->status < 0)
    {
 cholmod_l_free_sparse (&A2, Common) ;
 cholmod_l_free_sparse (&B2, Common) ;
 ;
 return (((void *)0)) ;
    }
    Cp = C->p ;
    Ci = C->i ;
    Cx = C->x ;
    cnz = 0 ;
    if (values)
    {
 for (j = 0 ; j < ncol ; j++)
 {
     { Common->mark++ ; if (Common->mark <= 0) { Common->mark = (-1) ; cholmod_l_clear_flag (Common) ; } } ;
     mark = Common->mark ;
     Cp [j] = cnz ;
     pb = Bp [j] ;
     pbend = (bpacked) ? (Bp [j+1]) : (pb + Bnz [j]) ;
     for ( ; pb < pbend ; pb++)
     {
  t = Bi [pb] ;
  bjt = Bx [pb] ;
  pa = Ap [t] ;
  paend = (apacked) ? (Ap [t+1]) : (pa + Anz [t]) ;
  for ( ; pa < paend ; pa++)
  {
      i = Ai [pa] ;
      if (Flag [i] != mark)
      {
   Flag [i] = mark ;
   Ci [cnz++] = i ;
      }
      W [i] += Ax [pa] * bjt ;
  }
     }
     for (p = Cp [j] ; p < cnz ; p++)
     {
  i = Ci [p] ;
  Cx [p] = W [i] ;
  W [i] = 0 ;
     }
 }
    }
    else
    {
 for (j = 0 ; j < ncol ; j++)
 {
     { Common->mark++ ; if (Common->mark <= 0) { Common->mark = (-1) ; cholmod_l_clear_flag (Common) ; } } ;
     mark = Common->mark ;
     Cp [j] = cnz ;
     pb = Bp [j] ;
     pbend = (bpacked) ? (Bp [j+1]) : (pb + Bnz [j]) ;
     for ( ; pb < pbend ; pb++)
     {
  t = Bi [pb] ;
  pa = Ap [t] ;
  paend = (apacked) ? (Ap [t+1]) : (pa + Anz [t]) ;
  for ( ; pa < paend ; pa++)
  {
      i = Ai [pa] ;
      if (Flag [i] != mark)
      {
   Flag [i] = mark ;
   Ci [cnz++] = i ;
      }
  }
     }
 }
    }
    Cp [ncol] = cnz ;
    ;
    cholmod_l_free_sparse (&A2, Common) ;
    cholmod_l_free_sparse (&B2, Common) ;
    { Common->mark++ ; if (Common->mark <= 0) { Common->mark = (-1) ; cholmod_l_clear_flag (Common) ; } } ;
    ;
    if (stype > 0)
    {
 (void) cholmod_l_band_inplace (0, ncol, values, C, Common) ;
 C->stype = 1 ;
    }
    else if (stype < 0)
    {
 (void) cholmod_l_band_inplace (-nrow, 0, values, C, Common) ;
 C->stype = -1 ;
    }
    ;
    if (sorted)
    {
 if (do_swap_and_transpose)
 {
     C2 = cholmod_l_ptranspose (C, values, ((void *)0), ((void *)0), 0, Common) ;
     cholmod_l_free_sparse (&C, Common) ;
     if (Common->status < 0)
     {
  ;
  return (((void *)0)) ;
     }
     C = C2 ;
 }
 else
 {
     if (!cholmod_l_sort (C, Common))
     {
  cholmod_l_free_sparse (&C, Common) ;
  ;
  return (((void *)0)) ;
     }
 }
    }
    ;
    ;
    return (C) ;
}

canonical_original_code:
struct cholmod_sparse_struct *cholmod_l_ssmult(struct cholmod_sparse_struct *A, struct cholmod_sparse_struct *B, int stype, int values, int sorted, struct cholmod_common_struct *Common)
{
    double bjt;
    double *Ax; double *Bx; double *Cx; double *W;
    long *Ap; long *Anz; long *Ai; long *Bp; long *Bnz; long *Bi; long *Cp; long *Ci; long *Flag;
    struct cholmod_sparse_struct *C; struct cholmod_sparse_struct *A2; struct cholmod_sparse_struct *B2; struct cholmod_sparse_struct *A3; struct cholmod_sparse_struct *B3; struct cholmod_sparse_struct *C2;
    long apacked; long bpacked; long j; long i; long pa; long paend; long pb; long pbend; long ncol; long mark; long cnz; long t; long p; long nrow; long anz; long bnz; long do_swap_and_transpose; long n1; long n2;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_ssmult.c", 71, "argument missing", Common) ; } return (((void *)0)) ; } } ;
    { if ((B) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_ssmult.c", 72, "argument missing", Common) ; } return (((void *)0)) ; } } ;
    values = values &&
 (A->xtype != 0) && (B->xtype != 0) ;
    { if ((A)->xtype < (0) || (A)->xtype > (values ? 1 : 3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_ssmult.c", 75, "invalid xtype", Common) ; } return (((void *)0)) ; } } ;
    { if ((B)->xtype < (0) || (B)->xtype > (values ? 1 : 3) || ((B)->xtype != 0 && ((B)->x) == ((void *)0)) || ((B)->xtype == 3 && ((B)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_ssmult.c", 77, "invalid xtype", Common) ; } return (((void *)0)) ; } } ;
    if (A->ncol != B->nrow)
    {
 cholmod_l_error ((-4), "../MatrixOps/cholmod_ssmult.c", 82, "A and B inner dimensions must match", Common) ;
 return (((void *)0)) ;
    }
    Common->status = 0 ;
    if (A->nrow <= 1)
    {
 sorted = 0 ;
    }
    if (sorted)
    {
 n1 = (((A->nrow) > (B->ncol)) ? (A->nrow) : (B->ncol)) ;
    }
    else
    {
 n1 = A->nrow ;
    }
    n2 = (((A->ncol) > (A->nrow)) ? ((((A->ncol) > (B->nrow)) ? ((((A->ncol) > (B->ncol)) ? (A->ncol) : (B->ncol))) : ((((B->nrow) > (B->ncol)) ? (B->nrow) : (B->ncol))))) : ((((A->nrow) > (B->nrow)) ? ((((A->nrow) > (B->ncol)) ? (A->nrow) : (B->ncol))) : ((((B->nrow) > (B->ncol)) ? (B->nrow) : (B->ncol)))))) ;
    cholmod_l_allocate_work (n1, n2, values ? n1 : 0, Common) ;
    if (Common->status < 0)
    {
 return (((void *)0)) ;
    }
    ;
    A2 = ((void *)0) ;
    B2 = ((void *)0) ;
    if (A->stype)
    {
 A2 = cholmod_l_copy (A, 0, values, Common) ;
 if (Common->status < 0)
 {
     ;
     return (((void *)0)) ;
 }
 A = A2 ;
    }
    if (B->stype)
    {
 B2 = cholmod_l_copy (B, 0, values, Common) ;
 if (Common->status < 0)
 {
     cholmod_l_free_sparse (&A2, Common) ;
     ;
     return (((void *)0)) ;
 }
 B = B2 ;
    }
    ;
    ;
    Ap = A->p ;
    Anz = A->nz ;
    Ai = A->i ;
    Ax = A->x ;
    apacked = A->packed ;
    Bp = B->p ;
    Bnz = B->nz ;
    Bi = B->i ;
    Bx = B->x ;
    bpacked = B->packed ;
    nrow = A->nrow ;
    ncol = B->ncol ;
    W = Common->Xwork ;
    Flag = Common->Flag ;
    cnz = 0 ;
    for (j = 0 ; j < ncol ; j++)
    {
 { Common->mark++ ; if (Common->mark <= 0) { Common->mark = (-1) ; cholmod_l_clear_flag (Common) ; } } ;
 mark = Common->mark ;
 pb = Bp [j] ;
 pbend = (bpacked) ? (Bp [j+1]) : (pb + Bnz [j]) ;
 for ( ; pb < pbend ; pb++)
 {
     t = Bi [pb] ;
     pa = Ap [t] ;
     paend = (apacked) ? (Ap [t+1]) : (pa + Anz [t]) ;
     for ( ; pa < paend ; pa++)
     {
  i = Ai [pa] ;
  if (Flag [i] != mark)
  {
      Flag [i] = mark ;
      cnz++ ;
  }
     }
 }
 if (cnz < 0)
 {
     break ;
 }
    }
    { Common->mark++ ; if (Common->mark <= 0) { Common->mark = (-1) ; cholmod_l_clear_flag (Common) ; } } ;
    mark = Common->mark ;
    if (cnz < 0)
    {
 cholmod_l_error ((-3), "../MatrixOps/cholmod_ssmult.c", 224, "problem too large", Common) ;
 cholmod_l_free_sparse (&A2, Common) ;
 cholmod_l_free_sparse (&B2, Common) ;
 ;
 return (((void *)0)) ;
    }
    do_swap_and_transpose = 0 ;
    if (sorted)
    {
 anz = cholmod_l_nnz (A, Common) ;
 bnz = cholmod_l_nnz (B, Common) ;
 do_swap_and_transpose = (anz + bnz < cnz) ;
 if (do_swap_and_transpose)
 {
     A3 = cholmod_l_ptranspose (A, values, ((void *)0), ((void *)0), 0, Common) ;
     cholmod_l_free_sparse (&A2, Common) ;
     A2 = A3 ;
     if (Common->status < 0)
     {
  cholmod_l_free_sparse (&A2, Common) ;
  cholmod_l_free_sparse (&B2, Common) ;
  ;
  return (((void *)0)) ;
     }
     B3 = cholmod_l_ptranspose (B, values, ((void *)0), ((void *)0), 0, Common) ;
     cholmod_l_free_sparse (&B2, Common) ;
     B2 = B3 ;
     if (Common->status < 0)
     {
  cholmod_l_free_sparse (&A2, Common) ;
  cholmod_l_free_sparse (&B2, Common) ;
  ;
  return (((void *)0)) ;
     }
     A = B2 ;
     B = A2 ;
     Ap = A->p ;
     Anz = A->nz ;
     Ai = A->i ;
     Ax = A->x ;
     apacked = A->packed ;
     Bp = B->p ;
     Bnz = B->nz ;
     Bi = B->i ;
     Bx = B->x ;
     bpacked = B->packed ;
     nrow = A->nrow ;
     ncol = B->ncol ;
 }
    }
    C = cholmod_l_allocate_sparse (nrow, ncol, cnz, 0, 1, 0,
     values ? A->xtype : 0, Common) ;
    if (Common->status < 0)
    {
 cholmod_l_free_sparse (&A2, Common) ;
 cholmod_l_free_sparse (&B2, Common) ;
 ;
 return (((void *)0)) ;
    }
    Cp = C->p ;
    Ci = C->i ;
    Cx = C->x ;
    cnz = 0 ;
    if (values)
    {
 for (j = 0 ; j < ncol ; j++)
 {
     { Common->mark++ ; if (Common->mark <= 0) { Common->mark = (-1) ; cholmod_l_clear_flag (Common) ; } } ;
     mark = Common->mark ;
     Cp [j] = cnz ;
     pb = Bp [j] ;
     pbend = (bpacked) ? (Bp [j+1]) : (pb + Bnz [j]) ;
     for ( ; pb < pbend ; pb++)
     {
  t = Bi [pb] ;
  bjt = Bx [pb] ;
  pa = Ap [t] ;
  paend = (apacked) ? (Ap [t+1]) : (pa + Anz [t]) ;
  for ( ; pa < paend ; pa++)
  {
      i = Ai [pa] ;
      if (Flag [i] != mark)
      {
   Flag [i] = mark ;
   Ci [cnz++] = i ;
      }
      W [i] += Ax [pa] * bjt ;
  }
     }
     for (p = Cp [j] ; p < cnz ; p++)
     {
  i = Ci [p] ;
  Cx [p] = W [i] ;
  W [i] = 0 ;
     }
 }
    }
    else
    {
 for (j = 0 ; j < ncol ; j++)
 {
     { Common->mark++ ; if (Common->mark <= 0) { Common->mark = (-1) ; cholmod_l_clear_flag (Common) ; } } ;
     mark = Common->mark ;
     Cp [j] = cnz ;
     pb = Bp [j] ;
     pbend = (bpacked) ? (Bp [j+1]) : (pb + Bnz [j]) ;
     for ( ; pb < pbend ; pb++)
     {
  t = Bi [pb] ;
  pa = Ap [t] ;
  paend = (apacked) ? (Ap [t+1]) : (pa + Anz [t]) ;
  for ( ; pa < paend ; pa++)
  {
      i = Ai [pa] ;
      if (Flag [i] != mark)
      {
   Flag [i] = mark ;
   Ci [cnz++] = i ;
      }
  }
     }
 }
    }
    Cp [ncol] = cnz ;
    ;
    cholmod_l_free_sparse (&A2, Common) ;
    cholmod_l_free_sparse (&B2, Common) ;
    { Common->mark++ ; if (Common->mark <= 0) { Common->mark = (-1) ; cholmod_l_clear_flag (Common) ; } } ;
    ;
    if (stype > 0)
    {
 (void) cholmod_l_band_inplace (0, ncol, values, C, Common) ;
 C->stype = 1 ;
    }
    else if (stype < 0)
    {
 (void) cholmod_l_band_inplace (-nrow, 0, values, C, Common) ;
 C->stype = -1 ;
    }
    ;
    if (sorted)
    {
 if (do_swap_and_transpose)
 {
     C2 = cholmod_l_ptranspose (C, values, ((void *)0), ((void *)0), 0, Common) ;
     cholmod_l_free_sparse (&C, Common) ;
     if (Common->status < 0)
     {
  ;
  return (((void *)0)) ;
     }
     C = C2 ;
 }
 else
 {
     if (!cholmod_l_sort (C, Common))
     {
  cholmod_l_free_sparse (&C, Common) ;
  ;
  return (((void *)0)) ;
     }
 }
    }
    ;
    ;
    return (C) ;
}

variable_types:
A
struct cholmod_sparse_struct *

variable_types:
B
struct cholmod_sparse_struct *

variable_types: stype int

variable_types: values int

variable_types: sorted 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: bjt double

variable_types:
Ax
double *

variable_types:
Bx
double *

variable_types:
Cx
double *

variable_types:
W
double *

variable_types:
Ap
long *

variable_types:
Anz
long *

variable_types:
Ai
long *

variable_types:
Bp
long *

variable_types:
Bnz
long *

variable_types:
Bi
long *

variable_types:
Cp
long *

variable_types:
Ci
long *

variable_types:
Flag
long *

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

variable_types: apacked long

variable_types: bpacked long

variable_types: j long

variable_types: i long

variable_types: pa long

variable_types: paend long

variable_types: pb long

variable_types: pbend long

variable_types: ncol long

variable_types: mark long

variable_types: cnz long

variable_types: t long

variable_types: p long

variable_types: nrow long

variable_types: anz long

variable_types: bnz long


original_code:
double umfdl_usolve
(
    NumericType *Numeric,
    double X [ ],
    long Pattern [ ]
)
{
    double xk ;
    double *xp, *D, *Uval ;
    long k, deg, j, *ip, col, *Upos, *Uilen, pos,
 *Uip, n, ulen, up, newUchain, npiv, n1, *Ui ;
    if (Numeric->n_row != Numeric->n_col) return (0.) ;
    n = Numeric->n_row ;
    npiv = Numeric->npiv ;
    Upos = Numeric->Upos ;
    Uilen = Numeric->Uilen ;
    Uip = Numeric->Uip ;
    D = Numeric->D ;
    n1 = Numeric->n1 ;
    for (k = n-1 ; k >= npiv ; k--)
    {
 ;
 xk = X [k] ;
 { (X [k]) = (xk) / (D [k]) ; } ;
    }
    deg = Numeric->ulen ;
    if (deg > 0)
    {
 for (j = 0 ; j < deg ; j++)
 {
     ;
     ;
     Pattern [j] = Numeric->Upattern [j] ;
 }
    }
    for (k = npiv-1 ; k >= n1 ; k--)
    {
 up = Uip [k] ;
 ulen = Uilen [k] ;
 newUchain = (up < 0) ;
 if (newUchain)
 {
     up = -up ;
     xp = (double *) (Numeric->Memory + up + (((((sizeof (long) * (ulen))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
 }
 else
 {
     xp = (double *) (Numeric->Memory + up) ;
 }
 xk = X [k] ;
 for (j = 0 ; j < deg ; j++)
 {
     ;
     ;
     ;
     { (xk) -= (X [Pattern [j]]) * (*xp) ; } ;
     xp++ ;
 }
 { (X [k]) = (xk) / (D [k]) ; } ;
 if (k == n1) break ;
 if (newUchain)
 {
     deg = ulen ;
     ;
     ;
     ip = (long *) (Numeric->Memory + up) ;
     for (j = 0 ; j < deg ; j++)
     {
  col = *ip++ ;
  ;
  ;
  Pattern [j] = col ;
     }
 }
 else
 {
     deg -= ulen ;
     ;
     ;
     pos = Upos [k] ;
     if (pos != (-1))
     {
  ;
  ;
  Pattern [deg++] = Pattern [pos] ;
  Pattern [pos] = k ;
     }
 }
    }
    for (k = n1 - 1 ; k >= 0 ; k--)
    {
 deg = Uilen [k] ;
 xk = X [k] ;
 ;
 if (deg > 0)
 {
     up = Uip [k] ;
     Ui = (long *) (Numeric->Memory + up) ;
     up += (((((sizeof (long) * (deg))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Uval = (double *) (Numeric->Memory + up) ;
     for (j = 0 ; j < deg ; j++)
     {
  ;
  ;
  ;
  ;
  { (xk) -= (X [Ui [j]]) * (Uval [j]) ; } ;
     }
 }
 { (X [k]) = (xk) / (D [k]) ; } ;
    }
    return (1. * ((double) n) + 2. * ((double) Numeric->unz));
}

canonical_original_code:
double umfdl_usolve(struct NumericType *Numeric, double X[], long Pattern[])
{
    double xk;
    double *xp; double *D; double *Uval;
    long k; long deg; long j; long *ip; long col; long *Upos; long *Uilen; long pos; long *Uip; long n; long ulen; long up; long newUchain; long npiv; long n1; long *Ui;
    if (Numeric->n_row != Numeric->n_col) return (0.) ;
    n = Numeric->n_row ;
    npiv = Numeric->npiv ;
    Upos = Numeric->Upos ;
    Uilen = Numeric->Uilen ;
    Uip = Numeric->Uip ;
    D = Numeric->D ;
    n1 = Numeric->n1 ;
    for (k = n-1 ; k >= npiv ; k--)
    {
 ;
 xk = X [k] ;
 { (X [k]) = (xk) / (D [k]) ; } ;
    }
    deg = Numeric->ulen ;
    if (deg > 0)
    {
 for (j = 0 ; j < deg ; j++)
 {
     ;
     ;
     Pattern [j] = Numeric->Upattern [j] ;
 }
    }
    for (k = npiv-1 ; k >= n1 ; k--)
    {
 up = Uip [k] ;
 ulen = Uilen [k] ;
 newUchain = (up < 0) ;
 if (newUchain)
 {
     up = -up ;
     xp = (double *) (Numeric->Memory + up + (((((sizeof (long) * (ulen))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
 }
 else
 {
     xp = (double *) (Numeric->Memory + up) ;
 }
 xk = X [k] ;
 for (j = 0 ; j < deg ; j++)
 {
     ;
     ;
     ;
     { (xk) -= (X [Pattern [j]]) * (*xp) ; } ;
     xp++ ;
 }
 { (X [k]) = (xk) / (D [k]) ; } ;
 if (k == n1) break ;
 if (newUchain)
 {
     deg = ulen ;
     ;
     ;
     ip = (long *) (Numeric->Memory + up) ;
     for (j = 0 ; j < deg ; j++)
     {
  col = *ip++ ;
  ;
  ;
  Pattern [j] = col ;
     }
 }
 else
 {
     deg -= ulen ;
     ;
     ;
     pos = Upos [k] ;
     if (pos != (-1))
     {
  ;
  ;
  Pattern [deg++] = Pattern [pos] ;
  Pattern [pos] = k ;
     }
 }
    }
    for (k = n1 - 1 ; k >= 0 ; k--)
    {
 deg = Uilen [k] ;
 xk = X [k] ;
 ;
 if (deg > 0)
 {
     up = Uip [k] ;
     Ui = (long *) (Numeric->Memory + up) ;
     up += (((((sizeof (long) * (deg))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Uval = (double *) (Numeric->Memory + up) ;
     for (j = 0 ; j < deg ; j++)
     {
  ;
  ;
  ;
  ;
  { (xk) -= (X [Ui [j]]) * (Uval [j]) ; } ;
     }
 }
 { (X [k]) = (xk) / (D [k]) ; } ;
    }
    return (1. * ((double) n) + 2. * ((double) Numeric->unz));
}

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

variable_types:
X
double []

variable_types:
Pattern
long []

variable_types: xk double

variable_types:
xp
double *

variable_types:
D
double *

variable_types:
Uval
double *

variable_types: k long

variable_types: deg long

variable_types:
ip
long *

variable_types: col long

variable_types:
Upos
long *

variable_types:
Uilen
long *

variable_types: pos long

variable_types:
Uip
long *

variable_types: n long

variable_types: ulen long

variable_types: up long

variable_types: newUchain long

variable_types: npiv long

variable_types:
Ui
long *

return_type: double

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


decompiled_code:
__int64 __fastcall cholmod_add_size_t(__int64 a1, __int64 a2, _DWORD *a3)
{
bool v4; // dl
__int64 v5; // rdi
__int64 result; // rax

v4 = !__CFADD__(a2, a1) && *a3 != 0;
*a3 = v4;
v5 = a2 + a1;
result = 0LL;
if ( v4 )
result = v5;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, _DWORD *a3)
{
bool v4; // dl
__int64 v5; // rdi
__int64 result; // rax

v4 = !__CFADD__(a2, a1) && *a3 != 0;
*a3 = v4;
v5 = a2 + a1;
result = 0LL;
if ( v4 )
result = v5;
return result;
}

original_code:
size_t cholmod_add_size_t (size_t a, size_t b, int *ok)
{
    size_t s = a + b ;
    (*ok) = (*ok) && (s >= a) ;
    return ((*ok) ? s : 0) ;
}

canonical_original_code:
unsigned long cholmod_add_size_t(unsigned long a, unsigned long b, int *ok)
{
    unsigned long s = a + b;
    (*ok) = (*ok) && (s >= a) ;
    return ((*ok) ? s : 0) ;
}

variable_types:
a
unsigned long

variable_types:
b
unsigned long

variable_types:
ok
int *

variable_types:
s
unsigned long

return_type: unsigned long


decompiled_code:
__int64 __fastcall cholmod_mult_size_t(unsigned __int64 a1, unsigned __int64 a2, _DWORD *a3)
{
__int64 v3; // r8
bool v4; // al
bool v5; // cf

if ( !*a3 )
return 0LL;
v3 = 0LL;
while ( 1 )
{
if ( (a2 & 1) != 0 )
{
v5 = __CFADD__(a1, v3);
v3 += a1;
*a3 = !v5;
}
if ( a2 <= 1 )
break;
v4 = 2 * a1 >= a1 && *a3 != 0;
*a3 = v4;
if ( !v4 )
return 0LL;
a2 >>= 1;
a1 *= 2LL;
}
return v3;
}

original_code:
size_t cholmod_mult_size_t (size_t a, size_t k, int *ok)
{
    size_t p = 0, s ;
    while (*ok)
    {
 if (k % 2)
 {
     p = p + a ;
     (*ok) = (*ok) && (p >= a) ;
 }
 k = k / 2 ;
 if (!k) return (p) ;
 s = a + a ;
 (*ok) = (*ok) && (s >= a) ;
 a = s ;
    }
    return (0) ;
}

canonical_original_code:
unsigned long cholmod_mult_size_t(unsigned long a, unsigned long k, int *ok)
{
    unsigned long p = 0; unsigned long s;
    while (*ok)
    {
 if (k % 2)
 {
     p = p + a ;
     (*ok) = (*ok) && (p >= a) ;
 }
 k = k / 2 ;
 if (!k) return (p) ;
 s = a + a ;
 (*ok) = (*ok) && (s >= a) ;
 a = s ;
    }
    return (0) ;
}

variable_types:
k
unsigned long

variable_types:
p
unsigned long


decompiled_code:
__int64 __fastcall cholmod_malloc(unsigned __int64 a1, unsigned __int64 a2, __int64 a3)
{
bool v5; // zf
unsigned __int64 v6; // rdi
__int64 v7; // rdi
__int64 result; // rax
unsigned __int64 v9; // rbp
int v10[7]; // [rsp+Ch] [rbp-1Ch] BYREF

v10[0] = 1;
if ( !a3 )
return 0LL;
if ( *(_QWORD *)(a3 + 2016) )
{
*(_DWORD *)(a3 + 2028) = -4;
result = 0LL;
}
else if ( a2 )
{
if ( 0xFFFFFFFFFFFFFFFFLL / a2 <= a1 || a1 > 0x7FFFFFFE )
{
cholmod_error(4294967293LL, "../Core/cholmod_memory.c", 136LL, "problem too large", a3);
result = 0LL;
}
else
{
v5 = a1 == 0;
v6 = 1LL;
if ( !v5 )
v6 = a1;
v7 = cholmod_mult_size_t(v6, a2, v10);
if ( v10[0] && (result = (*(__int64 (__fastcall **)(__int64))(a3 + 1880))(v7)) != 0 )
{
++*(_QWORD *)(a3 + 2064);
v9 = *(_QWORD *)(a3 + 2080) + a1 * a2;
*(_QWORD *)(a3 + 2080) = v9;
if ( *(_QWORD *)(a3 + 2072) >= v9 )
v9 = *(_QWORD *)(a3 + 2072);
*(_QWORD *)(a3 + 2072) = v9;
}
else
{
cholmod_error(4294967294LL, "../Core/cholmod_memory.c", 147LL, "out of memory", a3);
result = 0LL;
}
}
}
else
{
cholmod_error(4294967292LL, "../Core/cholmod_memory.c", 130LL, "sizeof(item) must be > 0", a3);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(unsigned __int64 a1, unsigned __int64 a2, __int64 a3)
{
bool v5; // zf
unsigned __int64 v6; // rdi
__int64 v7; // rdi
__int64 result; // rax
unsigned __int64 v9; // rbp
int v10[7]; // [rsp+Ch] [rbp-1Ch] BYREF

v10[0] = 1;
if ( !a3 )
return 0LL;
if ( *(_QWORD *)(a3 + 2016) )
{
*(_DWORD *)(a3 + 2028) = -4;
result = 0LL;
}
else if ( a2 )
{
if ( 0xFFFFFFFFFFFFFFFFLL / a2 <= a1 || a1 > 0x7FFFFFFE )
{
cholmod_error(4294967293LL, "../Core/cholmod_memory.c", 136LL, "problem too large", a3);
result = 0LL;
}
else
{
v5 = a1 == 0;
v6 = 1LL;
if ( !v5 )
v6 = a1;
v7 = func1(v6, a2, v10);
if ( v10[0] && (result = (*(__int64 (__fastcall **)(__int64))(a3 + 1880))(v7)) != 0 )
{
++*(_QWORD *)(a3 + 2064);
v9 = *(_QWORD *)(a3 + 2080) + a1 * a2;
*(_QWORD *)(a3 + 2080) = v9;
if ( *(_QWORD *)(a3 + 2072) >= v9 )
v9 = *(_QWORD *)(a3 + 2072);
*(_QWORD *)(a3 + 2072) = v9;
}
else
{
cholmod_error(4294967294LL, "../Core/cholmod_memory.c", 147LL, "out of memory", a3);
result = 0LL;
}
}
}
else
{
cholmod_error(4294967292LL, "../Core/cholmod_memory.c", 130LL, "sizeof(item) must be > 0", a3);
result = 0LL;
}
return result;
}

original_code:
void *cholmod_malloc
(
    size_t n,
    size_t size,
    cholmod_common *Common
)
{
    void *p ;
    size_t s ;
    int ok = 1 ;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (size == 0)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 130, "sizeof(item) must be > 0", Common) ;
 p = ((void *)0) ;
    }
    else if (n >= (((size_t) (-1)) / size) || n >= 0x7fffffff)
    {
 cholmod_error ((-3), "../Core/cholmod_memory.c", 136, "problem too large", Common) ;
 p = ((void *)0) ;
    }
    else
    {
 s = cholmod_mult_size_t ((((1) > (n)) ? (1) : (n)), size, &ok) ;
 p = ok ? ((Common->malloc_memory) (s)) : ((void *)0) ;
 if (p == ((void *)0))
 {
     cholmod_error ((-2), "../Core/cholmod_memory.c", 147, "out of memory", Common) ;
 }
 else
 {
     Common->malloc_count++ ;
     Common->memory_inuse += (n * size) ;
     Common->memory_usage =
  (((Common->memory_usage) > (Common->memory_inuse)) ? (Common->memory_usage) : (Common->memory_inuse)) ;
     ;
 }
    }
    return (p) ;
}

canonical_original_code:
void *cholmod_malloc(unsigned long n, unsigned long size, struct cholmod_common_struct *Common)
{
    void *p;
    unsigned long s;
    int ok = 1;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (size == 0)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 130, "sizeof(item) must be > 0", Common) ;
 p = ((void *)0) ;
    }
    else if (n >= (((unsigned long) (-1)) / size) || n >= 0x7fffffff)
    {
 cholmod_error ((-3), "../Core/cholmod_memory.c", 136, "problem too large", Common) ;
 p = ((void *)0) ;
    }
    else
    {
 s = cholmod_mult_size_t ((((1) > (n)) ? (1) : (n)), size, &ok) ;
 p = ok ? ((Common->malloc_memory) (s)) : ((void *)0) ;
 if (p == ((void *)0))
 {
     cholmod_error ((-2), "../Core/cholmod_memory.c", 147, "out of memory", Common) ;
 }
 else
 {
     Common->malloc_count++ ;
     Common->memory_inuse += (n * size) ;
     Common->memory_usage =
  (((Common->memory_usage) > (Common->memory_inuse)) ? (Common->memory_usage) : (Common->memory_inuse)) ;
     ;
 }
    }
    return (p) ;
}

variable_types:
n
unsigned long

variable_types:
size
unsigned long

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

variable_types:
p
void *

variable_types: ok int

return_type: void *

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


original_code:
void *cholmod_free
(
    size_t n,
    size_t size,
    void *p,
    cholmod_common *Common
)
{
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (p != ((void *)0))
    {
 (Common->free_memory) (p) ;
 Common->malloc_count-- ;
 Common->memory_inuse -= (n * size) ;
 ;
 ;
    }
    return (((void *)0)) ;
}

canonical_original_code:
void *cholmod_free(unsigned long n, unsigned long size, void *p, struct cholmod_common_struct *Common)
{
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (p != ((void *)0))
    {
 (Common->free_memory) (p) ;
 Common->malloc_count-- ;
 Common->memory_inuse -= (n * size) ;
 ;
 ;
    }
    return (((void *)0)) ;
}

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


decompiled_code:
__int64 __fastcall cholmod_calloc(unsigned __int64 a1, unsigned __int64 a2, __int64 a3)
{
bool v5; // zf
__int64 v6; // rdi
__int64 v7; // r12
unsigned __int64 v8; // rbx

if ( !a3 )
return 0LL;
if ( *(_QWORD *)(a3 + 2016) )
{
*(_DWORD *)(a3 + 2028) = -4;
v7 = 0LL;
}
else if ( a2 )
{
if ( 0xFFFFFFFFFFFFFFFFLL / a2 <= a1 || a1 > 0x7FFFFFFE )
{
cholmod_error(4294967293LL, "../Core/cholmod_memory.c", 245LL, "problem too large", a3);
v7 = 0LL;
}
else
{
v5 = a1 == 0;
v6 = 1LL;
if ( !v5 )
v6 = a1;
v7 = (*(__int64 (__fastcall **)(__int64, unsigned __int64, unsigned __int64))(a3 + 1904))(
v6,
a2,
0xFFFFFFFFFFFFFFFFLL % a2);
if ( v7 )
{
++*(_QWORD *)(a3 + 2064);
v8 = *(_QWORD *)(a3 + 2080) + a1 * a2;
*(_QWORD *)(a3 + 2080) = v8;
if ( *(_QWORD *)(a3 + 2072) >= v8 )
v8 = *(_QWORD *)(a3 + 2072);
*(_QWORD *)(a3 + 2072) = v8;
}
else
{
cholmod_error(4294967294LL, "../Core/cholmod_memory.c", 255LL, "out of memory", a3);
}
}
}
else
{
cholmod_error(4294967292LL, "../Core/cholmod_memory.c", 239LL, "sizeof(item) must be > 0", a3);
v7 = 0LL;
}
return v7;
}

canonical_decompiled_code:
__int64 __fastcall func4(unsigned __int64 a1, unsigned __int64 a2, __int64 a3)
{
bool v5; // zf
__int64 v6; // rdi
__int64 v7; // r12
unsigned __int64 v8; // rbx

if ( !a3 )
return 0LL;
if ( *(_QWORD *)(a3 + 2016) )
{
*(_DWORD *)(a3 + 2028) = -4;
v7 = 0LL;
}
else if ( a2 )
{
if ( 0xFFFFFFFFFFFFFFFFLL / a2 <= a1 || a1 > 0x7FFFFFFE )
{
cholmod_error(4294967293LL, "../Core/cholmod_memory.c", 245LL, "problem too large", a3);
v7 = 0LL;
}
else
{
v5 = a1 == 0;
v6 = 1LL;
if ( !v5 )
v6 = a1;
v7 = (*(__int64 (__fastcall **)(__int64, unsigned __int64, unsigned __int64))(a3 + 1904))(
v6,
a2,
0xFFFFFFFFFFFFFFFFLL % a2);
if ( v7 )
{
++*(_QWORD *)(a3 + 2064);
v8 = *(_QWORD *)(a3 + 2080) + a1 * a2;
*(_QWORD *)(a3 + 2080) = v8;
if ( *(_QWORD *)(a3 + 2072) >= v8 )
v8 = *(_QWORD *)(a3 + 2072);
*(_QWORD *)(a3 + 2072) = v8;
}
else
{
cholmod_error(4294967294LL, "../Core/cholmod_memory.c", 255LL, "out of memory", a3);
}
}
}
else
{
cholmod_error(4294967292LL, "../Core/cholmod_memory.c", 239LL, "sizeof(item) must be > 0", a3);
v7 = 0LL;
}
return v7;
}

original_code:
void *cholmod_calloc
(
    size_t n,
    size_t size,
    cholmod_common *Common
)
{
    void *p ;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (size == 0)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 239, "sizeof(item) must be > 0", Common) ;
 p = ((void *)0) ;
    }
    else if (n >= (((size_t) (-1)) / size) || n >= 0x7fffffff)
    {
 cholmod_error ((-3), "../Core/cholmod_memory.c", 245, "problem too large", Common) ;
 p = ((void *)0) ;
    }
    else
    {
 p = (Common->calloc_memory) ((((1) > (n)) ? (1) : (n)), size) ;
 if (p == ((void *)0))
 {
     cholmod_error ((-2), "../Core/cholmod_memory.c", 255, "out of memory", Common) ;
 }
 else
 {
     Common->malloc_count++ ;
     Common->memory_inuse += (n * size) ;
     Common->memory_usage =
  (((Common->memory_usage) > (Common->memory_inuse)) ? (Common->memory_usage) : (Common->memory_inuse)) ;
     ;
 }
    }
    return (p) ;
}

canonical_original_code:
void *cholmod_calloc(unsigned long n, unsigned long size, struct cholmod_common_struct *Common)
{
    void *p;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (size == 0)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 239, "sizeof(item) must be > 0", Common) ;
 p = ((void *)0) ;
    }
    else if (n >= (((unsigned long) (-1)) / size) || n >= 0x7fffffff)
    {
 cholmod_error ((-3), "../Core/cholmod_memory.c", 245, "problem too large", Common) ;
 p = ((void *)0) ;
    }
    else
    {
 p = (Common->calloc_memory) ((((1) > (n)) ? (1) : (n)), size) ;
 if (p == ((void *)0))
 {
     cholmod_error ((-2), "../Core/cholmod_memory.c", 255, "out of memory", Common) ;
 }
 else
 {
     Common->malloc_count++ ;
     Common->memory_inuse += (n * size) ;
     Common->memory_usage =
  (((Common->memory_usage) > (Common->memory_inuse)) ? (Common->memory_usage) : (Common->memory_inuse)) ;
     ;
 }
    }
    return (p) ;
}


decompiled_code:
__int64 __fastcall cholmod_realloc(unsigned __int64 a1, unsigned __int64 a2, __int64 a3, unsigned __int64 *a4, __int64 a5)
{
unsigned __int64 v6; // r14
unsigned __int64 v7; // rbp
__int64 result; // rax
bool v11; // zf
unsigned __int64 v12; // rdi
__int64 v13; // rax
unsigned __int64 v14; // rdx
int v15[15]; // [rsp+Ch] [rbp-3Ch] BYREF

v6 = *a4;
v15[0] = 1;
if ( !a5 )
return 0LL;
v7 = a1;
if ( *(_QWORD *)(a5 + 2016) )
{
*(_DWORD *)(a5 + 2028) = -4;
result = 0LL;
}
else if ( a2 )
{
if ( a3 )
{
result = a3;
if ( v6 != a1 )
{
if ( 0xFFFFFFFFFFFFFFFFLL / a2 > a1 && a1 <= 0x7FFFFFFE )
{
v11 = a1 == 0;
v12 = 1LL;
if ( !v11 )
v12 = v7;
v13 = cholmod_mult_size_t(v12, a2, v15);
if ( v15[0] && (result = (*(__int64 (__fastcall **)(__int64, __int64))(a5 + 1888))(a3, v13)) != 0 )
{
*a4 = v7;
*(_QWORD *)(a5 + 2080) += a2 * (v7 - v6);
}
else
{
if ( v6 < v7 )
{
cholmod_error(4294967294LL, "../Core/cholmod_memory.c", 366LL, "out of memory", a5);
}
else
{
*a4 = v7;
*(_QWORD *)(a5 + 2080) += a2 * (v7 - v6);
}
result = a3;
}
v14 = *(_QWORD *)(a5 + 2072);
if ( *(_QWORD *)(a5 + 2080) >= v14 )
v14 = *(_QWORD *)(a5 + 2080);
*(_QWORD *)(a5 + 2072) = v14;
}
else
{
cholmod_error(4294967293LL, "../Core/cholmod_memory.c", 331LL, "problem too large", a5);
result = a3;
}
}
}
else
{
result = cholmod_malloc(a1, a2, a5);
if ( !result )
v7 = 0LL;
*a4 = v7;
}
}
else
{
cholmod_error(4294967292LL, "../Core/cholmod_memory.c", 313LL, "sizeof(item) must be > 0", a5);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func5(unsigned __int64 a1, unsigned __int64 a2, __int64 a3, unsigned __int64 *a4, __int64 a5)
{
unsigned __int64 v6; // r14
unsigned __int64 v7; // rbp
__int64 result; // rax
bool v11; // zf
unsigned __int64 v12; // rdi
__int64 v13; // rax
unsigned __int64 v14; // rdx
int v15[15]; // [rsp+Ch] [rbp-3Ch] BYREF

v6 = *a4;
v15[0] = 1;
if ( !a5 )
return 0LL;
v7 = a1;
if ( *(_QWORD *)(a5 + 2016) )
{
*(_DWORD *)(a5 + 2028) = -4;
result = 0LL;
}
else if ( a2 )
{
if ( a3 )
{
result = a3;
if ( v6 != a1 )
{
if ( 0xFFFFFFFFFFFFFFFFLL / a2 > a1 && a1 <= 0x7FFFFFFE )
{
v11 = a1 == 0;
v12 = 1LL;
if ( !v11 )
v12 = v7;
v13 = func1(v12, a2, v15);
if ( v15[0] && (result = (*(__int64 (__fastcall **)(__int64, __int64))(a5 + 1888))(a3, v13)) != 0 )
{
*a4 = v7;
*(_QWORD *)(a5 + 2080) += a2 * (v7 - v6);
}
else
{
if ( v6 < v7 )
{
cholmod_error(4294967294LL, "../Core/cholmod_memory.c", 366LL, "out of memory", a5);
}
else
{
*a4 = v7;
*(_QWORD *)(a5 + 2080) += a2 * (v7 - v6);
}
result = a3;
}
v14 = *(_QWORD *)(a5 + 2072);
if ( *(_QWORD *)(a5 + 2080) >= v14 )
v14 = *(_QWORD *)(a5 + 2080);
*(_QWORD *)(a5 + 2072) = v14;
}
else
{
cholmod_error(4294967293LL, "../Core/cholmod_memory.c", 331LL, "problem too large", a5);
result = a3;
}
}
}
else
{
result = func2(a1, a2, a5);
if ( !result )
v7 = 0LL;
*a4 = v7;
}
}
else
{
cholmod_error(4294967292LL, "../Core/cholmod_memory.c", 313LL, "sizeof(item) must be > 0", a5);
result = 0LL;
}
return result;
}

original_code:
void *cholmod_realloc
(
    size_t nnew,
    size_t size,
    void *p,
    size_t *n,
    cholmod_common *Common
)
{
    size_t nold = (*n) ;
    void *pnew ;
    size_t s ;
    int ok = 1 ;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (size == 0)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 313, "sizeof(item) must be > 0", Common) ;
 p = ((void *)0) ;
    }
    else if (p == ((void *)0))
    {
 ;
 p = cholmod_malloc (nnew, size, Common) ;
 *n = (p == ((void *)0)) ? 0 : nnew ;
    }
    else if (nold == nnew)
    {
 ;
    }
    else if (nnew >= (((size_t) (-1)) / size) || nnew >= 0x7fffffff)
    {
 cholmod_error ((-3), "../Core/cholmod_memory.c", 331, "problem too large", Common) ;
    }
    else
    {
 ;
 pnew = ((void *)0) ;
 s = cholmod_mult_size_t ((((1) > (nnew)) ? (1) : (nnew)), size, &ok) ;
 pnew = ok ? ((Common->realloc_memory) (p, s)) : ((void *)0) ;
 if (pnew == ((void *)0))
 {
     if (nnew <= nold)
     {
  *n = nnew ;
  ;
  ;
  Common->memory_inuse += ((nnew-nold) * size) ;
     }
     else
     {
  cholmod_error ((-2), "../Core/cholmod_memory.c", 366, "out of memory", Common) ;
     }
 }
 else
 {
     ;
     p = pnew ;
     *n = nnew ;
     Common->memory_inuse += ((nnew-nold) * size) ;
 }
 Common->memory_usage = (((Common->memory_usage) > (Common->memory_inuse)) ? (Common->memory_usage) : (Common->memory_inuse));
    }
    return (p) ;
}

canonical_original_code:
void *cholmod_realloc(unsigned long nnew, unsigned long size, void *p, unsigned long *n, struct cholmod_common_struct *Common)
{
    unsigned long nold = (*n);
    void *pnew;
    unsigned long s;
    int ok = 1;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (size == 0)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 313, "sizeof(item) must be > 0", Common) ;
 p = ((void *)0) ;
    }
    else if (p == ((void *)0))
    {
 ;
 p = cholmod_malloc (nnew, size, Common) ;
 *n = (p == ((void *)0)) ? 0 : nnew ;
    }
    else if (nold == nnew)
    {
 ;
    }
    else if (nnew >= (((unsigned long) (-1)) / size) || nnew >= 0x7fffffff)
    {
 cholmod_error ((-3), "../Core/cholmod_memory.c", 331, "problem too large", Common) ;
    }
    else
    {
 ;
 pnew = ((void *)0) ;
 s = cholmod_mult_size_t ((((1) > (nnew)) ? (1) : (nnew)), size, &ok) ;
 pnew = ok ? ((Common->realloc_memory) (p, s)) : ((void *)0) ;
 if (pnew == ((void *)0))
 {
     if (nnew <= nold)
     {
  *n = nnew ;
  ;
  ;
  Common->memory_inuse += ((nnew-nold) * size) ;
     }
     else
     {
  cholmod_error ((-2), "../Core/cholmod_memory.c", 366, "out of memory", Common) ;
     }
 }
 else
 {
     ;
     p = pnew ;
     *n = nnew ;
     Common->memory_inuse += ((nnew-nold) * size) ;
 }
 Common->memory_usage = (((Common->memory_usage) > (Common->memory_inuse)) ? (Common->memory_usage) : (Common->memory_inuse));
    }
    return (p) ;
}

variable_types:
nnew
unsigned long

variable_types:
n
unsigned long *

variable_types:
nold
unsigned long

variable_types:
pnew
void *


decompiled_code:
__int64 __fastcall cholmod_realloc_multiple(unsigned __int64 a1, int a2, unsigned int a3, __int64 *a4, __int64 *a5, __int64 *a6, __int64 *a7, unsigned __int64 *a8, __int64 a9)
{
__int64 result; // rax
unsigned __int64 v12; // r15
_QWORD *v13; // rax
_QWORD *v14; // rdx
unsigned __int64 v17; // [rsp+10h] [rbp-58h] BYREF
__int64 v18; // [rsp+18h] [rbp-50h] BYREF
__int64 v19; // [rsp+20h] [rbp-48h] BYREF
unsigned __int64 v20[8]; // [rsp+28h] [rbp-40h] BYREF

if ( !a9 )
return 0LL;
if ( *(_QWORD *)(a9 + 2016) )
{
*(_DWORD *)(a9 + 2028) = -4;
result = 0LL;
}
else if ( a3 > 3 )
{
cholmod_error(4294967292LL, "../Core/cholmod_memory.c", 423LL, "invalid xtype", a9);
result = 0LL;
}
else if ( a2 > 0 || (result = 1LL, a3) )
{
v12 = *a8;
v20[0] = v12;
v19 = v12;
v18 = v12;
v17 = v12;
if ( a2 > 0 )
*a4 = cholmod_realloc(a1, 4uLL, *a4, v20, a9);
if ( a2 > 1 )
*a5 = cholmod_realloc(a1, 4uLL, *a5, (unsigned __int64 *)&v19, a9);
switch ( a3 )
{
case 2u:
*a6 = cholmod_realloc(a1, 0x10uLL, *a6, (unsigned __int64 *)&v18, a9);
break;
case 3u:
*a6 = cholmod_realloc(a1, 8uLL, *a6, (unsigned __int64 *)&v18, a9);
*a7 = cholmod_realloc(a1, 8uLL, *a7, &v17, a9);
break;
case 1u:
*a6 = cholmod_realloc(a1, 8uLL, *a6, (unsigned __int64 *)&v18, a9);
break;
}
if ( *(int *)(a9 + 2028) < 0 )
{
if ( v12 )
{
if ( a2 > 0 )
*a4 = cholmod_realloc(v12, 4uLL, *a4, v20, a9);
if ( a2 > 1 )
*a5 = cholmod_realloc(v12, 4uLL, *a5, (unsigned __int64 *)&v19, a9);
if ( a3 == 2 )
{
*a6 = cholmod_realloc(v12, 0x10uLL, *a6, (unsigned __int64 *)&v18, a9);
result = 0LL;
}
else if ( a3 == 3 )
{
*a6 = cholmod_realloc(v12, 8uLL, *a6, (unsigned __int64 *)&v18, a9);
*a7 = cholmod_realloc(v12, 8uLL, *a7, &v17, a9);
result = 0LL;
}
else
{
result = 0LL;
if ( a3 == 1 )
{
*a6 = cholmod_realloc(v12, 8uLL, *a6, (unsigned __int64 *)&v18, a9);
result = 0LL;
}
}
}
else
{
if ( a2 > 0 )
*a4 = cholmod_free(v20[0], 4LL, *a4, a9);
if ( a2 > 1 )
*a5 = cholmod_free(v19, 4LL, *a5, a9);
if ( a3 == 2 )
{
*a6 = cholmod_free(v18, 16LL, *a6, a9);
result = 0LL;
}
else if ( a3 == 3 )
{
*a6 = cholmod_free(v18, 8LL, *a6, a9);
*a7 = cholmod_free(v18, 8LL, *a7, a9);
result = 0LL;
}
else
{
result = 0LL;
if ( a3 == 1 )
{
*a6 = cholmod_free(v18, 8LL, *a6, a9);
result = 0LL;
}
}
}
}
else
{
if ( !v12 )
{
v13 = (_QWORD *)*a6;
switch ( a3 )
{
case 2u:
*v13 = 0LL;
v13[1] = 0LL;
break;
case 3u:
v14 = (_QWORD *)*a7;
*v13 = 0LL;
*v14 = 0LL;
break;
case 1u:
*v13 = 0LL;
break;
}
}
*a8 = a1;
result = 1LL;
}
}
return result;
}

original_code:
int cholmod_realloc_multiple
(
    size_t nnew,
    int nint,
    int xtype,
    void **Iblock,
    void **Jblock,
    void **Xblock,
    void **Zblock,
    size_t *nold_p,
    cholmod_common *Common
)
{
    double *xx, *zz ;
    size_t i, j, x, z, nold ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    if (xtype < 0 || xtype > 3)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 423, "invalid xtype", Common) ;
 return (0) ;
    }
    nold = *nold_p ;
    if (nint < 1 && xtype == 0)
    {
 return (1) ;
    }
    i = nold ;
    j = nold ;
    x = nold ;
    z = nold ;
    if (nint > 0)
    {
 *Iblock = cholmod_realloc (nnew, sizeof (int), *Iblock, &i, Common) ;
    }
    if (nint > 1)
    {
 *Jblock = cholmod_realloc (nnew, sizeof (int), *Jblock, &j, Common) ;
    }
    switch (xtype)
    {
 case 1:
     *Xblock = cholmod_realloc (nnew, sizeof (double), *Xblock, &x,
                    Common) ;
     break ;
 case 2:
     *Xblock = cholmod_realloc (nnew, 2*sizeof (double), *Xblock, &x,
                    Common) ;
     break ;
 case 3:
     *Xblock = cholmod_realloc (nnew, sizeof (double), *Xblock, &x,
                    Common) ;
     *Zblock = cholmod_realloc (nnew, sizeof (double), *Zblock, &z,
                    Common) ;
     break ;
    }
    if (Common->status < 0)
    {
 if (nold == 0)
 {
     if (nint > 0)
     {
  *Iblock = cholmod_free (i, sizeof (int), *Iblock, Common) ;
     }
     if (nint > 1)
     {
  *Jblock = cholmod_free (j, sizeof (int), *Jblock, Common) ;
     }
     switch (xtype)
     {
  case 1:
      *Xblock = cholmod_free (x, sizeof (double), *Xblock,
                            Common) ;
      break ;
  case 2:
      *Xblock = cholmod_free (x, 2*sizeof (double), *Xblock,
                            Common) ;
      break ;
  case 3:
      *Xblock = cholmod_free (x, sizeof (double), *Xblock,
                            Common) ;
      *Zblock = cholmod_free (x, sizeof (double), *Zblock,
                            Common) ;
      break ;
     }
 }
 else
 {
     if (nint > 0)
     {
  *Iblock = cholmod_realloc (nold, sizeof (int), *Iblock, &i,
                            Common) ;
     }
     if (nint > 1)
     {
  *Jblock = cholmod_realloc (nold, sizeof (int), *Jblock, &j,
                            Common) ;
     }
     switch (xtype)
     {
  case 1:
      *Xblock = cholmod_realloc (nold, sizeof (double),
                            *Xblock, &x, Common) ;
      break ;
  case 2:
      *Xblock = cholmod_realloc (nold, 2*sizeof (double),
                            *Xblock, &x, Common) ;
      break ;
  case 3:
      *Xblock = cholmod_realloc (nold, sizeof (double),
                            *Xblock, &x, Common) ;
      *Zblock = cholmod_realloc (nold, sizeof (double),
                            *Zblock, &z, Common) ;
      break ;
     }
 }
 return (0) ;
    }
    if (nold == 0)
    {
 xx = *Xblock ;
 zz = *Zblock ;
 switch (xtype)
 {
     case 1:
  xx [0] = 0 ;
  break ;
     case 2:
  xx [0] = 0 ;
  xx [1] = 0 ;
  break ;
     case 3:
  xx [0] = 0 ;
  zz [0] = 0 ;
  break ;
 }
    }
    *nold_p = nnew ;
    return (1) ;
}

canonical_original_code:
int cholmod_realloc_multiple(unsigned long nnew, int nint, int xtype, void **Iblock, void **Jblock, void **Xblock, void **Zblock, unsigned long *nold_p, struct cholmod_common_struct *Common)
{
    double *xx; double *zz;
    unsigned long i; unsigned long j; unsigned long x; unsigned long z; unsigned long nold;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    if (xtype < 0 || xtype > 3)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 423, "invalid xtype", Common) ;
 return (0) ;
    }
    nold = *nold_p ;
    if (nint < 1 && xtype == 0)
    {
 return (1) ;
    }
    i = nold ;
    j = nold ;
    x = nold ;
    z = nold ;
    if (nint > 0)
    {
 *Iblock = cholmod_realloc (nnew, sizeof (int), *Iblock, &i, Common) ;
    }
    if (nint > 1)
    {
 *Jblock = cholmod_realloc (nnew, sizeof (int), *Jblock, &j, Common) ;
    }
    switch (xtype)
    {
 case 1:
     *Xblock = cholmod_realloc (nnew, sizeof (double), *Xblock, &x,
                    Common) ;
     break ;
 case 2:
     *Xblock = cholmod_realloc (nnew, 2*sizeof (double), *Xblock, &x,
                    Common) ;
     break ;
 case 3:
     *Xblock = cholmod_realloc (nnew, sizeof (double), *Xblock, &x,
                    Common) ;
     *Zblock = cholmod_realloc (nnew, sizeof (double), *Zblock, &z,
                    Common) ;
     break ;
    }
    if (Common->status < 0)
    {
 if (nold == 0)
 {
     if (nint > 0)
     {
  *Iblock = cholmod_free (i, sizeof (int), *Iblock, Common) ;
     }
     if (nint > 1)
     {
  *Jblock = cholmod_free (j, sizeof (int), *Jblock, Common) ;
     }
     switch (xtype)
     {
  case 1:
      *Xblock = cholmod_free (x, sizeof (double), *Xblock,
                            Common) ;
      break ;
  case 2:
      *Xblock = cholmod_free (x, 2*sizeof (double), *Xblock,
                            Common) ;
      break ;
  case 3:
      *Xblock = cholmod_free (x, sizeof (double), *Xblock,
                            Common) ;
      *Zblock = cholmod_free (x, sizeof (double), *Zblock,
                            Common) ;
      break ;
     }
 }
 else
 {
     if (nint > 0)
     {
  *Iblock = cholmod_realloc (nold, sizeof (int), *Iblock, &i,
                            Common) ;
     }
     if (nint > 1)
     {
  *Jblock = cholmod_realloc (nold, sizeof (int), *Jblock, &j,
                            Common) ;
     }
     switch (xtype)
     {
  case 1:
      *Xblock = cholmod_realloc (nold, sizeof (double),
                            *Xblock, &x, Common) ;
      break ;
  case 2:
      *Xblock = cholmod_realloc (nold, 2*sizeof (double),
                            *Xblock, &x, Common) ;
      break ;
  case 3:
      *Xblock = cholmod_realloc (nold, sizeof (double),
                            *Xblock, &x, Common) ;
      *Zblock = cholmod_realloc (nold, sizeof (double),
                            *Zblock, &z, Common) ;
      break ;
     }
 }
 return (0) ;
    }
    if (nold == 0)
    {
 xx = *Xblock ;
 zz = *Zblock ;
 switch (xtype)
 {
     case 1:
  xx [0] = 0 ;
  break ;
     case 2:
  xx [0] = 0 ;
  xx [1] = 0 ;
  break ;
     case 3:
  xx [0] = 0 ;
  zz [0] = 0 ;
  break ;
 }
    }
    *nold_p = nnew ;
    return (1) ;
}

variable_types: nint int

variable_types: xtype int

variable_types:
Iblock
void **

variable_types:
Jblock
void **

variable_types:
Xblock
void **

variable_types:
Zblock
void **

variable_types:
xx
double *

variable_types:
zz
double *

variable_types:
i
unsigned long

variable_types:
j
unsigned long

variable_types:
x
unsigned long

variable_types:
z
unsigned long

return_type: int


original_code:
long umfpack_dl_transpose
(
    long n_row,
    long n_col,
    const long Ap [ ],
    const long Ai [ ],
    const double Ax [ ],
    const long P [ ],
    const long Q [ ],
    long Rp [ ],
    long Ri [ ],
    double Rx [ ]
)
{
    long status, *W, nn ;
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    nn = (((nn) > (1)) ? (nn) : (1)) ;
    W = (long *) umf_l_malloc (nn, sizeof (long)) ;
    if (!W)
    {
 ;
 ;
 return ((-1)) ;
    }
    ;
    status = umfdl_transpose (n_row, n_col, Ap, Ai, Ax, P, Q, n_col, Rp, Ri, Rx,
 W, (1)
 ) ;
    (void) umf_l_free ((void *) W) ;
    ;
    return (status) ;
}

canonical_original_code:
long umfpack_dl_transpose(long n_row, long n_col, long Ap[], long Ai[], double Ax[], long P[], long Q[], long Rp[], long Ri[], double Rx[])
{
    long status; long *W; long nn;
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    nn = (((nn) > (1)) ? (nn) : (1)) ;
    W = (long *) umf_l_malloc (nn, sizeof (long)) ;
    if (!W)
    {
 ;
 ;
 return ((-1)) ;
    }
    ;
    status = umfdl_transpose (n_row, n_col, Ap, Ai, Ax, P, Q, n_col, Rp, Ri, Rx,
 W, (1)
 ) ;
    (void) umf_l_free ((void *) W) ;
    ;
    return (status) ;
}

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
P
long []

variable_types:
Q
long []

variable_types:
Rp
long []

variable_types:
Ri
long []

variable_types:
Rx
double []

variable_types: status long

variable_types:
W
long *

variable_types: nn long

return_type: long


decompiled_code:
__int64 __fastcall umf_i_report_perm(int a1, __int64 a2, __int64 a3, int a4, int a5)
{
__int64 v6; // rax
int v7; // er13
__int64 i; // rbp
__int64 result; // rax
int v10; // ebx
int *v11; // rax
int v12; // edx
bool v14; // [rsp+Fh] [rbp-39h]

v14 = a4 > 3 || a5 != 0;
if ( !v14 )
goto LABEL_4;
if ( amd_printf )
{
amd_printf("permutation vector, n = %d. ", (unsigned int)a1);
LABEL_4:
if ( a1 <= 0 )
{
if ( amd_printf )
amd_printf("ERROR: length of permutation is <= 0\n\n");
return 4294967290LL;
}
if ( !a2 )
{
if ( amd_printf )
amd_printf("(not present)\n\n");
return 0LL;
}
goto LABEL_6;
}
if ( a1 <= 0 )
return 4294967290LL;
if ( !a2 )
return 0LL;
LABEL_6:
if ( !a3 )
{
result = 0xFFFFFFFFLL;
if ( amd_printf )
{
amd_printf("ERROR: out of memory\n\n");
result = 0xFFFFFFFFLL;
}
return result;
}
if ( a4 > 3 && amd_printf )
amd_printf("\n");
v6 = 0LL;
do
*(_DWORD *)(a3 + 4 * v6++) = 1;
while ( a1 > (int)v6 );
v7 = a4;
for ( i = 0LL; ; ++i )
{
v10 = *(_DWORD *)(a2 + 4 * i);
if ( v7 > 3 && amd_printf )
amd_printf(" %d : %d ", (unsigned int)i, (unsigned int)v10);
if ( v10 < 0 || a1 <= v10 || (v11 = (int *)(a3 + 4LL * v10), v12 = *v11, *v11 = 0, !v12) )
{
result = 4294967281LL;
if ( amd_printf )
{
amd_printf("ERROR: invalid\n\n");
result = 4294967281LL;
}
return result;
}
if ( v7 <= 3 )
goto LABEL_49;
if ( !amd_printf )
break;
amd_printf("\n", (unsigned int)i);
LABEL_49:
if ( a1 <= 10 || v7 != 4 || (_DWORD)i != 9 )
goto LABEL_38;
if ( amd_printf )
amd_printf(" ...\n", (unsigned int)i);
LABEL_53:
v7 = 3;
LABEL_39:
;
}
if ( v7 == 4 && a1 > 10 && (_DWORD)i == 9 )
goto LABEL_53;
LABEL_38:
if ( (int)i + 1 < a1 )
goto LABEL_39;
if ( a4 <= 3 )
{
if ( !v14 )
return 0LL;
}
else
{
result = 0LL;
if ( !amd_printf )
return result;
amd_printf(" permutation vector ");
}
if ( amd_printf )
amd_printf("OK\n\n");
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, __int64 a2, __int64 a3, int a4, int a5)
{
__int64 v6; // rax
int v7; // er13
__int64 i; // rbp
__int64 result; // rax
int v10; // ebx
int *v11; // rax
int v12; // edx
bool v14; // [rsp+Fh] [rbp-39h]

v14 = a4 > 3 || a5 != 0;
if ( !v14 )
goto LABEL_4;
if ( amd_printf )
{
amd_printf("permutation vector, n = %d. ", (unsigned int)a1);
LABEL_4:
if ( a1 <= 0 )
{
if ( amd_printf )
amd_printf("ERROR: length of permutation is <= 0\n\n");
return 4294967290LL;
}
if ( !a2 )
{
if ( amd_printf )
amd_printf("(not present)\n\n");
return 0LL;
}
goto LABEL_6;
}
if ( a1 <= 0 )
return 4294967290LL;
if ( !a2 )
return 0LL;
LABEL_6:
if ( !a3 )
{
result = 0xFFFFFFFFLL;
if ( amd_printf )
{
amd_printf("ERROR: out of memory\n\n");
result = 0xFFFFFFFFLL;
}
return result;
}
if ( a4 > 3 && amd_printf )
amd_printf("\n");
v6 = 0LL;
do
*(_DWORD *)(a3 + 4 * v6++) = 1;
while ( a1 > (int)v6 );
v7 = a4;
for ( i = 0LL; ; ++i )
{
v10 = *(_DWORD *)(a2 + 4 * i);
if ( v7 > 3 && amd_printf )
amd_printf(" %d : %d ", (unsigned int)i, (unsigned int)v10);
if ( v10 < 0 || a1 <= v10 || (v11 = (int *)(a3 + 4LL * v10), v12 = *v11, *v11 = 0, !v12) )
{
result = 4294967281LL;
if ( amd_printf )
{
amd_printf("ERROR: invalid\n\n");
result = 4294967281LL;
}
return result;
}
if ( v7 <= 3 )
goto LABEL_49;
if ( !amd_printf )
break;
amd_printf("\n", (unsigned int)i);
LABEL_49:
if ( a1 <= 10 || v7 != 4 || (_DWORD)i != 9 )
goto LABEL_38;
if ( amd_printf )
amd_printf(" ...\n", (unsigned int)i);
LABEL_53:
v7 = 3;
LABEL_39:
;
}
if ( v7 == 4 && a1 > 10 && (_DWORD)i == 9 )
goto LABEL_53;
LABEL_38:
if ( (int)i + 1 < a1 )
goto LABEL_39;
if ( a4 <= 3 )
{
if ( !v14 )
return 0LL;
}
else
{
result = 0LL;
if ( !amd_printf )
return result;
amd_printf(" permutation vector ");
}
if ( amd_printf )
amd_printf("OK\n\n");
return 0LL;
}

original_code:
int umf_i_report_perm
(
    int n,
    const int P [ ],
    int W [ ],
    int prl,
    int user
)
{
    int i, k, valid, prl1 ;
    ;
    { if (user || prl >= 4) { if (amd_printf != ((void *)0)) (void) amd_printf ("permutation vector, n = ""%d"". ", n) ; } ; } ;
    if (n <= 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: length of permutation is <= 0\n\n") ; } ;
 return ((-6)) ;
    }
    if (!P)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("(not present)\n\n") ; } ;
 return ((0)) ;
    }
    if (!W)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: out of memory\n\n") ; } ;
 return ((-1)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    for (i = 0 ; i < n ; i++)
    {
 W [i] = (1) ;
    }
    prl1 = prl ;
    for (k = 0 ; k < n ; k++)
    {
 i = P [k] ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    ""%d"" : ""%d"" ", (k), (i)) ; } ; } } ;
 valid = (i >= 0 && i < n) ;
 if (valid)
 {
     valid = W [i] ;
     W [i] = (0) ;
 }
 if (!valid)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid\n\n") ; } ;
     return ((-15)) ;
 }
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
 if (prl == 4 && k == 9 && n > 10)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("    ...\n") ; } ;
     prl-- ;
 }
    }
    prl = prl1 ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    permutation vector ") ; } ; } } ;
    { if (user || prl >= 4) { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ; } ;
    return ((0)) ;
}

canonical_original_code:
int umf_i_report_perm(int n, int P[], int W[], int prl, int user)
{
    int i; int k; int valid; int prl1;
    ;
    { if (user || prl >= 4) { if (amd_printf != ((void *)0)) (void) amd_printf ("permutation vector, n = ""%d"". ", n) ; } ; } ;
    if (n <= 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: length of permutation is <= 0\n\n") ; } ;
 return ((-6)) ;
    }
    if (!P)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("(not present)\n\n") ; } ;
 return ((0)) ;
    }
    if (!W)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: out of memory\n\n") ; } ;
 return ((-1)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    for (i = 0 ; i < n ; i++)
    {
 W [i] = (1) ;
    }
    prl1 = prl ;
    for (k = 0 ; k < n ; k++)
    {
 i = P [k] ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    ""%d"" : ""%d"" ", (k), (i)) ; } ; } } ;
 valid = (i >= 0 && i < n) ;
 if (valid)
 {
     valid = W [i] ;
     W [i] = (0) ;
 }
 if (!valid)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid\n\n") ; } ;
     return ((-15)) ;
 }
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
 if (prl == 4 && k == 9 && n > 10)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("    ...\n") ; } ;
     prl-- ;
 }
    }
    prl = prl1 ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    permutation vector ") ; } ; } } ;
    { if (user || prl >= 4) { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ; } ;
    return ((0)) ;
}

variable_types: n int

variable_types:
P
int []

variable_types:
W
int []

variable_types: prl int

variable_types: user int

variable_types: i int

variable_types: k int

variable_types: valid int


original_code:
size_t amd_l_aat
(
    long n,
    const long Ap [ ],
    const long Ai [ ],
    long Len [ ],
    long Tp [ ],
    double Info [ ]
)
{
    long p1, p2, p, i, j, pj, pj2, k, nzdiag, nzboth, nz ;
    double sym ;
    size_t nzaat ;
    if (Info != (double *) ((void *)0))
    {
 for (i = 0 ; i < 20 ; i++)
 {
     Info [i] = (-1) ;
 }
 Info [0] = 0 ;
    }
    for (k = 0 ; k < n ; k++)
    {
 Len [k] = 0 ;
    }
    nzdiag = 0 ;
    nzboth = 0 ;
    nz = Ap [n] ;
    for (k = 0 ; k < n ; k++)
    {
 p1 = Ap [k] ;
 p2 = Ap [k+1] ;
 ;
 for (p = p1 ; p < p2 ; )
 {
     j = Ai [p] ;
     if (j < k)
     {
  Len [j]++ ;
  Len [k]++ ;
  ;
  p++ ;
     }
     else if (j == k)
     {
  p++ ;
  nzdiag++ ;
  break ;
     }
     else
     {
  break ;
     }
     ;
     ;
     pj2 = Ap [j+1] ;
     for (pj = Tp [j] ; pj < pj2 ; )
     {
  i = Ai [pj] ;
  if (i < k)
  {
      Len [i]++ ;
      Len [j]++ ;
      ;
      pj++ ;
  }
  else if (i == k)
  {
      pj++ ;
      nzboth++ ;
      break ;
  }
  else
  {
      break ;
  }
     }
     Tp [j] = pj ;
 }
 Tp [k] = p ;
    }
    for (j = 0 ; j < n ; j++)
    {
 for (pj = Tp [j] ; pj < Ap [j+1] ; pj++)
 {
     i = Ai [pj] ;
     Len [i]++ ;
     Len [j]++ ;
     ;
 }
    }
    if (nz == nzdiag)
    {
 sym = 1 ;
    }
    else
    {
 sym = (2 * (double) nzboth) / ((double) (nz - nzdiag)) ;
    }
    nzaat = 0 ;
    for (k = 0 ; k < n ; k++)
    {
 nzaat += Len [k] ;
    }
    ;
    ;
    if (Info != (double *) ((void *)0))
    {
 Info [0] = 0 ;
 Info [1] = n ;
 Info [2] = nz ;
 Info [3] = sym ;
 Info [4] = nzdiag ;
 Info [5] = nzaat ;
    }
    return (nzaat) ;
}

canonical_original_code:
unsigned long amd_l_aat(long n, long Ap[], long Ai[], long Len[], long Tp[], double Info[])
{
    long p1; long p2; long p; long i; long j; long pj; long pj2; long k; long nzdiag; long nzboth; long nz;
    double sym;
    unsigned long nzaat;
    if (Info != (double *) ((void *)0))
    {
 for (i = 0 ; i < 20 ; i++)
 {
     Info [i] = (-1) ;
 }
 Info [0] = 0 ;
    }
    for (k = 0 ; k < n ; k++)
    {
 Len [k] = 0 ;
    }
    nzdiag = 0 ;
    nzboth = 0 ;
    nz = Ap [n] ;
    for (k = 0 ; k < n ; k++)
    {
 p1 = Ap [k] ;
 p2 = Ap [k+1] ;
 ;
 for (p = p1 ; p < p2 ; )
 {
     j = Ai [p] ;
     if (j < k)
     {
  Len [j]++ ;
  Len [k]++ ;
  ;
  p++ ;
     }
     else if (j == k)
     {
  p++ ;
  nzdiag++ ;
  break ;
     }
     else
     {
  break ;
     }
     ;
     ;
     pj2 = Ap [j+1] ;
     for (pj = Tp [j] ; pj < pj2 ; )
     {
  i = Ai [pj] ;
  if (i < k)
  {
      Len [i]++ ;
      Len [j]++ ;
      ;
      pj++ ;
  }
  else if (i == k)
  {
      pj++ ;
      nzboth++ ;
      break ;
  }
  else
  {
      break ;
  }
     }
     Tp [j] = pj ;
 }
 Tp [k] = p ;
    }
    for (j = 0 ; j < n ; j++)
    {
 for (pj = Tp [j] ; pj < Ap [j+1] ; pj++)
 {
     i = Ai [pj] ;
     Len [i]++ ;
     Len [j]++ ;
     ;
 }
    }
    if (nz == nzdiag)
    {
 sym = 1 ;
    }
    else
    {
 sym = (2 * (double) nzboth) / ((double) (nz - nzdiag)) ;
    }
    nzaat = 0 ;
    for (k = 0 ; k < n ; k++)
    {
 nzaat += Len [k] ;
    }
    ;
    ;
    if (Info != (double *) ((void *)0))
    {
 Info [0] = 0 ;
 Info [1] = n ;
 Info [2] = nz ;
 Info [3] = sym ;
 Info [4] = nzdiag ;
 Info [5] = nzaat ;
    }
    return (nzaat) ;
}

variable_types: n long

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Len
long []

variable_types:
Tp
long []

variable_types:
Info
double []

variable_types: p long

variable_types: i long

variable_types: j long

variable_types: pj long

variable_types: k long

variable_types: nzdiag long

variable_types: nzboth long

variable_types: nz long

variable_types: sym double

variable_types:
nzaat
unsigned long


original_code:
void umfzi_kernel_wrapup
(
    NumericType *Numeric,
    SymbolicType *Symbolic,
    WorkType *Work
)
{
    DoubleComplex pivot_value ;
    double d ;
    DoubleComplex *D ;
    int i, k, col, row, llen, ulen, *ip, *Rperm, *Cperm, *Lilen, npiv, lp,
 *Uilen, *Lip, *Uip, *Cperm_init, up, pivrow, pivcol, *Lpos, *Upos, *Wr,
 *Wc, *Wp, *Frpos, *Fcpos, *Row_degree, *Col_degree, *Rperm_init,
 n_row, n_col, n_inner, zero_pivot, nan_pivot, n1 ;
    ;
    n_row = Symbolic->n_row ;
    n_col = Symbolic->n_col ;
    n_inner = (((n_row) < (n_col)) ? (n_row) : (n_col)) ;
    Rperm = Numeric->Rperm ;
    Cperm = Numeric->Cperm ;
    Lilen = Numeric->Lilen ;
    Uilen = Numeric->Uilen ;
    Upos = Numeric->Upos ;
    Lpos = Numeric->Lpos ;
    Lip = Numeric->Lip ;
    Uip = Numeric->Uip ;
    D = Numeric->D ;
    npiv = Work->npiv ;
    Numeric->npiv = npiv ;
    Numeric->ulen = Work->ulen ;
    ;
    ;
    ;
    ;
    ;
    for (k = 0 ; k < npiv ; k++)
    {
 pivot_value = D [k] ;
 { (d) = umfpack_hypot ((pivot_value).component [0], (pivot_value).component [1]) ; } ;
 zero_pivot = ((d) == 0.) ;
 nan_pivot = ((d) != (d)) ;
 if (!zero_pivot)
 {
     Numeric->nnzpiv++ ;
 }
 if (k == 0)
 {
     Numeric->min_udiag = d ;
     Numeric->max_udiag = d ;
 }
 else
 {
     if (((Numeric->min_udiag) != 0.))
     {
  if (zero_pivot || nan_pivot)
  {
      Numeric->min_udiag = d ;
  }
  else if (!((Numeric->min_udiag) != (Numeric->min_udiag)))
  {
      Numeric->min_udiag = (((Numeric->min_udiag) < (d)) ? (Numeric->min_udiag) : (d)) ;
  }
     }
     if (nan_pivot)
     {
  Numeric->max_udiag = d ;
     }
     else if (!((Numeric->max_udiag) != (Numeric->max_udiag)))
     {
  Numeric->max_udiag = (((Numeric->max_udiag) > (d)) ? (Numeric->max_udiag) : (d)) ;
     }
 }
    }
    Col_degree = Cperm ;
    Row_degree = Rperm ;
    if (npiv < n_row)
    {
 k = npiv ;
 ;
 for (row = 0 ; row < n_row ; row++)
 {
     if ((Row_degree [row] >= 0))
     {
  Rperm [row] = (-(k)-1) ;
  ;
  ;
  Lpos [row] = (-1) ;
  Uip [row] = (-1) ;
  Uilen [row] = 0 ;
  k++ ;
     }
 }
 ;
    }
    if (npiv < n_col)
    {
 k = npiv ;
 ;
 for (col = 0 ; col < n_col ; col++)
 {
     if ((Col_degree [col] >= 0))
     {
  Cperm [col] = (-(k)-1) ;
  ;
  ;
  Upos [col] = (-1) ;
  Lip [col] = (-1) ;
  Lilen [col] = 0 ;
  k++ ;
     }
 }
 ;
    }
    if (npiv < n_inner)
    {
 ;
 for (k = npiv ; k < n_inner ; k++)
 {
     { (D [k]).component [0] = 0. ; (D [k]).component [1] = 0. ; } ;
 }
    }
    if (Numeric->ulen > 0)
    {
 ;
 Numeric->Upattern = Work->Upattern ;
 Work->Upattern = (int *) ((void *)0) ;
    }
    ;
    ;
    if (Numeric->nnzpiv < n_inner && !((Numeric->min_udiag) != (Numeric->min_udiag)))
    {
 Numeric->min_udiag = 0.0 ;
    }
    Frpos = Work->Frpos ;
    Fcpos = Work->Fcpos ;
    Wp = Work->Wp ;
    Wr = Work->Lpattern ;
    Wc = Work->Wrp ;
    for (pivrow = 0 ; pivrow < n_row ; pivrow++)
    {
 k = Rperm [pivrow] ;
 ;
 k = (-(k)-1) ;
 ;
 Wp [k] = pivrow ;
 Frpos [pivrow] = k ;
    }
    for (k = 0 ; k < n_row ; k++)
    {
 Rperm [k] = Wp [k] ;
    }
    for (pivcol = 0 ; pivcol < n_col ; pivcol++)
    {
 k = Cperm [pivcol] ;
 ;
 k = (-(k)-1) ;
 ;
 Wp [k] = pivcol ;
 Fcpos [pivcol] = k ;
    }
    for (k = 0 ; k < n_col ; k++)
    {
 Cperm [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivrow = Rperm [k] ;
 Wr [k] = Uilen [pivrow] ;
 Wp [k] = Uip [pivrow] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Uilen [k] = Wr [k] ;
 Uip [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivrow = Rperm [k] ;
 Wp [k] = Lpos [pivrow] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Lpos [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivcol = Cperm [k] ;
 Wc [k] = Lilen [pivcol] ;
 Wp [k] = Lip [pivcol] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Lilen [k] = Wc [k] ;
 Lip [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivcol = Cperm [k] ;
 Wp [k] = Upos [pivcol] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Upos [k] = Wp [k] ;
    }
    Upos [npiv] = (-1) ;
    Lpos [npiv] = (-1) ;
    Uip [npiv] = (-1) ;
    Lip [npiv] = (-1) ;
    Uilen [npiv] = 0 ;
    Lilen [npiv] = 0 ;
    n1 = Symbolic->n1 ;
    for (k = 0 ; k < n1 ; k++)
    {
 ulen = Uilen [k] ;
 ;
 if (ulen > 0)
 {
     up = Uip [k] ;
     ip = (int *) (Numeric->Memory + up) ;
     for (i = 0 ; i < ulen ; i++)
     {
  col = *ip ;
  ;
  ;
  *ip++ = Fcpos [col] ;
     }
 }
    }
    for (k = n1 ; k < npiv ; k++)
    {
 up = Uip [k] ;
 if (up < 0)
 {
     ulen = Uilen [k] ;
     ;
     if (ulen > 0)
     {
  up = -up ;
  ip = (int *) (Numeric->Memory + up) ;
  for (i = 0 ; i < ulen ; i++)
  {
      col = *ip ;
      ;
      ;
      *ip++ = Fcpos [col] ;
  }
     }
 }
    }
    ulen = Numeric->ulen ;
    if (ulen > 0)
    {
 ;
 for (i = 0 ; i < ulen ; i++)
 {
     col = Numeric->Upattern [i] ;
     ;
     Numeric->Upattern [i] = Fcpos [col] ;
 }
    }
    for (k = 0 ; k < n1 ; k++)
    {
 llen = Lilen [k] ;
 ;
 if (llen > 0)
 {
     lp = Lip [k] ;
     ip = (int *) (Numeric->Memory + lp) ;
     for (i = 0 ; i < llen ; i++)
     {
  row = *ip ;
  ;
  ;
  *ip++ = Frpos [row] ;
     }
 }
    }
    for (k = n1 ; k < npiv ; k++)
    {
 llen = Lilen [k] ;
 ;
 if (llen > 0)
 {
     lp = Lip [k] ;
     if (lp < 0)
     {
  lp = -lp ;
     }
     ip = (int *) (Numeric->Memory + lp) ;
     for (i = 0 ; i < llen ; i++)
     {
  row = *ip ;
  ;
  ;
  *ip++ = Frpos [row] ;
     }
 }
    }
    Cperm_init = Symbolic->Cperm_init ;
    Rperm_init = Symbolic->Rperm_init ;
    for (k = 0 ; k < n_row ; k++)
    {
 Rperm [k] = Rperm_init [Rperm [k]] ;
    }
    for (k = 0 ; k < n_col ; k++)
    {
 Cperm [k] = Cperm_init [Cperm [k]] ;
    }
}

canonical_original_code:
void umfzi_kernel_wrapup(struct NumericType *Numeric, struct SymbolicType *Symbolic, struct WorkType *Work)
{
    struct DoubleComplex pivot_value;
    double d;
    struct DoubleComplex *D;
    int i; int k; int col; int row; int llen; int ulen; int *ip; int *Rperm; int *Cperm; int *Lilen; int npiv; int lp; int *Uilen; int *Lip; int *Uip; int *Cperm_init; int up; int pivrow; int pivcol; int *Lpos; int *Upos; int *Wr; int *Wc; int *Wp; int *Frpos; int *Fcpos; int *Row_degree; int *Col_degree; int *Rperm_init; int n_row; int n_col; int n_inner; int zero_pivot; int nan_pivot; int n1;
    ;
    n_row = Symbolic->n_row ;
    n_col = Symbolic->n_col ;
    n_inner = (((n_row) < (n_col)) ? (n_row) : (n_col)) ;
    Rperm = Numeric->Rperm ;
    Cperm = Numeric->Cperm ;
    Lilen = Numeric->Lilen ;
    Uilen = Numeric->Uilen ;
    Upos = Numeric->Upos ;
    Lpos = Numeric->Lpos ;
    Lip = Numeric->Lip ;
    Uip = Numeric->Uip ;
    D = Numeric->D ;
    npiv = Work->npiv ;
    Numeric->npiv = npiv ;
    Numeric->ulen = Work->ulen ;
    ;
    ;
    ;
    ;
    ;
    for (k = 0 ; k < npiv ; k++)
    {
 pivot_value = D [k] ;
 { (d) = umfpack_hypot ((pivot_value).component [0], (pivot_value).component [1]) ; } ;
 zero_pivot = ((d) == 0.) ;
 nan_pivot = ((d) != (d)) ;
 if (!zero_pivot)
 {
     Numeric->nnzpiv++ ;
 }
 if (k == 0)
 {
     Numeric->min_udiag = d ;
     Numeric->max_udiag = d ;
 }
 else
 {
     if (((Numeric->min_udiag) != 0.))
     {
  if (zero_pivot || nan_pivot)
  {
      Numeric->min_udiag = d ;
  }
  else if (!((Numeric->min_udiag) != (Numeric->min_udiag)))
  {
      Numeric->min_udiag = (((Numeric->min_udiag) < (d)) ? (Numeric->min_udiag) : (d)) ;
  }
     }
     if (nan_pivot)
     {
  Numeric->max_udiag = d ;
     }
     else if (!((Numeric->max_udiag) != (Numeric->max_udiag)))
     {
  Numeric->max_udiag = (((Numeric->max_udiag) > (d)) ? (Numeric->max_udiag) : (d)) ;
     }
 }
    }
    Col_degree = Cperm ;
    Row_degree = Rperm ;
    if (npiv < n_row)
    {
 k = npiv ;
 ;
 for (row = 0 ; row < n_row ; row++)
 {
     if ((Row_degree [row] >= 0))
     {
  Rperm [row] = (-(k)-1) ;
  ;
  ;
  Lpos [row] = (-1) ;
  Uip [row] = (-1) ;
  Uilen [row] = 0 ;
  k++ ;
     }
 }
 ;
    }
    if (npiv < n_col)
    {
 k = npiv ;
 ;
 for (col = 0 ; col < n_col ; col++)
 {
     if ((Col_degree [col] >= 0))
     {
  Cperm [col] = (-(k)-1) ;
  ;
  ;
  Upos [col] = (-1) ;
  Lip [col] = (-1) ;
  Lilen [col] = 0 ;
  k++ ;
     }
 }
 ;
    }
    if (npiv < n_inner)
    {
 ;
 for (k = npiv ; k < n_inner ; k++)
 {
     { (D [k]).component [0] = 0. ; (D [k]).component [1] = 0. ; } ;
 }
    }
    if (Numeric->ulen > 0)
    {
 ;
 Numeric->Upattern = Work->Upattern ;
 Work->Upattern = (int *) ((void *)0) ;
    }
    ;
    ;
    if (Numeric->nnzpiv < n_inner && !((Numeric->min_udiag) != (Numeric->min_udiag)))
    {
 Numeric->min_udiag = 0.0 ;
    }
    Frpos = Work->Frpos ;
    Fcpos = Work->Fcpos ;
    Wp = Work->Wp ;
    Wr = Work->Lpattern ;
    Wc = Work->Wrp ;
    for (pivrow = 0 ; pivrow < n_row ; pivrow++)
    {
 k = Rperm [pivrow] ;
 ;
 k = (-(k)-1) ;
 ;
 Wp [k] = pivrow ;
 Frpos [pivrow] = k ;
    }
    for (k = 0 ; k < n_row ; k++)
    {
 Rperm [k] = Wp [k] ;
    }
    for (pivcol = 0 ; pivcol < n_col ; pivcol++)
    {
 k = Cperm [pivcol] ;
 ;
 k = (-(k)-1) ;
 ;
 Wp [k] = pivcol ;
 Fcpos [pivcol] = k ;
    }
    for (k = 0 ; k < n_col ; k++)
    {
 Cperm [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivrow = Rperm [k] ;
 Wr [k] = Uilen [pivrow] ;
 Wp [k] = Uip [pivrow] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Uilen [k] = Wr [k] ;
 Uip [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivrow = Rperm [k] ;
 Wp [k] = Lpos [pivrow] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Lpos [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivcol = Cperm [k] ;
 Wc [k] = Lilen [pivcol] ;
 Wp [k] = Lip [pivcol] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Lilen [k] = Wc [k] ;
 Lip [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivcol = Cperm [k] ;
 Wp [k] = Upos [pivcol] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Upos [k] = Wp [k] ;
    }
    Upos [npiv] = (-1) ;
    Lpos [npiv] = (-1) ;
    Uip [npiv] = (-1) ;
    Lip [npiv] = (-1) ;
    Uilen [npiv] = 0 ;
    Lilen [npiv] = 0 ;
    n1 = Symbolic->n1 ;
    for (k = 0 ; k < n1 ; k++)
    {
 ulen = Uilen [k] ;
 ;
 if (ulen > 0)
 {
     up = Uip [k] ;
     ip = (int *) (Numeric->Memory + up) ;
     for (i = 0 ; i < ulen ; i++)
     {
  col = *ip ;
  ;
  ;
  *ip++ = Fcpos [col] ;
     }
 }
    }
    for (k = n1 ; k < npiv ; k++)
    {
 up = Uip [k] ;
 if (up < 0)
 {
     ulen = Uilen [k] ;
     ;
     if (ulen > 0)
     {
  up = -up ;
  ip = (int *) (Numeric->Memory + up) ;
  for (i = 0 ; i < ulen ; i++)
  {
      col = *ip ;
      ;
      ;
      *ip++ = Fcpos [col] ;
  }
     }
 }
    }
    ulen = Numeric->ulen ;
    if (ulen > 0)
    {
 ;
 for (i = 0 ; i < ulen ; i++)
 {
     col = Numeric->Upattern [i] ;
     ;
     Numeric->Upattern [i] = Fcpos [col] ;
 }
    }
    for (k = 0 ; k < n1 ; k++)
    {
 llen = Lilen [k] ;
 ;
 if (llen > 0)
 {
     lp = Lip [k] ;
     ip = (int *) (Numeric->Memory + lp) ;
     for (i = 0 ; i < llen ; i++)
     {
  row = *ip ;
  ;
  ;
  *ip++ = Frpos [row] ;
     }
 }
    }
    for (k = n1 ; k < npiv ; k++)
    {
 llen = Lilen [k] ;
 ;
 if (llen > 0)
 {
     lp = Lip [k] ;
     if (lp < 0)
     {
  lp = -lp ;
     }
     ip = (int *) (Numeric->Memory + lp) ;
     for (i = 0 ; i < llen ; i++)
     {
  row = *ip ;
  ;
  ;
  *ip++ = Frpos [row] ;
     }
 }
    }
    Cperm_init = Symbolic->Cperm_init ;
    Rperm_init = Symbolic->Rperm_init ;
    for (k = 0 ; k < n_row ; k++)
    {
 Rperm [k] = Rperm_init [Rperm [k]] ;
    }
    for (k = 0 ; k < n_col ; k++)
    {
 Cperm [k] = Cperm_init [Cperm [k]] ;
    }
}

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 SymbolicType { double num_mem_usage_est; int valid; } *

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

variable_types: i int

variable_types: k int

variable_types: col int

variable_types: row int

variable_types: llen int

variable_types: ulen int

variable_types:
ip
int *

variable_types:
Rperm
int *

variable_types:
Cperm
int *

variable_types:
Lilen
int *

variable_types: npiv int

variable_types: lp int

variable_types:
Uilen
int *

variable_types:
Lip
int *

variable_types:
Uip
int *

variable_types: up int

variable_types: pivrow int

variable_types: pivcol int

variable_types:
Lpos
int *

variable_types:
Upos
int *

variable_types:
Wr
int *

variable_types:
Wc
int *

variable_types:
Wp
int *

variable_types:
Frpos
int *

variable_types:
Fcpos
int *

return_type: void

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


original_code:
long umfpack_zl_triplet_to_col
(
    long n_row,
    long n_col,
    long nz,
    const long Ti [ ],
    const long Tj [ ],
    const double Tx [ ],
    const double Tz [ ],
    long Ap [ ],
    long Ai [ ],
    double Ax [ ]
    , double Az [ ]
    , long Map [ ]
)
{
    long *RowCount, *Rp, *Rj, *W, nn, do_values, do_map, *Map2, status ;
    double *Rx ;
    double *Rz ;
    long split ;
    if (!Ai || !Ap || !Ti || !Tj)
    {
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 return ((-6)) ;
    }
    if (nz < 0)
    {
 return ((-8)) ;
    }
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    Rx = (double *) ((void *)0) ;
    do_values = Ax && Tx ;
    if (do_values)
    {
 Rx = (double *) umf_l_malloc (2*nz+2, sizeof (double)) ;
 split = ((Tz) != (double *) ((void *)0)) && ((Az) != (double *) ((void *)0)) ;
 if (split)
 {
     Rz = Rx + nz ;
 }
 else
 {
     Rz = (double *) ((void *)0) ;
 }
 if (!Rx)
 {
     ;
     ;
     return ((-1)) ;
 }
    }
    do_map = (Map != (long *) ((void *)0)) ;
    Map2 = (long *) ((void *)0) ;
    if (do_map)
    {
 ;
 Map2 = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
 if (!Map2)
 {
     ;
     (void) umf_l_free ((void *) Rx) ;
     ;
     return ((-1)) ;
 }
    }
    Rj = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
    Rp = (long *) umf_l_malloc (n_row+1, sizeof (long)) ;
    RowCount = (long *) umf_l_malloc (n_row, sizeof (long)) ;
    W = (long *) umf_l_malloc (nn, sizeof (long)) ;
    if (!Rj || !Rp || !RowCount || !W)
    {
 ;
 (void) umf_l_free ((void *) Rx) ;
 (void) umf_l_free ((void *) Map2) ;
 (void) umf_l_free ((void *) Rp) ;
 (void) umf_l_free ((void *) Rj) ;
 (void) umf_l_free ((void *) RowCount) ;
 (void) umf_l_free ((void *) W) ;
 ;
 return ((-1)) ;
    }
    ;
    if (do_map)
    {
 if (do_values)
 {
     status = umfzl_triplet_map_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Tx, Ax, Rx
  , Tz, Az, Rz
  , Map, Map2) ;
 }
 else
 {
     status = umfzl_triplet_map_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Map, Map2) ;
 }
    }
    else
    {
 if (do_values)
 {
     status = umfzl_triplet_nomap_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount , Tx, Ax, Rx
  , Tz, Az, Rz
  ) ;
 }
 else
 {
     status = umfzl_triplet_nomap_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai,
  Rp, Rj, W, RowCount) ;
 }
    }
    (void) umf_l_free ((void *) Rx) ;
    (void) umf_l_free ((void *) Map2) ;
    (void) umf_l_free ((void *) Rp) ;
    (void) umf_l_free ((void *) Rj) ;
    (void) umf_l_free ((void *) RowCount) ;
    (void) umf_l_free ((void *) W) ;
    ;
    return (status) ;
}

canonical_original_code:
long umfpack_zl_triplet_to_col(long n_row, long n_col, long nz, long Ti[], long Tj[], double Tx[], double Tz[], long Ap[], long Ai[], double Ax[], double Az[], long Map[])
{
    long *RowCount; long *Rp; long *Rj; long *W; long nn; long do_values; long do_map; long *Map2; long status;
    double *Rx;
    double *Rz;
    long split;
    if (!Ai || !Ap || !Ti || !Tj)
    {
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 return ((-6)) ;
    }
    if (nz < 0)
    {
 return ((-8)) ;
    }
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    Rx = (double *) ((void *)0) ;
    do_values = Ax && Tx ;
    if (do_values)
    {
 Rx = (double *) umf_l_malloc (2*nz+2, sizeof (double)) ;
 split = ((Tz) != (double *) ((void *)0)) && ((Az) != (double *) ((void *)0)) ;
 if (split)
 {
     Rz = Rx + nz ;
 }
 else
 {
     Rz = (double *) ((void *)0) ;
 }
 if (!Rx)
 {
     ;
     ;
     return ((-1)) ;
 }
    }
    do_map = (Map != (long *) ((void *)0)) ;
    Map2 = (long *) ((void *)0) ;
    if (do_map)
    {
 ;
 Map2 = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
 if (!Map2)
 {
     ;
     (void) umf_l_free ((void *) Rx) ;
     ;
     return ((-1)) ;
 }
    }
    Rj = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
    Rp = (long *) umf_l_malloc (n_row+1, sizeof (long)) ;
    RowCount = (long *) umf_l_malloc (n_row, sizeof (long)) ;
    W = (long *) umf_l_malloc (nn, sizeof (long)) ;
    if (!Rj || !Rp || !RowCount || !W)
    {
 ;
 (void) umf_l_free ((void *) Rx) ;
 (void) umf_l_free ((void *) Map2) ;
 (void) umf_l_free ((void *) Rp) ;
 (void) umf_l_free ((void *) Rj) ;
 (void) umf_l_free ((void *) RowCount) ;
 (void) umf_l_free ((void *) W) ;
 ;
 return ((-1)) ;
    }
    ;
    if (do_map)
    {
 if (do_values)
 {
     status = umfzl_triplet_map_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Tx, Ax, Rx
  , Tz, Az, Rz
  , Map, Map2) ;
 }
 else
 {
     status = umfzl_triplet_map_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Map, Map2) ;
 }
    }
    else
    {
 if (do_values)
 {
     status = umfzl_triplet_nomap_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount , Tx, Ax, Rx
  , Tz, Az, Rz
  ) ;
 }
 else
 {
     status = umfzl_triplet_nomap_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai,
  Rp, Rj, W, RowCount) ;
 }
    }
    (void) umf_l_free ((void *) Rx) ;
    (void) umf_l_free ((void *) Map2) ;
    (void) umf_l_free ((void *) Rp) ;
    (void) umf_l_free ((void *) Rj) ;
    (void) umf_l_free ((void *) RowCount) ;
    (void) umf_l_free ((void *) W) ;
    ;
    return (status) ;
}

variable_types: nz long

variable_types:
Ti
long []

variable_types:
Tj
long []

variable_types:
Tx
double []

variable_types:
Tz
double []

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
Az
double []

variable_types:
Map
long []

variable_types:
RowCount
long *

variable_types:
Rp
long *

variable_types:
Rj
long *

variable_types:
W
long *

variable_types: nn long

variable_types: status long

variable_types:
Rx
double *

variable_types:
Rz
double *

variable_types: split long


original_code:
int umfdi_init_front
(
    NumericType *Numeric,
    WorkType *Work
)
{
    int i, j, fnr_curr, row, col, *Frows, *Fcols,
 *Fcpos, *Frpos, fncols, fnrows, *Wrow, fnr2, fnc2, rrdeg, ccdeg, *Wm,
 fnrows_extended ;
    double *Fcblock, *Fl, *Wy, *Wx ;
    if (Work->do_grow)
    {
 fnr2 = (1.2) * Work->fnrows_new + 2 ;
 fnc2 = (1.2) * Work->fncols_new + 2 ;
 if (!umfdi_grow_front (Numeric, fnr2, fnc2, Work,
     Work->pivrow_in_front ? 2 : 0))
 {
     ;
     return ((0)) ;
 }
    }
    ;
    fnr_curr = Work->fnr_curr ;
    ;
    ;
    ;
    ;
    Frows = Work->Frows ;
    Fcols = Work->Fcols ;
    Frpos = Work->Frpos ;
    Fcpos = Work->Fcpos ;
    Work->fnzeros = 0 ;
    ccdeg = Work->ccdeg ;
    rrdeg = Work->rrdeg ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    ;
    Fl = Work->Flblock ;
    if (Work->pivcol_in_front)
    {
 Work->fscan_row = fnrows ;
 Work->NewRows = Work->Wrp ;
 Wy = Work->Wy ;
 for (i = 0 ; i < fnrows ; i++)
 {
     Fl [i] = Wy [i] ;
 }
 fnrows_extended = fnrows + ccdeg ;
 for (i = fnrows ; i < fnrows_extended ; i++)
 {
     Fl [i] = Wy [i] ;
     row = Frows [i] ;
     Work->NewRows [i] = (-(row)-2) ;
 }
 fnrows = fnrows_extended ;
    }
    else
    {
 Work->fscan_row = 0 ;
 Work->NewRows = Frows ;
 Wm = Work->Wm ;
 Wx = Work->Wx ;
 for (i = 0 ; i < ccdeg ; i++)
 {
     Fl [i] = Wx [i] ;
     row = Wm [i] ;
     Frows [i] = row ;
     Frpos [row] = i ;
 }
 fnrows = ccdeg ;
    }
    Work->fnrows = fnrows ;
    Wrow = Work->Wrow ;
    if (Work->pivrow_in_front)
    {
 Work->fscan_col = fncols ;
 Work->NewCols = Work->Wp ;
 ;
 if (Wrow == Fcols)
 {
     for (j = fncols ; j < rrdeg ; j++)
     {
  col = Wrow [j] ;
  Work->NewCols [j] = (-(col)-2) ;
  Fcpos [col] = j * fnr_curr ;
     }
 }
 else
 {
     for (j = fncols ; j < rrdeg ; j++)
     {
  col = Wrow [j] ;
  Fcols [j] = col ;
  Work->NewCols [j] = (-(col)-2) ;
  Fcpos [col] = j * fnr_curr ;
     }
 }
    }
    else
    {
 Work->fscan_col = 0 ;
 Work->NewCols = Fcols ;
 for (j = 0 ; j < rrdeg ; j++)
 {
     col = Wrow [j] ;
     Fcols [j] = col ;
     Fcpos [col] = j * fnr_curr ;
 }
    }
    ;
    fncols = rrdeg ;
    Work->fncols = fncols ;
    ;
    ;
    Fcblock = Work->Fcblock ;
    ;
    zero_init_front (fncols, fnrows, Fcblock, fnr_curr) ;
    return ((1)) ;
}

canonical_original_code:
int umfdi_init_front(struct NumericType *Numeric, struct WorkType *Work)
{
    int i; int j; int fnr_curr; int row; int col; int *Frows; int *Fcols; int *Fcpos; int *Frpos; int fncols; int fnrows; int *Wrow; int fnr2; int fnc2; int rrdeg; int ccdeg; int *Wm; int fnrows_extended;
    double *Fcblock; double *Fl; double *Wy; double *Wx;
    if (Work->do_grow)
    {
 fnr2 = (1.2) * Work->fnrows_new + 2 ;
 fnc2 = (1.2) * Work->fncols_new + 2 ;
 if (!umfdi_grow_front (Numeric, fnr2, fnc2, Work,
     Work->pivrow_in_front ? 2 : 0))
 {
     ;
     return ((0)) ;
 }
    }
    ;
    fnr_curr = Work->fnr_curr ;
    ;
    ;
    ;
    ;
    Frows = Work->Frows ;
    Fcols = Work->Fcols ;
    Frpos = Work->Frpos ;
    Fcpos = Work->Fcpos ;
    Work->fnzeros = 0 ;
    ccdeg = Work->ccdeg ;
    rrdeg = Work->rrdeg ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    ;
    Fl = Work->Flblock ;
    if (Work->pivcol_in_front)
    {
 Work->fscan_row = fnrows ;
 Work->NewRows = Work->Wrp ;
 Wy = Work->Wy ;
 for (i = 0 ; i < fnrows ; i++)
 {
     Fl [i] = Wy [i] ;
 }
 fnrows_extended = fnrows + ccdeg ;
 for (i = fnrows ; i < fnrows_extended ; i++)
 {
     Fl [i] = Wy [i] ;
     row = Frows [i] ;
     Work->NewRows [i] = (-(row)-2) ;
 }
 fnrows = fnrows_extended ;
    }
    else
    {
 Work->fscan_row = 0 ;
 Work->NewRows = Frows ;
 Wm = Work->Wm ;
 Wx = Work->Wx ;
 for (i = 0 ; i < ccdeg ; i++)
 {
     Fl [i] = Wx [i] ;
     row = Wm [i] ;
     Frows [i] = row ;
     Frpos [row] = i ;
 }
 fnrows = ccdeg ;
    }
    Work->fnrows = fnrows ;
    Wrow = Work->Wrow ;
    if (Work->pivrow_in_front)
    {
 Work->fscan_col = fncols ;
 Work->NewCols = Work->Wp ;
 ;
 if (Wrow == Fcols)
 {
     for (j = fncols ; j < rrdeg ; j++)
     {
  col = Wrow [j] ;
  Work->NewCols [j] = (-(col)-2) ;
  Fcpos [col] = j * fnr_curr ;
     }
 }
 else
 {
     for (j = fncols ; j < rrdeg ; j++)
     {
  col = Wrow [j] ;
  Fcols [j] = col ;
  Work->NewCols [j] = (-(col)-2) ;
  Fcpos [col] = j * fnr_curr ;
     }
 }
    }
    else
    {
 Work->fscan_col = 0 ;
 Work->NewCols = Fcols ;
 for (j = 0 ; j < rrdeg ; j++)
 {
     col = Wrow [j] ;
     Fcols [j] = col ;
     Fcpos [col] = j * fnr_curr ;
 }
    }
    ;
    fncols = rrdeg ;
    Work->fncols = fncols ;
    ;
    ;
    Fcblock = Work->Fcblock ;
    ;
    zero_init_front (fncols, fnrows, Fcblock, fnr_curr) ;
    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; 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: i int

variable_types: j int

variable_types: row int

variable_types: col int

variable_types:
Frows
int *

variable_types:
Fcols
int *

variable_types:
Fcpos
int *

variable_types:
Frpos
int *

variable_types: fncols int

variable_types: fnrows int

variable_types:
Wrow
int *

variable_types: rrdeg int

variable_types: ccdeg int

variable_types:
Wm
int *

variable_types:
Fcblock
double *

variable_types:
Fl
double *

variable_types:
Wy
double *

variable_types:
Wx
double *

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


original_code:
static void zero_init_front (int m, int n, double *Fcblock, int d)
{
    int i, j ;
    double *F, *Fj = Fcblock ;
    for (j = 0 ; j < m ; j++)
    {
 F = Fj ;
 Fj += d ;
 for (i = 0 ; i < n ; i++)
 {
     { (*F) = 0. ; } ;
     F++ ;
 }
    }
}

canonical_original_code:
static void zero_init_front(int m, int n, double *Fcblock, int d)
{
    int i; int j;
    double *F; double *Fj = Fcblock;
    for (j = 0 ; j < m ; j++)
    {
 F = Fj ;
 Fj += d ;
 for (i = 0 ; i < n ; i++)
 {
     { (*F) = 0. ; } ;
     F++ ;
 }
    }
}

variable_types: m int

variable_types: n int

variable_types: d int

variable_types: i int

variable_types: j int

variable_types:
F
double *

variable_types:
Fj
double *