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

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

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

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

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

variable_types: d double

variable_types:
D
double *

variable_types: i int

variable_types: k int

variable_types: col int

variable_types: row int

variable_types: llen int

variable_types: ulen int

variable_types:
ip
int *

variable_types:
Rperm
int *

variable_types:
Cperm
int *

variable_types:
Lilen
int *

variable_types: npiv int

variable_types: lp int

variable_types:
Uilen
int *

variable_types:
Lip
int *

variable_types:
Uip
int *

variable_types: up int

variable_types: pivrow int

variable_types: pivcol int

variable_types:
Lpos
int *

variable_types:
Upos
int *

variable_types:
Wr
int *

variable_types:
Wc
int *

variable_types:
Wp
int *

variable_types:
Frpos
int *

variable_types:
Fcpos
int *


decompiled_code:
__int64 __fastcall umfpack_zi_symbolic(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
return umfpack_zi_qsymbolic(a1, a2, a3, a4);
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
return umfpack_zi_qsymbolic(a1, a2, a3, a4);
}

original_code:
int umfpack_zi_symbolic
(
    int n_row,
    int n_col,
    const int Ap [ ],
    const int Ai [ ],
    const double Ax [ ],
    const double Az [ ],
    void **SymbolicHandle,
    const double Control [20],
    double Info [90]
)
{
    return (umfpack_zi_qsymbolic (n_row, n_col, Ap, Ai, Ax,
        Az,
        (int *) ((void *)0), SymbolicHandle, Control, Info)) ;
}

canonical_original_code:
int umfpack_zi_symbolic(int n_row, int n_col, int Ap[], int Ai[], double Ax[], double Az[], void **SymbolicHandle, double Control[20], double Info[90])
{
    return (umfpack_zi_qsymbolic (n_row, n_col, Ap, Ai, Ax,
        Az,
        (int *) ((void *)0), SymbolicHandle, Control, Info)) ;
}

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Ax
double []

variable_types:
Az
double []

variable_types:
SymbolicHandle
void **

variable_types:
Control
double [20]

variable_types:
Info
double [90]

return_type: int


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

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

variable_types: n int

variable_types:
P
int []

variable_types:
Control
double []

variable_types:
Info
double []

variable_types:
Len
int *

variable_types:
S
int *

variable_types: nz int

variable_types: i int

variable_types:
Pinv
int *

variable_types: info int

variable_types: status int

variable_types:
Rp
int *

variable_types:
Ri
int *

variable_types:
Cp
int *

variable_types:
Ci
int *

variable_types: ok int

variable_types:
nzaat
unsigned long

variable_types:
slen
unsigned long

variable_types: mem double


original_code:
int cholmod_l_scale
(
    cholmod_dense *S,
    int scale,
    cholmod_sparse *A,
    cholmod_common *Common
)
{
    double t ;
    double *Ax, *s ;
    long *Ap, *Anz, *Ai ;
    long packed, j, ncol, nrow, p, pend, sncol, snrow, nn, ok ;
    { 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), "../MatrixOps/cholmod_scale.c", 85, "argument missing", Common) ; } return (0) ; } } ;
    { if ((S) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_scale.c", 86, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (1) || (A)->xtype > (1) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_scale.c", 87, "invalid xtype", Common) ; } return (0) ; } } ;
    { if ((S)->xtype < (1) || (S)->xtype > (1) || ((S)->xtype != 0 && ((S)->x) == ((void *)0)) || ((S)->xtype == 3 && ((S)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_scale.c", 88, "invalid xtype", Common) ; } return (0) ; } } ;
    ncol = A->ncol ;
    nrow = A->nrow ;
    sncol = S->ncol ;
    snrow = S->nrow ;
    if (scale == 0)
    {
 ok = (snrow == 1 && sncol == 1) ;
    }
    else if (scale == 1)
    {
 ok = (snrow == nrow && sncol == 1) || (snrow == 1 && sncol == nrow) ;
    }
    else if (scale == 2)
    {
 ok = (snrow == ncol && sncol == 1) || (snrow == 1 && sncol == ncol) ;
    }
    else if (scale == 3)
    {
 nn = (((nrow) > (ncol)) ? (nrow) : (ncol)) ;
 ok = (snrow == nn && sncol == 1) || (snrow == 1 && sncol == nn) ;
    }
    else
    {
 cholmod_l_error ((-4), "../MatrixOps/cholmod_scale.c", 113, "invalid scaling option", Common) ;
 return (0) ;
    }
    if (!ok)
    {
 cholmod_l_error ((-4), "../MatrixOps/cholmod_scale.c", 119, "invalid scale factors", Common) ;
 return (0) ;
    }
    Common->status = 0 ;
    Ap = A->p ;
    Anz = A->nz ;
    Ai = A->i ;
    Ax = A->x ;
    packed = A->packed ;
    s = S->x ;
    if (scale == 1)
    {
 for (j = 0 ; j < ncol ; j++)
 {
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  Ax [p] *= s [Ai [p]] ;
     }
 }
    }
    else if (scale == 2)
    {
 for (j = 0 ; j < ncol ; j++)
 {
     t = s [j] ;
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  Ax [p] *= t ;
     }
 }
    }
    else if (scale == 3)
    {
 for (j = 0 ; j < ncol ; j++)
 {
     t = s [j] ;
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  Ax [p] *= t * s [Ai [p]] ;
     }
 }
    }
    else if (scale == 0)
    {
 t = s [0] ;
 for (j = 0 ; j < ncol ; j++)
 {
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  Ax [p] *= t ;
     }
 }
    }
    ;
    return (1) ;
}

canonical_original_code:
int cholmod_l_scale(struct cholmod_dense_struct *S, int scale, struct cholmod_sparse_struct *A, struct cholmod_common_struct *Common)
{
    double t;
    double *Ax; double *s;
    long *Ap; long *Anz; long *Ai;
    long packed; long j; long ncol; long nrow; long p; long pend; long sncol; long snrow; long nn; long ok;
    { 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), "../MatrixOps/cholmod_scale.c", 85, "argument missing", Common) ; } return (0) ; } } ;
    { if ((S) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_scale.c", 86, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (1) || (A)->xtype > (1) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_scale.c", 87, "invalid xtype", Common) ; } return (0) ; } } ;
    { if ((S)->xtype < (1) || (S)->xtype > (1) || ((S)->xtype != 0 && ((S)->x) == ((void *)0)) || ((S)->xtype == 3 && ((S)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../MatrixOps/cholmod_scale.c", 88, "invalid xtype", Common) ; } return (0) ; } } ;
    ncol = A->ncol ;
    nrow = A->nrow ;
    sncol = S->ncol ;
    snrow = S->nrow ;
    if (scale == 0)
    {
 ok = (snrow == 1 && sncol == 1) ;
    }
    else if (scale == 1)
    {
 ok = (snrow == nrow && sncol == 1) || (snrow == 1 && sncol == nrow) ;
    }
    else if (scale == 2)
    {
 ok = (snrow == ncol && sncol == 1) || (snrow == 1 && sncol == ncol) ;
    }
    else if (scale == 3)
    {
 nn = (((nrow) > (ncol)) ? (nrow) : (ncol)) ;
 ok = (snrow == nn && sncol == 1) || (snrow == 1 && sncol == nn) ;
    }
    else
    {
 cholmod_l_error ((-4), "../MatrixOps/cholmod_scale.c", 113, "invalid scaling option", Common) ;
 return (0) ;
    }
    if (!ok)
    {
 cholmod_l_error ((-4), "../MatrixOps/cholmod_scale.c", 119, "invalid scale factors", Common) ;
 return (0) ;
    }
    Common->status = 0 ;
    Ap = A->p ;
    Anz = A->nz ;
    Ai = A->i ;
    Ax = A->x ;
    packed = A->packed ;
    s = S->x ;
    if (scale == 1)
    {
 for (j = 0 ; j < ncol ; j++)
 {
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  Ax [p] *= s [Ai [p]] ;
     }
 }
    }
    else if (scale == 2)
    {
 for (j = 0 ; j < ncol ; j++)
 {
     t = s [j] ;
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  Ax [p] *= t ;
     }
 }
    }
    else if (scale == 3)
    {
 for (j = 0 ; j < ncol ; j++)
 {
     t = s [j] ;
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  Ax [p] *= t * s [Ai [p]] ;
     }
 }
    }
    else if (scale == 0)
    {
 t = s [0] ;
 for (j = 0 ; j < ncol ; j++)
 {
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  Ax [p] *= t ;
     }
 }
    }
    ;
    return (1) ;
}

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

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

variable_types: t double

variable_types:
Ax
double *

variable_types:
s
double *

variable_types:
Ap
long *

variable_types:
Anz
long *

variable_types:
Ai
long *

variable_types: packed long

variable_types: j long

variable_types: ncol long

variable_types: nrow long

variable_types: p long

variable_types: pend long

variable_types: sncol long

variable_types: snrow long

variable_types: nn long

variable_types: ok long

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

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

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

variable_types:
X
struct DoubleComplex []

variable_types:
Pattern
int []

variable_types: k int

variable_types: deg int

variable_types: j int

variable_types:
ip
int *

variable_types: col int

variable_types:
Upos
int *

variable_types:
Uilen
int *

variable_types: kstart int

variable_types: kend int

variable_types: up int

variable_types:
Uip
int *

variable_types: n int

variable_types: uhead int

variable_types: ulen int

variable_types: pos int

variable_types: npiv int

variable_types:
Ui
int *

return_type: double

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


original_code:
long amd_l_post_tree
(
    long root,
    long k,
    long Child [ ],
    const long Sibling [ ],
    long Order [ ],
    long Stack [ ]
)
{
    long f, head, h, i ;
    head = 0 ;
    Stack [0] = root ;
    while (head >= 0)
    {
 ;
 i = Stack [head] ;
 ;
 ;
 if (Child [i] != (-1))
 {
     for (f = Child [i] ; f != (-1) ; f = Sibling [f])
     {
  head++ ;
  ;
  ;
     }
     h = head ;
     ;
     for (f = Child [i] ; f != (-1) ; f = Sibling [f])
     {
  ;
  Stack [h--] = f ;
  ;
  ;
     }
     ;
     Child [i] = (-1) ;
 }
 else
 {
     head-- ;
     ;
     Order [i] = k++ ;
     ;
 }
    }
    return (k) ;
}

canonical_original_code:
long amd_l_post_tree(long root, long k, long Child[], long Sibling[], long Order[], long Stack[])
{
    long f; long head; long h; long i;
    head = 0 ;
    Stack [0] = root ;
    while (head >= 0)
    {
 ;
 i = Stack [head] ;
 ;
 ;
 if (Child [i] != (-1))
 {
     for (f = Child [i] ; f != (-1) ; f = Sibling [f])
     {
  head++ ;
  ;
  ;
     }
     h = head ;
     ;
     for (f = Child [i] ; f != (-1) ; f = Sibling [f])
     {
  ;
  Stack [h--] = f ;
  ;
  ;
     }
     ;
     Child [i] = (-1) ;
 }
 else
 {
     head-- ;
     ;
     Order [i] = k++ ;
     ;
 }
    }
    return (k) ;
}

variable_types: root long

variable_types: k long

variable_types:
Child
long []

variable_types:
Sibling
long []

variable_types:
Order
long []

variable_types:
Stack
long []

variable_types: f long

variable_types: head long

variable_types: h long

variable_types: i long

return_type: long


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

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

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

variable_types: llen int

variable_types: lp int

variable_types: newLchain int

variable_types:
Li
int *


original_code:
long umfzl_extend_front
(
    NumericType *Numeric,
    WorkType *Work
)
{
    long j, i, *Frows, row, col, *Wrow, fnr2, fnc2, *Frpos, *Fcpos, *Fcols,
 fnrows_extended, rrdeg, ccdeg, fncols_extended, fnr_curr, fnc_curr,
 fnrows, fncols, pos, fnpiv, *Wm ;
    DoubleComplex *Wx, *Wy, *Fu, *Fl ;
    fnpiv = Work->fnpiv ;
    if (Work->do_grow)
    {
 fnr2 = (1.2) * Work->fnrows_new + 2 ;
 fnc2 = (1.2) * Work->fncols_new + 2 ;
 if (!umfzl_grow_front (Numeric, fnr2, fnc2, Work, 1))
 {
     ;
     return ((0)) ;
 }
    }
    fnr_curr = Work->fnr_curr ;
    fnc_curr = Work->fnc_curr ;
    ;
    ;
    ;
    Frows = Work->Frows ;
    Frpos = Work->Frpos ;
    Fcols = Work->Fcols ;
    Fcpos = Work->Fcpos ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    rrdeg = Work->rrdeg ;
    ccdeg = Work->ccdeg ;
    Work->fscan_col = fncols ;
    Work->NewCols = Fcols ;
    Work->fscan_row = fnrows ;
    Work->NewRows = Frows ;
    fnrows_extended = fnrows ;
    fncols_extended = fncols ;
    Fl = Work->Flblock + fnpiv * fnr_curr ;
    if (Work->pivcol_in_front)
    {
 fnrows_extended += ccdeg ;
 Wy = Work->Wy ;
 for (i = 0 ; i < fnrows_extended ; i++)
 {
     Fl [i] = Wy [i] ;
 }
    }
    else
    {
 DoubleComplex *F ;
 Fu = Work->Flublock + fnpiv * Work->nb ;
 Wm = Work->Wm ;
 Wx = Work->Wx ;
 F = Fu ;
 for (i = 0 ; i < fnpiv ; i++)
 {
     { F->component [0] = 0. ; F->component [1] = 0. ; F++ ; } ;
 }
 F = Fl ;
 for (i = 0 ; i < fnrows ; i++)
 {
     { F->component [0] = 0. ; F->component [1] = 0. ; F++ ; } ;
 }
 for (i = 0 ; i < ccdeg ; i++)
 {
     row = Wm [i] ;
     pos = Frpos [row] ;
     if (pos < 0)
     {
  pos = fnrows_extended++ ;
  Frows [pos] = row ;
  Frpos [row] = pos ;
     }
     Fl [pos] = Wx [i] ;
 }
    }
    ;
    if (Work->pivrow_in_front)
    {
 if (Work->pivcol_in_front)
 {
     ;
     for (j = fncols ; j < rrdeg ; j++)
     {
  Fcpos [Fcols [j]] = j * fnr_curr ;
     }
 }
 else
 {
     Wrow = Work->Wrow ;
     ;
     if (Wrow == Fcols)
     {
  for (j = fncols ; j < rrdeg ; j++)
  {
      col = Wrow [j] ;
      ;
      ;
      Fcpos [col] = j * fnr_curr ;
  }
     }
     else
     {
  for (j = fncols ; j < rrdeg ; j++)
  {
      col = Wrow [j] ;
      ;
      ;
      Fcols [j] = col ;
      Fcpos [col] = j * fnr_curr ;
  }
     }
 }
 fncols_extended = rrdeg ;
    }
    else
    {
 ;
 Wrow = Work->Wrow ;
 for (j = 0 ; j < rrdeg ; j++)
 {
     col = Wrow [j] ;
     ;
     if (Fcpos [col] < 0)
     {
  ;
  Fcols [fncols_extended] = col ;
  Fcpos [col] = fncols_extended * fnr_curr ;
  fncols_extended++ ;
     }
 }
    }
    zero_front (Work->Flblock, Work->Fublock, Work->Fcblock,
 fnrows, fncols, fnr_curr, fnc_curr,
 fnpiv, fnrows_extended, fncols_extended) ;
    Work->fnrows = fnrows_extended ;
    Work->fncols = fncols_extended ;
    ;
    ;
    return ((1)) ;
}

canonical_original_code:
long umfzl_extend_front(struct NumericType *Numeric, struct WorkType *Work)
{
    long j; long i; long *Frows; long row; long col; long *Wrow; long fnr2; long fnc2; long *Frpos; long *Fcpos; long *Fcols; long fnrows_extended; long rrdeg; long ccdeg; long fncols_extended; long fnr_curr; long fnc_curr; long fnrows; long fncols; long pos; long fnpiv; long *Wm;
    struct DoubleComplex *Wx; struct DoubleComplex *Wy; struct DoubleComplex *Fu; struct DoubleComplex *Fl;
    fnpiv = Work->fnpiv ;
    if (Work->do_grow)
    {
 fnr2 = (1.2) * Work->fnrows_new + 2 ;
 fnc2 = (1.2) * Work->fncols_new + 2 ;
 if (!umfzl_grow_front (Numeric, fnr2, fnc2, Work, 1))
 {
     ;
     return ((0)) ;
 }
    }
    fnr_curr = Work->fnr_curr ;
    fnc_curr = Work->fnc_curr ;
    ;
    ;
    ;
    Frows = Work->Frows ;
    Frpos = Work->Frpos ;
    Fcols = Work->Fcols ;
    Fcpos = Work->Fcpos ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    rrdeg = Work->rrdeg ;
    ccdeg = Work->ccdeg ;
    Work->fscan_col = fncols ;
    Work->NewCols = Fcols ;
    Work->fscan_row = fnrows ;
    Work->NewRows = Frows ;
    fnrows_extended = fnrows ;
    fncols_extended = fncols ;
    Fl = Work->Flblock + fnpiv * fnr_curr ;
    if (Work->pivcol_in_front)
    {
 fnrows_extended += ccdeg ;
 Wy = Work->Wy ;
 for (i = 0 ; i < fnrows_extended ; i++)
 {
     Fl [i] = Wy [i] ;
 }
    }
    else
    {
 struct DoubleComplex *F;
 Fu = Work->Flublock + fnpiv * Work->nb ;
 Wm = Work->Wm ;
 Wx = Work->Wx ;
 F = Fu ;
 for (i = 0 ; i < fnpiv ; i++)
 {
     { F->component [0] = 0. ; F->component [1] = 0. ; F++ ; } ;
 }
 F = Fl ;
 for (i = 0 ; i < fnrows ; i++)
 {
     { F->component [0] = 0. ; F->component [1] = 0. ; F++ ; } ;
 }
 for (i = 0 ; i < ccdeg ; i++)
 {
     row = Wm [i] ;
     pos = Frpos [row] ;
     if (pos < 0)
     {
  pos = fnrows_extended++ ;
  Frows [pos] = row ;
  Frpos [row] = pos ;
     }
     Fl [pos] = Wx [i] ;
 }
    }
    ;
    if (Work->pivrow_in_front)
    {
 if (Work->pivcol_in_front)
 {
     ;
     for (j = fncols ; j < rrdeg ; j++)
     {
  Fcpos [Fcols [j]] = j * fnr_curr ;
     }
 }
 else
 {
     Wrow = Work->Wrow ;
     ;
     if (Wrow == Fcols)
     {
  for (j = fncols ; j < rrdeg ; j++)
  {
      col = Wrow [j] ;
      ;
      ;
      Fcpos [col] = j * fnr_curr ;
  }
     }
     else
     {
  for (j = fncols ; j < rrdeg ; j++)
  {
      col = Wrow [j] ;
      ;
      ;
      Fcols [j] = col ;
      Fcpos [col] = j * fnr_curr ;
  }
     }
 }
 fncols_extended = rrdeg ;
    }
    else
    {
 ;
 Wrow = Work->Wrow ;
 for (j = 0 ; j < rrdeg ; j++)
 {
     col = Wrow [j] ;
     ;
     if (Fcpos [col] < 0)
     {
  ;
  Fcols [fncols_extended] = col ;
  Fcpos [col] = fncols_extended * fnr_curr ;
  fncols_extended++ ;
     }
 }
    }
    zero_front (Work->Flblock, Work->Fublock, Work->Fcblock,
 fnrows, fncols, fnr_curr, fnc_curr,
 fnpiv, fnrows_extended, fncols_extended) ;
    Work->fnrows = fnrows_extended ;
    Work->fncols = fncols_extended ;
    ;
    ;
    return ((1)) ;
}

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

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

variable_types: j long

variable_types:
Frows
long *

variable_types: row long

variable_types: col long

variable_types:
Wrow
long *

variable_types:
Frpos
long *

variable_types:
Fcpos
long *

variable_types:
Fcols
long *

variable_types: rrdeg long

variable_types: ccdeg long

variable_types: fnrows long

variable_types: fncols long

variable_types: pos long

variable_types: fnpiv long

variable_types:
Wm
long *

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


original_code:
long
umfpack_dl_wsolve
(
    long sys,
    const long Ap [ ],
    const long Ai [ ],
    const double Ax [ ],
    double Xx [ ],
    const double Bx [ ],
    void *NumericHandle,
    const double Control [20],
    double User_Info [90]
    , long Pattern [ ],
    double W [ ]
)
{
    double Info2 [90], stats [2] ;
    double *Info ;
    NumericType *Numeric ;
    long n, i, irstep, status ;
    umfpack_tic (stats) ;
    irstep = ((Control != (double *) ((void *)0)) ? (((Control [7]) != (Control [7])) ? 2 : Control [7]) : 2) ;
    if (User_Info != (double *) ((void *)0))
    {
 Info = User_Info ;
 for (i = 80 ; i <= 85 ; i++)
 {
     Info [i] = (-1) ;
 }
    }
    else
    {
 Info = Info2 ;
 for (i = 0 ; i < 90 ; i++)
 {
     Info [i] = (-1) ;
 }
    }
    Info [0] = (0) ;
    Info [84] = 0 ;
    Numeric = (NumericType *) NumericHandle ;
    if (!umfdl_valid_numeric (Numeric))
    {
 Info [0] = (-3) ;
 return ((-3)) ;
    }
    Info [1] = Numeric->n_row ;
    Info [16] = Numeric->n_col ;
    if (Numeric->n_row != Numeric->n_col)
    {
 Info [0] = (-13) ;
 return ((-13)) ;
    }
    n = Numeric->n_row ;
    if (Numeric->nnzpiv < n
 || ((Numeric->rcond) == 0.) || ((Numeric->rcond) != (Numeric->rcond)))
    {
 irstep = 0 ;
    }
    if (!Xx || !Bx)
    {
 Info [0] = (-5) ;
 return ((-5)) ;
    }
    if (sys >= (3))
    {
 irstep = 0 ;
    }
    if (!W || !Pattern)
    {
 Info [0] = (-5) ;
 return ((-5)) ;
    }
    status = umfdl_solve (sys, Ap, Ai, Ax, Xx, Bx,
 Numeric, irstep, Info, Pattern, W) ;
    Info [0] = status ;
    if (status >= 0)
    {
 umfpack_toc (stats) ;
 Info [86] = stats [0] ;
 Info [85] = stats [1] ;
    }
    return (status) ;
}

canonical_original_code:
long umfpack_dl_wsolve(long sys, long Ap[], long Ai[], double Ax[], double Xx[], double Bx[], void *NumericHandle, double Control[20], double User_Info[90], long Pattern[], double W[])
{
    double Info2[90]; double stats[2];
    double *Info;
    struct NumericType *Numeric;
    long n; long i; long irstep; long status;
    umfpack_tic (stats) ;
    irstep = ((Control != (double *) ((void *)0)) ? (((Control [7]) != (Control [7])) ? 2 : Control [7]) : 2) ;
    if (User_Info != (double *) ((void *)0))
    {
 Info = User_Info ;
 for (i = 80 ; i <= 85 ; i++)
 {
     Info [i] = (-1) ;
 }
    }
    else
    {
 Info = Info2 ;
 for (i = 0 ; i < 90 ; i++)
 {
     Info [i] = (-1) ;
 }
    }
    Info [0] = (0) ;
    Info [84] = 0 ;
    Numeric = (struct NumericType *) NumericHandle ;
    if (!umfdl_valid_numeric (Numeric))
    {
 Info [0] = (-3) ;
 return ((-3)) ;
    }
    Info [1] = Numeric->n_row ;
    Info [16] = Numeric->n_col ;
    if (Numeric->n_row != Numeric->n_col)
    {
 Info [0] = (-13) ;
 return ((-13)) ;
    }
    n = Numeric->n_row ;
    if (Numeric->nnzpiv < n
 || ((Numeric->rcond) == 0.) || ((Numeric->rcond) != (Numeric->rcond)))
    {
 irstep = 0 ;
    }
    if (!Xx || !Bx)
    {
 Info [0] = (-5) ;
 return ((-5)) ;
    }
    if (sys >= (3))
    {
 irstep = 0 ;
    }
    if (!W || !Pattern)
    {
 Info [0] = (-5) ;
 return ((-5)) ;
    }
    status = umfdl_solve (sys, Ap, Ai, Ax, Xx, Bx,
 Numeric, irstep, Info, Pattern, W) ;
    Info [0] = status ;
    if (status >= 0)
    {
 umfpack_toc (stats) ;
 Info [86] = stats [0] ;
 Info [85] = stats [1] ;
    }
    return (status) ;
}

variable_types: sys long

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
Xx
double []

variable_types:
Bx
double []

variable_types:
NumericHandle
void *

variable_types:
Control
double [20]

variable_types:
Pattern
long []

variable_types:
W
double []

variable_types:
stats
double [2]

variable_types:
Info
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: n long

variable_types: i long

variable_types: irstep long

variable_types: status 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:
void umf_l_fsize
(
    long nn,
    long Fsize [ ],
    long Fnrows [ ],
    long Fncols [ ],
    long Parent [ ],
    long Npiv [ ]
)
{
    long j, parent, frsize, r, c ;
    for (j = 0 ; j < nn ; j++)
    {
 Fsize [j] = (-1) ;
    }
    ;
    for (j = 0 ; j < nn ; j++)
    {
 if (Npiv [j] > 0)
 {
     parent = Parent [j] ;
     r = Fnrows [j] ;
     c = Fncols [j] ;
     frsize = r * c ;
     if (((!((((double) r) * ((double) c)) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || ((((double) r) * ((double) c)) != (((double) r) * ((double) c)))))
     {
  frsize = 0x7fffffffffffffffL ;
     }
     ;
     Fsize [j] = (((Fsize [j]) > (frsize)) ? (Fsize [j]) : (frsize)) ;
     ;
     if (parent != (-1))
     {
  ;
  ;
  Fsize [parent] = (((Fsize [parent]) > (Fsize [j])) ? (Fsize [parent]) : (Fsize [j])) ;
  ;
     }
 }
    }
}

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

variable_types: nn long

variable_types:
Fsize
long []

variable_types:
Fnrows
long []

variable_types:
Fncols
long []

variable_types:
Parent
long []

variable_types:
Npiv
long []

variable_types: j long

variable_types: parent long

variable_types: frsize long

variable_types: r long

variable_types: c long

return_type: void


original_code:
void umfdi_mem_free_tail_block
(
    NumericType *Numeric,
    int i
)
{
    Unit *pprev, *pnext, *p, *pbig ;
    int sprev ;
    ;
    ;
    if (i == (-1) || i == 0) return ;
    p = Numeric->Memory + i ;
    p-- ;
    ;
    ;
    ;
    ;
    ;
    Numeric->tail_usage -= p->header.size + 1 ;
    pnext = p + 1 + p->header.size ;
    ;
    ;
    ;
    ;
    if (pnext->header.size < 0)
    {
 p->header.size += (-(pnext->header.size)) + 1 ;
 ;
    }
    if (p > Numeric->Memory + Numeric->itail)
    {
 ;
 pprev = p - 1 - p->header.prevsize ;
 ;
 ;
 sprev = pprev->header.size ;
 if (sprev < 0)
 {
     ;
     pprev->header.size = p->header.size + (-sprev) + 1 ;
     p = pprev ;
     ;
 }
    }
    pnext = p + 1 + p->header.size ;
    ;
    if (p == Numeric->Memory + Numeric->itail)
    {
 Numeric->itail = pnext - Numeric->Memory ;
 pnext->header.prevsize = 0 ;
 ;
 ;
 if (Numeric->ibig != (-1) && Numeric->ibig <= Numeric->itail)
 {
     Numeric->ibig = (-1) ;
 }
    }
    else
    {
 if (Numeric->ibig == (-1))
 {
     Numeric->ibig = p - Numeric->Memory ;
 }
 else
 {
     pbig = Numeric->Memory + Numeric->ibig ;
     if (-(pbig->header.size) < p->header.size)
     {
  Numeric->ibig = p - Numeric->Memory ;
     }
 }
 pnext->header.prevsize = p->header.size ;
 p->header.size = -(p->header.size) ;
    }
    ;
}

canonical_original_code:
void umfdi_mem_free_tail_block(struct NumericType *Numeric, int i)
{
    union Unit_union *pprev; union Unit_union *pnext; union Unit_union *p; union Unit_union *pbig;
    int sprev;
    ;
    ;
    if (i == (-1) || i == 0) return ;
    p = Numeric->Memory + i ;
    p-- ;
    ;
    ;
    ;
    ;
    ;
    Numeric->tail_usage -= p->header.size + 1 ;
    pnext = p + 1 + p->header.size ;
    ;
    ;
    ;
    ;
    if (pnext->header.size < 0)
    {
 p->header.size += (-(pnext->header.size)) + 1 ;
 ;
    }
    if (p > Numeric->Memory + Numeric->itail)
    {
 ;
 pprev = p - 1 - p->header.prevsize ;
 ;
 ;
 sprev = pprev->header.size ;
 if (sprev < 0)
 {
     ;
     pprev->header.size = p->header.size + (-sprev) + 1 ;
     p = pprev ;
     ;
 }
    }
    pnext = p + 1 + p->header.size ;
    ;
    if (p == Numeric->Memory + Numeric->itail)
    {
 Numeric->itail = pnext - Numeric->Memory ;
 pnext->header.prevsize = 0 ;
 ;
 ;
 if (Numeric->ibig != (-1) && Numeric->ibig <= Numeric->itail)
 {
     Numeric->ibig = (-1) ;
 }
    }
    else
    {
 if (Numeric->ibig == (-1))
 {
     Numeric->ibig = p - Numeric->Memory ;
 }
 else
 {
     pbig = Numeric->Memory + Numeric->ibig ;
     if (-(pbig->header.size) < p->header.size)
     {
  Numeric->ibig = p - Numeric->Memory ;
     }
 }
 pnext->header.prevsize = p->header.size ;
 p->header.size = -(p->header.size) ;
    }
    ;
}

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

variable_types: i int

variable_types: sprev int

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


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

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

variable_types:
X
double []

variable_types:
Pattern
int []

variable_types: xk double

variable_types:
xp
double *

variable_types:
D
double *

variable_types:
Uval
double *

variable_types: k int

variable_types: deg int

variable_types: j int

variable_types:
ip
int *

variable_types: col int

variable_types:
Upos
int *

variable_types:
Uilen
int *

variable_types: kstart int

variable_types: kend int

variable_types: up int

variable_types:
Uip
int *

variable_types: n int

variable_types: uhead int

variable_types: ulen int

variable_types: pos int

variable_types: npiv int

variable_types:
Ui
int *

user_defined_types: union Unit_union { struct { int size; } header; double xxxxxx; }


decompiled_code:
__int64 __fastcall umfpack_zi_report_perm(unsigned int a1, __int64 a2, double *a3)
{
int v3; // er14
bool v5; // cc
__int64 v7; // rdi
__int64 v8; // r15
unsigned int v9; // er12

if ( !a3 )
return 0LL;
v3 = (int)*a3;
if ( v3 <= 2 )
return 0LL;
v5 = (int)a1 <= 0;
v7 = 1LL;
if ( !v5 )
v7 = a1;
v8 = umf_i_malloc(v7, 4LL);
v9 = umf_i_report_perm(a1, a2, v8, (unsigned int)v3, 1LL);
umf_i_free(v8);
return v9;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1, __int64 a2, double *a3)
{
int v3; // er14
bool v5; // cc
__int64 v7; // rdi
__int64 v8; // r15
unsigned int v9; // er12

if ( !a3 )
return 0LL;
v3 = (int)*a3;
if ( v3 <= 2 )
return 0LL;
v5 = (int)a1 <= 0;
v7 = 1LL;
if ( !v5 )
v7 = a1;
v8 = umf_i_malloc(v7, 4LL);
v9 = umf_i_report_perm(a1, a2, v8, (unsigned int)v3, 1LL);
umf_i_free(v8);
return v9;
}

original_code:
int umfpack_zi_report_perm
(
    int np,
    const int Perm [ ],
    const double Control [20]
)
{
    int prl, *W, status ;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    W = (int *) umf_i_malloc ((((np) > (1)) ? (np) : (1)), sizeof (int)) ;
    status = umf_i_report_perm (np, Perm, W, prl, 1) ;
    (void) umf_i_free ((void *) W) ;
    return (status) ;
}

canonical_original_code:
int umfpack_zi_report_perm(int np, int Perm[], double Control[20])
{
    int prl; int *W; int status;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    W = (int *) umf_i_malloc ((((np) > (1)) ? (np) : (1)), sizeof (int)) ;
    status = umf_i_report_perm (np, Perm, W, prl, 1) ;
    (void) umf_i_free ((void *) W) ;
    return (status) ;
}

variable_types: np int

variable_types:
Perm
int []

variable_types:
Control
double [20]

variable_types: prl int

variable_types:
W
int *

variable_types: status int


original_code:
void amd_l_postorder
(
    long nn,
    long Parent [ ],
    long Nv [ ],
    long Fsize [ ],
    long Order [ ],
    long Child [ ],
    long Sibling [ ],
    long Stack [ ]
)
{
    long i, j, k, parent, frsize, f, fprev, maxfrsize, bigfprev, bigf, fnext ;
    for (j = 0 ; j < nn ; j++)
    {
 Child [j] = (-1) ;
 Sibling [j] = (-1) ;
    }
    for (j = nn-1 ; j >= 0 ; j--)
    {
 if (Nv [j] > 0)
 {
     parent = Parent [j] ;
     if (parent != (-1))
     {
  Sibling [j] = Child [parent] ;
  Child [parent] = j ;
     }
 }
    }
    for (i = 0 ; i < nn ; i++)
    {
 if (Nv [i] > 0 && Child [i] != (-1))
 {
     fprev = (-1) ;
     maxfrsize = (-1) ;
     bigfprev = (-1) ;
     bigf = (-1) ;
     for (f = Child [i] ; f != (-1) ; f = Sibling [f])
     {
  ;
  frsize = Fsize [f] ;
  if (frsize >= maxfrsize)
  {
      maxfrsize = frsize ;
      bigfprev = fprev ;
      bigf = f ;
  }
  fprev = f ;
     }
     ;
     fnext = Sibling [bigf] ;
     ;
     if (fnext != (-1))
     {
  if (bigfprev == (-1))
  {
      Child [i] = fnext ;
  }
  else
  {
      Sibling [bigfprev] = fnext ;
  }
  Sibling [bigf] = (-1) ;
  ;
  ;
  ;
  Sibling [fprev] = bigf ;
     }
 }
    }
    for (i = 0 ; i < nn ; i++)
    {
 Order [i] = (-1) ;
    }
    k = 0 ;
    for (i = 0 ; i < nn ; i++)
    {
 if (Parent [i] == (-1) && Nv [i] > 0)
 {
     ;
     k = amd_l_post_tree (i, k, Child, Sibling, Order, Stack
  ) ;
 }
    }
}

canonical_original_code:
void amd_l_postorder(long nn, long Parent[], long Nv[], long Fsize[], long Order[], long Child[], long Sibling[], long Stack[])
{
    long i; long j; long k; long parent; long frsize; long f; long fprev; long maxfrsize; long bigfprev; long bigf; long fnext;
    for (j = 0 ; j < nn ; j++)
    {
 Child [j] = (-1) ;
 Sibling [j] = (-1) ;
    }
    for (j = nn-1 ; j >= 0 ; j--)
    {
 if (Nv [j] > 0)
 {
     parent = Parent [j] ;
     if (parent != (-1))
     {
  Sibling [j] = Child [parent] ;
  Child [parent] = j ;
     }
 }
    }
    for (i = 0 ; i < nn ; i++)
    {
 if (Nv [i] > 0 && Child [i] != (-1))
 {
     fprev = (-1) ;
     maxfrsize = (-1) ;
     bigfprev = (-1) ;
     bigf = (-1) ;
     for (f = Child [i] ; f != (-1) ; f = Sibling [f])
     {
  ;
  frsize = Fsize [f] ;
  if (frsize >= maxfrsize)
  {
      maxfrsize = frsize ;
      bigfprev = fprev ;
      bigf = f ;
  }
  fprev = f ;
     }
     ;
     fnext = Sibling [bigf] ;
     ;
     if (fnext != (-1))
     {
  if (bigfprev == (-1))
  {
      Child [i] = fnext ;
  }
  else
  {
      Sibling [bigfprev] = fnext ;
  }
  Sibling [bigf] = (-1) ;
  ;
  ;
  ;
  Sibling [fprev] = bigf ;
     }
 }
    }
    for (i = 0 ; i < nn ; i++)
    {
 Order [i] = (-1) ;
    }
    k = 0 ;
    for (i = 0 ; i < nn ; i++)
    {
 if (Parent [i] == (-1) && Nv [i] > 0)
 {
     ;
     k = amd_l_post_tree (i, k, Child, Sibling, Order, Stack
  ) ;
 }
    }
}

variable_types: nn long

variable_types:
Parent
long []

variable_types:
Nv
long []

variable_types:
Fsize
long []

variable_types:
Order
long []

variable_types:
Child
long []

variable_types:
Sibling
long []

variable_types:
Stack
long []

variable_types: i long

variable_types: j long

variable_types: k long

variable_types: parent long

variable_types: frsize long

variable_types: f long

variable_types: fprev long

variable_types: maxfrsize long

variable_types: bigfprev long

variable_types: bigf long

variable_types: fnext long


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

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

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
Az
double []

variable_types:
P
long []

variable_types:
Q
long []

variable_types:
Rp
long []

variable_types:
Ri
long []

variable_types:
Rx
double []

variable_types:
Rz
double []

variable_types: status long

variable_types:
W
long *

variable_types: nn long


original_code:
long umfdl_extend_front
(
    NumericType *Numeric,
    WorkType *Work
)
{
    long j, i, *Frows, row, col, *Wrow, fnr2, fnc2, *Frpos, *Fcpos, *Fcols,
 fnrows_extended, rrdeg, ccdeg, fncols_extended, fnr_curr, fnc_curr,
 fnrows, fncols, pos, fnpiv, *Wm ;
    double *Wx, *Wy, *Fu, *Fl ;
    fnpiv = Work->fnpiv ;
    if (Work->do_grow)
    {
 fnr2 = (1.2) * Work->fnrows_new + 2 ;
 fnc2 = (1.2) * Work->fncols_new + 2 ;
 if (!umfdl_grow_front (Numeric, fnr2, fnc2, Work, 1))
 {
     ;
     return ((0)) ;
 }
    }
    fnr_curr = Work->fnr_curr ;
    fnc_curr = Work->fnc_curr ;
    ;
    ;
    ;
    Frows = Work->Frows ;
    Frpos = Work->Frpos ;
    Fcols = Work->Fcols ;
    Fcpos = Work->Fcpos ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    rrdeg = Work->rrdeg ;
    ccdeg = Work->ccdeg ;
    Work->fscan_col = fncols ;
    Work->NewCols = Fcols ;
    Work->fscan_row = fnrows ;
    Work->NewRows = Frows ;
    fnrows_extended = fnrows ;
    fncols_extended = fncols ;
    Fl = Work->Flblock + fnpiv * fnr_curr ;
    if (Work->pivcol_in_front)
    {
 fnrows_extended += ccdeg ;
 Wy = Work->Wy ;
 for (i = 0 ; i < fnrows_extended ; i++)
 {
     Fl [i] = Wy [i] ;
 }
    }
    else
    {
 double *F ;
 Fu = Work->Flublock + fnpiv * Work->nb ;
 Wm = Work->Wm ;
 Wx = Work->Wx ;
 F = Fu ;
 for (i = 0 ; i < fnpiv ; i++)
 {
     { *F++ = 0. ; } ;
 }
 F = Fl ;
 for (i = 0 ; i < fnrows ; i++)
 {
     { *F++ = 0. ; } ;
 }
 for (i = 0 ; i < ccdeg ; i++)
 {
     row = Wm [i] ;
     pos = Frpos [row] ;
     if (pos < 0)
     {
  pos = fnrows_extended++ ;
  Frows [pos] = row ;
  Frpos [row] = pos ;
     }
     Fl [pos] = Wx [i] ;
 }
    }
    ;
    if (Work->pivrow_in_front)
    {
 if (Work->pivcol_in_front)
 {
     ;
     for (j = fncols ; j < rrdeg ; j++)
     {
  Fcpos [Fcols [j]] = j * fnr_curr ;
     }
 }
 else
 {
     Wrow = Work->Wrow ;
     ;
     if (Wrow == Fcols)
     {
  for (j = fncols ; j < rrdeg ; j++)
  {
      col = Wrow [j] ;
      ;
      ;
      Fcpos [col] = j * fnr_curr ;
  }
     }
     else
     {
  for (j = fncols ; j < rrdeg ; j++)
  {
      col = Wrow [j] ;
      ;
      ;
      Fcols [j] = col ;
      Fcpos [col] = j * fnr_curr ;
  }
     }
 }
 fncols_extended = rrdeg ;
    }
    else
    {
 ;
 Wrow = Work->Wrow ;
 for (j = 0 ; j < rrdeg ; j++)
 {
     col = Wrow [j] ;
     ;
     if (Fcpos [col] < 0)
     {
  ;
  Fcols [fncols_extended] = col ;
  Fcpos [col] = fncols_extended * fnr_curr ;
  fncols_extended++ ;
     }
 }
    }
    zero_front (Work->Flblock, Work->Fublock, Work->Fcblock,
 fnrows, fncols, fnr_curr, fnc_curr,
 fnpiv, fnrows_extended, fncols_extended) ;
    Work->fnrows = fnrows_extended ;
    Work->fncols = fncols_extended ;
    ;
    ;
    return ((1)) ;
}

canonical_original_code:
long umfdl_extend_front(struct NumericType *Numeric, struct WorkType *Work)
{
    long j; long i; long *Frows; long row; long col; long *Wrow; long fnr2; long fnc2; long *Frpos; long *Fcpos; long *Fcols; long fnrows_extended; long rrdeg; long ccdeg; long fncols_extended; long fnr_curr; long fnc_curr; long fnrows; long fncols; long pos; long fnpiv; long *Wm;
    double *Wx; double *Wy; double *Fu; double *Fl;
    fnpiv = Work->fnpiv ;
    if (Work->do_grow)
    {
 fnr2 = (1.2) * Work->fnrows_new + 2 ;
 fnc2 = (1.2) * Work->fncols_new + 2 ;
 if (!umfdl_grow_front (Numeric, fnr2, fnc2, Work, 1))
 {
     ;
     return ((0)) ;
 }
    }
    fnr_curr = Work->fnr_curr ;
    fnc_curr = Work->fnc_curr ;
    ;
    ;
    ;
    Frows = Work->Frows ;
    Frpos = Work->Frpos ;
    Fcols = Work->Fcols ;
    Fcpos = Work->Fcpos ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    rrdeg = Work->rrdeg ;
    ccdeg = Work->ccdeg ;
    Work->fscan_col = fncols ;
    Work->NewCols = Fcols ;
    Work->fscan_row = fnrows ;
    Work->NewRows = Frows ;
    fnrows_extended = fnrows ;
    fncols_extended = fncols ;
    Fl = Work->Flblock + fnpiv * fnr_curr ;
    if (Work->pivcol_in_front)
    {
 fnrows_extended += ccdeg ;
 Wy = Work->Wy ;
 for (i = 0 ; i < fnrows_extended ; i++)
 {
     Fl [i] = Wy [i] ;
 }
    }
    else
    {
 double *F;
 Fu = Work->Flublock + fnpiv * Work->nb ;
 Wm = Work->Wm ;
 Wx = Work->Wx ;
 F = Fu ;
 for (i = 0 ; i < fnpiv ; i++)
 {
     { *F++ = 0. ; } ;
 }
 F = Fl ;
 for (i = 0 ; i < fnrows ; i++)
 {
     { *F++ = 0. ; } ;
 }
 for (i = 0 ; i < ccdeg ; i++)
 {
     row = Wm [i] ;
     pos = Frpos [row] ;
     if (pos < 0)
     {
  pos = fnrows_extended++ ;
  Frows [pos] = row ;
  Frpos [row] = pos ;
     }
     Fl [pos] = Wx [i] ;
 }
    }
    ;
    if (Work->pivrow_in_front)
    {
 if (Work->pivcol_in_front)
 {
     ;
     for (j = fncols ; j < rrdeg ; j++)
     {
  Fcpos [Fcols [j]] = j * fnr_curr ;
     }
 }
 else
 {
     Wrow = Work->Wrow ;
     ;
     if (Wrow == Fcols)
     {
  for (j = fncols ; j < rrdeg ; j++)
  {
      col = Wrow [j] ;
      ;
      ;
      Fcpos [col] = j * fnr_curr ;
  }
     }
     else
     {
  for (j = fncols ; j < rrdeg ; j++)
  {
      col = Wrow [j] ;
      ;
      ;
      Fcols [j] = col ;
      Fcpos [col] = j * fnr_curr ;
  }
     }
 }
 fncols_extended = rrdeg ;
    }
    else
    {
 ;
 Wrow = Work->Wrow ;
 for (j = 0 ; j < rrdeg ; j++)
 {
     col = Wrow [j] ;
     ;
     if (Fcpos [col] < 0)
     {
  ;
  Fcols [fncols_extended] = col ;
  Fcpos [col] = fncols_extended * fnr_curr ;
  fncols_extended++ ;
     }
 }
    }
    zero_front (Work->Flblock, Work->Fublock, Work->Fcblock,
 fnrows, fncols, fnr_curr, fnc_curr,
 fnpiv, fnrows_extended, fncols_extended) ;
    Work->fnrows = fnrows_extended ;
    Work->fncols = fncols_extended ;
    ;
    ;
    return ((1)) ;
}

variable_types: struct NumericType { double flops; long scale; long valid; union Unit_union { struct { long size; } header; double xxxxxx; } *Memory; long ihead; long *Rperm; long ulen; 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: j long

variable_types: i long

variable_types:
Frows
long *

variable_types: row long

variable_types: col long

variable_types:
Wrow
long *

variable_types:
Frpos
long *

variable_types:
Fcpos
long *

variable_types:
Fcols
long *

variable_types: rrdeg long

variable_types: ccdeg long

variable_types: fnrows long

variable_types: fncols long

variable_types: pos long

variable_types: fnpiv long

variable_types:
Wm
long *

variable_types:
Wx
double *

variable_types:
Wy
double *

variable_types:
Fu
double *

variable_types:
Fl
double *

variable_types:
F
double *


original_code:
static void zero_front (
    double *Flblock, double *Fublock, double *Fcblock,
    long fnrows, long fncols, long fnr_curr, long fnc_curr,
    long fnpiv, long fnrows_extended, long fncols_extended)
{
    long j, i ;
    double *F, *Fj, *Fi ;
    Fj = Fcblock + fnrows ;
    for (j = 0 ; j < fncols ; j++)
    {
 F = Fj ;
 Fj += fnr_curr ;
#pragma ivdep
 for (i = fnrows ; i < fnrows_extended ; i++)
 {
     { *F++ = 0. ; } ;
 }
    }
    Fj -= fnrows ;
    for (j = fncols ; j < fncols_extended ; j++)
    {
 F = Fj ;
 Fj += fnr_curr ;
#pragma ivdep
 for (i = 0 ; i < fnrows_extended ; i++)
 {
     { *F++ = 0. ; } ;
 }
    }
    Fj = Flblock + fnrows ;
    for (j = 0 ; j < fnpiv ; j++)
    {
 F = Fj ;
 Fj += fnr_curr ;
#pragma ivdep
 for (i = fnrows ; i < fnrows_extended ; i++)
 {
     { *F++ = 0. ; } ;
 }
    }
    Fi = Fublock + fncols ;
    for (i = 0 ; i < fnpiv ; i++)
    {
 F = Fi ;
 Fi += fnc_curr ;
#pragma ivdep
 for (j = fncols ; j < fncols_extended ; j++)
 {
     { *F++ = 0. ; } ;
 }
    }
}

canonical_original_code:
static void zero_front(double *Flblock, double *Fublock, double *Fcblock, long fnrows, long fncols, long fnr_curr, long fnc_curr, long fnpiv, long fnrows_extended, long fncols_extended)
{
    long j; long i;
    double *F; double *Fj; double *Fi;
    Fj = Fcblock + fnrows ;
    for (j = 0 ; j < fncols ; j++)
    {
 F = Fj ;
 Fj += fnr_curr ;
#pragma ivdep
 for (i = fnrows ; i < fnrows_extended ; i++)
 {
     { *F++ = 0. ; } ;
 }
    }
    Fj -= fnrows ;
    for (j = fncols ; j < fncols_extended ; j++)
    {
 F = Fj ;
 Fj += fnr_curr ;
#pragma ivdep
 for (i = 0 ; i < fnrows_extended ; i++)
 {
     { *F++ = 0. ; } ;
 }
    }
    Fj = Flblock + fnrows ;
    for (j = 0 ; j < fnpiv ; j++)
    {
 F = Fj ;
 Fj += fnr_curr ;
#pragma ivdep
 for (i = fnrows ; i < fnrows_extended ; i++)
 {
     { *F++ = 0. ; } ;
 }
    }
    Fi = Fublock + fncols ;
    for (i = 0 ; i < fnpiv ; i++)
    {
 F = Fi ;
 Fi += fnc_curr ;
#pragma ivdep
 for (j = fncols ; j < fncols_extended ; j++)
 {
     { *F++ = 0. ; } ;
 }
    }
}

variable_types:
Flblock
double *

variable_types:
Fublock
double *

variable_types:
Fcblock
double *

variable_types: j long

variable_types: i long

variable_types:
Fj
double *

variable_types:
Fi
double *