original_code:
int cholmod_factorize_p
(
    cholmod_sparse *A,
    double beta [2],
    int *fset,
    size_t fsize,
    cholmod_factor *L,
    cholmod_common *Common
)
{
    cholmod_sparse *S, *F, *A1, *A2 ;
    int nrow, ncol, stype, convert, n, nsuper, grow2, status ;
    size_t s, t, uncol ;
    int ok = 1 ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_factorize.c", 123, "argument missing", Common) ; } return (0) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_factorize.c", 124, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (1) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_factorize.c", 125, "invalid xtype", Common) ; } return (0) ; } } ;
    { if ((L)->xtype < (0) || (L)->xtype > (3) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_factorize.c", 126, "invalid xtype", Common) ; } return (0) ; } } ;
    nrow = A->nrow ;
    ncol = A->ncol ;
    n = L->n ;
    stype = A->stype ;
    if (L->n != A->nrow)
    {
 cholmod_error ((-4), "../Cholesky/cholmod_factorize.c", 133, "A and L dimensions do not match", Common) ;
 return (0) ;
    }
    if (stype != 0 && nrow != ncol)
    {
 cholmod_error ((-4), "../Cholesky/cholmod_factorize.c", 138, "matrix invalid", Common) ;
 return (0) ;
    }
    ;
    Common->status = 0 ;
    nsuper = (L->is_super ? L->nsuper : 0) ;
    uncol = ((stype != 0) ? 0 : ncol) ;
    s = cholmod_mult_size_t (nsuper, 2, &ok) ;
    s = (((uncol) > (s)) ? (uncol) : (s)) ;
    t = cholmod_mult_size_t (nrow, 2, &ok) ;
    s = cholmod_add_size_t (s, t, &ok) ;
    if (!ok)
    {
 cholmod_error ((-3), "../Cholesky/cholmod_factorize.c", 158, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_allocate_work (nrow, s, 0, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    S = ((void *)0) ;
    F = ((void *)0) ;
    A1 = ((void *)0) ;
    A2 = ((void *)0) ;
    convert = !(Common->final_asis) ;
    if (L->is_super)
    {
 if (L->ordering == 0)
 {
     if (stype > 0)
     {
  A1 = cholmod_ptranspose (A, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A1 ;
     }
     else if (stype < 0)
     {
  S = A ;
     }
     else
     {
  A1 = cholmod_ptranspose (A, 2, ((void *)0), fset, fsize, Common) ;
  F = A1 ;
  S = A ;
     }
 }
 else
 {
     if (stype > 0)
     {
  A1 = cholmod_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
  S = A1 ;
     }
     else if (stype < 0)
     {
  A2 = cholmod_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
  A1 = cholmod_ptranspose (A2, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A1 ;
  cholmod_free_sparse (&A2, Common) ;
  ;
     }
     else
     {
  A1 = cholmod_ptranspose (A, 2, L->Perm, fset, fsize, Common) ;
  F = A1 ;
  A2 = cholmod_ptranspose (F, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A2 ;
     }
 }
 if (Common->status == 0)
 {
     cholmod_super_numeric (S, F, beta, L, Common) ;
 }
 status = Common->status ;
 ;
 if (Common->status >= 0 && convert)
 {
     ok = cholmod_change_factor (L->xtype, Common->final_ll,
      Common->final_super, Common->final_pack,
      Common->final_monotonic, L, Common) ;
     if (ok && Common->final_resymbol && !(L->is_super))
     {
  cholmod_resymbol_noperm (S, fset, fsize, Common->final_pack,
      L, Common) ;
     }
 }
    }
    else
    {
 if (L->ordering == 0)
 {
     if (stype > 0)
     {
  S = A ;
     }
     else if (stype < 0)
     {
  A2 = cholmod_ptranspose (A, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A2 ;
     }
     else
     {
  A1 = cholmod_ptranspose (A, 2, ((void *)0), fset, fsize, Common) ;
  F = A1 ;
  S = A ;
     }
 }
 else
 {
     if (stype > 0)
     {
  A1 = cholmod_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
  A2 = cholmod_ptranspose (A1, 2, ((void *)0), ((void *)0), 0, Common) ;
  cholmod_free_sparse (&A1, Common) ;
     }
     else if (stype < 0)
     {
  A2 = cholmod_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
     }
     else
     {
  A1 = cholmod_ptranspose (A, 2, L->Perm, fset, fsize, Common) ;
  F = A1 ;
  A2 = cholmod_ptranspose (F, 2, ((void *)0), ((void *)0), 0, Common) ;
     }
     S = A2 ;
 }
 if (Common->status == 0)
 {
     grow2 = Common->grow2 ;
     L->is_ll = ((Common->final_ll) ? 1 : 0) ;
     if (L->xtype == 0 && Common->final_pack)
     {
  Common->grow2 = 0 ;
     }
     cholmod_rowfac (S, F, beta, 0, nrow, L, Common) ;
     Common->grow2 = grow2 ;
 }
 status = Common->status ;
 if (Common->status >= 0 && convert)
 {
     cholmod_change_factor (L->xtype, L->is_ll, 0,
      Common->final_pack, Common->final_monotonic, L, Common) ;
 }
    }
    cholmod_free_sparse (&A1, Common) ;
    cholmod_free_sparse (&A2, Common) ;
    Common->status = (((Common->status) > (status)) ? (Common->status) : (status)) ;
    return (Common->status >= 0) ;
}

canonical_original_code:
int cholmod_factorize_p(struct cholmod_sparse_struct *A, double beta[2], int *fset, unsigned long fsize, struct cholmod_factor_struct *L, struct cholmod_common_struct *Common)
{
    struct cholmod_sparse_struct *S; struct cholmod_sparse_struct *F; struct cholmod_sparse_struct *A1; struct cholmod_sparse_struct *A2;
    int nrow; int ncol; int stype; int convert; int n; int nsuper; int grow2; int status;
    unsigned long s; unsigned long t; unsigned long uncol;
    int ok = 1;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_factorize.c", 123, "argument missing", Common) ; } return (0) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_factorize.c", 124, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (1) || (A)->xtype > (3) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_factorize.c", 125, "invalid xtype", Common) ; } return (0) ; } } ;
    { if ((L)->xtype < (0) || (L)->xtype > (3) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_factorize.c", 126, "invalid xtype", Common) ; } return (0) ; } } ;
    nrow = A->nrow ;
    ncol = A->ncol ;
    n = L->n ;
    stype = A->stype ;
    if (L->n != A->nrow)
    {
 cholmod_error ((-4), "../Cholesky/cholmod_factorize.c", 133, "A and L dimensions do not match", Common) ;
 return (0) ;
    }
    if (stype != 0 && nrow != ncol)
    {
 cholmod_error ((-4), "../Cholesky/cholmod_factorize.c", 138, "matrix invalid", Common) ;
 return (0) ;
    }
    ;
    Common->status = 0 ;
    nsuper = (L->is_super ? L->nsuper : 0) ;
    uncol = ((stype != 0) ? 0 : ncol) ;
    s = cholmod_mult_size_t (nsuper, 2, &ok) ;
    s = (((uncol) > (s)) ? (uncol) : (s)) ;
    t = cholmod_mult_size_t (nrow, 2, &ok) ;
    s = cholmod_add_size_t (s, t, &ok) ;
    if (!ok)
    {
 cholmod_error ((-3), "../Cholesky/cholmod_factorize.c", 158, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_allocate_work (nrow, s, 0, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    S = ((void *)0) ;
    F = ((void *)0) ;
    A1 = ((void *)0) ;
    A2 = ((void *)0) ;
    convert = !(Common->final_asis) ;
    if (L->is_super)
    {
 if (L->ordering == 0)
 {
     if (stype > 0)
     {
  A1 = cholmod_ptranspose (A, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A1 ;
     }
     else if (stype < 0)
     {
  S = A ;
     }
     else
     {
  A1 = cholmod_ptranspose (A, 2, ((void *)0), fset, fsize, Common) ;
  F = A1 ;
  S = A ;
     }
 }
 else
 {
     if (stype > 0)
     {
  A1 = cholmod_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
  S = A1 ;
     }
     else if (stype < 0)
     {
  A2 = cholmod_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
  A1 = cholmod_ptranspose (A2, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A1 ;
  cholmod_free_sparse (&A2, Common) ;
  ;
     }
     else
     {
  A1 = cholmod_ptranspose (A, 2, L->Perm, fset, fsize, Common) ;
  F = A1 ;
  A2 = cholmod_ptranspose (F, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A2 ;
     }
 }
 if (Common->status == 0)
 {
     cholmod_super_numeric (S, F, beta, L, Common) ;
 }
 status = Common->status ;
 ;
 if (Common->status >= 0 && convert)
 {
     ok = cholmod_change_factor (L->xtype, Common->final_ll,
      Common->final_super, Common->final_pack,
      Common->final_monotonic, L, Common) ;
     if (ok && Common->final_resymbol && !(L->is_super))
     {
  cholmod_resymbol_noperm (S, fset, fsize, Common->final_pack,
      L, Common) ;
     }
 }
    }
    else
    {
 if (L->ordering == 0)
 {
     if (stype > 0)
     {
  S = A ;
     }
     else if (stype < 0)
     {
  A2 = cholmod_ptranspose (A, 2, ((void *)0), ((void *)0), 0, Common) ;
  S = A2 ;
     }
     else
     {
  A1 = cholmod_ptranspose (A, 2, ((void *)0), fset, fsize, Common) ;
  F = A1 ;
  S = A ;
     }
 }
 else
 {
     if (stype > 0)
     {
  A1 = cholmod_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
  A2 = cholmod_ptranspose (A1, 2, ((void *)0), ((void *)0), 0, Common) ;
  cholmod_free_sparse (&A1, Common) ;
     }
     else if (stype < 0)
     {
  A2 = cholmod_ptranspose (A, 2, L->Perm, ((void *)0), 0, Common) ;
     }
     else
     {
  A1 = cholmod_ptranspose (A, 2, L->Perm, fset, fsize, Common) ;
  F = A1 ;
  A2 = cholmod_ptranspose (F, 2, ((void *)0), ((void *)0), 0, Common) ;
     }
     S = A2 ;
 }
 if (Common->status == 0)
 {
     grow2 = Common->grow2 ;
     L->is_ll = ((Common->final_ll) ? 1 : 0) ;
     if (L->xtype == 0 && Common->final_pack)
     {
  Common->grow2 = 0 ;
     }
     cholmod_rowfac (S, F, beta, 0, nrow, L, Common) ;
     Common->grow2 = grow2 ;
 }
 status = Common->status ;
 if (Common->status >= 0 && convert)
 {
     cholmod_change_factor (L->xtype, L->is_ll, 0,
      Common->final_pack, Common->final_monotonic, L, Common) ;
 }
    }
    cholmod_free_sparse (&A1, Common) ;
    cholmod_free_sparse (&A2, Common) ;
    Common->status = (((Common->status) > (status)) ? (Common->status) : (status)) ;
    return (Common->status >= 0) ;
}

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:
beta
double [2]

variable_types:
fset
int *

variable_types:
fsize
unsigned long

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

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

variable_types: ncol int

variable_types: stype int

variable_types: convert int

variable_types: n int

variable_types: nsuper int

variable_types: status int

variable_types:
s
unsigned long

variable_types:
t
unsigned long

variable_types:
uncol
unsigned long

variable_types: ok int

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


decompiled_code:
_BOOL8 __fastcall cholmod_factorize(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v4[3]; // [rsp+0h] [rbp-18h] BYREF

v4[0] = 0LL;
v4[1] = 0LL;
return cholmod_factorize_p(a1, (__int64)v4, 0LL, 0LL, a2, a3);
}

original_code:
int cholmod_factorize
(
    cholmod_sparse *A,
    cholmod_factor *L,
    cholmod_common *Common
)
{
    double zero [2] ;
    zero [0] = 0 ;
    zero [1] = 0 ;
    return (cholmod_factorize_p (A, zero, ((void *)0), 0, L, Common)) ;
}

canonical_original_code:
int cholmod_factorize(struct cholmod_sparse_struct *A, struct cholmod_factor_struct *L, struct cholmod_common_struct *Common)
{
    double zero[2];
    zero [0] = 0 ;
    zero [1] = 0 ;
    return (cholmod_factorize_p (A, zero, ((void *)0), 0, L, Common)) ;
}

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:
zero
double [2]

return_type: int

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

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 alloc_expansion_list()
{
__int64 v0; // rax
__int64 v1; // r12

v0 = my_malloc(16LL);
*(_DWORD *)v0 = 0;
v1 = v0;
*(_QWORD *)(v0 + 8) = my_calloc(16LL, 16385LL);
return v1;
}

original_code:
t_expansion_list* alloc_expansion_list(void) {
    t_expansion_list* expansion_list = my_malloc(sizeof(t_expansion_list));
    expansion_list->heap_size = 0;
    expansion_list->heap = my_calloc(sizeof(t_heap_node), 16384 + 1);
    return expansion_list;
}

canonical_original_code:
struct s_expansion_list *alloc_expansion_list() {
    struct s_expansion_list *expansion_list = my_malloc(sizeof(t_expansion_list));
    expansion_list->heap_size = 0;
    expansion_list->heap = my_calloc(sizeof(t_heap_node), 16384 + 1);
    return expansion_list;
}

variable_types: struct s_expansion_list { int heap_size; struct s_heap_node { double key; struct s_wire { int channel_x_coord; int channel_y_coord; struct s_switchblock { int x_coord; int y_coord; struct s_wire ***adjacency_list; int *num_adjacencies; int *occupancy_list; } **array_of_adjacent_switchblocks; int num_switchblocks; struct s_pin { struct s_block { int x_coord; int y_coord; struct s_pin **array_of_pins; int num_pins; } *block; int pin_num; struct s_wire **array_of_adjacent_wires; int num_adjacent_wires; struct s_net { struct s_pin *source_pin; struct s_pin *sink_pin; int net_num; struct s_wire **associated_wires; int num_associated_wires; } *associated_net; } **array_of_adjacent_pins; int num_adjacent_pins; int channel_pair_num; struct s_wire *reservoir_wire; int wire_num; double occupancy; double present_cost; double history_cost; enum e_ROUTING_LABEL { NONE=-1, TARGET=0, SOURCE=1, USED=2, CURRENT_EXPANSION=3 } label_type; double label_value; int counted; } *wire; } *heap; } *

user_defined_types: struct s_expansion_list { int heap_size; struct s_heap_node *heap; }

user_defined_types: struct s_heap_node { double key; struct s_wire *wire; }

user_defined_types: struct s_wire { int channel_x_coord; int channel_y_coord; struct s_switchblock **array_of_adjacent_switchblocks; int num_switchblocks; struct s_pin **array_of_adjacent_pins; int num_adjacent_pins; int channel_pair_num; struct s_wire *reservoir_wire; int wire_num; double occupancy; double present_cost; double history_cost; enum e_ROUTING_LABEL label_type; double label_value; int counted; }

user_defined_types: struct s_pin { struct s_block *block; int pin_num; struct s_wire **array_of_adjacent_wires; int num_adjacent_wires; struct s_net *associated_net; }


decompiled_code:
_BOOL8 __fastcall is_empty_expansion_list(_DWORD *a1)
{
return *a1 == 0;
}

canonical_decompiled_code:
_BOOL8 __fastcall func1(_DWORD *a1)
{
return *a1 == 0;
}

original_code:
t_boolean is_empty_expansion_list(t_expansion_list* expansion_list) {
    return expansion_list->heap_size == 0;
}

canonical_original_code:
enum e_boolean is_empty_expansion_list(struct s_expansion_list *expansion_list) {
    return expansion_list->heap_size == 0;
}

return_type: enum e_boolean { FALSE=0, TRUE=1 }

user_defined_types: enum e_ROUTING_LABEL { NONE=-1, TARGET=0, SOURCE=1, USED=2, CURRENT_EXPANSION=3 }

user_defined_types: struct s_switchblock { int x_coord; int y_coord; struct s_wire ***adjacency_list; int *num_adjacencies; int *occupancy_list; }

user_defined_types: struct s_block { int x_coord; int y_coord; struct s_pin **array_of_pins; int num_pins; }

user_defined_types: struct s_net { struct s_pin *source_pin; struct s_pin *sink_pin; int net_num; struct s_wire **associated_wires; int num_associated_wires; }


decompiled_code:
__int64 __fastcall parent_index(int a1)
{
return (unsigned int)(a1 / 2);
}

canonical_decompiled_code:
__int64 __fastcall func2(int a1)
{
return (unsigned int)(a1 / 2);
}

original_code:
int parent_index(int current_index) {
    return current_index / 2;
}


decompiled_code:
__int64 __fastcall child_left_index(int a1)
{
return (unsigned int)(2 * a1);
}

canonical_decompiled_code:
__int64 __fastcall func3(int a1)
{
return (unsigned int)(2 * a1);
}

original_code:
int child_left_index(int current_index) {
    return 2*current_index;
}


decompiled_code:
__int64 __fastcall child_right_index(int a1)
{
return (unsigned int)(2 * a1 + 1);
}

canonical_decompiled_code:
__int64 __fastcall func4(int a1)
{
return (unsigned int)(2 * a1 + 1);
}

original_code:
int child_right_index(int current_index) {
    return 2*current_index + 1;
}


decompiled_code:
__int64 __fastcall verify_heap(int *a1)
{
int v1; // esi
int v2; // ecx
int v3; // edi
int v4; // eax
__int64 v5; // rdx
int v6; // ecx
double *v7; // r8
__int64 v8; // r9

v1 = *a1;
if ( *a1 < 0 )
return 1LL;
v2 = 0;
do
{
v3 = v2;
child_left_index(v2);
v4 = child_right_index(v3);
if ( v1 >= (int)v5 && *v7 > *(double *)(v8 + 16 * v5) )
_assert_fail("heap_ok", "SRC/base/expansion_list.c", 0x4Du, "verify_heap");
if ( v1 >= v4 && *v7 > *(double *)(v8 + 16LL * v4) )
_assert_fail("heap_ok", "SRC/base/expansion_list.c", 0x55u, "verify_heap");
v2 = v6 + 1;
}
while ( v1 >= v2 );
return 1LL;
}

canonical_decompiled_code:
__int64 __fastcall func5(int *a1)
{
int v1; // esi
int v2; // ecx
int v3; // edi
int v4; // eax
__int64 v5; // rdx
int v6; // ecx
double *v7; // r8
__int64 v8; // r9

v1 = *a1;
if ( *a1 < 0 )
return 1LL;
v2 = 0;
do
{
v3 = v2;
func3(v2);
v4 = func4(v3);
if ( v1 >= (int)v5 && *v7 > *(double *)(v8 + 16 * v5) )
_assert_fail("heap_ok", "SRC/base/expansion_list.c", 0x4Du, "verify_heap");
if ( v1 >= v4 && *v7 > *(double *)(v8 + 16LL * v4) )
_assert_fail("heap_ok", "SRC/base/expansion_list.c", 0x55u, "verify_heap");
v2 = v6 + 1;
}
while ( v1 >= v2 );
return 1LL;
}

original_code:
t_boolean verify_heap(t_expansion_list* expansion_list){
    t_boolean heap_ok = TRUE;
    int node_index = 1;
    int heap_size = expansion_list->heap_size;
    t_heap_node* heap = expansion_list->heap;
    for(node_index = 0; node_index <= heap_size; node_index++) {
        int left_child_index = child_left_index(node_index);
        int right_child_index = child_right_index(node_index);
        if (left_child_index <= heap_size
            && heap[node_index].key > heap[left_child_index].key) {
            heap_ok = FALSE;
            ((void) sizeof ((heap_ok) ? 1 : 0), __extension__ ({ if (heap_ok) ; else __assert_fail ("heap_ok", "SRC/base/expansion_list.c", 77, __extension__ __PRETTY_FUNCTION__); }));
        }
        if (right_child_index <= heap_size
            && heap[node_index].key > heap[right_child_index].key) {
            heap_ok = FALSE;
            ((void) sizeof ((heap_ok) ? 1 : 0), __extension__ ({ if (heap_ok) ; else __assert_fail ("heap_ok", "SRC/base/expansion_list.c", 85, __extension__ __PRETTY_FUNCTION__); }));
        }
    }
    if(heap_ok == FALSE) {
        printf("Error: invalid heap state\n");
    }
    return heap_ok;
}

canonical_original_code:
enum e_boolean verify_heap(struct s_expansion_list *expansion_list){
    enum e_boolean heap_ok = TRUE;
    int node_index = 1;
    int heap_size = expansion_list->heap_size;
    struct s_heap_node *heap = expansion_list->heap;
    for(node_index = 0; node_index <= heap_size; node_index++) {
        int left_child_index = child_left_index(node_index);
        int right_child_index = child_right_index(node_index);
        if (left_child_index <= heap_size
            && heap[node_index].key > heap[left_child_index].key) {
            heap_ok = FALSE;
            ((void) sizeof ((heap_ok) ? 1 : 0), __extension__ ({ if (heap_ok) ; else __assert_fail ("heap_ok", "SRC/base/expansion_list.c", 77, __extension__ __PRETTY_FUNCTION__); }));
        }
        if (right_child_index <= heap_size
            && heap[node_index].key > heap[right_child_index].key) {
            heap_ok = FALSE;
            ((void) sizeof ((heap_ok) ? 1 : 0), __extension__ ({ if (heap_ok) ; else __assert_fail ("heap_ok", "SRC/base/expansion_list.c", 85, __extension__ __PRETTY_FUNCTION__); }));
        }
    }
    if(heap_ok == FALSE) {
        printf("Error: invalid heap state\n");
    }
    return heap_ok;
}

variable_types: struct s_heap_node { double key; struct s_wire { int channel_x_coord; int channel_y_coord; struct s_switchblock { int x_coord; int y_coord; struct s_wire ***adjacency_list; int *num_adjacencies; int *occupancy_list; } **array_of_adjacent_switchblocks; int num_switchblocks; struct s_pin { struct s_block { int x_coord; int y_coord; struct s_pin **array_of_pins; int num_pins; } *block; int pin_num; struct s_wire **array_of_adjacent_wires; int num_adjacent_wires; struct s_net { struct s_pin *source_pin; struct s_pin *sink_pin; int net_num; struct s_wire **associated_wires; int num_associated_wires; } *associated_net; } **array_of_adjacent_pins; int num_adjacent_pins; int channel_pair_num; struct s_wire *reservoir_wire; int wire_num; double occupancy; double present_cost; double history_cost; enum e_ROUTING_LABEL { NONE=-1, TARGET=0, SOURCE=1, USED=2, CURRENT_EXPANSION=3 } label_type; double label_value; int counted; } *wire; } *


original_code:
void swap_nodes(t_heap_node* a, t_heap_node* b) {
    t_heap_node tmp = *a;
    *a = *b;
    *b = tmp;
}

canonical_original_code:
void swap_nodes(struct s_heap_node *a, struct s_heap_node *b) {
    struct s_heap_node tmp = *a;
    *a = *b;
    *b = tmp;
}

variable_types:
b
struct s_heap_node *

variable_types: struct s_heap_node { double key; struct s_wire { int channel_x_coord; int channel_y_coord; struct s_switchblock { int x_coord; int y_coord; struct s_wire ***adjacency_list; int *num_adjacencies; int *occupancy_list; } **array_of_adjacent_switchblocks; int num_switchblocks; struct s_pin { struct s_block { int x_coord; int y_coord; struct s_pin **array_of_pins; int num_pins; } *block; int pin_num; struct s_wire **array_of_adjacent_wires; int num_adjacent_wires; struct s_net { struct s_pin *source_pin; struct s_pin *sink_pin; int net_num; struct s_wire **associated_wires; int num_associated_wires; } *associated_net; } **array_of_adjacent_pins; int num_adjacent_pins; int channel_pair_num; struct s_wire *reservoir_wire; int wire_num; double occupancy; double present_cost; double history_cost; enum e_ROUTING_LABEL { NONE=-1, TARGET=0, SOURCE=1, USED=2, CURRENT_EXPANSION=3 } label_type; double label_value; int counted; } *wire; }

return_type: void


decompiled_code:
double __fastcall bubble_up(__int64 a1, int a2)
{
__int64 v4; // rsi
int v5; // eax
__int64 v6; // rdx
__int64 *v7; // r9
__m128i *v8; // rsi
double result; // xmm0_8

if ( *(_DWORD *)a1 < a2 )
_assert_fail("node_index <= expansion_list->heap_size", "SRC/base/expansion_list.c", 0x71u, "bubble_up");
while ( a2 > 1 )
{
v4 = *(_QWORD *)(a1 + 8);
v5 = parent_index(a2);
v7 = (__int64 *)(v4 + v6);
v8 = (__m128i *)(16LL * v5 + v4);
result = *(double *)v8->m128i_i64;
if ( *(double *)v8->m128i_i64 <= *(double *)v7 )
break;
swap_nodes(v7, v8);
}
return result;
}

canonical_decompiled_code:
double __fastcall func7(__int64 a1, int a2)
{
__int64 v4; // rsi
int v5; // eax
__int64 v6; // rdx
__int64 *v7; // r9
__m128i *v8; // rsi
double result; // xmm0_8

if ( *(_DWORD *)a1 < a2 )
_assert_fail("node_index <= expansion_list->heap_size", "SRC/base/expansion_list.c", 0x71u, "bubble_up");
while ( a2 > 1 )
{
v4 = *(_QWORD *)(a1 + 8);
v5 = func2(a2);
v7 = (__int64 *)(v4 + v6);
v8 = (__m128i *)(16LL * v5 + v4);
result = *(double *)v8->m128i_i64;
if ( *(double *)v8->m128i_i64 <= *(double *)v7 )
break;
func6(v7, v8);
}
return result;
}

original_code:
void bubble_up(t_expansion_list* expansion_list, int node_index){
    ((void) sizeof ((node_index <= expansion_list->heap_size) ? 1 : 0), __extension__ ({ if (node_index <= expansion_list->heap_size) ; else __assert_fail ("node_index <= expansion_list->heap_size", "SRC/base/expansion_list.c", 113, __extension__ __PRETTY_FUNCTION__); }));
    while( node_index > 1
          && expansion_list->heap[node_index].key < expansion_list->heap[parent_index(node_index)].key
          ) {
        swap_nodes(&expansion_list->heap[node_index], &expansion_list->heap[parent_index(node_index)]);
        node_index = parent_index(node_index);
    }
}

canonical_original_code:
void bubble_up(struct s_expansion_list *expansion_list, int node_index){
    ((void) sizeof ((node_index <= expansion_list->heap_size) ? 1 : 0), __extension__ ({ if (node_index <= expansion_list->heap_size) ; else __assert_fail ("node_index <= expansion_list->heap_size", "SRC/base/expansion_list.c", 113, __extension__ __PRETTY_FUNCTION__); }));
    while( node_index > 1
          && expansion_list->heap[node_index].key < expansion_list->heap[parent_index(node_index)].key
          ) {
        swap_nodes(&expansion_list->heap[node_index], &expansion_list->heap[parent_index(node_index)]);
        node_index = parent_index(node_index);
    }
}


decompiled_code:
double __fastcall insert_expansion_list(__int64 a1, __int64 a2, int a3)
{
int v4; // esi
__int64 v5; // rax

v4 = *(_DWORD *)a1 + 1;
*(_DWORD *)a1 = v4;
if ( v4 > 0x4000 )
_assert_fail(
"expansion_list->heap_size <= MAX_HEAP_ITEMS",
"SRC/base/expansion_list.c",
0x1Eu,
"insert_expansion_list");
v5 = *(_QWORD *)(a1 + 8) + 16LL * v4;
*(_QWORD *)(v5 + 8) = a2;
*(double *)v5 = (double)a3;
return bubble_up(a1, v4);
}

canonical_decompiled_code:
double __fastcall func8(__int64 a1, __int64 a2, int a3)
{
int v4; // esi
__int64 v5; // rax

v4 = *(_DWORD *)a1 + 1;
*(_DWORD *)a1 = v4;
if ( v4 > 0x4000 )
_assert_fail(
"expansion_list->heap_size <= MAX_HEAP_ITEMS",
"SRC/base/expansion_list.c",
0x1Eu,
"insert_expansion_list");
v5 = *(_QWORD *)(a1 + 8) + 16LL * v4;
*(_QWORD *)(v5 + 8) = a2;
*(double *)v5 = (double)a3;
return func7(a1, v4);
}

original_code:
void insert_expansion_list(t_expansion_list* expansion_list, t_wire* wire, int cost) {
    expansion_list->heap_size++;
    ((void) sizeof ((expansion_list->heap_size <= 16384) ? 1 : 0), __extension__ ({ if (expansion_list->heap_size <= 16384) ; else __assert_fail ("expansion_list->heap_size <= MAX_HEAP_ITEMS", "SRC/base/expansion_list.c", 30, __extension__ __PRETTY_FUNCTION__); }));
    t_heap_node new_node;
    new_node.key = cost;
    new_node.wire = wire;
    expansion_list->heap[expansion_list->heap_size] = new_node;
    bubble_up(expansion_list, expansion_list->heap_size);
}

canonical_original_code:
void insert_expansion_list(struct s_expansion_list *expansion_list, struct s_wire *wire, int cost) {
    expansion_list->heap_size++;
    ((void) sizeof ((expansion_list->heap_size <= 16384) ? 1 : 0), __extension__ ({ if (expansion_list->heap_size <= 16384) ; else __assert_fail ("expansion_list->heap_size <= MAX_HEAP_ITEMS", "SRC/base/expansion_list.c", 30, __extension__ __PRETTY_FUNCTION__); }));
    struct s_heap_node new_node;
    new_node.key = cost;
    new_node.wire = wire;
    expansion_list->heap[expansion_list->heap_size] = new_node;
    bubble_up(expansion_list, expansion_list->heap_size);
}

variable_types:
wire
struct s_wire *

variable_types: cost int


decompiled_code:
__int64 __fastcall bubble_down(__int64 a1, int a2)
{
__int64 result; // rax
__int64 v3; // rcx
__int64 v4; // rdi
__int64 v5; // r8
__m128i *v6; // r8
double v7; // xmm0_8
int v8; // er9
double *v9; // r9
__int64 *v10; // rdi
int v11; // edx
_DWORD *v12; // rcx

while ( 1 )
{
result = child_left_index(a2);
if ( (int)result > *v12 )
break;
result = child_right_index(a2);
v4 = *(_QWORD *)(v3 + 8);
v6 = (__m128i *)(v4 + 16 * v5);
v7 = *(double *)v6->m128i_i64;
if ( v8 >= (int)result )
{
v9 = (double *)(v4 + 16LL * (int)result);
if ( v7 > *v9 )
{
v7 = *v9;
v6 = (__m128i *)(v4 + 16LL * (int)result);
}
}
v10 = (__int64 *)(16LL * a2 + v4);
if ( *(double *)v10 <= v7 )
break;
swap_nodes(v10, v6);
a2 = v11;
}
return result;
}

original_code:
void bubble_down(t_expansion_list* expansion_list, int node_index){
    while(child_left_index(node_index) <= expansion_list->heap_size) {
        int left_child_index = child_left_index(node_index);
        int right_child_index = child_right_index(node_index);
        int child_to_swap_index = left_child_index;
        if (right_child_index <= expansion_list->heap_size) {
            if (expansion_list->heap[right_child_index].key < expansion_list->heap[left_child_index].key) {
                child_to_swap_index = right_child_index;
            }
        }
        if (expansion_list->heap[node_index].key > expansion_list->heap[child_to_swap_index].key) {
            swap_nodes(&expansion_list->heap[node_index], &expansion_list->heap[child_to_swap_index]);
            node_index = child_to_swap_index;
        } else {
            break;
        }
    }
}

canonical_original_code:
void bubble_down(struct s_expansion_list *expansion_list, int node_index){
    while(child_left_index(node_index) <= expansion_list->heap_size) {
        int left_child_index = child_left_index(node_index);
        int right_child_index = child_right_index(node_index);
        int child_to_swap_index = left_child_index;
        if (right_child_index <= expansion_list->heap_size) {
            if (expansion_list->heap[right_child_index].key < expansion_list->heap[left_child_index].key) {
                child_to_swap_index = right_child_index;
            }
        }
        if (expansion_list->heap[node_index].key > expansion_list->heap[child_to_swap_index].key) {
            swap_nodes(&expansion_list->heap[node_index], &expansion_list->heap[child_to_swap_index]);
            node_index = child_to_swap_index;
        } else {
            break;
        }
    }
}


original_code:
t_heap_node get_min_expansion_list(t_expansion_list* expansion_list) {
    swap_nodes(&expansion_list->heap[1], &expansion_list->heap[expansion_list->heap_size]);
    expansion_list->heap_size--;
    bubble_down(expansion_list, 1);
    return expansion_list->heap[expansion_list->heap_size+1];
}

canonical_original_code:
struct s_heap_node get_min_expansion_list(struct s_expansion_list *expansion_list) {
    swap_nodes(&expansion_list->heap[1], &expansion_list->heap[expansion_list->heap_size]);
    expansion_list->heap_size--;
    bubble_down(expansion_list, 1);
    return expansion_list->heap[expansion_list->heap_size+1];
}

variable_types: struct s_expansion_list { int heap_size; struct s_heap_node *heap; } *

return_type: struct s_heap_node { double key; struct s_wire { int channel_x_coord; int channel_y_coord; struct s_switchblock { int x_coord; int y_coord; struct s_wire ***adjacency_list; int *num_adjacencies; int *occupancy_list; } **array_of_adjacent_switchblocks; int num_switchblocks; struct s_pin { struct s_block { int x_coord; int y_coord; struct s_pin **array_of_pins; int num_pins; } *block; int pin_num; struct s_wire **array_of_adjacent_wires; int num_adjacent_wires; struct s_net { struct s_pin *source_pin; struct s_pin *sink_pin; int net_num; struct s_wire **associated_wires; int num_associated_wires; } *associated_net; } **array_of_adjacent_pins; int num_adjacent_pins; int channel_pair_num; struct s_wire *reservoir_wire; int wire_num; double occupancy; double present_cost; double history_cost; enum e_ROUTING_LABEL { NONE=-1, TARGET=0, SOURCE=1, USED=2, CURRENT_EXPANSION=3 } label_type; double label_value; int counted; } *wire; }


original_code:
long umfzl_mem_alloc_element
(
    NumericType *Numeric,
    long nrows,
    long ncols,
    long **Rows,
    long **Cols,
    DoubleComplex **C,
    long *size,
    Element **epout
)
{
    Element *ep ;
    Unit *p ;
    long i ;
    ;
    ;
    *size = ((((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (long) * ((ncols) + (nrows)))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (DoubleComplex) * ((ncols) * (nrows)))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    if (((!((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (long) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (DoubleComplex) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || ((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (long) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (DoubleComplex) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) != (((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (long) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (DoubleComplex) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1))))
    {
 return (0) ;
    }
    i = umfzl_mem_alloc_tail_block (Numeric, *size) ;
    (*size)++ ;
    if (!i)
    {
 ;
 return (0) ;
    }
    p = Numeric->Memory + i ;
    ep = (Element *) p ;
    ;
    p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
    *Cols = (long *) p ;
    *Rows = *Cols + ncols ;
    p += (((((sizeof (long) * (ncols + nrows))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
    *C = (DoubleComplex *) p ;
    ep->nrows = nrows ;
    ep->ncols = ncols ;
    ep->nrowsleft = nrows ;
    ep->ncolsleft = ncols ;
    ep->cdeg = 0 ;
    ep->rdeg = 0 ;
    ep->next = (-1) ;
    ;
    ;
    *epout = ep ;
    return (i) ;
}

canonical_original_code:
long umfzl_mem_alloc_element(struct NumericType *Numeric, long nrows, long ncols, long **Rows, long **Cols, struct DoubleComplex **C, long *size, struct Element **epout)
{
    struct Element *ep;
    union Unit_union *p;
    long i;
    ;
    ;
    *size = ((((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (long) * ((ncols) + (nrows)))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) + (((((sizeof (DoubleComplex) * ((ncols) * (nrows)))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
    if (((!((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (long) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (DoubleComplex) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) * (1.0+1e-8) <= (double) 0x7fffffffffffffffL)) || ((((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (long) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (DoubleComplex) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1) != (((ceil ((sizeof (Element) * ((double) 1)) / sizeof (Unit))) + (ceil ((sizeof (long) * ((double) (ncols) + (nrows))) / sizeof (Unit))) + (ceil ((sizeof (DoubleComplex) * ((double) (ncols) * (nrows))) / sizeof (Unit)))) + 1))))
    {
 return (0) ;
    }
    i = umfzl_mem_alloc_tail_block (Numeric, *size) ;
    (*size)++ ;
    if (!i)
    {
 ;
 return (0) ;
    }
    p = Numeric->Memory + i ;
    ep = (struct Element *) p ;
    ;
    p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
    *Cols = (long *) p ;
    *Rows = *Cols + ncols ;
    p += (((((sizeof (long) * (ncols + nrows))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
    *C = (struct DoubleComplex *) p ;
    ep->nrows = nrows ;
    ep->ncols = ncols ;
    ep->nrowsleft = nrows ;
    ep->ncolsleft = ncols ;
    ep->cdeg = 0 ;
    ep->rdeg = 0 ;
    ep->next = (-1) ;
    ;
    ;
    *epout = ep ;
    return (i) ;
}

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

variable_types: nrows long

variable_types: ncols long

variable_types:
Rows
long **

variable_types:
Cols
long **

variable_types:
C
struct DoubleComplex **

variable_types:
size
long *

variable_types:
epout
struct Element { long cdeg; } **

variable_types:
ep
struct Element { long cdeg; } *

variable_types: i long

return_type: long

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


original_code:
int umfpack_di_triplet_to_col
(
    int n_row,
    int n_col,
    int nz,
    const int Ti [ ],
    const int Tj [ ],
    const double Tx [ ],
    int Ap [ ],
    int Ai [ ],
    double Ax [ ]
    , int Map [ ]
)
{
    int *RowCount, *Rp, *Rj, *W, nn, do_values, do_map, *Map2, status ;
    double *Rx ;
    if (!Ai || !Ap || !Ti || !Tj)
    {
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 return ((-6)) ;
    }
    if (nz < 0)
    {
 return ((-8)) ;
    }
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    Rx = (double *) ((void *)0) ;
    do_values = Ax && Tx ;
    if (do_values)
    {
 Rx = (double *) umf_i_malloc (nz+1, sizeof (double)) ;
 if (!Rx)
 {
     ;
     ;
     return ((-1)) ;
 }
    }
    do_map = (Map != (int *) ((void *)0)) ;
    Map2 = (int *) ((void *)0) ;
    if (do_map)
    {
 ;
 Map2 = (int *) umf_i_malloc (nz+1, sizeof (int)) ;
 if (!Map2)
 {
     ;
     (void) umf_i_free ((void *) Rx) ;
     ;
     return ((-1)) ;
 }
    }
    Rj = (int *) umf_i_malloc (nz+1, sizeof (int)) ;
    Rp = (int *) umf_i_malloc (n_row+1, sizeof (int)) ;
    RowCount = (int *) umf_i_malloc (n_row, sizeof (int)) ;
    W = (int *) umf_i_malloc (nn, sizeof (int)) ;
    if (!Rj || !Rp || !RowCount || !W)
    {
 ;
 (void) umf_i_free ((void *) Rx) ;
 (void) umf_i_free ((void *) Map2) ;
 (void) umf_i_free ((void *) Rp) ;
 (void) umf_i_free ((void *) Rj) ;
 (void) umf_i_free ((void *) RowCount) ;
 (void) umf_i_free ((void *) W) ;
 ;
 return ((-1)) ;
    }
    ;
    if (do_map)
    {
 if (do_values)
 {
     status = umfdi_triplet_map_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Tx, Ax, Rx
  , Map, Map2) ;
 }
 else
 {
     status = umfdi_triplet_map_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Map, Map2) ;
 }
    }
    else
    {
 if (do_values)
 {
     status = umfdi_triplet_nomap_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount , Tx, Ax, Rx
  ) ;
 }
 else
 {
     status = umfdi_triplet_nomap_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai,
  Rp, Rj, W, RowCount) ;
 }
    }
    (void) umf_i_free ((void *) Rx) ;
    (void) umf_i_free ((void *) Map2) ;
    (void) umf_i_free ((void *) Rp) ;
    (void) umf_i_free ((void *) Rj) ;
    (void) umf_i_free ((void *) RowCount) ;
    (void) umf_i_free ((void *) W) ;
    ;
    return (status) ;
}

canonical_original_code:
int umfpack_di_triplet_to_col(int n_row, int n_col, int nz, int Ti[], int Tj[], double Tx[], int Ap[], int Ai[], double Ax[], int Map[])
{
    int *RowCount; int *Rp; int *Rj; int *W; int nn; int do_values; int do_map; int *Map2; int status;
    double *Rx;
    if (!Ai || !Ap || !Ti || !Tj)
    {
 return ((-5)) ;
    }
    if (n_row <= 0 || n_col <= 0)
    {
 return ((-6)) ;
    }
    if (nz < 0)
    {
 return ((-8)) ;
    }
    nn = (((n_row) > (n_col)) ? (n_row) : (n_col)) ;
    Rx = (double *) ((void *)0) ;
    do_values = Ax && Tx ;
    if (do_values)
    {
 Rx = (double *) umf_i_malloc (nz+1, sizeof (double)) ;
 if (!Rx)
 {
     ;
     ;
     return ((-1)) ;
 }
    }
    do_map = (Map != (int *) ((void *)0)) ;
    Map2 = (int *) ((void *)0) ;
    if (do_map)
    {
 ;
 Map2 = (int *) umf_i_malloc (nz+1, sizeof (int)) ;
 if (!Map2)
 {
     ;
     (void) umf_i_free ((void *) Rx) ;
     ;
     return ((-1)) ;
 }
    }
    Rj = (int *) umf_i_malloc (nz+1, sizeof (int)) ;
    Rp = (int *) umf_i_malloc (n_row+1, sizeof (int)) ;
    RowCount = (int *) umf_i_malloc (n_row, sizeof (int)) ;
    W = (int *) umf_i_malloc (nn, sizeof (int)) ;
    if (!Rj || !Rp || !RowCount || !W)
    {
 ;
 (void) umf_i_free ((void *) Rx) ;
 (void) umf_i_free ((void *) Map2) ;
 (void) umf_i_free ((void *) Rp) ;
 (void) umf_i_free ((void *) Rj) ;
 (void) umf_i_free ((void *) RowCount) ;
 (void) umf_i_free ((void *) W) ;
 ;
 return ((-1)) ;
    }
    ;
    if (do_map)
    {
 if (do_values)
 {
     status = umfdi_triplet_map_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Tx, Ax, Rx
  , Map, Map2) ;
 }
 else
 {
     status = umfdi_triplet_map_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount, Map, Map2) ;
 }
    }
    else
    {
 if (do_values)
 {
     status = umfdi_triplet_nomap_x (n_row, n_col, nz, Ti, Tj, Ap, Ai, Rp,
  Rj, W, RowCount , Tx, Ax, Rx
  ) ;
 }
 else
 {
     status = umfdi_triplet_nomap_nox (n_row, n_col, nz, Ti, Tj, Ap, Ai,
  Rp, Rj, W, RowCount) ;
 }
    }
    (void) umf_i_free ((void *) Rx) ;
    (void) umf_i_free ((void *) Map2) ;
    (void) umf_i_free ((void *) Rp) ;
    (void) umf_i_free ((void *) Rj) ;
    (void) umf_i_free ((void *) RowCount) ;
    (void) umf_i_free ((void *) W) ;
    ;
    return (status) ;
}

variable_types: nz int

variable_types:
Ti
int []

variable_types:
Tj
int []

variable_types:
Tx
double []

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Ax
double []

variable_types:
Map
int []

variable_types:
RowCount
int *

variable_types:
Rp
int *

variable_types:
Rj
int *

variable_types:
W
int *

variable_types: nn int

variable_types: status int

variable_types:
Rx
double *


original_code:
int umfdi_valid_symbolic
(
    SymbolicType *Symbolic
)
{
    if (!Symbolic)
    {
 return ((0)) ;
    }
    if (Symbolic->valid != 41937)
    {
 return ((0)) ;
    }
    if (!Symbolic->Cperm_init || !Symbolic->Rperm_init ||
 !Symbolic->Front_npivcol || !Symbolic->Front_1strow ||
 !Symbolic->Front_leftmostdesc ||
 !Symbolic->Front_parent || !Symbolic->Chain_start ||
 !Symbolic->Chain_maxrows || !Symbolic->Chain_maxcols ||
 Symbolic->n_row <= 0 || Symbolic->n_col <= 0)
    {
 return ((0)) ;
    }
    return ((1)) ;
}

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

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


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

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

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

variable_types:
X
double []

variable_types:
Pattern
int []

variable_types: xk double

variable_types:
xp
double *

variable_types:
D
double *

variable_types:
Uval
double *

variable_types: k int

variable_types: deg int

variable_types: j int

variable_types:
ip
int *

variable_types: col int

variable_types:
Upos
int *

variable_types:
Uilen
int *

variable_types: pos int

variable_types:
Uip
int *

variable_types: n int

variable_types: ulen int

variable_types: up int

variable_types: newUchain int

variable_types: npiv int

variable_types:
Ui
int *

return_type: double

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


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

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

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

variable_types:
Parent
long *

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

variable_types:
Ap
long *

variable_types:
Ai
long *

variable_types:
Anz
long *

variable_types:
Ancestor
long *

variable_types:
Prev
long *

variable_types:
Iwork
long *

variable_types: i long

variable_types: j long

variable_types: jprev long

variable_types: p long

variable_types: pend long

variable_types: nrow long

variable_types: ncol long

variable_types: packed long

variable_types: stype long

variable_types:
s
unsigned long

variable_types: ok int


decompiled_code:
__int64 __fastcall umfpack_zl_report_perm(__int64 a1, __int64 a2, double *a3)
{
unsigned __int64 v3; // r14
bool v5; // cc
__int64 v7; // rdi
__int64 v8; // r15
__int64 v9; // r12

if ( !a3 )
return 0LL;
v3 = (unsigned int)(int)*a3;
if ( v3 <= 2 )
return 0LL;
v5 = a1 <= 0;
v7 = 1LL;
if ( !v5 )
v7 = a1;
v8 = umf_l_malloc(v7, 8LL);
v9 = umf_l_report_perm(a1, a2, v8, v3, 1LL);
umf_l_free(v8);
return v9;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, double *a3)
{
unsigned __int64 v3; // r14
bool v5; // cc
__int64 v7; // rdi
__int64 v8; // r15
__int64 v9; // r12

if ( !a3 )
return 0LL;
v3 = (unsigned int)(int)*a3;
if ( v3 <= 2 )
return 0LL;
v5 = a1 <= 0;
v7 = 1LL;
if ( !v5 )
v7 = a1;
v8 = umf_l_malloc(v7, 8LL);
v9 = umf_l_report_perm(a1, a2, v8, v3, 1LL);
umf_l_free(v8);
return v9;
}

original_code:
long umfpack_zl_report_perm
(
    long np,
    const long Perm [ ],
    const double Control [20]
)
{
    long prl, *W, status ;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    W = (long *) umf_l_malloc ((((np) > (1)) ? (np) : (1)), sizeof (long)) ;
    status = umf_l_report_perm (np, Perm, W, prl, 1) ;
    (void) umf_l_free ((void *) W) ;
    return (status) ;
}

canonical_original_code:
long umfpack_zl_report_perm(long np, long Perm[], double Control[20])
{
    long prl; long *W; long status;
    prl = ((Control != (double *) ((void *)0)) ? (((Control [0]) != (Control [0])) ? 1 : Control [0]) : 1) ;
    if (prl <= 2)
    {
 return ((0)) ;
    }
    W = (long *) umf_l_malloc ((((np) > (1)) ? (np) : (1)), sizeof (long)) ;
    status = umf_l_report_perm (np, Perm, W, prl, 1) ;
    (void) umf_l_free ((void *) W) ;
    return (status) ;
}

variable_types: np long

variable_types:
Perm
long []

variable_types:
Control
double [20]

variable_types: prl long

variable_types:
W
long *

variable_types: status long


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

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

variable_types:
Mx
double *

variable_types:
Mz
double *

variable_types:
Ex
double *

variable_types:
NumericHandle
void *

variable_types:
one
double [2]

variable_types:
Info
double *

variable_types:
Rs
double *

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

variable_types: i int

variable_types: n int

variable_types: itmp int

variable_types: npiv int

variable_types:
Wi
int *

variable_types:
Rperm
int *

variable_types:
Cperm
int *

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


original_code:
static int rescale_determinant
(
    DoubleComplex *d_mantissa,
    double *d_exponent
)
{
    double d_abs ;
    { (d_abs) = umfpack_hypot ((*d_mantissa).component [0], (*d_mantissa).component [1]) ; } ;
    if (((d_abs) == 0.))
    {
 *d_exponent = 0 ;
 return ((0)) ;
    }
    if (((d_abs) != (d_abs)))
    {
 return ((0)) ;
    }
    while (d_abs < 1.)
    {
 { (*d_mantissa).component [0] *= (10.0) ; (*d_mantissa).component [1] *= (10.0) ; } ;
 *d_exponent = *d_exponent - 1.0 ;
 { (d_abs) = umfpack_hypot ((*d_mantissa).component [0], (*d_mantissa).component [1]) ; } ;
    }
    while (d_abs >= 10.)
    {
 { (*d_mantissa).component [0] *= (0.1) ; (*d_mantissa).component [1] *= (0.1) ; } ;
 *d_exponent = *d_exponent + 1.0 ;
 { (d_abs) = umfpack_hypot ((*d_mantissa).component [0], (*d_mantissa).component [1]) ; } ;
    }
    return ((1)) ;
}

canonical_original_code:
static int rescale_determinant(struct DoubleComplex *d_mantissa, double *d_exponent)
{
    double d_abs;
    { (d_abs) = umfpack_hypot ((*d_mantissa).component [0], (*d_mantissa).component [1]) ; } ;
    if (((d_abs) == 0.))
    {
 *d_exponent = 0 ;
 return ((0)) ;
    }
    if (((d_abs) != (d_abs)))
    {
 return ((0)) ;
    }
    while (d_abs < 1.)
    {
 { (*d_mantissa).component [0] *= (10.0) ; (*d_mantissa).component [1] *= (10.0) ; } ;
 *d_exponent = *d_exponent - 1.0 ;
 { (d_abs) = umfpack_hypot ((*d_mantissa).component [0], (*d_mantissa).component [1]) ; } ;
    }
    while (d_abs >= 10.)
    {
 { (*d_mantissa).component [0] *= (0.1) ; (*d_mantissa).component [1] *= (0.1) ; } ;
 *d_exponent = *d_exponent + 1.0 ;
 { (d_abs) = umfpack_hypot ((*d_mantissa).component [0], (*d_mantissa).component [1]) ; } ;
    }
    return ((1)) ;
}

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


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

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

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

variable_types: i long

variable_types: n long

variable_types: itmp long

variable_types: npiv long

variable_types:
Wi
long *

variable_types:
Rperm
long *

variable_types:
Cperm
long *


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

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

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


original_code:
int cholmod_drop
(
    double tol,
    cholmod_sparse *A,
    cholmod_common *Common
)
{
    double aij ;
    double *Ax ;
    int *Ap, *Ai, *Anz ;
    int packed, i, j, nrow, ncol, p, pend, nz, values ;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../MatrixOps/cholmod_drop.c", 52, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (0) || (A)->xtype > (1) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../MatrixOps/cholmod_drop.c", 53, "invalid xtype", Common) ; } return (0) ; } } ;
    Common->status = 0 ;
    ;
    Ap = A->p ;
    Ai = A->i ;
    Ax = A->x ;
    Anz = A->nz ;
    packed = A->packed ;
    ncol = A->ncol ;
    nrow = A->nrow ;
    values = (A->xtype != 0) ;
    nz = 0 ;
    if (values)
    {
 if (A->stype > 0)
 {
     for (j = 0 ; j < ncol ; j++)
     {
  p = Ap [j] ;
  pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
  Ap [j] = nz ;
  for ( ; p < pend ; p++)
  {
      i = Ai [p] ;
      aij = Ax [p] ;
      if (i <= j && (fabs (aij) > tol || ((aij) != (aij))))
      {
   Ai [nz] = i ;
   Ax [nz] = aij ;
   nz++ ;
      }
  }
     }
 }
 else if (A->stype < 0)
 {
     for (j = 0 ; j < ncol ; j++)
     {
  p = Ap [j] ;
  pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
  Ap [j] = nz ;
  for ( ; p < pend ; p++)
  {
      i = Ai [p] ;
      aij = Ax [p] ;
      if (i >= j && (fabs (aij) > tol || ((aij) != (aij))))
      {
   Ai [nz] = i ;
   Ax [nz] = aij ;
   nz++ ;
      }
  }
     }
 }
 else
 {
     for (j = 0 ; j < ncol ; j++)
     {
  p = Ap [j] ;
  pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
  Ap [j] = nz ;
  for ( ; p < pend ; p++)
  {
      i = Ai [p] ;
      aij = Ax [p] ;
      if (fabs (aij) > tol || ((aij) != (aij)))
      {
   Ai [nz] = i ;
   Ax [nz] = aij ;
   nz++ ;
      }
  }
     }
 }
 Ap [ncol] = nz ;
 ;
 cholmod_reallocate_sparse (nz, A, Common) ;
 ;
    }
    else
    {
 if (A->stype > 0)
 {
     cholmod_band_inplace (0, ncol, 0, A, Common) ;
 }
 else if (A->stype < 0)
 {
     cholmod_band_inplace (-nrow, 0, 0, A, Common) ;
 }
    }
    ;
    return (1) ;
}

canonical_original_code:
int cholmod_drop(double tol, struct cholmod_sparse_struct *A, struct cholmod_common_struct *Common)
{
    double aij;
    double *Ax;
    int *Ap; int *Ai; int *Anz;
    int packed; int i; int j; int nrow; int ncol; int p; int pend; int nz; int values;
    { if (Common == ((void *)0)) { return (0) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return (0) ; } } ;
    { if ((A) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../MatrixOps/cholmod_drop.c", 52, "argument missing", Common) ; } return (0) ; } } ;
    { if ((A)->xtype < (0) || (A)->xtype > (1) || ((A)->xtype != 0 && ((A)->x) == ((void *)0)) || ((A)->xtype == 3 && ((A)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_error ((-4), "../MatrixOps/cholmod_drop.c", 53, "invalid xtype", Common) ; } return (0) ; } } ;
    Common->status = 0 ;
    ;
    Ap = A->p ;
    Ai = A->i ;
    Ax = A->x ;
    Anz = A->nz ;
    packed = A->packed ;
    ncol = A->ncol ;
    nrow = A->nrow ;
    values = (A->xtype != 0) ;
    nz = 0 ;
    if (values)
    {
 if (A->stype > 0)
 {
     for (j = 0 ; j < ncol ; j++)
     {
  p = Ap [j] ;
  pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
  Ap [j] = nz ;
  for ( ; p < pend ; p++)
  {
      i = Ai [p] ;
      aij = Ax [p] ;
      if (i <= j && (fabs (aij) > tol || ((aij) != (aij))))
      {
   Ai [nz] = i ;
   Ax [nz] = aij ;
   nz++ ;
      }
  }
     }
 }
 else if (A->stype < 0)
 {
     for (j = 0 ; j < ncol ; j++)
     {
  p = Ap [j] ;
  pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
  Ap [j] = nz ;
  for ( ; p < pend ; p++)
  {
      i = Ai [p] ;
      aij = Ax [p] ;
      if (i >= j && (fabs (aij) > tol || ((aij) != (aij))))
      {
   Ai [nz] = i ;
   Ax [nz] = aij ;
   nz++ ;
      }
  }
     }
 }
 else
 {
     for (j = 0 ; j < ncol ; j++)
     {
  p = Ap [j] ;
  pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ;
  Ap [j] = nz ;
  for ( ; p < pend ; p++)
  {
      i = Ai [p] ;
      aij = Ax [p] ;
      if (fabs (aij) > tol || ((aij) != (aij)))
      {
   Ai [nz] = i ;
   Ax [nz] = aij ;
   nz++ ;
      }
  }
     }
 }
 Ap [ncol] = nz ;
 ;
 cholmod_reallocate_sparse (nz, A, Common) ;
 ;
    }
    else
    {
 if (A->stype > 0)
 {
     cholmod_band_inplace (0, ncol, 0, A, Common) ;
 }
 else if (A->stype < 0)
 {
     cholmod_band_inplace (-nrow, 0, 0, A, Common) ;
 }
    }
    ;
    return (1) ;
}

variable_types: tol double

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

variable_types:
Ax
double *

variable_types:
Ap
int *

variable_types:
Ai
int *

variable_types:
Anz
int *

variable_types: packed int

variable_types: j int

variable_types: nrow int

variable_types: ncol int

variable_types: p int

variable_types: pend int

variable_types: nz int

variable_types: values int