decompiled_code:
__int64 __fastcall cholmod_l_realloc_multiple(unsigned __int64 a1, int a2, unsigned int a3, __int64 *a4, __int64 *a5, __int64 *a6, __int64 *a7, unsigned __int64 *a8, __int64 a9)
{
__int64 result; // rax
unsigned __int64 v12; // r15
_QWORD *v13; // rax
_QWORD *v14; // rdx
unsigned __int64 v17; // [rsp+10h] [rbp-58h] BYREF
__int64 v18; // [rsp+18h] [rbp-50h] BYREF
__int64 v19; // [rsp+20h] [rbp-48h] BYREF
unsigned __int64 v20[8]; // [rsp+28h] [rbp-40h] BYREF

if ( !a9 )
return 0LL;
if ( *(_QWORD *)(a9 + 2016) == 2LL )
{
if ( a3 > 3 )
{
cholmod_l_error(4294967292LL, "../Core/cholmod_memory.c", 423LL, "invalid xtype", a9);
result = 0LL;
}
else if ( a2 > 0 || (result = 1LL, a3) )
{
v12 = *a8;
v20[0] = v12;
v19 = v12;
v18 = v12;
v17 = v12;
if ( a2 > 0 )
*a4 = cholmod_l_realloc(a1, 8uLL, *a4, v20, a9);
if ( a2 > 1 )
*a5 = cholmod_l_realloc(a1, 8uLL, *a5, (unsigned __int64 *)&v19, a9);
switch ( a3 )
{
case 2u:
*a6 = cholmod_l_realloc(a1, 0x10uLL, *a6, (unsigned __int64 *)&v18, a9);
break;
case 3u:
*a6 = cholmod_l_realloc(a1, 8uLL, *a6, (unsigned __int64 *)&v18, a9);
*a7 = cholmod_l_realloc(a1, 8uLL, *a7, &v17, a9);
break;
case 1u:
*a6 = cholmod_l_realloc(a1, 8uLL, *a6, (unsigned __int64 *)&v18, a9);
break;
}
if ( *(int *)(a9 + 2028) < 0 )
{
if ( v12 )
{
if ( a2 > 0 )
*a4 = cholmod_l_realloc(v12, 8uLL, *a4, v20, a9);
if ( a2 > 1 )
*a5 = cholmod_l_realloc(v12, 8uLL, *a5, (unsigned __int64 *)&v19, a9);
if ( a3 == 2 )
{
*a6 = cholmod_l_realloc(v12, 0x10uLL, *a6, (unsigned __int64 *)&v18, a9);
result = 0LL;
}
else if ( a3 == 3 )
{
*a6 = cholmod_l_realloc(v12, 8uLL, *a6, (unsigned __int64 *)&v18, a9);
*a7 = cholmod_l_realloc(v12, 8uLL, *a7, &v17, a9);
result = 0LL;
}
else
{
result = 0LL;
if ( a3 == 1 )
{
*a6 = cholmod_l_realloc(v12, 8uLL, *a6, (unsigned __int64 *)&v18, a9);
result = 0LL;
}
}
}
else
{
if ( a2 > 0 )
*a4 = cholmod_l_free(v20[0], 8LL, *a4, a9);
if ( a2 > 1 )
*a5 = cholmod_l_free(v19, 8LL, *a5, a9);
if ( a3 == 2 )
{
*a6 = cholmod_l_free(v18, 16LL, *a6, a9);
result = 0LL;
}
else if ( a3 == 3 )
{
*a6 = cholmod_l_free(v18, 8LL, *a6, a9);
*a7 = cholmod_l_free(v18, 8LL, *a7, a9);
result = 0LL;
}
else
{
result = 0LL;
if ( a3 == 1 )
{
*a6 = cholmod_l_free(v18, 8LL, *a6, a9);
result = 0LL;
}
}
}
}
else
{
if ( !v12 )
{
v13 = (_QWORD *)*a6;
switch ( a3 )
{
case 2u:
*v13 = 0LL;
v13[1] = 0LL;
break;
case 3u:
v14 = (_QWORD *)*a7;
*v13 = 0LL;
*v14 = 0LL;
break;
case 1u:
*v13 = 0LL;
break;
}
}
*a8 = a1;
result = 1LL;
}
}
}
else
{
*(_DWORD *)(a9 + 2028) = -4;
result = 0LL;
}
return result;
}

original_code:
int cholmod_l_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 != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    if (xtype < 0 || xtype > 3)
    {
 cholmod_l_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_l_realloc (nnew, sizeof (long), *Iblock, &i, Common) ;
    }
    if (nint > 1)
    {
 *Jblock = cholmod_l_realloc (nnew, sizeof (long), *Jblock, &j, Common) ;
    }
    switch (xtype)
    {
 case 1:
     *Xblock = cholmod_l_realloc (nnew, sizeof (double), *Xblock, &x,
                    Common) ;
     break ;
 case 2:
     *Xblock = cholmod_l_realloc (nnew, 2*sizeof (double), *Xblock, &x,
                    Common) ;
     break ;
 case 3:
     *Xblock = cholmod_l_realloc (nnew, sizeof (double), *Xblock, &x,
                    Common) ;
     *Zblock = cholmod_l_realloc (nnew, sizeof (double), *Zblock, &z,
                    Common) ;
     break ;
    }
    if (Common->status < 0)
    {
 if (nold == 0)
 {
     if (nint > 0)
     {
  *Iblock = cholmod_l_free (i, sizeof (long), *Iblock, Common) ;
     }
     if (nint > 1)
     {
  *Jblock = cholmod_l_free (j, sizeof (long), *Jblock, Common) ;
     }
     switch (xtype)
     {
  case 1:
      *Xblock = cholmod_l_free (x, sizeof (double), *Xblock,
                            Common) ;
      break ;
  case 2:
      *Xblock = cholmod_l_free (x, 2*sizeof (double), *Xblock,
                            Common) ;
      break ;
  case 3:
      *Xblock = cholmod_l_free (x, sizeof (double), *Xblock,
                            Common) ;
      *Zblock = cholmod_l_free (x, sizeof (double), *Zblock,
                            Common) ;
      break ;
     }
 }
 else
 {
     if (nint > 0)
     {
  *Iblock = cholmod_l_realloc (nold, sizeof (long), *Iblock, &i,
                            Common) ;
     }
     if (nint > 1)
     {
  *Jblock = cholmod_l_realloc (nold, sizeof (long), *Jblock, &j,
                            Common) ;
     }
     switch (xtype)
     {
  case 1:
      *Xblock = cholmod_l_realloc (nold, sizeof (double),
                            *Xblock, &x, Common) ;
      break ;
  case 2:
      *Xblock = cholmod_l_realloc (nold, 2*sizeof (double),
                            *Xblock, &x, Common) ;
      break ;
  case 3:
      *Xblock = cholmod_l_realloc (nold, sizeof (double),
                            *Xblock, &x, Common) ;
      *Zblock = cholmod_l_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_l_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 != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    if (xtype < 0 || xtype > 3)
    {
 cholmod_l_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_l_realloc (nnew, sizeof (long), *Iblock, &i, Common) ;
    }
    if (nint > 1)
    {
 *Jblock = cholmod_l_realloc (nnew, sizeof (long), *Jblock, &j, Common) ;
    }
    switch (xtype)
    {
 case 1:
     *Xblock = cholmod_l_realloc (nnew, sizeof (double), *Xblock, &x,
                    Common) ;
     break ;
 case 2:
     *Xblock = cholmod_l_realloc (nnew, 2*sizeof (double), *Xblock, &x,
                    Common) ;
     break ;
 case 3:
     *Xblock = cholmod_l_realloc (nnew, sizeof (double), *Xblock, &x,
                    Common) ;
     *Zblock = cholmod_l_realloc (nnew, sizeof (double), *Zblock, &z,
                    Common) ;
     break ;
    }
    if (Common->status < 0)
    {
 if (nold == 0)
 {
     if (nint > 0)
     {
  *Iblock = cholmod_l_free (i, sizeof (long), *Iblock, Common) ;
     }
     if (nint > 1)
     {
  *Jblock = cholmod_l_free (j, sizeof (long), *Jblock, Common) ;
     }
     switch (xtype)
     {
  case 1:
      *Xblock = cholmod_l_free (x, sizeof (double), *Xblock,
                            Common) ;
      break ;
  case 2:
      *Xblock = cholmod_l_free (x, 2*sizeof (double), *Xblock,
                            Common) ;
      break ;
  case 3:
      *Xblock = cholmod_l_free (x, sizeof (double), *Xblock,
                            Common) ;
      *Zblock = cholmod_l_free (x, sizeof (double), *Zblock,
                            Common) ;
      break ;
     }
 }
 else
 {
     if (nint > 0)
     {
  *Iblock = cholmod_l_realloc (nold, sizeof (long), *Iblock, &i,
                            Common) ;
     }
     if (nint > 1)
     {
  *Jblock = cholmod_l_realloc (nold, sizeof (long), *Jblock, &j,
                            Common) ;
     }
     switch (xtype)
     {
  case 1:
      *Xblock = cholmod_l_realloc (nold, sizeof (double),
                            *Xblock, &x, Common) ;
      break ;
  case 2:
      *Xblock = cholmod_l_realloc (nold, 2*sizeof (double),
                            *Xblock, &x, Common) ;
      break ;
  case 3:
      *Xblock = cholmod_l_realloc (nold, sizeof (double),
                            *Xblock, &x, Common) ;
      *Zblock = cholmod_l_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


decompiled_code:
double __fastcall cholmod_l_hypot(double a1, double a2)
{
__int64 v2; // xmm3_8
__int64 v3; // xmm2_8
double v4; // xmm1_8
double v5; // xmm1_8
double v7; // xmm0_8
double v8; // xmm0_8
double v9; // [rsp+0h] [rbp-18h]

v2 = *(_QWORD *)&a1 & LC4;
*(_QWORD *)&v9 = *(_QWORD *)&a1 & LC4;
v3 = LC4 & *(_QWORD *)&a2;
if ( COERCE_DOUBLE(*(_QWORD *)&a1 & LC4) < COERCE_DOUBLE(LC4 & *(_QWORD *)&a2) )
{
if ( *(double *)&v2 + *(double *)&v3 == *(double *)&v3 )
{
*(_QWORD *)&v9 = LC4 & *(_QWORD *)&a2;
}
else
{
v7 = a1 / a2 * (a1 / a2) + 1.0;
if ( v7 < 0.0 )
v8 = sqrt(v7);
else
v8 = sqrt(v7);
v9 = v8 * *(double *)&v3;
}
}
else if ( *(double *)&v3 + *(double *)&v2 != *(double *)&v2 )
{
v4 = a2 / a1 * (a2 / a1) + 1.0;
if ( v4 < 0.0 )
v5 = sqrt(v4);
else
v5 = sqrt(v4);
v9 = v5 * *(double *)&v2;
}
return v9;
}

canonical_decompiled_code:
double __fastcall func1(double a1, double a2)
{
__int64 v2; // xmm3_8
__int64 v3; // xmm2_8
double v4; // xmm1_8
double v5; // xmm1_8
double v7; // xmm0_8
double v8; // xmm0_8
double v9; // [rsp+0h] [rbp-18h]

v2 = *(_QWORD *)&a1 & LC4;
*(_QWORD *)&v9 = *(_QWORD *)&a1 & LC4;
v3 = LC4 & *(_QWORD *)&a2;
if ( COERCE_DOUBLE(*(_QWORD *)&a1 & LC4) < COERCE_DOUBLE(LC4 & *(_QWORD *)&a2) )
{
if ( *(double *)&v2 + *(double *)&v3 == *(double *)&v3 )
{
*(_QWORD *)&v9 = LC4 & *(_QWORD *)&a2;
}
else
{
v7 = a1 / a2 * (a1 / a2) + 1.0;
if ( v7 < 0.0 )
v8 = sqrt(v7);
else
v8 = sqrt(v7);
v9 = v8 * *(double *)&v3;
}
}
else if ( *(double *)&v3 + *(double *)&v2 != *(double *)&v2 )
{
v4 = a2 / a1 * (a2 / a1) + 1.0;
if ( v4 < 0.0 )
v5 = sqrt(v4);
else
v5 = sqrt(v4);
v9 = v5 * *(double *)&v2;
}
return v9;
}

original_code:
double cholmod_l_hypot (double x, double y)
{
    double s, r ;
    x = fabs (x) ;
    y = fabs (y) ;
    if (x >= y)
    {
 if (x + y == x)
 {
     s = x ;
 }
 else
 {
     r = y / x ;
     s = x * sqrt (1.0 + r*r) ;
 }
    }
    else
    {
 if (y + x == y)
 {
     s = y ;
 }
 else
 {
     r = x / y ;
     s = y * sqrt (1.0 + r*r) ;
 }
    }
    return (s) ;
}

canonical_original_code:
double cholmod_l_hypot(double x, double y)
{
    double s; double r;
    x = fabs (x) ;
    y = fabs (y) ;
    if (x >= y)
    {
 if (x + y == x)
 {
     s = x ;
 }
 else
 {
     r = y / x ;
     s = x * sqrt (1.0 + r*r) ;
 }
    }
    else
    {
 if (y + x == y)
 {
     s = y ;
 }
 else
 {
     r = x / y ;
     s = y * sqrt (1.0 + r*r) ;
 }
    }
    return (s) ;
}

variable_types: x double

variable_types: y double

variable_types: s double

variable_types: r double

return_type: double


decompiled_code:
_BOOL8 __fastcall cholmod_l_divcomplex(double *a1, double *a2, double a3, double a4, double a5, double a6)
{
double v7; // xmm4_8
double v8; // xmm2_8
double v9; // xmm0_8
double v10; // xmm4_8
double v12; // xmm4_8

if ( COERCE_DOUBLE(*(_QWORD *)&a5 & LC4) < COERCE_DOUBLE(LC4 & *(_QWORD *)&a6) )
{
v12 = a5 / a6;
v8 = a5 * (a5 / a6) + a6;
v9 = (v12 * a3 + a4) / v8;
v10 = (v12 * a4 - a3) / v8;
}
else
{
v7 = a6 / a5;
v8 = a5 + a6 * (a6 / a5);
v9 = (a4 * v7 + a3) / v8;
v10 = (a4 - a3 * v7) / v8;
}
*a1 = v9;
*a2 = v10;
return v8 == 0.0;
}

canonical_decompiled_code:
_BOOL8 __fastcall func2(double *a1, double *a2, double a3, double a4, double a5, double a6)
{
double v7; // xmm4_8
double v8; // xmm2_8
double v9; // xmm0_8
double v10; // xmm4_8
double v12; // xmm4_8

if ( COERCE_DOUBLE(*(_QWORD *)&a5 & LC4) < COERCE_DOUBLE(LC4 & *(_QWORD *)&a6) )
{
v12 = a5 / a6;
v8 = a5 * (a5 / a6) + a6;
v9 = (v12 * a3 + a4) / v8;
v10 = (v12 * a4 - a3) / v8;
}
else
{
v7 = a6 / a5;
v8 = a5 + a6 * (a6 / a5);
v9 = (a4 * v7 + a3) / v8;
v10 = (a4 - a3 * v7) / v8;
}
*a1 = v9;
*a2 = v10;
return v8 == 0.0;
}

original_code:
int cholmod_l_divcomplex
(
    double ar, double ai,
    double br, double bi,
    double *cr, double *ci
)
{
    double tr, ti, r, den ;
    if (fabs (br) >= fabs (bi))
    {
 r = bi / br ;
 den = br + r * bi ;
 tr = (ar + ai * r) / den ;
 ti = (ai - ar * r) / den ;
    }
    else
    {
 r = br / bi ;
 den = r * br + bi ;
 tr = (ar * r + ai) / den ;
 ti = (ai * r - ar) / den ;
    }
    *cr = tr ;
    *ci = ti ;
    return (((den) == 0.)) ;
}

canonical_original_code:
int cholmod_l_divcomplex(double ar, double ai, double br, double bi, double *cr, double *ci)
{
    double tr; double ti; double r; double den;
    if (fabs (br) >= fabs (bi))
    {
 r = bi / br ;
 den = br + r * bi ;
 tr = (ar + ai * r) / den ;
 ti = (ai - ar * r) / den ;
    }
    else
    {
 r = br / bi ;
 den = r * br + bi ;
 tr = (ar * r + ai) / den ;
 ti = (ai * r - ar) / den ;
    }
    *cr = tr ;
    *ci = ti ;
    return (((den) == 0.)) ;
}

variable_types: ar double

variable_types: ai double

variable_types: br double

variable_types: bi double

variable_types:
cr
double *

variable_types:
ci
double *

variable_types: tr double

variable_types: ti double

variable_types: den double

return_type: int


decompiled_code:
__int64 __fastcall cholmod_l_sparse_xtype(unsigned int a1, __int64 a2, __int64 a3)
{
__int64 result; // rax
unsigned int v5; // esi

if ( !a3 )
return 0LL;
if ( *(_QWORD *)(a3 + 2016) == 2LL )
{
if ( a2 )
{
v5 = *(_DWORD *)(a2 + 72);
if ( v5 > 3 || v5 && (!*(_QWORD *)(a2 + 48) || v5 == 3 && !*(_QWORD *)(a2 + 56)) )
{
result = 0LL;
if ( *(_DWORD *)(a3 + 2028) != -2 )
{
cholmod_l_error(4294967292LL, "../Core/cholmod_complex.c", 441LL, "invalid xtype", a3);
result = 0LL;
}
}
else
{
result = change_complexity(*(_QWORD *)(a2 + 16), v5, a1, 0, 3, (__int64 *)(a2 + 48), (__int64 *)(a2 + 56), a3);
if ( (_DWORD)result )
*(_DWORD *)(a2 + 72) = a1;
}
}
else
{
result = 0LL;
if ( *(_DWORD *)(a3 + 2028) != -2 )
{
cholmod_l_error(4294967292LL, "../Core/cholmod_complex.c", 440LL, "argument missing", a3);
result = 0LL;
}
}
}
else
{
*(_DWORD *)(a3 + 2028) = -4;
result = 0LL;
}
return result;
}

original_code:
int cholmod_l_sparse_xtype
(
    int to_xtype,
    cholmod_sparse *A,
    cholmod_common *Common
)
{
    long ok ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 440, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (0) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 441, "invalid xtype", Common) ; } return (0) ; } } ;
    ok = change_complexity (A->nzmax, A->xtype, to_xtype,
     0, 3, &(A->x), &(A->z), Common) ;
    if (ok)
    {
 A->xtype = to_xtype ;
    }
    return (ok) ;
}

canonical_original_code:
int cholmod_l_sparse_xtype(int to_xtype, struct cholmod_sparse_struct *A, struct cholmod_common_struct *Common)
{
    long ok;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 440, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (0) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 441, "invalid xtype", Common) ; } return (0) ; } } ;
    ok = change_complexity (A->nzmax, A->xtype, to_xtype,
     0, 3, &(A->x), &(A->z), Common) ;
    if (ok)
    {
 A->xtype = to_xtype ;
    }
    return (ok) ;
}

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

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

variable_types: ok long

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


decompiled_code:
__int64 __fastcall cholmod_l_triplet_xtype(unsigned int a1, __int64 a2, __int64 a3)
{
__int64 result; // rax
unsigned int v5; // esi

if ( !a3 )
return 0LL;
if ( *(_QWORD *)(a3 + 2016) == 2LL )
{
if ( a2 )
{
v5 = *(_DWORD *)(a2 + 72);
if ( v5 > 3 || v5 && (!*(_QWORD *)(a2 + 48) || v5 == 3 && !*(_QWORD *)(a2 + 56)) )
{
result = 0LL;
if ( *(_DWORD *)(a3 + 2028) != -2 )
{
cholmod_l_error(4294967292LL, "../Core/cholmod_complex.c", 473LL, "invalid xtype", a3);
result = 0LL;
}
}
else
{
result = change_complexity(*(_QWORD *)(a2 + 16), v5, a1, 0, 3, (__int64 *)(a2 + 48), (__int64 *)(a2 + 56), a3);
if ( (_DWORD)result )
*(_DWORD *)(a2 + 72) = a1;
}
}
else
{
result = 0LL;
if ( *(_DWORD *)(a3 + 2028) != -2 )
{
cholmod_l_error(4294967292LL, "../Core/cholmod_complex.c", 472LL, "argument missing", a3);
result = 0LL;
}
}
}
else
{
*(_DWORD *)(a3 + 2028) = -4;
result = 0LL;
}
return result;
}

original_code:
int cholmod_l_triplet_xtype
(
    int to_xtype,
    cholmod_triplet *T,
    cholmod_common *Common
)
{
    long ok ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((T) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 472, "argument missing", Common) ; } return (0) ; } } ;
    { if ((T)->xtype < (0) || (T)->xtype > (3) || ((T)->xtype != 0 && ((T)->x) == ((void *)0)) || ((T)->xtype == 3 && ((T)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 473, "invalid xtype", Common) ; } return (0) ; } } ;
    ok = change_complexity (T->nzmax, T->xtype, to_xtype,
     0, 3, &(T->x), &(T->z), Common) ;
    if (ok)
    {
 T->xtype = to_xtype ;
    }
    return (ok) ;
}

canonical_original_code:
int cholmod_l_triplet_xtype(int to_xtype, struct cholmod_triplet_struct *T, struct cholmod_common_struct *Common)
{
    long ok;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((T) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 472, "argument missing", Common) ; } return (0) ; } } ;
    { if ((T)->xtype < (0) || (T)->xtype > (3) || ((T)->xtype != 0 && ((T)->x) == ((void *)0)) || ((T)->xtype == 3 && ((T)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 473, "invalid xtype", Common) ; } return (0) ; } } ;
    ok = change_complexity (T->nzmax, T->xtype, to_xtype,
     0, 3, &(T->x), &(T->z), Common) ;
    if (ok)
    {
 T->xtype = to_xtype ;
    }
    return (ok) ;
}

variable_types: struct cholmod_triplet_struct { unsigned long nrow; unsigned long ncol; unsigned long nzmax; unsigned long nnz; void *i; void *j; void *x; void *z; int stype; int itype; int xtype; int dtype; } *

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_l_dense_xtype(unsigned int a1, __int64 a2, __int64 a3)
{
__int64 result; // rax
unsigned int v5; // esi

if ( !a3 )
return 0LL;
if ( *(_QWORD *)(a3 + 2016) == 2LL )
{
if ( a2 )
{
v5 = *(_DWORD *)(a2 + 48);
if ( v5 - 1 <= 2 && *(_QWORD *)(a2 + 32) && (v5 != 3 || *(_QWORD *)(a2 + 40)) )
{
result = change_complexity(*(_QWORD *)(a2 + 16), v5, a1, 1, 3, (__int64 *)(a2 + 32), (__int64 *)(a2 + 40), a3);
if ( (_DWORD)result )
*(_DWORD *)(a2 + 48) = a1;
}
else
{
result = 0LL;
if ( *(_DWORD *)(a3 + 2028) != -2 )
{
cholmod_l_error(4294967292LL, "../Core/cholmod_complex.c", 504LL, "invalid xtype", a3);
result = 0LL;
}
}
}
else
{
result = 0LL;
if ( *(_DWORD *)(a3 + 2028) != -2 )
{
cholmod_l_error(4294967292LL, "../Core/cholmod_complex.c", 503LL, "argument missing", a3);
result = 0LL;
}
}
}
else
{
*(_DWORD *)(a3 + 2028) = -4;
result = 0LL;
}
return result;
}

original_code:
int cholmod_l_dense_xtype
(
    int to_xtype,
    cholmod_dense *X,
    cholmod_common *Common
)
{
    long ok ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((X) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 503, "argument missing", Common) ; } return (0) ; } } ;
    { 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), "../Core/cholmod_complex.c", 504, "invalid xtype", Common) ; } return (0) ; } } ;
    ok = change_complexity (X->nzmax, X->xtype, to_xtype,
     1, 3, &(X->x), &(X->z), Common) ;
    if (ok)
    {
 X->xtype = to_xtype ;
    }
    return (ok) ;
}

canonical_original_code:
int cholmod_l_dense_xtype(int to_xtype, struct cholmod_dense_struct *X, struct cholmod_common_struct *Common)
{
    long ok;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((X) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 503, "argument missing", Common) ; } return (0) ; } } ;
    { 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), "../Core/cholmod_complex.c", 504, "invalid xtype", Common) ; } return (0) ; } } ;
    ok = change_complexity (X->nzmax, X->xtype, to_xtype,
     1, 3, &(X->x), &(X->z), Common) ;
    if (ok)
    {
 X->xtype = to_xtype ;
    }
    return (ok) ;
}

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


decompiled_code:
__int64 __fastcall cholmod_l_factor_xtype(unsigned int a1, __int64 a2, __int64 a3)
{
__int64 result; // rax
unsigned int v6; // esi
__int64 *v7; // rax
__int64 *v8; // r9
__int64 v9; // rdi

if ( !a3 )
return 0LL;
if ( *(_QWORD *)(a3 + 2016) != 2LL )
{
*(_DWORD *)(a3 + 2028) = -4;
return 0LL;
}
if ( a2 )
{
v6 = *(_DWORD *)(a2 + 188);
if ( v6 - 1 <= 2 && *(_QWORD *)(a2 + 56) )
{
if ( v6 != 3 )
{
if ( *(_DWORD *)(a2 + 176) )
{
if ( a1 != 3 )
{
v7 = (__int64 *)(a2 + 64);
v8 = (__int64 *)(a2 + 56);
v9 = *(_QWORD *)(a2 + 112);
goto LABEL_12;
}
LABEL_18:
cholmod_l_error(4294967292LL, "../Core/cholmod_complex.c", 539LL, "invalid xtype for supernodal L", a3);
return 0LL;
}
LABEL_22:
v7 = (__int64 *)(a2 + 64);
v8 = (__int64 *)(a2 + 56);
v9 = *(_QWORD *)(a2 + 32);
LABEL_12:
result = change_complexity(v9, v6, a1, 1, 3, v8, v7, a3);
if ( (_DWORD)result )
*(_DWORD *)(a2 + 188) = a1;
return result;
}
if ( *(_QWORD *)(a2 + 64) )
{
if ( *(_DWORD *)(a2 + 176) )
goto LABEL_18;
goto LABEL_22;
}
}
result = 0LL;
if ( *(_DWORD *)(a3 + 2028) != -2 )
{
cholmod_l_error(4294967292LL, "../Core/cholmod_complex.c", 535LL, "invalid xtype", a3);
result = 0LL;
}
}
else
{
result = 0LL;
if ( *(_DWORD *)(a3 + 2028) != -2 )
{
cholmod_l_error(4294967292LL, "../Core/cholmod_complex.c", 534LL, "argument missing", a3);
result = 0LL;
}
}
return result;
}

original_code:
int cholmod_l_factor_xtype
(
    int to_xtype,
    cholmod_factor *L,
    cholmod_common *Common
)
{
    long ok ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 534, "argument missing", Common) ; } return (0) ; } } ;
    { if ((L)->xtype < (1) || (L)->xtype > (3) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 535, "invalid xtype", Common) ; } return (0) ; } } ;
    if (L->is_super &&
     (L->xtype == 3 || to_xtype == 3))
    {
 cholmod_l_error ((-4), "../Core/cholmod_complex.c", 539, "invalid xtype for supernodal L", Common) ;
 return (0) ;
    }
    ok = change_complexity ((L->is_super ? L->xsize : L->nzmax), L->xtype,
     to_xtype, 1, 3, &(L->x), &(L->z), Common) ;
    if (ok)
    {
 L->xtype = to_xtype ;
    }
    return (ok) ;
}

canonical_original_code:
int cholmod_l_factor_xtype(int to_xtype, struct cholmod_factor_struct *L, struct cholmod_common_struct *Common)
{
    long ok;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 534, "argument missing", Common) ; } return (0) ; } } ;
    { if ((L)->xtype < (1) || (L)->xtype > (3) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Core/cholmod_complex.c", 535, "invalid xtype", Common) ; } return (0) ; } } ;
    if (L->is_super &&
     (L->xtype == 3 || to_xtype == 3))
    {
 cholmod_l_error ((-4), "../Core/cholmod_complex.c", 539, "invalid xtype for supernodal L", Common) ;
 return (0) ;
    }
    ok = change_complexity ((L->is_super ? L->xsize : L->nzmax), L->xtype,
     to_xtype, 1, 3, &(L->x), &(L->z), Common) ;
    if (ok)
    {
 L->xtype = to_xtype ;
    }
    return (ok) ;
}

variable_types: struct cholmod_factor_struct { unsigned long n; unsigned long minor; void *Perm; void *ColCount; unsigned long nzmax; void *p; void *i; void *x; void *z; void *nz; void *next; void *prev; unsigned long nsuper; unsigned long ssize; unsigned long xsize; unsigned long maxcsize; unsigned long maxesize; void *super; void *pi; void *px; void *s; int ordering; int is_ll; int is_super; int is_monotonic; int itype; int xtype; int dtype; } *


original_code:
int cholmod_defaults
(
    cholmod_common *Common
)
{
    int i ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || 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_defaults(struct cholmod_common_struct *Common)
{
    int i;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || 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: i int


original_code:
int cholmod_start
(
    cholmod_common *Common
)
{
    int k ;
    if (Common == ((void *)0))
    {
 return (0) ;
    }
    Common->error_handler = ((void *)0) ;
    Common->itype = 0 ;
    Common->dtype = 0 ;
    cholmod_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_divcomplex ;
    Common->hypotenuse = cholmod_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_start(struct cholmod_common_struct *Common)
{
    int k;
    if (Common == ((void *)0))
    {
 return (0) ;
    }
    Common->error_handler = ((void *)0) ;
    Common->itype = 0 ;
    Common->dtype = 0 ;
    cholmod_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_divcomplex ;
    Common->hypotenuse = cholmod_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_free_work
(
    cholmod_common *Common
)
{
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->Flag = cholmod_free (Common->nrow, sizeof (int),
     Common->Flag, Common) ;
    Common->Head = cholmod_free (Common->nrow+1, sizeof (int),
     Common->Head, Common) ;
    Common->Iwork = cholmod_free (Common->iworksize, sizeof (int),
     Common->Iwork, Common) ;
    Common->Xwork = cholmod_free (Common->xworksize, sizeof (double),
     Common->Xwork, Common) ;
    Common->nrow = 0 ;
    Common->iworksize = 0 ;
    Common->xworksize = 0 ;
    return (1) ;
}

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


decompiled_code:
__int64 __fastcall cholmod_finish(__int64 a1)
{
return cholmod_free_work(a1);
}

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

original_code:
int cholmod_finish
(
    cholmod_common *Common
)
{
    return (cholmod_free_work (Common)) ;
}

canonical_original_code:
int cholmod_finish(struct cholmod_common_struct *Common)
{
    return (cholmod_free_work (Common)) ;
}


original_code:
long cholmod_clear_flag
(
    cholmod_common *Common
)
{
    int i, nrow, *Flag ;
    { if (Common == ((void *)0)) { return (-1) ; } if (Common->itype != 0 || 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_clear_flag(struct cholmod_common_struct *Common)
{
    int i; int nrow; int *Flag;
    { if (Common == ((void *)0)) { return (-1) ; } if (Common->itype != 0 || 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: nrow int

variable_types:
Flag
int *

return_type: long


original_code:
int cholmod_allocate_work
(
    size_t nrow,
    size_t iworksize,
    size_t xworksize,
    cholmod_common *Common
)
{
    double *W ;
    int *Head ;
    int i ;
    size_t nrow1 ;
    int ok = 1 ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->status = 0 ;
    nrow = (((1) > (nrow)) ? (1) : (nrow)) ;
    nrow1 = cholmod_add_size_t (nrow, 1, &ok) ;
    if (!ok)
    {
 Common->status = (-3) ;
 cholmod_free_work (Common) ;
 return (0) ;
    }
    if (nrow > Common->nrow)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 Common->Flag = cholmod_free (Common->nrow, sizeof (int), Common->Flag,
  Common) ;
 Common->Head = cholmod_free (Common->nrow+1,sizeof (int), Common->Head,
  Common) ;
 Common->Flag = cholmod_malloc (nrow, sizeof (int), Common) ;
 Common->Head = cholmod_malloc (nrow1, sizeof (int), Common) ;
 Common->nrow = nrow ;
 if (Common->status < 0)
 {
     cholmod_free_work (Common) ;
     return (0) ;
 }
 Common->mark = (-1) ;
 cholmod_clear_flag (Common) ;
 Head = Common->Head ;
 for (i = 0 ; i <= (int) (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_free (Common->iworksize, sizeof (int), Common->Iwork, Common) ;
 Common->Iwork = cholmod_malloc (iworksize, sizeof (int), Common) ;
 Common->iworksize = iworksize ;
 if (Common->status < 0)
 {
     cholmod_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_free (Common->xworksize, sizeof (double), Common->Xwork,
  Common) ;
 Common->Xwork = cholmod_malloc (xworksize, sizeof (double), Common) ;
 Common->xworksize = xworksize ;
 if (Common->status < 0)
 {
     cholmod_free_work (Common) ;
     return (0) ;
 }
 W = Common->Xwork ;
 for (i = 0 ; i < (int) xworksize ; i++)
 {
     W [i] = 0. ;
 }
    }
    return (1) ;
}

canonical_original_code:
int cholmod_allocate_work(unsigned long nrow, unsigned long iworksize, unsigned long xworksize, struct cholmod_common_struct *Common)
{
    double *W;
    int *Head;
    int i;
    unsigned long nrow1;
    int ok = 1;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    Common->status = 0 ;
    nrow = (((1) > (nrow)) ? (1) : (nrow)) ;
    nrow1 = cholmod_add_size_t (nrow, 1, &ok) ;
    if (!ok)
    {
 Common->status = (-3) ;
 cholmod_free_work (Common) ;
 return (0) ;
    }
    if (nrow > Common->nrow)
    {
 if (Common->no_workspace_reallocate)
 {
     Common->status = (-4) ;
     return (0) ;
 }
 Common->Flag = cholmod_free (Common->nrow, sizeof (int), Common->Flag,
  Common) ;
 Common->Head = cholmod_free (Common->nrow+1,sizeof (int), Common->Head,
  Common) ;
 Common->Flag = cholmod_malloc (nrow, sizeof (int), Common) ;
 Common->Head = cholmod_malloc (nrow1, sizeof (int), Common) ;
 Common->nrow = nrow ;
 if (Common->status < 0)
 {
     cholmod_free_work (Common) ;
     return (0) ;
 }
 Common->mark = (-1) ;
 cholmod_clear_flag (Common) ;
 Head = Common->Head ;
 for (i = 0 ; i <= (int) (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_free (Common->iworksize, sizeof (int), Common->Iwork, Common) ;
 Common->Iwork = cholmod_malloc (iworksize, sizeof (int), Common) ;
 Common->iworksize = iworksize ;
 if (Common->status < 0)
 {
     cholmod_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_free (Common->xworksize, sizeof (double), Common->Xwork,
  Common) ;
 Common->Xwork = cholmod_malloc (xworksize, sizeof (double), Common) ;
 Common->xworksize = xworksize ;
 if (Common->status < 0)
 {
     cholmod_free_work (Common) ;
     return (0) ;
 }
 W = Common->Xwork ;
 for (i = 0 ; i < (int) xworksize ; i++)
 {
     W [i] = 0. ;
 }
    }
    return (1) ;
}

variable_types:
nrow
unsigned long

variable_types:
iworksize
unsigned long

variable_types:
xworksize
unsigned long

variable_types:
W
double *

variable_types:
Head
int *

variable_types: ok int


decompiled_code:
unsigned __int64 __fastcall cholmod_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) )
{
*(_DWORD *)(a2 + 2028) = -4;
result = 0LL;
}
else
{
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;
}
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) )
{
*(_DWORD *)(a2 + 2028) = -4;
result = 0LL;
}
else
{
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;
}
return result;
}

original_code:
size_t cholmod_maxrank
(
    size_t n,
    cholmod_common *Common
)
{
    size_t maxrank ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || 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_maxrank(unsigned long n, struct cholmod_common_struct *Common)
{
    unsigned long maxrank;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || 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

return_type: unsigned long


decompiled_code:
double __fastcall cholmod_dbound(__int64 a1, double a2)
{
double v2; // rbx

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

canonical_decompiled_code:
double __fastcall func7(__int64 a1, double a2)
{
double v2; // rbx

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

original_code:
double cholmod_dbound
(
    double dj,
    cholmod_common *Common
)
{
    double dbound ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || 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_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_error ((2), "../Core/cholmod_common.c", 695, "diagonal below threshold", Common) ;
  }
     }
 }
    }
    return (dj) ;
}

canonical_original_code:
double cholmod_dbound(double dj, struct cholmod_common_struct *Common)
{
    double dbound;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || 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_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_error ((2), "../Core/cholmod_common.c", 695, "diagonal below threshold", Common) ;
  }
     }
 }
    }
    return (dj) ;
}

variable_types: dj double

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: dbound double


decompiled_code:
__int64 __fastcall umfpack_dl_report_matrix(__int64 a1, __int64 a2, _QWORD *a3, __int64 a4, __int64 a5, __int64 a6, double *a7)
{
__int64 result; // rax
__int64 v9; // rbp
__int64 v10; // rbx
__int64 i; // rsi
__int64 v12; // rax
__int64 j; // rdx
__int64 v14; // r12
__int64 v15; // rbx
__int64 v16; // rbp
__int64 v17; // rbx
__int64 v18; // r15
__int64 v19; // rbx
__int64 v20; // r13
char v21; // al
__int64 v22; // r14
double v23; // xmm0_8
__int64 v26; // [rsp+18h] [rbp-90h]
__int64 v27; // [rsp+20h] [rbp-88h]
__int64 v28; // [rsp+28h] [rbp-80h]
const char *v29; // [rsp+30h] [rbp-78h]
const char *v30; // [rsp+38h] [rbp-70h]
__int64 v31; // [rsp+40h] [rbp-68h]
__int64 v32; // [rsp+48h] [rbp-60h]
__int64 v33; // [rsp+50h] [rbp-58h]
_QWORD *v34; // [rsp+60h] [rbp-48h]
__int64 v35; // [rsp+68h] [rbp-40h]

if ( !a7 )
return 0LL;
v27 = (unsigned int)(int)*a7;
result = 0LL;
if ( (unsigned __int64)v27 > 2 )
{
if ( a6 )
{
v26 = a1;
v9 = a2;
v30 = (const char *)&LC0;
v29 = "column";
}
else
{
v26 = a2;
v9 = a1;
v30 = "column";
v29 = (const char *)&LC0;
}
if ( amd_printf )
{
amd_printf("%s-form matrix, n_row %ld n_col %ld, ", v29, a1, a2);
if ( a1 <= 0 || a2 <= 0 )
{
if ( amd_printf )
amd_printf("ERROR: n_row <= 0 or n_col <= 0\n\n");
return -6LL;
}
if ( !a3 )
{
if ( amd_printf )
amd_printf("ERROR: Ap missing\n\n");
return -5LL;
}
}
else
{
if ( a2 <= 0 || a1 <= 0 )
return -6LL;
if ( !a3 )
return -5LL;
}
v10 = a3[v9];
if ( amd_printf )
{
amd_printf("nz = %ld. ", a3[v9]);
if ( v10 < 0 )
{
if ( amd_printf )
amd_printf("ERROR: number of entries < 0\n\n");
return -8LL;
}
if ( *a3 )
{
if ( amd_printf )
amd_printf("ERROR: Ap [%ld] = %ld must be %ld\n\n", 0LL, *a3, 0LL);
return -8LL;
}
}
else
{
if ( v10 < 0 )
return -8LL;
if ( *a3 )
return -8LL;
}
if ( a4 )
{
if ( v27 <= 3 )
{
if ( v9 <= 0 )
goto LABEL_112;
}
else
{
if ( amd_printf )
amd_printf("\n");
if ( v9 <= 0 )
{
LABEL_91:
result = 0LL;
if ( !amd_printf )
return result;
amd_printf(" %s-form matrix ", v29);
goto LABEL_112;
}
}
for ( i = 0LL; ; ++i )
{
v12 = a3[i];
if ( v12 < 0 )
{
result = -8LL;
if ( amd_printf )
{
amd_printf("ERROR: Ap [%ld] < 0\n\n", i);
result = -8LL;
}
return result;
}
if ( v12 > v10 )
{
result = -8LL;
if ( amd_printf )
{
amd_printf("ERROR: Ap [%ld] > size of Ai\n\n", i);
result = -8LL;
}
return result;
}
if ( v9 == i + 1 )
break;
}
for ( j = 0LL; (__int64)(a3[j + 1] - a3[j]) >= 0; ++j )
{
if ( i == j )
{
v14 = v27;
v33 = 0LL;
v35 = i + 1;
v34 = a3;
while ( 1 )
{
if ( v33 <= 9 )
v14 = v27;
v15 = v34[v33];
v16 = v34[v33 + 1];
v32 = v16 - v15;
if ( v14 > 3 && amd_printf )
amd_printf("\n %s %ld: start: %ld end: %ld entries: %ld\n", v29, v33, v15, v16 - 1, v34[v33 + 1] - v15);
if ( v15 < v16 )
break;
LABEL_83:
if ( v35 > 10 && v33 == 9 && v14 == 4 )
{
if ( amd_printf )
amd_printf("\n ...\n");
v14 = 3LL;
}
else if ( v33 + 1 >= v35 )
{
if ( v27 > 3 )
goto LABEL_91;
LABEL_112:
if ( amd_printf )
amd_printf("OK\n\n");
return 0LL;
}
++v33;
}
v28 = v16 - v15;
v17 = 8 * v15;
v18 = a4 + v17;
v31 = a5 + v17;
v19 = 0LL;
v20 = -1LL;
while ( 2 )
{
v22 = v20;
v20 = *(_QWORD *)(v18 + 8 * v19);
v21 = 0;
if ( v14 > 3 )
{
if ( amd_printf )
{
amd_printf("\t%s %ld ", v30, *(_QWORD *)(v18 + 8 * v19));
if ( a5 )
{
if ( amd_printf )
amd_printf(":");
LABEL_70:
v23 = *(double *)(v31 + 8 * v19);
if ( v23 == 0.0 )
{
v21 = 1;
if ( amd_printf )
{
amd_printf(" (0)");
v21 = 1;
}
}
else
{
v21 = 1;
if ( amd_printf )
{
amd_printf(" (%g)", v23);
v21 = 1;
}
}
}
else
{
v21 = 1;
}
}
else
{
if ( a5 )
goto LABEL_70;
v21 = 1;
}
}
if ( v20 < 0 || v26 <= v20 )
{
result = -8LL;
if ( amd_printf )
{
amd_printf(" ERROR: %s index %ld out of range in %s %ld\n\n", v30, v20, v29, v33);
result = -8LL;
}
return result;
}
if ( v20 <= v22 )
{
result = -8LL;
if ( amd_printf )
{
amd_printf(" ERROR: %s index %ld out of order (or duplicate) in %s %ld\n\n", v30, v20, v29, v33);
result = -8LL;
}
return result;
}
if ( v21 && amd_printf )
amd_printf("\n");
if ( v14 == 4 && v32 > 10 && v19 == 9 )
{
if ( amd_printf )
amd_printf("\t...\n");
v14 = 3LL;
}
if ( ++v19 == v28 )
goto LABEL_83;
continue;
}
}
}
result = -8LL;
if ( amd_printf )
{
amd_printf("ERROR: # entries in %s %ld is < 0\n\n", v29, j);
result = -8LL;
}
}
else
{
result = -5LL;
if ( amd_printf )
{
amd_printf("ERROR: Ai missing\n\n");
result = -5LL;
}
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, _QWORD *a3, __int64 a4, __int64 a5, __int64 a6, double *a7)
{
__int64 result; // rax
__int64 v9; // rbp
__int64 v10; // rbx
__int64 i; // rsi
__int64 v12; // rax
__int64 j; // rdx
__int64 v14; // r12
__int64 v15; // rbx
__int64 v16; // rbp
__int64 v17; // rbx
__int64 v18; // r15
__int64 v19; // rbx
__int64 v20; // r13
char v21; // al
__int64 v22; // r14
double v23; // xmm0_8
__int64 v26; // [rsp+18h] [rbp-90h]
__int64 v27; // [rsp+20h] [rbp-88h]
__int64 v28; // [rsp+28h] [rbp-80h]
const char *v29; // [rsp+30h] [rbp-78h]
const char *v30; // [rsp+38h] [rbp-70h]
__int64 v31; // [rsp+40h] [rbp-68h]
__int64 v32; // [rsp+48h] [rbp-60h]
__int64 v33; // [rsp+50h] [rbp-58h]
_QWORD *v34; // [rsp+60h] [rbp-48h]
__int64 v35; // [rsp+68h] [rbp-40h]

if ( !a7 )
return 0LL;
v27 = (unsigned int)(int)*a7;
result = 0LL;
if ( (unsigned __int64)v27 > 2 )
{
if ( a6 )
{
v26 = a1;
v9 = a2;
v30 = (const char *)&LC0;
v29 = "column";
}
else
{
v26 = a2;
v9 = a1;
v30 = "column";
v29 = (const char *)&LC0;
}
if ( amd_printf )
{
amd_printf("%s-form matrix, n_row %ld n_col %ld, ", v29, a1, a2);
if ( a1 <= 0 || a2 <= 0 )
{
if ( amd_printf )
amd_printf("ERROR: n_row <= 0 or n_col <= 0\n\n");
return -6LL;
}
if ( !a3 )
{
if ( amd_printf )
amd_printf("ERROR: Ap missing\n\n");
return -5LL;
}
}
else
{
if ( a2 <= 0 || a1 <= 0 )
return -6LL;
if ( !a3 )
return -5LL;
}
v10 = a3[v9];
if ( amd_printf )
{
amd_printf("nz = %ld. ", a3[v9]);
if ( v10 < 0 )
{
if ( amd_printf )
amd_printf("ERROR: number of entries < 0\n\n");
return -8LL;
}
if ( *a3 )
{
if ( amd_printf )
amd_printf("ERROR: Ap [%ld] = %ld must be %ld\n\n", 0LL, *a3, 0LL);
return -8LL;
}
}
else
{
if ( v10 < 0 )
return -8LL;
if ( *a3 )
return -8LL;
}
if ( a4 )
{
if ( v27 <= 3 )
{
if ( v9 <= 0 )
goto LABEL_112;
}
else
{
if ( amd_printf )
amd_printf("\n");
if ( v9 <= 0 )
{
LABEL_91:
result = 0LL;
if ( !amd_printf )
return result;
amd_printf(" %s-form matrix ", v29);
goto LABEL_112;
}
}
for ( i = 0LL; ; ++i )
{
v12 = a3[i];
if ( v12 < 0 )
{
result = -8LL;
if ( amd_printf )
{
amd_printf("ERROR: Ap [%ld] < 0\n\n", i);
result = -8LL;
}
return result;
}
if ( v12 > v10 )
{
result = -8LL;
if ( amd_printf )
{
amd_printf("ERROR: Ap [%ld] > size of Ai\n\n", i);
result = -8LL;
}
return result;
}
if ( v9 == i + 1 )
break;
}
for ( j = 0LL; (__int64)(a3[j + 1] - a3[j]) >= 0; ++j )
{
if ( i == j )
{
v14 = v27;
v33 = 0LL;
v35 = i + 1;
v34 = a3;
while ( 1 )
{
if ( v33 <= 9 )
v14 = v27;
v15 = v34[v33];
v16 = v34[v33 + 1];
v32 = v16 - v15;
if ( v14 > 3 && amd_printf )
amd_printf("\n %s %ld: start: %ld end: %ld entries: %ld\n", v29, v33, v15, v16 - 1, v34[v33 + 1] - v15);
if ( v15 < v16 )
break;
LABEL_83:
if ( v35 > 10 && v33 == 9 && v14 == 4 )
{
if ( amd_printf )
amd_printf("\n ...\n");
v14 = 3LL;
}
else if ( v33 + 1 >= v35 )
{
if ( v27 > 3 )
goto LABEL_91;
LABEL_112:
if ( amd_printf )
amd_printf("OK\n\n");
return 0LL;
}
++v33;
}
v28 = v16 - v15;
v17 = 8 * v15;
v18 = a4 + v17;
v31 = a5 + v17;
v19 = 0LL;
v20 = -1LL;
while ( 2 )
{
v22 = v20;
v20 = *(_QWORD *)(v18 + 8 * v19);
v21 = 0;
if ( v14 > 3 )
{
if ( amd_printf )
{
amd_printf("\t%s %ld ", v30, *(_QWORD *)(v18 + 8 * v19));
if ( a5 )
{
if ( amd_printf )
amd_printf(":");
LABEL_70:
v23 = *(double *)(v31 + 8 * v19);
if ( v23 == 0.0 )
{
v21 = 1;
if ( amd_printf )
{
amd_printf(" (0)");
v21 = 1;
}
}
else
{
v21 = 1;
if ( amd_printf )
{
amd_printf(" (%g)", v23);
v21 = 1;
}
}
}
else
{
v21 = 1;
}
}
else
{
if ( a5 )
goto LABEL_70;
v21 = 1;
}
}
if ( v20 < 0 || v26 <= v20 )
{
result = -8LL;
if ( amd_printf )
{
amd_printf(" ERROR: %s index %ld out of range in %s %ld\n\n", v30, v20, v29, v33);
result = -8LL;
}
return result;
}
if ( v20 <= v22 )
{
result = -8LL;
if ( amd_printf )
{
amd_printf(" ERROR: %s index %ld out of order (or duplicate) in %s %ld\n\n", v30, v20, v29, v33);
result = -8LL;
}
return result;
}
if ( v21 && amd_printf )
amd_printf("\n");
if ( v14 == 4 && v32 > 10 && v19 == 9 )
{
if ( amd_printf )
amd_printf("\t...\n");
v14 = 3LL;
}
if ( ++v19 == v28 )
goto LABEL_83;
continue;
}
}
}
result = -8LL;
if ( amd_printf )
{
amd_printf("ERROR: # entries in %s %ld is < 0\n\n", v29, j);
result = -8LL;
}
}
else
{
result = -5LL;
if ( amd_printf )
{
amd_printf("ERROR: Ai missing\n\n");
result = -5LL;
}
}
}
return result;
}

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

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

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
Control
double [20]

variable_types: a double

variable_types: prl long

variable_types: i long

variable_types: k long

variable_types: length long

variable_types: ilast long

variable_types: p long

variable_types: nz long

variable_types: n long


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

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

variable_types: nchains long

variable_types: nfr long

variable_types: esize long

variable_types: units double


decompiled_code:
__int64 __fastcall umfdi_kernel(__int64 a1, __int64 a2, __int64 a3, __int64 a4, _DWORD *a5, __int64 a6)
{
int v9; // eax
int v10; // er15
int v11; // er14
int v12; // er13
int v13; // eax
int v14; // edx
int v15; // esi
__int64 v16; // rax
int v17; // ecx
__int64 result; // rax
bool v19; // r13
double v20; // [rsp+0h] [rbp-68h]
int v21; // [rsp+Ch] [rbp-5Ch]
__int64 v22; // [rsp+10h] [rbp-58h]
__int64 v23; // [rsp+18h] [rbp-50h]
__int64 v24; // [rsp+20h] [rbp-48h]
__int64 v25; // [rsp+28h] [rbp-40h]

if ( !(unsigned int)umfdi_kernel_init() )
return 4294967285LL;
v9 = *(_DWORD *)(a6 + 64);
v24 = *(_QWORD *)(a6 + 72);
v22 = *(_QWORD *)(a6 + 104);
v10 = *(_DWORD *)(a6 + 220);
v11 = *(_DWORD *)(a6 + 244);
v20 = *(double *)(a4 + 24);
if ( v9 <= 0 )
{
LABEL_37:
umfdi_kernel_wrapup(a4, a6, a5);
return 0LL;
}
v25 = (unsigned int)v9;
v23 = 0LL;
while ( 2 )
{
v12 = *(_DWORD *)(v24 + 4 * v23);
v21 = *(_DWORD *)(v24 + 4 * v23 + 4);
if ( !(unsigned int)umfdi_start_front((unsigned int)v23, a4, a5, a6) )
return 0xFFFFFFFFLL;
a5[195] = v12;
if ( v21 <= v12 )
goto LABEL_33;
while ( 2 )
{
v13 = *(_DWORD *)(v22 + 4LL * v12);
a5[181] = v13;
v14 = a5[182];
a5[183] = v14;
a5[184] = v13 + v14 - 1;
if ( v11 )
{
v15 = 1;
}
else
{
v15 = 128;
if ( v13 <= 128 )
v15 = v13;
if ( v13 <= 0 )
goto LABEL_15;
}
v16 = 0LL;
do
{
v17 = v14++;
a5[v16++ + 49] = v17;
}
while ( v15 > (int)v16 );
a5[182] = v14;
LABEL_15:
a5[177] = v15;
while ( (int)a5[181] > 0 )
{
result = umfdi_local_search(a4, a5, a6);
if ( (_DWORD)result == -11 )
return result;
if ( (_DWORD)result != 1 )
{
if ( a5[188] )
{
umfdi_blas3_update(a5);
if ( v20 <= 0.0 )
{
if ( !(unsigned int)umfdi_store_lu(a4, a5) )
return 0xFFFFFFFFLL;
}
else if ( !(unsigned int)umfdi_store_lu_drop(a4, a5) )
{
return 0xFFFFFFFFLL;
}
}
if ( a5[187] )
{
if ( !(unsigned int)umfdi_extend_front(a4, a5) )
return 0xFFFFFFFFLL;
}
else
{
if ( !(unsigned int)umfdi_create_element(a4, a5, a6) )
return 0xFFFFFFFFLL;
if ( !(unsigned int)umfdi_init_front(a4, a5) )
return 0xFFFFFFFFLL;
}
if ( v11 )
umfdi_assemble_fixq(a4, a5);
else
umfdi_assemble(a4, a5);
umfdi_scale_column(a4, a5);
if ( !a5[344] )
{
v19 = 1;
goto LABEL_26;
}
v19 = a5[345] == 0;
if ( a5[352] < v10 && a5[345] )
{
a5[358] = 0;
a5[359] = 0;
}
else
{
LABEL_26:
umfdi_blas3_update(a5);
if ( v20 <= 0.0 )
{
if ( !(unsigned int)umfdi_store_lu(a4, a5) )
return 0xFFFFFFFFLL;
}
else if ( !(unsigned int)umfdi_store_lu_drop(a4, a5) )
{
return 0xFFFFFFFFLL;
}
a5[358] = 0;
a5[359] = 0;
if ( v19 )
{
umfdi_create_element(a4, a5, a6);
a5[344] = 0;
a5[345] = 0;
}
}
}
}
v12 = a5[195] + 1;
a5[195] = v12;
if ( v21 > v12 )
continue;
break;
}
LABEL_33:
umfdi_blas3_update(a5);
if ( v20 <= 0.0 )
{
if ( !(unsigned int)umfdi_store_lu(a4, a5) )
return 0xFFFFFFFFLL;
LABEL_35:
a5[356] = a5[344];
a5[357] = a5[345];
if ( !(unsigned int)umfdi_create_element(a4, a5, a6) )
return 0xFFFFFFFFLL;
a5[344] = 0;
a5[345] = 0;
if ( v25 == ++v23 )
goto LABEL_37;
continue;
}
break;
}
if ( (unsigned int)umfdi_store_lu_drop(a4, a5) )
goto LABEL_35;
return 0xFFFFFFFFLL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, __int64 a3, __int64 a4, _DWORD *a5, __int64 a6)
{
int v9; // eax
int v10; // er15
int v11; // er14
int v12; // er13
int v13; // eax
int v14; // edx
int v15; // esi
__int64 v16; // rax
int v17; // ecx
__int64 result; // rax
bool v19; // r13
double v20; // [rsp+0h] [rbp-68h]
int v21; // [rsp+Ch] [rbp-5Ch]
__int64 v22; // [rsp+10h] [rbp-58h]
__int64 v23; // [rsp+18h] [rbp-50h]
__int64 v24; // [rsp+20h] [rbp-48h]
__int64 v25; // [rsp+28h] [rbp-40h]

if ( !(unsigned int)umfdi_kernel_init() )
return 4294967285LL;
v9 = *(_DWORD *)(a6 + 64);
v24 = *(_QWORD *)(a6 + 72);
v22 = *(_QWORD *)(a6 + 104);
v10 = *(_DWORD *)(a6 + 220);
v11 = *(_DWORD *)(a6 + 244);
v20 = *(double *)(a4 + 24);
if ( v9 <= 0 )
{
LABEL_37:
umfdi_kernel_wrapup(a4, a6, a5);
return 0LL;
}
v25 = (unsigned int)v9;
v23 = 0LL;
while ( 2 )
{
v12 = *(_DWORD *)(v24 + 4 * v23);
v21 = *(_DWORD *)(v24 + 4 * v23 + 4);
if ( !(unsigned int)umfdi_start_front((unsigned int)v23, a4, a5, a6) )
return 0xFFFFFFFFLL;
a5[195] = v12;
if ( v21 <= v12 )
goto LABEL_33;
while ( 2 )
{
v13 = *(_DWORD *)(v22 + 4LL * v12);
a5[181] = v13;
v14 = a5[182];
a5[183] = v14;
a5[184] = v13 + v14 - 1;
if ( v11 )
{
v15 = 1;
}
else
{
v15 = 128;
if ( v13 <= 128 )
v15 = v13;
if ( v13 <= 0 )
goto LABEL_15;
}
v16 = 0LL;
do
{
v17 = v14++;
a5[v16++ + 49] = v17;
}
while ( v15 > (int)v16 );
a5[182] = v14;
LABEL_15:
a5[177] = v15;
while ( (int)a5[181] > 0 )
{
result = umfdi_local_search(a4, a5, a6);
if ( (_DWORD)result == -11 )
return result;
if ( (_DWORD)result != 1 )
{
if ( a5[188] )
{
umfdi_blas3_update(a5);
if ( v20 <= 0.0 )
{
if ( !(unsigned int)umfdi_store_lu(a4, a5) )
return 0xFFFFFFFFLL;
}
else if ( !(unsigned int)umfdi_store_lu_drop(a4, a5) )
{
return 0xFFFFFFFFLL;
}
}
if ( a5[187] )
{
if ( !(unsigned int)umfdi_extend_front(a4, a5) )
return 0xFFFFFFFFLL;
}
else
{
if ( !(unsigned int)umfdi_create_element(a4, a5, a6) )
return 0xFFFFFFFFLL;
if ( !(unsigned int)umfdi_init_front(a4, a5) )
return 0xFFFFFFFFLL;
}
if ( v11 )
umfdi_assemble_fixq(a4, a5);
else
umfdi_assemble(a4, a5);
umfdi_scale_column(a4, a5);
if ( !a5[344] )
{
v19 = 1;
goto LABEL_26;
}
v19 = a5[345] == 0;
if ( a5[352] < v10 && a5[345] )
{
a5[358] = 0;
a5[359] = 0;
}
else
{
LABEL_26:
umfdi_blas3_update(a5);
if ( v20 <= 0.0 )
{
if ( !(unsigned int)umfdi_store_lu(a4, a5) )
return 0xFFFFFFFFLL;
}
else if ( !(unsigned int)umfdi_store_lu_drop(a4, a5) )
{
return 0xFFFFFFFFLL;
}
a5[358] = 0;
a5[359] = 0;
if ( v19 )
{
umfdi_create_element(a4, a5, a6);
a5[344] = 0;
a5[345] = 0;
}
}
}
}
v12 = a5[195] + 1;
a5[195] = v12;
if ( v21 > v12 )
continue;
break;
}
LABEL_33:
umfdi_blas3_update(a5);
if ( v20 <= 0.0 )
{
if ( !(unsigned int)umfdi_store_lu(a4, a5) )
return 0xFFFFFFFFLL;
LABEL_35:
a5[356] = a5[344];
a5[357] = a5[345];
if ( !(unsigned int)umfdi_create_element(a4, a5, a6) )
return 0xFFFFFFFFLL;
a5[344] = 0;
a5[345] = 0;
if ( v25 == ++v23 )
goto LABEL_37;
continue;
}
break;
}
if ( (unsigned int)umfdi_store_lu_drop(a4, a5) )
goto LABEL_35;
return 0xFFFFFFFFLL;
}

original_code:
int umfdi_kernel
(
    const int Ap [ ],
    const int Ai [ ],
    const double Ax [ ],
    NumericType *Numeric,
    WorkType *Work,
    SymbolicType *Symbolic
)
{
    int j, f1, f2, chain, nchains, *Chain_start, status, fixQ, evaporate,
 *Front_npivcol, jmax, nb, drop ;
    if (!umfdi_kernel_init (Ap, Ai, Ax,
 Numeric, Work, Symbolic))
    {
 ;
 return ((-11)) ;
    }
    nchains = Symbolic->nchains ;
    Chain_start = Symbolic->Chain_start ;
    Front_npivcol = Symbolic->Front_npivcol ;
    nb = Symbolic->nb ;
    fixQ = Symbolic->fixQ ;
    drop = Numeric->droptol > 0.0 ;
    for (chain = 0 ; chain < nchains ; chain++)
    {
 f1 = Chain_start [chain] ;
 f2 = Chain_start [chain+1] - 1 ;
 { if (! (umfdi_start_front (chain, Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 for (Work->frontid = f1 ; Work->frontid <= f2 ; Work->frontid++)
 {
     Work->ncand = Front_npivcol [Work->frontid] ;
     Work->lo = Work->nextcand ;
     Work->hi = Work->nextcand + Work->ncand - 1 ;
     jmax = (((128) < (Work->ncand)) ? (128) : (Work->ncand)) ;
     ;
     if (fixQ)
     {
  jmax = 1 ;
     }
     ;
     for (j = 0 ; j < jmax ; j++)
     {
  ;
  ;
  Work->Candidates [j] = Work->nextcand++ ;
     }
     Work->nCandidates = jmax ;
     ;
     while (Work->ncand > 0)
     {
  status = umfdi_local_search (Numeric, Work, Symbolic) ;
  if (status == (-11))
  {
      ;
      return ((-11)) ;
  }
  if (status == (1))
  {
      continue ;
  }
  if (Work->do_update)
  {
      umfdi_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfdi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfdi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  if (Work->do_extend)
  {
      { if (! (umfdi_extend_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  else
  {
      { if (! (umfdi_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
      { if (! (umfdi_init_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  if (fixQ)
  {
      umfdi_assemble_fixq (Numeric, Work) ;
  }
  else
  {
      umfdi_assemble (Numeric, Work) ;
  }
  umfdi_scale_column (Numeric, Work) ;
  evaporate = Work->fnrows == 0 || Work->fncols == 0 ;
  if (Work->fnpiv >= nb || evaporate)
  {
      umfdi_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfdi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfdi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  Work->pivrow_in_front = (0) ;
  Work->pivcol_in_front = (0) ;
  if (evaporate)
  {
      (void) umfdi_create_element (Numeric, Work, Symbolic) ;
      Work->fnrows = 0 ;
      Work->fncols = 0 ;
  }
     }
 }
 umfdi_blas3_update (Work) ;
 if (drop)
 {
     { if (! (umfdi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
 }
 else
 {
     { if (! (umfdi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
 }
 Work->fnrows_new = Work->fnrows ;
 Work->fncols_new = Work->fncols ;
 { if (! (umfdi_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 Work->fnrows = 0 ;
 Work->fncols = 0 ;
    }
    umfdi_kernel_wrapup (Numeric, Symbolic, Work) ;
    return ((0)) ;
}

canonical_original_code:
int umfdi_kernel(int Ap[], int Ai[], double Ax[], struct NumericType *Numeric, struct WorkType *Work, struct SymbolicType *Symbolic)
{
    int j; int f1; int f2; int chain; int nchains; int *Chain_start; int status; int fixQ; int evaporate; int *Front_npivcol; int jmax; int nb; int drop;
    if (!umfdi_kernel_init (Ap, Ai, Ax,
 Numeric, Work, Symbolic))
    {
 ;
 return ((-11)) ;
    }
    nchains = Symbolic->nchains ;
    Chain_start = Symbolic->Chain_start ;
    Front_npivcol = Symbolic->Front_npivcol ;
    nb = Symbolic->nb ;
    fixQ = Symbolic->fixQ ;
    drop = Numeric->droptol > 0.0 ;
    for (chain = 0 ; chain < nchains ; chain++)
    {
 f1 = Chain_start [chain] ;
 f2 = Chain_start [chain+1] - 1 ;
 { if (! (umfdi_start_front (chain, Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 for (Work->frontid = f1 ; Work->frontid <= f2 ; Work->frontid++)
 {
     Work->ncand = Front_npivcol [Work->frontid] ;
     Work->lo = Work->nextcand ;
     Work->hi = Work->nextcand + Work->ncand - 1 ;
     jmax = (((128) < (Work->ncand)) ? (128) : (Work->ncand)) ;
     ;
     if (fixQ)
     {
  jmax = 1 ;
     }
     ;
     for (j = 0 ; j < jmax ; j++)
     {
  ;
  ;
  Work->Candidates [j] = Work->nextcand++ ;
     }
     Work->nCandidates = jmax ;
     ;
     while (Work->ncand > 0)
     {
  status = umfdi_local_search (Numeric, Work, Symbolic) ;
  if (status == (-11))
  {
      ;
      return ((-11)) ;
  }
  if (status == (1))
  {
      continue ;
  }
  if (Work->do_update)
  {
      umfdi_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfdi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfdi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  if (Work->do_extend)
  {
      { if (! (umfdi_extend_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  else
  {
      { if (! (umfdi_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
      { if (! (umfdi_init_front (Numeric, Work))) { return ((-1)) ; }} ;
  }
  if (fixQ)
  {
      umfdi_assemble_fixq (Numeric, Work) ;
  }
  else
  {
      umfdi_assemble (Numeric, Work) ;
  }
  umfdi_scale_column (Numeric, Work) ;
  evaporate = Work->fnrows == 0 || Work->fncols == 0 ;
  if (Work->fnpiv >= nb || evaporate)
  {
      umfdi_blas3_update (Work) ;
      if (drop)
      {
   { if (! (umfdi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
      }
      else
      {
   { if (! (umfdi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
      }
  }
  Work->pivrow_in_front = (0) ;
  Work->pivcol_in_front = (0) ;
  if (evaporate)
  {
      (void) umfdi_create_element (Numeric, Work, Symbolic) ;
      Work->fnrows = 0 ;
      Work->fncols = 0 ;
  }
     }
 }
 umfdi_blas3_update (Work) ;
 if (drop)
 {
     { if (! (umfdi_store_lu_drop (Numeric, Work))) { return ((-1)) ; }} ;
 }
 else
 {
     { if (! (umfdi_store_lu (Numeric, Work))) { return ((-1)) ; }} ;
 }
 Work->fnrows_new = Work->fnrows ;
 Work->fncols_new = Work->fncols ;
 { if (! (umfdi_create_element (Numeric, Work, Symbolic))) { return ((-1)) ; }} ;
 Work->fnrows = 0 ;
 Work->fncols = 0 ;
    }
    umfdi_kernel_wrapup (Numeric, Symbolic, Work) ;
    return ((0)) ;
}

variable_types:
Ap
int []

variable_types:
Ai
int []

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

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

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

variable_types: j int

variable_types: chain int

variable_types: nchains int

variable_types: status int

variable_types: fixQ int

variable_types: evaporate int

variable_types: jmax int

variable_types: nb int

variable_types: drop int

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


decompiled_code:
__int64 __fastcall umfzi_mem_alloc_head_block(unsigned int *a1, int a2)
{
__int64 result; // rax
unsigned int v3; // esi
signed int v4; // esi

result = a1[26];
if ( (int)(a1[27] - result) < a2 )
return 0LL;
v3 = result + a2;
a1[26] = v3;
v4 = a1[61] + v3;
if ( v4 < (int)a1[63] )
v4 = a1[63];
a1[63] = v4;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int *a1, int a2)
{
__int64 result; // rax
unsigned int v3; // esi
signed int v4; // esi

result = a1[26];
if ( (int)(a1[27] - result) < a2 )
return 0LL;
v3 = result + a2;
a1[26] = v3;
v4 = a1[61] + v3;
if ( v4 < (int)a1[63] )
v4 = a1[63];
a1[63] = v4;
return result;
}

original_code:
int umfzi_mem_alloc_head_block
(
    NumericType *Numeric,
    int nunits
)
{
    int p, usage ;
    ;
    ;
    ;
    if (nunits > (Numeric->itail - Numeric->ihead))
    {
 ;
 return (0) ;
    }
    p = Numeric->ihead ;
    Numeric->ihead += nunits ;
    ;
    usage = Numeric->ihead + Numeric->tail_usage ;
    Numeric->max_usage = (((Numeric->max_usage) > (usage)) ? (Numeric->max_usage) : (usage)) ;
    return (p) ;
}

canonical_original_code:
int umfzi_mem_alloc_head_block(struct NumericType *Numeric, int nunits)
{
    int p; int usage;
    ;
    ;
    ;
    if (nunits > (Numeric->itail - Numeric->ihead))
    {
 ;
 return (0) ;
    }
    p = Numeric->ihead ;
    Numeric->ihead += nunits ;
    ;
    usage = Numeric->ihead + Numeric->tail_usage ;
    Numeric->max_usage = (((Numeric->max_usage) > (usage)) ? (Numeric->max_usage) : (usage)) ;
    return (p) ;
}

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: nunits int

variable_types: p int

variable_types: usage int

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


decompiled_code:
__int64 __fastcall umfpack_zl_symbolic(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
return umfpack_zl_qsymbolic(a1, a2, a3, a4);
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
return umfpack_zl_qsymbolic(a1, a2, a3, a4);
}

original_code:
long umfpack_zl_symbolic
(
    long n_row,
    long n_col,
    const long Ap [ ],
    const long Ai [ ],
    const double Ax [ ],
    const double Az [ ],
    void **SymbolicHandle,
    const double Control [20],
    double Info [90]
)
{
    return (umfpack_zl_qsymbolic (n_row, n_col, Ap, Ai, Ax,
        Az,
        (long *) ((void *)0), SymbolicHandle, Control, Info)) ;
}

canonical_original_code:
long umfpack_zl_symbolic(long n_row, long n_col, long Ap[], long Ai[], double Ax[], double Az[], void **SymbolicHandle, double Control[20], double Info[90])
{
    return (umfpack_zl_qsymbolic (n_row, n_col, Ap, Ai, Ax,
        Az,
        (long *) ((void *)0), SymbolicHandle, Control, Info)) ;
}

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
Az
double []

variable_types:
SymbolicHandle
void **

variable_types:
Control
double [20]

variable_types:
Info
double [90]


decompiled_code:
double __fastcall cholmod_hypot(double a1, double a2)
{
__int64 v2; // xmm3_8
__int64 v3; // xmm2_8
double v4; // xmm1_8
double v5; // xmm1_8
double v7; // xmm0_8
double v8; // xmm0_8
double v9; // [rsp+0h] [rbp-18h]

v2 = *(_QWORD *)&a1 & LC4;
*(_QWORD *)&v9 = *(_QWORD *)&a1 & LC4;
v3 = LC4 & *(_QWORD *)&a2;
if ( COERCE_DOUBLE(*(_QWORD *)&a1 & LC4) < COERCE_DOUBLE(LC4 & *(_QWORD *)&a2) )
{
if ( *(double *)&v2 + *(double *)&v3 == *(double *)&v3 )
{
*(_QWORD *)&v9 = LC4 & *(_QWORD *)&a2;
}
else
{
v7 = a1 / a2 * (a1 / a2) + 1.0;
if ( v7 < 0.0 )
v8 = sqrt(v7);
else
v8 = sqrt(v7);
v9 = v8 * *(double *)&v3;
}
}
else if ( *(double *)&v3 + *(double *)&v2 != *(double *)&v2 )
{
v4 = a2 / a1 * (a2 / a1) + 1.0;
if ( v4 < 0.0 )
v5 = sqrt(v4);
else
v5 = sqrt(v4);
v9 = v5 * *(double *)&v2;
}
return v9;
}

original_code:
double cholmod_hypot (double x, double y)
{
    double s, r ;
    x = fabs (x) ;
    y = fabs (y) ;
    if (x >= y)
    {
 if (x + y == x)
 {
     s = x ;
 }
 else
 {
     r = y / x ;
     s = x * sqrt (1.0 + r*r) ;
 }
    }
    else
    {
 if (y + x == y)
 {
     s = y ;
 }
 else
 {
     r = x / y ;
     s = y * sqrt (1.0 + r*r) ;
 }
    }
    return (s) ;
}

canonical_original_code:
double cholmod_hypot(double x, double y)
{
    double s; double r;
    x = fabs (x) ;
    y = fabs (y) ;
    if (x >= y)
    {
 if (x + y == x)
 {
     s = x ;
 }
 else
 {
     r = y / x ;
     s = x * sqrt (1.0 + r*r) ;
 }
    }
    else
    {
 if (y + x == y)
 {
     s = y ;
 }
 else
 {
     r = x / y ;
     s = y * sqrt (1.0 + r*r) ;
 }
    }
    return (s) ;
}

variable_types: x double

variable_types: y double

variable_types: s double

variable_types: r double


decompiled_code:
_BOOL8 __fastcall cholmod_divcomplex(double *a1, double *a2, double a3, double a4, double a5, double a6)
{
double v7; // xmm4_8
double v8; // xmm2_8
double v9; // xmm0_8
double v10; // xmm4_8
double v12; // xmm4_8

if ( COERCE_DOUBLE(*(_QWORD *)&a5 & LC4) < COERCE_DOUBLE(LC4 & *(_QWORD *)&a6) )
{
v12 = a5 / a6;
v8 = a5 * (a5 / a6) + a6;
v9 = (v12 * a3 + a4) / v8;
v10 = (v12 * a4 - a3) / v8;
}
else
{
v7 = a6 / a5;
v8 = a5 + a6 * (a6 / a5);
v9 = (a4 * v7 + a3) / v8;
v10 = (a4 - a3 * v7) / v8;
}
*a1 = v9;
*a2 = v10;
return v8 == 0.0;
}

original_code:
int cholmod_divcomplex
(
    double ar, double ai,
    double br, double bi,
    double *cr, double *ci
)
{
    double tr, ti, r, den ;
    if (fabs (br) >= fabs (bi))
    {
 r = bi / br ;
 den = br + r * bi ;
 tr = (ar + ai * r) / den ;
 ti = (ai - ar * r) / den ;
    }
    else
    {
 r = br / bi ;
 den = r * br + bi ;
 tr = (ar * r + ai) / den ;
 ti = (ai * r - ar) / den ;
    }
    *cr = tr ;
    *ci = ti ;
    return (((den) == 0.)) ;
}

canonical_original_code:
int cholmod_divcomplex(double ar, double ai, double br, double bi, double *cr, double *ci)
{
    double tr; double ti; double r; double den;
    if (fabs (br) >= fabs (bi))
    {
 r = bi / br ;
 den = br + r * bi ;
 tr = (ar + ai * r) / den ;
 ti = (ai - ar * r) / den ;
    }
    else
    {
 r = br / bi ;
 den = r * br + bi ;
 tr = (ar * r + ai) / den ;
 ti = (ai * r - ar) / den ;
    }
    *cr = tr ;
    *ci = ti ;
    return (((den) == 0.)) ;
}

variable_types: ar double

variable_types: ai double

variable_types: br double

variable_types: bi double

variable_types:
cr
double *

variable_types:
ci
double *

variable_types: tr double

variable_types: ti double

variable_types: den double