original_code:
int umfzi_start_front
(
    int chain,
    NumericType *Numeric,
    WorkType *Work,
    SymbolicType *Symbolic
)
{
    double maxbytes ;
    int fnrows_max, fncols_max, fnr2, fnc2, fsize, fcurr_size, maxfrsize,
 overflow, nb, f, cdeg ;
    nb = Symbolic->nb ;
    fnrows_max = Symbolic->Chain_maxrows [chain] ;
    fncols_max = Symbolic->Chain_maxcols [chain] ;
    ;
    Work->fnrows_max = fnrows_max ;
    Work->fncols_max = fncols_max ;
    Work->any_skip = (0) ;
    maxbytes = sizeof (DoubleComplex) *
 (double) (fnrows_max + nb) * (double) (fncols_max + nb) ;
    fcurr_size = Work->fcurr_size ;
    if (Symbolic->prefer_diagonal)
    {
 int col, tpi, e, *E, *Col_tuples, *Col_tlen, *Cols ;
 Tuple *tp, *tpend ;
 Unit *Memory, *p ;
 Element *ep ;
 E = Work->E ;
 Memory = Numeric->Memory ;
 Col_tuples = Numeric->Lip ;
 Col_tlen = Numeric->Lilen ;
 col = Work->nextcand ;
 tpi = Col_tuples [col] ;
 tp = (Tuple *) Memory + tpi ;
 tpend = tp + Col_tlen [col] ;
 cdeg = 0 ;
 ;
 for ( ; tp < tpend ; tp++)
 {
     ;
     e = tp->e ;
     if (!E [e]) continue ;
     f = tp->f ;
     p = Memory + E [e] ;
     ep = (Element *) p ;
     p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Cols = (int *) p ;
     if (Cols [f] == (-1)) continue ;
     ;
     cdeg += ep->nrowsleft ;
 }
 if (Symbolic->amd_dmax > 0)
 {
     cdeg = (((cdeg) < (Symbolic->amd_dmax)) ? (cdeg) : (Symbolic->amd_dmax)) ;
 }
 cdeg += 2 ;
 cdeg = (((cdeg) < (fnrows_max)) ? (cdeg) : (fnrows_max)) ;
    }
    else
    {
 cdeg = 0 ;
    }
    ;
    ;
    ;
    ;
    overflow = ((!((maxbytes) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((maxbytes) != (maxbytes))) ;
    if (overflow)
    {
 maxfrsize = 0x7fffffff / sizeof (DoubleComplex) ;
    }
    else
    {
 maxfrsize = (fnrows_max + nb) * (fncols_max + nb) ;
    }
    ;
    if (Numeric->front_alloc_init < 0)
    {
 fsize = -Numeric->front_alloc_init ;
 fsize = (((1) > (fsize)) ? (1) : (fsize)) ;
    }
    else
    {
 if (((!((Numeric->front_alloc_init * maxbytes) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((Numeric->front_alloc_init * maxbytes) != (Numeric->front_alloc_init * maxbytes))))
 {
     fsize = 0x7fffffff / sizeof (DoubleComplex) ;
 }
 else
 {
     fsize = Numeric->front_alloc_init * maxfrsize ;
 }
 if (cdeg > 0)
 {
     int fsize2 ;
     cdeg += nb ;
     if (((!((((double) cdeg * (double) cdeg) * sizeof (DoubleComplex)) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((((double) cdeg * (double) cdeg) * sizeof (DoubleComplex)) != (((double) cdeg * (double) cdeg) * sizeof (DoubleComplex)))))
     {
  fsize2 = 0x7fffffff / sizeof (DoubleComplex) ;
     }
     else
     {
  fsize2 = (((cdeg * cdeg) > (fcurr_size)) ? (cdeg * cdeg) : (fcurr_size)) ;
     }
     fsize = (((fsize) < (fsize2)) ? (fsize) : (fsize2)) ;
 }
    }
    fsize = (((fsize) > (2*nb*nb)) ? (fsize) : (2*nb*nb)) ;
    ;
    Work->fnrows_new = 0 ;
    Work->fncols_new = 0 ;
    ;
    ;
    if (fsize >= maxfrsize && !overflow)
    {
 fnr2 = fnrows_max + nb ;
 fnc2 = fncols_max + nb ;
 fsize = maxfrsize ;
 ;
    }
    else
    {
 if (fnrows_max <= fncols_max)
 {
     fnr2 = (int) sqrt ((double) fsize) ;
     fnr2 = (((fnr2) > (1)) ? (fnr2) : (1)) ;
     if (fnr2 % 2 == 0) fnr2++ ;
     fnr2 = (((fnr2) < (fnrows_max + nb)) ? (fnr2) : (fnrows_max + nb)) ;
     fnc2 = fsize / fnr2 ;
 }
 else
 {
     fnc2 = (int) sqrt ((double) fsize) ;
     fnc2 = (((fnc2) < (fncols_max + nb)) ? (fnc2) : (fncols_max + nb)) ;
     fnr2 = fsize / fnc2 ;
     fnr2 = (((fnr2) > (1)) ? (fnr2) : (1)) ;
     if (fnr2 % 2 == 0)
     {
  fnr2++ ;
  fnc2 = fsize / fnr2 ;
     }
 }
 ;
    }
    fnr2 = (((fnr2) < (fnrows_max + nb)) ? (fnr2) : (fnrows_max + nb)) ;
    fnc2 = (((fnc2) < (fncols_max + nb)) ? (fnc2) : (fncols_max + nb)) ;
    ;
    ;
    fnr2 -= nb ;
    fnc2 -= nb ;
    ;
    ;
    if (fsize > fcurr_size)
    {
 ;
 Work->do_grow = (1) ;
 if (!umfzi_grow_front (Numeric, fnr2, fnc2, Work, -1))
 {
     ;
     return ((0)) ;
 }
    }
    else
    {
 ;
 Work->fnr_curr = fnr2 ;
 Work->fnc_curr = fnc2 ;
 Work->Flblock = Work->Flublock + nb * nb ;
 Work->Fublock = Work->Flblock + nb * fnr2 ;
 Work->Fcblock = Work->Fublock + nb * fnc2 ;
    }
    ;
    ;
    ;
    return ((1)) ;
}

canonical_original_code:
int umfzi_start_front(int chain, struct NumericType *Numeric, struct WorkType *Work, struct SymbolicType *Symbolic)
{
    double maxbytes;
    int fnrows_max; int fncols_max; int fnr2; int fnc2; int fsize; int fcurr_size; int maxfrsize; int overflow; int nb; int f; int cdeg;
    nb = Symbolic->nb ;
    fnrows_max = Symbolic->Chain_maxrows [chain] ;
    fncols_max = Symbolic->Chain_maxcols [chain] ;
    ;
    Work->fnrows_max = fnrows_max ;
    Work->fncols_max = fncols_max ;
    Work->any_skip = (0) ;
    maxbytes = sizeof (DoubleComplex) *
 (double) (fnrows_max + nb) * (double) (fncols_max + nb) ;
    fcurr_size = Work->fcurr_size ;
    if (Symbolic->prefer_diagonal)
    {
 int col; int tpi; int e; int *E; int *Col_tuples; int *Col_tlen; int *Cols;
 struct Tuple *tp; struct Tuple *tpend;
 union Unit_union *Memory; union Unit_union *p;
 struct Element *ep;
 E = Work->E ;
 Memory = Numeric->Memory ;
 Col_tuples = Numeric->Lip ;
 Col_tlen = Numeric->Lilen ;
 col = Work->nextcand ;
 tpi = Col_tuples [col] ;
 tp = (struct Tuple *) Memory + tpi ;
 tpend = tp + Col_tlen [col] ;
 cdeg = 0 ;
 ;
 for ( ; tp < tpend ; tp++)
 {
     ;
     e = tp->e ;
     if (!E [e]) continue ;
     f = tp->f ;
     p = Memory + E [e] ;
     ep = (struct Element *) p ;
     p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Cols = (int *) p ;
     if (Cols [f] == (-1)) continue ;
     ;
     cdeg += ep->nrowsleft ;
 }
 if (Symbolic->amd_dmax > 0)
 {
     cdeg = (((cdeg) < (Symbolic->amd_dmax)) ? (cdeg) : (Symbolic->amd_dmax)) ;
 }
 cdeg += 2 ;
 cdeg = (((cdeg) < (fnrows_max)) ? (cdeg) : (fnrows_max)) ;
    }
    else
    {
 cdeg = 0 ;
    }
    ;
    ;
    ;
    ;
    overflow = ((!((maxbytes) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((maxbytes) != (maxbytes))) ;
    if (overflow)
    {
 maxfrsize = 0x7fffffff / sizeof (DoubleComplex) ;
    }
    else
    {
 maxfrsize = (fnrows_max + nb) * (fncols_max + nb) ;
    }
    ;
    if (Numeric->front_alloc_init < 0)
    {
 fsize = -Numeric->front_alloc_init ;
 fsize = (((1) > (fsize)) ? (1) : (fsize)) ;
    }
    else
    {
 if (((!((Numeric->front_alloc_init * maxbytes) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((Numeric->front_alloc_init * maxbytes) != (Numeric->front_alloc_init * maxbytes))))
 {
     fsize = 0x7fffffff / sizeof (DoubleComplex) ;
 }
 else
 {
     fsize = Numeric->front_alloc_init * maxfrsize ;
 }
 if (cdeg > 0)
 {
     int fsize2;
     cdeg += nb ;
     if (((!((((double) cdeg * (double) cdeg) * sizeof (DoubleComplex)) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((((double) cdeg * (double) cdeg) * sizeof (DoubleComplex)) != (((double) cdeg * (double) cdeg) * sizeof (DoubleComplex)))))
     {
  fsize2 = 0x7fffffff / sizeof (DoubleComplex) ;
     }
     else
     {
  fsize2 = (((cdeg * cdeg) > (fcurr_size)) ? (cdeg * cdeg) : (fcurr_size)) ;
     }
     fsize = (((fsize) < (fsize2)) ? (fsize) : (fsize2)) ;
 }
    }
    fsize = (((fsize) > (2*nb*nb)) ? (fsize) : (2*nb*nb)) ;
    ;
    Work->fnrows_new = 0 ;
    Work->fncols_new = 0 ;
    ;
    ;
    if (fsize >= maxfrsize && !overflow)
    {
 fnr2 = fnrows_max + nb ;
 fnc2 = fncols_max + nb ;
 fsize = maxfrsize ;
 ;
    }
    else
    {
 if (fnrows_max <= fncols_max)
 {
     fnr2 = (int) sqrt ((double) fsize) ;
     fnr2 = (((fnr2) > (1)) ? (fnr2) : (1)) ;
     if (fnr2 % 2 == 0) fnr2++ ;
     fnr2 = (((fnr2) < (fnrows_max + nb)) ? (fnr2) : (fnrows_max + nb)) ;
     fnc2 = fsize / fnr2 ;
 }
 else
 {
     fnc2 = (int) sqrt ((double) fsize) ;
     fnc2 = (((fnc2) < (fncols_max + nb)) ? (fnc2) : (fncols_max + nb)) ;
     fnr2 = fsize / fnc2 ;
     fnr2 = (((fnr2) > (1)) ? (fnr2) : (1)) ;
     if (fnr2 % 2 == 0)
     {
  fnr2++ ;
  fnc2 = fsize / fnr2 ;
     }
 }
 ;
    }
    fnr2 = (((fnr2) < (fnrows_max + nb)) ? (fnr2) : (fnrows_max + nb)) ;
    fnc2 = (((fnc2) < (fncols_max + nb)) ? (fnc2) : (fncols_max + nb)) ;
    ;
    ;
    fnr2 -= nb ;
    fnc2 -= nb ;
    ;
    ;
    if (fsize > fcurr_size)
    {
 ;
 Work->do_grow = (1) ;
 if (!umfzi_grow_front (Numeric, fnr2, fnc2, Work, -1))
 {
     ;
     return ((0)) ;
 }
    }
    else
    {
 ;
 Work->fnr_curr = fnr2 ;
 Work->fnc_curr = fnc2 ;
 Work->Flblock = Work->Flublock + nb * nb ;
 Work->Fublock = Work->Flblock + nb * fnr2 ;
 Work->Fcblock = Work->Fublock + nb * fnc2 ;
    }
    ;
    ;
    ;
    return ((1)) ;
}

variable_types: chain int

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

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

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

variable_types: maxbytes double

variable_types: fsize int

variable_types: maxfrsize int

variable_types: overflow int

variable_types: nb int

variable_types: f int

variable_types: cdeg int

variable_types: col int

variable_types: tpi int

variable_types: e int

variable_types:
E
int *

variable_types:
Cols
int *

variable_types:
tp
struct Tuple { int e; } *

variable_types:
tpend
struct Tuple { int e; } *

variable_types:
ep
struct Element { int cdeg; } *


original_code:
long umfdl_triplet_map_x
(
    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 [ ]
    , const double Tx [ ]
    , double Ax [ ]
    , double Rx [ ]
    , 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] ;
 Rx [p] = Tx [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) ;
  Rx [pj] += Rx [p] ;
     }
     else
     {
  W [j] = pdest ;
  Map2 [p] = pdest ;
  if (pdest != p)
  {
      Rj [pdest] = j ;
      Rx [pdest] = Rx [p] ;
  }
  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 ;
     Ax [cp] = Rx [p] ;
 }
    }
    for (k = 0 ; k < nz ; k++)
    {
 Map [k] = Map2 [Map [k]] ;
    }
    return ((0)) ;
}

canonical_original_code:
long umfdl_triplet_map_x(long n_row, long n_col, long nz, long Ti[], long Tj[], long Ap[], long Ai[], long Rp[], long Rj[], long W[], long RowCount[], double Tx[], double Ax[], double Rx[], 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] ;
 Rx [p] = Tx [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) ;
  Rx [pj] += Rx [p] ;
     }
     else
     {
  W [j] = pdest ;
  Map2 [p] = pdest ;
  if (pdest != p)
  {
      Rj [pdest] = j ;
      Rx [pdest] = Rx [p] ;
  }
  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 ;
     Ax [cp] = Rx [p] ;
 }
    }
    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:
Tx
double []

variable_types:
Ax
double []

variable_types:
Rx
double []

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:
__int64 __fastcall umfpack_di_report_symbolic(__int64 a1, double *a2)
{
int v2; // er15
int v3; // er12
__int64 v4; // r13
unsigned int v5; // ebp
unsigned int v6; // er14
__int64 (*v7)(const char *, ...); // rdx
int v8; // eax
__int64 v9; // rdx
__int64 v10; // rdi
__int64 v11; // rbp
int v12; // er12
int v13; // er13
unsigned int v14; // er12
unsigned int v16; // ebp
__int64 v17; // r14
unsigned int v18; // er12
__int64 v19; // rsi
__int64 v20; // rdx
__int64 v21; // rdi
__int64 v22; // rax
int v23; // er12
int v24; // er13
int v25; // eax
__int64 v26; // [rsp+0h] [rbp-98h]
__int64 v27; // [rsp+8h] [rbp-90h]
unsigned int v28; // [rsp+10h] [rbp-88h]
int v29; // [rsp+10h] [rbp-88h]
unsigned int v30; // [rsp+14h] [rbp-84h]
__int64 v31; // [rsp+18h] [rbp-80h]
__int64 v32; // [rsp+20h] [rbp-78h]
__int64 v34; // [rsp+30h] [rbp-68h]
unsigned int *v35; // [rsp+38h] [rbp-60h]
__int64 v36; // [rsp+40h] [rbp-58h]
__int64 v37; // [rsp+48h] [rbp-50h]
__int64 v38; // [rsp+50h] [rbp-48h]
unsigned int v39; // [rsp+58h] [rbp-40h]
unsigned int v40; // [rsp+5Ch] [rbp-3Ch]

if ( !a2 )
return 0;
v2 = (int)*a2;
if ( v2 <= 2 )
return 0;
if ( amd_printf )
amd_printf("Symbolic object: ");
if ( !(unsigned int)umfdi_valid_symbolic(a1) )
{
if ( amd_printf )
amd_printf("ERROR: invalid\n");
return (unsigned int)-4;
}
v3 = *(_DWORD *)(a1 + 64);
v4 = *(_QWORD *)(a1 + 112);
v30 = *(_DWORD *)(a1 + 204);
v34 = *(_QWORD *)(a1 + 72);
v39 = *(_DWORD *)(a1 + 208);
v37 = *(_QWORD *)(a1 + 80);
v38 = *(_QWORD *)(a1 + 88);
v26 = *(_QWORD *)(a1 + 104);
v40 = *(_DWORD *)(a1 + 212);
v27 = *(_QWORD *)(a1 + 120);
v31 = *(_QWORD *)(a1 + 128);
if ( v2 == 3 )
goto LABEL_62;
v5 = *(_DWORD *)(a1 + 96);
v28 = *(_DWORD *)(a1 + 100);
if ( !amd_printf
|| (v6 = *(_DWORD *)(a1 + 216), amd_printf("\n matrix to be factorized:\n"), !amd_printf)
|| (amd_printf("\tn_row: %d n_col: %d\n", v39, v40), !amd_printf)
|| (amd_printf("\tnumber of entries: %d\n", v6), !amd_printf) )
{
if ( *(_DWORD *)(a1 + 236) != 3 )
goto LABEL_38;
v25 = *(_DWORD *)(a1 + 240);
if ( v25 == 1 )
goto LABEL_62;
v7 = 0LL;
if ( v25 == 2 )
goto LABEL_62;
goto LABEL_102;
}
amd_printf(" block size used for dense matrix kernels: %d\n", *(unsigned int *)(a1 + 220));
if ( !amd_printf )
{
if ( *(_DWORD *)(a1 + 236) != 3 )
goto LABEL_38;
LABEL_122:
v25 = *(_DWORD *)(a1 + 240);
if ( v25 == 1 )
goto LABEL_62;
if ( v25 == 2 )
goto LABEL_62;
v7 = 0LL;
if ( v25 == 6 )
goto LABEL_62;
LABEL_103:
if ( v25 == 3 )
{
if ( !v7 )
goto LABEL_62;
v7("metis on A");
v7 = amd_printf;
}
goto LABEL_42;
}
amd_printf(" strategy used: ");
if ( *(_DWORD *)(a1 + 236) != 3 )
{
if ( amd_printf )
{
amd_printf("unsymmetric\n");
if ( amd_printf )
{
amd_printf(" ordering used: ");
v7 = amd_printf;
v8 = *(_DWORD *)(a1 + 240);
if ( v8 == 1 )
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("colamd on A\n");
v7 = amd_printf;
goto LABEL_42;
}
if ( v8 != 2 )
{
if ( v8 == 6 )
{
LABEL_18:
if ( !v7 )
goto LABEL_62;
v7("user function");
v7 = amd_printf;
goto LABEL_42;
}
LABEL_41:
if ( v8 == 3 )
{
if ( !v7 )
goto LABEL_62;
v7("metis on A'A");
v7 = amd_printf;
}
goto LABEL_42;
}
goto LABEL_106;
}
}
LABEL_38:
v8 = *(_DWORD *)(a1 + 240);
if ( v8 == 1 )
goto LABEL_62;
if ( v8 == 2 )
goto LABEL_62;
v7 = 0LL;
if ( v8 == 6 )
goto LABEL_62;
goto LABEL_41;
}
if ( !amd_printf )
goto LABEL_122;
amd_printf("symmetric\n");
if ( !amd_printf )
goto LABEL_122;
amd_printf(" ordering used: ");
v7 = amd_printf;
v25 = *(_DWORD *)(a1 + 240);
if ( v25 != 1 )
{
if ( v25 == 2 )
{
LABEL_106:
if ( !v7 )
goto LABEL_62;
v7("user permutation");
v7 = amd_printf;
goto LABEL_42;
}
LABEL_102:
if ( v25 == 6 )
goto LABEL_18;
goto LABEL_103;
}
if ( !amd_printf )
goto LABEL_62;
amd_printf("amd on A\n");
v7 = amd_printf;
LABEL_42:
if ( v7 )
{
v7("\n");
if ( amd_printf )
{
amd_printf(" performn column etree postorder: ");
if ( *(_DWORD *)(a1 + 244) )
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("no\n");
}
else
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("yes\n");
}
if ( !amd_printf )
goto LABEL_62;
amd_printf(" prefer diagonal pivoting (attempt P=Q): ");
if ( *(_DWORD *)(a1 + 248) )
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("yes\n");
}
else
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("no\n");
}
if ( amd_printf )
{
amd_printf(" variable-size part of Numeric object:\n");
if ( amd_printf )
{
amd_printf(
"\tminimum initial size (Units): %.20g (MBytes): %.1f\n",
*(double *)(a1 + 32),
8.0 * *(double *)(a1 + 32) * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(
"\testimated peak size (Units): %.20g (MBytes): %.1f\n",
*(double *)a1,
8.0 * *(double *)a1 * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(
"\testimated final size (Units): %.20g (MBytes): %.1f\n",
*(double *)(a1 + 8),
8.0 * *(double *)(a1 + 8) * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(
" symbolic factorization memory usage (Units): %.20g (MBytes): %.1f\n",
*(double *)(a1 + 16),
8.0 * *(double *)(a1 + 16) * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(" frontal matrices / supercolumns:\n");
if ( amd_printf )
{
amd_printf("\tnumber of frontal chains: %d\n", (unsigned int)v3);
if ( amd_printf )
{
amd_printf("\tnumber of frontal matrices: %d\n", v30);
if ( amd_printf )
{
amd_printf("\tlargest frontal matrix row dimension: %d\n", v5);
if ( amd_printf )
amd_printf("\tlargest frontal matrix column dimension: %d\n", v28);
}
}
}
}
}
}
}
}
}
}
}
LABEL_62:
if ( v3 > 0 )
{
v16 = 0;
v32 = 0LL;
v35 = (unsigned int *)(v26 + 4LL * (int)v30);
v36 = v3;
while ( 1 )
{
v17 = *(int *)(v34 + 4 * v32);
v29 = *(_DWORD *)(v34 + 4 * v32 + 4) - 1;
if ( v2 != 3 )
{
if ( amd_printf )
{
amd_printf(
"\n Frontal chain: %d. Frontal matrices %d to %d\n",
(unsigned int)v32,
(unsigned int)v17,
(unsigned int)(*(_DWORD *)(v34 + 4 * v32 + 4) - 1));
if ( amd_printf )
amd_printf(
"\tLargest frontal matrix in Frontal chain: %d-by-%d\n",
*(unsigned int *)(v37 + 4 * v32),
*(unsigned int *)(v38 + 4 * v32));
}
}
if ( (int)v17 <= v29 )
break;
LABEL_85:
v20 = *v35;
if ( (_DWORD)v20 && v2 != 3 && amd_printf )
amd_printf("\tFront: %d placeholder for %d empty columns\n", v30, v20);
if ( v36 == ++v32 )
goto LABEL_90;
}
while ( 1 )
{
v18 = *(_DWORD *)(v26 + 4 * v17);
if ( v2 != 3 )
{
if ( amd_printf )
{
amd_printf(
"\tFront: %d pivot cols: %d (pivot columns %d to %d)\n",
(unsigned int)v17,
v18,
v16,
v16 + v18 - 1);
if ( amd_printf )
{
amd_printf(
"\t pivot row candidates: %d to %d\n",
*(unsigned int *)(v4 + 4LL * *(int *)(v27 + 4 * v17)),
(unsigned int)(*(_DWORD *)(v4 + 4 * v17 + 4) - 1));
if ( amd_printf )
{
amd_printf("\t leftmost descendant: %d\n", *(unsigned int *)(v27 + 4 * v17));
if ( amd_printf )
{
amd_printf("\t 1st new candidate row : %d\n", *(unsigned int *)(v4 + 4 * v17));
if ( amd_printf )
amd_printf("\t parent:");
}
}
}
}
v19 = *(unsigned int *)(v31 + 4 * v17);
if ( (_DWORD)v19 == -1 )
{
if ( amd_printf )
amd_printf(" (none)\n");
}
else if ( amd_printf )
{
amd_printf(" %d\n", v19);
}
if ( v2 == 4 && (int)v30 > 21 && (_DWORD)v17 == 20 )
break;
}
v16 += v18;
if ( v29 < (int)++v17 )
goto LABEL_85;
}
if ( amd_printf )
amd_printf("\t...\n");
v9 = *v35;
if ( !(_DWORD)v9 )
{
v10 = v40;
if ( (int)v39 >= (int)v40 )
v10 = v39;
v11 = umf_i_malloc(v10, 4LL);
if ( v11 )
goto LABEL_26;
goto LABEL_129;
}
if ( amd_printf )
amd_printf("\tFront: %d placeholder for %d empty columns\n", v30, v9);
}
LABEL_90:
v21 = v40;
if ( (int)v39 >= (int)v40 )
v21 = v39;
v22 = umf_i_malloc(v21, 4LL);
v11 = v22;
if ( v22 )
{
if ( v2 == 3 )
{
v23 = umf_i_report_perm(v40, *(_QWORD *)(a1 + 136), v22, 3LL, 0LL);
v24 = umf_i_report_perm(v39, *(_QWORD *)(a1 + 144), v11, 3LL, 0LL);
umf_i_free(v11);
if ( !(v23 | v24) )
{
LABEL_33:
if ( amd_printf )
amd_printf("OK\n\n");
return 0;
}
return (unsigned int)-4;
}
LABEL_26:
if ( amd_printf )
amd_printf("\nInitial column permutation, Q1: ");
v12 = umf_i_report_perm(v40, *(_QWORD *)(a1 + 136), v11, (unsigned int)v2, 0LL);
if ( amd_printf )
amd_printf("\nInitial row permutation, P1: ");
v13 = umf_i_report_perm(v39, *(_QWORD *)(a1 + 144), v11, (unsigned int)v2, 0LL);
umf_i_free(v11);
if ( !(v12 | v13) )
{
if ( amd_printf )
{
amd_printf(" Symbolic object: ");
goto LABEL_33;
}
return 0;
}
return (unsigned int)-4;
}
LABEL_129:
v14 = -1;
if ( amd_printf )
amd_printf("ERROR: out of memory to check Symbolic object\n\n");
return v14;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, double *a2)
{
int v2; // er15
int v3; // er12
__int64 v4; // r13
unsigned int v5; // ebp
unsigned int v6; // er14
__int64 (*v7)(const char *, ...); // rdx
int v8; // eax
__int64 v9; // rdx
__int64 v10; // rdi
__int64 v11; // rbp
int v12; // er12
int v13; // er13
unsigned int v14; // er12
unsigned int v16; // ebp
__int64 v17; // r14
unsigned int v18; // er12
__int64 v19; // rsi
__int64 v20; // rdx
__int64 v21; // rdi
__int64 v22; // rax
int v23; // er12
int v24; // er13
int v25; // eax
__int64 v26; // [rsp+0h] [rbp-98h]
__int64 v27; // [rsp+8h] [rbp-90h]
unsigned int v28; // [rsp+10h] [rbp-88h]
int v29; // [rsp+10h] [rbp-88h]
unsigned int v30; // [rsp+14h] [rbp-84h]
__int64 v31; // [rsp+18h] [rbp-80h]
__int64 v32; // [rsp+20h] [rbp-78h]
__int64 v34; // [rsp+30h] [rbp-68h]
unsigned int *v35; // [rsp+38h] [rbp-60h]
__int64 v36; // [rsp+40h] [rbp-58h]
__int64 v37; // [rsp+48h] [rbp-50h]
__int64 v38; // [rsp+50h] [rbp-48h]
unsigned int v39; // [rsp+58h] [rbp-40h]
unsigned int v40; // [rsp+5Ch] [rbp-3Ch]

if ( !a2 )
return 0;
v2 = (int)*a2;
if ( v2 <= 2 )
return 0;
if ( amd_printf )
amd_printf("Symbolic object: ");
if ( !(unsigned int)umfdi_valid_symbolic(a1) )
{
if ( amd_printf )
amd_printf("ERROR: invalid\n");
return (unsigned int)-4;
}
v3 = *(_DWORD *)(a1 + 64);
v4 = *(_QWORD *)(a1 + 112);
v30 = *(_DWORD *)(a1 + 204);
v34 = *(_QWORD *)(a1 + 72);
v39 = *(_DWORD *)(a1 + 208);
v37 = *(_QWORD *)(a1 + 80);
v38 = *(_QWORD *)(a1 + 88);
v26 = *(_QWORD *)(a1 + 104);
v40 = *(_DWORD *)(a1 + 212);
v27 = *(_QWORD *)(a1 + 120);
v31 = *(_QWORD *)(a1 + 128);
if ( v2 == 3 )
goto LABEL_62;
v5 = *(_DWORD *)(a1 + 96);
v28 = *(_DWORD *)(a1 + 100);
if ( !amd_printf
|| (v6 = *(_DWORD *)(a1 + 216), amd_printf("\n matrix to be factorized:\n"), !amd_printf)
|| (amd_printf("\tn_row: %d n_col: %d\n", v39, v40), !amd_printf)
|| (amd_printf("\tnumber of entries: %d\n", v6), !amd_printf) )
{
if ( *(_DWORD *)(a1 + 236) != 3 )
goto LABEL_38;
v25 = *(_DWORD *)(a1 + 240);
if ( v25 == 1 )
goto LABEL_62;
v7 = 0LL;
if ( v25 == 2 )
goto LABEL_62;
goto LABEL_102;
}
amd_printf(" block size used for dense matrix kernels: %d\n", *(unsigned int *)(a1 + 220));
if ( !amd_printf )
{
if ( *(_DWORD *)(a1 + 236) != 3 )
goto LABEL_38;
LABEL_122:
v25 = *(_DWORD *)(a1 + 240);
if ( v25 == 1 )
goto LABEL_62;
if ( v25 == 2 )
goto LABEL_62;
v7 = 0LL;
if ( v25 == 6 )
goto LABEL_62;
LABEL_103:
if ( v25 == 3 )
{
if ( !v7 )
goto LABEL_62;
v7("metis on A");
v7 = amd_printf;
}
goto LABEL_42;
}
amd_printf(" strategy used: ");
if ( *(_DWORD *)(a1 + 236) != 3 )
{
if ( amd_printf )
{
amd_printf("unsymmetric\n");
if ( amd_printf )
{
amd_printf(" ordering used: ");
v7 = amd_printf;
v8 = *(_DWORD *)(a1 + 240);
if ( v8 == 1 )
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("colamd on A\n");
v7 = amd_printf;
goto LABEL_42;
}
if ( v8 != 2 )
{
if ( v8 == 6 )
{
LABEL_18:
if ( !v7 )
goto LABEL_62;
v7("user function");
v7 = amd_printf;
goto LABEL_42;
}
LABEL_41:
if ( v8 == 3 )
{
if ( !v7 )
goto LABEL_62;
v7("metis on A'A");
v7 = amd_printf;
}
goto LABEL_42;
}
goto LABEL_106;
}
}
LABEL_38:
v8 = *(_DWORD *)(a1 + 240);
if ( v8 == 1 )
goto LABEL_62;
if ( v8 == 2 )
goto LABEL_62;
v7 = 0LL;
if ( v8 == 6 )
goto LABEL_62;
goto LABEL_41;
}
if ( !amd_printf )
goto LABEL_122;
amd_printf("symmetric\n");
if ( !amd_printf )
goto LABEL_122;
amd_printf(" ordering used: ");
v7 = amd_printf;
v25 = *(_DWORD *)(a1 + 240);
if ( v25 != 1 )
{
if ( v25 == 2 )
{
LABEL_106:
if ( !v7 )
goto LABEL_62;
v7("user permutation");
v7 = amd_printf;
goto LABEL_42;
}
LABEL_102:
if ( v25 == 6 )
goto LABEL_18;
goto LABEL_103;
}
if ( !amd_printf )
goto LABEL_62;
amd_printf("amd on A\n");
v7 = amd_printf;
LABEL_42:
if ( v7 )
{
v7("\n");
if ( amd_printf )
{
amd_printf(" performn column etree postorder: ");
if ( *(_DWORD *)(a1 + 244) )
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("no\n");
}
else
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("yes\n");
}
if ( !amd_printf )
goto LABEL_62;
amd_printf(" prefer diagonal pivoting (attempt P=Q): ");
if ( *(_DWORD *)(a1 + 248) )
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("yes\n");
}
else
{
if ( !amd_printf )
goto LABEL_62;
amd_printf("no\n");
}
if ( amd_printf )
{
amd_printf(" variable-size part of Numeric object:\n");
if ( amd_printf )
{
amd_printf(
"\tminimum initial size (Units): %.20g (MBytes): %.1f\n",
*(double *)(a1 + 32),
8.0 * *(double *)(a1 + 32) * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(
"\testimated peak size (Units): %.20g (MBytes): %.1f\n",
*(double *)a1,
8.0 * *(double *)a1 * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(
"\testimated final size (Units): %.20g (MBytes): %.1f\n",
*(double *)(a1 + 8),
8.0 * *(double *)(a1 + 8) * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(
" symbolic factorization memory usage (Units): %.20g (MBytes): %.1f\n",
*(double *)(a1 + 16),
8.0 * *(double *)(a1 + 16) * 0.00000095367431640625);
if ( amd_printf )
{
amd_printf(" frontal matrices / supercolumns:\n");
if ( amd_printf )
{
amd_printf("\tnumber of frontal chains: %d\n", (unsigned int)v3);
if ( amd_printf )
{
amd_printf("\tnumber of frontal matrices: %d\n", v30);
if ( amd_printf )
{
amd_printf("\tlargest frontal matrix row dimension: %d\n", v5);
if ( amd_printf )
amd_printf("\tlargest frontal matrix column dimension: %d\n", v28);
}
}
}
}
}
}
}
}
}
}
}
LABEL_62:
if ( v3 > 0 )
{
v16 = 0;
v32 = 0LL;
v35 = (unsigned int *)(v26 + 4LL * (int)v30);
v36 = v3;
while ( 1 )
{
v17 = *(int *)(v34 + 4 * v32);
v29 = *(_DWORD *)(v34 + 4 * v32 + 4) - 1;
if ( v2 != 3 )
{
if ( amd_printf )
{
amd_printf(
"\n Frontal chain: %d. Frontal matrices %d to %d\n",
(unsigned int)v32,
(unsigned int)v17,
(unsigned int)(*(_DWORD *)(v34 + 4 * v32 + 4) - 1));
if ( amd_printf )
amd_printf(
"\tLargest frontal matrix in Frontal chain: %d-by-%d\n",
*(unsigned int *)(v37 + 4 * v32),
*(unsigned int *)(v38 + 4 * v32));
}
}
if ( (int)v17 <= v29 )
break;
LABEL_85:
v20 = *v35;
if ( (_DWORD)v20 && v2 != 3 && amd_printf )
amd_printf("\tFront: %d placeholder for %d empty columns\n", v30, v20);
if ( v36 == ++v32 )
goto LABEL_90;
}
while ( 1 )
{
v18 = *(_DWORD *)(v26 + 4 * v17);
if ( v2 != 3 )
{
if ( amd_printf )
{
amd_printf(
"\tFront: %d pivot cols: %d (pivot columns %d to %d)\n",
(unsigned int)v17,
v18,
v16,
v16 + v18 - 1);
if ( amd_printf )
{
amd_printf(
"\t pivot row candidates: %d to %d\n",
*(unsigned int *)(v4 + 4LL * *(int *)(v27 + 4 * v17)),
(unsigned int)(*(_DWORD *)(v4 + 4 * v17 + 4) - 1));
if ( amd_printf )
{
amd_printf("\t leftmost descendant: %d\n", *(unsigned int *)(v27 + 4 * v17));
if ( amd_printf )
{
amd_printf("\t 1st new candidate row : %d\n", *(unsigned int *)(v4 + 4 * v17));
if ( amd_printf )
amd_printf("\t parent:");
}
}
}
}
v19 = *(unsigned int *)(v31 + 4 * v17);
if ( (_DWORD)v19 == -1 )
{
if ( amd_printf )
amd_printf(" (none)\n");
}
else if ( amd_printf )
{
amd_printf(" %d\n", v19);
}
if ( v2 == 4 && (int)v30 > 21 && (_DWORD)v17 == 20 )
break;
}
v16 += v18;
if ( v29 < (int)++v17 )
goto LABEL_85;
}
if ( amd_printf )
amd_printf("\t...\n");
v9 = *v35;
if ( !(_DWORD)v9 )
{
v10 = v40;
if ( (int)v39 >= (int)v40 )
v10 = v39;
v11 = umf_i_malloc(v10, 4LL);
if ( v11 )
goto LABEL_26;
goto LABEL_129;
}
if ( amd_printf )
amd_printf("\tFront: %d placeholder for %d empty columns\n", v30, v9);
}
LABEL_90:
v21 = v40;
if ( (int)v39 >= (int)v40 )
v21 = v39;
v22 = umf_i_malloc(v21, 4LL);
v11 = v22;
if ( v22 )
{
if ( v2 == 3 )
{
v23 = umf_i_report_perm(v40, *(_QWORD *)(a1 + 136), v22, 3LL, 0LL);
v24 = umf_i_report_perm(v39, *(_QWORD *)(a1 + 144), v11, 3LL, 0LL);
umf_i_free(v11);
if ( !(v23 | v24) )
{
LABEL_33:
if ( amd_printf )
amd_printf("OK\n\n");
return 0;
}
return (unsigned int)-4;
}
LABEL_26:
if ( amd_printf )
amd_printf("\nInitial column permutation, Q1: ");
v12 = umf_i_report_perm(v40, *(_QWORD *)(a1 + 136), v11, (unsigned int)v2, 0LL);
if ( amd_printf )
amd_printf("\nInitial row permutation, P1: ");
v13 = umf_i_report_perm(v39, *(_QWORD *)(a1 + 144), v11, (unsigned int)v2, 0LL);
umf_i_free(v11);
if ( !(v12 | v13) )
{
if ( amd_printf )
{
amd_printf(" Symbolic object: ");
goto LABEL_33;
}
return 0;
}
return (unsigned int)-4;
}
LABEL_129:
v14 = -1;
if ( amd_printf )
amd_printf("ERROR: out of memory to check Symbolic object\n\n");
return v14;
}

original_code:
int umfpack_di_report_symbolic
(
    void *SymbolicHandle,
    const double Control [20]
)
{
    int n_row, n_col, nz, nchains, nfr, maxnrows, maxncols, prl,
 k, chain, frontid, frontid1, frontid2, kk, *Chain_start, *W,
 *Chain_maxrows, *Chain_maxcols, *Front_npivcol, *Front_1strow,
 *Front_leftmostdesc, *Front_parent, done, status1, status2 ;
    SymbolicType *Symbolic ;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    { if (amd_printf != ((void *)0)) (void) amd_printf ("Symbolic object: ") ; } ;
    Symbolic = (SymbolicType *) SymbolicHandle ;
    if (!umfdi_valid_symbolic (Symbolic))
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid\n") ; } ;
 return ((-4)) ;
    }
    n_row = Symbolic->n_row ;
    n_col = Symbolic->n_col ;
    nz = Symbolic->nz ;
    nchains = Symbolic->nchains ;
    nfr = Symbolic->nfr ;
    maxnrows = Symbolic->maxnrows ;
    maxncols = Symbolic->maxncols ;
    Chain_start = Symbolic->Chain_start ;
    Chain_maxrows = Symbolic->Chain_maxrows ;
    Chain_maxcols = Symbolic->Chain_maxcols ;
    Front_npivcol = Symbolic->Front_npivcol ;
    Front_1strow = Symbolic->Front_1strow ;
    Front_leftmostdesc = Symbolic->Front_leftmostdesc ;
    Front_parent = Symbolic->Front_parent ;
    if (prl >= 4)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\n    matrix to be factorized:\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tn_row: ""%d"" n_col: ""%d""\n", n_row, n_col) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of entries: ""%d""\n", nz) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    block size used for dense matrix kernels:   ""%d""\n", Symbolic->nb) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    strategy used:                              ") ; } ;
 if (Symbolic->strategy == 3)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("symmetric\n") ; } ;
            { if (amd_printf != ((void *)0)) (void) amd_printf ("    ordering used:                              ") ; } ;
            if (Symbolic->ordering == 1)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("amd on A\n") ; } ;
            }
            else if (Symbolic->ordering == 2)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user permutation") ; } ;
            }
            else if (Symbolic->ordering == 6)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user function") ; } ;
            }
            else if (Symbolic->ordering == 3)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("metis on A") ; } ;
            }
 }
 else
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("unsymmetric\n") ; } ;
            { if (amd_printf != ((void *)0)) (void) amd_printf ("    ordering used:                              ") ; } ;
            if (Symbolic->ordering == 1)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("colamd on A\n") ; } ;
            }
            else if (Symbolic->ordering == 2)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user permutation") ; } ;
            }
            else if (Symbolic->ordering == 6)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user function") ; } ;
            }
            else if (Symbolic->ordering == 3)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("metis on A'A") ; } ;
            }
 }
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    performn column etree postorder:            ") ; } ;
 if (Symbolic->fixQ)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("no\n") ; } ;
 }
 else
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("yes\n") ; } ;
 }
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    prefer diagonal pivoting (attempt P=Q):     ") ; } ;
 if (Symbolic->prefer_diagonal)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("yes\n") ; } ;
 }
 else
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("no\n") ; } ;
 }
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    variable-size part of Numeric object:\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tminimum initial size (Units): %.20g  (MBytes): %.1f\n", Symbolic->dnum_mem_init_usage, (((Symbolic->dnum_mem_init_usage) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\testimated peak size (Units):  %.20g  (MBytes): %.1f\n", Symbolic->num_mem_usage_est, (((Symbolic->num_mem_usage_est) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\testimated final size (Units): %.20g  (MBytes): %.1f\n", Symbolic->num_mem_size_est, (((Symbolic->num_mem_size_est) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    symbolic factorization memory usage (Units):" " %.20g  (MBytes): %.1f\n", Symbolic->peak_sym_usage, (((Symbolic->peak_sym_usage) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    frontal matrices / supercolumns:\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of frontal chains: ""%d""\n", nchains) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of frontal matrices: ""%d""\n", nfr) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tlargest frontal matrix row dimension: ""%d""\n", maxnrows) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tlargest frontal matrix column dimension: ""%d""\n",maxncols) ; };
    }
    k = 0 ;
    done = (0) ;
    for (chain = 0 ; chain < nchains ; chain++)
    {
 frontid1 = Chain_start [chain] ;
 frontid2 = Chain_start [chain+1] - 1 ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n    Frontal chain: ""%d"".  Frontal matrices ""%d"" to ""%d""\n", (chain), (frontid1), (frontid2)) ; } ; } } ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tLargest frontal matrix in Frontal chain: ""%d""-by-""%d""\n", Chain_maxrows [chain], Chain_maxcols [chain]) ; } ; } } ;
 for (frontid = frontid1 ; frontid <= frontid2 ; frontid++)
 {
     kk = Front_npivcol [frontid] ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tFront: ""%d""  pivot cols: ""%d"" (pivot columns ""%d"" to " "%d"")\n", (frontid), kk, (k), (k+kk-1)) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    pivot row candidates: ""%d"" to ""%d""\n", (Front_1strow [Front_leftmostdesc [frontid]]), (Front_1strow [frontid+1]-1)) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    leftmost descendant: ""%d""\n", (Front_leftmostdesc [frontid])) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    1st new candidate row : ""%d""\n", (Front_1strow [frontid])) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    parent:") ; } ; } } ;
     if (Front_parent [frontid] == (-1))
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" (none)\n") ; } ; } } ;
     }
     else
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" ""%d""\n", (Front_parent [frontid])) ; } ; } } ;
     }
     done = (frontid == 20 && frontid < nfr-1 && prl == 4) ;
     if (done)
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t...\n") ; } ; } } ;
  break ;
     }
     k += kk ;
 }
 if (Front_npivcol [nfr] != 0)
 {
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tFront: ""%d"" placeholder for ""%d"" empty columns\n", (nfr), Front_npivcol [nfr]) ; } ; } } ;
 }
 if (done)
 {
     break ;
 }
    }
    W = (int *) umf_i_malloc ((((n_row) > (n_col)) ? (n_row) : (n_col)), sizeof (int)) ;
    if (!W)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: out of memory to check Symbolic object\n\n") ; } ;
 return ((-1)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\nInitial column permutation, Q1: ") ; } ; } } ;
    status1 = umf_i_report_perm (n_col, Symbolic->Cperm_init, W, prl, 0) ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\nInitial row permutation, P1: ") ; } ; } } ;
    status2 = umf_i_report_perm (n_row, Symbolic->Rperm_init, W, prl, 0) ;
    (void) umf_i_free ((void *) W) ;
    if (status1 != (0) || status2 != (0))
    {
 return ((-4)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    Symbolic object:  ") ; } ; } } ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    return ((0)) ;
}

canonical_original_code:
int umfpack_di_report_symbolic(void *SymbolicHandle, double Control[20])
{
    int n_row; int n_col; int nz; int nchains; int nfr; int maxnrows; int maxncols; int prl; int k; int chain; int frontid; int frontid1; int frontid2; int kk; int *Chain_start; int *W; int *Chain_maxrows; int *Chain_maxcols; int *Front_npivcol; int *Front_1strow; int *Front_leftmostdesc; int *Front_parent; int done; int status1; int status2;
    struct SymbolicType *Symbolic;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    { if (amd_printf != ((void *)0)) (void) amd_printf ("Symbolic object: ") ; } ;
    Symbolic = (struct SymbolicType *) SymbolicHandle ;
    if (!umfdi_valid_symbolic (Symbolic))
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid\n") ; } ;
 return ((-4)) ;
    }
    n_row = Symbolic->n_row ;
    n_col = Symbolic->n_col ;
    nz = Symbolic->nz ;
    nchains = Symbolic->nchains ;
    nfr = Symbolic->nfr ;
    maxnrows = Symbolic->maxnrows ;
    maxncols = Symbolic->maxncols ;
    Chain_start = Symbolic->Chain_start ;
    Chain_maxrows = Symbolic->Chain_maxrows ;
    Chain_maxcols = Symbolic->Chain_maxcols ;
    Front_npivcol = Symbolic->Front_npivcol ;
    Front_1strow = Symbolic->Front_1strow ;
    Front_leftmostdesc = Symbolic->Front_leftmostdesc ;
    Front_parent = Symbolic->Front_parent ;
    if (prl >= 4)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\n    matrix to be factorized:\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tn_row: ""%d"" n_col: ""%d""\n", n_row, n_col) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of entries: ""%d""\n", nz) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    block size used for dense matrix kernels:   ""%d""\n", Symbolic->nb) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    strategy used:                              ") ; } ;
 if (Symbolic->strategy == 3)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("symmetric\n") ; } ;
            { if (amd_printf != ((void *)0)) (void) amd_printf ("    ordering used:                              ") ; } ;
            if (Symbolic->ordering == 1)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("amd on A\n") ; } ;
            }
            else if (Symbolic->ordering == 2)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user permutation") ; } ;
            }
            else if (Symbolic->ordering == 6)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user function") ; } ;
            }
            else if (Symbolic->ordering == 3)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("metis on A") ; } ;
            }
 }
 else
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("unsymmetric\n") ; } ;
            { if (amd_printf != ((void *)0)) (void) amd_printf ("    ordering used:                              ") ; } ;
            if (Symbolic->ordering == 1)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("colamd on A\n") ; } ;
            }
            else if (Symbolic->ordering == 2)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user permutation") ; } ;
            }
            else if (Symbolic->ordering == 6)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("user function") ; } ;
            }
            else if (Symbolic->ordering == 3)
            {
                { if (amd_printf != ((void *)0)) (void) amd_printf ("metis on A'A") ; } ;
            }
 }
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    performn column etree postorder:            ") ; } ;
 if (Symbolic->fixQ)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("no\n") ; } ;
 }
 else
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("yes\n") ; } ;
 }
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    prefer diagonal pivoting (attempt P=Q):     ") ; } ;
 if (Symbolic->prefer_diagonal)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("yes\n") ; } ;
 }
 else
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("no\n") ; } ;
 }
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    variable-size part of Numeric object:\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tminimum initial size (Units): %.20g  (MBytes): %.1f\n", Symbolic->dnum_mem_init_usage, (((Symbolic->dnum_mem_init_usage) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\testimated peak size (Units):  %.20g  (MBytes): %.1f\n", Symbolic->num_mem_usage_est, (((Symbolic->num_mem_usage_est) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\testimated final size (Units): %.20g  (MBytes): %.1f\n", Symbolic->num_mem_size_est, (((Symbolic->num_mem_size_est) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    symbolic factorization memory usage (Units):" " %.20g  (MBytes): %.1f\n", Symbolic->peak_sym_usage, (((Symbolic->peak_sym_usage) * sizeof (Unit)) / 1048576.0)) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("    frontal matrices / supercolumns:\n") ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of frontal chains: ""%d""\n", nchains) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tnumber of frontal matrices: ""%d""\n", nfr) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tlargest frontal matrix row dimension: ""%d""\n", maxnrows) ; } ;
 { if (amd_printf != ((void *)0)) (void) amd_printf ("\tlargest frontal matrix column dimension: ""%d""\n",maxncols) ; };
    }
    k = 0 ;
    done = (0) ;
    for (chain = 0 ; chain < nchains ; chain++)
    {
 frontid1 = Chain_start [chain] ;
 frontid2 = Chain_start [chain+1] - 1 ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n    Frontal chain: ""%d"".  Frontal matrices ""%d"" to ""%d""\n", (chain), (frontid1), (frontid2)) ; } ; } } ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tLargest frontal matrix in Frontal chain: ""%d""-by-""%d""\n", Chain_maxrows [chain], Chain_maxcols [chain]) ; } ; } } ;
 for (frontid = frontid1 ; frontid <= frontid2 ; frontid++)
 {
     kk = Front_npivcol [frontid] ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tFront: ""%d""  pivot cols: ""%d"" (pivot columns ""%d"" to " "%d"")\n", (frontid), kk, (k), (k+kk-1)) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    pivot row candidates: ""%d"" to ""%d""\n", (Front_1strow [Front_leftmostdesc [frontid]]), (Front_1strow [frontid+1]-1)) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    leftmost descendant: ""%d""\n", (Front_leftmostdesc [frontid])) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    1st new candidate row : ""%d""\n", (Front_1strow [frontid])) ; } ; } } ;
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t    parent:") ; } ; } } ;
     if (Front_parent [frontid] == (-1))
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" (none)\n") ; } ; } } ;
     }
     else
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" ""%d""\n", (Front_parent [frontid])) ; } ; } } ;
     }
     done = (frontid == 20 && frontid < nfr-1 && prl == 4) ;
     if (done)
     {
  { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\t...\n") ; } ; } } ;
  break ;
     }
     k += kk ;
 }
 if (Front_npivcol [nfr] != 0)
 {
     { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\tFront: ""%d"" placeholder for ""%d"" empty columns\n", (nfr), Front_npivcol [nfr]) ; } ; } } ;
 }
 if (done)
 {
     break ;
 }
    }
    W = (int *) umf_i_malloc ((((n_row) > (n_col)) ? (n_row) : (n_col)), sizeof (int)) ;
    if (!W)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: out of memory to check Symbolic object\n\n") ; } ;
 return ((-1)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\nInitial column permutation, Q1: ") ; } ; } } ;
    status1 = umf_i_report_perm (n_col, Symbolic->Cperm_init, W, prl, 0) ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\nInitial row permutation, P1: ") ; } ; } } ;
    status2 = umf_i_report_perm (n_row, Symbolic->Rperm_init, W, prl, 0) ;
    (void) umf_i_free ((void *) W) ;
    if (status1 != (0) || status2 != (0))
    {
 return ((-4)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    Symbolic object:  ") ; } ; } } ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    return ((0)) ;
}

variable_types:
SymbolicHandle
void *

variable_types:
Control
double [20]

variable_types: nz int

variable_types: nchains int

variable_types: nfr int

variable_types: maxnrows int

variable_types: maxncols int

variable_types: prl int

variable_types: k int

variable_types: chain int

variable_types: frontid int

variable_types: kk int

variable_types:
W
int *

variable_types: done int

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

return_type: int


decompiled_code:
// attributes: thunk
__int64 umfpack_timer()
{
return SuiteSparse_time();
}

canonical_decompiled_code:
__int64 func0()
{
return SuiteSparse_time();
}

original_code:
double umfpack_timer ( void )
{
    return (SuiteSparse_time ( )) ;
}

canonical_original_code:
double umfpack_timer()
{
    return (SuiteSparse_time ( )) ;
}

return_type: double


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

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

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

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

variable_types: needunits long

variable_types: nsize double

variable_types: bsize double

variable_types: tsize double

variable_types: i long

variable_types: minsize long

variable_types: newsize long

variable_types: newmem long

variable_types: costly long

variable_types: row long

variable_types: col long

variable_types: nb long

variable_types: dr long

variable_types: dc long

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


original_code:
int cholmod_amd
(
    cholmod_sparse *A,
    int *fset,
    size_t fsize,
    int *Perm,
    cholmod_common *Common
)
{
    double Info [20], Control2 [5], *Control ;
    int *Cp, *Len, *Nv, *Head, *Elen, *Degree, *Wi, *Iwork, *Next ;
    cholmod_sparse *C ;
    int j, n, cnz ;
    size_t s ;
    int ok = 1 ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_amd.c", 71, "argument missing", Common) ; } return (0) ; } } ;
    n = A->nrow ;
    { if ((Perm) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_amd.c", 74, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (0) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_amd.c", 75, "invalid xtype", Common) ; } return (0) ; } } ;
    Common->status = 0 ;
    if (n == 0)
    {
 Common->fl = 0 ;
 Common->lnz = 0 ;
 Common->anz = 0 ;
 return (1) ;
    }
    s = cholmod_mult_size_t (n, 6, &ok) ;
    if (!ok)
    {
 cholmod_error ((-3), "../Cholesky/cholmod_amd.c", 99, "problem too large", Common) ;
 return (0) ;
    }
    s = (((s) > (A->ncol)) ? (s) : (A->ncol)) ;
    cholmod_allocate_work (n, s, 0, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    Iwork = Common->Iwork ;
    Degree = Iwork ;
    Wi = Iwork + n ;
    Len = Iwork + 2*((size_t) n) ;
    Nv = Iwork + 3*((size_t) n) ;
    Next = Iwork + 4*((size_t) n) ;
    Elen = Iwork + 5*((size_t) n) ;
    Head = Common->Head ;
    if (A->stype == 0)
    {
 C = cholmod_aat (A, fset, fsize, -2, Common) ;
    }
    else
    {
 C = cholmod_copy (A, 0, -2, Common) ;
    }
    if (Common->status < 0)
    {
 return (0) ;
    }
    Cp = C->p ;
    for (j = 0 ; j < n ; j++)
    {
 Len [j] = Cp [j+1] - Cp [j] ;
    }
    cnz = Cp [n] ;
    Common->anz = cnz / 2 + n ;
    if (Common->current < 0 || Common->current >= 9)
    {
 Control = ((void *)0) ;
    }
    else
    {
 Control = Control2 ;
 Control [0] = Common->method [Common->current].prune_dense ;
 Control [1] = Common->method [Common->current].aggressive ;
    }
    amd_malloc = Common->malloc_memory ;
    amd_free = Common->free_memory ;
    amd_calloc = Common->calloc_memory ;
    amd_realloc = Common->realloc_memory ;
    amd_printf = Common->print_function ;
    amd_2 (n, C->p, C->i, Len, C->nzmax, cnz, Nv, Next, Perm, Head, Elen,
     Degree, Wi, Control, Info) ;
    Common->fl = Info [10] + 2 * Info [11] + n ;
    Common->lnz = n + Info [9] ;
    ;
    cholmod_free_sparse (&C, Common) ;
    for (j = 0 ; j <= n ; j++)
    {
 Head [j] = (-1) ;
    }
    return (1) ;
}

canonical_original_code:
int cholmod_amd(struct cholmod_sparse_struct *A, int *fset, unsigned long fsize, int *Perm, struct cholmod_common_struct *Common)
{
    double Info[20]; double Control2[5]; double *Control;
    int *Cp; int *Len; int *Nv; int *Head; int *Elen; int *Degree; int *Wi; int *Iwork; int *Next;
    struct cholmod_sparse_struct *C;
    int j; int n; int cnz;
    unsigned long s;
    int ok = 1;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_amd.c", 71, "argument missing", Common) ; } return (0) ; } } ;
    n = A->nrow ;
    { if ((Perm) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_amd.c", 74, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (0) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_amd.c", 75, "invalid xtype", Common) ; } return (0) ; } } ;
    Common->status = 0 ;
    if (n == 0)
    {
 Common->fl = 0 ;
 Common->lnz = 0 ;
 Common->anz = 0 ;
 return (1) ;
    }
    s = cholmod_mult_size_t (n, 6, &ok) ;
    if (!ok)
    {
 cholmod_error ((-3), "../Cholesky/cholmod_amd.c", 99, "problem too large", Common) ;
 return (0) ;
    }
    s = (((s) > (A->ncol)) ? (s) : (A->ncol)) ;
    cholmod_allocate_work (n, s, 0, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    Iwork = Common->Iwork ;
    Degree = Iwork ;
    Wi = Iwork + n ;
    Len = Iwork + 2*((unsigned long) n) ;
    Nv = Iwork + 3*((unsigned long) n) ;
    Next = Iwork + 4*((unsigned long) n) ;
    Elen = Iwork + 5*((unsigned long) n) ;
    Head = Common->Head ;
    if (A->stype == 0)
    {
 C = cholmod_aat (A, fset, fsize, -2, Common) ;
    }
    else
    {
 C = cholmod_copy (A, 0, -2, Common) ;
    }
    if (Common->status < 0)
    {
 return (0) ;
    }
    Cp = C->p ;
    for (j = 0 ; j < n ; j++)
    {
 Len [j] = Cp [j+1] - Cp [j] ;
    }
    cnz = Cp [n] ;
    Common->anz = cnz / 2 + n ;
    if (Common->current < 0 || Common->current >= 9)
    {
 Control = ((void *)0) ;
    }
    else
    {
 Control = Control2 ;
 Control [0] = Common->method [Common->current].prune_dense ;
 Control [1] = Common->method [Common->current].aggressive ;
    }
    amd_malloc = Common->malloc_memory ;
    amd_free = Common->free_memory ;
    amd_calloc = Common->calloc_memory ;
    amd_realloc = Common->realloc_memory ;
    amd_printf = Common->print_function ;
    amd_2 (n, C->p, C->i, Len, C->nzmax, cnz, Nv, Next, Perm, Head, Elen,
     Degree, Wi, Control, Info) ;
    Common->fl = Info [10] + 2 * Info [11] + n ;
    Common->lnz = n + Info [9] ;
    ;
    cholmod_free_sparse (&C, Common) ;
    for (j = 0 ; j <= n ; j++)
    {
 Head [j] = (-1) ;
    }
    return (1) ;
}

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:
fset
int *

variable_types:
fsize
unsigned long

variable_types:
Perm
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:
Info
double [20]

variable_types:
Control
double *

variable_types:
Cp
int *

variable_types:
Len
int *

variable_types:
Nv
int *

variable_types:
Head
int *

variable_types:
Elen
int *

variable_types:
Degree
int *

variable_types:
Wi
int *

variable_types:
Iwork
int *

variable_types:
Next
int *

variable_types: j int

variable_types: n int

variable_types: cnz int

variable_types:
s
unsigned long

variable_types: ok int

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


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

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

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
P
long []

variable_types:
Q
long []

variable_types: nq long

variable_types:
Rp
long []

variable_types:
Ri
long []

variable_types:
Rx
double []

variable_types:
W
long []

variable_types: check long

variable_types: i long

variable_types: j long

variable_types: k long

variable_types: p long

variable_types: bp long

variable_types: newj long


decompiled_code:
__int64 __fastcall umfpack_zl_report_matrix(__int64 a1, __int64 a2, _QWORD *a3, __int64 a4, __int64 a5, __int64 a6, double a7, double a8, double a9, double a10, __int64 a11, double *a12)
{
__int64 result; // rax
__int64 v15; // r12
bool v16; // r13
__int64 v17; // r13
void (*v18)(const char *, ...); // r11
__int64 i; // rsi
__int64 v20; // rax
__int64 j; // rdx
__int64 v22; // rbx
__int64 v23; // r15
__int64 v24; // r12
__int64 v25; // r15
__int64 v26; // r13
__int64 v27; // r12
double v28; // xmm0_8
double v29; // xmm1_8
__int64 v30; // rax
__int64 v32; // [rsp+8h] [rbp-A0h]
unsigned __int64 v34; // [rsp+18h] [rbp-90h]
__int64 v35; // [rsp+28h] [rbp-80h]
const char *v36; // [rsp+30h] [rbp-78h]
const char *v37; // [rsp+38h] [rbp-70h]
__int64 v38; // [rsp+40h] [rbp-68h]
unsigned __int64 v39; // [rsp+50h] [rbp-58h]
__int64 v40; // [rsp+58h] [rbp-50h]
_QWORD *v41; // [rsp+60h] [rbp-48h]
__int64 v42; // [rsp+68h] [rbp-40h]

if ( !a12 )
return 0LL;
v34 = (unsigned int)(int)*a12;
result = 0LL;
if ( v34 <= 2 )
return result;
if ( a11 )
{
v32 = a1;
v15 = a2;
v37 = (const char *)&LC0;
v36 = "column";
}
else
{
v32 = a2;
v15 = a1;
v37 = "column";
v36 = (const char *)&LC0;
}
v16 = a1 <= 0 || a2 <= 0;
if ( !amd_printf )
{
if ( !v16 )
{
if ( !a3 )
return -5LL;
v17 = a3[v15];
goto LABEL_32;
}
return -6LL;
}
amd_printf("%s-form matrix, n_row %ld n_col %ld, ", v36, a1, a2);
if ( v16 )
{
if ( amd_printf )
{
amd_printf("ERROR: n_row <= 0 or n_col <= 0\n\n");
return -6LL;
}
return -6LL;
}
if ( !a3 )
{
if ( amd_printf )
amd_printf("ERROR: Ap missing\n\n");
return -5LL;
}
v17 = a3[v15];
if ( !amd_printf )
{
LABEL_32:
if ( v17 < 0 || *a3 )
return -8LL;
if ( a4 )
{
v18 = 0LL;
if ( v34 != 3 )
goto LABEL_36;
LABEL_25:
if ( v15 <= 0 )
goto LABEL_90;
goto LABEL_15;
}
return -5LL;
}
amd_printf("nz = %ld. ", a3[v15]);
if ( v17 < 0 )
{
if ( amd_printf )
amd_printf("ERROR: number of entries < 0\n\n");
return -8LL;
}
v18 = (void (*)(const char *, ...))amd_printf;
if ( *a3 )
{
if ( amd_printf )
{
amd_printf("ERROR: Ap [%ld] = %ld must be %ld\n\n", 0LL, *a3, 0LL);
return -8LL;
}
return -8LL;
}
if ( !a4 )
{
if ( amd_printf )
{
amd_printf("ERROR: Ai missing\n\n");
return -5LL;
}
return -5LL;
}
if ( v34 == 3 )
goto LABEL_25;
if ( !amd_printf )
{
LABEL_36:
if ( v15 <= 0 )
return 0LL;
v18 = 0LL;
goto LABEL_15;
}
amd_printf("\n");
v18 = (void (*)(const char *, ...))amd_printf;
if ( v15 <= 0 )
goto LABEL_88;
LABEL_15:
for ( i = 0LL; ; ++i )
{
v20 = a3[i];
if ( v20 < 0 )
{
if ( v18 )
{
v18("ERROR: Ap [%ld] < 0\n\n", i);
return -8LL;
}
return -8LL;
}
if ( v20 > v17 )
{
if ( v18 )
{
v18("ERROR: Ap [%ld] > size of Ai\n\n", i);
return -8LL;
}
return -8LL;
}
if ( v15 == i + 1 )
break;
}
for ( j = 0LL; ; ++j )
{
if ( (__int64)(a3[j + 1] - a3[j]) < 0 )
{
if ( v18 )
{
v18("ERROR: # entries in %s %ld is < 0\n\n", v36);
return -8LL;
}
return -8LL;
}
if ( j == i )
break;
}
v42 = i + 1;
v39 = 0LL;
v41 = a3;
v22 = v34;
while ( 2 )
{
v23 = v41[v39 + 1];
v24 = v41[v39];
if ( v39 <= 9 )
v22 = v34;
v40 = v23 - v24;
if ( v22 == 3 )
{
if ( v24 < v23 )
break;
LABEL_103:
v30 = v39 + 1;
if ( (__int64)(v39 + 1) < v42 )
goto LABEL_104;
LABEL_87:
if ( v34 == 3 )
{
LABEL_90:
if ( v18 )
{
v18("OK\n\n");
return 0LL;
}
}
else
{
LABEL_88:
if ( v18 )
{
v18(" %s-form matrix ", v36);
v18 = (void (*)(const char *, ...))amd_printf;
goto LABEL_90;
}
}
return 0LL;
}
if ( v18 )
{
v18("\n %s %ld: start: %ld end: %ld entries: %ld\n", v36, v39, v24, v23 - 1, v23 - v24);
v18 = (void (*)(const char *, ...))amd_printf;
}
if ( v24 >= v23 )
{
LABEL_84:
if ( v22 != 4 || v39 != 9 )
goto LABEL_103;
if ( v42 <= 10 )
goto LABEL_87;
if ( v18 )
{
v18("\n ...\n");
v18 = (void (*)(const char *, ...))amd_printf;
}
v22 = 3LL;
v30 = 10LL;
LABEL_104:
v39 = v30;
continue;
}
break;
}
v35 = v23;
v38 = ~v24;
v25 = -1LL;
v26 = v24 + 1;
while ( 2 )
{
v27 = v25;
v25 = *(_QWORD *)(a4 + 8 * v26 - 8);
if ( v22 != 3 )
{
if ( v18 )
{
v18("\t%s %ld ", v37, *(_QWORD *)(a4 + 8 * v26 - 8));
v18 = (void (*)(const char *, ...))amd_printf;
if ( a5 )
{
if ( amd_printf )
{
amd_printf(":");
v18 = (void (*)(const char *, ...))amd_printf;
}
LABEL_74:
if ( a6 )
{
v28 = *(double *)(a5 + 8 * v26 - 8);
v29 = *(double *)(a6 + 8 * v26 - 8);
}
else
{
v28 = *(double *)(a5 + 16 * v26 - 16);
v29 = *(double *)(a5 + 16 * v26 - 8);
}
if ( v28 == 0.0 )
{
if ( v18 )
{
v18(" (0");
v18 = (void (*)(const char *, ...))amd_printf;
if ( v29 < 0.0 )
goto LABEL_79;
LABEL_55:
if ( v29 == 0.0 )
{
if ( v18 )
{
v18(" + 0i)", v28, v29, 0.0, a10, 0.0, 0.0);
v18 = (void (*)(const char *, ...))amd_printf;
}
}
else if ( v18 )
{
v18(" + %gi)", v29);
v18 = (void (*)(const char *, ...))amd_printf;
}
}
}
else if ( v18 )
{
v18(" (%g");
v18 = (void (*)(const char *, ...))amd_printf;
if ( v29 >= 0.0 )
goto LABEL_55;
LABEL_79:
if ( v18 )
{
v18(" - %gi)", COERCE_DOUBLE(*(_QWORD *)&v29 ^ LC19));
v18 = (void (*)(const char *, ...))amd_printf;
}
}
}
}
else if ( a5 )
{
goto LABEL_74;
}
}
if ( v25 < 0 || v32 <= v25 )
{
if ( !v18 )
return -8LL;
v18(" ERROR: %s index %ld out of range in %s %ld\n\n", v37, v25, v36, v39);
return -8LL;
}
if ( v25 > v27 )
{
if ( v22 != 3 )
{
if ( v18 )
{
v18("\n");
v18 = (void (*)(const char *, ...))amd_printf;
}
if ( v22 == 4 && v26 + v38 == 9 && v40 > 10 )
{
v22 = 3LL;
if ( v18 )
{
v18("\t...\n");
v18 = (void (*)(const char *, ...))amd_printf;
}
}
}
if ( v35 == v26 )
goto LABEL_84;
++v26;
continue;
}
break;
}
if ( !v18 )
return -8LL;
v18(" ERROR: %s index %ld out of order (or duplicate) in %s %ld\n\n", v37, v25, v36, v39);
return -8LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, _QWORD *a3, __int64 a4, __int64 a5, __int64 a6, double a7, double a8, double a9, double a10, __int64 a11, double *a12)
{
__int64 result; // rax
__int64 v15; // r12
bool v16; // r13
__int64 v17; // r13
void (*v18)(const char *, ...); // r11
__int64 i; // rsi
__int64 v20; // rax
__int64 j; // rdx
__int64 v22; // rbx
__int64 v23; // r15
__int64 v24; // r12
__int64 v25; // r15
__int64 v26; // r13
__int64 v27; // r12
double v28; // xmm0_8
double v29; // xmm1_8
__int64 v30; // rax
__int64 v32; // [rsp+8h] [rbp-A0h]
unsigned __int64 v34; // [rsp+18h] [rbp-90h]
__int64 v35; // [rsp+28h] [rbp-80h]
const char *v36; // [rsp+30h] [rbp-78h]
const char *v37; // [rsp+38h] [rbp-70h]
__int64 v38; // [rsp+40h] [rbp-68h]
unsigned __int64 v39; // [rsp+50h] [rbp-58h]
__int64 v40; // [rsp+58h] [rbp-50h]
_QWORD *v41; // [rsp+60h] [rbp-48h]
__int64 v42; // [rsp+68h] [rbp-40h]

if ( !a12 )
return 0LL;
v34 = (unsigned int)(int)*a12;
result = 0LL;
if ( v34 <= 2 )
return result;
if ( a11 )
{
v32 = a1;
v15 = a2;
v37 = (const char *)&LC0;
v36 = "column";
}
else
{
v32 = a2;
v15 = a1;
v37 = "column";
v36 = (const char *)&LC0;
}
v16 = a1 <= 0 || a2 <= 0;
if ( !amd_printf )
{
if ( !v16 )
{
if ( !a3 )
return -5LL;
v17 = a3[v15];
goto LABEL_32;
}
return -6LL;
}
amd_printf("%s-form matrix, n_row %ld n_col %ld, ", v36, a1, a2);
if ( v16 )
{
if ( amd_printf )
{
amd_printf("ERROR: n_row <= 0 or n_col <= 0\n\n");
return -6LL;
}
return -6LL;
}
if ( !a3 )
{
if ( amd_printf )
amd_printf("ERROR: Ap missing\n\n");
return -5LL;
}
v17 = a3[v15];
if ( !amd_printf )
{
LABEL_32:
if ( v17 < 0 || *a3 )
return -8LL;
if ( a4 )
{
v18 = 0LL;
if ( v34 != 3 )
goto LABEL_36;
LABEL_25:
if ( v15 <= 0 )
goto LABEL_90;
goto LABEL_15;
}
return -5LL;
}
amd_printf("nz = %ld. ", a3[v15]);
if ( v17 < 0 )
{
if ( amd_printf )
amd_printf("ERROR: number of entries < 0\n\n");
return -8LL;
}
v18 = (void (*)(const char *, ...))amd_printf;
if ( *a3 )
{
if ( amd_printf )
{
amd_printf("ERROR: Ap [%ld] = %ld must be %ld\n\n", 0LL, *a3, 0LL);
return -8LL;
}
return -8LL;
}
if ( !a4 )
{
if ( amd_printf )
{
amd_printf("ERROR: Ai missing\n\n");
return -5LL;
}
return -5LL;
}
if ( v34 == 3 )
goto LABEL_25;
if ( !amd_printf )
{
LABEL_36:
if ( v15 <= 0 )
return 0LL;
v18 = 0LL;
goto LABEL_15;
}
amd_printf("\n");
v18 = (void (*)(const char *, ...))amd_printf;
if ( v15 <= 0 )
goto LABEL_88;
LABEL_15:
for ( i = 0LL; ; ++i )
{
v20 = a3[i];
if ( v20 < 0 )
{
if ( v18 )
{
v18("ERROR: Ap [%ld] < 0\n\n", i);
return -8LL;
}
return -8LL;
}
if ( v20 > v17 )
{
if ( v18 )
{
v18("ERROR: Ap [%ld] > size of Ai\n\n", i);
return -8LL;
}
return -8LL;
}
if ( v15 == i + 1 )
break;
}
for ( j = 0LL; ; ++j )
{
if ( (__int64)(a3[j + 1] - a3[j]) < 0 )
{
if ( v18 )
{
v18("ERROR: # entries in %s %ld is < 0\n\n", v36);
return -8LL;
}
return -8LL;
}
if ( j == i )
break;
}
v42 = i + 1;
v39 = 0LL;
v41 = a3;
v22 = v34;
while ( 2 )
{
v23 = v41[v39 + 1];
v24 = v41[v39];
if ( v39 <= 9 )
v22 = v34;
v40 = v23 - v24;
if ( v22 == 3 )
{
if ( v24 < v23 )
break;
LABEL_103:
v30 = v39 + 1;
if ( (__int64)(v39 + 1) < v42 )
goto LABEL_104;
LABEL_87:
if ( v34 == 3 )
{
LABEL_90:
if ( v18 )
{
v18("OK\n\n");
return 0LL;
}
}
else
{
LABEL_88:
if ( v18 )
{
v18(" %s-form matrix ", v36);
v18 = (void (*)(const char *, ...))amd_printf;
goto LABEL_90;
}
}
return 0LL;
}
if ( v18 )
{
v18("\n %s %ld: start: %ld end: %ld entries: %ld\n", v36, v39, v24, v23 - 1, v23 - v24);
v18 = (void (*)(const char *, ...))amd_printf;
}
if ( v24 >= v23 )
{
LABEL_84:
if ( v22 != 4 || v39 != 9 )
goto LABEL_103;
if ( v42 <= 10 )
goto LABEL_87;
if ( v18 )
{
v18("\n ...\n");
v18 = (void (*)(const char *, ...))amd_printf;
}
v22 = 3LL;
v30 = 10LL;
LABEL_104:
v39 = v30;
continue;
}
break;
}
v35 = v23;
v38 = ~v24;
v25 = -1LL;
v26 = v24 + 1;
while ( 2 )
{
v27 = v25;
v25 = *(_QWORD *)(a4 + 8 * v26 - 8);
if ( v22 != 3 )
{
if ( v18 )
{
v18("\t%s %ld ", v37, *(_QWORD *)(a4 + 8 * v26 - 8));
v18 = (void (*)(const char *, ...))amd_printf;
if ( a5 )
{
if ( amd_printf )
{
amd_printf(":");
v18 = (void (*)(const char *, ...))amd_printf;
}
LABEL_74:
if ( a6 )
{
v28 = *(double *)(a5 + 8 * v26 - 8);
v29 = *(double *)(a6 + 8 * v26 - 8);
}
else
{
v28 = *(double *)(a5 + 16 * v26 - 16);
v29 = *(double *)(a5 + 16 * v26 - 8);
}
if ( v28 == 0.0 )
{
if ( v18 )
{
v18(" (0");
v18 = (void (*)(const char *, ...))amd_printf;
if ( v29 < 0.0 )
goto LABEL_79;
LABEL_55:
if ( v29 == 0.0 )
{
if ( v18 )
{
v18(" + 0i)", v28, v29, 0.0, a10, 0.0, 0.0);
v18 = (void (*)(const char *, ...))amd_printf;
}
}
else if ( v18 )
{
v18(" + %gi)", v29);
v18 = (void (*)(const char *, ...))amd_printf;
}
}
}
else if ( v18 )
{
v18(" (%g");
v18 = (void (*)(const char *, ...))amd_printf;
if ( v29 >= 0.0 )
goto LABEL_55;
LABEL_79:
if ( v18 )
{
v18(" - %gi)", COERCE_DOUBLE(*(_QWORD *)&v29 ^ LC19));
v18 = (void (*)(const char *, ...))amd_printf;
}
}
}
}
else if ( a5 )
{
goto LABEL_74;
}
}
if ( v25 < 0 || v32 <= v25 )
{
if ( !v18 )
return -8LL;
v18(" ERROR: %s index %ld out of range in %s %ld\n\n", v37, v25, v36, v39);
return -8LL;
}
if ( v25 > v27 )
{
if ( v22 != 3 )
{
if ( v18 )
{
v18("\n");
v18 = (void (*)(const char *, ...))amd_printf;
}
if ( v22 == 4 && v26 + v38 == 9 && v40 > 10 )
{
v22 = 3LL;
if ( v18 )
{
v18("\t...\n");
v18 = (void (*)(const char *, ...))amd_printf;
}
}
}
if ( v35 == v26 )
goto LABEL_84;
++v26;
continue;
}
break;
}
if ( !v18 )
return -8LL;
v18(" ERROR: %s index %ld out of order (or duplicate) in %s %ld\n\n", v37, v25, v36, v39);
return -8LL;
}

original_code:
long umfpack_zl_report_matrix
(
    long n_row,
    long n_col,
    const long Ap [ ],
    const long Ai [ ],
    const double Ax [ ],
    const double Az [ ],
    long col_form,
    const double Control [20]
)
{
    DoubleComplex a ;
    long prl, i, k, length, ilast, p, nz, prl1, p1, p2, n, n_i, do_values ;
    char *vector_kind, *index_kind ;
    long split = ((Az) != (double *) ((void *)0)) ;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    if (col_form)
    {
 vector_kind = "column" ;
 index_kind = "row" ;
 n = n_col ;
 n_i = n_row ;
    }
    else
    {
 vector_kind = "row" ;
 index_kind = "column" ;
 n = n_row ;
 n_i = n_col ;
    }
    { if (amd_printf != ((void *)0)) (void) amd_printf ("%s-form matrix, n_row ""%" "ld"" n_col ""%" "ld"", ", 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 = ""%" "ld"". ", 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 [""%" "ld""] = ""%" "ld"" must be ""%" "ld""\n\n", (long) (0), (Ap [0]), (long) (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 [""%" "ld""] < 0\n\n", (k)) ; } ;
     return ((-8)) ;
 }
 if (Ap [k] > nz)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Ap [""%" "ld""] > 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 ""%" "ld"" 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 ""%" "ld"": start: ""%" "ld"" end: ""%" "ld"" entries: ""%" "ld""\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 ""%" "ld"" ", index_kind, (i)) ; } ; } } ;
     if (do_values && prl >= 4)
     {
  { if (amd_printf != ((void *)0)) (void) amd_printf (":") ; } ;
  { if (split) { (a).component [0] = (Ax)[p] ; (a).component [1] = (Az)[p] ; } else { (a) = ((DoubleComplex *)(Ax))[p] ; } } ;
  { if ((((a).component [0]) != 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" (%g", (a).component [0]) ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" (0") ; } ; } if ((((a).component [1]) < 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" - %gi)", -(a).component [1]) ; } ; } else if ((((a).component [1]) == 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" + 0i)") ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" + %gi)", (a).component [1]) ; } ; } } ;
     }
     if (i < 0 || i >= n_i)
     {
  { if (amd_printf != ((void *)0)) (void) amd_printf (" ERROR: %s index ""%" "ld"" out of range in %s ""%" "ld""\n\n", index_kind, (i), vector_kind, (k)) ; } ;
  return ((-8)) ;
     }
     if (i <= ilast)
     {
  { if (amd_printf != ((void *)0)) (void) amd_printf (" ERROR: %s index ""%" "ld"" out of order (or duplicate) in " "%s ""%" "ld""\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:
long umfpack_zl_report_matrix(long n_row, long n_col, long Ap[], long Ai[], double Ax[], double Az[], long col_form, double Control[20])
{
    struct DoubleComplex a;
    long prl; long i; long k; long length; long ilast; long p; long nz; long prl1; long p1; long p2; long n; long n_i; long do_values;
    char *vector_kind; char *index_kind;
    long split = ((Az) != (double *) ((void *)0));
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    if (col_form)
    {
 vector_kind = "column" ;
 index_kind = "row" ;
 n = n_col ;
 n_i = n_row ;
    }
    else
    {
 vector_kind = "row" ;
 index_kind = "column" ;
 n = n_row ;
 n_i = n_col ;
    }
    { if (amd_printf != ((void *)0)) (void) amd_printf ("%s-form matrix, n_row ""%" "ld"" n_col ""%" "ld"", ", 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 = ""%" "ld"". ", 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 [""%" "ld""] = ""%" "ld"" must be ""%" "ld""\n\n", (long) (0), (Ap [0]), (long) (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 [""%" "ld""] < 0\n\n", (k)) ; } ;
     return ((-8)) ;
 }
 if (Ap [k] > nz)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: Ap [""%" "ld""] > 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 ""%" "ld"" 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 ""%" "ld"": start: ""%" "ld"" end: ""%" "ld"" entries: ""%" "ld""\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 ""%" "ld"" ", index_kind, (i)) ; } ; } } ;
     if (do_values && prl >= 4)
     {
  { if (amd_printf != ((void *)0)) (void) amd_printf (":") ; } ;
  { if (split) { (a).component [0] = (Ax)[p] ; (a).component [1] = (Az)[p] ; } else { (a) = ((struct DoubleComplex *)(Ax))[p] ; } } ;
  { if ((((a).component [0]) != 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" (%g", (a).component [0]) ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" (0") ; } ; } if ((((a).component [1]) < 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" - %gi)", -(a).component [1]) ; } ; } else if ((((a).component [1]) == 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" + 0i)") ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" + %gi)", (a).component [1]) ; } ; } } ;
     }
     if (i < 0 || i >= n_i)
     {
  { if (amd_printf != ((void *)0)) (void) amd_printf (" ERROR: %s index ""%" "ld"" out of range in %s ""%" "ld""\n\n", index_kind, (i), vector_kind, (k)) ; } ;
  return ((-8)) ;
     }
     if (i <= ilast)
     {
  { if (amd_printf != ((void *)0)) (void) amd_printf (" ERROR: %s index ""%" "ld"" out of order (or duplicate) in " "%s ""%" "ld""\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
long []

variable_types:
Az
double []

variable_types:
Control
double [20]

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

variable_types: prl long

variable_types: length long

variable_types: ilast long

variable_types: nz long

variable_types: n long

variable_types: split long


original_code:
int umfdi_build_tuples
(
    NumericType *Numeric,
    WorkType *Work
)
{
    int e, nrows, ncols, nel, *Rows, *Cols, row, col, n_row, n_col, *E,
 *Row_tuples, *Row_degree, *Row_tlen,
 *Col_tuples, *Col_degree, *Col_tlen, n1 ;
    Element *ep ;
    Unit *p ;
    Tuple tuple, *tp ;
    E = Work->E ;
    Col_degree = Numeric->Cperm ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Row_tlen = Numeric->Uilen ;
    Col_tuples = Numeric->Lip ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    nel = Work->nel ;
    n1 = Work->n1 ;
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     Row_tuples [row] = umfdi_mem_alloc_tail_block (Numeric,
  (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     if (!Row_tuples [row])
     {
  ;
  return ((0)) ;
     }
     Row_tlen [row] = 0 ;
 }
    }
    for (col = n_col-1 ; col >= n1 ; col--)
    {
 if ((Col_degree [col] >= 0))
 {
     Col_tuples [col] = umfdi_mem_alloc_tail_block (Numeric,
  (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     if (!Col_tuples [col])
     {
  ;
  return ((0)) ;
     }
     Col_tlen [col] = 0 ;
 }
    }
    for (e = 1 ; e <= nel ; e++)
    {
 ;
 ;
 p = Numeric->Memory + E [e] ;
 { { ; ; ; ep = (Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (int *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
 nrows = ep->nrows ;
 ;
 ;
 ;
 tuple.e = e ;
 for (tuple.f = 0 ; tuple.f < ncols ; tuple.f++)
 {
     col = Cols [tuple.f] ;
     ;
     ;
     ;
     tp = ((Tuple *) (Numeric->Memory + Col_tuples [col]))
  + Col_tlen [col]++ ;
     *tp = tuple ;
 }
 for (tuple.f = 0 ; tuple.f < nrows ; tuple.f++)
 {
     row = Rows [tuple.f] ;
     ;
     ;
     ;
     tp = ((Tuple *) (Numeric->Memory + Row_tuples [row]))
  + Row_tlen [row]++ ;
     *tp = tuple ;
 }
    }
    ;
    return ((1)) ;
}

canonical_original_code:
int umfdi_build_tuples(struct NumericType *Numeric, struct WorkType *Work)
{
    int e; int nrows; int ncols; int nel; int *Rows; int *Cols; int row; int col; int n_row; int n_col; int *E; int *Row_tuples; int *Row_degree; int *Row_tlen; int *Col_tuples; int *Col_degree; int *Col_tlen; int n1;
    struct Element *ep;
    union Unit_union *p;
    struct Tuple tuple; struct Tuple *tp;
    E = Work->E ;
    Col_degree = Numeric->Cperm ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Row_tlen = Numeric->Uilen ;
    Col_tuples = Numeric->Lip ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    nel = Work->nel ;
    n1 = Work->n1 ;
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     Row_tuples [row] = umfdi_mem_alloc_tail_block (Numeric,
  (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     if (!Row_tuples [row])
     {
  ;
  return ((0)) ;
     }
     Row_tlen [row] = 0 ;
 }
    }
    for (col = n_col-1 ; col >= n1 ; col--)
    {
 if ((Col_degree [col] >= 0))
 {
     Col_tuples [col] = umfdi_mem_alloc_tail_block (Numeric,
  (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     if (!Col_tuples [col])
     {
  ;
  return ((0)) ;
     }
     Col_tlen [col] = 0 ;
 }
    }
    for (e = 1 ; e <= nel ; e++)
    {
 ;
 ;
 p = Numeric->Memory + E [e] ;
 { { ; ; ; ep = (struct Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (int *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
 nrows = ep->nrows ;
 ;
 ;
 ;
 tuple.e = e ;
 for (tuple.f = 0 ; tuple.f < ncols ; tuple.f++)
 {
     col = Cols [tuple.f] ;
     ;
     ;
     ;
     tp = ((struct Tuple *) (Numeric->Memory + Col_tuples [col]))
  + Col_tlen [col]++ ;
     *tp = tuple ;
 }
 for (tuple.f = 0 ; tuple.f < nrows ; tuple.f++)
 {
     row = Rows [tuple.f] ;
     ;
     ;
     ;
     tp = ((struct Tuple *) (Numeric->Memory + Row_tuples [row]))
  + Row_tlen [row]++ ;
     *tp = tuple ;
 }
    }
    ;
    return ((1)) ;
}

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

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

variable_types: e int

variable_types: nrows int

variable_types: ncols int

variable_types: nel int

variable_types:
Rows
int *

variable_types:
Cols
int *

variable_types: row int

variable_types: col int

variable_types:
E
int *

variable_types:
ep
struct Element { int cdeg; } *

variable_types:
tuple
struct Tuple { int e; }

variable_types:
tp
struct Tuple { int e; } *

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