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

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

variable_types:
Ai
long []

variable_types:
Ap
long []

variable_types:
Up
long []

variable_types: fixQ long

variable_types:
W
long []

variable_types:
Link
long []

variable_types: j long

variable_types: col long

variable_types: k long

variable_types: row long

variable_types: parent long

variable_types: pdest long

variable_types: p long

variable_types: thickness long

variable_types: npivots long

variable_types: nfr long

variable_types: i long

variable_types:
Winv
long *

variable_types: kk long

variable_types: npiv long

variable_types: jnext long

variable_types: krow long

variable_types: knext long

variable_types: pfirst long

variable_types: jlast long

variable_types: ncompactions long

variable_types: Wflag long

variable_types: npivcol long

variable_types: fallrows long

variable_types: fallcols long

variable_types: fpiv long

variable_types: frows long

variable_types: fcols long


decompiled_code:
__int64 __fastcall umf_l_realloc(__int64 a1, signed __int64 a2, unsigned __int64 a3)
{
__int64 result; // rax

if ( a2 <= 0 )
a2 = 1LL;
if ( 0x7FFFFFFFFFFFFFFFLL / a3 < a2 )
result = 0LL;
else
result = amd_realloc(a1, a3 * a2, 0x7FFFFFFFFFFFFFFFLL % a3);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, signed __int64 a2, unsigned __int64 a3)
{
__int64 result; // rax

if ( a2 <= 0 )
a2 = 1LL;
if ( 0x7FFFFFFFFFFFFFFFLL / a3 < a2 )
result = 0LL;
else
result = amd_realloc(a1, a3 * a2, 0x7FFFFFFFFFFFFFFFLL % a3);
return result;
}

original_code:
void *umf_l_realloc
(
    void *p,
    long n_objects,
    size_t size_of_object
)
{
    size_t size ;
    void *p2 ;
    n_objects = (((1) > (n_objects)) ? (1) : (n_objects)) ;
    size = (size_t) n_objects ;
    ;
    if (size > 0x7fffffffffffffffL / size_of_object)
    {
 return ((void *) ((void *)0)) ;
    }
    size *= size_of_object ;
    ;
    p2 = amd_realloc (p, size) ;
    ;
    return (p2) ;
}

canonical_original_code:
void *umf_l_realloc(void *p, long n_objects, unsigned long size_of_object)
{
    unsigned long size;
    void *p2;
    n_objects = (((1) > (n_objects)) ? (1) : (n_objects)) ;
    size = (unsigned long) n_objects ;
    ;
    if (size > 0x7fffffffffffffffL / size_of_object)
    {
 return ((void *) ((void *)0)) ;
    }
    size *= size_of_object ;
    ;
    p2 = amd_realloc (p, size) ;
    ;
    return (p2) ;
}

variable_types:
p
void *

variable_types:
size
unsigned long

return_type: void *


original_code:
int umfzi_valid_numeric
(
    NumericType *Numeric
)
{
    if (!Numeric)
    {
 return ((0)) ;
    }
    if (Numeric->valid != 17957)
    {
 return ((0)) ;
    }
    if (Numeric->n_row <= 0 || Numeric->n_col <= 0 || !Numeric->D ||
 !Numeric->Rperm || !Numeric->Cperm ||
 !Numeric->Lpos || !Numeric->Upos ||
 !Numeric->Lilen || !Numeric->Uilen || !Numeric->Lip || !Numeric->Uip ||
 !Numeric->Memory || (Numeric->ulen > 0 && !Numeric->Upattern))
    {
 return ((0)) ;
    }
    return ((1)) ;
}

canonical_original_code:
int umfzi_valid_numeric(struct NumericType *Numeric)
{
    if (!Numeric)
    {
 return ((0)) ;
    }
    if (Numeric->valid != 17957)
    {
 return ((0)) ;
    }
    if (Numeric->n_row <= 0 || Numeric->n_col <= 0 || !Numeric->D ||
 !Numeric->Rperm || !Numeric->Cperm ||
 !Numeric->Lpos || !Numeric->Upos ||
 !Numeric->Lilen || !Numeric->Uilen || !Numeric->Lip || !Numeric->Uip ||
 !Numeric->Memory || (Numeric->ulen > 0 && !Numeric->Upattern))
    {
 return ((0)) ;
    }
    return ((1)) ;
}

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

return_type: int

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:
void umfzi_scale_column
(
    NumericType *Numeric,
    WorkType *Work
)
{
    DoubleComplex pivot_value ;
    DoubleComplex *Fcol, *Flublock, *Flblock, *Fublock, *Fcblock ;
    int k, k1, fnr_curr, fnrows, fncols, *Frpos, *Fcpos, pivrow, pivcol,
 *Frows, *Fcols, fnc_curr, fnpiv, *Row_tuples, nb,
 *Col_tuples, *Rperm, *Cperm, fspos, col2, row2 ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    fnpiv = Work->fnpiv ;
    Rperm = Numeric->Rperm ;
    Cperm = Numeric->Cperm ;
    Flublock = Work->Flublock ;
    Flblock = Work->Flblock ;
    Fublock = Work->Fublock ;
    Fcblock = Work->Fcblock ;
    fnr_curr = Work->fnr_curr ;
    fnc_curr = Work->fnc_curr ;
    Frpos = Work->Frpos ;
    Fcpos = Work->Fcpos ;
    Frows = Work->Frows ;
    Fcols = Work->Fcols ;
    pivrow = Work->pivrow ;
    pivcol = Work->pivcol ;
    ;
    ;
    Row_tuples = Numeric->Uip ;
    Col_tuples = Numeric->Lip ;
    nb = Work->nb ;
    fspos = Fcpos [pivcol] ;
    fncols = --(Work->fncols) ;
    if (fspos != fncols * fnr_curr)
    {
 int fs = fspos / fnr_curr ;
 ;
 ;
 {
     int i ;
     DoubleComplex *Fs, *Fe ;
     Fs = Fcblock + fspos ;
     Fe = Fcblock + fncols * fnr_curr ;
#pragma ivdep
     for (i = 0 ; i < fnrows ; i++)
     {
  Fs [i] = Fe [i] ;
     }
 }
 {
     int i ;
     DoubleComplex *Fs, *Fe ;
     Fs = Fublock + fs ;
     Fe = Fublock + fncols ;
#pragma ivdep
     for (i = 0 ; i < fnpiv ; i++)
     {
  Fs [i * fnc_curr] = Fe [i * fnc_curr] ;
     }
 }
 col2 = Fcols [fncols] ;
 Fcols [fs] = col2 ;
 Fcpos [col2] = fspos ;
    }
    Fcpos [pivcol] = (-1) ;
    fspos = Frpos [pivrow] ;
    fnrows = --(Work->fnrows) ;
    ;
    ;
    if (fspos == fnrows)
    {
 ;
 {
     int j ;
     DoubleComplex *Fd, *Fs ;
     Fd = Fublock + fnpiv * fnc_curr ;
     Fs = Fcblock + fspos ;
#pragma ivdep
     for (j = 0 ; j < fncols ; j++)
     {
  Fd [j] = Fs [j * fnr_curr] ;
     }
 }
 if (Work->pivrow_in_front)
 {
     int j ;
     DoubleComplex *Fd, *Fs ;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
#pragma ivdep
     for (j = 0 ; j <= fnpiv ; j++)
     {
  Fd [j * nb] = Fs [j * fnr_curr] ;
     }
 }
 else
 {
     int j ;
     DoubleComplex *Fd, *Fs ;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
#pragma ivdep
     for (j = 0 ; j < fnpiv ; j++)
     {
  ;
  { (Fd [j * nb]).component [0] = 0. ; (Fd [j * nb]).component [1] = 0. ; } ;
     }
     Fd [fnpiv * nb] = Fs [fnpiv * fnr_curr] ;
 }
    }
    else
    {
 ;
 {
     DoubleComplex *Fd, *Fs, *Fe ;
     Fd = Fublock + fnpiv * fnc_curr ;
     Fs = Fcblock + fspos ;
     Fe = Fcblock + fnrows ;
     shift_pivot_row (Fd, Fs, Fe, fncols, fnr_curr) ;
 }
 if (Work->pivrow_in_front)
 {
     int j ;
     DoubleComplex *Fd, *Fs, *Fe ;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
     Fe = Flblock + fnrows ;
#pragma ivdep
     for (j = 0 ; j <= fnpiv ; j++)
     {
  Fd [j * nb] = Fs [j * fnr_curr] ;
  Fs [j * fnr_curr] = Fe [j * fnr_curr] ;
     }
 }
 else
 {
     int j ;
     DoubleComplex *Fd, *Fs, *Fe ;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
     Fe = Flblock + fnrows ;
#pragma ivdep
     for (j = 0 ; j < fnpiv ; j++)
     {
  ;
  { (Fd [j * nb]).component [0] = 0. ; (Fd [j * nb]).component [1] = 0. ; } ;
  Fs [j * fnr_curr] = Fe [j * fnr_curr] ;
     }
     Fd [fnpiv * nb] = Fs [fnpiv * fnr_curr] ;
     Fs [fnpiv * fnr_curr] = Fe [fnpiv * fnr_curr] ;
 }
 row2 = Frows [fnrows] ;
 Frows [fspos] = row2 ;
 Frpos [row2] = fspos ;
    }
    Frpos [pivrow] = (-1) ;
    Fcol = Flblock + fnpiv * fnr_curr ;
    pivot_value = Flublock [fnpiv + fnpiv * nb] ;
    k = Work->npiv + fnpiv ;
    ;
    ;
    ;
    umfzi_scale (fnrows, pivot_value, Fcol) ;
    umfzi_mem_free_tail_block (Numeric, Row_tuples [pivrow]) ;
    umfzi_mem_free_tail_block (Numeric, Col_tuples [pivcol]) ;
    Row_tuples [pivrow] = 0 ;
    Col_tuples [pivcol] = 0 ;
    ;
    ;
    ;
    k1 = (-(k)-1) ;
    Rperm [pivrow] = k1 ;
    Cperm [pivcol] = k1 ;
    ;
    ;
    ;
    Work->Pivrow [fnpiv] = pivrow ;
    Work->Pivcol [fnpiv] = pivcol ;
    Work->fnpiv++ ;
}

canonical_original_code:
void umfzi_scale_column(struct NumericType *Numeric, struct WorkType *Work)
{
    struct DoubleComplex pivot_value;
    struct DoubleComplex *Fcol; struct DoubleComplex *Flublock; struct DoubleComplex *Flblock; struct DoubleComplex *Fublock; struct DoubleComplex *Fcblock;
    int k; int k1; int fnr_curr; int fnrows; int fncols; int *Frpos; int *Fcpos; int pivrow; int pivcol; int *Frows; int *Fcols; int fnc_curr; int fnpiv; int *Row_tuples; int nb; int *Col_tuples; int *Rperm; int *Cperm; int fspos; int col2; int row2;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    fnpiv = Work->fnpiv ;
    Rperm = Numeric->Rperm ;
    Cperm = Numeric->Cperm ;
    Flublock = Work->Flublock ;
    Flblock = Work->Flblock ;
    Fublock = Work->Fublock ;
    Fcblock = Work->Fcblock ;
    fnr_curr = Work->fnr_curr ;
    fnc_curr = Work->fnc_curr ;
    Frpos = Work->Frpos ;
    Fcpos = Work->Fcpos ;
    Frows = Work->Frows ;
    Fcols = Work->Fcols ;
    pivrow = Work->pivrow ;
    pivcol = Work->pivcol ;
    ;
    ;
    Row_tuples = Numeric->Uip ;
    Col_tuples = Numeric->Lip ;
    nb = Work->nb ;
    fspos = Fcpos [pivcol] ;
    fncols = --(Work->fncols) ;
    if (fspos != fncols * fnr_curr)
    {
 int fs = fspos / fnr_curr;
 ;
 ;
 {
     int i;
     struct DoubleComplex *Fs; struct DoubleComplex *Fe;
     Fs = Fcblock + fspos ;
     Fe = Fcblock + fncols * fnr_curr ;
#pragma ivdep
     for (i = 0 ; i < fnrows ; i++)
     {
  Fs [i] = Fe [i] ;
     }
 }
 {
     int i;
     struct DoubleComplex *Fs; struct DoubleComplex *Fe;
     Fs = Fublock + fs ;
     Fe = Fublock + fncols ;
#pragma ivdep
     for (i = 0 ; i < fnpiv ; i++)
     {
  Fs [i * fnc_curr] = Fe [i * fnc_curr] ;
     }
 }
 col2 = Fcols [fncols] ;
 Fcols [fs] = col2 ;
 Fcpos [col2] = fspos ;
    }
    Fcpos [pivcol] = (-1) ;
    fspos = Frpos [pivrow] ;
    fnrows = --(Work->fnrows) ;
    ;
    ;
    if (fspos == fnrows)
    {
 ;
 {
     int j;
     struct DoubleComplex *Fd; struct DoubleComplex *Fs;
     Fd = Fublock + fnpiv * fnc_curr ;
     Fs = Fcblock + fspos ;
#pragma ivdep
     for (j = 0 ; j < fncols ; j++)
     {
  Fd [j] = Fs [j * fnr_curr] ;
     }
 }
 if (Work->pivrow_in_front)
 {
     int j;
     struct DoubleComplex *Fd; struct DoubleComplex *Fs;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
#pragma ivdep
     for (j = 0 ; j <= fnpiv ; j++)
     {
  Fd [j * nb] = Fs [j * fnr_curr] ;
     }
 }
 else
 {
     int j;
     struct DoubleComplex *Fd; struct DoubleComplex *Fs;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
#pragma ivdep
     for (j = 0 ; j < fnpiv ; j++)
     {
  ;
  { (Fd [j * nb]).component [0] = 0. ; (Fd [j * nb]).component [1] = 0. ; } ;
     }
     Fd [fnpiv * nb] = Fs [fnpiv * fnr_curr] ;
 }
    }
    else
    {
 ;
 {
     struct DoubleComplex *Fd; struct DoubleComplex *Fs; struct DoubleComplex *Fe;
     Fd = Fublock + fnpiv * fnc_curr ;
     Fs = Fcblock + fspos ;
     Fe = Fcblock + fnrows ;
     shift_pivot_row (Fd, Fs, Fe, fncols, fnr_curr) ;
 }
 if (Work->pivrow_in_front)
 {
     int j;
     struct DoubleComplex *Fd; struct DoubleComplex *Fs; struct DoubleComplex *Fe;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
     Fe = Flblock + fnrows ;
#pragma ivdep
     for (j = 0 ; j <= fnpiv ; j++)
     {
  Fd [j * nb] = Fs [j * fnr_curr] ;
  Fs [j * fnr_curr] = Fe [j * fnr_curr] ;
     }
 }
 else
 {
     int j;
     struct DoubleComplex *Fd; struct DoubleComplex *Fs; struct DoubleComplex *Fe;
     Fd = Flublock + fnpiv ;
     Fs = Flblock + fspos ;
     Fe = Flblock + fnrows ;
#pragma ivdep
     for (j = 0 ; j < fnpiv ; j++)
     {
  ;
  { (Fd [j * nb]).component [0] = 0. ; (Fd [j * nb]).component [1] = 0. ; } ;
  Fs [j * fnr_curr] = Fe [j * fnr_curr] ;
     }
     Fd [fnpiv * nb] = Fs [fnpiv * fnr_curr] ;
     Fs [fnpiv * fnr_curr] = Fe [fnpiv * fnr_curr] ;
 }
 row2 = Frows [fnrows] ;
 Frows [fspos] = row2 ;
 Frpos [row2] = fspos ;
    }
    Frpos [pivrow] = (-1) ;
    Fcol = Flblock + fnpiv * fnr_curr ;
    pivot_value = Flublock [fnpiv + fnpiv * nb] ;
    k = Work->npiv + fnpiv ;
    ;
    ;
    ;
    umfzi_scale (fnrows, pivot_value, Fcol) ;
    umfzi_mem_free_tail_block (Numeric, Row_tuples [pivrow]) ;
    umfzi_mem_free_tail_block (Numeric, Col_tuples [pivcol]) ;
    Row_tuples [pivrow] = 0 ;
    Col_tuples [pivcol] = 0 ;
    ;
    ;
    ;
    k1 = (-(k)-1) ;
    Rperm [pivrow] = k1 ;
    Cperm [pivcol] = k1 ;
    ;
    ;
    ;
    Work->Pivrow [fnpiv] = pivrow ;
    Work->Pivcol [fnpiv] = pivcol ;
    Work->fnpiv++ ;
}

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

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

variable_types: k int

variable_types: fnrows int

variable_types: fncols int

variable_types:
Frpos
int *

variable_types:
Fcpos
int *

variable_types: pivrow int

variable_types: pivcol int

variable_types:
Frows
int *

variable_types:
Fcols
int *

variable_types: fnpiv int

variable_types: nb int

variable_types:
Rperm
int *

variable_types:
Cperm
int *

variable_types: fspos int

variable_types: fs int

variable_types: i int

variable_types: j int

return_type: void

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


decompiled_code:
__int64 __fastcall umf_i_malloc(int a1, unsigned __int64 a2)
{
__int64 result; // rax

if ( a1 <= 0 )
a1 = 1;
if ( 0x7FFFFFFF / a2 < a1 )
result = 0LL;
else
result = amd_malloc(a2 * a1);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, unsigned __int64 a2)
{
__int64 result; // rax

if ( a1 <= 0 )
a1 = 1;
if ( 0x7FFFFFFF / a2 < a1 )
result = 0LL;
else
result = amd_malloc(a2 * a1);
return result;
}

original_code:
void *umf_i_malloc
(
    int n_objects,
    size_t size_of_object
)
{
    size_t size ;
    void *p ;
    ;
    n_objects = (((1) > (n_objects)) ? (1) : (n_objects)) ;
    size = (size_t) n_objects ;
    ;
    if (size > 0x7fffffff / size_of_object)
    {
 return ((void *) ((void *)0)) ;
    }
    size *= size_of_object ;
    p = amd_malloc (size) ;
    ;
    return (p) ;
}

canonical_original_code:
void *umf_i_malloc(int n_objects, unsigned long size_of_object)
{
    unsigned long size;
    void *p;
    ;
    n_objects = (((1) > (n_objects)) ? (1) : (n_objects)) ;
    size = (unsigned long) n_objects ;
    ;
    if (size > 0x7fffffff / size_of_object)
    {
 return ((void *) ((void *)0)) ;
    }
    size *= size_of_object ;
    p = amd_malloc (size) ;
    ;
    return (p) ;
}

variable_types:
size
unsigned long

variable_types:
p
void *


decompiled_code:
__int64 __fastcall umfpack_di_transpose(unsigned int a1, unsigned int a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, __int64 a7, __int64 a8, __int64 a9, __int64 a10)
{
bool v14; // cc
__int64 v15; // rdi
__int64 v16; // rax
__int64 v17; // r13
unsigned int v18; // er12

v14 = (int)a1 <= 0;
v15 = 1LL;
if ( !v14 )
v15 = a1;
if ( (int)v15 < (int)a2 )
v15 = a2;
v16 = umf_i_malloc(v15, 4LL);
if ( !v16 )
return (unsigned int)-1;
v17 = v16;
v18 = umfdi_transpose(a1, a2, a3, a4, a5, a6, a7, a2, a8, a9, a10, v16, 1LL);
umf_i_free(v17);
return v18;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int a1, unsigned int a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, __int64 a7, __int64 a8, __int64 a9, __int64 a10)
{
bool v14; // cc
__int64 v15; // rdi
__int64 v16; // rax
__int64 v17; // r13
unsigned int v18; // er12

v14 = (int)a1 <= 0;
v15 = 1LL;
if ( !v14 )
v15 = a1;
if ( (int)v15 < (int)a2 )
v15 = a2;
v16 = umf_i_malloc(v15, 4LL);
if ( !v16 )
return (unsigned int)-1;
v17 = v16;
v18 = umfdi_transpose(a1, a2, a3, a4, a5, a6, a7, a2, a8, a9, a10, v16, 1LL);
umf_i_free(v17);
return v18;
}

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

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

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Ax
double []

variable_types:
P
int []

variable_types:
Q
int []

variable_types:
Rp
int []

variable_types:
Ri
int []

variable_types:
Rx
double []

variable_types: status int

variable_types:
W
int *

variable_types: nn int


decompiled_code:
__int64 __fastcall umfpack_di_report_vector(__int64 a1, __int64 a2, double *a3)
{
__int64 v3; // rcx
__int64 result; // rax

if ( a3 && (v3 = (unsigned int)(int)*a3, (int)v3 > 2) )
result = umfdi_report_vector(a1, a2, 0LL, v3, 1LL, 0LL);
else
result = 0LL;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, double *a3)
{
__int64 v3; // rcx
__int64 result; // rax

if ( a3 && (v3 = (unsigned int)(int)*a3, (int)v3 > 2) )
result = umfdi_report_vector(a1, a2, 0LL, v3, 1LL, 0LL);
else
result = 0LL;
return result;
}

original_code:
int umfpack_di_report_vector
(
    int n,
    const double Xx [ ],
    const double Control [20]
)
{
    int prl ;
    double *Xz = (double *) ((void *)0) ;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    return (umfdi_report_vector (n, Xx, Xz, prl, (1), (0))) ;
}

canonical_original_code:
int umfpack_di_report_vector(int n, double Xx[], double Control[20])
{
    int prl;
    double *Xz = (double *) ((void *)0);
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    return (umfdi_report_vector (n, Xx, Xz, prl, (1), (0))) ;
}

variable_types: n int

variable_types:
Xx
double []

variable_types:
Control
double [20]

variable_types: prl int

variable_types:
Xz
double *


original_code:
void umfzi_garbage_collection
(
    NumericType *Numeric,
    WorkType *Work,
    int drnew,
    int dcnew,
    int do_Fcpos
)
{
    int size, e, n_row, n_col, nrows, ncols, nrowsleft, ncolsleft, prevsize,
 csize, size2, i2, j2, i, j, cdeg, rdeg, *E, row, col,
 *Rows, *Cols, *Rows2, *Cols2, nel, e2, *Row_tuples, *Col_tuples,
 *Row_degree, *Col_degree ;
    DoubleComplex *C, *C1, *C3, *C2 ;
    Unit *psrc, *pdest, *p, *pnext ;
    Element *epsrc, *epdest ;
    Col_degree = Numeric->Cperm ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Col_tuples = Numeric->Lip ;
    E = Work->E ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    Numeric->ngarbage++ ;
    for (row = 0 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0) && Row_tuples [row])
 {
     ;
     p = Numeric->Memory + Row_tuples [row] - 1 ;
     ;
     ;
     ;
     ;
     p->header.size = -p->header.size ;
     Row_tuples [row] = 0 ;
 }
    }
    for (col = 0 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0) && Col_tuples [col])
 {
     ;
     p = Numeric->Memory + Col_tuples [col] - 1 ;
     ;
     ;
     ;
     ;
     p->header.size = -p->header.size ;
     Col_tuples [col] = 0 ;
 }
    }
    nel = Work->nel ;
    ;
    e2 = 0 ;
    for (e = 0 ; e <= nel ; e++)
    {
 if (E [e])
 {
     psrc = Numeric->Memory + E [e] ;
     psrc-- ;
     if (e > 0)
     {
  e2++ ;
     }
     ;
     psrc->header.size = e2 ;
     ;
     E [e] = 0 ;
     if (e == Work->prior_element)
     {
  Work->prior_element = e2 ;
     }
 }
    }
    Work->nel = e2 ;
    nel = Work->nel ;
    psrc = Numeric->Memory + Numeric->size - 2 ;
    pdest = psrc ;
    prevsize = psrc->header.prevsize ;
    ;
    while (prevsize > 0)
    {
 size = prevsize ;
 psrc -= (size + 1) ;
 e = psrc->header.size ;
 prevsize = psrc->header.prevsize ;
 ;
 if (e == 0)
 {
     DoubleComplex *F1, *F2, *Fsrc, *Fdst ;
     int c, r, k, dr, dc, gap, gap1, gap2, nb ;
     F1 = (DoubleComplex *) (psrc + 1) ;
     k = Work->fnpiv ;
     dr = Work->fnr_curr ;
     dc = Work->fnc_curr ;
     r = Work->fnrows ;
     c = Work->fncols ;
     nb = Work->nb ;
     ;
     ;
     if (drnew % 2 == 0)
     {
  drnew++ ;
     }
     drnew = (((dr) < (drnew)) ? (dr) : (drnew)) ;
     ;
     pnext = pdest ;
     Fsrc = Work->Flblock ;
     Fdst = Work->Flblock ;
     ;
     gap1 = dr - r ;
     gap2 = drnew - r ;
     ;
     for (j = 0 ; j < k ; j++)
     {
  for (i = 0 ; i < r ; i++)
  {
      *Fdst++ = *Fsrc++ ;
  }
  Fsrc += gap1 ;
  Fdst += gap2 ;
     }
     ;
     Fdst += drnew * (nb - k) ;
     Fsrc = Work->Fublock ;
     ;
     gap1 = dc - c ;
     gap2 = dcnew - c ;
     for (i = 0 ; i < k ; i++)
     {
  for (j = 0 ; j < c ; j++)
  {
      *Fdst++ = *Fsrc++ ;
  }
  Fsrc += gap1 ;
  Fdst += gap2 ;
     }
     ;
     Fdst += dcnew * (nb - k) ;
     Fsrc = Work->Fcblock ;
     ;
     gap1 = dr - r ;
     gap2 = drnew - r ;
     for (j = 0 ; j < c ; j++)
     {
  for (i = 0 ; i < r ; i++)
  {
      *Fdst++ = *Fsrc++ ;
  }
  Fsrc += gap1 ;
  Fdst += gap2 ;
     }
     ;
     if (do_Fcpos)
     {
  int *Fcols, *Fcpos ;
  Fcols = Work->Fcols ;
  Fcpos = Work->Fcpos ;
  for (j = 0 ; j < c ; j++)
  {
      col = Fcols [j] ;
      ;
      ;
      Fcpos [col] = j * drnew ;
  }
     }
     Work->fnr_curr = drnew ;
     Work->fnc_curr = dcnew ;
     Work->fcurr_size = (drnew + nb) * (dcnew + nb) ;
     size = (((((sizeof (DoubleComplex) * (Work->fcurr_size))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     size = (((1) > (size)) ? (1) : (size)) ;
     pnext->header.prevsize = size ;
     pdest -= (size + 1) ;
     F2 = (DoubleComplex *) (pdest + 1) ;
     ;
     ;
     ;
     Fsrc = F1 + nb*nb + drnew*nb + nb*dcnew + drnew*c ;
     Fdst = F2 + nb*nb + drnew*nb + nb*dcnew + drnew*c ;
     gap = drnew - r ;
     for (j = c-1 ; j >= 0 ; j--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (i = r-1 ; i >= 0 ; i--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     Fsrc -= dcnew * (nb - k) ;
     Fdst -= dcnew * (nb - k) ;
     ;
     ;
     gap = dcnew - c ;
     for (i = k-1 ; i >= 0 ; i--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (j = c-1 ; j >= 0 ; j--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     Fsrc -= drnew * (nb - k) ;
     Fdst -= drnew * (nb - k) ;
     ;
     ;
     gap = drnew - r ;
     for (j = k-1 ; j >= 0 ; j--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (i = r-1 ; i >= 0 ; i--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     Fsrc -= nb * (nb - k) ;
     Fdst -= nb * (nb - k) ;
     ;
     ;
     gap = nb - k ;
     for (j = k-1 ; j >= 0 ; j--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (i = k-1 ; i >= 0 ; i--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     E [0] = (pdest + 1) - Numeric->Memory ;
     Work->Flublock = (DoubleComplex *) (Numeric->Memory + E [0]) ;
     ;
     Work->Flblock = Work->Flublock + nb * nb ;
     Work->Fublock = Work->Flblock + drnew * nb ;
     Work->Fcblock = Work->Fublock + nb * dcnew ;
     pdest->header.prevsize = 0 ;
     pdest->header.size = size ;
 }
 else if (e > 0)
 {
     p = psrc + 1 ;
     { { { ; ; ; epsrc = (Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (int *) p ; } ; ncols = epsrc->ncols ; Rows = Cols + ncols ; } ; nrows = epsrc->nrows ; p += (((((sizeof (int) * (ncols + nrows))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; C = (DoubleComplex *) p ; } ;
     nrowsleft = epsrc->nrowsleft ;
     ncolsleft = epsrc->ncolsleft ;
     cdeg = epsrc->cdeg ;
     rdeg = epsrc->rdeg ;
     csize = nrowsleft * ncolsleft ;
     size2 = (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))
    + (((((sizeof (int) * (nrowsleft + ncolsleft))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))
    + (((((sizeof (DoubleComplex) * (csize))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     ;
     pnext = pdest ;
     pnext->header.prevsize = size2 ;
     pdest -= (size2 + 1) ;
     ;
     ;
     ;
     p = pdest + 1 ;
     epdest = (Element *) p ;
     p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Cols2 = (int *) p ;
     Rows2 = Cols2 + ncolsleft ;
     p += (((((sizeof (int) * (nrowsleft + ncolsleft))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     C2 = (DoubleComplex *) p ;
     ;
     ;
     ;
     ;
     ;
     if (nrowsleft < nrows || ncolsleft < ncols)
     {
  ;
  C1 = C ;
  C3 = C ;
  for (j = 0 ; j < ncols ; j++)
  {
      if (Cols [j] >= 0)
      {
   for (i = 0 ; i < nrows ; i++)
   {
       if (Rows [i] >= 0)
       {
    *C3++ = C1 [i] ;
       }
   }
      }
      C1 += nrows ;
  }
  ;
  ;
     }
     C += csize ;
     C2 += csize ;
     for (i = 0 ; i < csize ; i++)
     {
  *--C2 = *--C ;
     }
     i2 = nrowsleft ;
     for (i = nrows - 1 ; i >= 0 ; i--)
     {
  ;
  if (Rows [i] >= 0)
  {
      Rows2 [--i2] = Rows [i] ;
  }
     }
     ;
     j2 = ncolsleft ;
     for (j = ncols - 1 ; j >= 0 ; j--)
     {
  ;
  if (Cols [j] >= 0)
  {
      Cols2 [--j2] = Cols [j] ;
  }
     }
     ;
     E [e] = (pdest + 1) - Numeric->Memory ;
     epdest = (Element *) (pdest + 1) ;
     epdest->next = (-1) ;
     epdest->ncols = ncolsleft ;
     epdest->nrows = nrowsleft ;
     epdest->ncolsleft = ncolsleft ;
     epdest->nrowsleft = nrowsleft ;
     epdest->rdeg = rdeg ;
     epdest->cdeg = cdeg ;
     ;
     pdest->header.prevsize = 0 ;
     pdest->header.size = size2 ;
     ;
 }
 ;
    }
    ;
    ;
    ;
    Numeric->itail = pdest - Numeric->Memory ;
    pdest->header.prevsize = 0 ;
    Numeric->ibig = (-1) ;
    Numeric->tail_usage = Numeric->size - Numeric->itail ;
    for (e = nel+1 ; e < Work->elen ; e++)
    {
 E [e] = 0 ;
    }
    ;
}

canonical_original_code:
void umfzi_garbage_collection(struct NumericType *Numeric, struct WorkType *Work, int drnew, int dcnew, int do_Fcpos)
{
    int size; int e; int n_row; int n_col; int nrows; int ncols; int nrowsleft; int ncolsleft; int prevsize; int csize; int size2; int i2; int j2; int i; int j; int cdeg; int rdeg; int *E; int row; int col; int *Rows; int *Cols; int *Rows2; int *Cols2; int nel; int e2; int *Row_tuples; int *Col_tuples; int *Row_degree; int *Col_degree;
    struct DoubleComplex *C; struct DoubleComplex *C1; struct DoubleComplex *C3; struct DoubleComplex *C2;
    union Unit_union *psrc; union Unit_union *pdest; union Unit_union *p; union Unit_union *pnext;
    struct Element *epsrc; struct Element *epdest;
    Col_degree = Numeric->Cperm ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Col_tuples = Numeric->Lip ;
    E = Work->E ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    Numeric->ngarbage++ ;
    for (row = 0 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0) && Row_tuples [row])
 {
     ;
     p = Numeric->Memory + Row_tuples [row] - 1 ;
     ;
     ;
     ;
     ;
     p->header.size = -p->header.size ;
     Row_tuples [row] = 0 ;
 }
    }
    for (col = 0 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0) && Col_tuples [col])
 {
     ;
     p = Numeric->Memory + Col_tuples [col] - 1 ;
     ;
     ;
     ;
     ;
     p->header.size = -p->header.size ;
     Col_tuples [col] = 0 ;
 }
    }
    nel = Work->nel ;
    ;
    e2 = 0 ;
    for (e = 0 ; e <= nel ; e++)
    {
 if (E [e])
 {
     psrc = Numeric->Memory + E [e] ;
     psrc-- ;
     if (e > 0)
     {
  e2++ ;
     }
     ;
     psrc->header.size = e2 ;
     ;
     E [e] = 0 ;
     if (e == Work->prior_element)
     {
  Work->prior_element = e2 ;
     }
 }
    }
    Work->nel = e2 ;
    nel = Work->nel ;
    psrc = Numeric->Memory + Numeric->size - 2 ;
    pdest = psrc ;
    prevsize = psrc->header.prevsize ;
    ;
    while (prevsize > 0)
    {
 size = prevsize ;
 psrc -= (size + 1) ;
 e = psrc->header.size ;
 prevsize = psrc->header.prevsize ;
 ;
 if (e == 0)
 {
     struct DoubleComplex *F1; struct DoubleComplex *F2; struct DoubleComplex *Fsrc; struct DoubleComplex *Fdst;
     int c; int r; int k; int dr; int dc; int gap; int gap1; int gap2; int nb;
     F1 = (struct DoubleComplex *) (psrc + 1) ;
     k = Work->fnpiv ;
     dr = Work->fnr_curr ;
     dc = Work->fnc_curr ;
     r = Work->fnrows ;
     c = Work->fncols ;
     nb = Work->nb ;
     ;
     ;
     if (drnew % 2 == 0)
     {
  drnew++ ;
     }
     drnew = (((dr) < (drnew)) ? (dr) : (drnew)) ;
     ;
     pnext = pdest ;
     Fsrc = Work->Flblock ;
     Fdst = Work->Flblock ;
     ;
     gap1 = dr - r ;
     gap2 = drnew - r ;
     ;
     for (j = 0 ; j < k ; j++)
     {
  for (i = 0 ; i < r ; i++)
  {
      *Fdst++ = *Fsrc++ ;
  }
  Fsrc += gap1 ;
  Fdst += gap2 ;
     }
     ;
     Fdst += drnew * (nb - k) ;
     Fsrc = Work->Fublock ;
     ;
     gap1 = dc - c ;
     gap2 = dcnew - c ;
     for (i = 0 ; i < k ; i++)
     {
  for (j = 0 ; j < c ; j++)
  {
      *Fdst++ = *Fsrc++ ;
  }
  Fsrc += gap1 ;
  Fdst += gap2 ;
     }
     ;
     Fdst += dcnew * (nb - k) ;
     Fsrc = Work->Fcblock ;
     ;
     gap1 = dr - r ;
     gap2 = drnew - r ;
     for (j = 0 ; j < c ; j++)
     {
  for (i = 0 ; i < r ; i++)
  {
      *Fdst++ = *Fsrc++ ;
  }
  Fsrc += gap1 ;
  Fdst += gap2 ;
     }
     ;
     if (do_Fcpos)
     {
  int *Fcols; int *Fcpos;
  Fcols = Work->Fcols ;
  Fcpos = Work->Fcpos ;
  for (j = 0 ; j < c ; j++)
  {
      col = Fcols [j] ;
      ;
      ;
      Fcpos [col] = j * drnew ;
  }
     }
     Work->fnr_curr = drnew ;
     Work->fnc_curr = dcnew ;
     Work->fcurr_size = (drnew + nb) * (dcnew + nb) ;
     size = (((((sizeof (DoubleComplex) * (Work->fcurr_size))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     size = (((1) > (size)) ? (1) : (size)) ;
     pnext->header.prevsize = size ;
     pdest -= (size + 1) ;
     F2 = (struct DoubleComplex *) (pdest + 1) ;
     ;
     ;
     ;
     Fsrc = F1 + nb*nb + drnew*nb + nb*dcnew + drnew*c ;
     Fdst = F2 + nb*nb + drnew*nb + nb*dcnew + drnew*c ;
     gap = drnew - r ;
     for (j = c-1 ; j >= 0 ; j--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (i = r-1 ; i >= 0 ; i--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     Fsrc -= dcnew * (nb - k) ;
     Fdst -= dcnew * (nb - k) ;
     ;
     ;
     gap = dcnew - c ;
     for (i = k-1 ; i >= 0 ; i--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (j = c-1 ; j >= 0 ; j--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     Fsrc -= drnew * (nb - k) ;
     Fdst -= drnew * (nb - k) ;
     ;
     ;
     gap = drnew - r ;
     for (j = k-1 ; j >= 0 ; j--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (i = r-1 ; i >= 0 ; i--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     Fsrc -= nb * (nb - k) ;
     Fdst -= nb * (nb - k) ;
     ;
     ;
     gap = nb - k ;
     for (j = k-1 ; j >= 0 ; j--)
     {
  Fsrc -= gap ;
  Fdst -= gap ;
  for (i = k-1 ; i >= 0 ; i--)
  {
      *--Fdst = *--Fsrc ;
  }
     }
     ;
     ;
     E [0] = (pdest + 1) - Numeric->Memory ;
     Work->Flublock = (struct DoubleComplex *) (Numeric->Memory + E [0]) ;
     ;
     Work->Flblock = Work->Flublock + nb * nb ;
     Work->Fublock = Work->Flblock + drnew * nb ;
     Work->Fcblock = Work->Fublock + nb * dcnew ;
     pdest->header.prevsize = 0 ;
     pdest->header.size = size ;
 }
 else if (e > 0)
 {
     p = psrc + 1 ;
     { { { ; ; ; epsrc = (struct Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (int *) p ; } ; ncols = epsrc->ncols ; Rows = Cols + ncols ; } ; nrows = epsrc->nrows ; p += (((((sizeof (int) * (ncols + nrows))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; C = (struct DoubleComplex *) p ; } ;
     nrowsleft = epsrc->nrowsleft ;
     ncolsleft = epsrc->ncolsleft ;
     cdeg = epsrc->cdeg ;
     rdeg = epsrc->rdeg ;
     csize = nrowsleft * ncolsleft ;
     size2 = (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))
    + (((((sizeof (int) * (nrowsleft + ncolsleft))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))
    + (((((sizeof (DoubleComplex) * (csize))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     ;
     pnext = pdest ;
     pnext->header.prevsize = size2 ;
     pdest -= (size2 + 1) ;
     ;
     ;
     ;
     p = pdest + 1 ;
     epdest = (struct Element *) p ;
     p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Cols2 = (int *) p ;
     Rows2 = Cols2 + ncolsleft ;
     p += (((((sizeof (int) * (nrowsleft + ncolsleft))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     C2 = (struct DoubleComplex *) p ;
     ;
     ;
     ;
     ;
     ;
     if (nrowsleft < nrows || ncolsleft < ncols)
     {
  ;
  C1 = C ;
  C3 = C ;
  for (j = 0 ; j < ncols ; j++)
  {
      if (Cols [j] >= 0)
      {
   for (i = 0 ; i < nrows ; i++)
   {
       if (Rows [i] >= 0)
       {
    *C3++ = C1 [i] ;
       }
   }
      }
      C1 += nrows ;
  }
  ;
  ;
     }
     C += csize ;
     C2 += csize ;
     for (i = 0 ; i < csize ; i++)
     {
  *--C2 = *--C ;
     }
     i2 = nrowsleft ;
     for (i = nrows - 1 ; i >= 0 ; i--)
     {
  ;
  if (Rows [i] >= 0)
  {
      Rows2 [--i2] = Rows [i] ;
  }
     }
     ;
     j2 = ncolsleft ;
     for (j = ncols - 1 ; j >= 0 ; j--)
     {
  ;
  if (Cols [j] >= 0)
  {
      Cols2 [--j2] = Cols [j] ;
  }
     }
     ;
     E [e] = (pdest + 1) - Numeric->Memory ;
     epdest = (struct Element *) (pdest + 1) ;
     epdest->next = (-1) ;
     epdest->ncols = ncolsleft ;
     epdest->nrows = nrowsleft ;
     epdest->ncolsleft = ncolsleft ;
     epdest->nrowsleft = nrowsleft ;
     epdest->rdeg = rdeg ;
     epdest->cdeg = cdeg ;
     ;
     pdest->header.prevsize = 0 ;
     pdest->header.size = size2 ;
     ;
 }
 ;
    }
    ;
    ;
    ;
    Numeric->itail = pdest - Numeric->Memory ;
    pdest->header.prevsize = 0 ;
    Numeric->ibig = (-1) ;
    Numeric->tail_usage = Numeric->size - Numeric->itail ;
    for (e = nel+1 ; e < Work->elen ; e++)
    {
 E [e] = 0 ;
    }
    ;
}

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

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

variable_types: drnew int

variable_types: dcnew int

variable_types: size int

variable_types: e int

variable_types: nrows int

variable_types: ncols int

variable_types: nrowsleft int

variable_types: ncolsleft int

variable_types: prevsize int

variable_types: csize int

variable_types: i int

variable_types: j int

variable_types: cdeg int

variable_types: rdeg int

variable_types:
E
int *

variable_types: row int

variable_types: col int

variable_types:
Rows
int *

variable_types:
Cols
int *

variable_types: nel int

variable_types:
epsrc
struct Element { int cdeg; } *

variable_types:
epdest
struct Element { int cdeg; } *

variable_types: c int

variable_types: r int

variable_types: k int

variable_types: dr int

variable_types: dc int

variable_types: gap int

variable_types: nb int

variable_types:
Fcols
int *

variable_types:
Fcpos
int *


original_code:
int
umfpack_di_wsolve
(
    int sys,
    const int Ap [ ],
    const int Ai [ ],
    const double Ax [ ],
    double Xx [ ],
    const double Bx [ ],
    void *NumericHandle,
    const double Control [20],
    double User_Info [90]
    , int Pattern [ ],
    double W [ ]
)
{
    double Info2 [90], stats [2] ;
    double *Info ;
    NumericType *Numeric ;
    int 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 (!umfdi_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 = umfdi_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:
int umfpack_di_wsolve(int sys, int Ap[], int Ai[], double Ax[], double Xx[], double Bx[], void *NumericHandle, double Control[20], double User_Info[90], int Pattern[], double W[])
{
    double Info2[90]; double stats[2];
    double *Info;
    struct NumericType *Numeric;
    int n; int i; int irstep; int 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 (!umfdi_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 = umfdi_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 int

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Ax
double []

variable_types:
Xx
double []

variable_types:
Bx
double []

variable_types:
NumericHandle
void *

variable_types:
Control
double [20]

variable_types:
Pattern
int []

variable_types:
W
double []

variable_types:
stats
double [2]

variable_types:
Info
double *

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

variable_types: i int

variable_types: irstep int

variable_types: status 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:
long umfdl_tuple_lengths
(
    NumericType *Numeric,
    WorkType *Work,
    double *p_dusage
)
{
    double dusage ;
    long e, nrows, ncols, nel, i, *Rows, *Cols, row, col, n_row, n_col, *E,
 *Row_degree, *Row_tlen, *Col_degree, *Col_tlen, usage, n1 ;
    Element *ep ;
    Unit *p ;
    E = Work->E ;
    Row_degree = Numeric->Rperm ;
    Col_degree = Numeric->Cperm ;
    Row_tlen = Numeric->Uilen ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    n1 = Work->n1 ;
    nel = Work->nel ;
    ;
    ;
    for (e = 1 ; e <= nel ; e++)
    {
 if (E [e])
 {
     p = Numeric->Memory + E [e] ;
     { { ; ; ; ep = (Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (long *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
     nrows = ep->nrows ;
     for (i = 0 ; i < nrows ; i++)
     {
  row = Rows [i] ;
  ;
  if (row >= n1)
  {
      ;
      Row_tlen [row] ++ ;
  }
     }
     for (i = 0 ; i < ncols ; i++)
     {
  col = Cols [i] ;
  ;
  if (col >= n1)
  {
      ;
      Col_tlen [col] ++ ;
  }
     }
 }
    }
    ;
    usage = 0 ;
    dusage = 0 ;
    ;
    for (col = n1 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    *p_dusage = dusage ;
    return (usage) ;
}

canonical_original_code:
long umfdl_tuple_lengths(struct NumericType *Numeric, struct WorkType *Work, double *p_dusage)
{
    double dusage;
    long e; long nrows; long ncols; long nel; long i; long *Rows; long *Cols; long row; long col; long n_row; long n_col; long *E; long *Row_degree; long *Row_tlen; long *Col_degree; long *Col_tlen; long usage; long n1;
    struct Element *ep;
    union Unit_union *p;
    E = Work->E ;
    Row_degree = Numeric->Rperm ;
    Col_degree = Numeric->Cperm ;
    Row_tlen = Numeric->Uilen ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    n1 = Work->n1 ;
    nel = Work->nel ;
    ;
    ;
    for (e = 1 ; e <= nel ; e++)
    {
 if (E [e])
 {
     p = Numeric->Memory + E [e] ;
     { { ; ; ; ep = (struct Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (long *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
     nrows = ep->nrows ;
     for (i = 0 ; i < nrows ; i++)
     {
  row = Rows [i] ;
  ;
  if (row >= n1)
  {
      ;
      Row_tlen [row] ++ ;
  }
     }
     for (i = 0 ; i < ncols ; i++)
     {
  col = Cols [i] ;
  ;
  if (col >= n1)
  {
      ;
      Col_tlen [col] ++ ;
  }
     }
 }
    }
    ;
    usage = 0 ;
    dusage = 0 ;
    ;
    for (col = n1 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    *p_dusage = dusage ;
    return (usage) ;
}

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

variable_types: e long

variable_types: nrows long

variable_types: ncols long

variable_types: nel long

variable_types: i long

variable_types:
Rows
long *

variable_types:
Cols
long *

variable_types: row long

variable_types: col long

variable_types:
E
long *

variable_types: usage long

variable_types:
ep
struct Element { long cdeg; } *

return_type: 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_i_apply_order
(
    int Front [ ],
    const int Order [ ],
    int Temp [ ],
    int nn,
    int nfr
)
{
    int i, k ;
    for (i = 0 ; i < nn ; i++)
    {
 k = Order [i] ;
 ;
 if (k != (-1))
 {
     Temp [k] = Front [i] ;
 }
    }
    for (k = 0 ; k < nfr ; k++)
    {
 Front [k] = Temp [k] ;
    }
}

canonical_original_code:
void umf_i_apply_order(int Front[], int Order[], int Temp[], int nn, int nfr)
{
    int i; int k;
    for (i = 0 ; i < nn ; i++)
    {
 k = Order [i] ;
 ;
 if (k != (-1))
 {
     Temp [k] = Front [i] ;
 }
    }
    for (k = 0 ; k < nfr ; k++)
    {
 Front [k] = Temp [k] ;
    }
}

variable_types:
Front
int []

variable_types:
Order
int []

variable_types:
Temp
int []

variable_types: nn int

variable_types: nfr int

variable_types: i int

variable_types: k int


original_code:
int umfzi_tuple_lengths
(
    NumericType *Numeric,
    WorkType *Work,
    double *p_dusage
)
{
    double dusage ;
    int e, nrows, ncols, nel, i, *Rows, *Cols, row, col, n_row, n_col, *E,
 *Row_degree, *Row_tlen, *Col_degree, *Col_tlen, usage, n1 ;
    Element *ep ;
    Unit *p ;
    E = Work->E ;
    Row_degree = Numeric->Rperm ;
    Col_degree = Numeric->Cperm ;
    Row_tlen = Numeric->Uilen ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    n1 = Work->n1 ;
    nel = Work->nel ;
    ;
    ;
    for (e = 1 ; e <= nel ; e++)
    {
 if (E [e])
 {
     p = Numeric->Memory + E [e] ;
     { { ; ; ; ep = (Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (int *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
     nrows = ep->nrows ;
     for (i = 0 ; i < nrows ; i++)
     {
  row = Rows [i] ;
  ;
  if (row >= n1)
  {
      ;
      Row_tlen [row] ++ ;
  }
     }
     for (i = 0 ; i < ncols ; i++)
     {
  col = Cols [i] ;
  ;
  if (col >= n1)
  {
      ;
      Col_tlen [col] ++ ;
  }
     }
 }
    }
    ;
    usage = 0 ;
    dusage = 0 ;
    ;
    for (col = n1 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    *p_dusage = dusage ;
    return (usage) ;
}

canonical_original_code:
int umfzi_tuple_lengths(struct NumericType *Numeric, struct WorkType *Work, double *p_dusage)
{
    double dusage;
    int e; int nrows; int ncols; int nel; int i; int *Rows; int *Cols; int row; int col; int n_row; int n_col; int *E; int *Row_degree; int *Row_tlen; int *Col_degree; int *Col_tlen; int usage; int n1;
    struct Element *ep;
    union Unit_union *p;
    E = Work->E ;
    Row_degree = Numeric->Rperm ;
    Col_degree = Numeric->Cperm ;
    Row_tlen = Numeric->Uilen ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    n1 = Work->n1 ;
    nel = Work->nel ;
    ;
    ;
    for (e = 1 ; e <= nel ; e++)
    {
 if (E [e])
 {
     p = Numeric->Memory + E [e] ;
     { { ; ; ; ep = (struct Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (int *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
     nrows = ep->nrows ;
     for (i = 0 ; i < nrows ; i++)
     {
  row = Rows [i] ;
  ;
  if (row >= n1)
  {
      ;
      Row_tlen [row] ++ ;
  }
     }
     for (i = 0 ; i < ncols ; i++)
     {
  col = Cols [i] ;
  ;
  if (col >= n1)
  {
      ;
      Col_tlen [col] ++ ;
  }
     }
 }
    }
    ;
    usage = 0 ;
    dusage = 0 ;
    ;
    for (col = n1 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     usage += 1 + (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     dusage += 1 + (ceil ((sizeof (Tuple) * ((double) (((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1)))) / sizeof (Unit))) ;
     ;
 }
    }
    ;
    *p_dusage = dusage ;
    return (usage) ;
}

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

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

variable_types: dusage double

variable_types: e int

variable_types: nrows int

variable_types: ncols int

variable_types: nel int

variable_types:
Rows
int *

variable_types:
Cols
int *

variable_types: row int

variable_types: col int

variable_types:
E
int *

variable_types: usage int

variable_types:
ep
struct Element { int cdeg; } *


original_code:
long umfpack_dl_triplet_to_col
(
    long n_row,
    long n_col,
    long nz,
    const long Ti [ ],
    const long Tj [ ],
    const double Tx [ ],
    long Ap [ ],
    long Ai [ ],
    double Ax [ ]
    , long Map [ ]
)
{
    long *RowCount, *Rp, *Rj, *W, nn, do_values, do_map, *Map2, status ;
    double *Rx ;
    if (!Ai || !Ap || !Ti || !Tj)
    {
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 return ((-6)) ;
    }
    if (nz < 0)
    {
 return ((-8)) ;
    }
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    Rx = (double *) ((void *)0) ;
    do_values = Ax && Tx ;
    if (do_values)
    {
 Rx = (double *) umf_l_malloc (nz+1, sizeof (double)) ;
 if (!Rx)
 {
     ;
     ;
     return ((-1)) ;
 }
    }
    do_map = (Map != (long *) ((void *)0)) ;
    Map2 = (long *) ((void *)0) ;
    if (do_map)
    {
 ;
 Map2 = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
 if (!Map2)
 {
     ;
     (void) umf_l_free ((void *) Rx) ;
     ;
     return ((-1)) ;
 }
    }
    Rj = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
    Rp = (long *) umf_l_malloc (n_row+1, sizeof (long)) ;
    RowCount = (long *) umf_l_malloc (n_row, sizeof (long)) ;
    W = (long *) umf_l_malloc (nn, sizeof (long)) ;
    if (!Rj || !Rp || !RowCount || !W)
    {
 ;
 (void) umf_l_free ((void *) Rx) ;
 (void) umf_l_free ((void *) Map2) ;
 (void) umf_l_free ((void *) Rp) ;
 (void) umf_l_free ((void *) Rj) ;
 (void) umf_l_free ((void *) RowCount) ;
 (void) umf_l_free ((void *) W) ;
 ;
 return ((-1)) ;
    }
    ;
    if (do_map)
    {
 if (do_values)
 {
     status = umfdl_triplet_map_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Tx, Ax, Rx
  , Map, Map2) ;
 }
 else
 {
     status = umfdl_triplet_map_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Map, Map2) ;
 }
    }
    else
    {
 if (do_values)
 {
     status = umfdl_triplet_nomap_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount , Tx, Ax, Rx
  ) ;
 }
 else
 {
     status = umfdl_triplet_nomap_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai,
  Rp, Rj, W, RowCount) ;
 }
    }
    (void) umf_l_free ((void *) Rx) ;
    (void) umf_l_free ((void *) Map2) ;
    (void) umf_l_free ((void *) Rp) ;
    (void) umf_l_free ((void *) Rj) ;
    (void) umf_l_free ((void *) RowCount) ;
    (void) umf_l_free ((void *) W) ;
    ;
    return (status) ;
}

canonical_original_code:
long umfpack_dl_triplet_to_col(long n_row, long n_col, long nz, long Ti[], long Tj[], double Tx[], long Ap[], long Ai[], double Ax[], long Map[])
{
    long *RowCount; long *Rp; long *Rj; long *W; long nn; long do_values; long do_map; long *Map2; long status;
    double *Rx;
    if (!Ai || !Ap || !Ti || !Tj)
    {
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 return ((-6)) ;
    }
    if (nz < 0)
    {
 return ((-8)) ;
    }
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    Rx = (double *) ((void *)0) ;
    do_values = Ax && Tx ;
    if (do_values)
    {
 Rx = (double *) umf_l_malloc (nz+1, sizeof (double)) ;
 if (!Rx)
 {
     ;
     ;
     return ((-1)) ;
 }
    }
    do_map = (Map != (long *) ((void *)0)) ;
    Map2 = (long *) ((void *)0) ;
    if (do_map)
    {
 ;
 Map2 = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
 if (!Map2)
 {
     ;
     (void) umf_l_free ((void *) Rx) ;
     ;
     return ((-1)) ;
 }
    }
    Rj = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
    Rp = (long *) umf_l_malloc (n_row+1, sizeof (long)) ;
    RowCount = (long *) umf_l_malloc (n_row, sizeof (long)) ;
    W = (long *) umf_l_malloc (nn, sizeof (long)) ;
    if (!Rj || !Rp || !RowCount || !W)
    {
 ;
 (void) umf_l_free ((void *) Rx) ;
 (void) umf_l_free ((void *) Map2) ;
 (void) umf_l_free ((void *) Rp) ;
 (void) umf_l_free ((void *) Rj) ;
 (void) umf_l_free ((void *) RowCount) ;
 (void) umf_l_free ((void *) W) ;
 ;
 return ((-1)) ;
    }
    ;
    if (do_map)
    {
 if (do_values)
 {
     status = umfdl_triplet_map_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Tx, Ax, Rx
  , Map, Map2) ;
 }
 else
 {
     status = umfdl_triplet_map_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Map, Map2) ;
 }
    }
    else
    {
 if (do_values)
 {
     status = umfdl_triplet_nomap_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount , Tx, Ax, Rx
  ) ;
 }
 else
 {
     status = umfdl_triplet_nomap_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai,
  Rp, Rj, W, RowCount) ;
 }
    }
    (void) umf_l_free ((void *) Rx) ;
    (void) umf_l_free ((void *) Map2) ;
    (void) umf_l_free ((void *) Rp) ;
    (void) umf_l_free ((void *) Rj) ;
    (void) umf_l_free ((void *) RowCount) ;
    (void) umf_l_free ((void *) W) ;
    ;
    return (status) ;
}

variable_types: nz long

variable_types:
Ti
long []

variable_types:
Tj
long []

variable_types:
Tx
double []

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
Map
long []

variable_types:
RowCount
long *

variable_types:
Rp
long *

variable_types:
Rj
long *

variable_types:
W
long *

variable_types: nn long

variable_types: status long

variable_types:
Rx
double *


original_code:
int umfdi_mem_alloc_element
(
    NumericType *Numeric,
    int nrows,
    int ncols,
    int **Rows,
    int **Cols,
    double **C,
    int *size,
    Element **epout
)
{
    Element *ep ;
    Unit *p ;
    int i ;
    ;
    ;
    *size = ((((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (int) * ((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 (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) != (((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1))))
    {
 return (0) ;
    }
    i = umfdi_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 = (int *) p ;
    *Rows = *Cols + ncols ;
    p += (((((sizeof (int) * (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:
int umfdi_mem_alloc_element(struct NumericType *Numeric, int nrows, int ncols, int **Rows, int **Cols, double **C, int *size, struct Element **epout)
{
    struct Element *ep;
    union Unit_union *p;
    int i;
    ;
    ;
    *size = ((((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (int) * ((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 (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) != (((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (double) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1))))
    {
 return (0) ;
    }
    i = umfdi_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 = (int *) p ;
    *Rows = *Cols + ncols ;
    p += (((((sizeof (int) * (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; 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: nrows int

variable_types: ncols int

variable_types:
Rows
int **

variable_types:
Cols
int **

variable_types:
C
double **

variable_types:
size
int *

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

variable_types: i int


original_code:
long umfzl_kernel
(
    const long Ap [ ],
    const long Ai [ ],
    const double Ax [ ],
    const double Az [ ],
    NumericType *Numeric,
    WorkType *Work,
    SymbolicType *Symbolic
)
{
    long j, f1, f2, chain, nchains, *Chain_start, status, fixQ, evaporate,
 *Front_npivcol, jmax, nb, drop ;
    if (!umfzl_kernel_init (Ap, Ai, Ax,
 Az,
 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 (! (umfzl_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 = umfzl_local_search (Numeric, Work, Symbolic) ;
  if (status == (-11))
  {
      ;
      return ((-11)) ;
  }
  if (status == (1))
  {
      continue ;
  }
  if (Work->do_update)
  {
      umfzl_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  if (Work->do_extend)
  {
      { if (! (umfzl_extend_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  else
  {
      { if (! (umfzl_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
      { if (! (umfzl_init_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  if (fixQ)
  {
      umfzl_assemble_fixq (Numeric, Work) ;
  }
  else
  {
      umfzl_assemble (Numeric, Work) ;
  }
  umfzl_scale_column (Numeric, Work) ;
  evaporate = Work->fnrows == 0 || Work->fncols == 0 ;
  if (Work->fnpiv >= nb || evaporate)
  {
      umfzl_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  Work->pivrow_in_front = (0) ;
  Work->pivcol_in_front = (0) ;
  if (evaporate)
  {
      (void) umfzl_create_element (Numeric, Work, Symbolic) ;
      Work->fnrows = 0 ;
      Work->fncols = 0 ;
  }
     }
 }
 umfzl_blas3_update (Work) ;
 if (drop)
 {
     { if (! (umfzl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
 }
 else
 {
     { if (! (umfzl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
 }
 Work->fnrows_new = Work->fnrows ;
 Work->fncols_new = Work->fncols ;
 { if (! (umfzl_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 Work->fnrows = 0 ;
 Work->fncols = 0 ;
    }
    umfzl_kernel_wrapup (Numeric, Symbolic, Work) ;
    return ((0)) ;
}

canonical_original_code:
long umfzl_kernel(long Ap[], long Ai[], double Ax[], double Az[], 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 (!umfzl_kernel_init (Ap, Ai, Ax,
 Az,
 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 (! (umfzl_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 = umfzl_local_search (Numeric, Work, Symbolic) ;
  if (status == (-11))
  {
      ;
      return ((-11)) ;
  }
  if (status == (1))
  {
      continue ;
  }
  if (Work->do_update)
  {
      umfzl_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  if (Work->do_extend)
  {
      { if (! (umfzl_extend_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  else
  {
      { if (! (umfzl_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
      { if (! (umfzl_init_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  if (fixQ)
  {
      umfzl_assemble_fixq (Numeric, Work) ;
  }
  else
  {
      umfzl_assemble (Numeric, Work) ;
  }
  umfzl_scale_column (Numeric, Work) ;
  evaporate = Work->fnrows == 0 || Work->fncols == 0 ;
  if (Work->fnpiv >= nb || evaporate)
  {
      umfzl_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  Work->pivrow_in_front = (0) ;
  Work->pivcol_in_front = (0) ;
  if (evaporate)
  {
      (void) umfzl_create_element (Numeric, Work, Symbolic) ;
      Work->fnrows = 0 ;
      Work->fncols = 0 ;
  }
     }
 }
 umfzl_blas3_update (Work) ;
 if (drop)
 {
     { if (! (umfzl_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
 }
 else
 {
     { if (! (umfzl_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
 }
 Work->fnrows_new = Work->fnrows ;
 Work->fncols_new = Work->fncols ;
 { if (! (umfzl_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 Work->fnrows = 0 ;
 Work->fncols = 0 ;
    }
    umfzl_kernel_wrapup (Numeric, Symbolic, Work) ;
    return ((0)) ;
}

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
Az
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; 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: struct SymbolicType { double num_mem_usage_est; long valid; } *

variable_types: j long

variable_types: chain long

variable_types: nchains long

variable_types: fixQ long

variable_types: evaporate long

variable_types: jmax long

variable_types: nb long

variable_types: drop 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:
int umfzi_kernel
(
    const int Ap [ ],
    const int Ai [ ],
    const double Ax [ ],
    const double Az [ ],
    NumericType *Numeric,
    WorkType *Work,
    SymbolicType *Symbolic
)
{
    int j, f1, f2, chain, nchains, *Chain_start, status, fixQ, evaporate,
 *Front_npivcol, jmax, nb, drop ;
    if (!umfzi_kernel_init (Ap, Ai, Ax,
 Az,
 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 (! (umfzi_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 = umfzi_local_search (Numeric, Work, Symbolic) ;
  if (status == (-11))
  {
      ;
      return ((-11)) ;
  }
  if (status == (1))
  {
      continue ;
  }
  if (Work->do_update)
  {
      umfzi_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  if (Work->do_extend)
  {
      { if (! (umfzi_extend_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  else
  {
      { if (! (umfzi_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
      { if (! (umfzi_init_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  if (fixQ)
  {
      umfzi_assemble_fixq (Numeric, Work) ;
  }
  else
  {
      umfzi_assemble (Numeric, Work) ;
  }
  umfzi_scale_column (Numeric, Work) ;
  evaporate = Work->fnrows == 0 || Work->fncols == 0 ;
  if (Work->fnpiv >= nb || evaporate)
  {
      umfzi_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  Work->pivrow_in_front = (0) ;
  Work->pivcol_in_front = (0) ;
  if (evaporate)
  {
      (void) umfzi_create_element (Numeric, Work, Symbolic) ;
      Work->fnrows = 0 ;
      Work->fncols = 0 ;
  }
     }
 }
 umfzi_blas3_update (Work) ;
 if (drop)
 {
     { if (! (umfzi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
 }
 else
 {
     { if (! (umfzi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
 }
 Work->fnrows_new = Work->fnrows ;
 Work->fncols_new = Work->fncols ;
 { if (! (umfzi_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 Work->fnrows = 0 ;
 Work->fncols = 0 ;
    }
    umfzi_kernel_wrapup (Numeric, Symbolic, Work) ;
    return ((0)) ;
}

canonical_original_code:
int umfzi_kernel(int Ap[], int Ai[], double Ax[], double Az[], struct NumericType *Numeric, struct WorkType *Work, struct SymbolicType *Symbolic)
{
    int j; int f1; int f2; int chain; int nchains; int *Chain_start; int status; int fixQ; int evaporate; int *Front_npivcol; int jmax; int nb; int drop;
    if (!umfzi_kernel_init (Ap, Ai, Ax,
 Az,
 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 (! (umfzi_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 = umfzi_local_search (Numeric, Work, Symbolic) ;
  if (status == (-11))
  {
      ;
      return ((-11)) ;
  }
  if (status == (1))
  {
      continue ;
  }
  if (Work->do_update)
  {
      umfzi_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  if (Work->do_extend)
  {
      { if (! (umfzi_extend_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  else
  {
      { if (! (umfzi_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
      { if (! (umfzi_init_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  if (fixQ)
  {
      umfzi_assemble_fixq (Numeric, Work) ;
  }
  else
  {
      umfzi_assemble (Numeric, Work) ;
  }
  umfzi_scale_column (Numeric, Work) ;
  evaporate = Work->fnrows == 0 || Work->fncols == 0 ;
  if (Work->fnpiv >= nb || evaporate)
  {
      umfzi_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfzi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfzi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  Work->pivrow_in_front = (0) ;
  Work->pivcol_in_front = (0) ;
  if (evaporate)
  {
      (void) umfzi_create_element (Numeric, Work, Symbolic) ;
      Work->fnrows = 0 ;
      Work->fncols = 0 ;
  }
     }
 }
 umfzi_blas3_update (Work) ;
 if (drop)
 {
     { if (! (umfzi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
 }
 else
 {
     { if (! (umfzi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
 }
 Work->fnrows_new = Work->fnrows ;
 Work->fncols_new = Work->fncols ;
 { if (! (umfzi_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 Work->fnrows = 0 ;
 Work->fncols = 0 ;
    }
    umfzi_kernel_wrapup (Numeric, Symbolic, Work) ;
    return ((0)) ;
}

variable_types:
Ap
int []

variable_types:
Ai
int []

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

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

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

variable_types: j int

variable_types: chain int

variable_types: nchains int

variable_types: status int

variable_types: fixQ int

variable_types: evaporate int

variable_types: jmax int

variable_types: nb int

variable_types: drop int


original_code:
int umfdi_get_memory
(
    NumericType *Numeric,
    WorkType *Work,
    int needunits,
    int r2,
    int c2,
    int do_Fcpos
)
{
    double nsize, bsize, tsize ;
    int i, minsize, newsize, newmem, costly, row, col, *Row_tlen, *Col_tlen,
 n_row, n_col, *Row_degree, *Col_degree ;
    Unit *mnew, *p ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    Row_degree = Numeric->Rperm ;
    Col_degree = Numeric->Cperm ;
    Row_tlen = Numeric->Uilen ;
    Col_tlen = Numeric->Lilen ;
    for (row = 0 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     Row_tlen [row] = 0 ;
 }
    }
    for (col = 0 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0))
 {
     Col_tlen [col] = 0 ;
 }
    }
    nsize = (double) needunits + 2 ;
    needunits += umfdi_tuple_lengths (Numeric, Work, &tsize) ;
    nsize += tsize ;
    needunits += 2 ;
    ;
    minsize = Numeric->size + needunits ;
    nsize += (double) Numeric->size ;
    bsize = ((double) 0x7fffffff) / sizeof (Unit) - 1 ;
    newsize = (int) ((1.2) * ((double) minsize)) ;
    nsize *= (1.2) ;
    nsize += 1 ;
    if (newsize < 0 || nsize > bsize)
    {
 ;
 newsize = (int) bsize ;
    }
    else
    {
 ;
 newsize = (((newsize) > (minsize)) ? (newsize) : (minsize)) ;
    }
    newsize = (((newsize) > (Numeric->size)) ? (newsize) : (Numeric->size)) ;
    ;
    Numeric->ibig = (-1) ;
    ;
    mnew = (Unit *) ((void *)0) ;
    while (!mnew)
    {
 mnew = (Unit *) umf_i_realloc (Numeric->Memory, newsize, sizeof (Unit)) ;
 if (!mnew)
 {
     if (newsize == minsize)
     {
  mnew = Numeric->Memory ;
  newsize = Numeric->size ;
     }
     else
     {
  newsize = (int) ((0.95) * ((double) newsize)) ;
  newsize = (((minsize) > (newsize)) ? (minsize) : (newsize)) ;
     }
 }
    }
    ;
    costly = (mnew != Numeric->Memory) ;
    Numeric->Memory = mnew ;
    if (Work->E [0])
    {
 int nb, dr, dc ;
 nb = Work->nb ;
 dr = Work->fnr_curr ;
 dc = Work->fnc_curr ;
 Work->Flublock = (double *) (Numeric->Memory + Work->E [0]) ;
 Work->Flblock = Work->Flublock + nb * nb ;
 Work->Fublock = Work->Flblock + dr * nb ;
 Work->Fcblock = Work->Fublock + nb * dc ;
 ;
    }
    ;
    newmem = newsize - Numeric->size ;
    ;
    if (newmem >= 2)
    {
 p = Numeric->Memory + Numeric->size - 2 ;
 p->header.size = newmem - 1 ;
 i = Numeric->size - 1 ;
 p += newmem ;
 p->header.prevsize = newmem - 1 ;
 p->header.size = 1 ;
 Numeric->size = newsize ;
 umfdi_mem_free_tail_block (Numeric, i) ;
 Numeric->nrealloc++ ;
 if (costly)
 {
     Numeric->ncostly++ ;
 }
    }
    ;
    umfdi_garbage_collection (Numeric, Work, r2, c2, do_Fcpos) ;
    return (umfdi_build_tuples (Numeric, Work)) ;
}

canonical_original_code:
int umfdi_get_memory(struct NumericType *Numeric, struct WorkType *Work, int needunits, int r2, int c2, int do_Fcpos)
{
    double nsize; double bsize; double tsize;
    int i; int minsize; int newsize; int newmem; int costly; int row; int col; int *Row_tlen; int *Col_tlen; int n_row; int n_col; int *Row_degree; int *Col_degree;
    union Unit_union *mnew; union Unit_union *p;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    Row_degree = Numeric->Rperm ;
    Col_degree = Numeric->Cperm ;
    Row_tlen = Numeric->Uilen ;
    Col_tlen = Numeric->Lilen ;
    for (row = 0 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     Row_tlen [row] = 0 ;
 }
    }
    for (col = 0 ; col < n_col ; col++)
    {
 if ((Col_degree [col] >= 0))
 {
     Col_tlen [col] = 0 ;
 }
    }
    nsize = (double) needunits + 2 ;
    needunits += umfdi_tuple_lengths (Numeric, Work, &tsize) ;
    nsize += tsize ;
    needunits += 2 ;
    ;
    minsize = Numeric->size + needunits ;
    nsize += (double) Numeric->size ;
    bsize = ((double) 0x7fffffff) / sizeof (Unit) - 1 ;
    newsize = (int) ((1.2) * ((double) minsize)) ;
    nsize *= (1.2) ;
    nsize += 1 ;
    if (newsize < 0 || nsize > bsize)
    {
 ;
 newsize = (int) bsize ;
    }
    else
    {
 ;
 newsize = (((newsize) > (minsize)) ? (newsize) : (minsize)) ;
    }
    newsize = (((newsize) > (Numeric->size)) ? (newsize) : (Numeric->size)) ;
    ;
    Numeric->ibig = (-1) ;
    ;
    mnew = (union Unit_union *) ((void *)0) ;
    while (!mnew)
    {
 mnew = (union Unit_union *) umf_i_realloc (Numeric->Memory, newsize, sizeof (Unit)) ;
 if (!mnew)
 {
     if (newsize == minsize)
     {
  mnew = Numeric->Memory ;
  newsize = Numeric->size ;
     }
     else
     {
  newsize = (int) ((0.95) * ((double) newsize)) ;
  newsize = (((minsize) > (newsize)) ? (minsize) : (newsize)) ;
     }
 }
    }
    ;
    costly = (mnew != Numeric->Memory) ;
    Numeric->Memory = mnew ;
    if (Work->E [0])
    {
 int nb; int dr; int dc;
 nb = Work->nb ;
 dr = Work->fnr_curr ;
 dc = Work->fnc_curr ;
 Work->Flublock = (double *) (Numeric->Memory + Work->E [0]) ;
 Work->Flblock = Work->Flublock + nb * nb ;
 Work->Fublock = Work->Flblock + dr * nb ;
 Work->Fcblock = Work->Fublock + nb * dc ;
 ;
    }
    ;
    newmem = newsize - Numeric->size ;
    ;
    if (newmem >= 2)
    {
 p = Numeric->Memory + Numeric->size - 2 ;
 p->header.size = newmem - 1 ;
 i = Numeric->size - 1 ;
 p += newmem ;
 p->header.prevsize = newmem - 1 ;
 p->header.size = 1 ;
 Numeric->size = newsize ;
 umfdi_mem_free_tail_block (Numeric, i) ;
 Numeric->nrealloc++ ;
 if (costly)
 {
     Numeric->ncostly++ ;
 }
    }
    ;
    umfdi_garbage_collection (Numeric, Work, r2, c2, do_Fcpos) ;
    return (umfdi_build_tuples (Numeric, Work)) ;
}

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

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

variable_types: needunits int

variable_types: nsize double

variable_types: bsize double

variable_types: tsize double

variable_types: i int

variable_types: minsize int

variable_types: newsize int

variable_types: newmem int

variable_types: costly int

variable_types: row int

variable_types: col int

variable_types: dr int

variable_types: dc int


original_code:
void umfzl_scale
(
    long n,
    DoubleComplex pivot,
    DoubleComplex X [ ]
)
{
    DoubleComplex x ;
    double s ;
    long i ;
    { (s) = (((((pivot).component [0]) < 0.)) ? -((pivot).component [0]) : ((pivot).component [0])) + (((((pivot).component [1]) < 0.)) ? -((pivot).component [1]) : ((pivot).component [1])) ; } ;
    if (s < 1e-12 || ((((pivot).component [0]) != ((pivot).component [0])) || (((pivot).component [1]) != ((pivot).component [1]))))
    {
 for (i = 0 ; i < n ; i++)
 {
     x = X [i] ;
     if (((((x).component [0]) != 0.) || (((x).component [1]) != 0.)))
     {
  { (void) umfpack_divcomplex ((x).component [0], (x).component [1], (pivot).component [0], (pivot).component [1], &((X [i]).component [0]), &((X [i]).component [1])) ; } ;
     }
 }
    }
    else
    {
 for (i = 0 ; i < n ; i++)
 {
     x = X [i] ;
     { (void) umfpack_divcomplex ((x).component [0], (x).component [1], (pivot).component [0], (pivot).component [1], &((X [i]).component [0]), &((X [i]).component [1])) ; } ;
 }
    }
}

canonical_original_code:
void umfzl_scale(long n, struct DoubleComplex pivot, struct DoubleComplex X[])
{
    struct DoubleComplex x;
    double s;
    long i;
    { (s) = (((((pivot).component [0]) < 0.)) ? -((pivot).component [0]) : ((pivot).component [0])) + (((((pivot).component [1]) < 0.)) ? -((pivot).component [1]) : ((pivot).component [1])) ; } ;
    if (s < 1e-12 || ((((pivot).component [0]) != ((pivot).component [0])) || (((pivot).component [1]) != ((pivot).component [1]))))
    {
 for (i = 0 ; i < n ; i++)
 {
     x = X [i] ;
     if (((((x).component [0]) != 0.) || (((x).component [1]) != 0.)))
     {
  { (void) umfpack_divcomplex ((x).component [0], (x).component [1], (pivot).component [0], (pivot).component [1], &((X [i]).component [0]), &((X [i]).component [1])) ; } ;
     }
 }
    }
    else
    {
 for (i = 0 ; i < n ; i++)
 {
     x = X [i] ;
     { (void) umfpack_divcomplex ((x).component [0], (x).component [1], (pivot).component [0], (pivot).component [1], &((X [i]).component [0]), &((X [i]).component [1])) ; } ;
 }
    }
}

variable_types: n long

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

variable_types:
X
struct DoubleComplex []

variable_types: s double

variable_types: i long