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

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

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

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

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

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

variable_types: chain long

variable_types: nchains long

variable_types: status long

variable_types: fixQ long

variable_types: evaporate long

variable_types: jmax long

variable_types: nb long

variable_types: drop long


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

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

variable_types:
Info
double []

variable_types: flops double

variable_types: lnz double

variable_types: unz double

variable_types: maxfrsize double

variable_types: ulen double

variable_types: npiv double

variable_types: maxnrows double

variable_types: maxncols double

variable_types: scale long

variable_types: what long

variable_types: nn double

variable_types: elen double

return_type: void

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


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

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

variable_types: nz long

variable_types:
Ti
long []

variable_types:
Tj
long []

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Rp
long []

variable_types:
Rj
long []

variable_types:
W
long []

variable_types:
RowCount
long []

variable_types:
Map
long []

variable_types: i long

variable_types: j long

variable_types: k long

variable_types: p long

variable_types: cp long

variable_types: pdest long

variable_types: pj long

variable_types: duplicates long

return_type: long


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

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

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

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

variable_types: mode int

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

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

return_type: int

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


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

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

variable_types: nz int

variable_types:
Ti
int []

variable_types:
Tj
int []

variable_types:
Tx
double []

variable_types:
Tz
double []

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Ax
double []

variable_types:
Az
double []

variable_types:
Map
int []

variable_types:
RowCount
int *

variable_types:
Rp
int *

variable_types:
Rj
int *

variable_types:
W
int *

variable_types: nn int

variable_types: status int

variable_types:
Rx
double *

variable_types:
Rz
double *

variable_types: split int


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

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

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

variable_types:
X
struct DoubleComplex []

variable_types:
Pattern
int []

variable_types: k int

variable_types: deg int

variable_types:
ip
int *

variable_types: j int

variable_types: row int

variable_types:
Lpos
int *

variable_types:
Lilen
int *

variable_types: kstart int

variable_types: kend int

variable_types:
Lip
int *

variable_types: llen int

variable_types: lp int

variable_types: pos int

variable_types: npiv int

variable_types:
Li
int *

return_type: double

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


decompiled_code:
__int64 __fastcall umfpack_di_report_matrix(int a1, int a2, _DWORD *a3, __int64 a4, __int64 a5, int a6, double *a7)
{
__int64 result; // rax
bool v9; // bl
__int64 v10; // rbx
int v11; // ebp
__int64 v12; // rdx
__int64 (*v13)(const char *, ...); // r11
__int64 v14; // rsi
int v15; // eax
__int64 v16; // rdx
int v17; // er14
int v18; // er12
__int64 v19; // rbx
int v20; // ebp
int v21; // eax
__int64 v22; // r12
__int64 v23; // r13
int v24; // ebx
double v25; // xmm0_8
int v28; // [rsp+14h] [rbp-84h]
int v29; // [rsp+18h] [rbp-80h]
int v30; // [rsp+1Ch] [rbp-7Ch]
__int64 v31; // [rsp+20h] [rbp-78h]
const char *v32; // [rsp+28h] [rbp-70h]
const char *v33; // [rsp+30h] [rbp-68h]
__int64 v34; // [rsp+38h] [rbp-60h]
unsigned __int64 v35; // [rsp+40h] [rbp-58h]
_DWORD *v36; // [rsp+48h] [rbp-50h]
int v37; // [rsp+50h] [rbp-48h]

if ( !a7 )
return 0LL;
v30 = (int)*a7;
result = 0LL;
if ( v30 > 2 )
{
if ( a6 )
{
v28 = a1;
v33 = (const char *)&LC0;
v29 = a2;
v32 = "column";
}
else
{
v28 = a2;
v33 = "column";
v29 = a1;
v32 = (const char *)&LC0;
}
v9 = a1 <= 0 || a2 <= 0;
if ( amd_printf )
{
amd_printf("%s-form matrix, n_row %d n_col %d, ", v32, (unsigned int)a1, (unsigned int)a2);
if ( !v9 )
{
if ( !a3 )
{
if ( amd_printf )
amd_printf("ERROR: Ap missing\n\n");
return 4294967291LL;
}
v10 = v29;
v11 = a3[v29];
if ( amd_printf )
{
amd_printf("nz = %d. ", (unsigned int)v11);
if ( v11 < 0 )
{
if ( amd_printf )
amd_printf("ERROR: number of entries < 0\n\n");
return 4294967288LL;
}
v12 = (unsigned int)*a3;
v13 = amd_printf;
if ( (_DWORD)v12 )
{
if ( amd_printf )
{
amd_printf("ERROR: Ap [%d] = %d must be %d\n\n", 0LL, v12, 0LL);
return 4294967288LL;
}
return 4294967288LL;
}
if ( a4 )
{
if ( v30 != 3 )
{
if ( amd_printf )
{
amd_printf("\n");
v13 = amd_printf;
if ( v29 <= 0 )
goto LABEL_77;
goto LABEL_15;
}
goto LABEL_35;
}
goto LABEL_24;
}
if ( amd_printf )
{
amd_printf("ERROR: Ai missing\n\n");
return 4294967291LL;
}
return 4294967291LL;
}
LABEL_31:
if ( v11 < 0 || *a3 )
return 4294967288LL;
if ( a4 )
{
v13 = 0LL;
if ( v30 != 3 )
{
LABEL_35:
if ( v29 <= 0 )
return 0LL;
v13 = 0LL;
goto LABEL_15;
}
LABEL_24:
if ( v29 <= 0 )
{
LABEL_79:
if ( !v13 )
return 0LL;
v13("OK\n\n");
return 0LL;
}
LABEL_15:
v14 = 0LL;
while ( 1 )
{
v15 = a3[v14];
if ( v15 < 0 )
break;
if ( v15 > v11 )
{
if ( v13 )
{
v13("ERROR: Ap [%d] > size of Ai\n\n", v14);
return 4294967288LL;
}
return 4294967288LL;
}
if ( v10 == ++v14 )
{
v16 = 0LL;
do
{
if ( a3[v16 + 1] - a3[v16] < 0 )
{
if ( v13 )
{
v13("ERROR: # entries in %s %d is < 0\n\n", v32);
return 4294967288LL;
}
return 4294967288LL;
}
++v16;
}
while ( v10 != v16 );
v35 = 0LL;
v17 = v30;
v36 = a3;
while ( 2 )
{
v18 = v36[v35 + 1];
v19 = (int)v36[v35];
if ( v35 <= 9 )
v17 = v30;
v37 = v18 - v19;
if ( v17 == 3 )
{
if ( (int)v19 < v18 )
goto LABEL_50;
LABEL_92:
if ( v29 <= (int)v35 + 1 )
{
LABEL_76:
if ( v30 == 3 )
goto LABEL_79;
LABEL_77:
if ( v13 )
{
v13(" %s-form matrix ", v32);
v13 = amd_printf;
goto LABEL_79;
}
return 0LL;
}
}
else
{
if ( v13 )
{
v13(
"\n %s %d: start: %d end: %d entries: %d\n",
v32,
(unsigned int)v35,
(unsigned int)v19,
(unsigned int)(v18 - 1),
(unsigned int)(v18 - v19));
v13 = amd_printf;
}
if ( (int)v19 < v18 )
{
LABEL_50:
v20 = -1;
v21 = v18 - 1;
v22 = 0LL;
v31 = (unsigned int)(v21 - v19);
v23 = a4 + 4 * v19;
v34 = a5 + 8 * v19;
while ( 1 )
{
v24 = v20;
v20 = *(_DWORD *)(v23 + 4 * v22);
if ( v17 != 3 )
{
if ( v13 )
{
v13("\t%s %d ", v33, (unsigned int)v20);
v13 = amd_printf;
if ( a5 )
{
if ( amd_printf )
{
amd_printf(":");
v13 = amd_printf;
v25 = *(double *)(v34 + 8 * v22);
if ( v25 == 0.0 )
{
if ( amd_printf )
{
amd_printf(" (0)");
v13 = amd_printf;
}
}
else if ( amd_printf )
{
amd_printf(" (%g)", v25);
v13 = amd_printf;
}
}
}
}
}
if ( v20 < 0 || v28 <= v20 )
{
if ( !v13 )
return 4294967288LL;
v13(
" ERROR: %s index %d out of range in %s %d\n\n",
v33,
(unsigned int)v20,
v32,
(unsigned int)v35);
return 4294967288LL;
}
if ( v20 <= v24 )
break;
if ( v17 != 3 )
{
if ( v13 )
{
v13("\n");
v13 = amd_printf;
if ( v17 == 4 && v37 > 10 && (_DWORD)v22 == 9 )
{
v17 = 3;
if ( amd_printf )
{
amd_printf("\t...\n");
v13 = amd_printf;
}
}
}
else if ( v17 == 4 && v37 > 10 && (_DWORD)v22 == 9 )
{
v17 = 3;
}
}
if ( v31 == v22 )
goto LABEL_73;
++v22;
}
if ( !v13 )
return 4294967288LL;
v13(
" ERROR: %s index %d out of order (or duplicate) in %s %d\n\n",
v33,
(unsigned int)v20,
v32,
(unsigned int)v35);
return 4294967288LL;
}
LABEL_73:
if ( v17 != 4 || (_DWORD)v35 != 9 )
goto LABEL_92;
if ( v29 <= 10 )
goto LABEL_76;
if ( v13 )
{
v13("\n ...\n");
v13 = amd_printf;
}
v17 = 3;
}
++v35;
continue;
}
}
}
if ( v13 )
{
v13("ERROR: Ap [%d] < 0\n\n", v14);
return 4294967288LL;
}
return 4294967288LL;
}
return 4294967291LL;
}
if ( amd_printf )
{
amd_printf("ERROR: n_row <= 0 or n_col <= 0\n\n");
return 4294967290LL;
}
}
else if ( !v9 )
{
if ( !a3 )
return 4294967291LL;
v10 = v29;
v11 = a3[v29];
goto LABEL_31;
}
result = 4294967290LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, int a2, _DWORD *a3, __int64 a4, __int64 a5, int a6, double *a7)
{
__int64 result; // rax
bool v9; // bl
__int64 v10; // rbx
int v11; // ebp
__int64 v12; // rdx
__int64 (*v13)(const char *, ...); // r11
__int64 v14; // rsi
int v15; // eax
__int64 v16; // rdx
int v17; // er14
int v18; // er12
__int64 v19; // rbx
int v20; // ebp
int v21; // eax
__int64 v22; // r12
__int64 v23; // r13
int v24; // ebx
double v25; // xmm0_8
int v28; // [rsp+14h] [rbp-84h]
int v29; // [rsp+18h] [rbp-80h]
int v30; // [rsp+1Ch] [rbp-7Ch]
__int64 v31; // [rsp+20h] [rbp-78h]
const char *v32; // [rsp+28h] [rbp-70h]
const char *v33; // [rsp+30h] [rbp-68h]
__int64 v34; // [rsp+38h] [rbp-60h]
unsigned __int64 v35; // [rsp+40h] [rbp-58h]
_DWORD *v36; // [rsp+48h] [rbp-50h]
int v37; // [rsp+50h] [rbp-48h]

if ( !a7 )
return 0LL;
v30 = (int)*a7;
result = 0LL;
if ( v30 > 2 )
{
if ( a6 )
{
v28 = a1;
v33 = (const char *)&LC0;
v29 = a2;
v32 = "column";
}
else
{
v28 = a2;
v33 = "column";
v29 = a1;
v32 = (const char *)&LC0;
}
v9 = a1 <= 0 || a2 <= 0;
if ( amd_printf )
{
amd_printf("%s-form matrix, n_row %d n_col %d, ", v32, (unsigned int)a1, (unsigned int)a2);
if ( !v9 )
{
if ( !a3 )
{
if ( amd_printf )
amd_printf("ERROR: Ap missing\n\n");
return 4294967291LL;
}
v10 = v29;
v11 = a3[v29];
if ( amd_printf )
{
amd_printf("nz = %d. ", (unsigned int)v11);
if ( v11 < 0 )
{
if ( amd_printf )
amd_printf("ERROR: number of entries < 0\n\n");
return 4294967288LL;
}
v12 = (unsigned int)*a3;
v13 = amd_printf;
if ( (_DWORD)v12 )
{
if ( amd_printf )
{
amd_printf("ERROR: Ap [%d] = %d must be %d\n\n", 0LL, v12, 0LL);
return 4294967288LL;
}
return 4294967288LL;
}
if ( a4 )
{
if ( v30 != 3 )
{
if ( amd_printf )
{
amd_printf("\n");
v13 = amd_printf;
if ( v29 <= 0 )
goto LABEL_77;
goto LABEL_15;
}
goto LABEL_35;
}
goto LABEL_24;
}
if ( amd_printf )
{
amd_printf("ERROR: Ai missing\n\n");
return 4294967291LL;
}
return 4294967291LL;
}
LABEL_31:
if ( v11 < 0 || *a3 )
return 4294967288LL;
if ( a4 )
{
v13 = 0LL;
if ( v30 != 3 )
{
LABEL_35:
if ( v29 <= 0 )
return 0LL;
v13 = 0LL;
goto LABEL_15;
}
LABEL_24:
if ( v29 <= 0 )
{
LABEL_79:
if ( !v13 )
return 0LL;
v13("OK\n\n");
return 0LL;
}
LABEL_15:
v14 = 0LL;
while ( 1 )
{
v15 = a3[v14];
if ( v15 < 0 )
break;
if ( v15 > v11 )
{
if ( v13 )
{
v13("ERROR: Ap [%d] > size of Ai\n\n", v14);
return 4294967288LL;
}
return 4294967288LL;
}
if ( v10 == ++v14 )
{
v16 = 0LL;
do
{
if ( a3[v16 + 1] - a3[v16] < 0 )
{
if ( v13 )
{
v13("ERROR: # entries in %s %d is < 0\n\n", v32);
return 4294967288LL;
}
return 4294967288LL;
}
++v16;
}
while ( v10 != v16 );
v35 = 0LL;
v17 = v30;
v36 = a3;
while ( 2 )
{
v18 = v36[v35 + 1];
v19 = (int)v36[v35];
if ( v35 <= 9 )
v17 = v30;
v37 = v18 - v19;
if ( v17 == 3 )
{
if ( (int)v19 < v18 )
goto LABEL_50;
LABEL_92:
if ( v29 <= (int)v35 + 1 )
{
LABEL_76:
if ( v30 == 3 )
goto LABEL_79;
LABEL_77:
if ( v13 )
{
v13(" %s-form matrix ", v32);
v13 = amd_printf;
goto LABEL_79;
}
return 0LL;
}
}
else
{
if ( v13 )
{
v13(
"\n %s %d: start: %d end: %d entries: %d\n",
v32,
(unsigned int)v35,
(unsigned int)v19,
(unsigned int)(v18 - 1),
(unsigned int)(v18 - v19));
v13 = amd_printf;
}
if ( (int)v19 < v18 )
{
LABEL_50:
v20 = -1;
v21 = v18 - 1;
v22 = 0LL;
v31 = (unsigned int)(v21 - v19);
v23 = a4 + 4 * v19;
v34 = a5 + 8 * v19;
while ( 1 )
{
v24 = v20;
v20 = *(_DWORD *)(v23 + 4 * v22);
if ( v17 != 3 )
{
if ( v13 )
{
v13("\t%s %d ", v33, (unsigned int)v20);
v13 = amd_printf;
if ( a5 )
{
if ( amd_printf )
{
amd_printf(":");
v13 = amd_printf;
v25 = *(double *)(v34 + 8 * v22);
if ( v25 == 0.0 )
{
if ( amd_printf )
{
amd_printf(" (0)");
v13 = amd_printf;
}
}
else if ( amd_printf )
{
amd_printf(" (%g)", v25);
v13 = amd_printf;
}
}
}
}
}
if ( v20 < 0 || v28 <= v20 )
{
if ( !v13 )
return 4294967288LL;
v13(
" ERROR: %s index %d out of range in %s %d\n\n",
v33,
(unsigned int)v20,
v32,
(unsigned int)v35);
return 4294967288LL;
}
if ( v20 <= v24 )
break;
if ( v17 != 3 )
{
if ( v13 )
{
v13("\n");
v13 = amd_printf;
if ( v17 == 4 && v37 > 10 && (_DWORD)v22 == 9 )
{
v17 = 3;
if ( amd_printf )
{
amd_printf("\t...\n");
v13 = amd_printf;
}
}
}
else if ( v17 == 4 && v37 > 10 && (_DWORD)v22 == 9 )
{
v17 = 3;
}
}
if ( v31 == v22 )
goto LABEL_73;
++v22;
}
if ( !v13 )
return 4294967288LL;
v13(
" ERROR: %s index %d out of order (or duplicate) in %s %d\n\n",
v33,
(unsigned int)v20,
v32,
(unsigned int)v35);
return 4294967288LL;
}
LABEL_73:
if ( v17 != 4 || (_DWORD)v35 != 9 )
goto LABEL_92;
if ( v29 <= 10 )
goto LABEL_76;
if ( v13 )
{
v13("\n ...\n");
v13 = amd_printf;
}
v17 = 3;
}
++v35;
continue;
}
}
}
if ( v13 )
{
v13("ERROR: Ap [%d] < 0\n\n", v14);
return 4294967288LL;
}
return 4294967288LL;
}
return 4294967291LL;
}
if ( amd_printf )
{
amd_printf("ERROR: n_row <= 0 or n_col <= 0\n\n");
return 4294967290LL;
}
}
else if ( !v9 )
{
if ( !a3 )
return 4294967291LL;
v10 = v29;
v11 = a3[v29];
goto LABEL_31;
}
result = 4294967290LL;
}
return result;
}

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

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

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Ax
double []

variable_types:
Control
double [20]

variable_types: a double

variable_types: prl int

variable_types: i int

variable_types: length int

variable_types: ilast int

variable_types: p int

variable_types: nz int

variable_types: n int


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

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

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

variable_types: norm int

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

variable_types: xnorm double

variable_types: s double

variable_types: x double

variable_types: z double

variable_types:
Xx
double *

variable_types:
Xz
double *

variable_types:
W
double *

variable_types: nrow int

variable_types: ncol int

variable_types: d int

variable_types: j int

variable_types: xtype int


decompiled_code:
__int64 __fastcall abs_value(int a1, __int64 a2, __int64 a3, int a4, __int64 a5)
{
__int64 result; // rax

if ( a1 == 2 )
return (*(__int64 (__fastcall **)(double, double))(a5 + 1920))(
*(double *)(a2 + 16LL * a4),
*(double *)(a2 + 16LL * a4 + 8));
if ( a1 > 2 && a1 == 3 )
result = (*(__int64 (__fastcall **)(double, double))(a5 + 1920))(
*(double *)(a2 + 8LL * a4),
*(double *)(a3 + 8LL * a4));
return result;
}

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

if ( a1 == 2 )
return (*(__int64 (__fastcall **)(double, double))(a5 + 1920))(
*(double *)(a2 + 16LL * a4),
*(double *)(a2 + 16LL * a4 + 8));
if ( a1 > 2 && a1 == 3 )
result = (*(__int64 (__fastcall **)(double, double))(a5 + 1920))(
*(double *)(a2 + 8LL * a4),
*(double *)(a3 + 8LL * a4));
return result;
}

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

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

variable_types:
Ax
double *

variable_types:
Az
double *

variable_types: p int

user_defined_types: struct cholmod_method_struct { double lnz; double fl; double prune_dense; double prune_dense2; double nd_oksep; double other_1[4]; unsigned long nd_small; unsigned long other_2[4]; int aggressive; int order_for_lu; int nd_compress; int nd_camd; int nd_components; int ordering; unsigned long other_3[4]; }


decompiled_code:
char __fastcall umfpack_di_report_status(double *a1, unsigned int a2)
{
int v2; // er12
unsigned int v3; // eax
__int64 (*v4)(const char *, ...); // rdx

if ( a1 )
{
v2 = (int)*a1;
LOBYTE(v3) = v2 <= 1;
if ( v2 <= 0 )
return v3;
}
else
{
LOBYTE(v3) = 1;
v2 = 1;
}
if ( !a2 && (_BYTE)v3 )
return v3;
if ( !amd_printf )
{
if ( v2 <= 3 )
goto LABEL_21;
goto LABEL_20;
}
LOBYTE(v3) = amd_printf("\n");
if ( v2 <= 3 )
goto LABEL_15;
if ( !amd_printf )
{
LABEL_20:
if ( v2 <= 5 )
goto LABEL_15;
LABEL_21:
if ( a2 == -911 )
return v3;
v3 = a2 + 18;
if ( a2 + 18 > 0x13 )
return v3;
v4 = 0LL;
goto LABEL_18;
}
LOBYTE(v3) = amd_printf("%s\n");
if ( v2 > 5 )
{
if ( !amd_printf )
goto LABEL_21;
LOBYTE(v3) = amd_printf("%s");
if ( !amd_printf )
goto LABEL_21;
LOBYTE(v3) = amd_printf("%s");
if ( !amd_printf )
goto LABEL_21;
LOBYTE(v3) = amd_printf("%s");
}
LABEL_15:
if ( !amd_printf )
goto LABEL_21;
LOBYTE(v3) = amd_printf("UMFPACK V%d.%d.%d (%s): ", 5LL, 6LL, 1LL, "Jun 20, 2012");
v4 = amd_printf;
if ( a2 != -911 )
{
v3 = a2 + 18;
LABEL_18:
switch ( v3 )
{
case 0u:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: ordering failed\n");
goto LABEL_28;
}
break;
case 3u:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: invalid permutation\n");
goto LABEL_28;
}
break;
case 5u:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: system argument invalid\n");
goto LABEL_28;
}
break;
case 7u:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: pattern of matrix (Ap and/or Ai) has changed\n");
goto LABEL_28;
}
break;
case 0xAu:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: input matrix is invalid\n");
goto LABEL_28;
}
break;
case 0xCu:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: dimension (n_row or n_col) must be > 0\n");
goto LABEL_28;
}
break;
case 0xDu:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: required argument(s) missing\n");
goto LABEL_28;
}
break;
case 0xEu:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: Symbolic object is invalid\n");
goto LABEL_28;
}
break;
case 0xFu:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: Numeric object is invalid\n");
goto LABEL_28;
}
break;
case 0x11u:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: out of memory\n");
goto LABEL_28;
}
break;
case 0x12u:
if ( v4 )
{
LOBYTE(v3) = v4("OK\n");
goto LABEL_28;
}
break;
case 0x13u:
if ( v4 )
{
LOBYTE(v3) = v4("WARNING: matrix is singular\n");
goto LABEL_28;
}
break;
default:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: Unrecognized error code: %d\n", a2);
goto LABEL_28;
}
break;
}
return v3;
}
if ( amd_printf )
{
LOBYTE(v3) = amd_printf(
"INTERNAL ERROR!\n"
"Input arguments might be corrupted or aliased, or an internal\n"
"error has occurred. Check your input arguments with the\n"
"umfpack_*_report_* routines before calling the umfpack_*\n"
"computational routines. Recompile UMFPACK with debugging\n"
"enabled, and look for failed assertions. If all else fails\n"
"please report this error to Tim Davis\n"
"(DrTimothyAldenDavis@gmail.com).\n");
LABEL_28:
if ( amd_printf )
LOBYTE(v3) = amd_printf("\n");
}
return v3;
}

canonical_decompiled_code:
char __fastcall func0(double *a1, unsigned int a2)
{
int v2; // er12
unsigned int v3; // eax
__int64 (*v4)(const char *, ...); // rdx

if ( a1 )
{
v2 = (int)*a1;
LOBYTE(v3) = v2 <= 1;
if ( v2 <= 0 )
return v3;
}
else
{
LOBYTE(v3) = 1;
v2 = 1;
}
if ( !a2 && (_BYTE)v3 )
return v3;
if ( !amd_printf )
{
if ( v2 <= 3 )
goto LABEL_21;
goto LABEL_20;
}
LOBYTE(v3) = amd_printf("\n");
if ( v2 <= 3 )
goto LABEL_15;
if ( !amd_printf )
{
LABEL_20:
if ( v2 <= 5 )
goto LABEL_15;
LABEL_21:
if ( a2 == -911 )
return v3;
v3 = a2 + 18;
if ( a2 + 18 > 0x13 )
return v3;
v4 = 0LL;
goto LABEL_18;
}
LOBYTE(v3) = amd_printf("%s\n");
if ( v2 > 5 )
{
if ( !amd_printf )
goto LABEL_21;
LOBYTE(v3) = amd_printf("%s");
if ( !amd_printf )
goto LABEL_21;
LOBYTE(v3) = amd_printf("%s");
if ( !amd_printf )
goto LABEL_21;
LOBYTE(v3) = amd_printf("%s");
}
LABEL_15:
if ( !amd_printf )
goto LABEL_21;
LOBYTE(v3) = amd_printf("UMFPACK V%d.%d.%d (%s): ", 5LL, 6LL, 1LL, "Jun 20, 2012");
v4 = amd_printf;
if ( a2 != -911 )
{
v3 = a2 + 18;
LABEL_18:
switch ( v3 )
{
case 0u:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: ordering failed\n");
goto LABEL_28;
}
break;
case 3u:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: invalid permutation\n");
goto LABEL_28;
}
break;
case 5u:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: system argument invalid\n");
goto LABEL_28;
}
break;
case 7u:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: pattern of matrix (Ap and/or Ai) has changed\n");
goto LABEL_28;
}
break;
case 0xAu:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: input matrix is invalid\n");
goto LABEL_28;
}
break;
case 0xCu:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: dimension (n_row or n_col) must be > 0\n");
goto LABEL_28;
}
break;
case 0xDu:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: required argument(s) missing\n");
goto LABEL_28;
}
break;
case 0xEu:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: Symbolic object is invalid\n");
goto LABEL_28;
}
break;
case 0xFu:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: Numeric object is invalid\n");
goto LABEL_28;
}
break;
case 0x11u:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: out of memory\n");
goto LABEL_28;
}
break;
case 0x12u:
if ( v4 )
{
LOBYTE(v3) = v4("OK\n");
goto LABEL_28;
}
break;
case 0x13u:
if ( v4 )
{
LOBYTE(v3) = v4("WARNING: matrix is singular\n");
goto LABEL_28;
}
break;
default:
if ( v4 )
{
LOBYTE(v3) = v4("ERROR: Unrecognized error code: %d\n", a2);
goto LABEL_28;
}
break;
}
return v3;
}
if ( amd_printf )
{
LOBYTE(v3) = amd_printf(
"INTERNAL ERROR!\n"
"Input arguments might be corrupted or aliased, or an internal\n"
"error has occurred. Check your input arguments with the\n"
"umfpack_*_report_* routines before calling the umfpack_*\n"
"computational routines. Recompile UMFPACK with debugging\n"
"enabled, and look for failed assertions. If all else fails\n"
"please report this error to Tim Davis\n"
"(DrTimothyAldenDavis@gmail.com).\n");
LABEL_28:
if ( amd_printf )
LOBYTE(v3) = amd_printf("\n");
}
return v3;
}

original_code:
void umfpack_di_report_status
(
    const double Control [20],
    int status
)
{
    int prl ;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl < 1)
    {
 return ;
    }
    if (status == (0) && prl <= 1)
    {
 return ;
    }
    { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("%s\n", "UMFPACK:  Copyright (c) 2005-2012 by Timothy A. Davis.  All Rights Reserved.\n") ; } ; } } ;
    { if (prl >= (6)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("%s", "\nUMFPACK License:\n" "\n" "   UMFPACK is available under alternate licenses,\n" "   contact T. Davis for details.\n" "\n" "   Your use or distribution of UMFPACK or any modified version of\n" "   UMFPACK implies that you agree to this License.\n" "\n" "   This library is free software; you can redistribute it and/or\n" "   modify it under the terms of the GNU General Public\n" "   License as published by the Free Software Foundation; either\n" "   version 2 of the License, or (at your option) any later version.\n" "\n" "   This library is distributed in the hope that it will be useful,\n" "   but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n" "   General Public License for more details.\n" "\n" "   You should have received a copy of the GNU General Public\n" "   License along with this library; if not, write to the Free Software\n" "   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301\n" "   USA\n") ; } ; } } ;
    { if (prl >= (6)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("%s", "\n" "   Permission is hereby granted to use or copy this program under the\n" "   terms of the GNU GPL, provided that the Copyright, this License,\n" "   and the Availability of the original version is retained on all copies.\n" "   User documentation of any code that uses this code or any modified\n" "   version of this code must cite the Copyright, this License, the\n" "   Availability note, and \"Used by permission.\" Permission to modify\n" "   the code and to distribute modified code is granted, provided the\n" "   Copyright, this License, and the Availability note are retained,\n" "   and a notice that the code was modified is included.\n") ; } ; } } ;
    { if (prl >= (6)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("%s", "\n" "Availability: http://www.suitesparse.com" "\n") ; } ; } } ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("UMFPACK V%d.%d.%d (%s): ", 5, 6, 1, "Jun 20, 2012") ; } ;
    switch (status)
    {
 case (0):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n") ; } ;
     break ;
 case (1):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("WARNING: matrix is singular\n") ; } ;
     break ;
 case (-1):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: out of memory\n") ; } ;
     break ;
 case (-3):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Numeric object is invalid\n") ; } ;
     break ;
 case (-4):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Symbolic object is invalid\n") ; } ;
     break ;
 case (-5):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: required argument(s) missing\n") ; } ;
     break ;
 case (-6):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: dimension (n_row or n_col) must be > 0\n") ; } ;
     break ;
 case (-8):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: input matrix is invalid\n") ; } ;
     break ;
 case (-13):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: system argument invalid\n") ; } ;
     break ;
 case (-15):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid permutation\n") ; } ;
     break ;
 case (-11):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: pattern of matrix (Ap and/or Ai) has changed\n") ; } ;
     break ;
        case (-18):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: ordering failed\n") ; } ;
     break ;
 case (-911):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("INTERNAL ERROR!\n" "Input arguments might be corrupted or aliased, or an internal\n" "error has occurred.  Check your input arguments with the\n" "umfpack_*_report_* routines before calling the umfpack_*\n" "computational routines.  Recompile UMFPACK with debugging\n" "enabled, and look for failed assertions.  If all else fails\n" "please report this error to Tim Davis\n" "(DrTimothyAldenDavis@gmail.com).\n" ) ; } ;
     break ;
 default:
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Unrecognized error code: ""%d""\n", status) ; } ;
    }
    { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ;
}

canonical_original_code:
void umfpack_di_report_status(double Control[20], int status)
{
    int prl;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl < 1)
    {
 return ;
    }
    if (status == (0) && prl <= 1)
    {
 return ;
    }
    { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("%s\n", "UMFPACK:  Copyright (c) 2005-2012 by Timothy A. Davis.  All Rights Reserved.\n") ; } ; } } ;
    { if (prl >= (6)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("%s", "\nUMFPACK License:\n" "\n" "   UMFPACK is available under alternate licenses,\n" "   contact T. Davis for details.\n" "\n" "   Your use or distribution of UMFPACK or any modified version of\n" "   UMFPACK implies that you agree to this License.\n" "\n" "   This library is free software; you can redistribute it and/or\n" "   modify it under the terms of the GNU General Public\n" "   License as published by the Free Software Foundation; either\n" "   version 2 of the License, or (at your option) any later version.\n" "\n" "   This library is distributed in the hope that it will be useful,\n" "   but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n" "   General Public License for more details.\n" "\n" "   You should have received a copy of the GNU General Public\n" "   License along with this library; if not, write to the Free Software\n" "   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301\n" "   USA\n") ; } ; } } ;
    { if (prl >= (6)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("%s", "\n" "   Permission is hereby granted to use or copy this program under the\n" "   terms of the GNU GPL, provided that the Copyright, this License,\n" "   and the Availability of the original version is retained on all copies.\n" "   User documentation of any code that uses this code or any modified\n" "   version of this code must cite the Copyright, this License, the\n" "   Availability note, and \"Used by permission.\" Permission to modify\n" "   the code and to distribute modified code is granted, provided the\n" "   Copyright, this License, and the Availability note are retained,\n" "   and a notice that the code was modified is included.\n") ; } ; } } ;
    { if (prl >= (6)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("%s", "\n" "Availability: http://www.suitesparse.com" "\n") ; } ; } } ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("UMFPACK V%d.%d.%d (%s): ", 5, 6, 1, "Jun 20, 2012") ; } ;
    switch (status)
    {
 case (0):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n") ; } ;
     break ;
 case (1):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("WARNING: matrix is singular\n") ; } ;
     break ;
 case (-1):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: out of memory\n") ; } ;
     break ;
 case (-3):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Numeric object is invalid\n") ; } ;
     break ;
 case (-4):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Symbolic object is invalid\n") ; } ;
     break ;
 case (-5):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: required argument(s) missing\n") ; } ;
     break ;
 case (-6):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: dimension (n_row or n_col) must be > 0\n") ; } ;
     break ;
 case (-8):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: input matrix is invalid\n") ; } ;
     break ;
 case (-13):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: system argument invalid\n") ; } ;
     break ;
 case (-15):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid permutation\n") ; } ;
     break ;
 case (-11):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: pattern of matrix (Ap and/or Ai) has changed\n") ; } ;
     break ;
        case (-18):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: ordering failed\n") ; } ;
     break ;
 case (-911):
     { if (amd_printf != ((void *)0)) (void) amd_printf ("INTERNAL ERROR!\n" "Input arguments might be corrupted or aliased, or an internal\n" "error has occurred.  Check your input arguments with the\n" "umfpack_*_report_* routines before calling the umfpack_*\n" "computational routines.  Recompile UMFPACK with debugging\n" "enabled, and look for failed assertions.  If all else fails\n" "please report this error to Tim Davis\n" "(DrTimothyAldenDavis@gmail.com).\n" ) ; } ;
     break ;
 default:
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Unrecognized error code: ""%d""\n", status) ; } ;
    }
    { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ;
}

variable_types:
Control
double [20]

variable_types: status int

variable_types: prl int


original_code:
int umfzi_mem_alloc_element
(
    NumericType *Numeric,
    int nrows,
    int ncols,
    int **Rows,
    int **Cols,
    DoubleComplex **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 (DoubleComplex) * ((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 (DoubleComplex) * ((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 (DoubleComplex) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) != (((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (DoubleComplex) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1))))
    {
 return (0) ;
    }
    i = umfzi_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 = (DoubleComplex *) 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 umfzi_mem_alloc_element(struct NumericType *Numeric, int nrows, int ncols, int **Rows, int **Cols, struct DoubleComplex **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 (DoubleComplex) * ((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 (DoubleComplex) * ((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 (DoubleComplex) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) != (((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (int) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (DoubleComplex) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1))))
    {
 return (0) ;
    }
    i = umfzi_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 = (struct DoubleComplex *) 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; struct DoubleComplex { double component[2]; } *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
struct DoubleComplex **

variable_types:
size
int *

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

variable_types:
ep
struct Element { int cdeg; } *

variable_types: i int


original_code:
int umfzi_mem_alloc_tail_block
(
    NumericType *Numeric,
    int nunits
)
{
    int bigsize, usage ;
    Unit *p, *pnext, *pbig ;
    ;
    ;
    bigsize = 0 ;
    pbig = (Unit *) ((void *)0) ;
    ;
    if (Numeric->ibig != (-1))
    {
 ;
 ;
 pbig = Numeric->Memory + Numeric->ibig ;
 bigsize = -pbig->header.size ;
 ;
 ;
    }
    if (pbig && bigsize >= nunits)
    {
 p = pbig ;
 pnext = p + 1 + bigsize ;
 ;
 ;
 ;
 bigsize -= nunits + 1 ;
 if (bigsize < 4)
 {
     p->header.size = -p->header.size ;
     ;
     Numeric->ibig = (-1) ;
 }
 else
 {
     p->header.size = nunits ;
     Numeric->ibig += nunits + 1 ;
     pbig = Numeric->Memory + Numeric->ibig ;
     pbig->header.size = -bigsize ;
     pbig->header.prevsize = nunits ;
     pnext->header.prevsize = bigsize ;
     ;
 }
    }
    else
    {
 pnext = Numeric->Memory + Numeric->itail ;
 ;
 if ((nunits + 1) > (Numeric->itail - Numeric->ihead))
 {
     ;
     return (0) ;
 }
 Numeric->itail -= (nunits + 1) ;
 p = Numeric->Memory + Numeric->itail ;
 p->header.size = nunits ;
 p->header.prevsize = 0 ;
 pnext->header.prevsize = nunits ;
 ;
    }
    Numeric->tail_usage += p->header.size + 1 ;
    usage = Numeric->ihead + Numeric->tail_usage ;
    Numeric->max_usage = (((Numeric->max_usage) > (usage)) ? (Numeric->max_usage) : (usage)) ;
    return ((p - Numeric->Memory) + 1) ;
}

canonical_original_code:
int umfzi_mem_alloc_tail_block(struct NumericType *Numeric, int nunits)
{
    int bigsize; int usage;
    union Unit_union *p; union Unit_union *pnext; union Unit_union *pbig;
    ;
    ;
    bigsize = 0 ;
    pbig = (union Unit_union *) ((void *)0) ;
    ;
    if (Numeric->ibig != (-1))
    {
 ;
 ;
 pbig = Numeric->Memory + Numeric->ibig ;
 bigsize = -pbig->header.size ;
 ;
 ;
    }
    if (pbig && bigsize >= nunits)
    {
 p = pbig ;
 pnext = p + 1 + bigsize ;
 ;
 ;
 ;
 bigsize -= nunits + 1 ;
 if (bigsize < 4)
 {
     p->header.size = -p->header.size ;
     ;
     Numeric->ibig = (-1) ;
 }
 else
 {
     p->header.size = nunits ;
     Numeric->ibig += nunits + 1 ;
     pbig = Numeric->Memory + Numeric->ibig ;
     pbig->header.size = -bigsize ;
     pbig->header.prevsize = nunits ;
     pnext->header.prevsize = bigsize ;
     ;
 }
    }
    else
    {
 pnext = Numeric->Memory + Numeric->itail ;
 ;
 if ((nunits + 1) > (Numeric->itail - Numeric->ihead))
 {
     ;
     return (0) ;
 }
 Numeric->itail -= (nunits + 1) ;
 p = Numeric->Memory + Numeric->itail ;
 p->header.size = nunits ;
 p->header.prevsize = 0 ;
 pnext->header.prevsize = nunits ;
 ;
    }
    Numeric->tail_usage += p->header.size + 1 ;
    usage = Numeric->ihead + Numeric->tail_usage ;
    Numeric->max_usage = (((Numeric->max_usage) > (usage)) ? (Numeric->max_usage) : (usage)) ;
    return ((p - Numeric->Memory) + 1) ;
}

variable_types: nunits int

variable_types: bigsize int

variable_types: usage int

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

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


decompiled_code:
__int64 __fastcall umfpack_di_get_determinant(double *a1, double *a2, __int64 a3, char *a4)
{
char *v7; // rbx
int v8; // er14
__int64 v9; // r8
int v10; // er15
double *v11; // rdx
double v12; // xmm0_8
double *v13; // rcx
__int64 v14; // rdx
double *v15; // r9
double *v16; // r10
__int64 v17; // rcx
__int64 v18; // rax
int *v19; // rdi
int *v20; // r10
char v21; // dl
int i; // er9
int j; // eax
int v24; // esi
int *v25; // rcx
__int64 v26; // rsi
__int64 v27; // rax
int k; // er9
int l; // eax
int v30; // esi
int *v31; // rcx
double v32; // xmm1_8
double v33; // xmm0_8
__int64 result; // rax
double v35; // xmm0_8
double *v36; // rdx
__int64 v37; // r9
double v38; // xmm1_8
char *v39; // rax
double v40; // xmm0_8
__int64 v41; // [rsp+8h] [rbp-320h]
double v42; // [rsp+10h] [rbp-318h] BYREF
double y; // [rsp+18h] [rbp-310h] BYREF
char v44[720]; // [rsp+20h] [rbp-308h] BYREF
char v45; // [rsp+2F0h] [rbp-38h] BYREF

v7 = a4;
if ( !a4 )
{
v7 = v44;
v39 = v44;
do
{
*(_QWORD *)v39 = LC5;
v39 += 8;
}
while ( &v45 != v39 );
}
*(_QWORD *)v7 = 0LL;
if ( (unsigned int)umfdi_valid_numeric(a3) )
{
v8 = *(_DWORD *)(a3 + 232);
if ( v8 == *(_DWORD *)(a3 + 236) )
{
if ( a1 )
{
v9 = umf_i_malloc((unsigned int)v8, 4LL);
if ( v9 )
{
y = 0.0;
v10 = *(_DWORD *)(a3 + 216);
v11 = *(double **)(a3 + 208);
v42 = *(double *)&LC2;
if ( v8 <= 0 )
goto LABEL_32;
v12 = *(double *)&LC2;
v13 = &v42;
while ( 1 )
{
v42 = v12 * *v11;
if ( !(unsigned int)rescale_determinant(v13, &y) )
goto LABEL_11;
v11 = (double *)(v14 + 8);
if ( v16 == v11 )
break;
v12 = v42;
}
if ( v15 )
{
while ( 1 )
{
v38 = *v15;
v35 = v10 ? v42 / v38 : v42 * v38;
v42 = v35;
if ( !(unsigned int)rescale_determinant(v13, &y) )
break;
v15 = (double *)(v37 + 8);
if ( v36 == v15 )
goto LABEL_12;
}
LABEL_11:
*(_QWORD *)v7 = LC2;
}
LABEL_12:
v17 = *(_QWORD *)(a3 + 120);
v18 = 0LL;
do
{
*(_DWORD *)(v9 + 4 * v18) = *(_DWORD *)(v17 + 4 * v18);
++v18;
}
while ( v8 > (int)v18 );
v19 = (int *)v9;
v20 = (int *)v9;
v21 = 0;
for ( i = 0; i < v8; ++i )
{
for ( j = *v20; j != i; *v20 = j )
{
v24 = j;
++v21;
v25 = (int *)(v9 + 4LL * j);
j = *v25;
*v25 = v24;
}
++v20;
}
v26 = *(_QWORD *)(a3 + 128);
v27 = 0LL;
do
{
*(_DWORD *)(v9 + 4 * v27) = *(_DWORD *)(v26 + 4 * v27);
++v27;
}
while ( v8 > (int)v27 );
for ( k = 0; k < v8; ++k )
{
for ( l = *v19; l != k; *v19 = l )
{
v30 = l;
++v21;
v31 = (int *)(v9 + 4LL * l);
l = *v31;
*v31 = v30;
}
++v19;
}
v41 = LC5;
if ( (v21 & 1) == 0 )
LABEL_32:
v41 = LC2;
umf_i_free(v9);
v32 = y;
if ( a2 )
{
v33 = v42;
*a2 = y;
}
else
{
v40 = pow(10.0, y);
v32 = y;
v33 = v40 * v42;
}
*a1 = v33 * *(double *)&v41;
if ( v32 + 1.0 > 308.2547155599167 )
{
*(_QWORD *)v7 = LC10;
result = 0LL;
}
else
{
result = 0LL;
if ( v32 - 1.0 < -307.6526555685888 )
{
*(_QWORD *)v7 = LC12;
result = 0LL;
}
}
}
else
{
*(_QWORD *)v7 = LC5;
result = 0xFFFFFFFFLL;
}
}
else
{
*(_QWORD *)v7 = LC8;
result = 4294967291LL;
}
}
else
{
*(_QWORD *)v7 = LC7;
result = 4294967283LL;
}
}
else
{
*(_QWORD *)v7 = LC6;
result = 4294967293LL;
}
return result;
}

original_code:
int umfpack_di_get_determinant
(
    double *Mx,
    double *Ex,
    void *NumericHandle,
    double User_Info [90]
)
{
    double d_mantissa, d_tmp ;
    double d_exponent, Info2 [90], one [2] = {1.0, 0.0}, d_sign ;
    double *D ;
    double *Info, *Rs ;
    NumericType *Numeric ;
    int i, n, itmp, npiv, *Wi, *Rperm, *Cperm, do_scale ;
    int do_recip ;
    if (User_Info != (double *) ((void *)0))
    {
 Info = User_Info ;
    }
    else
    {
 Info = Info2 ;
 for (i = 0 ; i < 90 ; i++)
 {
     Info [i] = (-1) ;
 }
    }
    Info [0] = (0) ;
    Numeric = (NumericType *) NumericHandle ;
    if (!umfdi_valid_numeric (Numeric))
    {
 Info [0] = (-3) ;
 return ((-3)) ;
    }
    if (Numeric->n_row != Numeric->n_col)
    {
 Info [0] = (-13) ;
 return ((-13)) ;
    }
    if (Mx == (double *) ((void *)0))
    {
 Info [0] = (-5) ;
 return ((-5)) ;
    }
    n = Numeric->n_row ;
    Wi = (int *) umf_i_malloc (n, sizeof (int)) ;
    if (!Wi)
    {
 ;
 Info [0] = (-1) ;
 return ((-1)) ;
    }
    Rs = Numeric->Rs ;
    do_scale = (Rs != (double *) ((void *)0)) ;
    do_recip = Numeric->do_recip ;
    d_mantissa = ((double *) one) [0] ;
    d_exponent = 0.0 ;
    D = Numeric->D ;
    for (i = 0 ; i < n ; i++)
    {
 { (d_tmp) = (d_mantissa) * (D [i]) ; } ;
 d_mantissa = d_tmp ;
 if (!rescale_determinant (&d_mantissa, &d_exponent))
 {
     Info [0] = (1) ;
     do_scale = (0) ;
     break ;
 }
    }
    if (do_scale)
    {
 for (i = 0 ; i < n ; i++)
 {
     if (do_recip)
     {
  { (d_mantissa) /= (Rs [i]) ; } ;
     }
     else
     {
  { (d_mantissa) *= (Rs [i]) ; } ;
     }
     if (!rescale_determinant (&d_mantissa, &d_exponent))
     {
  Info [0] = (1) ;
  break ;
     }
 }
    }
    npiv = 0 ;
    Rperm = Numeric->Rperm ;
    for (i = 0 ; i < n ; i++)
    {
 Wi [i] = Rperm [i] ;
    }
    for (i = 0 ; i < n ; i++)
    {
 while (Wi [i] != i)
 {
     itmp = Wi [Wi [i]] ;
     Wi [Wi [i]] = Wi [i] ;
     Wi [i] = itmp ;
     npiv++ ;
 }
    }
    Cperm = Numeric->Cperm ;
    for (i = 0 ; i < n ; i++)
    {
 Wi [i] = Cperm [i] ;
    }
    for (i = 0 ; i < n ; i++)
    {
 while (Wi [i] != i)
 {
     itmp = Wi [Wi [i]] ;
     Wi [Wi [i]] = Wi [i] ;
     Wi [i] = itmp ;
     npiv++ ;
 }
    }
    d_sign = (npiv % 2) ? -1. : 1. ;
    (void) umf_i_free ((void *) Wi) ;
    if (Ex == (double *) ((void *)0))
    {
 { (d_mantissa) *= (pow (10.0, d_exponent)) ; } ;
    }
    else
    {
 Ex [0] = d_exponent ;
    }
    Mx [0] = d_sign * (d_mantissa) ;
    if (d_exponent + 1.0 > log10 (((double)1.79769313486231570814527423731704357e+308L)))
    {
 Info [0] = (3) ;
    }
    else if (d_exponent - 1.0 < log10 (((double)2.22507385850720138309023271733240406e-308L)))
    {
 Info [0] = (2) ;
    }
    return ((0)) ;
}

canonical_original_code:
int umfpack_di_get_determinant(double *Mx, double *Ex, void *NumericHandle, double User_Info[90])
{
    double d_mantissa; double d_tmp;
    double d_exponent; double Info2[90]; double one[2] = {1.0, 0.0}; double d_sign;
    double *D;
    double *Info; double *Rs;
    struct NumericType *Numeric;
    int i; int n; int itmp; int npiv; int *Wi; int *Rperm; int *Cperm; int do_scale;
    int do_recip;
    if (User_Info != (double *) ((void *)0))
    {
 Info = User_Info ;
    }
    else
    {
 Info = Info2 ;
 for (i = 0 ; i < 90 ; i++)
 {
     Info [i] = (-1) ;
 }
    }
    Info [0] = (0) ;
    Numeric = (struct NumericType *) NumericHandle ;
    if (!umfdi_valid_numeric (Numeric))
    {
 Info [0] = (-3) ;
 return ((-3)) ;
    }
    if (Numeric->n_row != Numeric->n_col)
    {
 Info [0] = (-13) ;
 return ((-13)) ;
    }
    if (Mx == (double *) ((void *)0))
    {
 Info [0] = (-5) ;
 return ((-5)) ;
    }
    n = Numeric->n_row ;
    Wi = (int *) umf_i_malloc (n, sizeof (int)) ;
    if (!Wi)
    {
 ;
 Info [0] = (-1) ;
 return ((-1)) ;
    }
    Rs = Numeric->Rs ;
    do_scale = (Rs != (double *) ((void *)0)) ;
    do_recip = Numeric->do_recip ;
    d_mantissa = ((double *) one) [0] ;
    d_exponent = 0.0 ;
    D = Numeric->D ;
    for (i = 0 ; i < n ; i++)
    {
 { (d_tmp) = (d_mantissa) * (D [i]) ; } ;
 d_mantissa = d_tmp ;
 if (!rescale_determinant (&d_mantissa, &d_exponent))
 {
     Info [0] = (1) ;
     do_scale = (0) ;
     break ;
 }
    }
    if (do_scale)
    {
 for (i = 0 ; i < n ; i++)
 {
     if (do_recip)
     {
  { (d_mantissa) /= (Rs [i]) ; } ;
     }
     else
     {
  { (d_mantissa) *= (Rs [i]) ; } ;
     }
     if (!rescale_determinant (&d_mantissa, &d_exponent))
     {
  Info [0] = (1) ;
  break ;
     }
 }
    }
    npiv = 0 ;
    Rperm = Numeric->Rperm ;
    for (i = 0 ; i < n ; i++)
    {
 Wi [i] = Rperm [i] ;
    }
    for (i = 0 ; i < n ; i++)
    {
 while (Wi [i] != i)
 {
     itmp = Wi [Wi [i]] ;
     Wi [Wi [i]] = Wi [i] ;
     Wi [i] = itmp ;
     npiv++ ;
 }
    }
    Cperm = Numeric->Cperm ;
    for (i = 0 ; i < n ; i++)
    {
 Wi [i] = Cperm [i] ;
    }
    for (i = 0 ; i < n ; i++)
    {
 while (Wi [i] != i)
 {
     itmp = Wi [Wi [i]] ;
     Wi [Wi [i]] = Wi [i] ;
     Wi [i] = itmp ;
     npiv++ ;
 }
    }
    d_sign = (npiv % 2) ? -1. : 1. ;
    (void) umf_i_free ((void *) Wi) ;
    if (Ex == (double *) ((void *)0))
    {
 { (d_mantissa) *= (pow (10.0, d_exponent)) ; } ;
    }
    else
    {
 Ex [0] = d_exponent ;
    }
    Mx [0] = d_sign * (d_mantissa) ;
    if (d_exponent + 1.0 > log10 (((double)1.79769313486231570814527423731704357e+308L)))
    {
 Info [0] = (3) ;
    }
    else if (d_exponent - 1.0 < log10 (((double)2.22507385850720138309023271733240406e-308L)))
    {
 Info [0] = (2) ;
    }
    return ((0)) ;
}

variable_types:
Mx
double *

variable_types:
Ex
double *

variable_types:
NumericHandle
void *

variable_types:
one
double [2]

variable_types:
D
double *

variable_types:
Info
double *

variable_types:
Rs
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: itmp int

variable_types: npiv int

variable_types:
Wi
int *

variable_types:
Rperm
int *

variable_types:
Cperm
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:
static int rescale_determinant
(
    double *d_mantissa,
    double *d_exponent
)
{
    double d_abs ;
    { (d_abs) = ((((*d_mantissa) < 0.)) ? -(*d_mantissa) : (*d_mantissa)) ; } ;
    if (((d_abs) == 0.))
    {
 *d_exponent = 0 ;
 return ((0)) ;
    }
    if (((d_abs) != (d_abs)))
    {
 return ((0)) ;
    }
    while (d_abs < 1.)
    {
 { (*d_mantissa) *= (10.0) ; } ;
 *d_exponent = *d_exponent - 1.0 ;
 { (d_abs) = ((((*d_mantissa) < 0.)) ? -(*d_mantissa) : (*d_mantissa)) ; } ;
    }
    while (d_abs >= 10.)
    {
 { (*d_mantissa) *= (0.1) ; } ;
 *d_exponent = *d_exponent + 1.0 ;
 { (d_abs) = ((((*d_mantissa) < 0.)) ? -(*d_mantissa) : (*d_mantissa)) ; } ;
    }
    return ((1)) ;
}

canonical_original_code:
static int rescale_determinant(double *d_mantissa, double *d_exponent)
{
    double d_abs;
    { (d_abs) = ((((*d_mantissa) < 0.)) ? -(*d_mantissa) : (*d_mantissa)) ; } ;
    if (((d_abs) == 0.))
    {
 *d_exponent = 0 ;
 return ((0)) ;
    }
    if (((d_abs) != (d_abs)))
    {
 return ((0)) ;
    }
    while (d_abs < 1.)
    {
 { (*d_mantissa) *= (10.0) ; } ;
 *d_exponent = *d_exponent - 1.0 ;
 { (d_abs) = ((((*d_mantissa) < 0.)) ? -(*d_mantissa) : (*d_mantissa)) ; } ;
    }
    while (d_abs >= 10.)
    {
 { (*d_mantissa) *= (0.1) ; } ;
 *d_exponent = *d_exponent + 1.0 ;
 { (d_abs) = ((((*d_mantissa) < 0.)) ? -(*d_mantissa) : (*d_mantissa)) ; } ;
    }
    return ((1)) ;
}