decompiled_code:
__int64 __fastcall cholmod_malloc(unsigned __int64 a1, unsigned __int64 a2, __int64 a3)
{
bool v5; // zf
unsigned __int64 v6; // rdi
__int64 v7; // rdi
__int64 result; // rax
unsigned __int64 v9; // rbp
int v10[7]; // [rsp+Ch] [rbp-1Ch] BYREF

v10[0] = 1;
if ( !a3 )
return 0LL;
if ( *(_QWORD *)(a3 + 2016) )
{
*(_DWORD *)(a3 + 2028) = -4;
result = 0LL;
}
else if ( a2 )
{
if ( 0xFFFFFFFFFFFFFFFFLL / a2 <= a1 || a1 > 0x7FFFFFFE )
{
cholmod_error(4294967293LL, "../Core/cholmod_memory.c", 136LL, "problem too large", a3);
result = 0LL;
}
else
{
v5 = a1 == 0;
v6 = 1LL;
if ( !v5 )
v6 = a1;
v7 = cholmod_mult_size_t(v6, a2, v10);
if ( v10[0] && (result = (*(__int64 (__fastcall **)(__int64))(a3 + 1880))(v7)) != 0 )
{
v9 = *(_QWORD *)(a3 + 2080) + a1 * a2;
++*(_QWORD *)(a3 + 2064);
*(_QWORD *)(a3 + 2080) = v9;
if ( *(_QWORD *)(a3 + 2072) >= v9 )
v9 = *(_QWORD *)(a3 + 2072);
*(_QWORD *)(a3 + 2072) = v9;
}
else
{
cholmod_error(4294967294LL, "../Core/cholmod_memory.c", 147LL, "out of memory", a3);
result = 0LL;
}
}
}
else
{
cholmod_error(4294967292LL, "../Core/cholmod_memory.c", 130LL, "sizeof(item) must be > 0", a3);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(unsigned __int64 a1, unsigned __int64 a2, __int64 a3)
{
bool v5; // zf
unsigned __int64 v6; // rdi
__int64 v7; // rdi
__int64 result; // rax
unsigned __int64 v9; // rbp
int v10[7]; // [rsp+Ch] [rbp-1Ch] BYREF

v10[0] = 1;
if ( !a3 )
return 0LL;
if ( *(_QWORD *)(a3 + 2016) )
{
*(_DWORD *)(a3 + 2028) = -4;
result = 0LL;
}
else if ( a2 )
{
if ( 0xFFFFFFFFFFFFFFFFLL / a2 <= a1 || a1 > 0x7FFFFFFE )
{
cholmod_error(4294967293LL, "../Core/cholmod_memory.c", 136LL, "problem too large", a3);
result = 0LL;
}
else
{
v5 = a1 == 0;
v6 = 1LL;
if ( !v5 )
v6 = a1;
v7 = func1(v6, a2, v10);
if ( v10[0] && (result = (*(__int64 (__fastcall **)(__int64))(a3 + 1880))(v7)) != 0 )
{
v9 = *(_QWORD *)(a3 + 2080) + a1 * a2;
++*(_QWORD *)(a3 + 2064);
*(_QWORD *)(a3 + 2080) = v9;
if ( *(_QWORD *)(a3 + 2072) >= v9 )
v9 = *(_QWORD *)(a3 + 2072);
*(_QWORD *)(a3 + 2072) = v9;
}
else
{
cholmod_error(4294967294LL, "../Core/cholmod_memory.c", 147LL, "out of memory", a3);
result = 0LL;
}
}
}
else
{
cholmod_error(4294967292LL, "../Core/cholmod_memory.c", 130LL, "sizeof(item) must be > 0", a3);
result = 0LL;
}
return result;
}

original_code:
void *cholmod_malloc
(
    size_t n,
    size_t size,
    cholmod_common *Common
)
{
    void *p ;
    size_t s ;
    int ok = 1 ;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (size == 0)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 130, "sizeof(item) must be > 0", Common) ;
 p = ((void *)0) ;
    }
    else if (n >= (((size_t) (-1)) / size) || n >= 0x7fffffff)
    {
 cholmod_error ((-3), "../Core/cholmod_memory.c", 136, "problem too large", Common) ;
 p = ((void *)0) ;
    }
    else
    {
 s = cholmod_mult_size_t ((((1) > (n)) ? (1) : (n)), size, &ok) ;
 p = ok ? ((Common->malloc_memory) (s)) : ((void *)0) ;
 if (p == ((void *)0))
 {
     cholmod_error ((-2), "../Core/cholmod_memory.c", 147, "out of memory", Common) ;
 }
 else
 {
     Common->malloc_count++ ;
     Common->memory_inuse += (n * size) ;
     Common->memory_usage =
  (((Common->memory_usage) > (Common->memory_inuse)) ? (Common->memory_usage) : (Common->memory_inuse)) ;
     ;
 }
    }
    return (p) ;
}

canonical_original_code:
void *cholmod_malloc(unsigned long n, unsigned long size, struct cholmod_common_struct *Common)
{
    void *p;
    unsigned long s;
    int ok = 1;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (size == 0)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 130, "sizeof(item) must be > 0", Common) ;
 p = ((void *)0) ;
    }
    else if (n >= (((unsigned long) (-1)) / size) || n >= 0x7fffffff)
    {
 cholmod_error ((-3), "../Core/cholmod_memory.c", 136, "problem too large", Common) ;
 p = ((void *)0) ;
    }
    else
    {
 s = cholmod_mult_size_t ((((1) > (n)) ? (1) : (n)), size, &ok) ;
 p = ok ? ((Common->malloc_memory) (s)) : ((void *)0) ;
 if (p == ((void *)0))
 {
     cholmod_error ((-2), "../Core/cholmod_memory.c", 147, "out of memory", Common) ;
 }
 else
 {
     Common->malloc_count++ ;
     Common->memory_inuse += (n * size) ;
     Common->memory_usage =
  (((Common->memory_usage) > (Common->memory_inuse)) ? (Common->memory_usage) : (Common->memory_inuse)) ;
     ;
 }
    }
    return (p) ;
}

variable_types:
n
unsigned long

variable_types:
size
unsigned long

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:
p
void *

variable_types: ok int


original_code:
void *cholmod_free
(
    size_t n,
    size_t size,
    void *p,
    cholmod_common *Common
)
{
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (p != ((void *)0))
    {
 (Common->free_memory) (p) ;
 Common->malloc_count-- ;
 Common->memory_inuse -= (n * size) ;
 ;
 ;
    }
    return (((void *)0)) ;
}

canonical_original_code:
void *cholmod_free(unsigned long n, unsigned long size, void *p, struct cholmod_common_struct *Common)
{
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (p != ((void *)0))
    {
 (Common->free_memory) (p) ;
 Common->malloc_count-- ;
 Common->memory_inuse -= (n * size) ;
 ;
 ;
    }
    return (((void *)0)) ;
}

return_type: void *

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

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


decompiled_code:
__int64 __fastcall cholmod_calloc(unsigned __int64 a1, unsigned __int64 a2, __int64 a3)
{
bool v5; // zf
__int64 v6; // rdi
__int64 v7; // r13
unsigned __int64 v8; // rbx
__int64 result; // rax

if ( !a3 )
return 0LL;
if ( *(_QWORD *)(a3 + 2016) )
{
*(_DWORD *)(a3 + 2028) = -4;
result = 0LL;
}
else if ( a2 )
{
if ( 0xFFFFFFFFFFFFFFFFLL / a2 > a1 && a1 <= 0x7FFFFFFE )
{
v5 = a1 == 0;
v6 = 1LL;
if ( !v5 )
v6 = a1;
v7 = (*(__int64 (__fastcall **)(__int64, unsigned __int64, unsigned __int64))(a3 + 1904))(
v6,
a2,
0xFFFFFFFFFFFFFFFFLL % a2);
if ( v7 )
{
v8 = *(_QWORD *)(a3 + 2080) + a1 * a2;
++*(_QWORD *)(a3 + 2064);
*(_QWORD *)(a3 + 2080) = v8;
if ( *(_QWORD *)(a3 + 2072) >= v8 )
v8 = *(_QWORD *)(a3 + 2072);
*(_QWORD *)(a3 + 2072) = v8;
}
else
{
cholmod_error(4294967294LL, "../Core/cholmod_memory.c", 255LL, "out of memory", a3);
}
return v7;
}
cholmod_error(4294967293LL, "../Core/cholmod_memory.c", 245LL, "problem too large", a3);
result = 0LL;
}
else
{
cholmod_error(4294967292LL, "../Core/cholmod_memory.c", 239LL, "sizeof(item) must be > 0", a3);
result = 0LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(unsigned __int64 a1, unsigned __int64 a2, __int64 a3)
{
bool v5; // zf
__int64 v6; // rdi
__int64 v7; // r13
unsigned __int64 v8; // rbx
__int64 result; // rax

if ( !a3 )
return 0LL;
if ( *(_QWORD *)(a3 + 2016) )
{
*(_DWORD *)(a3 + 2028) = -4;
result = 0LL;
}
else if ( a2 )
{
if ( 0xFFFFFFFFFFFFFFFFLL / a2 > a1 && a1 <= 0x7FFFFFFE )
{
v5 = a1 == 0;
v6 = 1LL;
if ( !v5 )
v6 = a1;
v7 = (*(__int64 (__fastcall **)(__int64, unsigned __int64, unsigned __int64))(a3 + 1904))(
v6,
a2,
0xFFFFFFFFFFFFFFFFLL % a2);
if ( v7 )
{
v8 = *(_QWORD *)(a3 + 2080) + a1 * a2;
++*(_QWORD *)(a3 + 2064);
*(_QWORD *)(a3 + 2080) = v8;
if ( *(_QWORD *)(a3 + 2072) >= v8 )
v8 = *(_QWORD *)(a3 + 2072);
*(_QWORD *)(a3 + 2072) = v8;
}
else
{
cholmod_error(4294967294LL, "../Core/cholmod_memory.c", 255LL, "out of memory", a3);
}
return v7;
}
cholmod_error(4294967293LL, "../Core/cholmod_memory.c", 245LL, "problem too large", a3);
result = 0LL;
}
else
{
cholmod_error(4294967292LL, "../Core/cholmod_memory.c", 239LL, "sizeof(item) must be > 0", a3);
result = 0LL;
}
return result;
}

original_code:
void *cholmod_calloc
(
    size_t n,
    size_t size,
    cholmod_common *Common
)
{
    void *p ;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (size == 0)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 239, "sizeof(item) must be > 0", Common) ;
 p = ((void *)0) ;
    }
    else if (n >= (((size_t) (-1)) / size) || n >= 0x7fffffff)
    {
 cholmod_error ((-3), "../Core/cholmod_memory.c", 245, "problem too large", Common) ;
 p = ((void *)0) ;
    }
    else
    {
 p = (Common->calloc_memory) ((((1) > (n)) ? (1) : (n)), size) ;
 if (p == ((void *)0))
 {
     cholmod_error ((-2), "../Core/cholmod_memory.c", 255, "out of memory", Common) ;
 }
 else
 {
     Common->malloc_count++ ;
     Common->memory_inuse += (n * size) ;
     Common->memory_usage =
  (((Common->memory_usage) > (Common->memory_inuse)) ? (Common->memory_usage) : (Common->memory_inuse)) ;
     ;
 }
    }
    return (p) ;
}

canonical_original_code:
void *cholmod_calloc(unsigned long n, unsigned long size, struct cholmod_common_struct *Common)
{
    void *p;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (size == 0)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 239, "sizeof(item) must be > 0", Common) ;
 p = ((void *)0) ;
    }
    else if (n >= (((unsigned long) (-1)) / size) || n >= 0x7fffffff)
    {
 cholmod_error ((-3), "../Core/cholmod_memory.c", 245, "problem too large", Common) ;
 p = ((void *)0) ;
    }
    else
    {
 p = (Common->calloc_memory) ((((1) > (n)) ? (1) : (n)), size) ;
 if (p == ((void *)0))
 {
     cholmod_error ((-2), "../Core/cholmod_memory.c", 255, "out of memory", Common) ;
 }
 else
 {
     Common->malloc_count++ ;
     Common->memory_inuse += (n * size) ;
     Common->memory_usage =
  (((Common->memory_usage) > (Common->memory_inuse)) ? (Common->memory_usage) : (Common->memory_inuse)) ;
     ;
 }
    }
    return (p) ;
}


original_code:
void *cholmod_realloc
(
    size_t nnew,
    size_t size,
    void *p,
    size_t *n,
    cholmod_common *Common
)
{
    size_t nold = (*n) ;
    void *pnew ;
    size_t s ;
    int ok = 1 ;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (size == 0)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 313, "sizeof(item) must be > 0", Common) ;
 p = ((void *)0) ;
    }
    else if (p == ((void *)0))
    {
 ;
 p = cholmod_malloc (nnew, size, Common) ;
 *n = (p == ((void *)0)) ? 0 : nnew ;
    }
    else if (nold == nnew)
    {
 ;
    }
    else if (nnew >= (((size_t) (-1)) / size) || nnew >= 0x7fffffff)
    {
 cholmod_error ((-3), "../Core/cholmod_memory.c", 331, "problem too large", Common) ;
    }
    else
    {
 ;
 pnew = ((void *)0) ;
 s = cholmod_mult_size_t ((((1) > (nnew)) ? (1) : (nnew)), size, &ok) ;
 pnew = ok ? ((Common->realloc_memory) (p, s)) : ((void *)0) ;
 if (pnew == ((void *)0))
 {
     if (nnew <= nold)
     {
  *n = nnew ;
  ;
  ;
  Common->memory_inuse += ((nnew-nold) * size) ;
     }
     else
     {
  cholmod_error ((-2), "../Core/cholmod_memory.c", 366, "out of memory", Common) ;
     }
 }
 else
 {
     ;
     p = pnew ;
     *n = nnew ;
     Common->memory_inuse += ((nnew-nold) * size) ;
 }
 Common->memory_usage = (((Common->memory_usage) > (Common->memory_inuse)) ? (Common->memory_usage) : (Common->memory_inuse));
    }
    return (p) ;
}

canonical_original_code:
void *cholmod_realloc(unsigned long nnew, unsigned long size, void *p, unsigned long *n, struct cholmod_common_struct *Common)
{
    unsigned long nold = (*n);
    void *pnew;
    unsigned long s;
    int ok = 1;
    { if (Common == ((void *)0)) { return (((void *)0)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (((void *)0)) ; } } ;
    if (size == 0)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 313, "sizeof(item) must be > 0", Common) ;
 p = ((void *)0) ;
    }
    else if (p == ((void *)0))
    {
 ;
 p = cholmod_malloc (nnew, size, Common) ;
 *n = (p == ((void *)0)) ? 0 : nnew ;
    }
    else if (nold == nnew)
    {
 ;
    }
    else if (nnew >= (((unsigned long) (-1)) / size) || nnew >= 0x7fffffff)
    {
 cholmod_error ((-3), "../Core/cholmod_memory.c", 331, "problem too large", Common) ;
    }
    else
    {
 ;
 pnew = ((void *)0) ;
 s = cholmod_mult_size_t ((((1) > (nnew)) ? (1) : (nnew)), size, &ok) ;
 pnew = ok ? ((Common->realloc_memory) (p, s)) : ((void *)0) ;
 if (pnew == ((void *)0))
 {
     if (nnew <= nold)
     {
  *n = nnew ;
  ;
  ;
  Common->memory_inuse += ((nnew-nold) * size) ;
     }
     else
     {
  cholmod_error ((-2), "../Core/cholmod_memory.c", 366, "out of memory", Common) ;
     }
 }
 else
 {
     ;
     p = pnew ;
     *n = nnew ;
     Common->memory_inuse += ((nnew-nold) * size) ;
 }
 Common->memory_usage = (((Common->memory_usage) > (Common->memory_inuse)) ? (Common->memory_usage) : (Common->memory_inuse));
    }
    return (p) ;
}

variable_types:
nnew
unsigned long

variable_types:
n
unsigned long *

variable_types:
nold
unsigned long

variable_types:
pnew
void *

variable_types:
s
unsigned long


original_code:
int cholmod_realloc_multiple
(
    size_t nnew,
    int nint,
    int xtype,
    void **Iblock,
    void **Jblock,
    void **Xblock,
    void **Zblock,
    size_t *nold_p,
    cholmod_common *Common
)
{
    double *xx, *zz ;
    size_t i, j, x, z, nold ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    if (xtype < 0 || xtype > 3)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 423, "invalid xtype", Common) ;
 return (0) ;
    }
    nold = *nold_p ;
    if (nint < 1 && xtype == 0)
    {
 return (1) ;
    }
    i = nold ;
    j = nold ;
    x = nold ;
    z = nold ;
    if (nint > 0)
    {
 *Iblock = cholmod_realloc (nnew, sizeof (int), *Iblock, &i, Common) ;
    }
    if (nint > 1)
    {
 *Jblock = cholmod_realloc (nnew, sizeof (int), *Jblock, &j, Common) ;
    }
    switch (xtype)
    {
 case 1:
     *Xblock = cholmod_realloc (nnew, sizeof (double), *Xblock, &x,
                    Common) ;
     break ;
 case 2:
     *Xblock = cholmod_realloc (nnew, 2*sizeof (double), *Xblock, &x,
                    Common) ;
     break ;
 case 3:
     *Xblock = cholmod_realloc (nnew, sizeof (double), *Xblock, &x,
                    Common) ;
     *Zblock = cholmod_realloc (nnew, sizeof (double), *Zblock, &z,
                    Common) ;
     break ;
    }
    if (Common->status < 0)
    {
 if (nold == 0)
 {
     if (nint > 0)
     {
  *Iblock = cholmod_free (i, sizeof (int), *Iblock, Common) ;
     }
     if (nint > 1)
     {
  *Jblock = cholmod_free (j, sizeof (int), *Jblock, Common) ;
     }
     switch (xtype)
     {
  case 1:
      *Xblock = cholmod_free (x, sizeof (double), *Xblock,
                            Common) ;
      break ;
  case 2:
      *Xblock = cholmod_free (x, 2*sizeof (double), *Xblock,
                            Common) ;
      break ;
  case 3:
      *Xblock = cholmod_free (x, sizeof (double), *Xblock,
                            Common) ;
      *Zblock = cholmod_free (x, sizeof (double), *Zblock,
                            Common) ;
      break ;
     }
 }
 else
 {
     if (nint > 0)
     {
  *Iblock = cholmod_realloc (nold, sizeof (int), *Iblock, &i,
                            Common) ;
     }
     if (nint > 1)
     {
  *Jblock = cholmod_realloc (nold, sizeof (int), *Jblock, &j,
                            Common) ;
     }
     switch (xtype)
     {
  case 1:
      *Xblock = cholmod_realloc (nold, sizeof (double),
                            *Xblock, &x, Common) ;
      break ;
  case 2:
      *Xblock = cholmod_realloc (nold, 2*sizeof (double),
                            *Xblock, &x, Common) ;
      break ;
  case 3:
      *Xblock = cholmod_realloc (nold, sizeof (double),
                            *Xblock, &x, Common) ;
      *Zblock = cholmod_realloc (nold, sizeof (double),
                            *Zblock, &z, Common) ;
      break ;
     }
 }
 return (0) ;
    }
    if (nold == 0)
    {
 xx = *Xblock ;
 zz = *Zblock ;
 switch (xtype)
 {
     case 1:
  xx [0] = 0 ;
  break ;
     case 2:
  xx [0] = 0 ;
  xx [1] = 0 ;
  break ;
     case 3:
  xx [0] = 0 ;
  zz [0] = 0 ;
  break ;
 }
    }
    *nold_p = nnew ;
    return (1) ;
}

canonical_original_code:
int cholmod_realloc_multiple(unsigned long nnew, int nint, int xtype, void **Iblock, void **Jblock, void **Xblock, void **Zblock, unsigned long *nold_p, struct cholmod_common_struct *Common)
{
    double *xx; double *zz;
    unsigned long i; unsigned long j; unsigned long x; unsigned long z; unsigned long nold;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    if (xtype < 0 || xtype > 3)
    {
 cholmod_error ((-4), "../Core/cholmod_memory.c", 423, "invalid xtype", Common) ;
 return (0) ;
    }
    nold = *nold_p ;
    if (nint < 1 && xtype == 0)
    {
 return (1) ;
    }
    i = nold ;
    j = nold ;
    x = nold ;
    z = nold ;
    if (nint > 0)
    {
 *Iblock = cholmod_realloc (nnew, sizeof (int), *Iblock, &i, Common) ;
    }
    if (nint > 1)
    {
 *Jblock = cholmod_realloc (nnew, sizeof (int), *Jblock, &j, Common) ;
    }
    switch (xtype)
    {
 case 1:
     *Xblock = cholmod_realloc (nnew, sizeof (double), *Xblock, &x,
                    Common) ;
     break ;
 case 2:
     *Xblock = cholmod_realloc (nnew, 2*sizeof (double), *Xblock, &x,
                    Common) ;
     break ;
 case 3:
     *Xblock = cholmod_realloc (nnew, sizeof (double), *Xblock, &x,
                    Common) ;
     *Zblock = cholmod_realloc (nnew, sizeof (double), *Zblock, &z,
                    Common) ;
     break ;
    }
    if (Common->status < 0)
    {
 if (nold == 0)
 {
     if (nint > 0)
     {
  *Iblock = cholmod_free (i, sizeof (int), *Iblock, Common) ;
     }
     if (nint > 1)
     {
  *Jblock = cholmod_free (j, sizeof (int), *Jblock, Common) ;
     }
     switch (xtype)
     {
  case 1:
      *Xblock = cholmod_free (x, sizeof (double), *Xblock,
                            Common) ;
      break ;
  case 2:
      *Xblock = cholmod_free (x, 2*sizeof (double), *Xblock,
                            Common) ;
      break ;
  case 3:
      *Xblock = cholmod_free (x, sizeof (double), *Xblock,
                            Common) ;
      *Zblock = cholmod_free (x, sizeof (double), *Zblock,
                            Common) ;
      break ;
     }
 }
 else
 {
     if (nint > 0)
     {
  *Iblock = cholmod_realloc (nold, sizeof (int), *Iblock, &i,
                            Common) ;
     }
     if (nint > 1)
     {
  *Jblock = cholmod_realloc (nold, sizeof (int), *Jblock, &j,
                            Common) ;
     }
     switch (xtype)
     {
  case 1:
      *Xblock = cholmod_realloc (nold, sizeof (double),
                            *Xblock, &x, Common) ;
      break ;
  case 2:
      *Xblock = cholmod_realloc (nold, 2*sizeof (double),
                            *Xblock, &x, Common) ;
      break ;
  case 3:
      *Xblock = cholmod_realloc (nold, sizeof (double),
                            *Xblock, &x, Common) ;
      *Zblock = cholmod_realloc (nold, sizeof (double),
                            *Zblock, &z, Common) ;
      break ;
     }
 }
 return (0) ;
    }
    if (nold == 0)
    {
 xx = *Xblock ;
 zz = *Zblock ;
 switch (xtype)
 {
     case 1:
  xx [0] = 0 ;
  break ;
     case 2:
  xx [0] = 0 ;
  xx [1] = 0 ;
  break ;
     case 3:
  xx [0] = 0 ;
  zz [0] = 0 ;
  break ;
 }
    }
    *nold_p = nnew ;
    return (1) ;
}

variable_types: nint int

variable_types: xtype int

variable_types:
Iblock
void **

variable_types:
Jblock
void **

variable_types:
Xblock
void **

variable_types:
Zblock
void **

variable_types:
xx
double *

variable_types:
zz
double *

variable_types:
i
unsigned long

variable_types:
j
unsigned long

variable_types:
x
unsigned long

variable_types:
z
unsigned long

return_type: int


original_code:
long umfpack_dl_transpose
(
    long n_row,
    long n_col,
    const long Ap [ ],
    const long Ai [ ],
    const double Ax [ ],
    const long P [ ],
    const long Q [ ],
    long Rp [ ],
    long Ri [ ],
    double Rx [ ]
)
{
    long status, *W, nn ;
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    nn = (((nn) > (1)) ? (nn) : (1)) ;
    W = (long *) umf_l_malloc (nn, sizeof (long)) ;
    if (!W)
    {
 ;
 ;
 return ((-1)) ;
    }
    ;
    status = umfdl_transpose (n_row, n_col, Ap, Ai, Ax, P, Q, n_col, Rp, Ri, Rx,
 W, (1)
 ) ;
    (void) umf_l_free ((void *) W) ;
    ;
    return (status) ;
}

canonical_original_code:
long umfpack_dl_transpose(long n_row, long n_col, long Ap[], long Ai[], double Ax[], long P[], long Q[], long Rp[], long Ri[], double Rx[])
{
    long status; long *W; long nn;
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    nn = (((nn) > (1)) ? (nn) : (1)) ;
    W = (long *) umf_l_malloc (nn, sizeof (long)) ;
    if (!W)
    {
 ;
 ;
 return ((-1)) ;
    }
    ;
    status = umfdl_transpose (n_row, n_col, Ap, Ai, Ax, P, Q, n_col, Rp, Ri, Rx,
 W, (1)
 ) ;
    (void) umf_l_free ((void *) W) ;
    ;
    return (status) ;
}

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
P
long []

variable_types:
Q
long []

variable_types:
Rp
long []

variable_types:
Ri
long []

variable_types:
Rx
double []

variable_types: status long

variable_types:
W
long *

variable_types: nn long

return_type: long


decompiled_code:
__int64 __fastcall umf_i_report_perm(int a1, __int64 a2, __int64 a3, int a4, int a5)
{
__int64 v6; // rax
int v7; // er13
int v8; // ebp
__int64 v9; // rbx
int *v10; // rax
int v11; // edx
__int64 (*v12)(const char *, ...); // rdx
unsigned int v13; // er12
bool v16; // [rsp+Fh] [rbp-39h]

v16 = a4 > 3 || a5 != 0;
if ( !v16 )
goto LABEL_4;
if ( amd_printf )
{
amd_printf("permutation vector, n = %d. ", (unsigned int)a1);
LABEL_4:
if ( a1 > 0 )
{
if ( !a2 )
{
if ( amd_printf )
{
v13 = 0;
amd_printf("(not present)\n\n");
return v13;
}
return 0;
}
goto LABEL_6;
}
if ( amd_printf )
amd_printf("ERROR: length of permutation is <= 0\n\n");
return (unsigned int)-6;
}
if ( a1 <= 0 )
return (unsigned int)-6;
if ( !a2 )
return 0;
LABEL_6:
if ( a3 )
{
if ( a4 > 3 && amd_printf )
amd_printf("\n");
v6 = 0LL;
do
*(_DWORD *)(a3 + 4 * v6++) = 1;
while ( a1 > (int)v6 );
v7 = a4;
v8 = 0;
while ( 2 )
{
v9 = *(int *)(a2 + 4LL * v8);
if ( v7 > 3 && amd_printf )
amd_printf(" %d : %d ", (unsigned int)v8, (unsigned int)v9);
while ( 1 )
{
if ( (int)v9 < 0 || a1 <= (int)v9 || (v10 = (int *)(a3 + 4 * v9), v11 = *v10, *v10 = 0, !v11) )
{
if ( amd_printf )
amd_printf("ERROR: invalid\n\n");
return (unsigned int)-15;
}
if ( v7 <= 3 )
break;
if ( amd_printf )
amd_printf("\n");
if ( v7 != 4 || v8 != 9 )
break;
if ( a1 <= 10 )
goto LABEL_25;
if ( amd_printf )
amd_printf(" ...\n");
v9 = *(int *)(a2 + 40);
v8 = 10;
v7 = 3;
}
if ( a1 > ++v8 )
continue;
break;
}
LABEL_25:
if ( a4 <= 3 )
{
if ( !v16 )
return 0;
v12 = amd_printf;
}
else
{
if ( !amd_printf )
return 0;
amd_printf(" permutation vector ");
v12 = amd_printf;
}
if ( v12 )
v12("OK\n\n");
return 0;
}
v13 = -1;
if ( amd_printf )
amd_printf("ERROR: out of memory\n\n");
return v13;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, __int64 a2, __int64 a3, int a4, int a5)
{
__int64 v6; // rax
int v7; // er13
int v8; // ebp
__int64 v9; // rbx
int *v10; // rax
int v11; // edx
__int64 (*v12)(const char *, ...); // rdx
unsigned int v13; // er12
bool v16; // [rsp+Fh] [rbp-39h]

v16 = a4 > 3 || a5 != 0;
if ( !v16 )
goto LABEL_4;
if ( amd_printf )
{
amd_printf("permutation vector, n = %d. ", (unsigned int)a1);
LABEL_4:
if ( a1 > 0 )
{
if ( !a2 )
{
if ( amd_printf )
{
v13 = 0;
amd_printf("(not present)\n\n");
return v13;
}
return 0;
}
goto LABEL_6;
}
if ( amd_printf )
amd_printf("ERROR: length of permutation is <= 0\n\n");
return (unsigned int)-6;
}
if ( a1 <= 0 )
return (unsigned int)-6;
if ( !a2 )
return 0;
LABEL_6:
if ( a3 )
{
if ( a4 > 3 && amd_printf )
amd_printf("\n");
v6 = 0LL;
do
*(_DWORD *)(a3 + 4 * v6++) = 1;
while ( a1 > (int)v6 );
v7 = a4;
v8 = 0;
while ( 2 )
{
v9 = *(int *)(a2 + 4LL * v8);
if ( v7 > 3 && amd_printf )
amd_printf(" %d : %d ", (unsigned int)v8, (unsigned int)v9);
while ( 1 )
{
if ( (int)v9 < 0 || a1 <= (int)v9 || (v10 = (int *)(a3 + 4 * v9), v11 = *v10, *v10 = 0, !v11) )
{
if ( amd_printf )
amd_printf("ERROR: invalid\n\n");
return (unsigned int)-15;
}
if ( v7 <= 3 )
break;
if ( amd_printf )
amd_printf("\n");
if ( v7 != 4 || v8 != 9 )
break;
if ( a1 <= 10 )
goto LABEL_25;
if ( amd_printf )
amd_printf(" ...\n");
v9 = *(int *)(a2 + 40);
v8 = 10;
v7 = 3;
}
if ( a1 > ++v8 )
continue;
break;
}
LABEL_25:
if ( a4 <= 3 )
{
if ( !v16 )
return 0;
v12 = amd_printf;
}
else
{
if ( !amd_printf )
return 0;
amd_printf(" permutation vector ");
v12 = amd_printf;
}
if ( v12 )
v12("OK\n\n");
return 0;
}
v13 = -1;
if ( amd_printf )
amd_printf("ERROR: out of memory\n\n");
return v13;
}

original_code:
int umf_i_report_perm
(
    int n,
    const int P [ ],
    int W [ ],
    int prl,
    int user
)
{
    int i, k, valid, prl1 ;
    ;
    { if (user || prl >= 4) { if (amd_printf != ((void *)0)) (void) amd_printf ("permutation vector, n = ""%d"". ", n) ; } ; } ;
    if (n <= 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: length of permutation is <= 0\n\n") ; } ;
 return ((-6)) ;
    }
    if (!P)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("(not present)\n\n") ; } ;
 return ((0)) ;
    }
    if (!W)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: out of memory\n\n") ; } ;
 return ((-1)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    for (i = 0 ; i < n ; i++)
    {
 W [i] = (1) ;
    }
    prl1 = prl ;
    for (k = 0 ; k < n ; k++)
    {
 i = P [k] ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    ""%d"" : ""%d"" ", (k), (i)) ; } ; } } ;
 valid = (i >= 0 && i < n) ;
 if (valid)
 {
     valid = W [i] ;
     W [i] = (0) ;
 }
 if (!valid)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid\n\n") ; } ;
     return ((-15)) ;
 }
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
 if (prl == 4 && k == 9 && n > 10)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("    ...\n") ; } ;
     prl-- ;
 }
    }
    prl = prl1 ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    permutation vector ") ; } ; } } ;
    { if (user || prl >= 4) { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ; } ;
    return ((0)) ;
}

canonical_original_code:
int umf_i_report_perm(int n, int P[], int W[], int prl, int user)
{
    int i; int k; int valid; int prl1;
    ;
    { if (user || prl >= 4) { if (amd_printf != ((void *)0)) (void) amd_printf ("permutation vector, n = ""%d"". ", n) ; } ; } ;
    if (n <= 0)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: length of permutation is <= 0\n\n") ; } ;
 return ((-6)) ;
    }
    if (!P)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("(not present)\n\n") ; } ;
 return ((0)) ;
    }
    if (!W)
    {
 { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: out of memory\n\n") ; } ;
 return ((-1)) ;
    }
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
    for (i = 0 ; i < n ; i++)
    {
 W [i] = (1) ;
    }
    prl1 = prl ;
    for (k = 0 ; k < n ; k++)
    {
 i = P [k] ;
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    ""%d"" : ""%d"" ", (k), (i)) ; } ; } } ;
 valid = (i >= 0 && i < n) ;
 if (valid)
 {
     valid = W [i] ;
     W [i] = (0) ;
 }
 if (!valid)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("ERROR: invalid\n\n") ; } ;
     return ((-15)) ;
 }
 { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("\n") ; } ; } } ;
 if (prl == 4 && k == 9 && n > 10)
 {
     { if (amd_printf != ((void *)0)) (void) amd_printf ("    ...\n") ; } ;
     prl-- ;
 }
    }
    prl = prl1 ;
    { if (prl >= (4)) { { if (amd_printf != ((void *)0)) (void) amd_printf ("    permutation vector ") ; } ; } } ;
    { if (user || prl >= 4) { if (amd_printf != ((void *)0)) (void) amd_printf ("OK\n\n") ; } ; } ;
    return ((0)) ;
}

variable_types: n int

variable_types:
P
int []

variable_types:
W
int []

variable_types: prl int

variable_types: user int

variable_types: i int

variable_types: k int

variable_types: valid int


original_code:
size_t amd_l_aat
(
    long n,
    const long Ap [ ],
    const long Ai [ ],
    long Len [ ],
    long Tp [ ],
    double Info [ ]
)
{
    long 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_l_aat(long n, long Ap[], long Ai[], long Len[], long Tp[], double Info[])
{
    long p1; long p2; long p; long i; long j; long pj; long pj2; long k; long nzdiag; long nzboth; long 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 long

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Len
long []

variable_types:
Tp
long []

variable_types:
Info
double []

variable_types: p long

variable_types: i long

variable_types: j long

variable_types: pj long

variable_types: k long

variable_types: nzdiag long

variable_types: nzboth long

variable_types: nz long

variable_types: sym double

variable_types:
nzaat
unsigned long

return_type: unsigned long


original_code:
void umfzi_kernel_wrapup
(
    NumericType *Numeric,
    SymbolicType *Symbolic,
    WorkType *Work
)
{
    DoubleComplex pivot_value ;
    double d ;
    DoubleComplex *D ;
    int i, k, col, row, llen, ulen, *ip, *Rperm, *Cperm, *Lilen, npiv, lp,
 *Uilen, *Lip, *Uip, *Cperm_init, up, pivrow, pivcol, *Lpos, *Upos, *Wr,
 *Wc, *Wp, *Frpos, *Fcpos, *Row_degree, *Col_degree, *Rperm_init,
 n_row, n_col, n_inner, zero_pivot, nan_pivot, n1 ;
    ;
    n_row = Symbolic->n_row ;
    n_col = Symbolic->n_col ;
    n_inner = (((n_row) < (n_col)) ? (n_row) : (n_col)) ;
    Rperm = Numeric->Rperm ;
    Cperm = Numeric->Cperm ;
    Lilen = Numeric->Lilen ;
    Uilen = Numeric->Uilen ;
    Upos = Numeric->Upos ;
    Lpos = Numeric->Lpos ;
    Lip = Numeric->Lip ;
    Uip = Numeric->Uip ;
    D = Numeric->D ;
    npiv = Work->npiv ;
    Numeric->npiv = npiv ;
    Numeric->ulen = Work->ulen ;
    ;
    ;
    ;
    ;
    ;
    for (k = 0 ; k < npiv ; k++)
    {
 pivot_value = D [k] ;
 { (d) = umfpack_hypot ((pivot_value).component [0], (pivot_value).component [1]) ; } ;
 zero_pivot = ((d) == 0.) ;
 nan_pivot = ((d) != (d)) ;
 if (!zero_pivot)
 {
     Numeric->nnzpiv++ ;
 }
 if (k == 0)
 {
     Numeric->min_udiag = d ;
     Numeric->max_udiag = d ;
 }
 else
 {
     if (((Numeric->min_udiag) != 0.))
     {
  if (zero_pivot || nan_pivot)
  {
      Numeric->min_udiag = d ;
  }
  else if (!((Numeric->min_udiag) != (Numeric->min_udiag)))
  {
      Numeric->min_udiag = (((Numeric->min_udiag) < (d)) ? (Numeric->min_udiag) : (d)) ;
  }
     }
     if (nan_pivot)
     {
  Numeric->max_udiag = d ;
     }
     else if (!((Numeric->max_udiag) != (Numeric->max_udiag)))
     {
  Numeric->max_udiag = (((Numeric->max_udiag) > (d)) ? (Numeric->max_udiag) : (d)) ;
     }
 }
    }
    Col_degree = Cperm ;
    Row_degree = Rperm ;
    if (npiv < n_row)
    {
 k = npiv ;
 ;
 for (row = 0 ; row < n_row ; row++)
 {
     if ((Row_degree [row] >= 0))
     {
  Rperm [row] = (-(k)-1) ;
  ;
  ;
  Lpos [row] = (-1) ;
  Uip [row] = (-1) ;
  Uilen [row] = 0 ;
  k++ ;
     }
 }
 ;
    }
    if (npiv < n_col)
    {
 k = npiv ;
 ;
 for (col = 0 ; col < n_col ; col++)
 {
     if ((Col_degree [col] >= 0))
     {
  Cperm [col] = (-(k)-1) ;
  ;
  ;
  Upos [col] = (-1) ;
  Lip [col] = (-1) ;
  Lilen [col] = 0 ;
  k++ ;
     }
 }
 ;
    }
    if (npiv < n_inner)
    {
 ;
 for (k = npiv ; k < n_inner ; k++)
 {
     { (D [k]).component [0] = 0. ; (D [k]).component [1] = 0. ; } ;
 }
    }
    if (Numeric->ulen > 0)
    {
 ;
 Numeric->Upattern = Work->Upattern ;
 Work->Upattern = (int *) ((void *)0) ;
    }
    ;
    ;
    if (Numeric->nnzpiv < n_inner && !((Numeric->min_udiag) != (Numeric->min_udiag)))
    {
 Numeric->min_udiag = 0.0 ;
    }
    Frpos = Work->Frpos ;
    Fcpos = Work->Fcpos ;
    Wp = Work->Wp ;
    Wr = Work->Lpattern ;
    Wc = Work->Wrp ;
    for (pivrow = 0 ; pivrow < n_row ; pivrow++)
    {
 k = Rperm [pivrow] ;
 ;
 k = (-(k)-1) ;
 ;
 Wp [k] = pivrow ;
 Frpos [pivrow] = k ;
    }
    for (k = 0 ; k < n_row ; k++)
    {
 Rperm [k] = Wp [k] ;
    }
    for (pivcol = 0 ; pivcol < n_col ; pivcol++)
    {
 k = Cperm [pivcol] ;
 ;
 k = (-(k)-1) ;
 ;
 Wp [k] = pivcol ;
 Fcpos [pivcol] = k ;
    }
    for (k = 0 ; k < n_col ; k++)
    {
 Cperm [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivrow = Rperm [k] ;
 Wr [k] = Uilen [pivrow] ;
 Wp [k] = Uip [pivrow] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Uilen [k] = Wr [k] ;
 Uip [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivrow = Rperm [k] ;
 Wp [k] = Lpos [pivrow] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Lpos [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivcol = Cperm [k] ;
 Wc [k] = Lilen [pivcol] ;
 Wp [k] = Lip [pivcol] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Lilen [k] = Wc [k] ;
 Lip [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivcol = Cperm [k] ;
 Wp [k] = Upos [pivcol] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Upos [k] = Wp [k] ;
    }
    Upos [npiv] = (-1) ;
    Lpos [npiv] = (-1) ;
    Uip [npiv] = (-1) ;
    Lip [npiv] = (-1) ;
    Uilen [npiv] = 0 ;
    Lilen [npiv] = 0 ;
    n1 = Symbolic->n1 ;
    for (k = 0 ; k < n1 ; k++)
    {
 ulen = Uilen [k] ;
 ;
 if (ulen > 0)
 {
     up = Uip [k] ;
     ip = (int *) (Numeric->Memory + up) ;
     for (i = 0 ; i < ulen ; i++)
     {
  col = *ip ;
  ;
  ;
  *ip++ = Fcpos [col] ;
     }
 }
    }
    for (k = n1 ; k < npiv ; k++)
    {
 up = Uip [k] ;
 if (up < 0)
 {
     ulen = Uilen [k] ;
     ;
     if (ulen > 0)
     {
  up = -up ;
  ip = (int *) (Numeric->Memory + up) ;
  for (i = 0 ; i < ulen ; i++)
  {
      col = *ip ;
      ;
      ;
      *ip++ = Fcpos [col] ;
  }
     }
 }
    }
    ulen = Numeric->ulen ;
    if (ulen > 0)
    {
 ;
 for (i = 0 ; i < ulen ; i++)
 {
     col = Numeric->Upattern [i] ;
     ;
     Numeric->Upattern [i] = Fcpos [col] ;
 }
    }
    for (k = 0 ; k < n1 ; k++)
    {
 llen = Lilen [k] ;
 ;
 if (llen > 0)
 {
     lp = Lip [k] ;
     ip = (int *) (Numeric->Memory + lp) ;
     for (i = 0 ; i < llen ; i++)
     {
  row = *ip ;
  ;
  ;
  *ip++ = Frpos [row] ;
     }
 }
    }
    for (k = n1 ; k < npiv ; k++)
    {
 llen = Lilen [k] ;
 ;
 if (llen > 0)
 {
     lp = Lip [k] ;
     if (lp < 0)
     {
  lp = -lp ;
     }
     ip = (int *) (Numeric->Memory + lp) ;
     for (i = 0 ; i < llen ; i++)
     {
  row = *ip ;
  ;
  ;
  *ip++ = Frpos [row] ;
     }
 }
    }
    Cperm_init = Symbolic->Cperm_init ;
    Rperm_init = Symbolic->Rperm_init ;
    for (k = 0 ; k < n_row ; k++)
    {
 Rperm [k] = Rperm_init [Rperm [k]] ;
    }
    for (k = 0 ; k < n_col ; k++)
    {
 Cperm [k] = Cperm_init [Cperm [k]] ;
    }
}

canonical_original_code:
void umfzi_kernel_wrapup(struct NumericType *Numeric, struct SymbolicType *Symbolic, struct WorkType *Work)
{
    struct DoubleComplex pivot_value;
    double d;
    struct DoubleComplex *D;
    int i; int k; int col; int row; int llen; int ulen; int *ip; int *Rperm; int *Cperm; int *Lilen; int npiv; int lp; int *Uilen; int *Lip; int *Uip; int *Cperm_init; int up; int pivrow; int pivcol; int *Lpos; int *Upos; int *Wr; int *Wc; int *Wp; int *Frpos; int *Fcpos; int *Row_degree; int *Col_degree; int *Rperm_init; int n_row; int n_col; int n_inner; int zero_pivot; int nan_pivot; int n1;
    ;
    n_row = Symbolic->n_row ;
    n_col = Symbolic->n_col ;
    n_inner = (((n_row) < (n_col)) ? (n_row) : (n_col)) ;
    Rperm = Numeric->Rperm ;
    Cperm = Numeric->Cperm ;
    Lilen = Numeric->Lilen ;
    Uilen = Numeric->Uilen ;
    Upos = Numeric->Upos ;
    Lpos = Numeric->Lpos ;
    Lip = Numeric->Lip ;
    Uip = Numeric->Uip ;
    D = Numeric->D ;
    npiv = Work->npiv ;
    Numeric->npiv = npiv ;
    Numeric->ulen = Work->ulen ;
    ;
    ;
    ;
    ;
    ;
    for (k = 0 ; k < npiv ; k++)
    {
 pivot_value = D [k] ;
 { (d) = umfpack_hypot ((pivot_value).component [0], (pivot_value).component [1]) ; } ;
 zero_pivot = ((d) == 0.) ;
 nan_pivot = ((d) != (d)) ;
 if (!zero_pivot)
 {
     Numeric->nnzpiv++ ;
 }
 if (k == 0)
 {
     Numeric->min_udiag = d ;
     Numeric->max_udiag = d ;
 }
 else
 {
     if (((Numeric->min_udiag) != 0.))
     {
  if (zero_pivot || nan_pivot)
  {
      Numeric->min_udiag = d ;
  }
  else if (!((Numeric->min_udiag) != (Numeric->min_udiag)))
  {
      Numeric->min_udiag = (((Numeric->min_udiag) < (d)) ? (Numeric->min_udiag) : (d)) ;
  }
     }
     if (nan_pivot)
     {
  Numeric->max_udiag = d ;
     }
     else if (!((Numeric->max_udiag) != (Numeric->max_udiag)))
     {
  Numeric->max_udiag = (((Numeric->max_udiag) > (d)) ? (Numeric->max_udiag) : (d)) ;
     }
 }
    }
    Col_degree = Cperm ;
    Row_degree = Rperm ;
    if (npiv < n_row)
    {
 k = npiv ;
 ;
 for (row = 0 ; row < n_row ; row++)
 {
     if ((Row_degree [row] >= 0))
     {
  Rperm [row] = (-(k)-1) ;
  ;
  ;
  Lpos [row] = (-1) ;
  Uip [row] = (-1) ;
  Uilen [row] = 0 ;
  k++ ;
     }
 }
 ;
    }
    if (npiv < n_col)
    {
 k = npiv ;
 ;
 for (col = 0 ; col < n_col ; col++)
 {
     if ((Col_degree [col] >= 0))
     {
  Cperm [col] = (-(k)-1) ;
  ;
  ;
  Upos [col] = (-1) ;
  Lip [col] = (-1) ;
  Lilen [col] = 0 ;
  k++ ;
     }
 }
 ;
    }
    if (npiv < n_inner)
    {
 ;
 for (k = npiv ; k < n_inner ; k++)
 {
     { (D [k]).component [0] = 0. ; (D [k]).component [1] = 0. ; } ;
 }
    }
    if (Numeric->ulen > 0)
    {
 ;
 Numeric->Upattern = Work->Upattern ;
 Work->Upattern = (int *) ((void *)0) ;
    }
    ;
    ;
    if (Numeric->nnzpiv < n_inner && !((Numeric->min_udiag) != (Numeric->min_udiag)))
    {
 Numeric->min_udiag = 0.0 ;
    }
    Frpos = Work->Frpos ;
    Fcpos = Work->Fcpos ;
    Wp = Work->Wp ;
    Wr = Work->Lpattern ;
    Wc = Work->Wrp ;
    for (pivrow = 0 ; pivrow < n_row ; pivrow++)
    {
 k = Rperm [pivrow] ;
 ;
 k = (-(k)-1) ;
 ;
 Wp [k] = pivrow ;
 Frpos [pivrow] = k ;
    }
    for (k = 0 ; k < n_row ; k++)
    {
 Rperm [k] = Wp [k] ;
    }
    for (pivcol = 0 ; pivcol < n_col ; pivcol++)
    {
 k = Cperm [pivcol] ;
 ;
 k = (-(k)-1) ;
 ;
 Wp [k] = pivcol ;
 Fcpos [pivcol] = k ;
    }
    for (k = 0 ; k < n_col ; k++)
    {
 Cperm [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivrow = Rperm [k] ;
 Wr [k] = Uilen [pivrow] ;
 Wp [k] = Uip [pivrow] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Uilen [k] = Wr [k] ;
 Uip [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivrow = Rperm [k] ;
 Wp [k] = Lpos [pivrow] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Lpos [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivcol = Cperm [k] ;
 Wc [k] = Lilen [pivcol] ;
 Wp [k] = Lip [pivcol] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Lilen [k] = Wc [k] ;
 Lip [k] = Wp [k] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 pivcol = Cperm [k] ;
 Wp [k] = Upos [pivcol] ;
    }
    for (k = 0 ; k < npiv ; k++)
    {
 Upos [k] = Wp [k] ;
    }
    Upos [npiv] = (-1) ;
    Lpos [npiv] = (-1) ;
    Uip [npiv] = (-1) ;
    Lip [npiv] = (-1) ;
    Uilen [npiv] = 0 ;
    Lilen [npiv] = 0 ;
    n1 = Symbolic->n1 ;
    for (k = 0 ; k < n1 ; k++)
    {
 ulen = Uilen [k] ;
 ;
 if (ulen > 0)
 {
     up = Uip [k] ;
     ip = (int *) (Numeric->Memory + up) ;
     for (i = 0 ; i < ulen ; i++)
     {
  col = *ip ;
  ;
  ;
  *ip++ = Fcpos [col] ;
     }
 }
    }
    for (k = n1 ; k < npiv ; k++)
    {
 up = Uip [k] ;
 if (up < 0)
 {
     ulen = Uilen [k] ;
     ;
     if (ulen > 0)
     {
  up = -up ;
  ip = (int *) (Numeric->Memory + up) ;
  for (i = 0 ; i < ulen ; i++)
  {
      col = *ip ;
      ;
      ;
      *ip++ = Fcpos [col] ;
  }
     }
 }
    }
    ulen = Numeric->ulen ;
    if (ulen > 0)
    {
 ;
 for (i = 0 ; i < ulen ; i++)
 {
     col = Numeric->Upattern [i] ;
     ;
     Numeric->Upattern [i] = Fcpos [col] ;
 }
    }
    for (k = 0 ; k < n1 ; k++)
    {
 llen = Lilen [k] ;
 ;
 if (llen > 0)
 {
     lp = Lip [k] ;
     ip = (int *) (Numeric->Memory + lp) ;
     for (i = 0 ; i < llen ; i++)
     {
  row = *ip ;
  ;
  ;
  *ip++ = Frpos [row] ;
     }
 }
    }
    for (k = n1 ; k < npiv ; k++)
    {
 llen = Lilen [k] ;
 ;
 if (llen > 0)
 {
     lp = Lip [k] ;
     if (lp < 0)
     {
  lp = -lp ;
     }
     ip = (int *) (Numeric->Memory + lp) ;
     for (i = 0 ; i < llen ; i++)
     {
  row = *ip ;
  ;
  ;
  *ip++ = Frpos [row] ;
     }
 }
    }
    Cperm_init = Symbolic->Cperm_init ;
    Rperm_init = Symbolic->Rperm_init ;
    for (k = 0 ; k < n_row ; k++)
    {
 Rperm [k] = Rperm_init [Rperm [k]] ;
    }
    for (k = 0 ; k < n_col ; k++)
    {
 Cperm [k] = Cperm_init [Cperm [k]] ;
    }
}

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

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

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

variable_types: d double

variable_types: i int

variable_types: k int

variable_types: col int

variable_types: row int

variable_types: llen int

variable_types: ulen int

variable_types:
ip
int *

variable_types:
Rperm
int *

variable_types:
Cperm
int *

variable_types:
Lilen
int *

variable_types: npiv int

variable_types: lp int

variable_types:
Uilen
int *

variable_types:
Lip
int *

variable_types:
Uip
int *

variable_types: up int

variable_types: pivrow int

variable_types: pivcol int

variable_types:
Lpos
int *

variable_types:
Upos
int *

variable_types:
Wr
int *

variable_types:
Wc
int *

variable_types:
Wp
int *

variable_types:
Frpos
int *

variable_types:
Fcpos
int *

return_type: void

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:
long umfpack_zl_triplet_to_col
(
    long n_row,
    long n_col,
    long nz,
    const long Ti [ ],
    const long Tj [ ],
    const double Tx [ ],
    const double Tz [ ],
    long Ap [ ],
    long Ai [ ],
    double Ax [ ]
    , double Az [ ]
    , long Map [ ]
)
{
    long *RowCount, *Rp, *Rj, *W, nn, do_values, do_map, *Map2, status ;
    double *Rx ;
    double *Rz ;
    long split ;
    if (!Ai || !Ap || !Ti || !Tj)
    {
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 return ((-6)) ;
    }
    if (nz < 0)
    {
 return ((-8)) ;
    }
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    Rx = (double *) ((void *)0) ;
    do_values = Ax && Tx ;
    if (do_values)
    {
 Rx = (double *) umf_l_malloc (2*nz+2, sizeof (double)) ;
 split = ((Tz) != (double *) ((void *)0)) && ((Az) != (double *) ((void *)0)) ;
 if (split)
 {
     Rz = Rx + nz ;
 }
 else
 {
     Rz = (double *) ((void *)0) ;
 }
 if (!Rx)
 {
     ;
     ;
     return ((-1)) ;
 }
    }
    do_map = (Map != (long *) ((void *)0)) ;
    Map2 = (long *) ((void *)0) ;
    if (do_map)
    {
 ;
 Map2 = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
 if (!Map2)
 {
     ;
     (void) umf_l_free ((void *) Rx) ;
     ;
     return ((-1)) ;
 }
    }
    Rj = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
    Rp = (long *) umf_l_malloc (n_row+1, sizeof (long)) ;
    RowCount = (long *) umf_l_malloc (n_row, sizeof (long)) ;
    W = (long *) umf_l_malloc (nn, sizeof (long)) ;
    if (!Rj || !Rp || !RowCount || !W)
    {
 ;
 (void) umf_l_free ((void *) Rx) ;
 (void) umf_l_free ((void *) Map2) ;
 (void) umf_l_free ((void *) Rp) ;
 (void) umf_l_free ((void *) Rj) ;
 (void) umf_l_free ((void *) RowCount) ;
 (void) umf_l_free ((void *) W) ;
 ;
 return ((-1)) ;
    }
    ;
    if (do_map)
    {
 if (do_values)
 {
     status = umfzl_triplet_map_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Tx, Ax, Rx
  , Tz, Az, Rz
  , Map, Map2) ;
 }
 else
 {
     status = umfzl_triplet_map_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Map, Map2) ;
 }
    }
    else
    {
 if (do_values)
 {
     status = umfzl_triplet_nomap_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount , Tx, Ax, Rx
  , Tz, Az, Rz
  ) ;
 }
 else
 {
     status = umfzl_triplet_nomap_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai,
  Rp, Rj, W, RowCount) ;
 }
    }
    (void) umf_l_free ((void *) Rx) ;
    (void) umf_l_free ((void *) Map2) ;
    (void) umf_l_free ((void *) Rp) ;
    (void) umf_l_free ((void *) Rj) ;
    (void) umf_l_free ((void *) RowCount) ;
    (void) umf_l_free ((void *) W) ;
    ;
    return (status) ;
}

canonical_original_code:
long umfpack_zl_triplet_to_col(long n_row, long n_col, long nz, long Ti[], long Tj[], double Tx[], double Tz[], long Ap[], long Ai[], double Ax[], double Az[], long Map[])
{
    long *RowCount; long *Rp; long *Rj; long *W; long nn; long do_values; long do_map; long *Map2; long status;
    double *Rx;
    double *Rz;
    long split;
    if (!Ai || !Ap || !Ti || !Tj)
    {
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 return ((-6)) ;
    }
    if (nz < 0)
    {
 return ((-8)) ;
    }
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    Rx = (double *) ((void *)0) ;
    do_values = Ax && Tx ;
    if (do_values)
    {
 Rx = (double *) umf_l_malloc (2*nz+2, sizeof (double)) ;
 split = ((Tz) != (double *) ((void *)0)) && ((Az) != (double *) ((void *)0)) ;
 if (split)
 {
     Rz = Rx + nz ;
 }
 else
 {
     Rz = (double *) ((void *)0) ;
 }
 if (!Rx)
 {
     ;
     ;
     return ((-1)) ;
 }
    }
    do_map = (Map != (long *) ((void *)0)) ;
    Map2 = (long *) ((void *)0) ;
    if (do_map)
    {
 ;
 Map2 = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
 if (!Map2)
 {
     ;
     (void) umf_l_free ((void *) Rx) ;
     ;
     return ((-1)) ;
 }
    }
    Rj = (long *) umf_l_malloc (nz+1, sizeof (long)) ;
    Rp = (long *) umf_l_malloc (n_row+1, sizeof (long)) ;
    RowCount = (long *) umf_l_malloc (n_row, sizeof (long)) ;
    W = (long *) umf_l_malloc (nn, sizeof (long)) ;
    if (!Rj || !Rp || !RowCount || !W)
    {
 ;
 (void) umf_l_free ((void *) Rx) ;
 (void) umf_l_free ((void *) Map2) ;
 (void) umf_l_free ((void *) Rp) ;
 (void) umf_l_free ((void *) Rj) ;
 (void) umf_l_free ((void *) RowCount) ;
 (void) umf_l_free ((void *) W) ;
 ;
 return ((-1)) ;
    }
    ;
    if (do_map)
    {
 if (do_values)
 {
     status = umfzl_triplet_map_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Tx, Ax, Rx
  , Tz, Az, Rz
  , Map, Map2) ;
 }
 else
 {
     status = umfzl_triplet_map_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Map, Map2) ;
 }
    }
    else
    {
 if (do_values)
 {
     status = umfzl_triplet_nomap_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount , Tx, Ax, Rx
  , Tz, Az, Rz
  ) ;
 }
 else
 {
     status = umfzl_triplet_nomap_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai,
  Rp, Rj, W, RowCount) ;
 }
    }
    (void) umf_l_free ((void *) Rx) ;
    (void) umf_l_free ((void *) Map2) ;
    (void) umf_l_free ((void *) Rp) ;
    (void) umf_l_free ((void *) Rj) ;
    (void) umf_l_free ((void *) RowCount) ;
    (void) umf_l_free ((void *) W) ;
    ;
    return (status) ;
}

variable_types: nz long

variable_types:
Ti
long []

variable_types:
Tj
long []

variable_types:
Tx
double []

variable_types:
Tz
double []

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
Az
double []

variable_types:
Map
long []

variable_types:
RowCount
long *

variable_types:
Rp
long *

variable_types:
Rj
long *

variable_types:
W
long *

variable_types: nn long

variable_types: status long

variable_types:
Rx
double *

variable_types:
Rz
double *

variable_types: split long


original_code:
int umfdi_init_front
(
    NumericType *Numeric,
    WorkType *Work
)
{
    int i, j, fnr_curr, row, col, *Frows, *Fcols,
 *Fcpos, *Frpos, fncols, fnrows, *Wrow, fnr2, fnc2, rrdeg, ccdeg, *Wm,
 fnrows_extended ;
    double *Fcblock, *Fl, *Wy, *Wx ;
    if (Work->do_grow)
    {
 fnr2 = (1.2) * Work->fnrows_new + 2 ;
 fnc2 = (1.2) * Work->fncols_new + 2 ;
 if (!umfdi_grow_front (Numeric, fnr2, fnc2, Work,
     Work->pivrow_in_front ? 2 : 0))
 {
     ;
     return ((0)) ;
 }
    }
    ;
    fnr_curr = Work->fnr_curr ;
    ;
    ;
    ;
    ;
    Frows = Work->Frows ;
    Fcols = Work->Fcols ;
    Frpos = Work->Frpos ;
    Fcpos = Work->Fcpos ;
    Work->fnzeros = 0 ;
    ccdeg = Work->ccdeg ;
    rrdeg = Work->rrdeg ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    ;
    Fl = Work->Flblock ;
    if (Work->pivcol_in_front)
    {
 Work->fscan_row = fnrows ;
 Work->NewRows = Work->Wrp ;
 Wy = Work->Wy ;
 for (i = 0 ; i < fnrows ; i++)
 {
     Fl [i] = Wy [i] ;
 }
 fnrows_extended = fnrows + ccdeg ;
 for (i = fnrows ; i < fnrows_extended ; i++)
 {
     Fl [i] = Wy [i] ;
     row = Frows [i] ;
     Work->NewRows [i] = (-(row)-2) ;
 }
 fnrows = fnrows_extended ;
    }
    else
    {
 Work->fscan_row = 0 ;
 Work->NewRows = Frows ;
 Wm = Work->Wm ;
 Wx = Work->Wx ;
 for (i = 0 ; i < ccdeg ; i++)
 {
     Fl [i] = Wx [i] ;
     row = Wm [i] ;
     Frows [i] = row ;
     Frpos [row] = i ;
 }
 fnrows = ccdeg ;
    }
    Work->fnrows = fnrows ;
    Wrow = Work->Wrow ;
    if (Work->pivrow_in_front)
    {
 Work->fscan_col = fncols ;
 Work->NewCols = Work->Wp ;
 ;
 if (Wrow == Fcols)
 {
     for (j = fncols ; j < rrdeg ; j++)
     {
  col = Wrow [j] ;
  Work->NewCols [j] = (-(col)-2) ;
  Fcpos [col] = j * fnr_curr ;
     }
 }
 else
 {
     for (j = fncols ; j < rrdeg ; j++)
     {
  col = Wrow [j] ;
  Fcols [j] = col ;
  Work->NewCols [j] = (-(col)-2) ;
  Fcpos [col] = j * fnr_curr ;
     }
 }
    }
    else
    {
 Work->fscan_col = 0 ;
 Work->NewCols = Fcols ;
 for (j = 0 ; j < rrdeg ; j++)
 {
     col = Wrow [j] ;
     Fcols [j] = col ;
     Fcpos [col] = j * fnr_curr ;
 }
    }
    ;
    fncols = rrdeg ;
    Work->fncols = fncols ;
    ;
    ;
    Fcblock = Work->Fcblock ;
    ;
    zero_init_front (fncols, fnrows, Fcblock, fnr_curr) ;
    return ((1)) ;
}

canonical_original_code:
int umfdi_init_front(struct NumericType *Numeric, struct WorkType *Work)
{
    int i; int j; int fnr_curr; int row; int col; int *Frows; int *Fcols; int *Fcpos; int *Frpos; int fncols; int fnrows; int *Wrow; int fnr2; int fnc2; int rrdeg; int ccdeg; int *Wm; int fnrows_extended;
    double *Fcblock; double *Fl; double *Wy; double *Wx;
    if (Work->do_grow)
    {
 fnr2 = (1.2) * Work->fnrows_new + 2 ;
 fnc2 = (1.2) * Work->fncols_new + 2 ;
 if (!umfdi_grow_front (Numeric, fnr2, fnc2, Work,
     Work->pivrow_in_front ? 2 : 0))
 {
     ;
     return ((0)) ;
 }
    }
    ;
    fnr_curr = Work->fnr_curr ;
    ;
    ;
    ;
    ;
    Frows = Work->Frows ;
    Fcols = Work->Fcols ;
    Frpos = Work->Frpos ;
    Fcpos = Work->Fcpos ;
    Work->fnzeros = 0 ;
    ccdeg = Work->ccdeg ;
    rrdeg = Work->rrdeg ;
    fnrows = Work->fnrows ;
    fncols = Work->fncols ;
    ;
    Fl = Work->Flblock ;
    if (Work->pivcol_in_front)
    {
 Work->fscan_row = fnrows ;
 Work->NewRows = Work->Wrp ;
 Wy = Work->Wy ;
 for (i = 0 ; i < fnrows ; i++)
 {
     Fl [i] = Wy [i] ;
 }
 fnrows_extended = fnrows + ccdeg ;
 for (i = fnrows ; i < fnrows_extended ; i++)
 {
     Fl [i] = Wy [i] ;
     row = Frows [i] ;
     Work->NewRows [i] = (-(row)-2) ;
 }
 fnrows = fnrows_extended ;
    }
    else
    {
 Work->fscan_row = 0 ;
 Work->NewRows = Frows ;
 Wm = Work->Wm ;
 Wx = Work->Wx ;
 for (i = 0 ; i < ccdeg ; i++)
 {
     Fl [i] = Wx [i] ;
     row = Wm [i] ;
     Frows [i] = row ;
     Frpos [row] = i ;
 }
 fnrows = ccdeg ;
    }
    Work->fnrows = fnrows ;
    Wrow = Work->Wrow ;
    if (Work->pivrow_in_front)
    {
 Work->fscan_col = fncols ;
 Work->NewCols = Work->Wp ;
 ;
 if (Wrow == Fcols)
 {
     for (j = fncols ; j < rrdeg ; j++)
     {
  col = Wrow [j] ;
  Work->NewCols [j] = (-(col)-2) ;
  Fcpos [col] = j * fnr_curr ;
     }
 }
 else
 {
     for (j = fncols ; j < rrdeg ; j++)
     {
  col = Wrow [j] ;
  Fcols [j] = col ;
  Work->NewCols [j] = (-(col)-2) ;
  Fcpos [col] = j * fnr_curr ;
     }
 }
    }
    else
    {
 Work->fscan_col = 0 ;
 Work->NewCols = Fcols ;
 for (j = 0 ; j < rrdeg ; j++)
 {
     col = Wrow [j] ;
     Fcols [j] = col ;
     Fcpos [col] = j * fnr_curr ;
 }
    }
    ;
    fncols = rrdeg ;
    Work->fncols = fncols ;
    ;
    ;
    Fcblock = Work->Fcblock ;
    ;
    zero_init_front (fncols, fnrows, Fcblock, fnr_curr) ;
    return ((1)) ;
}

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

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

variable_types: i int

variable_types: j int

variable_types: row int

variable_types: col int

variable_types:
Frows
int *

variable_types:
Fcols
int *

variable_types:
Fcpos
int *

variable_types:
Frpos
int *

variable_types: fncols int

variable_types: fnrows int

variable_types:
Wrow
int *

variable_types: rrdeg int

variable_types: ccdeg int

variable_types:
Wm
int *

variable_types:
Fcblock
double *

variable_types:
Fl
double *

variable_types:
Wy
double *

variable_types:
Wx
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; }


decompiled_code:
unsigned __int64 __fastcall zero_init_front(int a1, int a2, char *a3, int a4)
{
unsigned __int64 result; // rax
size_t v5; // r15
__int64 v7; // r12
int i; // ebp
void *v10; // rdi

if ( a1 > 0 )
{
result = (unsigned int)(a2 - 1);
v5 = 8 * result + 8;
v7 = 8LL * a4;
for ( i = 0; i != a1; ++i )
{
v10 = a3;
a3 += v7;
if ( a2 > 0 )
result = (unsigned __int64)memset(v10, 0, v5);
}
}
return result;
}

canonical_decompiled_code:
unsigned __int64 __fastcall func0(int a1, int a2, char *a3, int a4)
{
unsigned __int64 result; // rax
size_t v5; // r15
__int64 v7; // r12
int i; // ebp
void *v10; // rdi

if ( a1 > 0 )
{
result = (unsigned int)(a2 - 1);
v5 = 8 * result + 8;
v7 = 8LL * a4;
for ( i = 0; i != a1; ++i )
{
v10 = a3;
a3 += v7;
if ( a2 > 0 )
result = (unsigned __int64)memset(v10, 0, v5);
}
}
return result;
}

original_code:
static void zero_init_front (int m, int n, double *Fcblock, int d)
{
    int i, j ;
    double *F, *Fj = Fcblock ;
    for (j = 0 ; j < m ; j++)
    {
 F = Fj ;
 Fj += d ;
 for (i = 0 ; i < n ; i++)
 {
     { (*F) = 0. ; } ;
     F++ ;
 }
    }
}

canonical_original_code:
static void zero_init_front(int m, int n, double *Fcblock, int d)
{
    int i; int j;
    double *F; double *Fj = Fcblock;
    for (j = 0 ; j < m ; j++)
    {
 F = Fj ;
 Fj += d ;
 for (i = 0 ; i < n ; i++)
 {
     { (*F) = 0. ; } ;
     F++ ;
 }
    }
}

variable_types: m int

variable_types: n int

variable_types: d int

variable_types: i int

variable_types: j int

variable_types:
F
double *

variable_types:
Fj
double *


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

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

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

variable_types: norm int

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

variable_types: xnorm double

variable_types: s double

variable_types: x double

variable_types: z double

variable_types:
Xx
double *

variable_types:
Xz
double *

variable_types:
W
double *

variable_types: nrow long

variable_types: ncol long

variable_types: d long

variable_types: i long

variable_types: j long

variable_types: xtype long

return_type: double


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

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

variable_types: xtype int

variable_types:
Ax
double *

variable_types:
Az
double *

variable_types: p long


original_code:
int cholmod_l_defaults
(
    cholmod_common *Common
)
{
    long i ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->dbound = 0.0 ;
    Common->grow0 = 1.2 ;
    Common->grow1 = 1.2 ;
    Common->grow2 = 5 ;
    Common->maxrank = 8 ;
    Common->final_asis = 1 ;
    Common->final_super = 1 ;
    Common->final_ll = 0 ;
    Common->final_pack = 1 ;
    Common->final_monotonic = 1 ;
    Common->final_resymbol = 0 ;
    Common->supernodal = 1 ;
    Common->supernodal_switch = 40 ;
    Common->nrelax [0] = 4 ;
    Common->nrelax [1] = 16 ;
    Common->nrelax [2] = 48 ;
    Common->zrelax [0] = 0.8 ;
    Common->zrelax [1] = 0.1 ;
    Common->zrelax [2] = 0.05 ;
    Common->prefer_zomplex = 0 ;
    Common->prefer_upper = 1 ;
    Common->prefer_binary = 0 ;
    Common->quick_return_if_not_posdef = 0 ;
    Common->metis_memory = 0.0 ;
    Common->metis_nswitch = 3000 ;
    Common->metis_dswitch = 0.66 ;
    Common->print = 3 ;
    Common->precise = 0 ;
    Common->nmethods = 0 ;
    Common->default_nesdis = 0 ;
    Common->current = 0 ;
    Common->selected = 0 ;
    for (i = 0 ; i <= 9 ; i++)
    {
 Common->method [i].ordering = 2 ;
 Common->method [i].prune_dense = 10.0 ;
 Common->method [i].prune_dense2 = -1 ;
 Common->method [i].aggressive = 1 ;
 Common->method [i].order_for_lu = 0 ;
 Common->method [i].nd_small = 200 ;
 Common->method [i].nd_compress = 1 ;
 Common->method [i].nd_camd = 1 ;
 Common->method [i].nd_components = 0 ;
 Common->method [i].nd_oksep = 1.0 ;
 Common->method [i].fl = (-1) ;
 Common->method [i].lnz = (-1) ;
    }
    Common->postorder = 1 ;
    Common->method [0].ordering = 1 ;
    Common->method [1].ordering = 2 ;
    Common->method [2].ordering = 3 ;
    Common->method [3].ordering = 4 ;
    Common->method [4].ordering = 0 ;
    Common->method [5].ordering = 4 ;
    Common->method [5].nd_small = 20000 ;
    Common->method [6].ordering = 4 ;
    Common->method [6].nd_small = 4 ;
    Common->method [6].nd_camd = 0 ;
    Common->method [7].ordering = 4 ;
    Common->method [7].prune_dense = -1. ;
    Common->method [8].ordering = 5 ;
    return (1) ;
}

canonical_original_code:
int cholmod_l_defaults(struct cholmod_common_struct *Common)
{
    long i;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->dbound = 0.0 ;
    Common->grow0 = 1.2 ;
    Common->grow1 = 1.2 ;
    Common->grow2 = 5 ;
    Common->maxrank = 8 ;
    Common->final_asis = 1 ;
    Common->final_super = 1 ;
    Common->final_ll = 0 ;
    Common->final_pack = 1 ;
    Common->final_monotonic = 1 ;
    Common->final_resymbol = 0 ;
    Common->supernodal = 1 ;
    Common->supernodal_switch = 40 ;
    Common->nrelax [0] = 4 ;
    Common->nrelax [1] = 16 ;
    Common->nrelax [2] = 48 ;
    Common->zrelax [0] = 0.8 ;
    Common->zrelax [1] = 0.1 ;
    Common->zrelax [2] = 0.05 ;
    Common->prefer_zomplex = 0 ;
    Common->prefer_upper = 1 ;
    Common->prefer_binary = 0 ;
    Common->quick_return_if_not_posdef = 0 ;
    Common->metis_memory = 0.0 ;
    Common->metis_nswitch = 3000 ;
    Common->metis_dswitch = 0.66 ;
    Common->print = 3 ;
    Common->precise = 0 ;
    Common->nmethods = 0 ;
    Common->default_nesdis = 0 ;
    Common->current = 0 ;
    Common->selected = 0 ;
    for (i = 0 ; i <= 9 ; i++)
    {
 Common->method [i].ordering = 2 ;
 Common->method [i].prune_dense = 10.0 ;
 Common->method [i].prune_dense2 = -1 ;
 Common->method [i].aggressive = 1 ;
 Common->method [i].order_for_lu = 0 ;
 Common->method [i].nd_small = 200 ;
 Common->method [i].nd_compress = 1 ;
 Common->method [i].nd_camd = 1 ;
 Common->method [i].nd_components = 0 ;
 Common->method [i].nd_oksep = 1.0 ;
 Common->method [i].fl = (-1) ;
 Common->method [i].lnz = (-1) ;
    }
    Common->postorder = 1 ;
    Common->method [0].ordering = 1 ;
    Common->method [1].ordering = 2 ;
    Common->method [2].ordering = 3 ;
    Common->method [3].ordering = 4 ;
    Common->method [4].ordering = 0 ;
    Common->method [5].ordering = 4 ;
    Common->method [5].nd_small = 20000 ;
    Common->method [6].ordering = 4 ;
    Common->method [6].nd_small = 4 ;
    Common->method [6].nd_camd = 0 ;
    Common->method [7].ordering = 4 ;
    Common->method [7].prune_dense = -1. ;
    Common->method [8].ordering = 5 ;
    return (1) ;
}

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:
int cholmod_l_start
(
    cholmod_common *Common
)
{
    int k ;
    if (Common == ((void *)0))
    {
 return (0) ;
    }
    Common->error_handler = ((void *)0) ;
    Common->itype = 2 ;
    Common->dtype = 0 ;
    cholmod_l_defaults (Common) ;
    Common->try_catch = 0 ;
    Common->malloc_memory = malloc ;
    Common->free_memory = free ;
    Common->realloc_memory = realloc ;
    Common->calloc_memory = calloc ;
    Common->complex_divide = cholmod_l_divcomplex ;
    Common->hypotenuse = cholmod_l_hypot ;
    Common->print_function = printf ;
    Common->nrow = 0 ;
    Common->mark = (-1) ;
    Common->xworksize = 0 ;
    Common->iworksize = 0 ;
    Common->Flag = ((void *)0) ;
    Common->Head = ((void *)0) ;
    Common->Iwork = ((void *)0) ;
    Common->Xwork = ((void *)0) ;
    Common->no_workspace_reallocate = 0 ;
    Common->fl = (-1) ;
    Common->lnz = (-1) ;
    Common->modfl = (-1) ;
    Common->status = 0 ;
    Common->malloc_count = 0 ;
    Common->memory_usage = 0 ;
    Common->memory_inuse = 0 ;
    Common->nrealloc_col = 0 ;
    Common->nrealloc_factor = 0 ;
    Common->ndbounds_hit = 0 ;
    Common->rowfacfl = 0 ;
    Common->aatfl = (-1) ;
    Common->called_nd = 0 ;
    Common->blas_ok = 1 ;
    for (k = 0 ; k < 4 ; k++) Common->SPQR_xstat [k] = 0 ;
    for (k = 0 ; k < 10 ; k++) Common->SPQR_istat [k] = 0 ;
    for (k = 0 ; k < 10 ; k++) Common->other1 [k] = 0 ;
    for (k = 0 ; k < 6 ; k++) Common->other2 [k] = 0 ;
    for (k = 0 ; k < 10 ; k++) Common->other3 [k] = 0 ;
    for (k = 0 ; k < 16 ; k++) Common->other4 [k] = 0 ;
    for (k = 0 ; k < 16 ; k++) Common->other5 [k] = (void *) ((void *)0) ;
    Common->SPQR_grain = 1 ;
    Common->SPQR_small = 1e6 ;
    Common->SPQR_shrink = 1 ;
    Common->SPQR_nthreads = 0 ;
    ;
    return (1) ;
}

canonical_original_code:
int cholmod_l_start(struct cholmod_common_struct *Common)
{
    int k;
    if (Common == ((void *)0))
    {
 return (0) ;
    }
    Common->error_handler = ((void *)0) ;
    Common->itype = 2 ;
    Common->dtype = 0 ;
    cholmod_l_defaults (Common) ;
    Common->try_catch = 0 ;
    Common->malloc_memory = malloc ;
    Common->free_memory = free ;
    Common->realloc_memory = realloc ;
    Common->calloc_memory = calloc ;
    Common->complex_divide = cholmod_l_divcomplex ;
    Common->hypotenuse = cholmod_l_hypot ;
    Common->print_function = printf ;
    Common->nrow = 0 ;
    Common->mark = (-1) ;
    Common->xworksize = 0 ;
    Common->iworksize = 0 ;
    Common->Flag = ((void *)0) ;
    Common->Head = ((void *)0) ;
    Common->Iwork = ((void *)0) ;
    Common->Xwork = ((void *)0) ;
    Common->no_workspace_reallocate = 0 ;
    Common->fl = (-1) ;
    Common->lnz = (-1) ;
    Common->modfl = (-1) ;
    Common->status = 0 ;
    Common->malloc_count = 0 ;
    Common->memory_usage = 0 ;
    Common->memory_inuse = 0 ;
    Common->nrealloc_col = 0 ;
    Common->nrealloc_factor = 0 ;
    Common->ndbounds_hit = 0 ;
    Common->rowfacfl = 0 ;
    Common->aatfl = (-1) ;
    Common->called_nd = 0 ;
    Common->blas_ok = 1 ;
    for (k = 0 ; k < 4 ; k++) Common->SPQR_xstat [k] = 0 ;
    for (k = 0 ; k < 10 ; k++) Common->SPQR_istat [k] = 0 ;
    for (k = 0 ; k < 10 ; k++) Common->other1 [k] = 0 ;
    for (k = 0 ; k < 6 ; k++) Common->other2 [k] = 0 ;
    for (k = 0 ; k < 10 ; k++) Common->other3 [k] = 0 ;
    for (k = 0 ; k < 16 ; k++) Common->other4 [k] = 0 ;
    for (k = 0 ; k < 16 ; k++) Common->other5 [k] = (void *) ((void *)0) ;
    Common->SPQR_grain = 1 ;
    Common->SPQR_small = 1e6 ;
    Common->SPQR_shrink = 1 ;
    Common->SPQR_nthreads = 0 ;
    ;
    return (1) ;
}

variable_types: k int


original_code:
int cholmod_l_free_work
(
    cholmod_common *Common
)
{
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->Flag = cholmod_l_free (Common->nrow, sizeof (long),
     Common->Flag, Common) ;
    Common->Head = cholmod_l_free (Common->nrow+1, sizeof (long),
     Common->Head, Common) ;
    Common->Iwork = cholmod_l_free (Common->iworksize, sizeof (long),
     Common->Iwork, Common) ;
    Common->Xwork = cholmod_l_free (Common->xworksize, sizeof (double),
     Common->Xwork, Common) ;
    Common->nrow = 0 ;
    Common->iworksize = 0 ;
    Common->xworksize = 0 ;
    return (1) ;
}

canonical_original_code:
int cholmod_l_free_work(struct cholmod_common_struct *Common)
{
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->Flag = cholmod_l_free (Common->nrow, sizeof (long),
     Common->Flag, Common) ;
    Common->Head = cholmod_l_free (Common->nrow+1, sizeof (long),
     Common->Head, Common) ;
    Common->Iwork = cholmod_l_free (Common->iworksize, sizeof (long),
     Common->Iwork, Common) ;
    Common->Xwork = cholmod_l_free (Common->xworksize, sizeof (double),
     Common->Xwork, Common) ;
    Common->nrow = 0 ;
    Common->iworksize = 0 ;
    Common->xworksize = 0 ;
    return (1) ;
}


decompiled_code:
// attributes: thunk
__int64 __fastcall cholmod_l_finish(__int64 a1)
{
return cholmod_l_free_work(a1);
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1)
{
return func2(a1);
}

original_code:
int cholmod_l_finish
(
    cholmod_common *Common
)
{
    return (cholmod_l_free_work (Common)) ;
}

canonical_original_code:
int cholmod_l_finish(struct cholmod_common_struct *Common)
{
    return (cholmod_l_free_work (Common)) ;
}


original_code:
long cholmod_l_clear_flag
(
    cholmod_common *Common
)
{
    long i, nrow, *Flag ;
    { if (Common == ((void *)0)) { return (-1) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (-1) ; } } ;
    Common->mark++ ;
    if (Common->mark <= 0)
    {
 nrow = Common->nrow ;
 Flag = Common->Flag ;
 ;
 ;
 for (i = 0 ; i < nrow ; i++)
 {
     Flag [i] = (-1) ;
 }
 Common->mark = 0 ;
    }
    return (Common->mark) ;
}

canonical_original_code:
long cholmod_l_clear_flag(struct cholmod_common_struct *Common)
{
    long i; long nrow; long *Flag;
    { if (Common == ((void *)0)) { return (-1) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (-1) ; } } ;
    Common->mark++ ;
    if (Common->mark <= 0)
    {
 nrow = Common->nrow ;
 Flag = Common->Flag ;
 ;
 ;
 for (i = 0 ; i < nrow ; i++)
 {
     Flag [i] = (-1) ;
 }
 Common->mark = 0 ;
    }
    return (Common->mark) ;
}

variable_types:
Flag
long *


original_code:
int cholmod_l_allocate_work
(
    size_t nrow,
    size_t iworksize,
    size_t xworksize,
    cholmod_common *Common
)
{
    double *W ;
    long *Head ;
    long i ;
    size_t nrow1 ;
    int ok = 1 ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->status = 0 ;
    nrow = (((1) > (nrow)) ? (1) : (nrow)) ;
    nrow1 = cholmod_l_add_size_t (nrow, 1, &ok) ;
    if (!ok)
    {
 Common->status = (-3) ;
 cholmod_l_free_work (Common) ;
 return (0) ;
    }
    if (nrow > Common->nrow)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 Common->Flag = cholmod_l_free (Common->nrow, sizeof (long), Common->Flag,
  Common) ;
 Common->Head = cholmod_l_free (Common->nrow+1,sizeof (long), Common->Head,
  Common) ;
 Common->Flag = cholmod_l_malloc (nrow, sizeof (long), Common) ;
 Common->Head = cholmod_l_malloc (nrow1, sizeof (long), Common) ;
 Common->nrow = nrow ;
 if (Common->status < 0)
 {
     cholmod_l_free_work (Common) ;
     return (0) ;
 }
 Common->mark = (-1) ;
 cholmod_l_clear_flag (Common) ;
 Head = Common->Head ;
 for (i = 0 ; i <= (long) (nrow) ; i++)
 {
     Head [i] = (-1) ;
 }
    }
    iworksize = (((1) > (iworksize)) ? (1) : (iworksize)) ;
    if (iworksize > Common->iworksize)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 cholmod_l_free (Common->iworksize, sizeof (long), Common->Iwork, Common) ;
 Common->Iwork = cholmod_l_malloc (iworksize, sizeof (long), Common) ;
 Common->iworksize = iworksize ;
 if (Common->status < 0)
 {
     cholmod_l_free_work (Common) ;
     return (0) ;
 }
    }
    xworksize = (((1) > (xworksize)) ? (1) : (xworksize)) ;
    if (xworksize > Common->xworksize)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 cholmod_l_free (Common->xworksize, sizeof (double), Common->Xwork,
  Common) ;
 Common->Xwork = cholmod_l_malloc (xworksize, sizeof (double), Common) ;
 Common->xworksize = xworksize ;
 if (Common->status < 0)
 {
     cholmod_l_free_work (Common) ;
     return (0) ;
 }
 W = Common->Xwork ;
 for (i = 0 ; i < (long) xworksize ; i++)
 {
     W [i] = 0. ;
 }
    }
    return (1) ;
}

canonical_original_code:
int cholmod_l_allocate_work(unsigned long nrow, unsigned long iworksize, unsigned long xworksize, struct cholmod_common_struct *Common)
{
    double *W;
    long *Head;
    long i;
    unsigned long nrow1;
    int ok = 1;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->status = 0 ;
    nrow = (((1) > (nrow)) ? (1) : (nrow)) ;
    nrow1 = cholmod_l_add_size_t (nrow, 1, &ok) ;
    if (!ok)
    {
 Common->status = (-3) ;
 cholmod_l_free_work (Common) ;
 return (0) ;
    }
    if (nrow > Common->nrow)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 Common->Flag = cholmod_l_free (Common->nrow, sizeof (long), Common->Flag,
  Common) ;
 Common->Head = cholmod_l_free (Common->nrow+1,sizeof (long), Common->Head,
  Common) ;
 Common->Flag = cholmod_l_malloc (nrow, sizeof (long), Common) ;
 Common->Head = cholmod_l_malloc (nrow1, sizeof (long), Common) ;
 Common->nrow = nrow ;
 if (Common->status < 0)
 {
     cholmod_l_free_work (Common) ;
     return (0) ;
 }
 Common->mark = (-1) ;
 cholmod_l_clear_flag (Common) ;
 Head = Common->Head ;
 for (i = 0 ; i <= (long) (nrow) ; i++)
 {
     Head [i] = (-1) ;
 }
    }
    iworksize = (((1) > (iworksize)) ? (1) : (iworksize)) ;
    if (iworksize > Common->iworksize)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 cholmod_l_free (Common->iworksize, sizeof (long), Common->Iwork, Common) ;
 Common->Iwork = cholmod_l_malloc (iworksize, sizeof (long), Common) ;
 Common->iworksize = iworksize ;
 if (Common->status < 0)
 {
     cholmod_l_free_work (Common) ;
     return (0) ;
 }
    }
    xworksize = (((1) > (xworksize)) ? (1) : (xworksize)) ;
    if (xworksize > Common->xworksize)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 cholmod_l_free (Common->xworksize, sizeof (double), Common->Xwork,
  Common) ;
 Common->Xwork = cholmod_l_malloc (xworksize, sizeof (double), Common) ;
 Common->xworksize = xworksize ;
 if (Common->status < 0)
 {
     cholmod_l_free_work (Common) ;
     return (0) ;
 }
 W = Common->Xwork ;
 for (i = 0 ; i < (long) xworksize ; i++)
 {
     W [i] = 0. ;
 }
    }
    return (1) ;
}

variable_types:
nrow
unsigned long

variable_types:
iworksize
unsigned long

variable_types:
xworksize
unsigned long

variable_types:
Head
long *

variable_types: ok int


decompiled_code:
unsigned __int64 __fastcall cholmod_l_maxrank(__int64 a1, __int64 a2)
{
unsigned __int64 v2; // rcx
unsigned __int64 v3; // rdi
unsigned __int64 result; // rax

if ( !a2 )
return 0LL;
if ( *(_QWORD *)(a2 + 2016) == 2LL )
{
v2 = *(_QWORD *)(a2 + 32);
if ( a1 )
{
v3 = 8 * a1;
if ( v2 > 0xFFFFFFFFFFFFFFFFLL / v3 )
v2 = 0xFFFFFFFFFFFFFFFFLL / v3;
}
result = 2LL;
if ( v2 > 2 )
result = (-(__int64)(v2 < 5) & 0xFFFFFFFFFFFFFFFCLL) + 8;
}
else
{
*(_DWORD *)(a2 + 2028) = -4;
result = 0LL;
}
return result;
}

canonical_decompiled_code:
unsigned __int64 __fastcall func6(__int64 a1, __int64 a2)
{
unsigned __int64 v2; // rcx
unsigned __int64 v3; // rdi
unsigned __int64 result; // rax

if ( !a2 )
return 0LL;
if ( *(_QWORD *)(a2 + 2016) == 2LL )
{
v2 = *(_QWORD *)(a2 + 32);
if ( a1 )
{
v3 = 8 * a1;
if ( v2 > 0xFFFFFFFFFFFFFFFFLL / v3 )
v2 = 0xFFFFFFFFFFFFFFFFLL / v3;
}
result = 2LL;
if ( v2 > 2 )
result = (-(__int64)(v2 < 5) & 0xFFFFFFFFFFFFFFFCLL) + 8;
}
else
{
*(_DWORD *)(a2 + 2028) = -4;
result = 0LL;
}
return result;
}

original_code:
size_t cholmod_l_maxrank
(
    size_t n,
    cholmod_common *Common
)
{
    size_t maxrank ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    maxrank = Common->maxrank ;
    if (n > 0)
    {
 maxrank = (((maxrank) < (((size_t) (-1)) / (n * sizeof (double)))) ? (maxrank) : (((size_t) (-1)) / (n * sizeof (double)))) ;
    }
    if (maxrank <= 2)
    {
 maxrank = 2 ;
    }
    else if (maxrank <= 4)
    {
 maxrank = 4 ;
    }
    else
    {
 maxrank = 8 ;
    }
    return (maxrank) ;
}

canonical_original_code:
unsigned long cholmod_l_maxrank(unsigned long n, struct cholmod_common_struct *Common)
{
    unsigned long maxrank;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    maxrank = Common->maxrank ;
    if (n > 0)
    {
 maxrank = (((maxrank) < (((unsigned long) (-1)) / (n * sizeof (double)))) ? (maxrank) : (((unsigned long) (-1)) / (n * sizeof (double)))) ;
    }
    if (maxrank <= 2)
    {
 maxrank = 2 ;
    }
    else if (maxrank <= 4)
    {
 maxrank = 4 ;
    }
    else
    {
 maxrank = 8 ;
    }
    return (maxrank) ;
}

variable_types:
n
unsigned long

variable_types:
maxrank
unsigned long


decompiled_code:
__int64 __fastcall cholmod_l_dbound(__int64 a1, double a2)
{
double v2; // xmm1_8
__int64 result; // rax
int v4; // edx

if ( a1 )
{
if ( *(_QWORD *)(a1 + 2016) == 2LL )
{
v2 = *(double *)a1;
if ( a2 < 0.0 )
{
if ( a2 > COERCE_DOUBLE(*(_QWORD *)&v2 ^ LC11) )
{
v4 = *(_DWORD *)(a1 + 2028);
*(double *)(a1 + 2104) = *(double *)(a1 + 2104) + 1.0;
if ( !v4 )
result = cholmod_l_error(2LL, "../Core/cholmod_common.c", 683LL, "diagonal below threshold", a1);
}
}
else if ( v2 > a2 )
{
result = *(unsigned int *)(a1 + 2028);
*(double *)(a1 + 2104) = *(double *)(a1 + 2104) + 1.0;
if ( !(_DWORD)result )
result = cholmod_l_error(2LL, "../Core/cholmod_common.c", 695LL, "diagonal below threshold", a1);
}
}
else
{
*(_DWORD *)(a1 + 2028) = -4;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1, double a2)
{
double v2; // xmm1_8
__int64 result; // rax
int v4; // edx

if ( a1 )
{
if ( *(_QWORD *)(a1 + 2016) == 2LL )
{
v2 = *(double *)a1;
if ( a2 < 0.0 )
{
if ( a2 > COERCE_DOUBLE(*(_QWORD *)&v2 ^ LC11) )
{
v4 = *(_DWORD *)(a1 + 2028);
*(double *)(a1 + 2104) = *(double *)(a1 + 2104) + 1.0;
if ( !v4 )
result = cholmod_l_error(2LL, "../Core/cholmod_common.c", 683LL, "diagonal below threshold", a1);
}
}
else if ( v2 > a2 )
{
result = *(unsigned int *)(a1 + 2028);
*(double *)(a1 + 2104) = *(double *)(a1 + 2104) + 1.0;
if ( !(_DWORD)result )
result = cholmod_l_error(2LL, "../Core/cholmod_common.c", 695LL, "diagonal below threshold", a1);
}
}
else
{
*(_DWORD *)(a1 + 2028) = -4;
}
}
return result;
}

original_code:
double cholmod_l_dbound
(
    double dj,
    cholmod_common *Common
)
{
    double dbound ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    if (!((dj) != (dj)))
    {
 dbound = Common->dbound ;
 if (dj < 0)
 {
     if (dj > -dbound)
     {
  dj = -dbound ;
  Common->ndbounds_hit++ ;
  if (Common->status == 0)
  {
      cholmod_l_error ((2), "../Core/cholmod_common.c", 683, "diagonal below threshold", Common) ;
  }
     }
 }
 else
 {
     if (dj < dbound)
     {
  dj = dbound ;
  Common->ndbounds_hit++ ;
  if (Common->status == 0)
  {
      cholmod_l_error ((2), "../Core/cholmod_common.c", 695, "diagonal below threshold", Common) ;
  }
     }
 }
    }
    return (dj) ;
}

canonical_original_code:
double cholmod_l_dbound(double dj, struct cholmod_common_struct *Common)
{
    double dbound;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    if (!((dj) != (dj)))
    {
 dbound = Common->dbound ;
 if (dj < 0)
 {
     if (dj > -dbound)
     {
  dj = -dbound ;
  Common->ndbounds_hit++ ;
  if (Common->status == 0)
  {
      cholmod_l_error ((2), "../Core/cholmod_common.c", 683, "diagonal below threshold", Common) ;
  }
     }
 }
 else
 {
     if (dj < dbound)
     {
  dj = dbound ;
  Common->ndbounds_hit++ ;
  if (Common->status == 0)
  {
      cholmod_l_error ((2), "../Core/cholmod_common.c", 695, "diagonal below threshold", Common) ;
  }
     }
 }
    }
    return (dj) ;
}

variable_types: dj double

variable_types: dbound double