original_code:
int cholmod_l_factorize_p
(
    cholmod_sparse *A,
    double beta [2],
    long *fset,
    size_t fsize,
    cholmod_factor *L,
    cholmod_common *Common
)
{
    cholmod_sparse *S, *F, *A1, *A2 ;
    long nrow, ncol, stype, convert, n, nsuper, grow2, status ;
    size_t s, t, uncol ;
    int ok = 1 ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_factorize.c", 123, "argument missing", Common) ; } return (0) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_factorize.c", 124, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (1) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_factorize.c", 125, "invalid xtype", Common) ; } return (0) ; } } ;
    { if ((L)->xtype < (0) || (L)->xtype > (3) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_factorize.c", 126, "invalid xtype", Common) ; } return (0) ; } } ;
    nrow = A->nrow ;
    ncol = A->ncol ;
    n = L->n ;
    stype = A->stype ;
    if (L->n != A->nrow)
    {
 cholmod_l_error ((-4), "../Cholesky/cholmod_factorize.c", 133, "A and L dimensions do not match", Common) ;
 return (0) ;
    }
    if (stype != 0 && nrow != ncol)
    {
 cholmod_l_error ((-4), "../Cholesky/cholmod_factorize.c", 138, "matrix invalid", Common) ;
 return (0) ;
    }
    ;
    Common->status = 0 ;
    nsuper = (L->is_super ? L->nsuper : 0) ;
    uncol = ((stype != 0) ? 0 : ncol) ;
    s = cholmod_l_mult_size_t (nsuper, 2, &ok) ;
    s = (((uncol) > (s)) ? (uncol) : (s)) ;
    t = cholmod_l_mult_size_t (nrow, 2, &ok) ;
    s = cholmod_l_add_size_t (s, t, &ok) ;
    if (!ok)
    {
 cholmod_l_error ((-3), "../Cholesky/cholmod_factorize.c", 158, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_l_allocate_work (nrow, s, 0, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    S = ((void *)0) ;
    F = ((void *)0) ;
    A1 = ((void *)0) ;
    A2 = ((void *)0) ;
    convert = !(Common->final_asis) ;
    if (L->is_super)
    {
 if (L->ordering == 0)
 {
     if (stype > 0)
     {
  A1 = cholmod_l_ptranspose (A, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A1 ;
     }
     else if (stype < 0)
     {
  S = A ;
     }
     else
     {
  A1 = cholmod_l_ptranspose (A, 2, ((void *)0), fset, fsize, Common) ;
  F = A1 ;
  S = A ;
     }
 }
 else
 {
     if (stype > 0)
     {
  A1 = cholmod_l_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
  S = A1 ;
     }
     else if (stype < 0)
     {
  A2 = cholmod_l_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
  A1 = cholmod_l_ptranspose (A2, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A1 ;
  cholmod_l_free_sparse (&A2, Common) ;
  ;
     }
     else
     {
  A1 = cholmod_l_ptranspose (A, 2, L->Perm, fset, fsize, Common) ;
  F = A1 ;
  A2 = cholmod_l_ptranspose (F, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A2 ;
     }
 }
 if (Common->status == 0)
 {
     cholmod_l_super_numeric (S, F, beta, L, Common) ;
 }
 status = Common->status ;
 ;
 if (Common->status >= 0 && convert)
 {
     ok = cholmod_l_change_factor (L->xtype, Common->final_ll,
      Common->final_super, Common->final_pack,
      Common->final_monotonic, L, Common) ;
     if (ok && Common->final_resymbol && !(L->is_super))
     {
  cholmod_l_resymbol_noperm (S, fset, fsize, Common->final_pack,
      L, Common) ;
     }
 }
    }
    else
    {
 if (L->ordering == 0)
 {
     if (stype > 0)
     {
  S = A ;
     }
     else if (stype < 0)
     {
  A2 = cholmod_l_ptranspose (A, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A2 ;
     }
     else
     {
  A1 = cholmod_l_ptranspose (A, 2, ((void *)0), fset, fsize, Common) ;
  F = A1 ;
  S = A ;
     }
 }
 else
 {
     if (stype > 0)
     {
  A1 = cholmod_l_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
  A2 = cholmod_l_ptranspose (A1, 2, ((void *)0), ((void *)0), 0, Common) ;
  cholmod_l_free_sparse (&A1, Common) ;
     }
     else if (stype < 0)
     {
  A2 = cholmod_l_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
     }
     else
     {
  A1 = cholmod_l_ptranspose (A, 2, L->Perm, fset, fsize, Common) ;
  F = A1 ;
  A2 = cholmod_l_ptranspose (F, 2, ((void *)0), ((void *)0), 0, Common) ;
     }
     S = A2 ;
 }
 if (Common->status == 0)
 {
     grow2 = Common->grow2 ;
     L->is_ll = ((Common->final_ll) ? 1 : 0) ;
     if (L->xtype == 0 && Common->final_pack)
     {
  Common->grow2 = 0 ;
     }
     cholmod_l_rowfac (S, F, beta, 0, nrow, L, Common) ;
     Common->grow2 = grow2 ;
 }
 status = Common->status ;
 if (Common->status >= 0 && convert)
 {
     cholmod_l_change_factor (L->xtype, L->is_ll, 0,
      Common->final_pack, Common->final_monotonic, L, Common) ;
 }
    }
    cholmod_l_free_sparse (&A1, Common) ;
    cholmod_l_free_sparse (&A2, Common) ;
    Common->status = (((Common->status) > (status)) ? (Common->status) : (status)) ;
    return (Common->status >= 0) ;
}

canonical_original_code:
int cholmod_l_factorize_p(struct cholmod_sparse_struct *A, double beta[2], long *fset, unsigned long fsize, struct cholmod_factor_struct *L, struct cholmod_common_struct *Common)
{
    struct cholmod_sparse_struct *S; struct cholmod_sparse_struct *F; struct cholmod_sparse_struct *A1; struct cholmod_sparse_struct *A2;
    long nrow; long ncol; long stype; long convert; long n; long nsuper; long grow2; long status;
    unsigned long s; unsigned long t; unsigned long uncol;
    int ok = 1;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_factorize.c", 123, "argument missing", Common) ; } return (0) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_factorize.c", 124, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (1) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_factorize.c", 125, "invalid xtype", Common) ; } return (0) ; } } ;
    { if ((L)->xtype < (0) || (L)->xtype > (3) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_factorize.c", 126, "invalid xtype", Common) ; } return (0) ; } } ;
    nrow = A->nrow ;
    ncol = A->ncol ;
    n = L->n ;
    stype = A->stype ;
    if (L->n != A->nrow)
    {
 cholmod_l_error ((-4), "../Cholesky/cholmod_factorize.c", 133, "A and L dimensions do not match", Common) ;
 return (0) ;
    }
    if (stype != 0 && nrow != ncol)
    {
 cholmod_l_error ((-4), "../Cholesky/cholmod_factorize.c", 138, "matrix invalid", Common) ;
 return (0) ;
    }
    ;
    Common->status = 0 ;
    nsuper = (L->is_super ? L->nsuper : 0) ;
    uncol = ((stype != 0) ? 0 : ncol) ;
    s = cholmod_l_mult_size_t (nsuper, 2, &ok) ;
    s = (((uncol) > (s)) ? (uncol) : (s)) ;
    t = cholmod_l_mult_size_t (nrow, 2, &ok) ;
    s = cholmod_l_add_size_t (s, t, &ok) ;
    if (!ok)
    {
 cholmod_l_error ((-3), "../Cholesky/cholmod_factorize.c", 158, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_l_allocate_work (nrow, s, 0, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    S = ((void *)0) ;
    F = ((void *)0) ;
    A1 = ((void *)0) ;
    A2 = ((void *)0) ;
    convert = !(Common->final_asis) ;
    if (L->is_super)
    {
 if (L->ordering == 0)
 {
     if (stype > 0)
     {
  A1 = cholmod_l_ptranspose (A, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A1 ;
     }
     else if (stype < 0)
     {
  S = A ;
     }
     else
     {
  A1 = cholmod_l_ptranspose (A, 2, ((void *)0), fset, fsize, Common) ;
  F = A1 ;
  S = A ;
     }
 }
 else
 {
     if (stype > 0)
     {
  A1 = cholmod_l_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
  S = A1 ;
     }
     else if (stype < 0)
     {
  A2 = cholmod_l_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
  A1 = cholmod_l_ptranspose (A2, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A1 ;
  cholmod_l_free_sparse (&A2, Common) ;
  ;
     }
     else
     {
  A1 = cholmod_l_ptranspose (A, 2, L->Perm, fset, fsize, Common) ;
  F = A1 ;
  A2 = cholmod_l_ptranspose (F, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A2 ;
     }
 }
 if (Common->status == 0)
 {
     cholmod_l_super_numeric (S, F, beta, L, Common) ;
 }
 status = Common->status ;
 ;
 if (Common->status >= 0 && convert)
 {
     ok = cholmod_l_change_factor (L->xtype, Common->final_ll,
      Common->final_super, Common->final_pack,
      Common->final_monotonic, L, Common) ;
     if (ok && Common->final_resymbol && !(L->is_super))
     {
  cholmod_l_resymbol_noperm (S, fset, fsize, Common->final_pack,
      L, Common) ;
     }
 }
    }
    else
    {
 if (L->ordering == 0)
 {
     if (stype > 0)
     {
  S = A ;
     }
     else if (stype < 0)
     {
  A2 = cholmod_l_ptranspose (A, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A2 ;
     }
     else
     {
  A1 = cholmod_l_ptranspose (A, 2, ((void *)0), fset, fsize, Common) ;
  F = A1 ;
  S = A ;
     }
 }
 else
 {
     if (stype > 0)
     {
  A1 = cholmod_l_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
  A2 = cholmod_l_ptranspose (A1, 2, ((void *)0), ((void *)0), 0, Common) ;
  cholmod_l_free_sparse (&A1, Common) ;
     }
     else if (stype < 0)
     {
  A2 = cholmod_l_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
     }
     else
     {
  A1 = cholmod_l_ptranspose (A, 2, L->Perm, fset, fsize, Common) ;
  F = A1 ;
  A2 = cholmod_l_ptranspose (F, 2, ((void *)0), ((void *)0), 0, Common) ;
     }
     S = A2 ;
 }
 if (Common->status == 0)
 {
     grow2 = Common->grow2 ;
     L->is_ll = ((Common->final_ll) ? 1 : 0) ;
     if (L->xtype == 0 && Common->final_pack)
     {
  Common->grow2 = 0 ;
     }
     cholmod_l_rowfac (S, F, beta, 0, nrow, L, Common) ;
     Common->grow2 = grow2 ;
 }
 status = Common->status ;
 if (Common->status >= 0 && convert)
 {
     cholmod_l_change_factor (L->xtype, L->is_ll, 0,
      Common->final_pack, Common->final_monotonic, L, Common) ;
 }
    }
    cholmod_l_free_sparse (&A1, Common) ;
    cholmod_l_free_sparse (&A2, Common) ;
    Common->status = (((Common->status) > (status)) ? (Common->status) : (status)) ;
    return (Common->status >= 0) ;
}

variable_types:
beta
double [2]

variable_types:
fset
long *

variable_types:
fsize
unsigned long

variable_types: nrow long

variable_types: ncol long

variable_types: stype long

variable_types: convert long

variable_types: nsuper long

variable_types: status long

variable_types:
s
unsigned long

variable_types:
t
unsigned long

variable_types:
uncol
unsigned long

variable_types: ok int


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

v4[0] = 0LL;
v4[1] = 0LL;
return cholmod_l_factorize_p(a1, (__int64)v4, 0LL, 0LL, a2, a3);
}

original_code:
int cholmod_l_factorize
(
    cholmod_sparse *A,
    cholmod_factor *L,
    cholmod_common *Common
)
{
    double zero [2] ;
    zero [0] = 0 ;
    zero [1] = 0 ;
    return (cholmod_l_factorize_p (A, zero, ((void *)0), 0, L, Common)) ;
}

canonical_original_code:
int cholmod_l_factorize(struct cholmod_sparse_struct *A, struct cholmod_factor_struct *L, struct cholmod_common_struct *Common)
{
    double zero[2];
    zero [0] = 0 ;
    zero [1] = 0 ;
    return (cholmod_l_factorize_p (A, zero, ((void *)0), 0, L, Common)) ;
}

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

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

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

variable_types:
zero
double [2]

return_type: int

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

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

variable_types: nz long

variable_types:
Ti
long []

variable_types:
Tj
long []

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Rp
long []

variable_types:
Rj
long []

variable_types:
W
long []

variable_types:
RowCount
long []

variable_types: i long

variable_types: j long

variable_types: k long

variable_types: p long

variable_types: cp long

variable_types: pdest long

variable_types: pj long

return_type: long


decompiled_code:
__int64 __fastcall umfpack_zi_report_matrix(int a1, const char *a2, _DWORD *a3, unsigned __int64 a4, __int64 a5, __int64 a6, double a7, double a8, double a9, double a10, int a11, double *a12)
{
int v12; // ebp
__int64 (*v14)(const char *, ...); // r14
double v15; // xmm0_8
int v16; // er13
__int64 result; // rax
__int64 (*v18)(const char *, ...); // r8
__int64 v19; // rcx
int v20; // ebx
__int64 v21; // rdx
__int64 i; // rax
__int64 v23; // rsi
int v24; // edx
__int64 v25; // rax
__int64 v26; // rdx
int v27; // er15
__int64 v28; // r13
int v29; // ebp
__int64 v30; // rcx
__int64 v31; // rbx
int v32; // ebp
char v33; // al
int v34; // er12
__int64 v35; // [rsp+8h] [rbp-90h]
int v36; // [rsp+10h] [rbp-88h]
int v37; // [rsp+14h] [rbp-84h]
double v39; // [rsp+18h] [rbp-80h]
__int64 v40; // [rsp+20h] [rbp-78h]
const char *v41; // [rsp+28h] [rbp-70h]
const char *v42; // [rsp+30h] [rbp-68h]
int v43; // [rsp+38h] [rbp-60h]
int v44; // [rsp+3Ch] [rbp-5Ch]
__int64 v45; // [rsp+40h] [rbp-58h]
_DWORD *v46; // [rsp+48h] [rbp-50h]
int v47; // [rsp+50h] [rbp-48h]

v35 = a6;
if ( !a12 )
return 0LL;
v12 = (int)a2;
v14 = (__int64 (*)(const char *, ...))a4;
v15 = *a12;
v16 = (int)*a12;
result = 0LL;
if ( v16 > 2 )
{
if ( a11 )
{
v37 = a1;
v36 = (int)a2;
v42 = (const char *)&LC0;
v41 = "column";
}
else
{
v37 = (int)a2;
v36 = a1;
v42 = "column";
v41 = (const char *)&LC0;
}
v18 = amd_printf;
if ( amd_printf )
{
v19 = (unsigned int)a2;
a2 = v41;
amd_printf("%s-form matrix, n_row %d n_col %d, ", v41, (unsigned int)a1, v19);
if ( a1 <= 0 || v12 <= 0 )
{
if ( amd_printf )
amd_printf("ERROR: n_row <= 0 or n_col <= 0\n\n");
return 4294967290LL;
}
if ( !a3 )
{
if ( amd_printf )
amd_printf("ERROR: Ap missing\n\n");
return 4294967291LL;
}
}
else
{
if ( a1 <= 0 || (int)a2 <= 0 )
return 4294967290LL;
if ( !a3 )
return 4294967291LL;
}
v20 = a3[v36];
if ( amd_printf )
{
a2 = (const char *)(unsigned int)v20;
amd_printf("nz = %d. ", (unsigned int)v20);
if ( v20 < 0 )
{
if ( amd_printf )
amd_printf("ERROR: number of entries < 0\n\n");
return 4294967288LL;
}
v21 = (unsigned int)*a3;
if ( (_DWORD)v21 )
{
if ( amd_printf )
amd_printf("ERROR: Ap [%d] = %d must be %d\n\n", 0LL, v21, 0LL);
return 4294967288LL;
}
}
else
{
if ( v20 < 0 )
return 4294967288LL;
if ( *a3 )
return 4294967288LL;
}
if ( v14 )
{
if ( v16 <= 3 )
{
if ( v36 <= 0 )
goto LABEL_121;
}
else
{
if ( amd_printf )
amd_printf("\n");
if ( v36 <= 0 )
{
LABEL_100:
result = 0LL;
if ( !amd_printf )
return result;
a2 = v41;
amd_printf(" %s-form matrix ", v41);
goto LABEL_121;
}
}
a4 = (unsigned int)v36;
for ( i = 0LL; i != v36; ++i )
{
v23 = (unsigned int)i;
v24 = a3[i];
if ( v24 < 0 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: Ap [%d] < 0\n\n", v23);
result = 4294967288LL;
}
return result;
}
if ( v24 > v20 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: Ap [%d] > size of Ai\n\n", v23);
result = 4294967288LL;
}
return result;
}
}
v25 = 0LL;
while ( 1 )
{
v26 = (unsigned int)v25;
if ( a3[v25 + 1] - a3[v25] < 0 )
break;
if ( ++v25 == v36 )
{
v27 = v16;
v45 = 0LL;
v47 = v16;
v46 = a3;
v28 = a5;
while ( 1 )
{
if ( (int)v45 <= 9 )
v27 = v47;
a2 = (const char *)(unsigned int)v46[v45];
v43 = (int)a2;
v29 = v46[v45 + 1];
a6 = (unsigned int)(v29 - (_DWORD)a2);
v44 = v29 - (_DWORD)a2;
if ( v27 > 3 && amd_printf )
{
v30 = (unsigned int)a2;
a2 = v41;
amd_printf(
"\n %s %d: start: %d end: %d entries: %d\n",
v41,
(unsigned int)v45,
v30,
(unsigned int)(v29 - 1),
a6);
}
if ( v43 < v29 )
break;
LABEL_92:
if ( v36 > 10 && (_DWORD)v45 == 9 && v27 == 4 )
{
if ( amd_printf )
amd_printf("\n ...\n", a2, amd_printf, a4, v18, a6);
v27 = 3;
}
else if ( v36 <= (int)v45 + 1 )
{
if ( v47 > 3 )
goto LABEL_100;
LABEL_121:
if ( amd_printf )
amd_printf("OK\n\n", a2, amd_printf, a4, v18, a6);
return 0LL;
}
++v45;
}
v31 = v43 + 1;
v40 = (unsigned int)(v29 - 1 - v43) + (__int64)v43 + 2;
v32 = -1;
while ( 2 )
{
v34 = v32;
v32 = *((_DWORD *)v14 + v31 - 1);
v33 = 0;
if ( v27 > 3 )
{
a4 = (unsigned __int64)amd_printf;
if ( amd_printf )
{
a2 = v42;
amd_printf("\t%s %d ", v42, (unsigned int)v32);
if ( v28 )
{
if ( amd_printf )
amd_printf(":");
LABEL_75:
if ( v35 )
{
v15 = *(double *)(v28 + 8 * v31 - 8);
v39 = *(double *)(v35 + 8 * v31 - 8);
}
else
{
v15 = *(double *)(v28 + 16 * v31 - 16);
v39 = *(double *)(v28 + 16 * v31 - 8);
}
if ( v15 == 0.0 )
{
if ( amd_printf )
amd_printf(" (0");
}
else if ( amd_printf )
{
amd_printf(" (%g", v15);
}
a9 = 0.0;
a8 = v39;
if ( v39 < 0.0 )
{
v33 = 1;
if ( amd_printf )
{
*(_QWORD *)&a8 = *(_QWORD *)&v39 ^ LC19;
*(_QWORD *)&v15 = *(_QWORD *)&v39 ^ LC19;
amd_printf(" - %gi)", COERCE_DOUBLE(*(_QWORD *)&v39 ^ LC19));
v33 = 1;
}
}
else
{
a10 = v39;
if ( v39 == 0.0 )
{
v33 = 1;
if ( amd_printf )
{
amd_printf(" + 0i)", v15, v39, 0.0, v39);
v33 = 1;
}
}
else
{
v33 = 1;
if ( amd_printf )
{
v15 = v39;
amd_printf(" + %gi)", v39);
v33 = 1;
}
}
}
}
else
{
v33 = 1;
}
}
else
{
if ( v28 )
goto LABEL_75;
v33 = 1;
}
}
if ( v32 < 0 || v37 <= v32 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf(
" ERROR: %s index %d out of range in %s %d\n\n",
v42,
(unsigned int)v32,
v41,
(unsigned int)v45);
result = 4294967288LL;
}
return result;
}
if ( v32 <= v34 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf(
" ERROR: %s index %d out of order (or duplicate) in %s %d\n\n",
v42,
(unsigned int)v32,
v41,
(unsigned int)v45);
result = 4294967288LL;
}
return result;
}
if ( v33 && amd_printf )
amd_printf("\n", v15, a8, a9, a10);
if ( v27 == 4 && (_DWORD)v31 + ~v43 == 9 && v44 > 10 )
{
if ( amd_printf )
amd_printf("\t...\n", v15, a8, a9, a10);
v27 = 3;
}
if ( ++v31 == v40 )
goto LABEL_92;
continue;
}
}
}
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: # entries in %s %d is < 0\n\n", v41, v26);
result = 4294967288LL;
}
}
else
{
result = 4294967291LL;
if ( amd_printf )
{
amd_printf("ERROR: Ai missing\n\n");
result = 4294967291LL;
}
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, const char *a2, _DWORD *a3, unsigned __int64 a4, __int64 a5, __int64 a6, double a7, double a8, double a9, double a10, int a11, double *a12)
{
int v12; // ebp
__int64 (*v14)(const char *, ...); // r14
double v15; // xmm0_8
int v16; // er13
__int64 result; // rax
__int64 (*v18)(const char *, ...); // r8
__int64 v19; // rcx
int v20; // ebx
__int64 v21; // rdx
__int64 i; // rax
__int64 v23; // rsi
int v24; // edx
__int64 v25; // rax
__int64 v26; // rdx
int v27; // er15
__int64 v28; // r13
int v29; // ebp
__int64 v30; // rcx
__int64 v31; // rbx
int v32; // ebp
char v33; // al
int v34; // er12
__int64 v35; // [rsp+8h] [rbp-90h]
int v36; // [rsp+10h] [rbp-88h]
int v37; // [rsp+14h] [rbp-84h]
double v39; // [rsp+18h] [rbp-80h]
__int64 v40; // [rsp+20h] [rbp-78h]
const char *v41; // [rsp+28h] [rbp-70h]
const char *v42; // [rsp+30h] [rbp-68h]
int v43; // [rsp+38h] [rbp-60h]
int v44; // [rsp+3Ch] [rbp-5Ch]
__int64 v45; // [rsp+40h] [rbp-58h]
_DWORD *v46; // [rsp+48h] [rbp-50h]
int v47; // [rsp+50h] [rbp-48h]

v35 = a6;
if ( !a12 )
return 0LL;
v12 = (int)a2;
v14 = (__int64 (*)(const char *, ...))a4;
v15 = *a12;
v16 = (int)*a12;
result = 0LL;
if ( v16 > 2 )
{
if ( a11 )
{
v37 = a1;
v36 = (int)a2;
v42 = (const char *)&LC0;
v41 = "column";
}
else
{
v37 = (int)a2;
v36 = a1;
v42 = "column";
v41 = (const char *)&LC0;
}
v18 = amd_printf;
if ( amd_printf )
{
v19 = (unsigned int)a2;
a2 = v41;
amd_printf("%s-form matrix, n_row %d n_col %d, ", v41, (unsigned int)a1, v19);
if ( a1 <= 0 || v12 <= 0 )
{
if ( amd_printf )
amd_printf("ERROR: n_row <= 0 or n_col <= 0\n\n");
return 4294967290LL;
}
if ( !a3 )
{
if ( amd_printf )
amd_printf("ERROR: Ap missing\n\n");
return 4294967291LL;
}
}
else
{
if ( a1 <= 0 || (int)a2 <= 0 )
return 4294967290LL;
if ( !a3 )
return 4294967291LL;
}
v20 = a3[v36];
if ( amd_printf )
{
a2 = (const char *)(unsigned int)v20;
amd_printf("nz = %d. ", (unsigned int)v20);
if ( v20 < 0 )
{
if ( amd_printf )
amd_printf("ERROR: number of entries < 0\n\n");
return 4294967288LL;
}
v21 = (unsigned int)*a3;
if ( (_DWORD)v21 )
{
if ( amd_printf )
amd_printf("ERROR: Ap [%d] = %d must be %d\n\n", 0LL, v21, 0LL);
return 4294967288LL;
}
}
else
{
if ( v20 < 0 )
return 4294967288LL;
if ( *a3 )
return 4294967288LL;
}
if ( v14 )
{
if ( v16 <= 3 )
{
if ( v36 <= 0 )
goto LABEL_121;
}
else
{
if ( amd_printf )
amd_printf("\n");
if ( v36 <= 0 )
{
LABEL_100:
result = 0LL;
if ( !amd_printf )
return result;
a2 = v41;
amd_printf(" %s-form matrix ", v41);
goto LABEL_121;
}
}
a4 = (unsigned int)v36;
for ( i = 0LL; i != v36; ++i )
{
v23 = (unsigned int)i;
v24 = a3[i];
if ( v24 < 0 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: Ap [%d] < 0\n\n", v23);
result = 4294967288LL;
}
return result;
}
if ( v24 > v20 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: Ap [%d] > size of Ai\n\n", v23);
result = 4294967288LL;
}
return result;
}
}
v25 = 0LL;
while ( 1 )
{
v26 = (unsigned int)v25;
if ( a3[v25 + 1] - a3[v25] < 0 )
break;
if ( ++v25 == v36 )
{
v27 = v16;
v45 = 0LL;
v47 = v16;
v46 = a3;
v28 = a5;
while ( 1 )
{
if ( (int)v45 <= 9 )
v27 = v47;
a2 = (const char *)(unsigned int)v46[v45];
v43 = (int)a2;
v29 = v46[v45 + 1];
a6 = (unsigned int)(v29 - (_DWORD)a2);
v44 = v29 - (_DWORD)a2;
if ( v27 > 3 && amd_printf )
{
v30 = (unsigned int)a2;
a2 = v41;
amd_printf(
"\n %s %d: start: %d end: %d entries: %d\n",
v41,
(unsigned int)v45,
v30,
(unsigned int)(v29 - 1),
a6);
}
if ( v43 < v29 )
break;
LABEL_92:
if ( v36 > 10 && (_DWORD)v45 == 9 && v27 == 4 )
{
if ( amd_printf )
amd_printf("\n ...\n", a2, amd_printf, a4, v18, a6);
v27 = 3;
}
else if ( v36 <= (int)v45 + 1 )
{
if ( v47 > 3 )
goto LABEL_100;
LABEL_121:
if ( amd_printf )
amd_printf("OK\n\n", a2, amd_printf, a4, v18, a6);
return 0LL;
}
++v45;
}
v31 = v43 + 1;
v40 = (unsigned int)(v29 - 1 - v43) + (__int64)v43 + 2;
v32 = -1;
while ( 2 )
{
v34 = v32;
v32 = *((_DWORD *)v14 + v31 - 1);
v33 = 0;
if ( v27 > 3 )
{
a4 = (unsigned __int64)amd_printf;
if ( amd_printf )
{
a2 = v42;
amd_printf("\t%s %d ", v42, (unsigned int)v32);
if ( v28 )
{
if ( amd_printf )
amd_printf(":");
LABEL_75:
if ( v35 )
{
v15 = *(double *)(v28 + 8 * v31 - 8);
v39 = *(double *)(v35 + 8 * v31 - 8);
}
else
{
v15 = *(double *)(v28 + 16 * v31 - 16);
v39 = *(double *)(v28 + 16 * v31 - 8);
}
if ( v15 == 0.0 )
{
if ( amd_printf )
amd_printf(" (0");
}
else if ( amd_printf )
{
amd_printf(" (%g", v15);
}
a9 = 0.0;
a8 = v39;
if ( v39 < 0.0 )
{
v33 = 1;
if ( amd_printf )
{
*(_QWORD *)&a8 = *(_QWORD *)&v39 ^ LC19;
*(_QWORD *)&v15 = *(_QWORD *)&v39 ^ LC19;
amd_printf(" - %gi)", COERCE_DOUBLE(*(_QWORD *)&v39 ^ LC19));
v33 = 1;
}
}
else
{
a10 = v39;
if ( v39 == 0.0 )
{
v33 = 1;
if ( amd_printf )
{
amd_printf(" + 0i)", v15, v39, 0.0, v39);
v33 = 1;
}
}
else
{
v33 = 1;
if ( amd_printf )
{
v15 = v39;
amd_printf(" + %gi)", v39);
v33 = 1;
}
}
}
}
else
{
v33 = 1;
}
}
else
{
if ( v28 )
goto LABEL_75;
v33 = 1;
}
}
if ( v32 < 0 || v37 <= v32 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf(
" ERROR: %s index %d out of range in %s %d\n\n",
v42,
(unsigned int)v32,
v41,
(unsigned int)v45);
result = 4294967288LL;
}
return result;
}
if ( v32 <= v34 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf(
" ERROR: %s index %d out of order (or duplicate) in %s %d\n\n",
v42,
(unsigned int)v32,
v41,
(unsigned int)v45);
result = 4294967288LL;
}
return result;
}
if ( v33 && amd_printf )
amd_printf("\n", v15, a8, a9, a10);
if ( v27 == 4 && (_DWORD)v31 + ~v43 == 9 && v44 > 10 )
{
if ( amd_printf )
amd_printf("\t...\n", v15, a8, a9, a10);
v27 = 3;
}
if ( ++v31 == v40 )
goto LABEL_92;
continue;
}
}
}
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: # entries in %s %d is < 0\n\n", v41, v26);
result = 4294967288LL;
}
}
else
{
result = 4294967291LL;
if ( amd_printf )
{
amd_printf("ERROR: Ai missing\n\n");
result = 4294967291LL;
}
}
}
return result;
}

original_code:
int umfpack_zi_report_matrix
(
    int n_row,
    int n_col,
    const int Ap [ ],
    const int Ai [ ],
    const double Ax [ ],
    const double Az [ ],
    int col_form,
    const double Control [20]
)
{
    DoubleComplex a ;
    int prl, i, k, length, ilast, p, nz, prl1, p1, p2, n, n_i, do_values ;
    char *vector_kind, *index_kind ;
    int split = ((Az) != (double *) ((void *)0)) ;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    if (col_form)
    {
 vector_kind = "column" ;
 index_kind = "row" ;
 n = n_col ;
 n_i = n_row ;
    }
    else
    {
 vector_kind = "row" ;
 index_kind = "column" ;
 n = n_row ;
 n_i = n_col ;
    }
    { if (amd_printf != ((void *)0)) (void) amd_printf ("%s-form matrix, n_row ""%d"" n_col ""%d"", ", vector_kind, n_row, n_col) ; } ;
    if (n_row <= 0 || n_col <= 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: n_row <= 0 or n_col <= 0\n\n") ; } ;
 return ((-6)) ;
    }
    if (!Ap)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Ap missing\n\n") ; } ;
 return ((-5)) ;
    }
    nz = Ap [n] ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("nz = ""%d"". ", nz) ; } ;
    if (nz < 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: number of entries < 0\n\n") ; } ;
 return ((-8)) ;
    }
    if (Ap [0] != 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Ap [""%d""] = ""%d"" must be ""%d""\n\n", (int) (0), (Ap [0]), (int) (0)) ; } ;
 return ((-8)) ;
    }
    if (!Ai)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Ai missing\n\n") ; } ;
 return ((-5)) ;
    }
    do_values = Ax != (double *) ((void *)0) ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    for (k = 0 ; k < n ; k++)
    {
 if (Ap [k] < 0)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Ap [""%d""] < 0\n\n", (k)) ; } ;
     return ((-8)) ;
 }
 if (Ap [k] > nz)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Ap [""%d""] > size of Ai\n\n", (k)) ; } ;
     return ((-8)) ;
 }
    }
    for (k = 0 ; k < n ; k++)
    {
 length = Ap [k+1] - Ap [k] ;
 if (length < 0)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: # entries in %s ""%d"" is < 0\n\n", vector_kind, (k)) ; } ;
     return ((-8)) ;
 }
    }
    prl1 = prl ;
    for (k = 0 ; k < n ; k++)
    {
 if (k < 10)
 {
     prl = prl1 ;
 }
 p1 = Ap [k] ;
 p2 = Ap [k+1] ;
 length = p2 - p1 ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n    %s ""%d"": start: ""%d"" end: ""%d"" entries: ""%d""\n", vector_kind, (k), p1, p2-1, length) ; } ; } } ;
 ilast = (-1) ;
 for (p = p1 ; p < p2 ; p++)
 {
     i = Ai [p] ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t%s ""%d"" ", index_kind, (i)) ; } ; } } ;
     if (do_values && prl >= 4)
     {
  { if (amd_printf != ((void *)0)) (void) amd_printf (":") ; } ;
  { if (split) { (a).component [0] = (Ax)[p] ; (a).component [1] = (Az)[p] ; } else { (a) = ((DoubleComplex *)(Ax))[p] ; } } ;
  { if ((((a).component [0]) != 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" (%g", (a).component [0]) ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" (0") ; } ; } if ((((a).component [1]) < 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" - %gi)", -(a).component [1]) ; } ; } else if ((((a).component [1]) == 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" + 0i)") ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" + %gi)", (a).component [1]) ; } ; } } ;
     }
     if (i < 0 || i >= n_i)
     {
  { if (amd_printf != ((void *)0)) (void) amd_printf (" ERROR: %s index ""%d"" out of range in %s ""%d""\n\n", index_kind, (i), vector_kind, (k)) ; } ;
  return ((-8)) ;
     }
     if (i <= ilast)
     {
  { if (amd_printf != ((void *)0)) (void) amd_printf (" ERROR: %s index ""%d"" out of order (or duplicate) in " "%s ""%d""\n\n", index_kind, (i), vector_kind, (k)) ; } ;
  return ((-8)) ;
     }
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
     if (prl == 4 && (p - p1) == 9 && length > 10)
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t...\n") ; } ; } } ;
  prl-- ;
     }
     ilast = i ;
 }
 if (prl == 4 && k == 9 && n > 10)
 {
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n    ...\n") ; } ; } } ;
     prl-- ;
 }
    }
    prl = prl1 ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    %s-form matrix ", vector_kind) ; } ; } } ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    return ((0)) ;
}

canonical_original_code:
int umfpack_zi_report_matrix(int n_row, int n_col, int Ap[], int Ai[], double Ax[], double Az[], int col_form, double Control[20])
{
    struct DoubleComplex a;
    int prl; int i; int k; int length; int ilast; int p; int nz; int prl1; int p1; int p2; int n; int n_i; int do_values;
    char *vector_kind; char *index_kind;
    int split = ((Az) != (double *) ((void *)0));
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    if (col_form)
    {
 vector_kind = "column" ;
 index_kind = "row" ;
 n = n_col ;
 n_i = n_row ;
    }
    else
    {
 vector_kind = "row" ;
 index_kind = "column" ;
 n = n_row ;
 n_i = n_col ;
    }
    { if (amd_printf != ((void *)0)) (void) amd_printf ("%s-form matrix, n_row ""%d"" n_col ""%d"", ", vector_kind, n_row, n_col) ; } ;
    if (n_row <= 0 || n_col <= 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: n_row <= 0 or n_col <= 0\n\n") ; } ;
 return ((-6)) ;
    }
    if (!Ap)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Ap missing\n\n") ; } ;
 return ((-5)) ;
    }
    nz = Ap [n] ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("nz = ""%d"". ", nz) ; } ;
    if (nz < 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: number of entries < 0\n\n") ; } ;
 return ((-8)) ;
    }
    if (Ap [0] != 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Ap [""%d""] = ""%d"" must be ""%d""\n\n", (int) (0), (Ap [0]), (int) (0)) ; } ;
 return ((-8)) ;
    }
    if (!Ai)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Ai missing\n\n") ; } ;
 return ((-5)) ;
    }
    do_values = Ax != (double *) ((void *)0) ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    for (k = 0 ; k < n ; k++)
    {
 if (Ap [k] < 0)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Ap [""%d""] < 0\n\n", (k)) ; } ;
     return ((-8)) ;
 }
 if (Ap [k] > nz)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Ap [""%d""] > size of Ai\n\n", (k)) ; } ;
     return ((-8)) ;
 }
    }
    for (k = 0 ; k < n ; k++)
    {
 length = Ap [k+1] - Ap [k] ;
 if (length < 0)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: # entries in %s ""%d"" is < 0\n\n", vector_kind, (k)) ; } ;
     return ((-8)) ;
 }
    }
    prl1 = prl ;
    for (k = 0 ; k < n ; k++)
    {
 if (k < 10)
 {
     prl = prl1 ;
 }
 p1 = Ap [k] ;
 p2 = Ap [k+1] ;
 length = p2 - p1 ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n    %s ""%d"": start: ""%d"" end: ""%d"" entries: ""%d""\n", vector_kind, (k), p1, p2-1, length) ; } ; } } ;
 ilast = (-1) ;
 for (p = p1 ; p < p2 ; p++)
 {
     i = Ai [p] ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t%s ""%d"" ", index_kind, (i)) ; } ; } } ;
     if (do_values && prl >= 4)
     {
  { if (amd_printf != ((void *)0)) (void) amd_printf (":") ; } ;
  { if (split) { (a).component [0] = (Ax)[p] ; (a).component [1] = (Az)[p] ; } else { (a) = ((struct DoubleComplex *)(Ax))[p] ; } } ;
  { if ((((a).component [0]) != 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" (%g", (a).component [0]) ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" (0") ; } ; } if ((((a).component [1]) < 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" - %gi)", -(a).component [1]) ; } ; } else if ((((a).component [1]) == 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" + 0i)") ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" + %gi)", (a).component [1]) ; } ; } } ;
     }
     if (i < 0 || i >= n_i)
     {
  { if (amd_printf != ((void *)0)) (void) amd_printf (" ERROR: %s index ""%d"" out of range in %s ""%d""\n\n", index_kind, (i), vector_kind, (k)) ; } ;
  return ((-8)) ;
     }
     if (i <= ilast)
     {
  { if (amd_printf != ((void *)0)) (void) amd_printf (" ERROR: %s index ""%d"" out of order (or duplicate) in " "%s ""%d""\n\n", index_kind, (i), vector_kind, (k)) ; } ;
  return ((-8)) ;
     }
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
     if (prl == 4 && (p - p1) == 9 && length > 10)
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t...\n") ; } ; } } ;
  prl-- ;
     }
     ilast = i ;
 }
 if (prl == 4 && k == 9 && n > 10)
 {
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n    ...\n") ; } ; } } ;
     prl-- ;
 }
    }
    prl = prl1 ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    %s-form matrix ", vector_kind) ; } ; } } ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    return ((0)) ;
}

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Ax
double []

variable_types:
Az
double []

variable_types:
Control
double [20]

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

variable_types: prl int

variable_types: i int

variable_types: k int

variable_types: length int

variable_types: ilast int

variable_types: p int

variable_types: nz int

variable_types: n int

variable_types: split int


decompiled_code:
__int64 __fastcall umfpack_dl_report_perm(__int64 a1, __int64 a2, double *a3)
{
unsigned __int64 v4; // r13
__int64 v5; // rbx
bool v6; // cc
__int64 v7; // rdi
__int64 v8; // r14

if ( !a3 )
return 0LL;
v4 = (unsigned int)(int)*a3;
v5 = 0LL;
if ( v4 > 2 )
{
v6 = a1 <= 0;
v7 = 1LL;
if ( !v6 )
v7 = a1;
v8 = umf_l_malloc(v7, 8LL);
v5 = umf_l_report_perm(a1, a2, v8, v4, 1LL);
umf_l_free(v8);
}
return v5;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, double *a3)
{
unsigned __int64 v4; // r13
__int64 v5; // rbx
bool v6; // cc
__int64 v7; // rdi
__int64 v8; // r14

if ( !a3 )
return 0LL;
v4 = (unsigned int)(int)*a3;
v5 = 0LL;
if ( v4 > 2 )
{
v6 = a1 <= 0;
v7 = 1LL;
if ( !v6 )
v7 = a1;
v8 = umf_l_malloc(v7, 8LL);
v5 = umf_l_report_perm(a1, a2, v8, v4, 1LL);
umf_l_free(v8);
}
return v5;
}

original_code:
long umfpack_dl_report_perm
(
    long np,
    const long Perm [ ],
    const double Control [20]
)
{
    long prl, *W, status ;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    W = (long *) umf_l_malloc ((((np) > (1)) ? (np) : (1)), sizeof (long)) ;
    status = umf_l_report_perm (np, Perm, W, prl, 1) ;
    (void) umf_l_free ((void *) W) ;
    return (status) ;
}

canonical_original_code:
long umfpack_dl_report_perm(long np, long Perm[], double Control[20])
{
    long prl; long *W; long status;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    W = (long *) umf_l_malloc ((((np) > (1)) ? (np) : (1)), sizeof (long)) ;
    status = umf_l_report_perm (np, Perm, W, prl, 1) ;
    (void) umf_l_free ((void *) W) ;
    return (status) ;
}

variable_types: np long

variable_types:
Perm
long []

variable_types: prl long

variable_types:
W
long *

variable_types: status long


original_code:
int umfpack_zi_scale
(
    double Xx [ ],
    double Xz [ ],
    const double Bx [ ],
    const double Bz [ ],
    void *NumericHandle
)
{
    NumericType *Numeric ;
    int n, i ;
    double *Rs ;
    int split = ((Xz) != (double *) ((void *)0)) && ((Bz) != (double *) ((void *)0)) ;
    Numeric = (NumericType *) NumericHandle ;
    if (!umfzi_valid_numeric (Numeric))
    {
 return ((-3)) ;
    }
    n = Numeric->n_row ;
    Rs = Numeric->Rs ;
    if (!Xx || !Bx)
    {
 return ((-5)) ;
    }
    if (Rs != (double *) ((void *)0))
    {
 if (Numeric->do_recip)
 {
     if (split)
     {
  for (i = 0 ; i < n ; i++)
  {
      Xx [i] = Bx [i] * Rs [i] ;
      Xz [i] = Bz [i] * Rs [i] ;
  }
     }
     else
     {
  for (i = 0 ; i < n ; i++)
  {
      Xx [2*i ] = Bx [2*i ] * Rs [i] ;
      Xx [2*i+1] = Bx [2*i+1] * Rs [i] ;
  }
     }
 }
 else
 {
     if (split)
     {
  for (i = 0 ; i < n ; i++)
  {
      Xx [i] = Bx [i] / Rs [i] ;
      Xz [i] = Bz [i] / Rs [i] ;
  }
     }
     else
     {
  for (i = 0 ; i < n ; i++)
  {
      Xx [2*i ] = Bx [2*i ] / Rs [i] ;
      Xx [2*i+1] = Bx [2*i+1] / Rs [i] ;
  }
     }
 }
    }
    else
    {
        if (split)
 {
     for (i = 0 ; i < n ; i++)
     {
  Xx [i] = Bx [i] ;
  Xz [i] = Bz [i] ;
     }
 }
 else
 {
     for (i = 0 ; i < n ; i++)
     {
  Xx [2*i ] = Bx [2*i ] ;
  Xx [2*i+1] = Bx [2*i+1] ;
     }
 }
    }
    return ((0)) ;
}

canonical_original_code:
int umfpack_zi_scale(double Xx[], double Xz[], double Bx[], double Bz[], void *NumericHandle)
{
    struct NumericType *Numeric;
    int n; int i;
    double *Rs;
    int split = ((Xz) != (double *) ((void *)0)) && ((Bz) != (double *) ((void *)0));
    Numeric = (struct NumericType *) NumericHandle ;
    if (!umfzi_valid_numeric (Numeric))
    {
 return ((-3)) ;
    }
    n = Numeric->n_row ;
    Rs = Numeric->Rs ;
    if (!Xx || !Bx)
    {
 return ((-5)) ;
    }
    if (Rs != (double *) ((void *)0))
    {
 if (Numeric->do_recip)
 {
     if (split)
     {
  for (i = 0 ; i < n ; i++)
  {
      Xx [i] = Bx [i] * Rs [i] ;
      Xz [i] = Bz [i] * Rs [i] ;
  }
     }
     else
     {
  for (i = 0 ; i < n ; i++)
  {
      Xx [2*i ] = Bx [2*i ] * Rs [i] ;
      Xx [2*i+1] = Bx [2*i+1] * Rs [i] ;
  }
     }
 }
 else
 {
     if (split)
     {
  for (i = 0 ; i < n ; i++)
  {
      Xx [i] = Bx [i] / Rs [i] ;
      Xz [i] = Bz [i] / Rs [i] ;
  }
     }
     else
     {
  for (i = 0 ; i < n ; i++)
  {
      Xx [2*i ] = Bx [2*i ] / Rs [i] ;
      Xx [2*i+1] = Bx [2*i+1] / Rs [i] ;
  }
     }
 }
    }
    else
    {
        if (split)
 {
     for (i = 0 ; i < n ; i++)
     {
  Xx [i] = Bx [i] ;
  Xz [i] = Bz [i] ;
     }
 }
 else
 {
     for (i = 0 ; i < n ; i++)
     {
  Xx [2*i ] = Bx [2*i ] ;
  Xx [2*i+1] = Bx [2*i+1] ;
     }
 }
    }
    return ((0)) ;
}

variable_types:
Xx
double []

variable_types:
Xz
double []

variable_types:
Bx
double []

variable_types:
Bz
double []

variable_types:
NumericHandle
void *

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:
Rs
double *

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


original_code:
long umfdl_mem_alloc_element
(
    NumericType *Numeric,
    long nrows,
    long ncols,
    long **Rows,
    long **Cols,
    double **C,
    long *size,
    Element **epout
)
{
    Element *ep ;
    Unit *p ;
    long i ;
    ;
    ;
    *size = ((((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (long) * ((ncols) + (nrows)))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (double) * ((ncols) * (nrows)))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    if (((!((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (long) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || ((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (long) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) != (((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (long) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1))))
    {
 return (0) ;
    }
    i = umfdl_mem_alloc_tail_block (Numeric, *size) ;
    (*size)++ ;
    if (!i)
    {
 ;
 return (0) ;
    }
    p = Numeric->Memory + i ;
    ep = (Element *) p ;
    ;
    p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
    *Cols = (long *) p ;
    *Rows = *Cols + ncols ;
    p += (((((sizeof (long) * (ncols + nrows))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
    *C = (double *) p ;
    ep->nrows = nrows ;
    ep->ncols = ncols ;
    ep->nrowsleft = nrows ;
    ep->ncolsleft = ncols ;
    ep->cdeg = 0 ;
    ep->rdeg = 0 ;
    ep->next = (-1) ;
    ;
    ;
    *epout = ep ;
    return (i) ;
}

canonical_original_code:
long umfdl_mem_alloc_element(struct NumericType *Numeric, long nrows, long ncols, long **Rows, long **Cols, double **C, long *size, struct Element **epout)
{
    struct Element *ep;
    union Unit_union *p;
    long i;
    ;
    ;
    *size = ((((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (long) * ((ncols) + (nrows)))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (double) * ((ncols) * (nrows)))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    if (((!((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (long) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || ((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (long) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) != (((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (long) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1))))
    {
 return (0) ;
    }
    i = umfdl_mem_alloc_tail_block (Numeric, *size) ;
    (*size)++ ;
    if (!i)
    {
 ;
 return (0) ;
    }
    p = Numeric->Memory + i ;
    ep = (struct Element *) p ;
    ;
    p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
    *Cols = (long *) p ;
    *Rows = *Cols + ncols ;
    p += (((((sizeof (long) * (ncols + nrows))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
    *C = (double *) p ;
    ep->nrows = nrows ;
    ep->ncols = ncols ;
    ep->nrowsleft = nrows ;
    ep->ncolsleft = ncols ;
    ep->cdeg = 0 ;
    ep->rdeg = 0 ;
    ep->next = (-1) ;
    ;
    ;
    *epout = ep ;
    return (i) ;
}

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: nrows long

variable_types: ncols long

variable_types:
Rows
long **

variable_types:
Cols
long **

variable_types:
C
double **

variable_types:
size
long *

variable_types:
epout
struct Element { long cdeg; } **

variable_types:
ep
struct Element { long cdeg; } *

variable_types: i long

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


original_code:
long umfzl_transpose
(
    long n_row,
    long n_col,
    const long Ap [ ],
    const long Ai [ ],
    const double Ax [ ],
    const long P [ ],
    const long Q [ ],
    long nq,
    long Rp [ ],
    long Ri [ ],
    double Rx [ ],
    long W [ ],
    long check
    , const double Az [ ]
    , double Rz [ ]
    , long do_conjugate
)
{
    long i, j, k, p, bp, newj, do_values ;
    long split ;
    if (check)
    {
 if (!Ai || !Ap || !Ri || !Rp || !W)
 {
     return ((-5)) ;
 }
 if (n_row <= 0 || n_col <= 0)
 {
     return ((-6)) ;
 }
 if (!umf_l_is_permutation (P, W, n_row, n_row) ||
     !umf_l_is_permutation (Q, W, nq, nq))
 {
     return ((-15)) ;
 }
 if (amd_l_valid (n_row, n_col, Ap, Ai) != 0)
 {
     return ((-8)) ;
 }
    }
    for (i = 0 ; i < n_row ; i++)
    {
 W [i] = 0 ;
 Rp [i] = 0 ;
    }
    if (Q != (long *) ((void *)0))
    {
 for (newj = 0 ; newj < nq ; newj++)
 {
     j = Q [newj] ;
     ;
     for (p = Ap [j] ; p < Ap [j+1] ; p++)
     {
  i = Ai [p] ;
  ;
  W [i]++ ;
     }
 }
    }
    else
    {
 for (j = 0 ; j < n_col ; j++)
 {
     for (p = Ap [j] ; p < Ap [j+1] ; p++)
     {
  i = Ai [p] ;
  ;
  W [i]++ ;
     }
 }
    }
    if (P != (long *) ((void *)0))
    {
 Rp [0] = 0 ;
 for (k = 0 ; k < n_row ; k++)
 {
     i = P [k] ;
     ;
     Rp [k+1] = Rp [k] + W [i] ;
 }
 for (k = 0 ; k < n_row ; k++)
 {
     i = P [k] ;
     ;
     W [i] = Rp [k] ;
 }
    }
    else
    {
 Rp [0] = 0 ;
 for (i = 0 ; i < n_row ; i++)
 {
     Rp [i+1] = Rp [i] + W [i] ;
 }
 for (i = 0 ; i < n_row ; i++)
 {
     W [i] = Rp [i] ;
 }
    }
    ;
    do_values = Ax && Rx ;
    split = ((Az) != (double *) ((void *)0)) && ((Rz) != (double *) ((void *)0)) ;
    if (do_conjugate && do_values)
    {
 if (Q != (long *) ((void *)0))
 {
     if (split)
     {
  for (newj = 0 ; newj < nq ; newj++)
  {
      j = Q [newj] ;
      ;
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   bp = W [Ai [p]]++ ;
   Ri [bp] = newj ;
   Rx [bp] = Ax [p] ;
   Rz [bp] = -Az [p] ;
      }
  }
     }
     else
     {
  for (newj = 0 ; newj < nq ; newj++)
  {
      j = Q [newj] ;
      ;
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   bp = W [Ai [p]]++ ;
   Ri [bp] = newj ;
   Rx [2*bp] = Ax [2*p] ;
   Rx [2*bp+1] = -Ax [2*p+1] ;
      }
  }
     }
 }
 else
 {
     if (split)
     {
  for (j = 0 ; j < n_col ; j++)
  {
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   bp = W [Ai [p]]++ ;
   Ri [bp] = j ;
   Rx [bp] = Ax [p] ;
   Rz [bp] = -Az [p] ;
      }
  }
     }
     else
     {
  for (j = 0 ; j < n_col ; j++)
  {
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   bp = W [Ai [p]]++ ;
   Ri [bp] = j ;
   Rx [2*bp] = Ax [2*p] ;
   Rx [2*bp+1] = -Ax [2*p+1] ;
      }
  }
     }
 }
    }
    else
    {
 if (Q != (long *) ((void *)0))
 {
     if (do_values)
     {
  if (split)
  {
      for (newj = 0 ; newj < nq ; newj++)
      {
   j = Q [newj] ;
   ;
   for (p = Ap [j] ; p < Ap [j+1] ; p++)
   {
       bp = W [Ai [p]]++ ;
       Ri [bp] = newj ;
       Rx [bp] = Ax [p] ;
       Rz [bp] = Az [p] ;
   }
      }
  }
  else
  {
      for (newj = 0 ; newj < nq ; newj++)
      {
   j = Q [newj] ;
   ;
   for (p = Ap [j] ; p < Ap [j+1] ; p++)
   {
       bp = W [Ai [p]]++ ;
       Ri [bp] = newj ;
       Rx [2*bp] = Ax [2*p] ;
       Rx [2*bp+1] = Ax [2*p+1] ;
   }
      }
  }
     }
     else
     {
  for (newj = 0 ; newj < nq ; newj++)
  {
      j = Q [newj] ;
      ;
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   Ri [W [Ai [p]]++] = newj ;
      }
  }
     }
 }
 else
 {
     if (do_values)
     {
  if (split)
  {
      for (j = 0 ; j < n_col ; j++)
      {
   for (p = Ap [j] ; p < Ap [j+1] ; p++)
   {
       bp = W [Ai [p]]++ ;
       Ri [bp] = j ;
       Rx [bp] = Ax [p] ;
       Rz [bp] = Az [p] ;
   }
      }
  }
  else
  {
      for (j = 0 ; j < n_col ; j++)
      {
   for (p = Ap [j] ; p < Ap [j+1] ; p++)
   {
       bp = W [Ai [p]]++ ;
       Ri [bp] = j ;
       Rx [2*bp] = Ax [2*p] ;
       Rx [2*bp+1] = Ax [2*p+1] ;
   }
      }
  }
     }
     else
     {
  for (j = 0 ; j < n_col ; j++)
  {
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   Ri [W [Ai [p]]++] = j ;
      }
  }
     }
 }
    }
    return ((0)) ;
}

canonical_original_code:
long umfzl_transpose(long n_row, long n_col, long Ap[], long Ai[], double Ax[], long P[], long Q[], long nq, long Rp[], long Ri[], double Rx[], long W[], long check, double Az[], double Rz[], long do_conjugate)
{
    long i; long j; long k; long p; long bp; long newj; long do_values;
    long split;
    if (check)
    {
 if (!Ai || !Ap || !Ri || !Rp || !W)
 {
     return ((-5)) ;
 }
 if (n_row <= 0 || n_col <= 0)
 {
     return ((-6)) ;
 }
 if (!umf_l_is_permutation (P, W, n_row, n_row) ||
     !umf_l_is_permutation (Q, W, nq, nq))
 {
     return ((-15)) ;
 }
 if (amd_l_valid (n_row, n_col, Ap, Ai) != 0)
 {
     return ((-8)) ;
 }
    }
    for (i = 0 ; i < n_row ; i++)
    {
 W [i] = 0 ;
 Rp [i] = 0 ;
    }
    if (Q != (long *) ((void *)0))
    {
 for (newj = 0 ; newj < nq ; newj++)
 {
     j = Q [newj] ;
     ;
     for (p = Ap [j] ; p < Ap [j+1] ; p++)
     {
  i = Ai [p] ;
  ;
  W [i]++ ;
     }
 }
    }
    else
    {
 for (j = 0 ; j < n_col ; j++)
 {
     for (p = Ap [j] ; p < Ap [j+1] ; p++)
     {
  i = Ai [p] ;
  ;
  W [i]++ ;
     }
 }
    }
    if (P != (long *) ((void *)0))
    {
 Rp [0] = 0 ;
 for (k = 0 ; k < n_row ; k++)
 {
     i = P [k] ;
     ;
     Rp [k+1] = Rp [k] + W [i] ;
 }
 for (k = 0 ; k < n_row ; k++)
 {
     i = P [k] ;
     ;
     W [i] = Rp [k] ;
 }
    }
    else
    {
 Rp [0] = 0 ;
 for (i = 0 ; i < n_row ; i++)
 {
     Rp [i+1] = Rp [i] + W [i] ;
 }
 for (i = 0 ; i < n_row ; i++)
 {
     W [i] = Rp [i] ;
 }
    }
    ;
    do_values = Ax && Rx ;
    split = ((Az) != (double *) ((void *)0)) && ((Rz) != (double *) ((void *)0)) ;
    if (do_conjugate && do_values)
    {
 if (Q != (long *) ((void *)0))
 {
     if (split)
     {
  for (newj = 0 ; newj < nq ; newj++)
  {
      j = Q [newj] ;
      ;
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   bp = W [Ai [p]]++ ;
   Ri [bp] = newj ;
   Rx [bp] = Ax [p] ;
   Rz [bp] = -Az [p] ;
      }
  }
     }
     else
     {
  for (newj = 0 ; newj < nq ; newj++)
  {
      j = Q [newj] ;
      ;
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   bp = W [Ai [p]]++ ;
   Ri [bp] = newj ;
   Rx [2*bp] = Ax [2*p] ;
   Rx [2*bp+1] = -Ax [2*p+1] ;
      }
  }
     }
 }
 else
 {
     if (split)
     {
  for (j = 0 ; j < n_col ; j++)
  {
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   bp = W [Ai [p]]++ ;
   Ri [bp] = j ;
   Rx [bp] = Ax [p] ;
   Rz [bp] = -Az [p] ;
      }
  }
     }
     else
     {
  for (j = 0 ; j < n_col ; j++)
  {
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   bp = W [Ai [p]]++ ;
   Ri [bp] = j ;
   Rx [2*bp] = Ax [2*p] ;
   Rx [2*bp+1] = -Ax [2*p+1] ;
      }
  }
     }
 }
    }
    else
    {
 if (Q != (long *) ((void *)0))
 {
     if (do_values)
     {
  if (split)
  {
      for (newj = 0 ; newj < nq ; newj++)
      {
   j = Q [newj] ;
   ;
   for (p = Ap [j] ; p < Ap [j+1] ; p++)
   {
       bp = W [Ai [p]]++ ;
       Ri [bp] = newj ;
       Rx [bp] = Ax [p] ;
       Rz [bp] = Az [p] ;
   }
      }
  }
  else
  {
      for (newj = 0 ; newj < nq ; newj++)
      {
   j = Q [newj] ;
   ;
   for (p = Ap [j] ; p < Ap [j+1] ; p++)
   {
       bp = W [Ai [p]]++ ;
       Ri [bp] = newj ;
       Rx [2*bp] = Ax [2*p] ;
       Rx [2*bp+1] = Ax [2*p+1] ;
   }
      }
  }
     }
     else
     {
  for (newj = 0 ; newj < nq ; newj++)
  {
      j = Q [newj] ;
      ;
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   Ri [W [Ai [p]]++] = newj ;
      }
  }
     }
 }
 else
 {
     if (do_values)
     {
  if (split)
  {
      for (j = 0 ; j < n_col ; j++)
      {
   for (p = Ap [j] ; p < Ap [j+1] ; p++)
   {
       bp = W [Ai [p]]++ ;
       Ri [bp] = j ;
       Rx [bp] = Ax [p] ;
       Rz [bp] = Az [p] ;
   }
      }
  }
  else
  {
      for (j = 0 ; j < n_col ; j++)
      {
   for (p = Ap [j] ; p < Ap [j+1] ; p++)
   {
       bp = W [Ai [p]]++ ;
       Ri [bp] = j ;
       Rx [2*bp] = Ax [2*p] ;
       Rx [2*bp+1] = Ax [2*p+1] ;
   }
      }
  }
     }
     else
     {
  for (j = 0 ; j < n_col ; j++)
  {
      for (p = Ap [j] ; p < Ap [j+1] ; p++)
      {
   Ri [W [Ai [p]]++] = j ;
      }
  }
     }
 }
    }
    return ((0)) ;
}

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
P
long []

variable_types:
Q
long []

variable_types: nq long

variable_types:
Rp
long []

variable_types:
Ri
long []

variable_types:
Rx
double []

variable_types:
W
long []

variable_types: check long

variable_types:
Az
double []

variable_types:
Rz
double []

variable_types: j long

variable_types: k long

variable_types: p long

variable_types: bp long

variable_types: newj long

variable_types: split long


original_code:
long umfdl_kernel
(
    const long Ap [ ],
    const long Ai [ ],
    const double Ax [ ],
    NumericType *Numeric,
    WorkType *Work,
    SymbolicType *Symbolic
)
{
    long j, f1, f2, chain, nchains, *Chain_start, status, fixQ, evaporate,
 *Front_npivcol, jmax, nb, drop ;
    if (!umfdl_kernel_init (Ap, Ai, Ax,
 Numeric, Work, Symbolic))
    {
 ;
 return ((-11)) ;
    }
    nchains = Symbolic->nchains ;
    Chain_start = Symbolic->Chain_start ;
    Front_npivcol = Symbolic->Front_npivcol ;
    nb = Symbolic->nb ;
    fixQ = Symbolic->fixQ ;
    drop = Numeric->droptol > 0.0 ;
    for (chain = 0 ; chain < nchains ; chain++)
    {
 f1 = Chain_start [chain] ;
 f2 = Chain_start [chain+1] - 1 ;
 { if (! (umfdl_start_front (chain, Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 for (Work->frontid = f1 ; Work->frontid <= f2 ; Work->frontid++)
 {
     Work->ncand = Front_npivcol [Work->frontid] ;
     Work->lo = Work->nextcand ;
     Work->hi = Work->nextcand + Work->ncand - 1 ;
     jmax = (((128) < (Work->ncand)) ? (128) : (Work->ncand)) ;
     ;
     if (fixQ)
     {
  jmax = 1 ;
     }
     ;
     for (j = 0 ; j < jmax ; j++)
     {
  ;
  ;
  Work->Candidates [j] = Work->nextcand++ ;
     }
     Work->nCandidates = jmax ;
     ;
     while (Work->ncand > 0)
     {
  status = umfdl_local_search (Numeric, Work, Symbolic) ;
  if (status == (-11))
  {
      ;
      return ((-11)) ;
  }
  if (status == (1))
  {
      continue ;
  }
  if (Work->do_update)
  {
      umfdl_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfdl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfdl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  if (Work->do_extend)
  {
      { if (! (umfdl_extend_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  else
  {
      { if (! (umfdl_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
      { if (! (umfdl_init_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  if (fixQ)
  {
      umfdl_assemble_fixq (Numeric, Work) ;
  }
  else
  {
      umfdl_assemble (Numeric, Work) ;
  }
  umfdl_scale_column (Numeric, Work) ;
  evaporate = Work->fnrows == 0 || Work->fncols == 0 ;
  if (Work->fnpiv >= nb || evaporate)
  {
      umfdl_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfdl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfdl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  Work->pivrow_in_front = (0) ;
  Work->pivcol_in_front = (0) ;
  if (evaporate)
  {
      (void) umfdl_create_element (Numeric, Work, Symbolic) ;
      Work->fnrows = 0 ;
      Work->fncols = 0 ;
  }
     }
 }
 umfdl_blas3_update (Work) ;
 if (drop)
 {
     { if (! (umfdl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
 }
 else
 {
     { if (! (umfdl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
 }
 Work->fnrows_new = Work->fnrows ;
 Work->fncols_new = Work->fncols ;
 { if (! (umfdl_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 Work->fnrows = 0 ;
 Work->fncols = 0 ;
    }
    umfdl_kernel_wrapup (Numeric, Symbolic, Work) ;
    return ((0)) ;
}

canonical_original_code:
long umfdl_kernel(long Ap[], long Ai[], double Ax[], struct NumericType *Numeric, struct WorkType *Work, struct SymbolicType *Symbolic)
{
    long j; long f1; long f2; long chain; long nchains; long *Chain_start; long status; long fixQ; long evaporate; long *Front_npivcol; long jmax; long nb; long drop;
    if (!umfdl_kernel_init (Ap, Ai, Ax,
 Numeric, Work, Symbolic))
    {
 ;
 return ((-11)) ;
    }
    nchains = Symbolic->nchains ;
    Chain_start = Symbolic->Chain_start ;
    Front_npivcol = Symbolic->Front_npivcol ;
    nb = Symbolic->nb ;
    fixQ = Symbolic->fixQ ;
    drop = Numeric->droptol > 0.0 ;
    for (chain = 0 ; chain < nchains ; chain++)
    {
 f1 = Chain_start [chain] ;
 f2 = Chain_start [chain+1] - 1 ;
 { if (! (umfdl_start_front (chain, Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 for (Work->frontid = f1 ; Work->frontid <= f2 ; Work->frontid++)
 {
     Work->ncand = Front_npivcol [Work->frontid] ;
     Work->lo = Work->nextcand ;
     Work->hi = Work->nextcand + Work->ncand - 1 ;
     jmax = (((128) < (Work->ncand)) ? (128) : (Work->ncand)) ;
     ;
     if (fixQ)
     {
  jmax = 1 ;
     }
     ;
     for (j = 0 ; j < jmax ; j++)
     {
  ;
  ;
  Work->Candidates [j] = Work->nextcand++ ;
     }
     Work->nCandidates = jmax ;
     ;
     while (Work->ncand > 0)
     {
  status = umfdl_local_search (Numeric, Work, Symbolic) ;
  if (status == (-11))
  {
      ;
      return ((-11)) ;
  }
  if (status == (1))
  {
      continue ;
  }
  if (Work->do_update)
  {
      umfdl_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfdl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfdl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  if (Work->do_extend)
  {
      { if (! (umfdl_extend_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  else
  {
      { if (! (umfdl_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
      { if (! (umfdl_init_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  if (fixQ)
  {
      umfdl_assemble_fixq (Numeric, Work) ;
  }
  else
  {
      umfdl_assemble (Numeric, Work) ;
  }
  umfdl_scale_column (Numeric, Work) ;
  evaporate = Work->fnrows == 0 || Work->fncols == 0 ;
  if (Work->fnpiv >= nb || evaporate)
  {
      umfdl_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfdl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfdl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  Work->pivrow_in_front = (0) ;
  Work->pivcol_in_front = (0) ;
  if (evaporate)
  {
      (void) umfdl_create_element (Numeric, Work, Symbolic) ;
      Work->fnrows = 0 ;
      Work->fncols = 0 ;
  }
     }
 }
 umfdl_blas3_update (Work) ;
 if (drop)
 {
     { if (! (umfdl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
 }
 else
 {
     { if (! (umfdl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
 }
 Work->fnrows_new = Work->fnrows ;
 Work->fncols_new = Work->fncols ;
 { if (! (umfdl_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 Work->fnrows = 0 ;
 Work->fncols = 0 ;
    }
    umfdl_kernel_wrapup (Numeric, Symbolic, Work) ;
    return ((0)) ;
}

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

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

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

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

variable_types: chain long

variable_types: nchains long

variable_types: status long

variable_types: fixQ long

variable_types: evaporate long

variable_types: jmax long

variable_types: nb long

variable_types: drop long


original_code:
void umfzl_set_stats
(
    double Info [ ],
    SymbolicType *Symbolic,
    double max_usage,
    double num_mem_size,
    double flops,
    double lnz,
    double unz,
    double maxfrsize,
    double ulen,
    double npiv,
    double maxnrows,
    double maxncols,
    long scale,
    long prefer_diagonal,
    long what
)
{
    double sym_size, work_usage, nn, n_row, n_col, n_inner, num_On_size1,
 num_On_size2, num_usage, sym_maxncols, sym_maxnrows, elen, n1 ;
    n_col = Symbolic->n_col ;
    n_row = Symbolic->n_row ;
    n1 = Symbolic->n1 ;
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    n_inner = (((n_row) < (n_col)) ? (n_row) : (n_col)) ;
    sym_maxncols = (((Symbolic->maxncols + Symbolic->nb) < (n_col)) ? (Symbolic->maxncols + Symbolic->nb) : (n_col)) ;
    sym_maxnrows = (((Symbolic->maxnrows + Symbolic->nb) < (n_row)) ? (Symbolic->maxnrows + Symbolic->nb) : (n_row)) ;
    elen = (n_col - n1) + (n_row - n1) + (((n_col - n1) < (n_row - n1)) ? (n_col - n1) : (n_row - n1)) + 1 ;
    sym_size = umfzl_symbolic_usage (Symbolic->n_row, Symbolic->n_col,
 Symbolic->nchains, Symbolic->nfr, Symbolic->esize, prefer_diagonal) ;
    num_On_size1 =
 (ceil ((sizeof (NumericType) * ((double) 1)) / sizeof (Unit)))
 + (ceil ((sizeof (DoubleComplex) * ((double) n_inner+1)) / sizeof (Unit)))
 + 4 * (ceil ((sizeof (long) * ((double) n_row+1)) / sizeof (Unit)))
 + 4 * (ceil ((sizeof (long) * ((double) n_col+1)) / sizeof (Unit)))
 + (scale ? (ceil ((sizeof (DoubleComplex) * ((double) n_row)) / sizeof (Unit))) : 0) ;
    num_On_size2 =
 (ceil ((sizeof (NumericType) * ((double) 1)) / sizeof (Unit)))
 + (ceil ((sizeof (DoubleComplex) * ((double) n_inner+1)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) n_row+1)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) n_col+1)) / sizeof (Unit)))
 + 6 * (ceil ((sizeof (long) * ((double) npiv+1)) / sizeof (Unit)))
 + (scale ? (ceil ((sizeof (DoubleComplex) * ((double) n_row)) / sizeof (Unit))) : 0) ;
    ;
    Info [46 + what] = max_usage ;
    Info [47 + what] = num_mem_size ;
    Info [40 + what] =
 num_On_size2
 + num_mem_size
 + (ceil ((sizeof (long) * ((double) ulen+1)) / sizeof (Unit))) ;
    ;
    ;
    ;
    Info [48 + what] = maxfrsize ;
    Info [49 + what] = maxnrows ;
    Info [50 + what] = maxncols ;
    ;
    ;
    work_usage =
 2 * (ceil ((sizeof (DoubleComplex) * ((double) sym_maxnrows + 1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (long) * ((double) n_row+1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (long) * ((double) n_col+1)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) nn + 1)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) (((n_col) > (sym_maxnrows)) ? (n_col) : (sym_maxnrows)) + 1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (long) * ((double) sym_maxnrows + 1)) / sizeof (Unit)))
 + 3 * (ceil ((sizeof (long) * ((double) sym_maxncols + 1)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) (((sym_maxnrows) > (sym_maxncols)) ? (sym_maxnrows) : (sym_maxncols)) + 1)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) elen)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) Symbolic->nfr + 1)) / sizeof (Unit)))
 + ((n_row == n_col) ? (2 * (ceil ((sizeof (long) * ((double) nn)) / sizeof (Unit)))) : 0) ;
    num_usage =
 sym_size
 + num_On_size1
 + work_usage
 + max_usage ;
    Info [41 + what] =
 (((Symbolic->peak_sym_usage) > (num_usage)) ? (Symbolic->peak_sym_usage) : (num_usage)) ;
    Info [42 + what] = flops ;
    Info [43 + what] = lnz ;
    Info [44 + what] = unz ;
}

canonical_original_code:
void umfzl_set_stats(double Info[], struct SymbolicType *Symbolic, double max_usage, double num_mem_size, double flops, double lnz, double unz, double maxfrsize, double ulen, double npiv, double maxnrows, double maxncols, long scale, long prefer_diagonal, long what)
{
    double sym_size; double work_usage; double nn; double n_row; double n_col; double n_inner; double num_On_size1; double num_On_size2; double num_usage; double sym_maxncols; double sym_maxnrows; double elen; double n1;
    n_col = Symbolic->n_col ;
    n_row = Symbolic->n_row ;
    n1 = Symbolic->n1 ;
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    n_inner = (((n_row) < (n_col)) ? (n_row) : (n_col)) ;
    sym_maxncols = (((Symbolic->maxncols + Symbolic->nb) < (n_col)) ? (Symbolic->maxncols + Symbolic->nb) : (n_col)) ;
    sym_maxnrows = (((Symbolic->maxnrows + Symbolic->nb) < (n_row)) ? (Symbolic->maxnrows + Symbolic->nb) : (n_row)) ;
    elen = (n_col - n1) + (n_row - n1) + (((n_col - n1) < (n_row - n1)) ? (n_col - n1) : (n_row - n1)) + 1 ;
    sym_size = umfzl_symbolic_usage (Symbolic->n_row, Symbolic->n_col,
 Symbolic->nchains, Symbolic->nfr, Symbolic->esize, prefer_diagonal) ;
    num_On_size1 =
 (ceil ((sizeof (NumericType) * ((double) 1)) / sizeof (Unit)))
 + (ceil ((sizeof (DoubleComplex) * ((double) n_inner+1)) / sizeof (Unit)))
 + 4 * (ceil ((sizeof (long) * ((double) n_row+1)) / sizeof (Unit)))
 + 4 * (ceil ((sizeof (long) * ((double) n_col+1)) / sizeof (Unit)))
 + (scale ? (ceil ((sizeof (DoubleComplex) * ((double) n_row)) / sizeof (Unit))) : 0) ;
    num_On_size2 =
 (ceil ((sizeof (NumericType) * ((double) 1)) / sizeof (Unit)))
 + (ceil ((sizeof (DoubleComplex) * ((double) n_inner+1)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) n_row+1)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) n_col+1)) / sizeof (Unit)))
 + 6 * (ceil ((sizeof (long) * ((double) npiv+1)) / sizeof (Unit)))
 + (scale ? (ceil ((sizeof (DoubleComplex) * ((double) n_row)) / sizeof (Unit))) : 0) ;
    ;
    Info [46 + what] = max_usage ;
    Info [47 + what] = num_mem_size ;
    Info [40 + what] =
 num_On_size2
 + num_mem_size
 + (ceil ((sizeof (long) * ((double) ulen+1)) / sizeof (Unit))) ;
    ;
    ;
    ;
    Info [48 + what] = maxfrsize ;
    Info [49 + what] = maxnrows ;
    Info [50 + what] = maxncols ;
    ;
    ;
    work_usage =
 2 * (ceil ((sizeof (DoubleComplex) * ((double) sym_maxnrows + 1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (long) * ((double) n_row+1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (long) * ((double) n_col+1)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) nn + 1)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) (((n_col) > (sym_maxnrows)) ? (n_col) : (sym_maxnrows)) + 1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (long) * ((double) sym_maxnrows + 1)) / sizeof (Unit)))
 + 3 * (ceil ((sizeof (long) * ((double) sym_maxncols + 1)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) (((sym_maxnrows) > (sym_maxncols)) ? (sym_maxnrows) : (sym_maxncols)) + 1)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) elen)) / sizeof (Unit)))
 + (ceil ((sizeof (long) * ((double) Symbolic->nfr + 1)) / sizeof (Unit)))
 + ((n_row == n_col) ? (2 * (ceil ((sizeof (long) * ((double) nn)) / sizeof (Unit)))) : 0) ;
    num_usage =
 sym_size
 + num_On_size1
 + work_usage
 + max_usage ;
    Info [41 + what] =
 (((Symbolic->peak_sym_usage) > (num_usage)) ? (Symbolic->peak_sym_usage) : (num_usage)) ;
    Info [42 + what] = flops ;
    Info [43 + what] = lnz ;
    Info [44 + what] = unz ;
}

variable_types:
Info
double []

variable_types: flops double

variable_types: lnz double

variable_types: unz double

variable_types: maxfrsize double

variable_types: ulen double

variable_types: npiv double

variable_types: maxnrows double

variable_types: maxncols double

variable_types: scale long

variable_types: what long

variable_types: nn double

variable_types: elen double

return_type: void

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


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

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

variable_types: nz long

variable_types:
Ti
long []

variable_types:
Tj
long []

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Rp
long []

variable_types:
Rj
long []

variable_types:
W
long []

variable_types:
RowCount
long []

variable_types:
Map
long []

variable_types: i long

variable_types: j long

variable_types: k long

variable_types: p long

variable_types: cp long

variable_types: pdest long

variable_types: pj long

variable_types: duplicates long


decompiled_code:
_BOOL8 __fastcall cholmod_l_band_inplace(__int64 a1, __int64 a2, int a3, __int64 *a4, __int64 a5)
{
return band(a4, a1, a2, a3, 1, a5) != 0LL;
}

canonical_decompiled_code:
_BOOL8 __fastcall func0(__int64 a1, __int64 a2, int a3, __int64 *a4, __int64 a5)
{
return band(a4, a1, a2, a3, 1, a5) != 0LL;
}

original_code:
int cholmod_l_band_inplace
(
    long k1,
    long k2,
    int mode,
    cholmod_sparse *A,
    cholmod_common *Common
)
{
    return (band (A, k1, k2, mode, 1, Common) != ((void *)0)) ;
}

canonical_original_code:
int cholmod_l_band_inplace(long k1, long k2, int mode, struct cholmod_sparse_struct *A, struct cholmod_common_struct *Common)
{
    return (band (A, k1, k2, mode, 1, Common) != ((void *)0)) ;
}

variable_types: mode int

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

variable_types: struct cholmod_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]; } *


original_code:
int umfpack_zi_triplet_to_col
(
    int n_row,
    int n_col,
    int nz,
    const int Ti [ ],
    const int Tj [ ],
    const double Tx [ ],
    const double Tz [ ],
    int Ap [ ],
    int Ai [ ],
    double Ax [ ]
    , double Az [ ]
    , int Map [ ]
)
{
    int *RowCount, *Rp, *Rj, *W, nn, do_values, do_map, *Map2, status ;
    double *Rx ;
    double *Rz ;
    int 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_i_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 != (int *) ((void *)0)) ;
    Map2 = (int *) ((void *)0) ;
    if (do_map)
    {
 ;
 Map2 = (int *) umf_i_malloc (nz+1, sizeof (int)) ;
 if (!Map2)
 {
     ;
     (void) umf_i_free ((void *) Rx) ;
     ;
     return ((-1)) ;
 }
    }
    Rj = (int *) umf_i_malloc (nz+1, sizeof (int)) ;
    Rp = (int *) umf_i_malloc (n_row+1, sizeof (int)) ;
    RowCount = (int *) umf_i_malloc (n_row, sizeof (int)) ;
    W = (int *) umf_i_malloc (nn, sizeof (int)) ;
    if (!Rj || !Rp || !RowCount || !W)
    {
 ;
 (void) umf_i_free ((void *) Rx) ;
 (void) umf_i_free ((void *) Map2) ;
 (void) umf_i_free ((void *) Rp) ;
 (void) umf_i_free ((void *) Rj) ;
 (void) umf_i_free ((void *) RowCount) ;
 (void) umf_i_free ((void *) W) ;
 ;
 return ((-1)) ;
    }
    ;
    if (do_map)
    {
 if (do_values)
 {
     status = umfzi_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 = umfzi_triplet_map_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Map, Map2) ;
 }
    }
    else
    {
 if (do_values)
 {
     status = umfzi_triplet_nomap_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount , Tx, Ax, Rx
  , Tz, Az, Rz
  ) ;
 }
 else
 {
     status = umfzi_triplet_nomap_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai,
  Rp, Rj, W, RowCount) ;
 }
    }
    (void) umf_i_free ((void *) Rx) ;
    (void) umf_i_free ((void *) Map2) ;
    (void) umf_i_free ((void *) Rp) ;
    (void) umf_i_free ((void *) Rj) ;
    (void) umf_i_free ((void *) RowCount) ;
    (void) umf_i_free ((void *) W) ;
    ;
    return (status) ;
}

canonical_original_code:
int umfpack_zi_triplet_to_col(int n_row, int n_col, int nz, int Ti[], int Tj[], double Tx[], double Tz[], int Ap[], int Ai[], double Ax[], double Az[], int Map[])
{
    int *RowCount; int *Rp; int *Rj; int *W; int nn; int do_values; int do_map; int *Map2; int status;
    double *Rx;
    double *Rz;
    int 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_i_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 != (int *) ((void *)0)) ;
    Map2 = (int *) ((void *)0) ;
    if (do_map)
    {
 ;
 Map2 = (int *) umf_i_malloc (nz+1, sizeof (int)) ;
 if (!Map2)
 {
     ;
     (void) umf_i_free ((void *) Rx) ;
     ;
     return ((-1)) ;
 }
    }
    Rj = (int *) umf_i_malloc (nz+1, sizeof (int)) ;
    Rp = (int *) umf_i_malloc (n_row+1, sizeof (int)) ;
    RowCount = (int *) umf_i_malloc (n_row, sizeof (int)) ;
    W = (int *) umf_i_malloc (nn, sizeof (int)) ;
    if (!Rj || !Rp || !RowCount || !W)
    {
 ;
 (void) umf_i_free ((void *) Rx) ;
 (void) umf_i_free ((void *) Map2) ;
 (void) umf_i_free ((void *) Rp) ;
 (void) umf_i_free ((void *) Rj) ;
 (void) umf_i_free ((void *) RowCount) ;
 (void) umf_i_free ((void *) W) ;
 ;
 return ((-1)) ;
    }
    ;
    if (do_map)
    {
 if (do_values)
 {
     status = umfzi_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 = umfzi_triplet_map_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Map, Map2) ;
 }
    }
    else
    {
 if (do_values)
 {
     status = umfzi_triplet_nomap_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount , Tx, Ax, Rx
  , Tz, Az, Rz
  ) ;
 }
 else
 {
     status = umfzi_triplet_nomap_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai,
  Rp, Rj, W, RowCount) ;
 }
    }
    (void) umf_i_free ((void *) Rx) ;
    (void) umf_i_free ((void *) Map2) ;
    (void) umf_i_free ((void *) Rp) ;
    (void) umf_i_free ((void *) Rj) ;
    (void) umf_i_free ((void *) RowCount) ;
    (void) umf_i_free ((void *) W) ;
    ;
    return (status) ;
}

variable_types: nz int

variable_types:
Ti
int []

variable_types:
Tj
int []

variable_types:
Tx
double []

variable_types:
Tz
double []

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Ax
double []

variable_types:
Az
double []

variable_types:
Map
int []

variable_types:
RowCount
int *

variable_types:
Rp
int *

variable_types:
Rj
int *

variable_types:
W
int *

variable_types: nn int

variable_types: status int

variable_types:
Rx
double *

variable_types:
Rz
double *

variable_types: split int


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

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

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

variable_types:
X
struct DoubleComplex []

variable_types:
Pattern
int []

variable_types: k int

variable_types: deg int

variable_types:
ip
int *

variable_types: j int

variable_types: row int

variable_types:
Lpos
int *

variable_types:
Lilen
int *

variable_types: kstart int

variable_types: kend int

variable_types:
Lip
int *

variable_types: llen int

variable_types: lp int

variable_types: pos int

variable_types: npiv int

variable_types:
Li
int *

return_type: double