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

if ( !a1 )
return 0LL;
result = 0LL;
if ( a1[12] == 129987754LL && (__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] == 129987754LL && (__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 umfzl_valid_numeric
(
    NumericType *Numeric
)
{
    if (!Numeric)
    {
 return ((0)) ;
    }
    if (Numeric->valid != 129987754)
    {
 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 umfzl_valid_numeric(struct NumericType *Numeric)
{
    if (!Numeric)
    {
 return ((0)) ;
    }
    if (Numeric->valid != 129987754)
    {
 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; long scale; long valid; union Unit_union { struct { long size; } header; double xxxxxx; } *Memory; long ihead; long *Rperm; long ulen; struct DoubleComplex { double component[2]; } *D; long do_recip; double *Rs; long n_row; long tail_usage; long maxnrows; } *

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


original_code:
int umfpack_zi_get_symbolic
(
    int *p_n_row,
    int *p_n_col,
    int *p_n1,
    int *p_nz,
    int *p_nfr,
    int *p_nchains,
    int P [ ],
    int Q [ ],
    int Front_npivcol [ ],
    int Front_parent [ ],
    int Front_1strow [ ],
    int Front_leftmostdesc [ ],
    int Chain_start [ ],
    int Chain_maxrows [ ],
    int Chain_maxcols [ ],
    void *SymbolicHandle
)
{
    SymbolicType *Symbolic ;
    int k, n_row, n_col, n1, nfr, nchains, *p ;
    Symbolic = (SymbolicType *) SymbolicHandle ;
    if (!umfzi_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 != (int *) ((void *)0))
    {
 int *Rperm_init, *Diagonal_map ;
 Rperm_init = Symbolic->Rperm_init ;
 Diagonal_map = Symbolic->Diagonal_map ;
 if (Diagonal_map != (int *) ((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 != (int *) ((void *)0))
    {
 p = Symbolic->Cperm_init ;
 for (k = 0 ; k < n_col ; k++)
 {
     Q [k] = p [k] ;
 }
    }
    if (Front_npivcol != (int *) ((void *)0))
    {
 p = Symbolic->Front_npivcol ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_npivcol [k] = p [k] ;
 }
    }
    if (Front_parent != (int *) ((void *)0))
    {
 p = Symbolic->Front_parent ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_parent [k] = p [k] ;
 }
    }
    if (Front_1strow != (int *) ((void *)0))
    {
 p = Symbolic->Front_1strow ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_1strow [k] = p [k] ;
 }
    }
    if (Front_leftmostdesc != (int *) ((void *)0))
    {
 p = Symbolic->Front_leftmostdesc ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_leftmostdesc [k] = p [k] ;
 }
    }
    if (Chain_start != (int *) ((void *)0))
    {
 p = Symbolic->Chain_start ;
 for (k = 0 ; k <= nchains ; k++)
 {
     Chain_start [k] = p [k] ;
 }
    }
    if (Chain_maxrows != (int *) ((void *)0))
    {
 p = Symbolic->Chain_maxrows ;
 for (k = 0 ; k < nchains ; k++)
 {
     Chain_maxrows [k] = p [k] ;
 }
 Chain_maxrows [nchains] = 0 ;
    }
    if (Chain_maxcols != (int *) ((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:
int umfpack_zi_get_symbolic(int *p_n_row, int *p_n_col, int *p_n1, int *p_nz, int *p_nfr, int *p_nchains, int P[], int Q[], int Front_npivcol[], int Front_parent[], int Front_1strow[], int Front_leftmostdesc[], int Chain_start[], int Chain_maxrows[], int Chain_maxcols[], void *SymbolicHandle)
{
    struct SymbolicType *Symbolic;
    int k; int n_row; int n_col; int n1; int nfr; int nchains; int *p;
    Symbolic = (struct SymbolicType *) SymbolicHandle ;
    if (!umfzi_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 != (int *) ((void *)0))
    {
 int *Rperm_init; int *Diagonal_map;
 Rperm_init = Symbolic->Rperm_init ;
 Diagonal_map = Symbolic->Diagonal_map ;
 if (Diagonal_map != (int *) ((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 != (int *) ((void *)0))
    {
 p = Symbolic->Cperm_init ;
 for (k = 0 ; k < n_col ; k++)
 {
     Q [k] = p [k] ;
 }
    }
    if (Front_npivcol != (int *) ((void *)0))
    {
 p = Symbolic->Front_npivcol ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_npivcol [k] = p [k] ;
 }
    }
    if (Front_parent != (int *) ((void *)0))
    {
 p = Symbolic->Front_parent ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_parent [k] = p [k] ;
 }
    }
    if (Front_1strow != (int *) ((void *)0))
    {
 p = Symbolic->Front_1strow ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_1strow [k] = p [k] ;
 }
    }
    if (Front_leftmostdesc != (int *) ((void *)0))
    {
 p = Symbolic->Front_leftmostdesc ;
 for (k = 0 ; k <= nfr ; k++)
 {
     Front_leftmostdesc [k] = p [k] ;
 }
    }
    if (Chain_start != (int *) ((void *)0))
    {
 p = Symbolic->Chain_start ;
 for (k = 0 ; k <= nchains ; k++)
 {
     Chain_start [k] = p [k] ;
 }
    }
    if (Chain_maxrows != (int *) ((void *)0))
    {
 p = Symbolic->Chain_maxrows ;
 for (k = 0 ; k < nchains ; k++)
 {
     Chain_maxrows [k] = p [k] ;
 }
 Chain_maxrows [nchains] = 0 ;
    }
    if (Chain_maxcols != (int *) ((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
int []

variable_types:
Q
int []

variable_types:
SymbolicHandle
void *

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

variable_types: k int

variable_types: nfr int

variable_types: nchains int

variable_types:
p
int *

return_type: int


original_code:
double umfzi_symbolic_usage
(
    int n_row,
    int n_col,
    int nchains,
    int nfr,
    int esize,
    int prefer_diagonal
)
{
    double units ;
    units =
 (ceil ((sizeof (SymbolicType) * ((double) 1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (int) * ((double) n_col+1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (int) * ((double) n_row+1)) / sizeof (Unit)))
 + 3 * (ceil ((sizeof (int) * ((double) nchains+1)) / sizeof (Unit)))
 + 4 * (ceil ((sizeof (int) * ((double) nfr+1)) / sizeof (Unit))) ;
    units += (ceil ((sizeof (int) * ((double) esize)) / sizeof (Unit))) ;
    if (prefer_diagonal)
    {
 units += (ceil ((sizeof (int) * ((double) n_col+1)) / sizeof (Unit))) ;
    }
    return (units) ;
}

canonical_original_code:
double umfzi_symbolic_usage(int n_row, int n_col, int nchains, int nfr, int esize, int prefer_diagonal)
{
    double units;
    units =
 (ceil ((sizeof (SymbolicType) * ((double) 1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (int) * ((double) n_col+1)) / sizeof (Unit)))
 + 2 * (ceil ((sizeof (int) * ((double) n_row+1)) / sizeof (Unit)))
 + 3 * (ceil ((sizeof (int) * ((double) nchains+1)) / sizeof (Unit)))
 + 4 * (ceil ((sizeof (int) * ((double) nfr+1)) / sizeof (Unit))) ;
    units += (ceil ((sizeof (int) * ((double) esize)) / sizeof (Unit))) ;
    if (prefer_diagonal)
    {
 units += (ceil ((sizeof (int) * ((double) n_col+1)) / sizeof (Unit))) ;
    }
    return (units) ;
}

variable_types: esize int

variable_types: units double

return_type: double


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

if ( !a1 )
return 0LL;
result = 0LL;
if ( a1[7] == 110291734LL )
{
if ( a1[19] )
{
if ( a1[20] )
{
if ( a1[15] )
{
if ( a1[16] )
{
if ( a1[17] )
{
if ( a1[18] )
{
if ( a1[10] )
{
if ( a1[11] )
{
if ( a1[12] )
{
if ( (__int64)a1[30] > 0 )
result = a1[31] > 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[7] == 110291734LL )
{
if ( a1[19] )
{
if ( a1[20] )
{
if ( a1[15] )
{
if ( a1[16] )
{
if ( a1[17] )
{
if ( a1[18] )
{
if ( a1[10] )
{
if ( a1[11] )
{
if ( a1[12] )
{
if ( (__int64)a1[30] > 0 )
result = a1[31] > 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 umfzl_valid_symbolic
(
    SymbolicType *Symbolic
)
{
    if (!Symbolic)
    {
 return ((0)) ;
    }
    if (Symbolic->valid != 110291734)
    {
 return ((0)) ;
    }
    if (!Symbolic->Cperm_init || !Symbolic->Rperm_init ||
 !Symbolic->Front_npivcol || !Symbolic->Front_1strow ||
 !Symbolic->Front_leftmostdesc ||
 !Symbolic->Front_parent || !Symbolic->Chain_start ||
 !Symbolic->Chain_maxrows || !Symbolic->Chain_maxcols ||
 Symbolic->n_row <= 0 || Symbolic->n_col <= 0)
    {
 return ((0)) ;
    }
    return ((1)) ;
}

canonical_original_code:
long umfzl_valid_symbolic(struct SymbolicType *Symbolic)
{
    if (!Symbolic)
    {
 return ((0)) ;
    }
    if (Symbolic->valid != 110291734)
    {
 return ((0)) ;
    }
    if (!Symbolic->Cperm_init || !Symbolic->Rperm_init ||
 !Symbolic->Front_npivcol || !Symbolic->Front_1strow ||
 !Symbolic->Front_leftmostdesc ||
 !Symbolic->Front_parent || !Symbolic->Chain_start ||
 !Symbolic->Chain_maxrows || !Symbolic->Chain_maxcols ||
 Symbolic->n_row <= 0 || Symbolic->n_col <= 0)
    {
 return ((0)) ;
    }
    return ((1)) ;
}

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

return_type: long


decompiled_code:
__int64 __fastcall umfzi_report_vector(int a1, __int64 a2, __int64 a3, int a4, int a5, int a6, double a7, double a8)
{
unsigned int i; // ebx
__int64 result; // rax
int v14; // er15
signed int v15; // ebx
bool v16; // [rsp+Fh] [rbp-39h]

v16 = a4 > 3 || a5 != 0;
if ( !v16 )
goto LABEL_10;
if ( amd_printf )
amd_printf("dense vector, n = %d. ", (unsigned int)a1);
if ( !a5 )
{
LABEL_8:
if ( amd_printf )
amd_printf("\n");
LABEL_10:
if ( a4 == 4 )
{
v14 = 10;
if ( a1 <= 10 )
v14 = a1;
if ( a1 > 0 )
{
v15 = 0;
do
print_value(v15++, a2, a3, a6, a7, a8);
while ( v14 > v15 );
}
if ( a1 > v14 )
{
if ( amd_printf )
a7 = amd_printf(" ...\n");
print_value(a1 - 1, a2, a3, a6, a7, a8);
}
}
else
{
if ( a4 > 4 && a1 > 0 )
{
for ( i = 0; i != a1; ++i )
print_value(i, a2, a3, a6, a7, a8);
}
if ( a4 <= 3 )
{
if ( !v16 )
return 0LL;
LABEL_34:
if ( amd_printf )
amd_printf("OK\n\n");
return 0LL;
}
}
result = 0LL;
if ( !amd_printf )
return result;
amd_printf(" dense vector ");
goto LABEL_34;
}
if ( a2 )
{
if ( a1 >= 0 )
{
if ( a4 <= 3 )
goto LABEL_10;
goto LABEL_8;
}
result = 4294967290LL;
if ( amd_printf )
{
amd_printf("ERROR: length of vector is < 0\n\n");
result = 4294967290LL;
}
}
else
{
result = 4294967291LL;
if ( amd_printf )
{
amd_printf("ERROR: vector not present\n\n");
result = 4294967291LL;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, __int64 a2, __int64 a3, int a4, int a5, int a6, double a7, double a8)
{
unsigned int i; // ebx
__int64 result; // rax
int v14; // er15
signed int v15; // ebx
bool v16; // [rsp+Fh] [rbp-39h]

v16 = a4 > 3 || a5 != 0;
if ( !v16 )
goto LABEL_10;
if ( amd_printf )
amd_printf("dense vector, n = %d. ", (unsigned int)a1);
if ( !a5 )
{
LABEL_8:
if ( amd_printf )
amd_printf("\n");
LABEL_10:
if ( a4 == 4 )
{
v14 = 10;
if ( a1 <= 10 )
v14 = a1;
if ( a1 > 0 )
{
v15 = 0;
do
print_value(v15++, a2, a3, a6, a7, a8);
while ( v14 > v15 );
}
if ( a1 > v14 )
{
if ( amd_printf )
a7 = amd_printf(" ...\n");
print_value(a1 - 1, a2, a3, a6, a7, a8);
}
}
else
{
if ( a4 > 4 && a1 > 0 )
{
for ( i = 0; i != a1; ++i )
print_value(i, a2, a3, a6, a7, a8);
}
if ( a4 <= 3 )
{
if ( !v16 )
return 0LL;
LABEL_34:
if ( amd_printf )
amd_printf("OK\n\n");
return 0LL;
}
}
result = 0LL;
if ( !amd_printf )
return result;
amd_printf(" dense vector ");
goto LABEL_34;
}
if ( a2 )
{
if ( a1 >= 0 )
{
if ( a4 <= 3 )
goto LABEL_10;
goto LABEL_8;
}
result = 4294967290LL;
if ( amd_printf )
{
amd_printf("ERROR: length of vector is < 0\n\n");
result = 4294967290LL;
}
}
else
{
result = 4294967291LL;
if ( amd_printf )
{
amd_printf("ERROR: vector not present\n\n");
result = 4294967291LL;
}
}
return result;
}

original_code:
int umfzi_report_vector
(
    int n,
    const double Xx [ ],
    const double Xz [ ],
    int prl,
    int user,
    int scalar
)
{
    int n2, i ;
    if (user || prl >= 4)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("dense vector, n = ""%d"". ", n) ; } ;
    }
    if (user)
    {
 if (!Xx)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: vector not present\n\n") ; } ;
     return ((-5)) ;
 }
 if (n < 0)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: length of vector is < 0\n\n") ; } ;
     return ((-6)) ;
 }
    }
    if (user || prl >= 4)
    {
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    }
    if (prl == 4)
    {
 n2 = (((10) < (n)) ? (10) : (n)) ;
 for (i = 0 ; i < n2 ; i++)
 {
     print_value (i, Xx, Xz, scalar) ;
 }
 if (n2 < n)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("    ...\n") ; } ;
     print_value (n-1, Xx, Xz, scalar) ;
 }
    }
    else if (prl > 4)
    {
 for (i = 0 ; i < n ; i++)
 {
     print_value (i, Xx, Xz, scalar) ;
 }
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    dense vector ") ; } ; } } ;
    if (user || prl >= 4)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    }
    return ((0)) ;
}

canonical_original_code:
int umfzi_report_vector(int n, double Xx[], double Xz[], int prl, int user, int scalar)
{
    int n2; int i;
    if (user || prl >= 4)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("dense vector, n = ""%d"". ", n) ; } ;
    }
    if (user)
    {
 if (!Xx)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: vector not present\n\n") ; } ;
     return ((-5)) ;
 }
 if (n < 0)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: length of vector is < 0\n\n") ; } ;
     return ((-6)) ;
 }
    }
    if (user || prl >= 4)
    {
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    }
    if (prl == 4)
    {
 n2 = (((10) < (n)) ? (10) : (n)) ;
 for (i = 0 ; i < n2 ; i++)
 {
     print_value (i, Xx, Xz, scalar) ;
 }
 if (n2 < n)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("    ...\n") ; } ;
     print_value (n-1, Xx, Xz, scalar) ;
 }
    }
    else if (prl > 4)
    {
 for (i = 0 ; i < n ; i++)
 {
     print_value (i, Xx, Xz, scalar) ;
 }
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    dense vector ") ; } ; } } ;
    if (user || prl >= 4)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ;
    }
    return ((0)) ;
}

variable_types: n int

variable_types:
Xx
double []

variable_types:
Xz
double []

variable_types: prl int

variable_types: user int

variable_types: scalar int

variable_types: i int


original_code:
int cholmod_etree
(
    cholmod_sparse *A,
    int *Parent,
    cholmod_common *Common
)
{
    int *Ap, *Ai, *Anz, *Ancestor, *Prev, *Iwork ;
    int i, j, jprev, p, pend, nrow, ncol, packed, stype ;
    size_t s ;
    int ok = 1 ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_etree.c", 104, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Parent) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_etree.c", 105, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (0) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_etree.c", 106, "invalid xtype", Common) ; } return (0) ; } } ;
    Common->status = 0 ;
    stype = A->stype ;
    s = cholmod_add_size_t (A->nrow, (stype ? 0 : A->ncol), &ok) ;
    if (!ok)
    {
 cholmod_error ((-3), "../Cholesky/cholmod_etree.c", 119, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_allocate_work (0, s, 0, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    ;
    Iwork = Common->Iwork ;
    ncol = A->ncol ;
    nrow = A->nrow ;
    Ap = A->p ;
    Ai = A->i ;
    Anz = A->nz ;
    packed = A->packed ;
    Ancestor = Iwork ;
    for (j = 0 ; j < ncol ; j++)
    {
 Parent [j] = (-1) ;
 Ancestor [j] = (-1) ;
    }
    if (stype > 0)
    {
 for (j = 0 ; j < ncol ; j++)
 {
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  i = Ai [p] ;
  if (i < j)
  {
      update_etree (i, j, Parent, Ancestor) ;
  }
     }
 }
    }
    else if (stype == 0)
    {
 Prev = Iwork + ncol ;
 for (i = 0 ; i < nrow ; i++)
 {
     Prev [i] = (-1) ;
 }
 for (j = 0 ; j < ncol ; j++)
 {
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  i = Ai [p] ;
  jprev = Prev [i] ;
  if (jprev != (-1))
  {
      update_etree (jprev, j, Parent, Ancestor) ;
  }
  Prev [i] = j ;
     }
 }
    }
    else
    {
 cholmod_error ((-4), "../Cholesky/cholmod_etree.c", 219, "symmetric lower not supported", Common) ;
 return (0) ;
    }
    ;
    return (1) ;
}

canonical_original_code:
int cholmod_etree(struct cholmod_sparse_struct *A, int *Parent, struct cholmod_common_struct *Common)
{
    int *Ap; int *Ai; int *Anz; int *Ancestor; int *Prev; int *Iwork;
    int i; int j; int jprev; int p; int pend; int nrow; int ncol; int packed; int stype;
    unsigned long s;
    int ok = 1;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_etree.c", 104, "argument missing", Common) ; } return (0) ; } } ;
    { if ((Parent) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_etree.c", 105, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (0) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_etree.c", 106, "invalid xtype", Common) ; } return (0) ; } } ;
    Common->status = 0 ;
    stype = A->stype ;
    s = cholmod_add_size_t (A->nrow, (stype ? 0 : A->ncol), &ok) ;
    if (!ok)
    {
 cholmod_error ((-3), "../Cholesky/cholmod_etree.c", 119, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_allocate_work (0, s, 0, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    ;
    Iwork = Common->Iwork ;
    ncol = A->ncol ;
    nrow = A->nrow ;
    Ap = A->p ;
    Ai = A->i ;
    Anz = A->nz ;
    packed = A->packed ;
    Ancestor = Iwork ;
    for (j = 0 ; j < ncol ; j++)
    {
 Parent [j] = (-1) ;
 Ancestor [j] = (-1) ;
    }
    if (stype > 0)
    {
 for (j = 0 ; j < ncol ; j++)
 {
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  i = Ai [p] ;
  if (i < j)
  {
      update_etree (i, j, Parent, Ancestor) ;
  }
     }
 }
    }
    else if (stype == 0)
    {
 Prev = Iwork + ncol ;
 for (i = 0 ; i < nrow ; i++)
 {
     Prev [i] = (-1) ;
 }
 for (j = 0 ; j < ncol ; j++)
 {
     p = Ap [j] ;
     pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
     for ( ; p < pend ; p++)
     {
  i = Ai [p] ;
  jprev = Prev [i] ;
  if (jprev != (-1))
  {
      update_etree (jprev, j, Parent, Ancestor) ;
  }
  Prev [i] = j ;
     }
 }
    }
    else
    {
 cholmod_error ((-4), "../Cholesky/cholmod_etree.c", 219, "symmetric lower not supported", Common) ;
 return (0) ;
    }
    ;
    return (1) ;
}

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

variable_types:
Parent
int *

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

variable_types:
Ap
int *

variable_types:
Ai
int *

variable_types:
Anz
int *

variable_types:
Ancestor
int *

variable_types:
Prev
int *

variable_types:
Iwork
int *

variable_types: j int

variable_types: jprev int

variable_types: p int

variable_types: pend int

variable_types: nrow int

variable_types: ncol int

variable_types: packed int

variable_types: stype int

variable_types:
s
unsigned long

variable_types: ok int

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


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

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

variable_types: sys int

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Ax
double []

variable_types:
Xx
double []

variable_types:
Bx
double []

variable_types:
NumericHandle
void *

variable_types:
Control
double [20]

variable_types:
stats
double [2]

variable_types:
Info
double *

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

variable_types: n int

variable_types: i int

variable_types: irstep int

variable_types: status int

variable_types:
Pattern
int *

variable_types: wsize int

variable_types:
W
double *

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:
int umfdi_triplet_nomap_x
(
    int n_row,
    int n_col,
    int nz,
    const int Ti [ ],
    const int Tj [ ],
    int Ap [ ],
    int Ai [ ],
    int Rp [ ],
    int Rj [ ],
    int W [ ],
    int RowCount [ ]
    , const double Tx [ ]
    , double Ax [ ]
    , double Rx [ ]
)
{
    int i, j, k, p, cp, p1, p2, pdest, pj ;
    for (i = 0 ; i < n_row ; i++)
    {
 W [i] = 0 ;
    }
    for (k = 0 ; k < nz ; k++)
    {
 i = Ti [k] ;
 j = Tj [k] ;
 if (i < 0 || i >= n_row || j < 0 || j >= n_col)
 {
     return ((-8)) ;
 }
 W [i]++ ;
    }
    Rp [0] = 0 ;
    for (i = 0 ; i < n_row ; i++)
    {
 Rp [i+1] = Rp [i] + W [i] ;
 W [i] = Rp [i] ;
    }
    for (k = 0 ; k < nz ; k++)
    {
 p = W [Ti [k]]++ ;
 Rj [p] = Tj [k] ;
 Rx [p] = Tx [k] ;
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = (-1) ;
    }
    for (i = 0 ; i < n_row ; i++)
    {
 p1 = Rp [i] ;
 p2 = Rp [i+1] ;
 pdest = p1 ;
 for (p = p1 ; p < p2 ; p++)
 {
     j = Rj [p] ;
     ;
     pj = W [j] ;
     if (pj >= p1)
     {
  ;
  ;
  Rx [pj] += Rx [p] ;
     }
     else
     {
  W [j] = pdest ;
  if (pdest != p)
  {
      Rj [pdest] = j ;
      Rx [pdest] = Rx [p] ;
  }
  pdest++ ;
     }
 }
 RowCount [i] = pdest - p1 ;
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = 0 ;
    }
    for (i = 0 ; i < n_row ; i++)
    {
 for (p = Rp [i] ; p < Rp [i] + RowCount [i] ; p++)
 {
     j = Rj [p] ;
     ;
     W [j]++ ;
 }
    }
    Ap [0] = 0 ;
    for (j = 0 ; j < n_col ; j++)
    {
 Ap [j+1] = Ap [j] + W [j] ;
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = Ap [j] ;
    }
    for (i = 0 ; i < n_row ; i++)
    {
 for (p = Rp [i] ; p < Rp [i] + RowCount [i] ; p++)
 {
     cp = W [Rj [p]]++ ;
     Ai [cp] = i ;
     Ax [cp] = Rx [p] ;
 }
    }
    return ((0)) ;
}

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

variable_types: nz int

variable_types:
Ti
int []

variable_types:
Tj
int []

variable_types:
Ap
int []

variable_types:
Rp
int []

variable_types:
Rj
int []

variable_types:
W
int []

variable_types:
RowCount
int []

variable_types:
Tx
double []

variable_types:
Rx
double []

variable_types: j int

variable_types: k int

variable_types: p int

variable_types: cp int

variable_types: pdest int

variable_types: pj int


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

if ( !a1 )
return 0LL;
result = 0LL;
if ( a1[7] == 399192713LL )
{
if ( a1[19] )
{
if ( a1[20] )
{
if ( a1[15] )
{
if ( a1[16] )
{
if ( a1[17] )
{
if ( a1[18] )
{
if ( a1[10] )
{
if ( a1[11] )
{
if ( a1[12] )
{
if ( (__int64)a1[30] > 0 )
result = a1[31] > 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[7] == 399192713LL )
{
if ( a1[19] )
{
if ( a1[20] )
{
if ( a1[15] )
{
if ( a1[16] )
{
if ( a1[17] )
{
if ( a1[18] )
{
if ( a1[10] )
{
if ( a1[11] )
{
if ( a1[12] )
{
if ( (__int64)a1[30] > 0 )
result = a1[31] > 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_symbolic
(
    SymbolicType *Symbolic
)
{
    if (!Symbolic)
    {
 return ((0)) ;
    }
    if (Symbolic->valid != 399192713)
    {
 return ((0)) ;
    }
    if (!Symbolic->Cperm_init || !Symbolic->Rperm_init ||
 !Symbolic->Front_npivcol || !Symbolic->Front_1strow ||
 !Symbolic->Front_leftmostdesc ||
 !Symbolic->Front_parent || !Symbolic->Chain_start ||
 !Symbolic->Chain_maxrows || !Symbolic->Chain_maxcols ||
 Symbolic->n_row <= 0 || Symbolic->n_col <= 0)
    {
 return ((0)) ;
    }
    return ((1)) ;
}

canonical_original_code:
long umfdl_valid_symbolic(struct SymbolicType *Symbolic)
{
    if (!Symbolic)
    {
 return ((0)) ;
    }
    if (Symbolic->valid != 399192713)
    {
 return ((0)) ;
    }
    if (!Symbolic->Cperm_init || !Symbolic->Rperm_init ||
 !Symbolic->Front_npivcol || !Symbolic->Front_1strow ||
 !Symbolic->Front_leftmostdesc ||
 !Symbolic->Front_parent || !Symbolic->Chain_start ||
 !Symbolic->Chain_maxrows || !Symbolic->Chain_maxcols ||
 Symbolic->n_row <= 0 || Symbolic->n_col <= 0)
    {
 return ((0)) ;
    }
    return ((1)) ;
}

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


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

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

variable_types: chain long

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

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

variable_types: maxbytes double

variable_types: fsize long

variable_types: maxfrsize long

variable_types: overflow long

variable_types: nb long

variable_types: f long

variable_types: cdeg long

variable_types: col long

variable_types: tpi long

variable_types: e long

variable_types:
E
long *

variable_types:
Cols
long *

variable_types:
tp
struct Tuple { long e; } *

variable_types:
tpend
struct Tuple { long e; } *

variable_types:
ep
struct Element { long cdeg; } *

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


original_code:
size_t amd_aat
(
    int n,
    const int Ap [ ],
    const int Ai [ ],
    int Len [ ],
    int Tp [ ],
    double Info [ ]
)
{
    int p1, p2, p, i, j, pj, pj2, k, nzdiag, nzboth, nz ;
    double sym ;
    size_t nzaat ;
    if (Info != (double *) ((void *)0))
    {
 for (i = 0 ; i < 20 ; i++)
 {
     Info [i] = (-1) ;
 }
 Info [0] = 0 ;
    }
    for (k = 0 ; k < n ; k++)
    {
 Len [k] = 0 ;
    }
    nzdiag = 0 ;
    nzboth = 0 ;
    nz = Ap [n] ;
    for (k = 0 ; k < n ; k++)
    {
 p1 = Ap [k] ;
 p2 = Ap [k+1] ;
 ;
 for (p = p1 ; p < p2 ; )
 {
     j = Ai [p] ;
     if (j < k)
     {
  Len [j]++ ;
  Len [k]++ ;
  ;
  p++ ;
     }
     else if (j == k)
     {
  p++ ;
  nzdiag++ ;
  break ;
     }
     else
     {
  break ;
     }
     ;
     ;
     pj2 = Ap [j+1] ;
     for (pj = Tp [j] ; pj < pj2 ; )
     {
  i = Ai [pj] ;
  if (i < k)
  {
      Len [i]++ ;
      Len [j]++ ;
      ;
      pj++ ;
  }
  else if (i == k)
  {
      pj++ ;
      nzboth++ ;
      break ;
  }
  else
  {
      break ;
  }
     }
     Tp [j] = pj ;
 }
 Tp [k] = p ;
    }
    for (j = 0 ; j < n ; j++)
    {
 for (pj = Tp [j] ; pj < Ap [j+1] ; pj++)
 {
     i = Ai [pj] ;
     Len [i]++ ;
     Len [j]++ ;
     ;
 }
    }
    if (nz == nzdiag)
    {
 sym = 1 ;
    }
    else
    {
 sym = (2 * (double) nzboth) / ((double) (nz - nzdiag)) ;
    }
    nzaat = 0 ;
    for (k = 0 ; k < n ; k++)
    {
 nzaat += Len [k] ;
    }
    ;
    ;
    if (Info != (double *) ((void *)0))
    {
 Info [0] = 0 ;
 Info [1] = n ;
 Info [2] = nz ;
 Info [3] = sym ;
 Info [4] = nzdiag ;
 Info [5] = nzaat ;
    }
    return (nzaat) ;
}

canonical_original_code:
unsigned long amd_aat(int n, int Ap[], int Ai[], int Len[], int Tp[], double Info[])
{
    int p1; int p2; int p; int i; int j; int pj; int pj2; int k; int nzdiag; int nzboth; int nz;
    double sym;
    unsigned long nzaat;
    if (Info != (double *) ((void *)0))
    {
 for (i = 0 ; i < 20 ; i++)
 {
     Info [i] = (-1) ;
 }
 Info [0] = 0 ;
    }
    for (k = 0 ; k < n ; k++)
    {
 Len [k] = 0 ;
    }
    nzdiag = 0 ;
    nzboth = 0 ;
    nz = Ap [n] ;
    for (k = 0 ; k < n ; k++)
    {
 p1 = Ap [k] ;
 p2 = Ap [k+1] ;
 ;
 for (p = p1 ; p < p2 ; )
 {
     j = Ai [p] ;
     if (j < k)
     {
  Len [j]++ ;
  Len [k]++ ;
  ;
  p++ ;
     }
     else if (j == k)
     {
  p++ ;
  nzdiag++ ;
  break ;
     }
     else
     {
  break ;
     }
     ;
     ;
     pj2 = Ap [j+1] ;
     for (pj = Tp [j] ; pj < pj2 ; )
     {
  i = Ai [pj] ;
  if (i < k)
  {
      Len [i]++ ;
      Len [j]++ ;
      ;
      pj++ ;
  }
  else if (i == k)
  {
      pj++ ;
      nzboth++ ;
      break ;
  }
  else
  {
      break ;
  }
     }
     Tp [j] = pj ;
 }
 Tp [k] = p ;
    }
    for (j = 0 ; j < n ; j++)
    {
 for (pj = Tp [j] ; pj < Ap [j+1] ; pj++)
 {
     i = Ai [pj] ;
     Len [i]++ ;
     Len [j]++ ;
     ;
 }
    }
    if (nz == nzdiag)
    {
 sym = 1 ;
    }
    else
    {
 sym = (2 * (double) nzboth) / ((double) (nz - nzdiag)) ;
    }
    nzaat = 0 ;
    for (k = 0 ; k < n ; k++)
    {
 nzaat += Len [k] ;
    }
    ;
    ;
    if (Info != (double *) ((void *)0))
    {
 Info [0] = 0 ;
 Info [1] = n ;
 Info [2] = nz ;
 Info [3] = sym ;
 Info [4] = nzdiag ;
 Info [5] = nzaat ;
    }
    return (nzaat) ;
}

variable_types: n int

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Len
int []

variable_types:
Tp
int []

variable_types:
Info
double []

variable_types: p int

variable_types: i int

variable_types: j int

variable_types: pj int

variable_types: k int

variable_types: nzdiag int

variable_types: nzboth int

variable_types: nz int

variable_types: sym double

variable_types:
nzaat
unsigned long

return_type: unsigned long


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

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

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

variable_types:
X
struct DoubleComplex []

variable_types:
Pattern
int []

variable_types: deg int

variable_types:
ip
int *

variable_types: col int

variable_types:
Upos
int *

variable_types:
Uilen
int *

variable_types: pos int

variable_types:
Uip
int *

variable_types: ulen int

variable_types: up int

variable_types: newUchain int

variable_types: npiv int

variable_types:
Ui
int *

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


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

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

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

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

variable_types: drnew long

variable_types: dcnew long

variable_types: size long

variable_types: e long

variable_types: nrows long

variable_types: ncols long

variable_types: nrowsleft long

variable_types: ncolsleft long

variable_types: prevsize long

variable_types: csize long

variable_types: i long

variable_types: j long

variable_types: cdeg long

variable_types: rdeg long

variable_types:
E
long *

variable_types: row long

variable_types: col long

variable_types:
Rows
long *

variable_types:
Cols
long *

variable_types: nel long

variable_types:
epsrc
struct Element { long cdeg; } *

variable_types:
epdest
struct Element { long cdeg; } *

variable_types: c long

variable_types: r long

variable_types: k long

variable_types: dr long

variable_types: dc long

variable_types: gap long

variable_types: nb long

variable_types:
Fcols
long *

variable_types:
Fcpos
long *

return_type: void


decompiled_code:
__int64 __fastcall cholmod_l_error(int a1, __int64 a2, unsigned int a3, const char *a4, __int64 a5)
{
__int64 result; // rax
void (*v9)(const char *, ...); // rdx
void (__fastcall *v10)(_QWORD, __int64, _QWORD, const char *); // r8

if ( !a5 )
return 0LL;
if ( *(_QWORD *)(a5 + 2016) == 2LL )
{
*(_DWORD *)(a5 + 2028) = a1;
result = 1LL;
if ( !*(_DWORD *)(a5 + 160) )
{
v9 = *(void (**)(const char *, ...))(a5 + 152);
if ( v9 )
{
if ( a1 <= 0 || *(int *)(a5 + 140) <= 1 )
{
if ( *(int *)(a5 + 140) > 0 )
{
v9("CHOLMOD error: %s\n", a4);
fflush(stdout);
fflush(stderr);
}
}
else
{
v9("CHOLMOD warning: %s\n", a4);
fflush(stdout);
fflush(stderr);
}
}
v10 = *(void (__fastcall **)(_QWORD, __int64, _QWORD, const char *))(a5 + 168);
result = 1LL;
if ( v10 )
{
v10((unsigned int)a1, a2, a3, a4);
result = 1LL;
}
}
}
else
{
*(_DWORD *)(a5 + 2028) = -4;
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, __int64 a2, unsigned int a3, const char *a4, __int64 a5)
{
__int64 result; // rax
void (*v9)(const char *, ...); // rdx
void (__fastcall *v10)(_QWORD, __int64, _QWORD, const char *); // r8

if ( !a5 )
return 0LL;
if ( *(_QWORD *)(a5 + 2016) == 2LL )
{
*(_DWORD *)(a5 + 2028) = a1;
result = 1LL;
if ( !*(_DWORD *)(a5 + 160) )
{
v9 = *(void (**)(const char *, ...))(a5 + 152);
if ( v9 )
{
if ( a1 <= 0 || *(int *)(a5 + 140) <= 1 )
{
if ( *(int *)(a5 + 140) > 0 )
{
v9("CHOLMOD error: %s\n", a4);
fflush(stdout);
fflush(stderr);
}
}
else
{
v9("CHOLMOD warning: %s\n", a4);
fflush(stdout);
fflush(stderr);
}
}
v10 = *(void (__fastcall **)(_QWORD, __int64, _QWORD, const char *))(a5 + 168);
result = 1LL;
if ( v10 )
{
v10((unsigned int)a1, a2, a3, a4);
result = 1LL;
}
}
}
else
{
*(_DWORD *)(a5 + 2028) = -4;
result = 0LL;
}
return result;
}

original_code:
int cholmod_l_error
(
    int status,
    const char *file,
    int line,
    const char *message,
    cholmod_common *Common
)
{
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->status = status ;
    if (!(Common->try_catch))
    {
 if (Common->print_function != ((void *)0))
 {
     if (status > 0 && Common->print > 1)
     {
  (Common->print_function) ("CHOLMOD warning: %s\n", message) ;
  fflush (stdout) ;
  fflush (stderr) ;
     }
     else if (Common->print > 0)
     {
  (Common->print_function) ("CHOLMOD error: %s\n", message) ;
  fflush (stdout) ;
  fflush (stderr) ;
     }
 }
 if (Common->error_handler != ((void *)0))
 {
     Common->error_handler (status, file, line, message) ;
 }
    }
    return (1) ;
}

canonical_original_code:
int cholmod_l_error(int status, char *file, int line, char *message, struct cholmod_common_struct *Common)
{
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->status = status ;
    if (!(Common->try_catch))
    {
 if (Common->print_function != ((void *)0))
 {
     if (status > 0 && Common->print > 1)
     {
  (Common->print_function) ("CHOLMOD warning: %s\n", message) ;
  fflush (stdout) ;
  fflush (stderr) ;
     }
     else if (Common->print > 0)
     {
  (Common->print_function) ("CHOLMOD error: %s\n", message) ;
  fflush (stdout) ;
  fflush (stderr) ;
     }
 }
 if (Common->error_handler != ((void *)0))
 {
     Common->error_handler (status, file, line, message) ;
 }
    }
    return (1) ;
}

variable_types: status int

variable_types:
file
char *

variable_types: line int

variable_types:
message
char *

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


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

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

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

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

variable_types: needunits long

variable_types: nsize double

variable_types: bsize double

variable_types: tsize double

variable_types: i long

variable_types: minsize long

variable_types: newsize long

variable_types: newmem long

variable_types: costly long

variable_types: row long

variable_types: col long

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

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

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

variable_types:
X
struct DoubleComplex []

variable_types:
Pattern
int []

variable_types: k int

variable_types: deg int

variable_types:
ip
int *

variable_types: j int

variable_types: row int

variable_types:
Lpos
int *

variable_types:
Lilen
int *

variable_types: kstart int

variable_types: kend int

variable_types:
Lip
int *

variable_types: llen int

variable_types: lp int

variable_types: pos int

variable_types: npiv int

variable_types:
Li
int *


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

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

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

variable_types: e int

variable_types: nrows int

variable_types: ncols int

variable_types: nel int

variable_types: i int

variable_types:
Rows
int *

variable_types:
Cols
int *

variable_types: col int

variable_types:
E
int *

variable_types: usage int

variable_types:
ep
struct Element { int cdeg; } *