decompiled_code:
__int64 __fastcall umfpack_zi_report_triplet(int a1, __int64 a2, int a3, __int64 a4, __int64 a5, __int64 a6, double a7, double a8, double a9, __int64 a10, double *a11)
{
__int64 v12; // rbx
double v15; // xmm0_8
__int64 result; // rax
__int64 v17; // rcx
__int64 v18; // rdx
int v19; // er15
__int64 v20; // rbx
__int64 v21; // r13
int v22; // ebp
int v23; // er12
double v24; // [rsp+8h] [rbp-60h]
int v25; // [rsp+14h] [rbp-54h]
__int64 v26; // [rsp+18h] [rbp-50h]
bool v28; // [rsp+2Bh] [rbp-3Dh]
int v29; // [rsp+2Ch] [rbp-3Ch]

v25 = a2;
v26 = a5;
if ( !a11 )
return 0LL;
v12 = a4;
v15 = *a11;
v29 = (int)*a11;
result = 0LL;
if ( v29 > 2 )
{
if ( amd_printf )
{
v17 = (unsigned int)a3;
v18 = (unsigned int)a2;
a2 = (unsigned int)a1;
amd_printf("triplet-form matrix, n_row = %d, n_col = %d nz = %d. ", (unsigned int)a1, v18, v17);
if ( !v12 || !a5 )
{
if ( amd_printf )
amd_printf("ERROR: indices not present\n\n");
return 4294967291LL;
}
if ( a1 <= 0 || v25 <= 0 )
{
if ( amd_printf )
amd_printf("ERROR: n_row or n_col is <= 0\n\n");
return 4294967290LL;
}
}
else
{
if ( !a4 || !a5 )
return 4294967291LL;
if ( a1 <= 0 || (int)a2 <= 0 )
return 4294967290LL;
}
if ( a3 < 0 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: nz is < 0\n\n");
result = 4294967288LL;
}
return result;
}
if ( v29 <= 3 )
{
v28 = a6 != 0;
if ( a3 <= 0 )
{
LABEL_60:
if ( amd_printf )
amd_printf("OK\n\n", a2, v15, a8, a9);
return 0LL;
}
}
else
{
if ( amd_printf )
amd_printf("\n");
v28 = a6 != 0;
if ( a3 <= 0 )
goto LABEL_58;
}
v19 = v29;
v20 = 0LL;
v21 = a4;
while ( 1 )
{
a2 = (unsigned int)v20;
v22 = *(_DWORD *)(v21 + 4 * v20);
v23 = *(_DWORD *)(v26 + 4 * v20);
if ( v19 <= 3 )
goto LABEL_33;
if ( amd_printf )
amd_printf(" %d : %d %d ", (unsigned int)v20, (unsigned int)v22, (unsigned int)v23);
if ( v28 )
{
if ( a10 )
{
v15 = *(double *)(a6 + 8 * v20);
v24 = *(double *)(a10 + 8 * v20);
}
else
{
v15 = *(double *)(a6 + 16 * v20);
v24 = *(double *)(a6 + 16 * v20 + 8);
}
if ( v15 == 0.0 )
{
if ( amd_printf )
{
amd_printf(" (0", (unsigned int)v20);
LABEL_25:
v15 = 0.0;
a8 = v24;
if ( v24 < 0.0 )
{
if ( amd_printf )
{
*(_QWORD *)&a8 = *(_QWORD *)&v24 ^ LC9;
*(_QWORD *)&v15 = *(_QWORD *)&v24 ^ LC9;
amd_printf(" - %gi)", COERCE_DOUBLE(*(_QWORD *)&v24 ^ LC9));
}
goto LABEL_31;
}
LABEL_26:
a9 = v24;
if ( v24 == 0.0 )
{
if ( amd_printf )
amd_printf(" + 0i)", v15, a8, v24);
}
else if ( amd_printf )
{
v15 = v24;
amd_printf(" + %gi)", v24);
}
goto LABEL_31;
}
}
else if ( amd_printf )
{
amd_printf(" (%g", v15);
goto LABEL_25;
}
if ( v24 >= 0.0 )
goto LABEL_26;
}
LABEL_31:
if ( amd_printf )
amd_printf("\n", v15, a8, a9);
LABEL_33:
if ( v22 < 0 || a1 <= v22 || v23 < 0 || v25 <= v23 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: invalid triplet\n\n", (unsigned int)v20, v15, a8, a9);
result = 4294967288LL;
}
return result;
}
if ( a3 > 10 && v19 == 4 && (_DWORD)v20 == 9 )
{
if ( amd_printf )
amd_printf(" ...\n", (unsigned int)v20, v15, a8, a9);
v19 = 3;
}
else if ( a3 <= (int)v20 + 1 )
{
if ( v29 <= 3 )
goto LABEL_60;
LABEL_58:
result = 0LL;
if ( amd_printf )
{
amd_printf(" triplet-form matrix ");
goto LABEL_60;
}
return result;
}
++v20;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, __int64 a2, int a3, __int64 a4, __int64 a5, __int64 a6, double a7, double a8, double a9, __int64 a10, double *a11)
{
__int64 v12; // rbx
double v15; // xmm0_8
__int64 result; // rax
__int64 v17; // rcx
__int64 v18; // rdx
int v19; // er15
__int64 v20; // rbx
__int64 v21; // r13
int v22; // ebp
int v23; // er12
double v24; // [rsp+8h] [rbp-60h]
int v25; // [rsp+14h] [rbp-54h]
__int64 v26; // [rsp+18h] [rbp-50h]
bool v28; // [rsp+2Bh] [rbp-3Dh]
int v29; // [rsp+2Ch] [rbp-3Ch]

v25 = a2;
v26 = a5;
if ( !a11 )
return 0LL;
v12 = a4;
v15 = *a11;
v29 = (int)*a11;
result = 0LL;
if ( v29 > 2 )
{
if ( amd_printf )
{
v17 = (unsigned int)a3;
v18 = (unsigned int)a2;
a2 = (unsigned int)a1;
amd_printf("triplet-form matrix, n_row = %d, n_col = %d nz = %d. ", (unsigned int)a1, v18, v17);
if ( !v12 || !a5 )
{
if ( amd_printf )
amd_printf("ERROR: indices not present\n\n");
return 4294967291LL;
}
if ( a1 <= 0 || v25 <= 0 )
{
if ( amd_printf )
amd_printf("ERROR: n_row or n_col is <= 0\n\n");
return 4294967290LL;
}
}
else
{
if ( !a4 || !a5 )
return 4294967291LL;
if ( a1 <= 0 || (int)a2 <= 0 )
return 4294967290LL;
}
if ( a3 < 0 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: nz is < 0\n\n");
result = 4294967288LL;
}
return result;
}
if ( v29 <= 3 )
{
v28 = a6 != 0;
if ( a3 <= 0 )
{
LABEL_60:
if ( amd_printf )
amd_printf("OK\n\n", a2, v15, a8, a9);
return 0LL;
}
}
else
{
if ( amd_printf )
amd_printf("\n");
v28 = a6 != 0;
if ( a3 <= 0 )
goto LABEL_58;
}
v19 = v29;
v20 = 0LL;
v21 = a4;
while ( 1 )
{
a2 = (unsigned int)v20;
v22 = *(_DWORD *)(v21 + 4 * v20);
v23 = *(_DWORD *)(v26 + 4 * v20);
if ( v19 <= 3 )
goto LABEL_33;
if ( amd_printf )
amd_printf(" %d : %d %d ", (unsigned int)v20, (unsigned int)v22, (unsigned int)v23);
if ( v28 )
{
if ( a10 )
{
v15 = *(double *)(a6 + 8 * v20);
v24 = *(double *)(a10 + 8 * v20);
}
else
{
v15 = *(double *)(a6 + 16 * v20);
v24 = *(double *)(a6 + 16 * v20 + 8);
}
if ( v15 == 0.0 )
{
if ( amd_printf )
{
amd_printf(" (0", (unsigned int)v20);
LABEL_25:
v15 = 0.0;
a8 = v24;
if ( v24 < 0.0 )
{
if ( amd_printf )
{
*(_QWORD *)&a8 = *(_QWORD *)&v24 ^ LC9;
*(_QWORD *)&v15 = *(_QWORD *)&v24 ^ LC9;
amd_printf(" - %gi)", COERCE_DOUBLE(*(_QWORD *)&v24 ^ LC9));
}
goto LABEL_31;
}
LABEL_26:
a9 = v24;
if ( v24 == 0.0 )
{
if ( amd_printf )
amd_printf(" + 0i)", v15, a8, v24);
}
else if ( amd_printf )
{
v15 = v24;
amd_printf(" + %gi)", v24);
}
goto LABEL_31;
}
}
else if ( amd_printf )
{
amd_printf(" (%g", v15);
goto LABEL_25;
}
if ( v24 >= 0.0 )
goto LABEL_26;
}
LABEL_31:
if ( amd_printf )
amd_printf("\n", v15, a8, a9);
LABEL_33:
if ( v22 < 0 || a1 <= v22 || v23 < 0 || v25 <= v23 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: invalid triplet\n\n", (unsigned int)v20, v15, a8, a9);
result = 4294967288LL;
}
return result;
}
if ( a3 > 10 && v19 == 4 && (_DWORD)v20 == 9 )
{
if ( amd_printf )
amd_printf(" ...\n", (unsigned int)v20, v15, a8, a9);
v19 = 3;
}
else if ( a3 <= (int)v20 + 1 )
{
if ( v29 <= 3 )
goto LABEL_60;
LABEL_58:
result = 0LL;
if ( amd_printf )
{
amd_printf(" triplet-form matrix ");
goto LABEL_60;
}
return result;
}
++v20;
}
}
return result;
}

original_code:
int umfpack_zi_report_triplet
(
    int n_row,
    int n_col,
    int nz,
    const int Ti [ ],
    const int Tj [ ],
    const double Tx [ ],
    const double Tz [ ],
    const double Control [20]
)
{
    DoubleComplex t ;
    int prl, prl1, k, i, j, do_values ;
    int split = ((Tz) != (double *) ((void *)0)) ;
    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 ("triplet-form matrix, n_row = ""%d"", n_col = ""%d"" nz = ""%d"". ", n_row, n_col, nz) ; } ;
    if (!Ti || !Tj)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: indices not present\n\n") ; } ;
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: n_row or n_col is <= 0\n\n") ; } ;
 return ((-6)) ;
    }
    if (nz < 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: nz is < 0\n\n") ; } ;
 return ((-8)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    do_values = Tx != (double *) ((void *)0) ;
    prl1 = prl ;
    for (k = 0 ; k < nz ; k++)
    {
 i = Ti [k] ;
 j = Tj [k] ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    ""%d"" : ""%d"" ""%d"" ", (k), (i), (j)) ; } ; } } ;
 if (do_values && prl >= 4)
 {
     { if (split) { (t).component [0] = (Tx)[k] ; (t).component [1] = (Tz)[k] ; } else { (t) = ((DoubleComplex *)(Tx))[k] ; } } ;
     { if ((((t).component [0]) != 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" (%g", (t).component [0]) ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" (0") ; } ; } if ((((t).component [1]) < 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" - %gi)", -(t).component [1]) ; } ; } else if ((((t).component [1]) == 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" + 0i)") ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" + %gi)", (t).component [1]) ; } ; } } ;
 }
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
 if (i < 0 || i >= n_row || j < 0 || j >= n_col)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid triplet\n\n") ; } ;
     return ((-8)) ;
 }
 if (prl == 4 && k == 9 && nz > 10)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("    ...\n") ; } ;
     prl-- ;
 }
    }
    prl = prl1 ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    triplet-form matrix ") ; } ; } } ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    return ((0)) ;
}

canonical_original_code:
int umfpack_zi_report_triplet(int n_row, int n_col, int nz, int Ti[], int Tj[], double Tx[], double Tz[], double Control[20])
{
    struct DoubleComplex t;
    int prl; int prl1; int k; int i; int j; int do_values;
    int split = ((Tz) != (double *) ((void *)0));
    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 ("triplet-form matrix, n_row = ""%d"", n_col = ""%d"" nz = ""%d"". ", n_row, n_col, nz) ; } ;
    if (!Ti || !Tj)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: indices not present\n\n") ; } ;
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: n_row or n_col is <= 0\n\n") ; } ;
 return ((-6)) ;
    }
    if (nz < 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: nz is < 0\n\n") ; } ;
 return ((-8)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    do_values = Tx != (double *) ((void *)0) ;
    prl1 = prl ;
    for (k = 0 ; k < nz ; k++)
    {
 i = Ti [k] ;
 j = Tj [k] ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    ""%d"" : ""%d"" ""%d"" ", (k), (i), (j)) ; } ; } } ;
 if (do_values && prl >= 4)
 {
     { if (split) { (t).component [0] = (Tx)[k] ; (t).component [1] = (Tz)[k] ; } else { (t) = ((struct DoubleComplex *)(Tx))[k] ; } } ;
     { if ((((t).component [0]) != 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" (%g", (t).component [0]) ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" (0") ; } ; } if ((((t).component [1]) < 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" - %gi)", -(t).component [1]) ; } ; } else if ((((t).component [1]) == 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" + 0i)") ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" + %gi)", (t).component [1]) ; } ; } } ;
 }
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
 if (i < 0 || i >= n_row || j < 0 || j >= n_col)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid triplet\n\n") ; } ;
     return ((-8)) ;
 }
 if (prl == 4 && k == 9 && nz > 10)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("    ...\n") ; } ;
     prl-- ;
 }
    }
    prl = prl1 ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    triplet-form matrix ") ; } ; } } ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    return ((0)) ;
}

variable_types: nz int

variable_types:
Ti
int []

variable_types:
Tj
int []

variable_types:
Tx
double []

variable_types:
Tz
double []

variable_types:
Control
double [20]

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

variable_types: prl int

variable_types: k int

variable_types: i int

variable_types: j int

variable_types: split int


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

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

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

variable_types: row int

variable_types: col int

variable_types:
Wrow
int *

variable_types:
Frpos
int *

variable_types:
Fcpos
int *

variable_types:
Fcols
int *

variable_types: rrdeg int

variable_types: ccdeg int

variable_types: fnrows int

variable_types: fncols int

variable_types: pos int

variable_types: fnpiv int

variable_types:
Wm
int *

variable_types:
Wx
double *

variable_types:
Wy
double *

variable_types:
Fu
double *

variable_types:
Fl
double *

variable_types:
F
double *

return_type: int

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


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

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

variable_types:
Flblock
double *

variable_types:
Fublock
double *

variable_types:
Fcblock
double *

variable_types: j int

variable_types: i int

variable_types:
Fj
double *

variable_types:
Fi
double *

return_type: void


original_code:
long umfpack_zl_get_symbolic
(
    long *p_n_row,
    long *p_n_col,
    long *p_n1,
    long *p_nz,
    long *p_nfr,
    long *p_nchains,
    long P [ ],
    long Q [ ],
    long Front_npivcol [ ],
    long Front_parent [ ],
    long Front_1strow [ ],
    long Front_leftmostdesc [ ],
    long Chain_start [ ],
    long Chain_maxrows [ ],
    long Chain_maxcols [ ],
    void *SymbolicHandle
)
{
    SymbolicType *Symbolic ;
    long k, n_row, n_col, n1, nfr, nchains, *p ;
    Symbolic = (SymbolicType *) SymbolicHandle ;
    if (!umfzl_valid_symbolic (Symbolic))
    {
 return ((-4)) ;
    }
    n_row = Symbolic->n_row ;
    n_col = Symbolic->n_col ;
    n1 = Symbolic->n1 ;
    nfr = Symbolic->nfr ;
    nchains = Symbolic->nchains ;
    if (p_n_row)
    {
 *p_n_row = n_row ;
    }
    if (p_n_col)
    {
 *p_n_col = n_col ;
    }
    if (p_n1)
    {
 *p_n1 = n1 ;
    }
    if (p_nz)
    {
 *p_nz = Symbolic->nz ;
    }
    if (p_nfr)
    {
 *p_nfr = nfr ;
    }
    if (p_nchains)
    {
 *p_nchains = nchains ;
    }
    if (P != (long *) ((void *)0))
    {
 long *Rperm_init, *Diagonal_map ;
 Rperm_init = Symbolic->Rperm_init ;
 Diagonal_map = Symbolic->Diagonal_map ;
 if (Diagonal_map != (long *) ((void *)0))
 {
     ;
     for (k = 0 ; k < n_row ; k++)
     {
  P [k] = Rperm_init [Diagonal_map [k]] ;
     }
 }
 else
 {
     for (k = 0 ; k < n_row ; k++)
     {
  P [k] = Rperm_init [k] ;
     }
 }
    }
    if (Q != (long *) ((void *)0))
    {
 p = Symbolic->Cperm_init ;
 for (k = 0 ; k < n_col ; k++)
 {
     Q [k] = p [k] ;
 }
    }
    if (Front_npivcol != (long *) ((void *)0))
    {
 p = Symbolic->Front_npivcol ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_npivcol [k] = p [k] ;
 }
    }
    if (Front_parent != (long *) ((void *)0))
    {
 p = Symbolic->Front_parent ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_parent [k] = p [k] ;
 }
    }
    if (Front_1strow != (long *) ((void *)0))
    {
 p = Symbolic->Front_1strow ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_1strow [k] = p [k] ;
 }
    }
    if (Front_leftmostdesc != (long *) ((void *)0))
    {
 p = Symbolic->Front_leftmostdesc ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_leftmostdesc [k] = p [k] ;
 }
    }
    if (Chain_start != (long *) ((void *)0))
    {
 p = Symbolic->Chain_start ;
 for (k = 0 ; k <= nchains ; k++)
 {
     Chain_start [k] = p [k] ;
 }
    }
    if (Chain_maxrows != (long *) ((void *)0))
    {
 p = Symbolic->Chain_maxrows ;
 for (k = 0 ; k < nchains ; k++)
 {
     Chain_maxrows [k] = p [k] ;
 }
 Chain_maxrows [nchains] = 0 ;
    }
    if (Chain_maxcols != (long *) ((void *)0))
    {
 p = Symbolic->Chain_maxcols ;
 for (k = 0 ; k < nchains ; k++)
 {
     Chain_maxcols [k] = p [k] ;
 }
 Chain_maxcols [nchains] = 0 ;
    }
    return ((0)) ;
}

canonical_original_code:
long umfpack_zl_get_symbolic(long *p_n_row, long *p_n_col, long *p_n1, long *p_nz, long *p_nfr, long *p_nchains, long P[], long Q[], long Front_npivcol[], long Front_parent[], long Front_1strow[], long Front_leftmostdesc[], long Chain_start[], long Chain_maxrows[], long Chain_maxcols[], void *SymbolicHandle)
{
    struct SymbolicType *Symbolic;
    long k; long n_row; long n_col; long n1; long nfr; long nchains; long *p;
    Symbolic = (struct SymbolicType *) SymbolicHandle ;
    if (!umfzl_valid_symbolic (Symbolic))
    {
 return ((-4)) ;
    }
    n_row = Symbolic->n_row ;
    n_col = Symbolic->n_col ;
    n1 = Symbolic->n1 ;
    nfr = Symbolic->nfr ;
    nchains = Symbolic->nchains ;
    if (p_n_row)
    {
 *p_n_row = n_row ;
    }
    if (p_n_col)
    {
 *p_n_col = n_col ;
    }
    if (p_n1)
    {
 *p_n1 = n1 ;
    }
    if (p_nz)
    {
 *p_nz = Symbolic->nz ;
    }
    if (p_nfr)
    {
 *p_nfr = nfr ;
    }
    if (p_nchains)
    {
 *p_nchains = nchains ;
    }
    if (P != (long *) ((void *)0))
    {
 long *Rperm_init; long *Diagonal_map;
 Rperm_init = Symbolic->Rperm_init ;
 Diagonal_map = Symbolic->Diagonal_map ;
 if (Diagonal_map != (long *) ((void *)0))
 {
     ;
     for (k = 0 ; k < n_row ; k++)
     {
  P [k] = Rperm_init [Diagonal_map [k]] ;
     }
 }
 else
 {
     for (k = 0 ; k < n_row ; k++)
     {
  P [k] = Rperm_init [k] ;
     }
 }
    }
    if (Q != (long *) ((void *)0))
    {
 p = Symbolic->Cperm_init ;
 for (k = 0 ; k < n_col ; k++)
 {
     Q [k] = p [k] ;
 }
    }
    if (Front_npivcol != (long *) ((void *)0))
    {
 p = Symbolic->Front_npivcol ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_npivcol [k] = p [k] ;
 }
    }
    if (Front_parent != (long *) ((void *)0))
    {
 p = Symbolic->Front_parent ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_parent [k] = p [k] ;
 }
    }
    if (Front_1strow != (long *) ((void *)0))
    {
 p = Symbolic->Front_1strow ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_1strow [k] = p [k] ;
 }
    }
    if (Front_leftmostdesc != (long *) ((void *)0))
    {
 p = Symbolic->Front_leftmostdesc ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_leftmostdesc [k] = p [k] ;
 }
    }
    if (Chain_start != (long *) ((void *)0))
    {
 p = Symbolic->Chain_start ;
 for (k = 0 ; k <= nchains ; k++)
 {
     Chain_start [k] = p [k] ;
 }
    }
    if (Chain_maxrows != (long *) ((void *)0))
    {
 p = Symbolic->Chain_maxrows ;
 for (k = 0 ; k < nchains ; k++)
 {
     Chain_maxrows [k] = p [k] ;
 }
 Chain_maxrows [nchains] = 0 ;
    }
    if (Chain_maxcols != (long *) ((void *)0))
    {
 p = Symbolic->Chain_maxcols ;
 for (k = 0 ; k < nchains ; k++)
 {
     Chain_maxcols [k] = p [k] ;
 }
 Chain_maxcols [nchains] = 0 ;
    }
    return ((0)) ;
}

variable_types:
P
long []

variable_types:
Q
long []

variable_types:
SymbolicHandle
void *

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

variable_types: k long

variable_types: nfr long

variable_types: nchains long

variable_types:
p
long *

return_type: long


original_code:
int umfdi_grow_front
(
    NumericType *Numeric,
    int fnr2,
    int fnc2,
    WorkType *Work,
    int do_what
)
{
    double s ;
    double *Fcold, *Fcnew ;
    int j, i, col, *Fcpos, *Fcols, fnrows_max, fncols_max, fnr_curr, nb,
 fnrows_new, fncols_new, fnr_min, fnc_min, minsize,
 newsize, fnrows, fncols, *E, eloc ;
    Fcols = Work->Fcols ;
    Fcpos = Work->Fcpos ;
    E = Work->E ;
    nb = Work->nb ;
    fnrows_max = Work->fnrows_max + nb ;
    fncols_max = Work->fncols_max + nb ;
    ;
    ;
    ;
    ;
    ;
    fnrows_new = Work->fnrows_new + 1 ;
    fncols_new = Work->fncols_new + 1 ;
    ;
    if (fnrows_new % 2 == 0) fnrows_new++ ;
    fnrows_new += nb ;
    fncols_new += nb ;
    fnr_min = (((fnrows_new) < (fnrows_max)) ? (fnrows_new) : (fnrows_max)) ;
    fnc_min = (((fncols_new) < (fncols_max)) ? (fncols_new) : (fncols_max)) ;
    minsize = fnr_min * fnc_min ;
    if (((!(((double) fnr_min * (double) fnc_min * sizeof (double)) * (1.0+1e-8) <= (double) 0x7fffffff)) || (((double) fnr_min * (double) fnc_min * sizeof (double)) != ((double) fnr_min * (double) fnc_min * sizeof (double)))))
    {
 return ((0)) ;
    }
    ;
    ;
    ;
    ;
    fnr2 += nb ;
    fnc2 += nb ;
    ;
    if (fnr2 % 2 == 0) fnr2++ ;
    fnr2 = (((fnr2) > (fnr_min)) ? (fnr2) : (fnr_min)) ;
    fnc2 = (((fnc2) > (fnc_min)) ? (fnc2) : (fnc_min)) ;
    fnr2 = (((fnr2) < (fnrows_max)) ? (fnr2) : (fnrows_max)) ;
    fnc2 = (((fnc2) < (fncols_max)) ? (fnc2) : (fncols_max)) ;
    ;
    ;
    ;
    s = ((double) fnr2) * ((double) fnc2) ;
    if (((!((s * sizeof (double)) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((s * sizeof (double)) != (s * sizeof (double)))))
    {
 double a = 0.9 * sqrt ((0x7fffffff / sizeof (double)) / s) ;
 fnr2 = (((fnr_min) > (a * fnr2)) ? (fnr_min) : (a * fnr2)) ;
 fnc2 = (((fnc_min) > (a * fnc2)) ? (fnc_min) : (a * fnc2)) ;
 newsize = fnr2 * fnc2 ;
 ;
 if (fnr2 % 2 == 0) fnr2++ ;
 fnc2 = newsize / fnr2 ;
    }
    fnr2 = (((fnr2) > (fnr_min)) ? (fnr2) : (fnr_min)) ;
    fnc2 = (((fnc2) > (fnc_min)) ? (fnc2) : (fnc_min)) ;
    newsize = fnr2 * fnc2 ;
    ;
    ;
    ;
    ;
    ;
    if (E [0] && do_what != 1)
    {
 ;
 umfdi_mem_free_tail_block (Numeric, E [0]) ;
 E [0] = 0 ;
 Work->Flublock = (double *) ((void *)0) ;
 Work->Flblock = (double *) ((void *)0) ;
 Work->Fublock = (double *) ((void *)0) ;
 Work->Fcblock = (double *) ((void *)0) ;
    }
    ;
    eloc = umfdi_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    if (!eloc)
    {
 ;
 if (!umfdi_get_memory (Numeric, Work, 1 + (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))),
     Work->fnrows, Work->fncols, (0)))
 {
     return ((0)) ;
 }
 ;
 eloc = umfdi_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    }
    while ((fnr2 != fnr_min || fnc2 != fnc_min) && !eloc)
    {
 fnr2 = (((fnr2 - 2) < (fnr2 * (0.95))) ? (fnr2 - 2) : (fnr2 * (0.95))) ;
 fnc2 = (((fnc2 - 2) < (fnc2 * (0.95))) ? (fnc2 - 2) : (fnc2 * (0.95))) ;
 ;
 ;
 fnr2 = (((fnr_min) > (fnr2)) ? (fnr_min) : (fnr2)) ;
 fnc2 = (((fnc_min) > (fnc2)) ? (fnc_min) : (fnc2)) ;
 ;
 if (fnr2 % 2 == 0) fnr2++ ;
 newsize = fnr2 * fnc2 ;
 ;
 eloc = umfdi_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    }
    if (!eloc)
    {
 fnr2 = fnr_min ;
 fnc2 = fnc_min ;
 newsize = minsize ;
 ;
 eloc = umfdi_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    }
    if (!eloc)
    {
 return ((0)) ;
    }
    ;
    ;
    ;
    fnr_curr = Work->fnr_curr ;
    ;
    ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    Fcold = Work->Fcblock ;
    fnr2 -= nb ;
    fnc2 -= nb ;
    Work->Flublock = (double *) (Numeric->Memory + eloc) ;
    Work->Flblock = Work->Flublock + nb * nb ;
    Work->Fublock = Work->Flblock + nb * fnr2 ;
    Work->Fcblock = Work->Fublock + nb * fnc2 ;
    Fcnew = Work->Fcblock ;
    if (E [0])
    {
 for (j = 0 ; j < fncols ; j++)
 {
     col = Fcols [j] ;
     ;
     ;
     for (i = 0 ; i < fnrows ; i++)
     {
  Fcnew [i] = Fcold [i] ;
     }
     Fcnew += fnr2 ;
     Fcold += fnr_curr ;
     ;
     Fcpos [col] = j * fnr2 ;
 }
    }
    else if (do_what == 2)
    {
 for (j = 0 ; j < fncols ; j++)
 {
     col = Fcols [j] ;
     ;
     Fcpos [col] = j * fnr2 ;
 }
    }
    umfdi_mem_free_tail_block (Numeric, E [0]) ;
    E [0] = eloc ;
    Work->fnr_curr = fnr2 ;
    Work->fnc_curr = fnc2 ;
    Work->fcurr_size = newsize ;
    Work->do_grow = (0) ;
    ;
    ;
    ;
    return ((1)) ;
}

canonical_original_code:
int umfdi_grow_front(struct NumericType *Numeric, int fnr2, int fnc2, struct WorkType *Work, int do_what)
{
    double s;
    double *Fcold; double *Fcnew;
    int j; int i; int col; int *Fcpos; int *Fcols; int fnrows_max; int fncols_max; int fnr_curr; int nb; int fnrows_new; int fncols_new; int fnr_min; int fnc_min; int minsize; int newsize; int fnrows; int fncols; int *E; int eloc;
    Fcols = Work->Fcols ;
    Fcpos = Work->Fcpos ;
    E = Work->E ;
    nb = Work->nb ;
    fnrows_max = Work->fnrows_max + nb ;
    fncols_max = Work->fncols_max + nb ;
    ;
    ;
    ;
    ;
    ;
    fnrows_new = Work->fnrows_new + 1 ;
    fncols_new = Work->fncols_new + 1 ;
    ;
    if (fnrows_new % 2 == 0) fnrows_new++ ;
    fnrows_new += nb ;
    fncols_new += nb ;
    fnr_min = (((fnrows_new) < (fnrows_max)) ? (fnrows_new) : (fnrows_max)) ;
    fnc_min = (((fncols_new) < (fncols_max)) ? (fncols_new) : (fncols_max)) ;
    minsize = fnr_min * fnc_min ;
    if (((!(((double) fnr_min * (double) fnc_min * sizeof (double)) * (1.0+1e-8) <= (double) 0x7fffffff)) || (((double) fnr_min * (double) fnc_min * sizeof (double)) != ((double) fnr_min * (double) fnc_min * sizeof (double)))))
    {
 return ((0)) ;
    }
    ;
    ;
    ;
    ;
    fnr2 += nb ;
    fnc2 += nb ;
    ;
    if (fnr2 % 2 == 0) fnr2++ ;
    fnr2 = (((fnr2) > (fnr_min)) ? (fnr2) : (fnr_min)) ;
    fnc2 = (((fnc2) > (fnc_min)) ? (fnc2) : (fnc_min)) ;
    fnr2 = (((fnr2) < (fnrows_max)) ? (fnr2) : (fnrows_max)) ;
    fnc2 = (((fnc2) < (fncols_max)) ? (fnc2) : (fncols_max)) ;
    ;
    ;
    ;
    s = ((double) fnr2) * ((double) fnc2) ;
    if (((!((s * sizeof (double)) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((s * sizeof (double)) != (s * sizeof (double)))))
    {
 double a = 0.9 * sqrt ((0x7fffffff / sizeof (double)) / s);
 fnr2 = (((fnr_min) > (a * fnr2)) ? (fnr_min) : (a * fnr2)) ;
 fnc2 = (((fnc_min) > (a * fnc2)) ? (fnc_min) : (a * fnc2)) ;
 newsize = fnr2 * fnc2 ;
 ;
 if (fnr2 % 2 == 0) fnr2++ ;
 fnc2 = newsize / fnr2 ;
    }
    fnr2 = (((fnr2) > (fnr_min)) ? (fnr2) : (fnr_min)) ;
    fnc2 = (((fnc2) > (fnc_min)) ? (fnc2) : (fnc_min)) ;
    newsize = fnr2 * fnc2 ;
    ;
    ;
    ;
    ;
    ;
    if (E [0] && do_what != 1)
    {
 ;
 umfdi_mem_free_tail_block (Numeric, E [0]) ;
 E [0] = 0 ;
 Work->Flublock = (double *) ((void *)0) ;
 Work->Flblock = (double *) ((void *)0) ;
 Work->Fublock = (double *) ((void *)0) ;
 Work->Fcblock = (double *) ((void *)0) ;
    }
    ;
    eloc = umfdi_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    if (!eloc)
    {
 ;
 if (!umfdi_get_memory (Numeric, Work, 1 + (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))),
     Work->fnrows, Work->fncols, (0)))
 {
     return ((0)) ;
 }
 ;
 eloc = umfdi_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    }
    while ((fnr2 != fnr_min || fnc2 != fnc_min) && !eloc)
    {
 fnr2 = (((fnr2 - 2) < (fnr2 * (0.95))) ? (fnr2 - 2) : (fnr2 * (0.95))) ;
 fnc2 = (((fnc2 - 2) < (fnc2 * (0.95))) ? (fnc2 - 2) : (fnc2 * (0.95))) ;
 ;
 ;
 fnr2 = (((fnr_min) > (fnr2)) ? (fnr_min) : (fnr2)) ;
 fnc2 = (((fnc_min) > (fnc2)) ? (fnc_min) : (fnc2)) ;
 ;
 if (fnr2 % 2 == 0) fnr2++ ;
 newsize = fnr2 * fnc2 ;
 ;
 eloc = umfdi_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    }
    if (!eloc)
    {
 fnr2 = fnr_min ;
 fnc2 = fnc_min ;
 newsize = minsize ;
 ;
 eloc = umfdi_mem_alloc_tail_block (Numeric, (((((sizeof (double) * (newsize))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    }
    if (!eloc)
    {
 return ((0)) ;
    }
    ;
    ;
    ;
    fnr_curr = Work->fnr_curr ;
    ;
    ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    Fcold = Work->Fcblock ;
    fnr2 -= nb ;
    fnc2 -= nb ;
    Work->Flublock = (double *) (Numeric->Memory + eloc) ;
    Work->Flblock = Work->Flublock + nb * nb ;
    Work->Fublock = Work->Flblock + nb * fnr2 ;
    Work->Fcblock = Work->Fublock + nb * fnc2 ;
    Fcnew = Work->Fcblock ;
    if (E [0])
    {
 for (j = 0 ; j < fncols ; j++)
 {
     col = Fcols [j] ;
     ;
     ;
     for (i = 0 ; i < fnrows ; i++)
     {
  Fcnew [i] = Fcold [i] ;
     }
     Fcnew += fnr2 ;
     Fcold += fnr_curr ;
     ;
     Fcpos [col] = j * fnr2 ;
 }
    }
    else if (do_what == 2)
    {
 for (j = 0 ; j < fncols ; j++)
 {
     col = Fcols [j] ;
     ;
     Fcpos [col] = j * fnr2 ;
 }
    }
    umfdi_mem_free_tail_block (Numeric, E [0]) ;
    E [0] = eloc ;
    Work->fnr_curr = fnr2 ;
    Work->fnc_curr = fnc2 ;
    Work->fcurr_size = newsize ;
    Work->do_grow = (0) ;
    ;
    ;
    ;
    return ((1)) ;
}

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

variable_types:
Fcold
double *

variable_types:
Fcnew
double *

variable_types: col int

variable_types:
Fcpos
int *

variable_types:
Fcols
int *

variable_types: nb int

variable_types: minsize int

variable_types: newsize int

variable_types: fnrows int

variable_types: fncols int

variable_types:
E
int *

variable_types: eloc int

variable_types: a double


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

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

variable_types: n int

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

variable_types:
X
struct DoubleComplex []

variable_types: i int


original_code:
void umf_l_apply_order
(
    long Front [ ],
    const long Order [ ],
    long Temp [ ],
    long nn,
    long nfr
)
{
    long i, k ;
    for (i = 0 ; i < nn ; i++)
    {
 k = Order [i] ;
 ;
 if (k != (-1))
 {
     Temp [k] = Front [i] ;
 }
    }
    for (k = 0 ; k < nfr ; k++)
    {
 Front [k] = Temp [k] ;
    }
}

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

variable_types:
Front
long []

variable_types:
Order
long []

variable_types:
Temp
long []

variable_types: nn long

variable_types: nfr long

variable_types: i long

variable_types: k long


decompiled_code:
__int64 __fastcall umfpack_di_report_triplet(int a1, __int64 a2, int a3, __int64 a4, __int64 a5, __int64 a6, double *a7)
{
__int64 v9; // r15
__int64 result; // rax
__int64 v12; // rcx
__int64 v13; // rdx
int v14; // er15
__int64 v15; // rbx
__int64 v16; // r13
int v17; // ebp
int v18; // er12
double v19; // xmm0_8
int v20; // [rsp+14h] [rbp-54h]
__int64 v21; // [rsp+18h] [rbp-50h]
bool v23; // [rsp+2Bh] [rbp-3Dh]
int v24; // [rsp+2Ch] [rbp-3Ch]

v20 = a2;
v21 = a4;
if ( !a7 )
return 0LL;
v9 = a5;
v24 = (int)*a7;
result = 0LL;
if ( v24 > 2 )
{
if ( amd_printf )
{
v12 = (unsigned int)a3;
v13 = (unsigned int)a2;
a2 = (unsigned int)a1;
amd_printf("triplet-form matrix, n_row = %d, n_col = %d nz = %d. ", (unsigned int)a1, v13, v12);
if ( !a4 || !v9 )
{
if ( amd_printf )
amd_printf("ERROR: indices not present\n\n");
return 4294967291LL;
}
if ( a1 <= 0 || v20 <= 0 )
{
if ( amd_printf )
amd_printf("ERROR: n_row or n_col is <= 0\n\n");
return 4294967290LL;
}
}
else
{
if ( !a4 || !a5 )
return 4294967291LL;
if ( a1 <= 0 || (int)a2 <= 0 )
return 4294967290LL;
}
if ( a3 < 0 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: nz is < 0\n\n");
result = 4294967288LL;
}
return result;
}
if ( v24 <= 3 )
{
v23 = a6 != 0;
if ( a3 <= 0 )
{
LABEL_49:
if ( amd_printf )
amd_printf("OK\n\n", a2);
return 0LL;
}
}
else
{
if ( amd_printf )
amd_printf("\n");
v23 = a6 != 0;
if ( a3 <= 0 )
goto LABEL_47;
}
v14 = v24;
v15 = 0LL;
v16 = a5;
while ( 1 )
{
a2 = (unsigned int)v15;
v17 = *(_DWORD *)(v21 + 4 * v15);
v18 = *(_DWORD *)(v16 + 4 * v15);
if ( v14 > 3 )
{
if ( amd_printf )
amd_printf(" %d : %d %d ", (unsigned int)v15, (unsigned int)v17, (unsigned int)v18);
if ( v23 )
{
v19 = *(double *)(a6 + 8 * v15);
if ( v19 == 0.0 )
{
if ( amd_printf )
amd_printf(" (0)", (unsigned int)v15);
}
else if ( amd_printf )
{
amd_printf(" (%g)", v19);
}
}
if ( amd_printf )
amd_printf("\n");
}
if ( v17 < 0 || a1 <= v17 || v18 < 0 || v20 <= v18 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: invalid triplet\n\n", (unsigned int)v15);
result = 4294967288LL;
}
return result;
}
if ( a3 > 10 && v14 == 4 && (_DWORD)v15 == 9 )
{
if ( amd_printf )
amd_printf(" ...\n", (unsigned int)v15);
v14 = 3;
}
else if ( a3 <= (int)v15 + 1 )
{
if ( v24 <= 3 )
goto LABEL_49;
LABEL_47:
result = 0LL;
if ( amd_printf )
{
amd_printf(" triplet-form matrix ");
goto LABEL_49;
}
return result;
}
++v15;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, __int64 a2, int a3, __int64 a4, __int64 a5, __int64 a6, double *a7)
{
__int64 v9; // r15
__int64 result; // rax
__int64 v12; // rcx
__int64 v13; // rdx
int v14; // er15
__int64 v15; // rbx
__int64 v16; // r13
int v17; // ebp
int v18; // er12
double v19; // xmm0_8
int v20; // [rsp+14h] [rbp-54h]
__int64 v21; // [rsp+18h] [rbp-50h]
bool v23; // [rsp+2Bh] [rbp-3Dh]
int v24; // [rsp+2Ch] [rbp-3Ch]

v20 = a2;
v21 = a4;
if ( !a7 )
return 0LL;
v9 = a5;
v24 = (int)*a7;
result = 0LL;
if ( v24 > 2 )
{
if ( amd_printf )
{
v12 = (unsigned int)a3;
v13 = (unsigned int)a2;
a2 = (unsigned int)a1;
amd_printf("triplet-form matrix, n_row = %d, n_col = %d nz = %d. ", (unsigned int)a1, v13, v12);
if ( !a4 || !v9 )
{
if ( amd_printf )
amd_printf("ERROR: indices not present\n\n");
return 4294967291LL;
}
if ( a1 <= 0 || v20 <= 0 )
{
if ( amd_printf )
amd_printf("ERROR: n_row or n_col is <= 0\n\n");
return 4294967290LL;
}
}
else
{
if ( !a4 || !a5 )
return 4294967291LL;
if ( a1 <= 0 || (int)a2 <= 0 )
return 4294967290LL;
}
if ( a3 < 0 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: nz is < 0\n\n");
result = 4294967288LL;
}
return result;
}
if ( v24 <= 3 )
{
v23 = a6 != 0;
if ( a3 <= 0 )
{
LABEL_49:
if ( amd_printf )
amd_printf("OK\n\n", a2);
return 0LL;
}
}
else
{
if ( amd_printf )
amd_printf("\n");
v23 = a6 != 0;
if ( a3 <= 0 )
goto LABEL_47;
}
v14 = v24;
v15 = 0LL;
v16 = a5;
while ( 1 )
{
a2 = (unsigned int)v15;
v17 = *(_DWORD *)(v21 + 4 * v15);
v18 = *(_DWORD *)(v16 + 4 * v15);
if ( v14 > 3 )
{
if ( amd_printf )
amd_printf(" %d : %d %d ", (unsigned int)v15, (unsigned int)v17, (unsigned int)v18);
if ( v23 )
{
v19 = *(double *)(a6 + 8 * v15);
if ( v19 == 0.0 )
{
if ( amd_printf )
amd_printf(" (0)", (unsigned int)v15);
}
else if ( amd_printf )
{
amd_printf(" (%g)", v19);
}
}
if ( amd_printf )
amd_printf("\n");
}
if ( v17 < 0 || a1 <= v17 || v18 < 0 || v20 <= v18 )
{
result = 4294967288LL;
if ( amd_printf )
{
amd_printf("ERROR: invalid triplet\n\n", (unsigned int)v15);
result = 4294967288LL;
}
return result;
}
if ( a3 > 10 && v14 == 4 && (_DWORD)v15 == 9 )
{
if ( amd_printf )
amd_printf(" ...\n", (unsigned int)v15);
v14 = 3;
}
else if ( a3 <= (int)v15 + 1 )
{
if ( v24 <= 3 )
goto LABEL_49;
LABEL_47:
result = 0LL;
if ( amd_printf )
{
amd_printf(" triplet-form matrix ");
goto LABEL_49;
}
return result;
}
++v15;
}
}
return result;
}

original_code:
int umfpack_di_report_triplet
(
    int n_row,
    int n_col,
    int nz,
    const int Ti [ ],
    const int Tj [ ],
    const double Tx [ ],
    const double Control [20]
)
{
    double t ;
    int prl, prl1, k, i, j, do_values ;
    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 ("triplet-form matrix, n_row = ""%d"", n_col = ""%d"" nz = ""%d"". ", n_row, n_col, nz) ; } ;
    if (!Ti || !Tj)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: indices not present\n\n") ; } ;
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: n_row or n_col is <= 0\n\n") ; } ;
 return ((-6)) ;
    }
    if (nz < 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: nz is < 0\n\n") ; } ;
 return ((-8)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    do_values = Tx != (double *) ((void *)0) ;
    prl1 = prl ;
    for (k = 0 ; k < nz ; k++)
    {
 i = Ti [k] ;
 j = Tj [k] ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    ""%d"" : ""%d"" ""%d"" ", (k), (i), (j)) ; } ; } } ;
 if (do_values && prl >= 4)
 {
     { (t) = (Tx)[k] ; } ;
     { if (((t) != 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" (%g)", (t)) ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" (0)") ; } ; } } ;
 }
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
 if (i < 0 || i >= n_row || j < 0 || j >= n_col)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid triplet\n\n") ; } ;
     return ((-8)) ;
 }
 if (prl == 4 && k == 9 && nz > 10)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("    ...\n") ; } ;
     prl-- ;
 }
    }
    prl = prl1 ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    triplet-form matrix ") ; } ; } } ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    return ((0)) ;
}

canonical_original_code:
int umfpack_di_report_triplet(int n_row, int n_col, int nz, int Ti[], int Tj[], double Tx[], double Control[20])
{
    double t;
    int prl; int prl1; int k; int i; int j; int do_values;
    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 ("triplet-form matrix, n_row = ""%d"", n_col = ""%d"" nz = ""%d"". ", n_row, n_col, nz) ; } ;
    if (!Ti || !Tj)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: indices not present\n\n") ; } ;
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: n_row or n_col is <= 0\n\n") ; } ;
 return ((-6)) ;
    }
    if (nz < 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: nz is < 0\n\n") ; } ;
 return ((-8)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    do_values = Tx != (double *) ((void *)0) ;
    prl1 = prl ;
    for (k = 0 ; k < nz ; k++)
    {
 i = Ti [k] ;
 j = Tj [k] ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    ""%d"" : ""%d"" ""%d"" ", (k), (i), (j)) ; } ; } } ;
 if (do_values && prl >= 4)
 {
     { (t) = (Tx)[k] ; } ;
     { if (((t) != 0.)) { { if (amd_printf != ((void *)0)) (void) amd_printf (" (%g)", (t)) ; } ; } else { { if (amd_printf != ((void *)0)) (void) amd_printf (" (0)") ; } ; } } ;
 }
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
 if (i < 0 || i >= n_row || j < 0 || j >= n_col)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid triplet\n\n") ; } ;
     return ((-8)) ;
 }
 if (prl == 4 && k == 9 && nz > 10)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("    ...\n") ; } ;
     prl-- ;
 }
    }
    prl = prl1 ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    triplet-form matrix ") ; } ; } } ;
    { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    return ((0)) ;
}

variable_types: nz int

variable_types:
Ti
int []

variable_types:
Tj
int []

variable_types:
Tx
double []

variable_types:
Control
double [20]

variable_types: t double

variable_types: prl int

variable_types: k int

variable_types: j int


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

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

variable_types:
Mx
double *

variable_types:
Ex
double *

variable_types:
NumericHandle
void *

variable_types:
one
double [2]

variable_types:
D
double *

variable_types:
Info
double *

variable_types:
Rs
double *

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

variable_types: n long

variable_types: itmp long

variable_types: npiv long

variable_types:
Wi
long *

variable_types:
Rperm
long *

variable_types:
Cperm
long *

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


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

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


decompiled_code:
_BOOL8 __fastcall umfdl_valid_numeric(_QWORD *a1)
{
_BOOL8 result; // rax

if ( !a1 )
return 0LL;
result = 0LL;
if ( a1[12] == 399789720LL && (__int64)a1[33] > 0 && (__int64)a1[34] > 0 )
{
if ( a1[30] )
{
if ( a1[18] )
{
if ( a1[19] )
{
if ( a1[21] )
{
if ( a1[20] )
{
if ( a1[23] )
{
if ( a1[25] )
{
if ( a1[22] )
{
if ( a1[24] )
{
if ( a1[13] )
{
result = 1LL;
if ( (__int64)a1[27] > 0 )
result = a1[26] != 0LL;
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
return result;
}

canonical_decompiled_code:
_BOOL8 __fastcall func0(_QWORD *a1)
{
_BOOL8 result; // rax

if ( !a1 )
return 0LL;
result = 0LL;
if ( a1[12] == 399789720LL && (__int64)a1[33] > 0 && (__int64)a1[34] > 0 )
{
if ( a1[30] )
{
if ( a1[18] )
{
if ( a1[19] )
{
if ( a1[21] )
{
if ( a1[20] )
{
if ( a1[23] )
{
if ( a1[25] )
{
if ( a1[22] )
{
if ( a1[24] )
{
if ( a1[13] )
{
result = 1LL;
if ( (__int64)a1[27] > 0 )
result = a1[26] != 0LL;
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
else
{
result = 0LL;
}
}
return result;
}

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

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

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


decompiled_code:
__int64 __fastcall umfdi_row_search(__int64 a1, __int64 *a2, __int64 a3, int a4, int a5, int *a6, __int64 a7, int *a8, int *a9, __int64 a10, __int64 a11, _DWORD *a12, double *a13, int a14, _DWORD *a15)
{
__int64 *v16; // rdi
int *v17; // r14
__int64 v18; // r9
__int64 v19; // r10
__int64 v20; // r12
int v21; // er13
__int64 v22; // rcx
int v23; // er15
int v24; // ebx
double v25; // xmm1_8
double v26; // xmm0_8
double v27; // xmm3_8
double *v28; // rcx
double v29; // xmm0_8
double v30; // xmm2_8
int v31; // ecx
double v32; // xmm1_8
__int64 v33; // rcx
double v34; // xmm6_8
int v35; // edx
int v36; // eax
int v37; // eax
__int64 v38; // r12
int v39; // edx
int v40; // ebp
__int64 v41; // rax
int v42; // edx
int *v43; // rbx
int *v44; // r11
char *v45; // r13
__int64 v46; // rax
double v47; // xmm6_8
double v48; // xmm7_8
double v49; // xmm0_8
int v50; // ebx
int v51; // er10
__int64 v52; // rax
double v53; // xmm6_8
double v54; // xmm0_8
int v55; // er11
int v56; // ecx
int v57; // ebx
double v58; // xmm0_8
int v59; // ebp
int v60; // er11
int v61; // ebx
int v62; // ebx
int v63; // eax
int v64; // ecx
int v65; // edx
int *v66; // rax
int v67; // edx
int v68; // er11
int v69; // ecx
int v70; // ecx
__int64 v71; // r11
int v72; // ebx
int v73; // ecx
__int64 v74; // rdx
int *v75; // rbp
int v76; // eax
int v77; // er12
int *v78; // rdx
int *v79; // rdx
int v80; // eax
int *v81; // r9
__int64 result; // rax
int v83; // eax
int *v84; // rax
int v85; // edx
_DWORD *v86; // rdi
int v87; // ecx
int v88; // eax
__int64 v89; // rdx
int v90; // edi
__int64 v91; // r8
int *v92; // rax
int v93; // edx
_DWORD *v94; // rcx
int v95; // ecx
int *v96; // rbp
int *v97; // r11
int v98; // eax
__int64 v99; // rdx
int v100; // edi
__int64 v101; // rdi
bool v102; // al
int v103; // edx
bool v104; // dl
int v105; // eax
int v106; // er8
int v107; // eax
__int64 v108; // rdx
int v109; // eax
unsigned __int64 v110; // r13
unsigned __int64 v111; // r12
__int64 v112; // [rsp+0h] [rbp-78h]
int v113; // [rsp+8h] [rbp-70h]
char *v114; // [rsp+8h] [rbp-70h]
__int64 *v115; // [rsp+8h] [rbp-70h]
__int64 v117; // [rsp+18h] [rbp-60h]
int v119; // [rsp+24h] [rbp-54h]
__int64 v121; // [rsp+30h] [rbp-48h]
__int64 v122; // [rsp+38h] [rbp-40h]
__int64 v123; // [rsp+40h] [rbp-38h]

v16 = a2;
v17 = a8;
v18 = *(_QWORD *)(a1 + 120);
v117 = *(_QWORD *)(a1 + 168);
v121 = *(_QWORD *)(a1 + 176);
v19 = a2[4];
v20 = a2[170];
v122 = *a2;
v112 = *(_QWORD *)(a1 + 96);
v21 = *((_DWORD *)a2 + 344);
v22 = a2[15];
if ( v22 )
{
v113 = *(_DWORD *)(v22 + 4LL * a14);
if ( v113 >= 0 )
{
v23 = *((_DWORD *)a2 + 350);
v24 = 0;
if ( a5 <= 0 )
{
v25 = 0.0;
v26 = 0.0 * *(double *)(a1 + 8);
v27 = *(double *)(a1 + 16);
LABEL_10:
v30 = v26;
v26 = v27 * v25;
goto LABEL_11;
}
goto LABEL_168;
}
v113 = -2 - v113;
v24 = 1;
}
else
{
v113 = -1;
v24 = -1;
}
v23 = *((_DWORD *)a2 + 350);
if ( a5 <= 0 )
{
v26 = 0.0 * *(double *)(a1 + 8);
v30 = v26;
goto LABEL_11;
}
LABEL_168:
v28 = a13;
v25 = 0.0;
do
{
v29 = *v28;
if ( *v28 < 0.0 )
*(_QWORD *)&v29 ^= LC1;
v25 = fmax(v25, v29);
++v28;
}
while ( v28 != &a13[(unsigned int)(a5 - 1) + 1] );
v26 = v25 * *(double *)(a1 + 8);
v27 = *(double *)(a1 + 16);
v30 = v26;
if ( !v24 )
goto LABEL_10;
LABEL_11:
if ( !*(_DWORD *)(a3 + 248) )
goto LABEL_16;
v31 = *(_DWORD *)(a7 + 4LL * v113);
if ( v31 < 0 )
goto LABEL_16;
v32 = a13[v31];
if ( v32 < 0.0 )
*(_QWORD *)&v32 ^= LC1;
if ( v32 == 0.0 || v32 < v26 )
{
LABEL_16:
if ( a4 <= 0 )
{
if ( a5 <= 0 )
{
LABEL_27:
if ( a5 )
goto LABEL_23;
goto LABEL_28;
}
v46 = 0LL;
v47 = 0.0;
v48 = 0.0;
do
{
v58 = a13[v46];
if ( v58 < 0.0 )
*(_QWORD *)&v58 ^= LC1;
if ( v58 != 0.0 && v58 >= v30 )
{
v59 = a6[v46];
v60 = *(_DWORD *)(v18 + 4LL * v59);
v61 = *(_DWORD *)(v20 + 4LL * v59);
if ( v61 < v21 && v61 >= 0 )
{
if ( *a9 > v60 || *a9 == v60 && v58 > v48 )
{
*a8 = v59;
*a9 = v60;
v48 = v58;
}
}
else
{
v62 = a9[1];
if ( v62 > v60 || v62 == v60 && v58 > v47 )
{
a8[1] = v59;
a9[1] = v60;
v47 = v58;
}
}
}
++v46;
}
while ( v46 != a5 );
LABEL_150:
if ( *a8 != -1 )
{
v36 = *a8;
LABEL_152:
v102 = *a12 == v36 && a5 > 0;
*a15 = v102;
if ( v102 )
goto LABEL_153;
goto LABEL_31;
}
goto LABEL_22;
}
v33 = 0LL;
v34 = 0.0;
v123 = a2[4];
do
{
v49 = a13[v33];
if ( v49 < 0.0 )
*(_QWORD *)&v49 ^= LC1;
if ( v49 != 0.0 && v49 >= v30 )
{
v50 = a6[v33];
v51 = *(_DWORD *)(v18 + 4LL * v50);
if ( *a9 > v51 || *a9 == v51 && v49 > v34 )
{
*a8 = v50;
*a9 = v51;
v34 = v49;
}
}
++v33;
}
while ( v33 != a4 );
v19 = v123;
if ( a5 > a4 )
{
v52 = a4;
v53 = 0.0;
do
{
v54 = a13[v52];
if ( v54 < 0.0 )
*(_QWORD *)&v54 ^= LC1;
if ( v54 != 0.0 && v54 >= v30 )
{
v55 = a6[v52];
v56 = *(_DWORD *)(v18 + 4LL * v55);
v57 = a9[1];
if ( v57 > v56 || v57 == v56 && v54 > v53 )
{
a8[1] = v55;
a9[1] = v56;
v53 = v54;
}
}
++v52;
}
while ( a5 > (int)v52 );
goto LABEL_150;
}
LABEL_26:
if ( a5 <= 0 )
goto LABEL_27;
goto LABEL_150;
}
v35 = *(_DWORD *)(v20 + 4LL * v113);
if ( v35 < v21 && v35 >= 0 )
{
*a8 = v113;
a8[1] = -1;
goto LABEL_26;
}
*a8 = -1;
a8[1] = v113;
if ( a5 > 0 )
{
LABEL_22:
if ( a8[1] == -1 )
{
v63 = *a6;
v64 = *(_DWORD *)(v18 + 4LL * *a6);
v65 = *(_DWORD *)(v20 + 4LL * *a6);
if ( v65 < v21 && v65 >= 0 )
{
*a8 = v63;
*a9 = v64;
}
else
{
a8[1] = v63;
a9[1] = v64;
}
if ( a5 > 1 )
{
v66 = a6 + 1;
do
{
v67 = *v66;
v68 = *(_DWORD *)(v18 + 4LL * *v66);
v69 = *(_DWORD *)(v20 + 4LL * *v66);
if ( v69 < v21 && v69 >= 0 )
{
if ( *a9 > v68 || v67 == v113 && *a9 == v68 )
{
*a8 = v67;
*a9 = v68;
}
}
else
{
v70 = a9[1];
if ( v70 > v68 || v67 == v113 && v70 == v68 )
{
a8[1] = v67;
a9[1] = v68;
}
}
++v66;
}
while ( v66 != &a6[a5 - 2 + 2] );
}
}
LABEL_23:
v36 = *a8;
if ( *a8 == -1 )
goto LABEL_153;
goto LABEL_152;
}
if ( a5 )
goto LABEL_153;
LABEL_28:
if ( v21 > 0 )
{
v37 = *(_DWORD *)a2[168];
*a8 = v37;
if ( v37 == -1 )
{
v105 = a8[1];
if ( v105 == -1 )
return 0LL;
a15[1] = a12[1] == v105 && a5 > 0;
goto LABEL_158;
}
*a15 = 0;
goto LABEL_31;
}
v71 = a2[99];
v72 = *(_DWORD *)(a3 + 204);
v73 = *(_DWORD *)(a1 + 232);
v74 = *((int *)a2 + 195);
v75 = (int *)(v71 + 4LL * *(int *)(*(_QWORD *)(a3 + 120) + 4 * v74));
v76 = *v75;
v77 = *(_DWORD *)(*(_QWORD *)(a3 + 112) + 4 * v74 + 4);
if ( v77 <= *v75 )
{
v77 = *v75;
}
else
{
v78 = (int *)(v18 + 4LL * v76);
while ( *v78 < 0 )
{
++v76;
++v78;
if ( v77 == v76 )
goto LABEL_99;
}
a8[1] = v76;
v77 = v76;
}
LABEL_99:
*v75 = v77;
if ( a8[1] != -1 )
goto LABEL_100;
v79 = (int *)(v71 + 4LL * v72);
v80 = *v79;
if ( v73 <= *v79 )
{
v73 = *v79;
}
else
{
v81 = (int *)(v18 + 4LL * v80);
while ( *v81 < 0 )
{
++v80;
++v81;
if ( v73 == v80 )
goto LABEL_109;
}
a8[1] = v80;
v73 = v80;
}
LABEL_109:
*v79 = v73;
result = 1LL;
if ( a8[1] != -1 )
{
LABEL_100:
if ( *a8 == -1 )
{
a15[1] = a8[1] == a12[1] && a5 > 0;
goto LABEL_158;
}
*a15 = *a12 == *a8 && a5 > 0;
LABEL_31:
v38 = a2[171];
v39 = *((_DWORD *)a2 + 345);
v40 = *((_DWORD *)a2 + 41);
*a9 = v39;
if ( *(int *)(v38 + 4LL * a14) < 0 )
{
if ( v39 >= v23 )
return 4294967285LL;
*(_DWORD *)(v19 + 4LL * a14) = v40;
v83 = (*a9)++;
*(_DWORD *)(a10 + 4LL * v83) = a14;
}
v41 = *a8;
v42 = *(_DWORD *)(v117 + 4 * v41);
if ( v42 )
{
v43 = (int *)(v112 + 8LL * v42);
v114 = (char *)v43;
v44 = &v43[2 * *(int *)(v121 + 4 * v41)];
if ( v43 >= v44 )
{
v45 = (char *)(v112 + 8LL * v42);
}
else
{
v45 = (char *)(v112 + 8LL * v42);
v119 = a5;
do
{
v88 = *(_DWORD *)(v122 + 4LL * *v43);
if ( v88 )
{
v89 = v112 + 8LL * v88;
v84 = (int *)(v89 + 32);
v90 = *(_DWORD *)(v89 + 20);
if ( *(_DWORD *)(v89 + 4 * (v90 + (__int64)v43[1]) + 32) != -1 )
{
if ( v90 > 0 )
{
v91 = v89 + 4LL * (unsigned int)(v90 - 1) + 36;
do
{
v85 = *v84;
if ( *v84 >= 0 )
{
v86 = (_DWORD *)(v19 + 4LL * v85);
if ( *v86 != v40 && *(int *)(v38 + 4LL * v85) < 0 )
{
if ( *a9 >= v23 )
return 4294967285LL;
*v86 = v40;
v87 = (*a9)++;
*(_DWORD *)(a10 + 4LL * v87) = v85;
}
}
++v84;
}
while ( v84 != (int *)v91 );
}
*(_QWORD *)v45 = *(_QWORD *)v43;
v45 += 8;
}
}
v43 += 2;
}
while ( v44 > v43 );
v16 = a2;
a5 = v119;
v17 = a8;
}
*(_DWORD *)(v121 + 4LL * *v17) = (v45 - v114) >> 3;
}
++*((_DWORD *)v16 + 41);
LABEL_153:
v103 = v17[1];
result = 0LL;
if ( v103 == -1 )
return result;
v104 = a5 > 0 && a12[1] == v103;
a15[1] = v104;
result = 0LL;
if ( v104 )
return result;
LABEL_158:
v106 = *((_DWORD *)v16 + 41);
a9[1] = 0;
if ( v23 <= 0 )
return 4294967285LL;
*(_DWORD *)(v19 + 4LL * a14) = v106;
v107 = a9[1];
a9[1] = v107 + 1;
*(_DWORD *)(a11 + 4LL * v107) = a14;
v108 = v17[1];
v109 = *(_DWORD *)(v117 + 4 * v108);
if ( v109 )
{
v110 = v112 + 8LL * v109;
v111 = v110 + 8LL * *(int *)(v121 + 4 * v108);
if ( v110 >= v111 )
{
v96 = (int *)(v112 + 8LL * v109);
}
else
{
v96 = (int *)(v112 + 8LL * v109);
v97 = v96;
v115 = v16;
do
{
v98 = *(_DWORD *)(v122 + 4LL * *v97);
if ( v98 )
{
v99 = v112 + 8LL * v98;
v92 = (int *)(v99 + 32);
v100 = *(_DWORD *)(v99 + 20);
if ( *(_DWORD *)(v99 + 4 * (v100 + (__int64)v97[1]) + 32) != -1 )
{
if ( v100 > 0 )
{
v101 = v99 + 4LL * (unsigned int)(v100 - 1) + 36;
do
{
v93 = *v92;
if ( *v92 >= 0 )
{
v94 = (_DWORD *)(v19 + 4LL * v93);
if ( *v94 != v106 )
{
if ( a9[1] >= v23 )
return 4294967285LL;
*v94 = v106;
v95 = a9[1];
a9[1] = v95 + 1;
*(_DWORD *)(a11 + 4LL * v95) = v93;
}
}
++v92;
}
while ( v92 != (int *)v101 );
}
*(_QWORD *)v96 = *(_QWORD *)v97;
v96 += 2;
}
}
v97 += 2;
}
while ( v111 > (unsigned __int64)v97 );
v16 = v115;
}
*(_DWORD *)(v121 + 4LL * v17[1]) = (__int64)((__int64)v96 - v110) >> 3;
}
++*((_DWORD *)v16 + 41);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 *a2, __int64 a3, int a4, int a5, int *a6, __int64 a7, int *a8, int *a9, __int64 a10, __int64 a11, _DWORD *a12, double *a13, int a14, _DWORD *a15)
{
__int64 *v16; // rdi
int *v17; // r14
__int64 v18; // r9
__int64 v19; // r10
__int64 v20; // r12
int v21; // er13
__int64 v22; // rcx
int v23; // er15
int v24; // ebx
double v25; // xmm1_8
double v26; // xmm0_8
double v27; // xmm3_8
double *v28; // rcx
double v29; // xmm0_8
double v30; // xmm2_8
int v31; // ecx
double v32; // xmm1_8
__int64 v33; // rcx
double v34; // xmm6_8
int v35; // edx
int v36; // eax
int v37; // eax
__int64 v38; // r12
int v39; // edx
int v40; // ebp
__int64 v41; // rax
int v42; // edx
int *v43; // rbx
int *v44; // r11
char *v45; // r13
__int64 v46; // rax
double v47; // xmm6_8
double v48; // xmm7_8
double v49; // xmm0_8
int v50; // ebx
int v51; // er10
__int64 v52; // rax
double v53; // xmm6_8
double v54; // xmm0_8
int v55; // er11
int v56; // ecx
int v57; // ebx
double v58; // xmm0_8
int v59; // ebp
int v60; // er11
int v61; // ebx
int v62; // ebx
int v63; // eax
int v64; // ecx
int v65; // edx
int *v66; // rax
int v67; // edx
int v68; // er11
int v69; // ecx
int v70; // ecx
__int64 v71; // r11
int v72; // ebx
int v73; // ecx
__int64 v74; // rdx
int *v75; // rbp
int v76; // eax
int v77; // er12
int *v78; // rdx
int *v79; // rdx
int v80; // eax
int *v81; // r9
__int64 result; // rax
int v83; // eax
int *v84; // rax
int v85; // edx
_DWORD *v86; // rdi
int v87; // ecx
int v88; // eax
__int64 v89; // rdx
int v90; // edi
__int64 v91; // r8
int *v92; // rax
int v93; // edx
_DWORD *v94; // rcx
int v95; // ecx
int *v96; // rbp
int *v97; // r11
int v98; // eax
__int64 v99; // rdx
int v100; // edi
__int64 v101; // rdi
bool v102; // al
int v103; // edx
bool v104; // dl
int v105; // eax
int v106; // er8
int v107; // eax
__int64 v108; // rdx
int v109; // eax
unsigned __int64 v110; // r13
unsigned __int64 v111; // r12
__int64 v112; // [rsp+0h] [rbp-78h]
int v113; // [rsp+8h] [rbp-70h]
char *v114; // [rsp+8h] [rbp-70h]
__int64 *v115; // [rsp+8h] [rbp-70h]
__int64 v117; // [rsp+18h] [rbp-60h]
int v119; // [rsp+24h] [rbp-54h]
__int64 v121; // [rsp+30h] [rbp-48h]
__int64 v122; // [rsp+38h] [rbp-40h]
__int64 v123; // [rsp+40h] [rbp-38h]

v16 = a2;
v17 = a8;
v18 = *(_QWORD *)(a1 + 120);
v117 = *(_QWORD *)(a1 + 168);
v121 = *(_QWORD *)(a1 + 176);
v19 = a2[4];
v20 = a2[170];
v122 = *a2;
v112 = *(_QWORD *)(a1 + 96);
v21 = *((_DWORD *)a2 + 344);
v22 = a2[15];
if ( v22 )
{
v113 = *(_DWORD *)(v22 + 4LL * a14);
if ( v113 >= 0 )
{
v23 = *((_DWORD *)a2 + 350);
v24 = 0;
if ( a5 <= 0 )
{
v25 = 0.0;
v26 = 0.0 * *(double *)(a1 + 8);
v27 = *(double *)(a1 + 16);
LABEL_10:
v30 = v26;
v26 = v27 * v25;
goto LABEL_11;
}
goto LABEL_168;
}
v113 = -2 - v113;
v24 = 1;
}
else
{
v113 = -1;
v24 = -1;
}
v23 = *((_DWORD *)a2 + 350);
if ( a5 <= 0 )
{
v26 = 0.0 * *(double *)(a1 + 8);
v30 = v26;
goto LABEL_11;
}
LABEL_168:
v28 = a13;
v25 = 0.0;
do
{
v29 = *v28;
if ( *v28 < 0.0 )
*(_QWORD *)&v29 ^= LC1;
v25 = fmax(v25, v29);
++v28;
}
while ( v28 != &a13[(unsigned int)(a5 - 1) + 1] );
v26 = v25 * *(double *)(a1 + 8);
v27 = *(double *)(a1 + 16);
v30 = v26;
if ( !v24 )
goto LABEL_10;
LABEL_11:
if ( !*(_DWORD *)(a3 + 248) )
goto LABEL_16;
v31 = *(_DWORD *)(a7 + 4LL * v113);
if ( v31 < 0 )
goto LABEL_16;
v32 = a13[v31];
if ( v32 < 0.0 )
*(_QWORD *)&v32 ^= LC1;
if ( v32 == 0.0 || v32 < v26 )
{
LABEL_16:
if ( a4 <= 0 )
{
if ( a5 <= 0 )
{
LABEL_27:
if ( a5 )
goto LABEL_23;
goto LABEL_28;
}
v46 = 0LL;
v47 = 0.0;
v48 = 0.0;
do
{
v58 = a13[v46];
if ( v58 < 0.0 )
*(_QWORD *)&v58 ^= LC1;
if ( v58 != 0.0 && v58 >= v30 )
{
v59 = a6[v46];
v60 = *(_DWORD *)(v18 + 4LL * v59);
v61 = *(_DWORD *)(v20 + 4LL * v59);
if ( v61 < v21 && v61 >= 0 )
{
if ( *a9 > v60 || *a9 == v60 && v58 > v48 )
{
*a8 = v59;
*a9 = v60;
v48 = v58;
}
}
else
{
v62 = a9[1];
if ( v62 > v60 || v62 == v60 && v58 > v47 )
{
a8[1] = v59;
a9[1] = v60;
v47 = v58;
}
}
}
++v46;
}
while ( v46 != a5 );
LABEL_150:
if ( *a8 != -1 )
{
v36 = *a8;
LABEL_152:
v102 = *a12 == v36 && a5 > 0;
*a15 = v102;
if ( v102 )
goto LABEL_153;
goto LABEL_31;
}
goto LABEL_22;
}
v33 = 0LL;
v34 = 0.0;
v123 = a2[4];
do
{
v49 = a13[v33];
if ( v49 < 0.0 )
*(_QWORD *)&v49 ^= LC1;
if ( v49 != 0.0 && v49 >= v30 )
{
v50 = a6[v33];
v51 = *(_DWORD *)(v18 + 4LL * v50);
if ( *a9 > v51 || *a9 == v51 && v49 > v34 )
{
*a8 = v50;
*a9 = v51;
v34 = v49;
}
}
++v33;
}
while ( v33 != a4 );
v19 = v123;
if ( a5 > a4 )
{
v52 = a4;
v53 = 0.0;
do
{
v54 = a13[v52];
if ( v54 < 0.0 )
*(_QWORD *)&v54 ^= LC1;
if ( v54 != 0.0 && v54 >= v30 )
{
v55 = a6[v52];
v56 = *(_DWORD *)(v18 + 4LL * v55);
v57 = a9[1];
if ( v57 > v56 || v57 == v56 && v54 > v53 )
{
a8[1] = v55;
a9[1] = v56;
v53 = v54;
}
}
++v52;
}
while ( a5 > (int)v52 );
goto LABEL_150;
}
LABEL_26:
if ( a5 <= 0 )
goto LABEL_27;
goto LABEL_150;
}
v35 = *(_DWORD *)(v20 + 4LL * v113);
if ( v35 < v21 && v35 >= 0 )
{
*a8 = v113;
a8[1] = -1;
goto LABEL_26;
}
*a8 = -1;
a8[1] = v113;
if ( a5 > 0 )
{
LABEL_22:
if ( a8[1] == -1 )
{
v63 = *a6;
v64 = *(_DWORD *)(v18 + 4LL * *a6);
v65 = *(_DWORD *)(v20 + 4LL * *a6);
if ( v65 < v21 && v65 >= 0 )
{
*a8 = v63;
*a9 = v64;
}
else
{
a8[1] = v63;
a9[1] = v64;
}
if ( a5 > 1 )
{
v66 = a6 + 1;
do
{
v67 = *v66;
v68 = *(_DWORD *)(v18 + 4LL * *v66);
v69 = *(_DWORD *)(v20 + 4LL * *v66);
if ( v69 < v21 && v69 >= 0 )
{
if ( *a9 > v68 || v67 == v113 && *a9 == v68 )
{
*a8 = v67;
*a9 = v68;
}
}
else
{
v70 = a9[1];
if ( v70 > v68 || v67 == v113 && v70 == v68 )
{
a8[1] = v67;
a9[1] = v68;
}
}
++v66;
}
while ( v66 != &a6[a5 - 2 + 2] );
}
}
LABEL_23:
v36 = *a8;
if ( *a8 == -1 )
goto LABEL_153;
goto LABEL_152;
}
if ( a5 )
goto LABEL_153;
LABEL_28:
if ( v21 > 0 )
{
v37 = *(_DWORD *)a2[168];
*a8 = v37;
if ( v37 == -1 )
{
v105 = a8[1];
if ( v105 == -1 )
return 0LL;
a15[1] = a12[1] == v105 && a5 > 0;
goto LABEL_158;
}
*a15 = 0;
goto LABEL_31;
}
v71 = a2[99];
v72 = *(_DWORD *)(a3 + 204);
v73 = *(_DWORD *)(a1 + 232);
v74 = *((int *)a2 + 195);
v75 = (int *)(v71 + 4LL * *(int *)(*(_QWORD *)(a3 + 120) + 4 * v74));
v76 = *v75;
v77 = *(_DWORD *)(*(_QWORD *)(a3 + 112) + 4 * v74 + 4);
if ( v77 <= *v75 )
{
v77 = *v75;
}
else
{
v78 = (int *)(v18 + 4LL * v76);
while ( *v78 < 0 )
{
++v76;
++v78;
if ( v77 == v76 )
goto LABEL_99;
}
a8[1] = v76;
v77 = v76;
}
LABEL_99:
*v75 = v77;
if ( a8[1] != -1 )
goto LABEL_100;
v79 = (int *)(v71 + 4LL * v72);
v80 = *v79;
if ( v73 <= *v79 )
{
v73 = *v79;
}
else
{
v81 = (int *)(v18 + 4LL * v80);
while ( *v81 < 0 )
{
++v80;
++v81;
if ( v73 == v80 )
goto LABEL_109;
}
a8[1] = v80;
v73 = v80;
}
LABEL_109:
*v79 = v73;
result = 1LL;
if ( a8[1] != -1 )
{
LABEL_100:
if ( *a8 == -1 )
{
a15[1] = a8[1] == a12[1] && a5 > 0;
goto LABEL_158;
}
*a15 = *a12 == *a8 && a5 > 0;
LABEL_31:
v38 = a2[171];
v39 = *((_DWORD *)a2 + 345);
v40 = *((_DWORD *)a2 + 41);
*a9 = v39;
if ( *(int *)(v38 + 4LL * a14) < 0 )
{
if ( v39 >= v23 )
return 4294967285LL;
*(_DWORD *)(v19 + 4LL * a14) = v40;
v83 = (*a9)++;
*(_DWORD *)(a10 + 4LL * v83) = a14;
}
v41 = *a8;
v42 = *(_DWORD *)(v117 + 4 * v41);
if ( v42 )
{
v43 = (int *)(v112 + 8LL * v42);
v114 = (char *)v43;
v44 = &v43[2 * *(int *)(v121 + 4 * v41)];
if ( v43 >= v44 )
{
v45 = (char *)(v112 + 8LL * v42);
}
else
{
v45 = (char *)(v112 + 8LL * v42);
v119 = a5;
do
{
v88 = *(_DWORD *)(v122 + 4LL * *v43);
if ( v88 )
{
v89 = v112 + 8LL * v88;
v84 = (int *)(v89 + 32);
v90 = *(_DWORD *)(v89 + 20);
if ( *(_DWORD *)(v89 + 4 * (v90 + (__int64)v43[1]) + 32) != -1 )
{
if ( v90 > 0 )
{
v91 = v89 + 4LL * (unsigned int)(v90 - 1) + 36;
do
{
v85 = *v84;
if ( *v84 >= 0 )
{
v86 = (_DWORD *)(v19 + 4LL * v85);
if ( *v86 != v40 && *(int *)(v38 + 4LL * v85) < 0 )
{
if ( *a9 >= v23 )
return 4294967285LL;
*v86 = v40;
v87 = (*a9)++;
*(_DWORD *)(a10 + 4LL * v87) = v85;
}
}
++v84;
}
while ( v84 != (int *)v91 );
}
*(_QWORD *)v45 = *(_QWORD *)v43;
v45 += 8;
}
}
v43 += 2;
}
while ( v44 > v43 );
v16 = a2;
a5 = v119;
v17 = a8;
}
*(_DWORD *)(v121 + 4LL * *v17) = (v45 - v114) >> 3;
}
++*((_DWORD *)v16 + 41);
LABEL_153:
v103 = v17[1];
result = 0LL;
if ( v103 == -1 )
return result;
v104 = a5 > 0 && a12[1] == v103;
a15[1] = v104;
result = 0LL;
if ( v104 )
return result;
LABEL_158:
v106 = *((_DWORD *)v16 + 41);
a9[1] = 0;
if ( v23 <= 0 )
return 4294967285LL;
*(_DWORD *)(v19 + 4LL * a14) = v106;
v107 = a9[1];
a9[1] = v107 + 1;
*(_DWORD *)(a11 + 4LL * v107) = a14;
v108 = v17[1];
v109 = *(_DWORD *)(v117 + 4 * v108);
if ( v109 )
{
v110 = v112 + 8LL * v109;
v111 = v110 + 8LL * *(int *)(v121 + 4 * v108);
if ( v110 >= v111 )
{
v96 = (int *)(v112 + 8LL * v109);
}
else
{
v96 = (int *)(v112 + 8LL * v109);
v97 = v96;
v115 = v16;
do
{
v98 = *(_DWORD *)(v122 + 4LL * *v97);
if ( v98 )
{
v99 = v112 + 8LL * v98;
v92 = (int *)(v99 + 32);
v100 = *(_DWORD *)(v99 + 20);
if ( *(_DWORD *)(v99 + 4 * (v100 + (__int64)v97[1]) + 32) != -1 )
{
if ( v100 > 0 )
{
v101 = v99 + 4LL * (unsigned int)(v100 - 1) + 36;
do
{
v93 = *v92;
if ( *v92 >= 0 )
{
v94 = (_DWORD *)(v19 + 4LL * v93);
if ( *v94 != v106 )
{
if ( a9[1] >= v23 )
return 4294967285LL;
*v94 = v106;
v95 = a9[1];
a9[1] = v95 + 1;
*(_DWORD *)(a11 + 4LL * v95) = v93;
}
}
++v92;
}
while ( v92 != (int *)v101 );
}
*(_QWORD *)v96 = *(_QWORD *)v97;
v96 += 2;
}
}
v97 += 2;
}
while ( v111 > (unsigned __int64)v97 );
v16 = v115;
}
*(_DWORD *)(v121 + 4LL * v17[1]) = (__int64)((__int64)v96 - v110) >> 3;
}
++*((_DWORD *)v16 + 41);
result = 0LL;
}
return result;
}

original_code:
int umfdi_row_search
(
    NumericType *Numeric,
    WorkType *Work,
    SymbolicType *Symbolic,
    int cdeg0,
    int cdeg1,
    const int Pattern [ ],
    const int Pos [ ],
    int pivrow [2],
    int rdeg [2],
    int W_i [ ],
    int W_o [ ],
    int prior_pivrow [2],
    const double Wxy [ ],
    int pivcol,
    int freebie [ ]
)
{
    double maxval, toler, toler2, value, pivot [2] ;
    int i, row, deg, col, *Frpos, fnrows, *E, j, ncols, *Cols, *Rows,
 e, f, Wrpflag, *Fcpos, fncols, tpi, max_rdeg, nans_in_col, was_offdiag,
 diag_row, prefer_diagonal, *Wrp, found, *Diagonal_map ;
    Tuple *tp, *tpend, *tp1, *tp2 ;
    Unit *Memory, *p ;
    Element *ep ;
    int *Row_tuples, *Row_degree, *Row_tlen ;
    pivot [0] = 0. ;
    pivot [1] = 0. ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Row_tlen = Numeric->Uilen ;
    Wrp = Work->Wrp ;
    Frpos = Work->Frpos ;
    E = Work->E ;
    Memory = Numeric->Memory ;
    fnrows = Work->fnrows ;
    prefer_diagonal = Symbolic->prefer_diagonal ;
    Diagonal_map = Work->Diagonal_map ;
    if (Diagonal_map)
    {
 diag_row = Diagonal_map [pivcol] ;
 was_offdiag = diag_row < 0 ;
 if (was_offdiag)
 {
     diag_row = (-(diag_row)-2) ;
 }
 ;
    }
    else
    {
 diag_row = (-1) ;
 was_offdiag = (-1) ;
    }
    max_rdeg = Work->fncols_max ;
    maxval = 0.0 ;
    nans_in_col = (0) ;
    for (i = 0 ; i < cdeg1 ; i++)
    {
 { (value) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
 if (((value) != (value)))
 {
     nans_in_col = (1) ;
     maxval = value ;
     break ;
 }
 maxval = (((maxval) > (value)) ? (maxval) : (value)) ;
    }
    toler = Numeric->relpt * maxval ;
    toler2 = Numeric->relpt2 * maxval ;
    toler2 = was_offdiag ? toler : toler2 ;
    ;
    if (((toler) != (toler)) || ((toler2) != (toler2)))
    {
 nans_in_col = (1) ;
    }
    if (!nans_in_col)
    {
 found = (0) ;
 ;
 if (prefer_diagonal)
 {
     ;
     i = Pos [diag_row] ;
     if (i >= 0)
     {
  double a ;
  ;
  ;
  { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
  ;
  ;
  if (((a) != 0.) && a >= toler2)
  {
      ;
      found = (1) ;
      if (Frpos [diag_row] >= 0 && Frpos [diag_row] < fnrows)
      {
   pivrow [0] = diag_row ;
   pivrow [1] = (-1) ;
      }
      else
      {
   pivrow [0] = (-1) ;
   pivrow [1] = diag_row ;
      }
  }
     }
 }
 if (!found)
 {
     if (cdeg0 > 0)
     {
  for (i = 0 ; i < cdeg0 ; i++)
  {
      double a ;
      { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   ;
   ;
   ;
   if (deg < rdeg [0]
          || (deg == rdeg [0] && a > pivot [0])
      )
   {
       pivrow [0] = row ;
       rdeg [0] = deg ;
       pivot [0] = a ;
   }
      }
  }
  for ( ; i < cdeg1 ; i++)
  {
      double a ;
      { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   ;
   ;
   if (deg < rdeg [1]
          || (deg == rdeg [1] && a > pivot [1])
      )
   {
       pivrow [1] = row ;
       rdeg [1] = deg ;
       pivot [1] = a ;
   }
      }
  }
     }
     else
     {
  for (i = 0 ; i < cdeg1 ; i++)
  {
      double a ;
      { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   if (Frpos [row] >= 0 && Frpos [row] < fnrows)
   {
       ;
       if (deg < rdeg [0]
          || (deg == rdeg [0] && a > pivot [0])
          )
       {
    pivrow [0] = row ;
    rdeg [0] = deg ;
    pivot [0] = a ;
       }
   }
   else
   {
       ;
       if (deg < rdeg [1]
          || (deg == rdeg[1] && a > pivot [1])
          )
       {
    pivrow [1] = row ;
    rdeg [1] = deg ;
    pivot [1] = a ;
       }
   }
      }
  }
     }
 }
    }
    if (cdeg1 > 0 && pivrow [0] == (-1) && pivrow [1] == (-1))
    {
 ;
 row = Pattern [0] ;
 deg = Row_degree [row] ;
 if (Frpos [row] >= 0 && Frpos [row] < fnrows)
 {
     ;
     pivrow [0] = row ;
     rdeg [0] = deg ;
 }
 else
 {
     ;
     pivrow [1] = row ;
     rdeg [1] = deg ;
 }
 for (i = 1 ; i < cdeg1 ; i++)
 {
     row = Pattern [i] ;
     deg = Row_degree [row] ;
     if (Frpos [row] >= 0 && Frpos [row] < fnrows)
     {
  ;
  if (deg < rdeg [0] || (deg == rdeg [0] && row == diag_row))
  {
      pivrow [0] = row ;
      rdeg [0] = deg ;
  }
     }
     else
     {
  ;
  if (deg < rdeg [1] || (deg == rdeg [1] && row == diag_row))
  {
      pivrow [1] = row ;
      rdeg [1] = deg ;
  }
     }
 }
    }
    ;
    ;
    if (cdeg1 == 0)
    {
 if (fnrows > 0)
 {
     pivrow [0] = Work->Frows [0] ;
     ;
 }
 else
 {
     int *Front_leftmostdesc, *Front_1strow, *Front_new1strow, row1,
  row2, fleftmost, nfr, n_row, frontid ;
     ;
     Front_leftmostdesc = Symbolic->Front_leftmostdesc ;
     Front_1strow = Symbolic->Front_1strow ;
     Front_new1strow = Work->Front_new1strow ;
     nfr = Symbolic->nfr ;
     n_row = Numeric->n_row ;
     frontid = Work->frontid ;
     ;
     fleftmost = Front_leftmostdesc [frontid] ;
     row1 = Front_new1strow [fleftmost] ;
     row2 = Front_1strow [frontid+1] - 1 ;
     ;
     for (row = row1 ; row <= row2 ; row++)
     {
  ;
  if ((Row_degree [row] >= 0))
  {
      ;
      ;
      pivrow [1] = row ;
      ;
      break ;
  }
     }
     Front_new1strow [fleftmost] = row ;
     if (pivrow [1] == (-1))
     {
  row1 = Front_new1strow [nfr] ;
  row2 = n_row-1 ;
  ;
  for (row = row1 ; row <= row2 ; row++)
  {
      ;
      if ((Row_degree [row] >= 0))
      {
   ;
   ;
   pivrow [1] = row ;
   ;
   break ;
      }
  }
  Front_new1strow [nfr] = row ;
     }
     if (pivrow [1] == (-1))
     {
  ;
  ;
  return ((1)) ;
     }
 }
    }
    if (pivrow [0] != (-1))
    {
 freebie [0] = (pivrow [0] == prior_pivrow [0]) && (cdeg1 > 0) ;
 ;
 if (!freebie [0])
 {
     Fcpos = Work->Fcpos ;
     fncols = Work->fncols ;
     Wrpflag = Work->Wrpflag ;
     rdeg [0] = fncols ;
     ;
     ;
     ;
     if (Fcpos [pivcol] < 0)
     {
  ;
  if (rdeg [0] >= max_rdeg)
  {
      return ((-11)) ;
  }
  Wrp [pivcol] = Wrpflag ;
  W_i [rdeg [0]++] = pivcol ;
     }
     tpi = Row_tuples [pivrow [0]] ;
     if (tpi)
     {
  tp = (Tuple *) (Memory + tpi) ;
  tp1 = tp ;
  tp2 = tp ;
  tpend = tp + Row_tlen [pivrow [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 ;
      ncols = ep->ncols ;
      Rows = Cols + ncols ;
      if (Rows [f] == (-1))
      {
   continue ;
      }
      ;
      for (j = 0 ; j < ncols ; j++)
      {
   col = Cols [j] ;
   ;
   if ((col >= 0) && (Wrp [col] != Wrpflag)
       && Fcpos [col] <0)
   {
       ;
       if (rdeg [0] >= max_rdeg)
       {
    ;
    return ((-11)) ;
       }
       Wrp [col] = Wrpflag ;
       W_i [rdeg [0]++] = col ;
   }
      }
      *tp2++ = *tp ;
  }
  Row_tlen [pivrow [0]] = tp2 - tp1 ;
     }
     Work->Wrpflag++ ;
 }
    }
    if (pivrow [1] != (-1))
    {
 freebie [1] = (pivrow [1] == prior_pivrow [1]) && cdeg1 > 0 ;
 ;
 if (!freebie [1])
 {
     Wrpflag = Work->Wrpflag ;
     rdeg [1] = 0 ;
     ;
     ;
     ;
     ;
     if (rdeg [1] >= max_rdeg)
     {
  return ((-11)) ;
     }
     Wrp [pivcol] = Wrpflag ;
     W_o [rdeg [1]++] = pivcol ;
     tpi = Row_tuples [pivrow [1]] ;
     if (tpi)
     {
  tp = (Tuple *) (Memory + tpi) ;
  tp1 = tp ;
  tp2 = tp ;
  tpend = tp + Row_tlen [pivrow [1]] ;
  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 ;
      ncols = ep->ncols ;
      Rows = Cols + ncols ;
      if (Rows [f] == (-1))
      {
   continue ;
      }
      ;
      for (j = 0 ; j < ncols ; j++)
      {
   col = Cols [j] ;
   ;
   if ((col >= 0) && (Wrp [col] != Wrpflag))
   {
       ;
       if (rdeg [1] >= max_rdeg)
       {
    ;
    return ((-11)) ;
       }
       Wrp [col] = Wrpflag ;
       W_o [rdeg [1]++] = col ;
   }
      }
      *tp2++ = *tp ;
  }
  Row_tlen [pivrow [1]] = tp2 - tp1 ;
     }
     Work->Wrpflag++ ;
 }
    }
    ;
    return ((0)) ;
}

canonical_original_code:
int umfdi_row_search(struct NumericType *Numeric, struct WorkType *Work, struct SymbolicType *Symbolic, int cdeg0, int cdeg1, int Pattern[], int Pos[], int pivrow[2], int rdeg[2], int W_i[], int W_o[], int prior_pivrow[2], double Wxy[], int pivcol, int freebie[])
{
    double maxval; double toler; double toler2; double value; double pivot[2];
    int i; int row; int deg; int col; int *Frpos; int fnrows; int *E; int j; int ncols; int *Cols; int *Rows; int e; int f; int Wrpflag; int *Fcpos; int fncols; int tpi; int max_rdeg; int nans_in_col; int was_offdiag; int diag_row; int prefer_diagonal; int *Wrp; int found; int *Diagonal_map;
    struct Tuple *tp; struct Tuple *tpend; struct Tuple *tp1; struct Tuple *tp2;
    union Unit_union *Memory; union Unit_union *p;
    struct Element *ep;
    int *Row_tuples; int *Row_degree; int *Row_tlen;
    pivot [0] = 0. ;
    pivot [1] = 0. ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Row_tlen = Numeric->Uilen ;
    Wrp = Work->Wrp ;
    Frpos = Work->Frpos ;
    E = Work->E ;
    Memory = Numeric->Memory ;
    fnrows = Work->fnrows ;
    prefer_diagonal = Symbolic->prefer_diagonal ;
    Diagonal_map = Work->Diagonal_map ;
    if (Diagonal_map)
    {
 diag_row = Diagonal_map [pivcol] ;
 was_offdiag = diag_row < 0 ;
 if (was_offdiag)
 {
     diag_row = (-(diag_row)-2) ;
 }
 ;
    }
    else
    {
 diag_row = (-1) ;
 was_offdiag = (-1) ;
    }
    max_rdeg = Work->fncols_max ;
    maxval = 0.0 ;
    nans_in_col = (0) ;
    for (i = 0 ; i < cdeg1 ; i++)
    {
 { (value) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
 if (((value) != (value)))
 {
     nans_in_col = (1) ;
     maxval = value ;
     break ;
 }
 maxval = (((maxval) > (value)) ? (maxval) : (value)) ;
    }
    toler = Numeric->relpt * maxval ;
    toler2 = Numeric->relpt2 * maxval ;
    toler2 = was_offdiag ? toler : toler2 ;
    ;
    if (((toler) != (toler)) || ((toler2) != (toler2)))
    {
 nans_in_col = (1) ;
    }
    if (!nans_in_col)
    {
 found = (0) ;
 ;
 if (prefer_diagonal)
 {
     ;
     i = Pos [diag_row] ;
     if (i >= 0)
     {
  double a;
  ;
  ;
  { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
  ;
  ;
  if (((a) != 0.) && a >= toler2)
  {
      ;
      found = (1) ;
      if (Frpos [diag_row] >= 0 && Frpos [diag_row] < fnrows)
      {
   pivrow [0] = diag_row ;
   pivrow [1] = (-1) ;
      }
      else
      {
   pivrow [0] = (-1) ;
   pivrow [1] = diag_row ;
      }
  }
     }
 }
 if (!found)
 {
     if (cdeg0 > 0)
     {
  for (i = 0 ; i < cdeg0 ; i++)
  {
      double a;
      { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   ;
   ;
   ;
   if (deg < rdeg [0]
          || (deg == rdeg [0] && a > pivot [0])
      )
   {
       pivrow [0] = row ;
       rdeg [0] = deg ;
       pivot [0] = a ;
   }
      }
  }
  for ( ; i < cdeg1 ; i++)
  {
      double a;
      { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   ;
   ;
   if (deg < rdeg [1]
          || (deg == rdeg [1] && a > pivot [1])
      )
   {
       pivrow [1] = row ;
       rdeg [1] = deg ;
       pivot [1] = a ;
   }
      }
  }
     }
     else
     {
  for (i = 0 ; i < cdeg1 ; i++)
  {
      double a;
      { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   if (Frpos [row] >= 0 && Frpos [row] < fnrows)
   {
       ;
       if (deg < rdeg [0]
          || (deg == rdeg [0] && a > pivot [0])
          )
       {
    pivrow [0] = row ;
    rdeg [0] = deg ;
    pivot [0] = a ;
       }
   }
   else
   {
       ;
       if (deg < rdeg [1]
          || (deg == rdeg[1] && a > pivot [1])
          )
       {
    pivrow [1] = row ;
    rdeg [1] = deg ;
    pivot [1] = a ;
       }
   }
      }
  }
     }
 }
    }
    if (cdeg1 > 0 && pivrow [0] == (-1) && pivrow [1] == (-1))
    {
 ;
 row = Pattern [0] ;
 deg = Row_degree [row] ;
 if (Frpos [row] >= 0 && Frpos [row] < fnrows)
 {
     ;
     pivrow [0] = row ;
     rdeg [0] = deg ;
 }
 else
 {
     ;
     pivrow [1] = row ;
     rdeg [1] = deg ;
 }
 for (i = 1 ; i < cdeg1 ; i++)
 {
     row = Pattern [i] ;
     deg = Row_degree [row] ;
     if (Frpos [row] >= 0 && Frpos [row] < fnrows)
     {
  ;
  if (deg < rdeg [0] || (deg == rdeg [0] && row == diag_row))
  {
      pivrow [0] = row ;
      rdeg [0] = deg ;
  }
     }
     else
     {
  ;
  if (deg < rdeg [1] || (deg == rdeg [1] && row == diag_row))
  {
      pivrow [1] = row ;
      rdeg [1] = deg ;
  }
     }
 }
    }
    ;
    ;
    if (cdeg1 == 0)
    {
 if (fnrows > 0)
 {
     pivrow [0] = Work->Frows [0] ;
     ;
 }
 else
 {
     int *Front_leftmostdesc; int *Front_1strow; int *Front_new1strow; int row1; int row2; int fleftmost; int nfr; int n_row; int frontid;
     ;
     Front_leftmostdesc = Symbolic->Front_leftmostdesc ;
     Front_1strow = Symbolic->Front_1strow ;
     Front_new1strow = Work->Front_new1strow ;
     nfr = Symbolic->nfr ;
     n_row = Numeric->n_row ;
     frontid = Work->frontid ;
     ;
     fleftmost = Front_leftmostdesc [frontid] ;
     row1 = Front_new1strow [fleftmost] ;
     row2 = Front_1strow [frontid+1] - 1 ;
     ;
     for (row = row1 ; row <= row2 ; row++)
     {
  ;
  if ((Row_degree [row] >= 0))
  {
      ;
      ;
      pivrow [1] = row ;
      ;
      break ;
  }
     }
     Front_new1strow [fleftmost] = row ;
     if (pivrow [1] == (-1))
     {
  row1 = Front_new1strow [nfr] ;
  row2 = n_row-1 ;
  ;
  for (row = row1 ; row <= row2 ; row++)
  {
      ;
      if ((Row_degree [row] >= 0))
      {
   ;
   ;
   pivrow [1] = row ;
   ;
   break ;
      }
  }
  Front_new1strow [nfr] = row ;
     }
     if (pivrow [1] == (-1))
     {
  ;
  ;
  return ((1)) ;
     }
 }
    }
    if (pivrow [0] != (-1))
    {
 freebie [0] = (pivrow [0] == prior_pivrow [0]) && (cdeg1 > 0) ;
 ;
 if (!freebie [0])
 {
     Fcpos = Work->Fcpos ;
     fncols = Work->fncols ;
     Wrpflag = Work->Wrpflag ;
     rdeg [0] = fncols ;
     ;
     ;
     ;
     if (Fcpos [pivcol] < 0)
     {
  ;
  if (rdeg [0] >= max_rdeg)
  {
      return ((-11)) ;
  }
  Wrp [pivcol] = Wrpflag ;
  W_i [rdeg [0]++] = pivcol ;
     }
     tpi = Row_tuples [pivrow [0]] ;
     if (tpi)
     {
  tp = (struct Tuple *) (Memory + tpi) ;
  tp1 = tp ;
  tp2 = tp ;
  tpend = tp + Row_tlen [pivrow [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 ;
      ncols = ep->ncols ;
      Rows = Cols + ncols ;
      if (Rows [f] == (-1))
      {
   continue ;
      }
      ;
      for (j = 0 ; j < ncols ; j++)
      {
   col = Cols [j] ;
   ;
   if ((col >= 0) && (Wrp [col] != Wrpflag)
       && Fcpos [col] <0)
   {
       ;
       if (rdeg [0] >= max_rdeg)
       {
    ;
    return ((-11)) ;
       }
       Wrp [col] = Wrpflag ;
       W_i [rdeg [0]++] = col ;
   }
      }
      *tp2++ = *tp ;
  }
  Row_tlen [pivrow [0]] = tp2 - tp1 ;
     }
     Work->Wrpflag++ ;
 }
    }
    if (pivrow [1] != (-1))
    {
 freebie [1] = (pivrow [1] == prior_pivrow [1]) && cdeg1 > 0 ;
 ;
 if (!freebie [1])
 {
     Wrpflag = Work->Wrpflag ;
     rdeg [1] = 0 ;
     ;
     ;
     ;
     ;
     if (rdeg [1] >= max_rdeg)
     {
  return ((-11)) ;
     }
     Wrp [pivcol] = Wrpflag ;
     W_o [rdeg [1]++] = pivcol ;
     tpi = Row_tuples [pivrow [1]] ;
     if (tpi)
     {
  tp = (struct Tuple *) (Memory + tpi) ;
  tp1 = tp ;
  tp2 = tp ;
  tpend = tp + Row_tlen [pivrow [1]] ;
  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 ;
      ncols = ep->ncols ;
      Rows = Cols + ncols ;
      if (Rows [f] == (-1))
      {
   continue ;
      }
      ;
      for (j = 0 ; j < ncols ; j++)
      {
   col = Cols [j] ;
   ;
   if ((col >= 0) && (Wrp [col] != Wrpflag))
   {
       ;
       if (rdeg [1] >= max_rdeg)
       {
    ;
    return ((-11)) ;
       }
       Wrp [col] = Wrpflag ;
       W_o [rdeg [1]++] = col ;
   }
      }
      *tp2++ = *tp ;
  }
  Row_tlen [pivrow [1]] = tp2 - tp1 ;
     }
     Work->Wrpflag++ ;
 }
    }
    ;
    return ((0)) ;
}

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

variable_types:
Pattern
int []

variable_types:
Pos
int []

variable_types:
pivrow
int [2]

variable_types:
rdeg
int [2]

variable_types:
Wxy
double []

variable_types: pivcol int

variable_types:
freebie
int []

variable_types: maxval double

variable_types: toler double

variable_types: value double

variable_types:
pivot
double [2]

variable_types: i int

variable_types: row int

variable_types: deg int

variable_types: col int

variable_types:
Frpos
int *

variable_types: fnrows int

variable_types:
E
int *

variable_types: ncols int

variable_types:
Cols
int *

variable_types:
Rows
int *

variable_types: e int

variable_types: f int

variable_types: Wrpflag int

variable_types:
Fcpos
int *

variable_types: fncols int

variable_types: tpi int

variable_types:
Wrp
int *

variable_types: found int

variable_types:
tp
struct Tuple { int e; } *

variable_types:
tpend
struct Tuple { int e; } *

variable_types:
ep
struct Element { int cdeg; } *

variable_types: a double

variable_types: fleftmost int

variable_types: nfr int

variable_types: frontid int


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

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

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