decompiled_code:
int verify_routed_netlist()
{
_QWORD *v0; // rbp
unsigned __int64 v1; // rbx
int v2; // eax

puts("\nVerifying routed netlist connectivity...");
v0 = *(_QWORD **)(FPGA + 16LL);
if ( v0[1] )
{
v1 = 0LL;
do
verify_routed_net(*(__int64 **)(*v0 + 8 * v1++));
while ( v0[1] > v1 );
}
puts("DONE");
puts("\vVerifying no resource sharing occurs...");
v2 = count_overused_resources();
if ( v2 > 0 )
printf("\tError: %d resources overused\n", (unsigned int)v2);
return puts("DONE");
}

canonical_decompiled_code:
int func1()
{
_QWORD *v0; // rbp
unsigned __int64 v1; // rbx
int v2; // eax

puts("\nVerifying routed netlist connectivity...");
v0 = *(_QWORD **)(FPGA + 16LL);
if ( v0[1] )
{
v1 = 0LL;
do
func0(*(__int64 **)(*v0 + 8 * v1++));
while ( v0[1] > v1 );
}
puts("DONE");
puts("\vVerifying no resource sharing occurs...");
v2 = count_overused_resources();
if ( v2 > 0 )
printf("\tError: %d resources overused\n", (unsigned int)v2);
return puts("DONE");
}

original_code:
void verify_routed_netlist(void) {
    printf("\nVerifying routed netlist connectivity...\n");
    int net_index;
    t_netlist* netlist = FPGA->netlist;
    for(net_index = 0; net_index < netlist->num_nets; net_index++) {
        t_net* net = netlist->array_of_nets[net_index];
        verify_routed_net(net);
    }
    printf("DONE\n");
    printf("\vVerifying no resource sharing occurs...\n");
    int overused_resource_count = count_overused_resources();
    if (overused_resource_count > 0) {
        printf("\tError: %d resources overused\n", overused_resource_count);
    }
    printf("DONE\n");
}

canonical_original_code:
void verify_routed_netlist() {
    printf("\nVerifying routed netlist connectivity...\n");
    int net_index;
    struct s_netlist *netlist = FPGA->netlist;
    for(net_index = 0; net_index < netlist->num_nets; net_index++) {
        struct s_net *net = netlist->array_of_nets[net_index];
        verify_routed_net(net);
    }
    printf("DONE\n");
    printf("\vVerifying no resource sharing occurs...\n");
    int overused_resource_count = count_overused_resources();
    if (overused_resource_count > 0) {
        printf("\tError: %d resources overused\n", overused_resource_count);
    }
    printf("DONE\n");
}

variable_types: struct s_netlist { struct s_net { 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 { 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 **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; } **array_of_adjacent_wires; int num_adjacent_wires; struct s_net *associated_net; } *source_pin; struct s_pin *sink_pin; int net_num; struct s_wire **associated_wires; int num_associated_wires; } **array_of_nets; unsigned long num_nets; struct s_net *tmp_net; } *

user_defined_types: struct s_netlist { struct s_net **array_of_nets; unsigned long num_nets; struct s_net *tmp_net; }

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 print_wire_seg_stats()
{
__int64 *v0; // r12
__int64 v1; // rdx
__int64 v2; // rax
__int64 v3; // rcx
unsigned int v4; // ebp
unsigned int v5; // ebx
int v6; // edx
__int64 v7; // rax
float v8; // xmm1_4
__int64 v10; // rdx

v0 = *(__int64 **)(FPGA + 16LL);
v1 = v0[1];
if ( v1 )
{
v2 = *v0;
v3 = *v0 + 8 * v1;
v4 = 0;
v5 = 0;
do
{
v6 = *(_DWORD *)(*(_QWORD *)v2 + 32LL);
v4 += v6;
if ( (int)v5 < v6 )
v5 = *(_DWORD *)(*(_QWORD *)v2 + 32LL);
v2 += 8LL;
}
while ( v2 != v3 );
}
else
{
v4 = 0;
v5 = 0;
}
puts(" Segment Utilization");
printf("\tTotal # Segs: %d segs\n", v4);
v7 = v0[1];
if ( v7 < 0 )
{
v10 = v0[1] & 1 | ((unsigned __int64)v7 >> 1);
v8 = (float)(int)v10 + (float)(int)v10;
}
else
{
v8 = (float)(int)v7;
}
printf("\tAVG # Segs: %.1f segs\n", (float)((float)(int)v4 / v8));
printf("\tMAX # Segs: %d segs\n", v5);
return v4;
}

canonical_decompiled_code:
__int64 func2()
{
__int64 *v0; // r12
__int64 v1; // rdx
__int64 v2; // rax
__int64 v3; // rcx
unsigned int v4; // ebp
unsigned int v5; // ebx
int v6; // edx
__int64 v7; // rax
float v8; // xmm1_4
__int64 v10; // rdx

v0 = *(__int64 **)(FPGA + 16LL);
v1 = v0[1];
if ( v1 )
{
v2 = *v0;
v3 = *v0 + 8 * v1;
v4 = 0;
v5 = 0;
do
{
v6 = *(_DWORD *)(*(_QWORD *)v2 + 32LL);
v4 += v6;
if ( (int)v5 < v6 )
v5 = *(_DWORD *)(*(_QWORD *)v2 + 32LL);
v2 += 8LL;
}
while ( v2 != v3 );
}
else
{
v4 = 0;
v5 = 0;
}
puts(" Segment Utilization");
printf("\tTotal # Segs: %d segs\n", v4);
v7 = v0[1];
if ( v7 < 0 )
{
v10 = v0[1] & 1 | ((unsigned __int64)v7 >> 1);
v8 = (float)(int)v10 + (float)(int)v10;
}
else
{
v8 = (float)(int)v7;
}
printf("\tAVG # Segs: %.1f segs\n", (float)((float)(int)v4 / v8));
printf("\tMAX # Segs: %d segs\n", v5);
return v4;
}

original_code:
int print_wire_seg_stats(void) {
    t_netlist* netlist = FPGA->netlist;
    int max_num_segs = 0;
    int total_num_segs = 0;
    int net_index;
    for(net_index = 0; net_index < netlist->num_nets; net_index++) {
        t_net* net = netlist->array_of_nets[net_index];
        int net_length = net->num_associated_wires;
        total_num_segs += net_length;
        if (net_length > max_num_segs) {
            max_num_segs = net_length;
        }
    }
    printf("  Segment Utilization\n");
    printf("\tTotal # Segs: %d segs\n", total_num_segs);
    printf("\tAVG   # Segs: %.1f segs\n", total_num_segs / (float) netlist->num_nets);
    printf("\tMAX   # Segs: %d segs\n", max_num_segs);
    return total_num_segs;
}

canonical_original_code:
int print_wire_seg_stats() {
    struct s_netlist *netlist = FPGA->netlist;
    int max_num_segs = 0;
    int total_num_segs = 0;
    int net_index;
    for(net_index = 0; net_index < netlist->num_nets; net_index++) {
        struct s_net *net = netlist->array_of_nets[net_index];
        int net_length = net->num_associated_wires;
        total_num_segs += net_length;
        if (net_length > max_num_segs) {
            max_num_segs = net_length;
        }
    }
    printf("  Segment Utilization\n");
    printf("\tTotal # Segs: %d segs\n", total_num_segs);
    printf("\tAVG   # Segs: %.1f segs\n", total_num_segs / (float) netlist->num_nets);
    printf("\tMAX   # Segs: %d segs\n", max_num_segs);
    return total_num_segs;
}

variable_types: struct s_net { 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 { 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 **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; } **array_of_adjacent_wires; int num_adjacent_wires; struct s_net *associated_net; } *source_pin; struct s_pin *sink_pin; int net_num; struct s_wire **associated_wires; int num_associated_wires; } *

return_type: int

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

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


original_code:
float evaluate_phi(int total_num_segs) {
    int num_reservoir_segs;
    t_netlist* netlist = FPGA->netlist;
    int net_index;
    for(net_index = 0; net_index < netlist->num_nets; net_index++) {
        t_net* net = netlist->array_of_nets[net_index];
        int seg_index;
        for(seg_index = 0; seg_index < net->num_associated_wires; seg_index++) {
            t_wire* net_wire = net->associated_wires[seg_index];
            t_wire* reservoir_wire = get_reservoir_wire(net_wire);
            if(FPGA->W % 2 != 0 && reservoir_wire == ((void *)0)) {
                continue;
            }
            if (reservoir_wire->occupancy == 0) {
                num_reservoir_segs++;
            }
        }
    }
    float phi = (float) total_num_segs - (0.3 * (float) num_reservoir_segs);
    return phi;
}

canonical_original_code:
float evaluate_phi(int total_num_segs) {
    int num_reservoir_segs;
    struct s_netlist *netlist = FPGA->netlist;
    int net_index;
    for(net_index = 0; net_index < netlist->num_nets; net_index++) {
        struct s_net *net = netlist->array_of_nets[net_index];
        int seg_index;
        for(seg_index = 0; seg_index < net->num_associated_wires; seg_index++) {
            struct s_wire *net_wire = net->associated_wires[seg_index];
            struct s_wire *reservoir_wire = get_reservoir_wire(net_wire);
            if(FPGA->W % 2 != 0 && reservoir_wire == ((void *)0)) {
                continue;
            }
            if (reservoir_wire->occupancy == 0) {
                num_reservoir_segs++;
            }
        }
    }
    float phi = (float) total_num_segs - (0.3 * (float) num_reservoir_segs);
    return phi;
}

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

variable_types: phi float

return_type: float


decompiled_code:
int __fastcall evaluate_qor(double a1, double a2, double a3)
{
double v3; // xmm0_8
int v4; // eax
int v5; // ebx
float v7; // [rsp+Ch] [rbp-Ch]

puts("\nQOR RESULTS:");
v3 = print_wire_seg_stats();
v5 = v4;
v7 = evaluate_phi(v4, v3, a2, a3);
puts(" Reservoir Optimization:");
return printf("\tPHI: %.1f segs\t(%.2f of total # segs)\n", v7, (float)(v7 / (float)v5));
}

canonical_decompiled_code:
int __fastcall func4(double a1, double a2, double a3)
{
double v3; // xmm0_8
int v4; // eax
int v5; // ebx
float v7; // [rsp+Ch] [rbp-Ch]

puts("\nQOR RESULTS:");
v3 = func2();
v5 = v4;
v7 = func3(v4, v3, a2, a3);
puts(" Reservoir Optimization:");
return printf("\tPHI: %.1f segs\t(%.2f of total # segs)\n", v7, (float)(v7 / (float)v5));
}

original_code:
void evaluate_qor(void) {
    printf("\nQOR RESULTS:\n");
    int total_num_segs = print_wire_seg_stats();
    float phi = evaluate_phi(total_num_segs);
    printf("  Reservoir Optimization:\n");
    printf("\tPHI: %.1f segs\t(%.2f of total # segs)\n", phi, (phi/total_num_segs));
}

canonical_original_code:
void evaluate_qor() {
    printf("\nQOR RESULTS:\n");
    int total_num_segs = print_wire_seg_stats();
    float phi = evaluate_phi(total_num_segs);
    printf("  Reservoir Optimization:\n");
    printf("\tPHI: %.1f segs\t(%.2f of total # segs)\n", phi, (phi/total_num_segs));
}

return_type: void


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

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

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

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

variable_types: needunits int

variable_types: nsize double

variable_types: bsize double

variable_types: tsize double

variable_types: i int

variable_types: minsize int

variable_types: newsize int

variable_types: newmem int

variable_types: costly int

variable_types: row int

variable_types: col int

variable_types: nb int

variable_types: dr int

variable_types: dc 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:
long
umfpack_dl_solve
(
    long sys,
    const long Ap [ ],
    const long Ai [ ],
    const double Ax [ ],
    double Xx [ ],
    const double Bx [ ],
    void *NumericHandle,
    const double Control [20],
    double User_Info [90]
)
{
    double Info2 [90], stats [2] ;
    double *Info ;
    NumericType *Numeric ;
    long n, i, irstep, status ;
    long *Pattern, wsize ;
    double *W ;
    umfpack_tic (stats) ;
    irstep = ((Control != (double *) ((void *)0)) ? (((Control [7]) != (Control [7])) ? 2 : Control [7]) : 2) ;
    if (User_Info != (double *) ((void *)0))
    {
 Info = User_Info ;
 for (i = 80 ; i <= 85 ; i++)
 {
     Info [i] = (-1) ;
 }
    }
    else
    {
 Info = Info2 ;
 for (i = 0 ; i < 90 ; i++)
 {
     Info [i] = (-1) ;
 }
    }
    Info [0] = (0) ;
    Info [84] = 0 ;
    Numeric = (NumericType *) NumericHandle ;
    if (!umfdl_valid_numeric (Numeric))
    {
 Info [0] = (-3) ;
 return ((-3)) ;
    }
    Info [1] = Numeric->n_row ;
    Info [16] = Numeric->n_col ;
    if (Numeric->n_row != Numeric->n_col)
    {
 Info [0] = (-13) ;
 return ((-13)) ;
    }
    n = Numeric->n_row ;
    if (Numeric->nnzpiv < n
 || ((Numeric->rcond) == 0.) || ((Numeric->rcond) != (Numeric->rcond)))
    {
 irstep = 0 ;
    }
    if (!Xx || !Bx)
    {
 Info [0] = (-5) ;
 return ((-5)) ;
    }
    if (sys >= (3))
    {
 irstep = 0 ;
    }
    if (irstep > 0)
    {
 wsize = 5*n ;
    }
    else
    {
 wsize = n ;
    }
    Pattern = (long *) umf_l_malloc (n, sizeof (long)) ;
    W = (double *) umf_l_malloc (wsize, sizeof (double)) ;
    if (!W || !Pattern)
    {
 ;
 Info [0] = (-1) ;
 (void) umf_l_free ((void *) W) ;
 (void) umf_l_free ((void *) Pattern) ;
 return ((-1)) ;
    }
    status = umfdl_solve (sys, Ap, Ai, Ax, Xx, Bx,
 Numeric, irstep, Info, Pattern, W) ;
    (void) umf_l_free ((void *) W) ;
    (void) umf_l_free ((void *) Pattern) ;
    ;
    Info [0] = status ;
    if (status >= 0)
    {
 umfpack_toc (stats) ;
 Info [86] = stats [0] ;
 Info [85] = stats [1] ;
    }
    return (status) ;
}

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

variable_types: sys long

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
Xx
double []

variable_types:
Bx
double []

variable_types:
NumericHandle
void *

variable_types:
Control
double [20]

variable_types:
stats
double [2]

variable_types:
Info
double *

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

variable_types: n long

variable_types: i long

variable_types: irstep long

variable_types: status long

variable_types:
Pattern
long *

variable_types: wsize long

variable_types:
W
double *

return_type: long

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


original_code:
void umfzi_mem_free_tail_block
(
    NumericType *Numeric,
    int i
)
{
    Unit *pprev, *pnext, *p, *pbig ;
    int sprev ;
    ;
    ;
    if (i == (-1) || i == 0) return ;
    p = Numeric->Memory + i ;
    p-- ;
    ;
    ;
    ;
    ;
    ;
    Numeric->tail_usage -= p->header.size + 1 ;
    pnext = p + 1 + p->header.size ;
    ;
    ;
    ;
    ;
    if (pnext->header.size < 0)
    {
 p->header.size += (-(pnext->header.size)) + 1 ;
 ;
    }
    if (p > Numeric->Memory + Numeric->itail)
    {
 ;
 pprev = p - 1 - p->header.prevsize ;
 ;
 ;
 sprev = pprev->header.size ;
 if (sprev < 0)
 {
     ;
     pprev->header.size = p->header.size + (-sprev) + 1 ;
     p = pprev ;
     ;
 }
    }
    pnext = p + 1 + p->header.size ;
    ;
    if (p == Numeric->Memory + Numeric->itail)
    {
 Numeric->itail = pnext - Numeric->Memory ;
 pnext->header.prevsize = 0 ;
 ;
 ;
 if (Numeric->ibig != (-1) && Numeric->ibig <= Numeric->itail)
 {
     Numeric->ibig = (-1) ;
 }
    }
    else
    {
 if (Numeric->ibig == (-1))
 {
     Numeric->ibig = p - Numeric->Memory ;
 }
 else
 {
     pbig = Numeric->Memory + Numeric->ibig ;
     if (-(pbig->header.size) < p->header.size)
     {
  Numeric->ibig = p - Numeric->Memory ;
     }
 }
 pnext->header.prevsize = p->header.size ;
 p->header.size = -(p->header.size) ;
    }
    ;
}

canonical_original_code:
void umfzi_mem_free_tail_block(struct NumericType *Numeric, int i)
{
    union Unit_union *pprev; union Unit_union *pnext; union Unit_union *p; union Unit_union *pbig;
    int sprev;
    ;
    ;
    if (i == (-1) || i == 0) return ;
    p = Numeric->Memory + i ;
    p-- ;
    ;
    ;
    ;
    ;
    ;
    Numeric->tail_usage -= p->header.size + 1 ;
    pnext = p + 1 + p->header.size ;
    ;
    ;
    ;
    ;
    if (pnext->header.size < 0)
    {
 p->header.size += (-(pnext->header.size)) + 1 ;
 ;
    }
    if (p > Numeric->Memory + Numeric->itail)
    {
 ;
 pprev = p - 1 - p->header.prevsize ;
 ;
 ;
 sprev = pprev->header.size ;
 if (sprev < 0)
 {
     ;
     pprev->header.size = p->header.size + (-sprev) + 1 ;
     p = pprev ;
     ;
 }
    }
    pnext = p + 1 + p->header.size ;
    ;
    if (p == Numeric->Memory + Numeric->itail)
    {
 Numeric->itail = pnext - Numeric->Memory ;
 pnext->header.prevsize = 0 ;
 ;
 ;
 if (Numeric->ibig != (-1) && Numeric->ibig <= Numeric->itail)
 {
     Numeric->ibig = (-1) ;
 }
    }
    else
    {
 if (Numeric->ibig == (-1))
 {
     Numeric->ibig = p - Numeric->Memory ;
 }
 else
 {
     pbig = Numeric->Memory + Numeric->ibig ;
     if (-(pbig->header.size) < p->header.size)
     {
  Numeric->ibig = p - Numeric->Memory ;
     }
 }
 pnext->header.prevsize = p->header.size ;
 p->header.size = -(p->header.size) ;
    }
    ;
}

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


original_code:
int umfpack_di_get_lunz
(
    int *lnz,
    int *unz,
    int *n_row,
    int *n_col,
    int *nz_udiag,
    void *NumericHandle
)
{
    NumericType *Numeric ;
    Numeric = (NumericType *) NumericHandle ;
    if (!umfdi_valid_numeric (Numeric))
    {
 return ((-3)) ;
    }
    if (!lnz || !unz || !n_row || !n_col || !nz_udiag)
    {
 return ((-5)) ;
    }
    *n_row = Numeric->n_row ;
    *n_col = Numeric->n_col ;
    *lnz = Numeric->lnz + (((Numeric->n_row) < (Numeric->n_col)) ? (Numeric->n_row) : (Numeric->n_col)) ;
    *unz = Numeric->unz + Numeric->nnzpiv ;
    *nz_udiag = Numeric->nnzpiv ;
    return ((0)) ;
}

canonical_original_code:
int umfpack_di_get_lunz(int *lnz, int *unz, int *n_row, int *n_col, int *nz_udiag, void *NumericHandle)
{
    struct NumericType *Numeric;
    Numeric = (struct NumericType *) NumericHandle ;
    if (!umfdi_valid_numeric (Numeric))
    {
 return ((-3)) ;
    }
    if (!lnz || !unz || !n_row || !n_col || !nz_udiag)
    {
 return ((-5)) ;
    }
    *n_row = Numeric->n_row ;
    *n_col = Numeric->n_col ;
    *lnz = Numeric->lnz + (((Numeric->n_row) < (Numeric->n_col)) ? (Numeric->n_row) : (Numeric->n_col)) ;
    *unz = Numeric->unz + Numeric->nnzpiv ;
    *nz_udiag = Numeric->nnzpiv ;
    return ((0)) ;
}

variable_types:
lnz
int *

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

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:
double cholmod_l_rcond
(
    cholmod_factor *L,
    cholmod_common *Common
)
{
    double lmin, lmax, rcond ;
    double *Lx ;
    long *Lpi, *Lpx, *Super, *Lp ;
    long n, e, nsuper, s, k1, k2, psi, psend, psx, nsrow, nscol, jj, j ;
    { if (Common == ((void *)0)) { return ((-1)) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return ((-1)) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rcond.c", 85, "argument missing", Common) ; } return ((-1)) ; } } ;
    { 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), "../Cholesky/cholmod_rcond.c", 86, "invalid xtype", Common) ; } return ((-1)) ; } } ;
    Common->status = 0 ;
    n = L->n ;
    if (n == 0)
    {
 return (1) ;
    }
    if (L->minor < L->n)
    {
 return (0) ;
    }
    e = (L->xtype == 2) ? 2 : 1 ;
    if (L->is_super)
    {
 nsuper = L->nsuper ;
 Lpi = L->pi ;
 Lpx = L->px ;
 Super = L->super ;
 Lx = L->x ;
 { double ljj = Lx [0] ; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
 for (s = 0 ; s < nsuper ; s++)
 {
     k1 = Super [s] ;
     k2 = Super [s+1] ;
     psi = Lpi [s] ;
     psend = Lpi [s+1] ;
     psx = Lpx [s] ;
     nsrow = psend - psi ;
     nscol = k2 - k1 ;
     for (jj = 0 ; jj < nscol ; jj++)
     {
  { double ljj = Lx [e * (psx + jj + jj*nsrow)] ; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    else
    {
 Lp = L->p ;
 Lx = L->x ;
 if (L->is_ll)
 {
     { double ljj = Lx [Lp [0]] ; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = Lx [e * Lp [j]] ; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
 else
 {
     { double ljj = fabs (Lx [Lp [0]]) ; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = fabs (Lx [e * Lp [j]]) ; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    rcond = lmin / lmax ;
    if (L->is_ll)
    {
 rcond = rcond*rcond ;
    }
    return (rcond) ;
}

canonical_original_code:
double cholmod_l_rcond(struct cholmod_factor_struct *L, struct cholmod_common_struct *Common)
{
    double lmin; double lmax; double rcond;
    double *Lx;
    long *Lpi; long *Lpx; long *Super; long *Lp;
    long n; long e; long nsuper; long s; long k1; long k2; long psi; long psend; long psx; long nsrow; long nscol; long jj; long j;
    { if (Common == ((void *)0)) { return ((-1)) ; } if (Common->itype != 2 || Common->dtype != 0) { Common->status = (-4) ; return ((-1)) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Cholesky/cholmod_rcond.c", 85, "argument missing", Common) ; } return ((-1)) ; } } ;
    { 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), "../Cholesky/cholmod_rcond.c", 86, "invalid xtype", Common) ; } return ((-1)) ; } } ;
    Common->status = 0 ;
    n = L->n ;
    if (n == 0)
    {
 return (1) ;
    }
    if (L->minor < L->n)
    {
 return (0) ;
    }
    e = (L->xtype == 2) ? 2 : 1 ;
    if (L->is_super)
    {
 nsuper = L->nsuper ;
 Lpi = L->pi ;
 Lpx = L->px ;
 Super = L->super ;
 Lx = L->x ;
 { double ljj = Lx [0]; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
 for (s = 0 ; s < nsuper ; s++)
 {
     k1 = Super [s] ;
     k2 = Super [s+1] ;
     psi = Lpi [s] ;
     psend = Lpi [s+1] ;
     psx = Lpx [s] ;
     nsrow = psend - psi ;
     nscol = k2 - k1 ;
     for (jj = 0 ; jj < nscol ; jj++)
     {
  { double ljj = Lx [e * (psx + jj + jj*nsrow)]; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    else
    {
 Lp = L->p ;
 Lx = L->x ;
 if (L->is_ll)
 {
     { double ljj = Lx [Lp [0]]; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = Lx [e * Lp [j]]; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
 else
 {
     { double ljj = fabs (Lx [Lp [0]]); if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = fabs (Lx [e * Lp [j]]); if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    rcond = lmin / lmax ;
    if (L->is_ll)
    {
 rcond = rcond*rcond ;
    }
    return (rcond) ;
}

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

variable_types: lmax double

variable_types: rcond double

variable_types:
Lx
double *

variable_types:
Lpi
long *

variable_types:
Lpx
long *

variable_types:
Super
long *

variable_types:
Lp
long *

variable_types: e long

variable_types: nsuper long

variable_types: s long

variable_types: psi long

variable_types: psend long

variable_types: psx long

variable_types: nsrow long

variable_types: nscol long

variable_types: jj long

variable_types: j long

variable_types: ljj double

return_type: double

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


original_code:
int cholmod_l_rowdel_mark
(
    size_t kdel,
    cholmod_sparse *R,
    double yk [2],
    long *colmark,
    cholmod_factor *L,
    cholmod_dense *X,
    cholmod_dense *DeltaB,
    cholmod_common *Common
)
{
    double dk, sqrt_dk, xk, dj, fl ;
    double *Lx, *Cx, *W, *Xx, *Nx ;
    long *Li, *Lp, *Lnz, *Ci, *Rj, *Rp, *Iwork ;
    cholmod_sparse *C, Cmatrix ;
    long j, p, pend, kk, lnz, n, Cp [2], do_solve, do_update, left, k,
 right, middle, i, klast, given_row, rnz ;
    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 ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 130, "argument missing", Common) ; } return (0) ; } } ;
    { if ((L)->xtype < (0) || (L)->xtype > (1) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 131, "invalid xtype", Common) ; } return (0) ; } } ;
    n = L->n ;
    k = kdel ;
    if (kdel >= L->n || k < 0)
    {
 cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 136, "k invalid", Common) ;
 return (0) ;
    }
    if (R == ((void *)0))
    {
 Rj = ((void *)0) ;
 rnz = (-1) ;
    }
    else
    {
 { if ((R)->xtype < (0) || (R)->xtype > (3) || ((R)->xtype != 0 && ((R)->x) == ((void *)0)) || ((R)->xtype == 3 && ((R)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 146, "invalid xtype", Common) ; } return (0) ; } } ;
 if (R->ncol != 1 || R->nrow != L->n)
 {
     cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 149, "R invalid", Common) ;
     return (0) ;
 }
 Rj = R->i ;
 Rp = R->p ;
 rnz = Rp [1] ;
    }
    do_solve = (X != ((void *)0)) && (DeltaB != ((void *)0)) ;
    if (do_solve)
    {
 { if ((X)->xtype < (1) || (X)->xtype > (1) || ((X)->xtype != 0 && ((X)->x) == ((void *)0)) || ((X)->xtype == 3 && ((X)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 159, "invalid xtype", Common) ; } return (0) ; } } ;
 { if ((DeltaB)->xtype < (1) || (DeltaB)->xtype > (1) || ((DeltaB)->xtype != 0 && ((DeltaB)->x) == ((void *)0)) || ((DeltaB)->xtype == 3 && ((DeltaB)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 160, "invalid xtype", Common) ; } return (0) ; } } ;
 Xx = X->x ;
 Nx = DeltaB->x ;
 if (X->nrow != L->n || X->ncol != 1 || DeltaB->nrow != L->n ||
  DeltaB->ncol != 1 || Xx == ((void *)0) || Nx == ((void *)0))
 {
     cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 166, "X and/or DeltaB invalid", Common) ;
     return (0) ;
 }
    }
    else
    {
 Xx = ((void *)0) ;
 Nx = ((void *)0) ;
    }
    Common->status = 0 ;
    s = cholmod_l_mult_size_t (n, 2, &ok) ;
    if (!ok)
    {
 cholmod_l_error ((-3), "../Modify/cholmod_rowdel.c", 185, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_l_allocate_work (n, s, s, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    ;
    if (L->xtype == 0 || L->is_super || L->is_ll)
    {
 cholmod_l_change_factor (1, 0, 0, 0, 0, L,
  Common) ;
 if (Common->status < 0)
 {
     return (0) ;
 }
    }
    Lp = L->p ;
    Lnz = L->nz ;
    Li = L->i ;
    Lx = L->x ;
    ;
    W = Common->Xwork ;
    Cx = W + n ;
    Iwork = Common->Iwork ;
    Ci = Iwork + n ;
    given_row = (rnz >= 0) ;
    klast = given_row ? rnz : k ;
    ;
    for (kk = 0 ; kk < klast ; kk++)
    {
 j = given_row ? (Rj [kk]) : (kk) ;
 if (j < 0 || j >= k)
 {
     cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 251, "R invalid", Common) ;
     return (0) ;
 }
 ;
 lnz = Lnz [j] ;
 dj = Lx [Lp [j]] ;
 ;
 if (lnz > 1)
 {
     left = Lp [j] ;
     pend = left + lnz ;
     right = pend - 1 ;
     i = Li [right] ;
     if (i < k)
     {
  continue ;
     }
     else if (i == k)
     {
  if (do_solve)
  {
      Xx [j] -= yk [0] * dj * Lx [right] ;
  }
  Lx [right] = 0 ;
     }
     else
     {
  ;
  while (left < right)
  {
      middle = (left + right) / 2 ;
      ;
      if (k > Li [middle])
      {
   left = middle + 1 ;
      }
      else
      {
   right = middle ;
      }
  }
  ;
  if (k == Li [left])
  {
      if (do_solve)
      {
   Xx [j] -= yk [0] * dj * Lx [left] ;
      }
      Lx [left] = 0 ;
  }
     }
 }
    }
    lnz = Lnz [k] - 1 ;
    ;
    ;
    p = Lp [k] ;
    pend = p + lnz + 1 ;
    dk = Lx [p] ;
    Lx [p++] = 1 ;
    ;
    ok = 1 ;
    fl = 0 ;
    if (lnz > 0)
    {
 if (do_solve)
 {
     xk = Xx [k] - yk [0] * dk ;
     for ( ; p < pend ; p++)
     {
  Nx [Li [p]] += Lx [p] * xk ;
     }
 }
 do_update = ((dk) > 0.) ;
 if (!do_update)
 {
     dk = -dk ;
 }
 sqrt_dk = sqrt (dk) ;
 p = Lp [k] + 1 ;
 for (kk = 0 ; kk < lnz ; kk++, p++)
 {
     Ci [kk] = Li [p] ;
     Cx [kk] = Lx [p] * sqrt_dk ;
     Lx [p] = 0 ;
 }
 fl = lnz + 1 ;
 C = &Cmatrix ;
 C->nrow = n ;
 C->ncol = 1 ;
 C->nzmax = lnz ;
 C->sorted = 1 ;
 C->packed = 1 ;
 C->p = Cp ;
 C->i = Ci ;
 C->x = Cx ;
 C->nz = ((void *)0) ;
 C->itype = L->itype ;
 C->xtype = L->xtype ;
 C->dtype = L->dtype ;
 C->z = ((void *)0) ;
 C->stype = 0 ;
 Cp [0] = 0 ;
 Cp [1] = lnz ;
 ok = cholmod_l_updown_mark (do_update ? (1) : (0), C, colmark,
  L, X, DeltaB, Common) ;
 for (kk = 0 ; kk < lnz ; kk++)
 {
     Cx [kk] = 0 ;
 }
    }
    Common->modfl += fl ;
    if (do_solve)
    {
 Xx [k] = yk [0] ;
    }
    ;
    ;
    return (ok) ;
}

canonical_original_code:
int cholmod_l_rowdel_mark(unsigned long kdel, struct cholmod_sparse_struct *R, double yk[2], long *colmark, struct cholmod_factor_struct *L, struct cholmod_dense_struct *X, struct cholmod_dense_struct *DeltaB, struct cholmod_common_struct *Common)
{
    double dk; double sqrt_dk; double xk; double dj; double fl;
    double *Lx; double *Cx; double *W; double *Xx; double *Nx;
    long *Li; long *Lp; long *Lnz; long *Ci; long *Rj; long *Rp; long *Iwork;
    struct cholmod_sparse_struct *C; struct cholmod_sparse_struct Cmatrix;
    long j; long p; long pend; long kk; long lnz; long n; long Cp[2]; long do_solve; long do_update; long left; long k; long right; long middle; long i; long klast; long given_row; long rnz;
    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 ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 130, "argument missing", Common) ; } return (0) ; } } ;
    { if ((L)->xtype < (0) || (L)->xtype > (1) || ((L)->xtype != 0 && ((L)->x) == ((void *)0)) || ((L)->xtype == 3 && ((L)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 131, "invalid xtype", Common) ; } return (0) ; } } ;
    n = L->n ;
    k = kdel ;
    if (kdel >= L->n || k < 0)
    {
 cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 136, "k invalid", Common) ;
 return (0) ;
    }
    if (R == ((void *)0))
    {
 Rj = ((void *)0) ;
 rnz = (-1) ;
    }
    else
    {
 { if ((R)->xtype < (0) || (R)->xtype > (3) || ((R)->xtype != 0 && ((R)->x) == ((void *)0)) || ((R)->xtype == 3 && ((R)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 146, "invalid xtype", Common) ; } return (0) ; } } ;
 if (R->ncol != 1 || R->nrow != L->n)
 {
     cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 149, "R invalid", Common) ;
     return (0) ;
 }
 Rj = R->i ;
 Rp = R->p ;
 rnz = Rp [1] ;
    }
    do_solve = (X != ((void *)0)) && (DeltaB != ((void *)0)) ;
    if (do_solve)
    {
 { if ((X)->xtype < (1) || (X)->xtype > (1) || ((X)->xtype != 0 && ((X)->x) == ((void *)0)) || ((X)->xtype == 3 && ((X)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 159, "invalid xtype", Common) ; } return (0) ; } } ;
 { if ((DeltaB)->xtype < (1) || (DeltaB)->xtype > (1) || ((DeltaB)->xtype != 0 && ((DeltaB)->x) == ((void *)0)) || ((DeltaB)->xtype == 3 && ((DeltaB)->z) == ((void *)0))) { if (Common->status != (-2)) { cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 160, "invalid xtype", Common) ; } return (0) ; } } ;
 Xx = X->x ;
 Nx = DeltaB->x ;
 if (X->nrow != L->n || X->ncol != 1 || DeltaB->nrow != L->n ||
  DeltaB->ncol != 1 || Xx == ((void *)0) || Nx == ((void *)0))
 {
     cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 166, "X and/or DeltaB invalid", Common) ;
     return (0) ;
 }
    }
    else
    {
 Xx = ((void *)0) ;
 Nx = ((void *)0) ;
    }
    Common->status = 0 ;
    s = cholmod_l_mult_size_t (n, 2, &ok) ;
    if (!ok)
    {
 cholmod_l_error ((-3), "../Modify/cholmod_rowdel.c", 185, "problem too large", Common) ;
 return (0) ;
    }
    cholmod_l_allocate_work (n, s, s, Common) ;
    if (Common->status < 0)
    {
 return (0) ;
    }
    ;
    if (L->xtype == 0 || L->is_super || L->is_ll)
    {
 cholmod_l_change_factor (1, 0, 0, 0, 0, L,
  Common) ;
 if (Common->status < 0)
 {
     return (0) ;
 }
    }
    Lp = L->p ;
    Lnz = L->nz ;
    Li = L->i ;
    Lx = L->x ;
    ;
    W = Common->Xwork ;
    Cx = W + n ;
    Iwork = Common->Iwork ;
    Ci = Iwork + n ;
    given_row = (rnz >= 0) ;
    klast = given_row ? rnz : k ;
    ;
    for (kk = 0 ; kk < klast ; kk++)
    {
 j = given_row ? (Rj [kk]) : (kk) ;
 if (j < 0 || j >= k)
 {
     cholmod_l_error ((-4), "../Modify/cholmod_rowdel.c", 251, "R invalid", Common) ;
     return (0) ;
 }
 ;
 lnz = Lnz [j] ;
 dj = Lx [Lp [j]] ;
 ;
 if (lnz > 1)
 {
     left = Lp [j] ;
     pend = left + lnz ;
     right = pend - 1 ;
     i = Li [right] ;
     if (i < k)
     {
  continue ;
     }
     else if (i == k)
     {
  if (do_solve)
  {
      Xx [j] -= yk [0] * dj * Lx [right] ;
  }
  Lx [right] = 0 ;
     }
     else
     {
  ;
  while (left < right)
  {
      middle = (left + right) / 2 ;
      ;
      if (k > Li [middle])
      {
   left = middle + 1 ;
      }
      else
      {
   right = middle ;
      }
  }
  ;
  if (k == Li [left])
  {
      if (do_solve)
      {
   Xx [j] -= yk [0] * dj * Lx [left] ;
      }
      Lx [left] = 0 ;
  }
     }
 }
    }
    lnz = Lnz [k] - 1 ;
    ;
    ;
    p = Lp [k] ;
    pend = p + lnz + 1 ;
    dk = Lx [p] ;
    Lx [p++] = 1 ;
    ;
    ok = 1 ;
    fl = 0 ;
    if (lnz > 0)
    {
 if (do_solve)
 {
     xk = Xx [k] - yk [0] * dk ;
     for ( ; p < pend ; p++)
     {
  Nx [Li [p]] += Lx [p] * xk ;
     }
 }
 do_update = ((dk) > 0.) ;
 if (!do_update)
 {
     dk = -dk ;
 }
 sqrt_dk = sqrt (dk) ;
 p = Lp [k] + 1 ;
 for (kk = 0 ; kk < lnz ; kk++, p++)
 {
     Ci [kk] = Li [p] ;
     Cx [kk] = Lx [p] * sqrt_dk ;
     Lx [p] = 0 ;
 }
 fl = lnz + 1 ;
 C = &Cmatrix ;
 C->nrow = n ;
 C->ncol = 1 ;
 C->nzmax = lnz ;
 C->sorted = 1 ;
 C->packed = 1 ;
 C->p = Cp ;
 C->i = Ci ;
 C->x = Cx ;
 C->nz = ((void *)0) ;
 C->itype = L->itype ;
 C->xtype = L->xtype ;
 C->dtype = L->dtype ;
 C->z = ((void *)0) ;
 C->stype = 0 ;
 Cp [0] = 0 ;
 Cp [1] = lnz ;
 ok = cholmod_l_updown_mark (do_update ? (1) : (0), C, colmark,
  L, X, DeltaB, Common) ;
 for (kk = 0 ; kk < lnz ; kk++)
 {
     Cx [kk] = 0 ;
 }
    }
    Common->modfl += fl ;
    if (do_solve)
    {
 Xx [k] = yk [0] ;
    }
    ;
    ;
    return (ok) ;
}

variable_types:
kdel
unsigned long

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

variable_types:
colmark
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_dense_struct { unsigned long nrow; unsigned long ncol; unsigned long nzmax; unsigned long d; void *x; void *z; int xtype; int dtype; } *

variable_types:
DeltaB
struct cholmod_dense_struct *

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

variable_types: xk double

variable_types: dj double

variable_types: fl double

variable_types:
Cx
double *

variable_types:
W
double *

variable_types:
Xx
double *

variable_types:
Nx
double *

variable_types:
Li
long *

variable_types:
Lnz
long *

variable_types:
Ci
long *

variable_types:
Rj
long *

variable_types:
Rp
long *

variable_types:
Iwork
long *

variable_types: p long

variable_types: pend long

variable_types: kk long

variable_types: lnz long

variable_types: n long

variable_types:
Cp
long [2]

variable_types: left long

variable_types: k long

variable_types: right long

variable_types: middle long

variable_types: i long

variable_types: klast long

variable_types: rnz long

variable_types:
s
unsigned long

variable_types: ok int


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

v5[0] = 0LL;
v5[1] = 0LL;
return cholmod_l_rowdel_mark(a1, a2, (double *)v5, 0LL, a3, 0LL, 0LL, v4);
}

original_code:
int cholmod_l_rowdel
(
    size_t k,
    cholmod_sparse *R,
    cholmod_factor *L,
    cholmod_common *Common
)
{
    double yk [2] ;
    yk [0] = 0. ;
    yk [1] = 0. ;
    return (cholmod_l_rowdel_mark (k, R, yk, ((void *)0), L, ((void *)0), ((void *)0), Common)) ;
}

canonical_original_code:
int cholmod_l_rowdel(unsigned long k, struct cholmod_sparse_struct *R, struct cholmod_factor_struct *L, struct cholmod_common_struct *Common)
{
    double yk[2];
    yk [0] = 0. ;
    yk [1] = 0. ;
    return (cholmod_l_rowdel_mark (k, R, yk, ((void *)0), L, ((void *)0), ((void *)0), Common)) ;
}

variable_types:
k
unsigned long

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


decompiled_code:
__int64 __fastcall cholmod_l_rowdel_solve(__int64 a1, __int64 a2, double *a3, __int64 a4, __int64 a5, __int64 a6, __int64 a7)
{
return cholmod_l_rowdel_mark(a1, a2, a3, 0LL, a4, a5, a6, a7);
}

original_code:
int cholmod_l_rowdel_solve
(
    size_t k,
    cholmod_sparse *R,
    double yk [2],
    cholmod_factor *L,
    cholmod_dense *X,
    cholmod_dense *DeltaB,
    cholmod_common *Common
)
{
    return (cholmod_l_rowdel_mark (k, R, yk, ((void *)0), L, X, DeltaB, Common)) ;
}

canonical_original_code:
int cholmod_l_rowdel_solve(unsigned long k, struct cholmod_sparse_struct *R, double yk[2], struct cholmod_factor_struct *L, struct cholmod_dense_struct *X, struct cholmod_dense_struct *DeltaB, struct cholmod_common_struct *Common)
{
    return (cholmod_l_rowdel_mark (k, R, yk, ((void *)0), L, X, DeltaB, Common)) ;
}

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

variable_types:
DeltaB
struct cholmod_dense_struct *

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

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


original_code:
long umfzl_build_tuples
(
    NumericType *Numeric,
    WorkType *Work
)
{
    long e, nrows, ncols, nel, *Rows, *Cols, row, col, n_row, n_col, *E,
 *Row_tuples, *Row_degree, *Row_tlen,
 *Col_tuples, *Col_degree, *Col_tlen, n1 ;
    Element *ep ;
    Unit *p ;
    Tuple tuple, *tp ;
    E = Work->E ;
    Col_degree = Numeric->Cperm ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Row_tlen = Numeric->Uilen ;
    Col_tuples = Numeric->Lip ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    nel = Work->nel ;
    n1 = Work->n1 ;
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     Row_tuples [row] = umfzl_mem_alloc_tail_block (Numeric,
  (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     if (!Row_tuples [row])
     {
  ;
  return ((0)) ;
     }
     Row_tlen [row] = 0 ;
 }
    }
    for (col = n_col-1 ; col >= n1 ; col--)
    {
 if ((Col_degree [col] >= 0))
 {
     Col_tuples [col] = umfzl_mem_alloc_tail_block (Numeric,
  (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     if (!Col_tuples [col])
     {
  ;
  return ((0)) ;
     }
     Col_tlen [col] = 0 ;
 }
    }
    for (e = 1 ; e <= nel ; e++)
    {
 ;
 ;
 p = Numeric->Memory + E [e] ;
 { { ; ; ; ep = (Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (long *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
 nrows = ep->nrows ;
 ;
 ;
 ;
 tuple.e = e ;
 for (tuple.f = 0 ; tuple.f < ncols ; tuple.f++)
 {
     col = Cols [tuple.f] ;
     ;
     ;
     ;
     tp = ((Tuple *) (Numeric->Memory + Col_tuples [col]))
  + Col_tlen [col]++ ;
     *tp = tuple ;
 }
 for (tuple.f = 0 ; tuple.f < nrows ; tuple.f++)
 {
     row = Rows [tuple.f] ;
     ;
     ;
     ;
     tp = ((Tuple *) (Numeric->Memory + Row_tuples [row]))
  + Row_tlen [row]++ ;
     *tp = tuple ;
 }
    }
    ;
    return ((1)) ;
}

canonical_original_code:
long umfzl_build_tuples(struct NumericType *Numeric, struct WorkType *Work)
{
    long e; long nrows; long ncols; long nel; long *Rows; long *Cols; long row; long col; long n_row; long n_col; long *E; long *Row_tuples; long *Row_degree; long *Row_tlen; long *Col_tuples; long *Col_degree; long *Col_tlen; long n1;
    struct Element *ep;
    union Unit_union *p;
    struct Tuple tuple; struct Tuple *tp;
    E = Work->E ;
    Col_degree = Numeric->Cperm ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Row_tlen = Numeric->Uilen ;
    Col_tuples = Numeric->Lip ;
    Col_tlen = Numeric->Lilen ;
    n_row = Work->n_row ;
    n_col = Work->n_col ;
    nel = Work->nel ;
    n1 = Work->n1 ;
    ;
    for (row = n1 ; row < n_row ; row++)
    {
 if ((Row_degree [row] >= 0))
 {
     Row_tuples [row] = umfzl_mem_alloc_tail_block (Numeric,
  (((((sizeof (Tuple) * ((((4) > ((Row_tlen [row]) + 1)) ? (4) : ((Row_tlen [row]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     if (!Row_tuples [row])
     {
  ;
  return ((0)) ;
     }
     Row_tlen [row] = 0 ;
 }
    }
    for (col = n_col-1 ; col >= n1 ; col--)
    {
 if ((Col_degree [col] >= 0))
 {
     Col_tuples [col] = umfzl_mem_alloc_tail_block (Numeric,
  (((((sizeof (Tuple) * ((((4) > ((Col_tlen [col]) + 1)) ? (4) : ((Col_tlen [col]) + 1))))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
     if (!Col_tuples [col])
     {
  ;
  return ((0)) ;
     }
     Col_tlen [col] = 0 ;
 }
    }
    for (e = 1 ; e <= nel ; e++)
    {
 ;
 ;
 p = Numeric->Memory + E [e] ;
 { { ; ; ; ep = (struct Element *) p ; p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ; Cols = (long *) p ; } ; ncols = ep->ncols ; Rows = Cols + ncols ; } ;
 nrows = ep->nrows ;
 ;
 ;
 ;
 tuple.e = e ;
 for (tuple.f = 0 ; tuple.f < ncols ; tuple.f++)
 {
     col = Cols [tuple.f] ;
     ;
     ;
     ;
     tp = ((struct Tuple *) (Numeric->Memory + Col_tuples [col]))
  + Col_tlen [col]++ ;
     *tp = tuple ;
 }
 for (tuple.f = 0 ; tuple.f < nrows ; tuple.f++)
 {
     row = Rows [tuple.f] ;
     ;
     ;
     ;
     tp = ((struct Tuple *) (Numeric->Memory + Row_tuples [row]))
  + Row_tlen [row]++ ;
     *tp = tuple ;
 }
    }
    ;
    return ((1)) ;
}

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

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

variable_types: e long

variable_types: nrows long

variable_types: ncols long

variable_types: nel long

variable_types:
Rows
long *

variable_types:
Cols
long *

variable_types: row long

variable_types: col long

variable_types:
E
long *

variable_types:
ep
struct Element { long cdeg; } *

variable_types:
tuple
struct Tuple { long e; }

variable_types:
tp
struct Tuple { long e; } *

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:
double
umfzi_uhsolve
(
    NumericType *Numeric,
    DoubleComplex X [ ],
    int Pattern [ ]
)
{
    DoubleComplex xk ;
    DoubleComplex *xp, *D, *Uval ;
    int k, deg, j, *ip, col, *Upos, *Uilen, kstart, kend, up,
 *Uip, n, uhead, ulen, pos, 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 ;
    kend = 0 ;
    n1 = Numeric->n1 ;
    for (k = 0 ; k < n1 ; k++)
    {
 ;
 { (void) umfpack_divcomplex ((X [k]).component [0], (X [k]).component [1], (D [k]).component [0], (-(D [k]).component [1]), &((xk).component [0]), &((xk).component [1])) ; } ;
 X [k] = xk ;
 deg = Uilen [k] ;
 if (deg > 0 && ((((xk).component [0]) != 0.) || (((xk).component [1]) != 0.)))
 {
     up = Uip [k] ;
     Ui = (int *) (Numeric->Memory + up) ;
     up += (((((sizeof (int) * (deg))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
     Uval = (DoubleComplex *) (Numeric->Memory + up) ;
     for (j = 0 ; j < deg ; j++)
     {
  ;
  ;
  ;
  { ; (X [Ui [j]]).component [0] -= (xk).component [0] * (Uval [j]).component [0] + (xk).component [1] * (Uval [j]).component [1] ; (X [Ui [j]]).component [1] -= (xk).component [1] * (Uval [j]).component [0] - (xk).component [0] * (Uval [j]).component [1] ; } ;
     }
 }
    }
    for (kstart = n1 ; kstart < npiv ; kstart = kend + 1)
    {
 ;
 kend = kstart ;
 while (kend < npiv && Uip [kend+1] > 0)
 {
     kend++ ;
 }
 k = kend+1 ;
 ;
 if (k == npiv)
 {
     deg = Numeric->ulen ;
     if (deg > 0)
     {
  for (j = 0 ; j < deg ; j++)
  {
      Pattern [j] = Numeric->Upattern [j] ;
  }
     }
 }
 else
 {
     ;
     up = -Uip [k] ;
     ;
     deg = Uilen [k] ;
     ;
     ip = (int *) (Numeric->Memory + up) ;
     for (j = 0 ; j < deg ; j++)
     {
  col = *ip++ ;
  ;
  ;
  Pattern [j] = col ;
     }
 }
 uhead = n ;
 for (k = kend ; k > kstart ; k--)
 {
     ;
     ulen = Uilen [k] ;
     for (j = 0 ; j < ulen ; j++)
     {
  ;
  Pattern [--uhead] = Pattern [--deg] ;
     }
     ;
     ;
     pos = Upos [k] ;
     if (pos != (-1))
     {
  ;
  ;
  Pattern [deg++] = Pattern [pos] ;
  Pattern [pos] = k ;
     }
 }
 ;
 for (k = kstart ; k <= kend ; k++)
 {
     ;
     pos = Upos [k] ;
     if (pos != (-1))
     {
  ;
  ;
  ;
  ;
  Pattern [pos] = Pattern [--deg] ;
     }
     up = Uip [k] ;
     ulen = Uilen [k] ;
     if (k > kstart)
     {
  for (j = 0 ; j < ulen ; j++)
  {
      ;
      Pattern [deg++] = Pattern [uhead++] ;
  }
  ;
  ;
     }
     { (void) umfpack_divcomplex ((X [k]).component [0], (X [k]).component [1], (D [k]).component [0], (-(D [k]).component [1]), &((xk).component [0]), &((xk).component [1])) ; } ;
     X [k] = xk ;
     if (((((xk).component [0]) != 0.) || (((xk).component [1]) != 0.)))
     {
  if (k == kstart)
  {
      up = -up ;
      xp = (DoubleComplex *) (Numeric->Memory + up + (((((sizeof (int) * (ulen))) + (sizeof (Unit)) - 1) / (sizeof (Unit))))) ;
  }
  else
  {
      xp = (DoubleComplex *) (Numeric->Memory + up) ;
  }
  for (j = 0 ; j < deg ; j++)
  {
      ;
      ;
      ;
      { ; (X [Pattern [j]]).component [0] -= (xk).component [0] * (*xp).component [0] + (xk).component [1] * (*xp).component [1] ; (X [Pattern [j]]).component [1] -= (xk).component [1] * (*xp).component [0] - (xk).component [0] * (*xp).component [1] ; } ;
      xp++ ;
  }
     }
 }
 ;
    }
    for (k = npiv ; k < n ; k++)
    {
 ;
 { (void) umfpack_divcomplex ((X [k]).component [0], (X [k]).component [1], (D [k]).component [0], (D [k]).component [1], &((xk).component [0]), &((xk).component [1])) ; } ;
 X [k] = xk ;
    }
    return (9. * ((double) n) + 8. * ((double) Numeric->unz));
}

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

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

variable_types:
X
struct DoubleComplex []

variable_types:
Pattern
int []

variable_types: 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: kstart int

variable_types: kend int

variable_types: up int

variable_types:
Uip
int *

variable_types: n int

variable_types: uhead int

variable_types: ulen int

variable_types: pos int

variable_types: npiv int

variable_types:
Ui
int *


original_code:
double cholmod_rcond
(
    cholmod_factor *L,
    cholmod_common *Common
)
{
    double lmin, lmax, rcond ;
    double *Lx ;
    int *Lpi, *Lpx, *Super, *Lp ;
    int n, e, nsuper, s, k1, k2, psi, psend, psx, nsrow, nscol, jj, j ;
    { if (Common == ((void *)0)) { return ((-1)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return ((-1)) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rcond.c", 85, "argument missing", Common) ; } return ((-1)) ; } } ;
    { 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_error ((-4), "../Cholesky/cholmod_rcond.c", 86, "invalid xtype", Common) ; } return ((-1)) ; } } ;
    Common->status = 0 ;
    n = L->n ;
    if (n == 0)
    {
 return (1) ;
    }
    if (L->minor < L->n)
    {
 return (0) ;
    }
    e = (L->xtype == 2) ? 2 : 1 ;
    if (L->is_super)
    {
 nsuper = L->nsuper ;
 Lpi = L->pi ;
 Lpx = L->px ;
 Super = L->super ;
 Lx = L->x ;
 { double ljj = Lx [0] ; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
 for (s = 0 ; s < nsuper ; s++)
 {
     k1 = Super [s] ;
     k2 = Super [s+1] ;
     psi = Lpi [s] ;
     psend = Lpi [s+1] ;
     psx = Lpx [s] ;
     nsrow = psend - psi ;
     nscol = k2 - k1 ;
     for (jj = 0 ; jj < nscol ; jj++)
     {
  { double ljj = Lx [e * (psx + jj + jj*nsrow)] ; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    else
    {
 Lp = L->p ;
 Lx = L->x ;
 if (L->is_ll)
 {
     { double ljj = Lx [Lp [0]] ; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = Lx [e * Lp [j]] ; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
 else
 {
     { double ljj = fabs (Lx [Lp [0]]) ; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = fabs (Lx [e * Lp [j]]) ; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    rcond = lmin / lmax ;
    if (L->is_ll)
    {
 rcond = rcond*rcond ;
    }
    return (rcond) ;
}

canonical_original_code:
double cholmod_rcond(struct cholmod_factor_struct *L, struct cholmod_common_struct *Common)
{
    double lmin; double lmax; double rcond;
    double *Lx;
    int *Lpi; int *Lpx; int *Super; int *Lp;
    int n; int e; int nsuper; int s; int k1; int k2; int psi; int psend; int psx; int nsrow; int nscol; int jj; int j;
    { if (Common == ((void *)0)) { return ((-1)) ; } if (Common->itype != 0 || Common->dtype != 0) { Common->status = (-4) ; return ((-1)) ; } } ;
    { if ((L) == ((void *)0)) { if (Common->status != (-2)) { cholmod_error ((-4), "../Cholesky/cholmod_rcond.c", 85, "argument missing", Common) ; } return ((-1)) ; } } ;
    { 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_error ((-4), "../Cholesky/cholmod_rcond.c", 86, "invalid xtype", Common) ; } return ((-1)) ; } } ;
    Common->status = 0 ;
    n = L->n ;
    if (n == 0)
    {
 return (1) ;
    }
    if (L->minor < L->n)
    {
 return (0) ;
    }
    e = (L->xtype == 2) ? 2 : 1 ;
    if (L->is_super)
    {
 nsuper = L->nsuper ;
 Lpi = L->pi ;
 Lpx = L->px ;
 Super = L->super ;
 Lx = L->x ;
 { double ljj = Lx [0]; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
 for (s = 0 ; s < nsuper ; s++)
 {
     k1 = Super [s] ;
     k2 = Super [s+1] ;
     psi = Lpi [s] ;
     psend = Lpi [s+1] ;
     psx = Lpx [s] ;
     nsrow = psend - psi ;
     nscol = k2 - k1 ;
     for (jj = 0 ; jj < nscol ; jj++)
     {
  { double ljj = Lx [e * (psx + jj + jj*nsrow)]; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    else
    {
 Lp = L->p ;
 Lx = L->x ;
 if (L->is_ll)
 {
     { double ljj = Lx [Lp [0]]; if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = Lx [e * Lp [j]]; if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
 else
 {
     { double ljj = fabs (Lx [Lp [0]]); if (((ljj) != (ljj))) { return (0) ; } lmin = ljj ; lmax = ljj ; } ;
     for (j = 1 ; j < n ; j++)
     {
  { double ljj = fabs (Lx [e * Lp [j]]); if (((ljj) != (ljj))) { return (0) ; } if (ljj < lmin) { lmin = ljj ; } else if (ljj > lmax) { lmax = ljj ; } } ;
     }
 }
    }
    rcond = lmin / lmax ;
    if (L->is_ll)
    {
 rcond = rcond*rcond ;
    }
    return (rcond) ;
}

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

variable_types: lmax double

variable_types: rcond double

variable_types:
Lx
double *

variable_types:
Lpi
int *

variable_types:
Lpx
int *

variable_types:
Super
int *

variable_types:
Lp
int *

variable_types: e int

variable_types: nsuper int

variable_types: s int

variable_types: psi int

variable_types: psend int

variable_types: psx int

variable_types: nsrow int

variable_types: nscol int

variable_types: jj int

variable_types: ljj double


original_code:
void umf_i_fsize
(
    int nn,
    int Fsize [ ],
    int Fnrows [ ],
    int Fncols [ ],
    int Parent [ ],
    int Npiv [ ]
)
{
    int j, parent, frsize, r, c ;
    for (j = 0 ; j < nn ; j++)
    {
 Fsize [j] = (-1) ;
    }
    ;
    for (j = 0 ; j < nn ; j++)
    {
 if (Npiv [j] > 0)
 {
     parent = Parent [j] ;
     r = Fnrows [j] ;
     c = Fncols [j] ;
     frsize = r * c ;
     if (((!((((double) r) * ((double) c)) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((((double) r) * ((double) c)) != (((double) r) * ((double) c)))))
     {
  frsize = 0x7fffffff ;
     }
     ;
     Fsize [j] = (((Fsize [j]) > (frsize)) ? (Fsize [j]) : (frsize)) ;
     ;
     if (parent != (-1))
     {
  ;
  ;
  Fsize [parent] = (((Fsize [parent]) > (Fsize [j])) ? (Fsize [parent]) : (Fsize [j])) ;
  ;
     }
 }
    }
}

canonical_original_code:
void umf_i_fsize(int nn, int Fsize[], int Fnrows[], int Fncols[], int Parent[], int Npiv[])
{
    int j; int parent; int frsize; int r; int c;
    for (j = 0 ; j < nn ; j++)
    {
 Fsize [j] = (-1) ;
    }
    ;
    for (j = 0 ; j < nn ; j++)
    {
 if (Npiv [j] > 0)
 {
     parent = Parent [j] ;
     r = Fnrows [j] ;
     c = Fncols [j] ;
     frsize = r * c ;
     if (((!((((double) r) * ((double) c)) * (1.0+1e-8) <= (double) 0x7fffffff)) || ((((double) r) * ((double) c)) != (((double) r) * ((double) c)))))
     {
  frsize = 0x7fffffff ;
     }
     ;
     Fsize [j] = (((Fsize [j]) > (frsize)) ? (Fsize [j]) : (frsize)) ;
     ;
     if (parent != (-1))
     {
  ;
  ;
  Fsize [parent] = (((Fsize [parent]) > (Fsize [j])) ? (Fsize [parent]) : (Fsize [j])) ;
  ;
     }
 }
    }
}

variable_types: nn int

variable_types:
Fsize
int []

variable_types:
Fnrows
int []

variable_types:
Fncols
int []

variable_types:
Parent
int []

variable_types:
Npiv
int []

variable_types: j int

variable_types: parent int

variable_types: frsize int

variable_types: r int

variable_types: c int


original_code:
int umf_i_analyze
(
    int n_row,
    int n_col,
    int Ai [ ],
    int Ap [ ],
    int Up [ ],
    int fixQ,
    int W [ ],
    int Link [ ],
    int Front_ncols [ ],
    int Front_nrows [ ],
    int Front_npivcol [ ],
    int Front_parent [ ],
    int *nfr_out,
    int *p_ncompactions
)
{
    int j, j3, col, k, row, parent, j2, pdest, p, p2, thickness, npivots, nfr,
 i, *Winv, kk, npiv, jnext, krow, knext, pfirst, jlast, ncompactions,
 *Front_stack, *Front_order, *Front_child, *Front_sibling,
 Wflag, npivcol, fallrows, fallcols, fpiv, frows, fcols, *Front_size ;
    nfr = 0 ;
    ;
#pragma ivdep
    for (j = 0 ; j < n_col ; j++)
    {
 Link [j] = (-1) ;
 W [j] = (-1) ;
 Up [j] = (-1) ;
 Front_npivcol [j] = 0 ;
 Front_nrows [j] = 0 ;
 Front_ncols [j] = 0 ;
 Front_parent [j] = (-1) ;
    }
    krow = 0 ;
    pfirst = Ap [0] ;
    jlast = (-1) ;
    jnext = (-1) ;
    Wflag = 0 ;
    ;
    pdest = 0 ;
    ncompactions = 0 ;
    for (j = 0 ; j < n_col ; j = jnext)
    {
 ;
 if (pdest + (n_col-j) > pfirst)
 {
     pdest = 0 ;
     ncompactions++ ;
     for (row = 0 ; row < j ; row++)
     {
  if (Up [row] != (-1))
  {
      ;
      ;
      p = Up [row] ;
      ;
      p2 = p + (Front_ncols [row] - Front_npivcol [row]) ;
      Up [row] = pdest ;
      for ( ; p < p2 ; p++)
      {
   ;
   ;
   ;
   Ai [pdest++] = Ai [p] ;
   ;
      }
      ;
  }
     }
 }
 if (pdest + (n_col-j) > pfirst)
 {
     return ((0)) ;
 }
 if (jlast != (-1) && Link [j] == jlast)
 {
     ;
     ;
     Up [j] = Up [jlast] ;
     Up [jlast] = (-1) ;
     parent = n_col ;
     for (p = Up [j] ; p < pdest ; )
     {
  j3 = Ai [p] ;
  ;
  ;
  ;
  ;
  if (j == j3)
  {
      ;
      Ai [p] = Ai [--pdest] ;
  }
  else
  {
      if (j3 < parent)
      {
   parent = j3 ;
      }
      p++ ;
  }
     }
     Link [j] = Link [jlast] ;
     ;
     thickness = (Front_nrows [jlast] - Front_npivcol [jlast]) ;
     ;
 }
 else
 {
     Up [j] = pdest ;
     parent = n_col ;
     thickness = 0 ;
     Wflag = j ;
 }
 ;
 W [j] = Wflag ;
 ;
 ;
 jnext = n_col ;
 for (knext = krow ; knext < n_row ; knext++)
 {
     ;
     ;
     jnext = Ai [Ap [knext]] ;
     ;
     if (jnext != j)
     {
  break ;
     }
 }
 if (knext == n_row)
 {
     jnext = n_col ;
 }
 ;
 ;
 for (k = krow ; k < knext ; k++)
 {
     p = Ap [k] ;
     p2 = Ap [k+1] ;
     ;
     ;
     ;
     ;
     ;
     ;
     ;
     for ( ; p < p2 ; p++)
     {
  col = Ai [p] ;
  ;
  ;
  if (W [col] != Wflag)
  {
      Ai [pdest++] = col ;
      ;
      W [col] = Wflag ;
      if (col < parent)
      {
   parent = col ;
      }
  }
     }
     ;
     thickness++ ;
 }
 krow = knext ;
 pfirst = Ap [knext] ;
 for (k = Link [j] ; k != (-1) ; k = Link [k])
 {
     ;
     ;
     ;
     p = Up [k] ;
     ;
     p2 = p + (Front_ncols [k] - Front_npivcol [k]) ;
     ;
     ;
     ;
     for ( ; p < p2 ; p++)
     {
  col = Ai [p] ;
  ;
  ;
  if (W [col] != Wflag)
  {
      Ai [pdest++] = col ;
      ;
      W [col] = Wflag ;
      if (col < parent)
      {
   parent = col ;
      }
  }
     }
     ;
     Up [k] = (-1) ;
     ;
     thickness += (Front_nrows [k] - Front_npivcol [k]) ;
     ;
 }
 for (j2 = j+1 ; j2 < jnext ; j2++)
 {
     ;
     if (W [j2] != Wflag || Link [j2] != (-1))
     {
  break ;
     }
 }
 ;
 ;
 jnext = j2 ;
 j2-- ;
 ;
 ;
 npivots = j2-j+1 ;
 ;
 if (j2 > j)
 {
     ;
     ;
     ;
     parent = n_col ;
     p2 = pdest ;
     pdest = Up [j] ;
     for (p = Up [j] ; p < p2 ; p++)
     {
  col = Ai [p] ;
  ;
  ;
  if (col > j2)
  {
      Ai [pdest++] = col ;
      if (col < parent)
      {
   parent = col ;
      }
  }
     }
 }
 ;
 ;
 if (parent == n_col)
 {
     parent = (-1) ;
 }
 npivcol = npivots ;
 fallrows = thickness ;
 fallcols = npivots + pdest - Up [j] ;
 fpiv = (((npivcol) < (fallrows)) ? (npivcol) : (fallrows)) ;
 frows = fallrows - fpiv ;
 fcols = fallcols - fpiv ;
 if (frows == 0 || fcols == 0)
 {
     ;
     Up [j] = (-1) ;
     parent = (-1) ;
 }
 Front_npivcol [j] = npivots ;
 Front_nrows [j] = fallrows ;
 Front_ncols [j] = fallcols ;
 Front_parent [j] = parent ;
 ;
 ;
 nfr++ ;
 if (parent != (-1))
 {
     Link [j] = Link [parent] ;
     Link [parent] = j ;
 }
 ;
 jlast = j ;
    }
    *nfr_out = nfr ;
    Front_order = W ;
    if (fixQ)
    {
 ;
 k = 0 ;
#pragma novector
 for (j = 0 ; j < n_col ; j++)
 {
     if (Front_npivcol [j] > 0)
     {
  Front_order [j] = k++ ;
  ;
     }
     else
     {
  Front_order [j] = (-1) ;
     }
 }
    }
    else
    {
 Front_child = Ap ;
 Front_sibling = Link ;
 Front_stack = Ai ;
 Front_size = Front_stack + n_col ;
 umf_i_fsize (n_col, Front_size, Front_nrows, Front_ncols,
     Front_parent, Front_npivcol) ;
 amd_postorder (n_col, Front_parent, Front_npivcol, Front_size,
     Front_order, Front_child, Front_sibling, Front_stack) ;
 Winv = Ai ;
 for (k = 0 ; k < nfr ; k++)
 {
     Winv [k] = (-1) ;
 }
 ;
 for (i = 0 ; i < n_col ; i++)
 {
     k = Front_order [i] ;
     if (k != (-1))
     {
  ;
  ;
  ;
  Winv [k] = i ;
     }
 }
 kk = 0 ;
 for (k = 0 ; k < nfr ; k++)
 {
     i = Winv [k] ;
     ;
     ;
     ;
     for (npiv = 0 ; npiv < Front_npivcol [i] ; npiv++)
     {
  Up [kk] = i + npiv ;
  ;
  kk++ ;
     }
 }
 ;
    }
    umf_i_apply_order (Front_npivcol, Front_order, Ai, n_col, nfr) ;
    umf_i_apply_order (Front_nrows, Front_order, Ai, n_col, nfr) ;
    umf_i_apply_order (Front_ncols, Front_order, Ai, n_col, nfr) ;
    umf_i_apply_order (Front_parent, Front_order, Ai, n_col, nfr) ;
    for (i = 0 ; i < nfr ; i++)
    {
 parent = Front_parent [i] ;
 if (parent != (-1))
 {
     ;
     ;
     Front_parent [i] = Front_order [parent] ;
 }
    }
    *p_ncompactions = ncompactions ;
    return ((1)) ;
}

canonical_original_code:
int umf_i_analyze(int n_row, int n_col, int Ai[], int Ap[], int Up[], int fixQ, int W[], int Link[], int Front_ncols[], int Front_nrows[], int Front_npivcol[], int Front_parent[], int *nfr_out, int *p_ncompactions)
{
    int j; int j3; int col; int k; int row; int parent; int j2; int pdest; int p; int p2; int thickness; int npivots; int nfr; int i; int *Winv; int kk; int npiv; int jnext; int krow; int knext; int pfirst; int jlast; int ncompactions; int *Front_stack; int *Front_order; int *Front_child; int *Front_sibling; int Wflag; int npivcol; int fallrows; int fallcols; int fpiv; int frows; int fcols; int *Front_size;
    nfr = 0 ;
    ;
#pragma ivdep
    for (j = 0 ; j < n_col ; j++)
    {
 Link [j] = (-1) ;
 W [j] = (-1) ;
 Up [j] = (-1) ;
 Front_npivcol [j] = 0 ;
 Front_nrows [j] = 0 ;
 Front_ncols [j] = 0 ;
 Front_parent [j] = (-1) ;
    }
    krow = 0 ;
    pfirst = Ap [0] ;
    jlast = (-1) ;
    jnext = (-1) ;
    Wflag = 0 ;
    ;
    pdest = 0 ;
    ncompactions = 0 ;
    for (j = 0 ; j < n_col ; j = jnext)
    {
 ;
 if (pdest + (n_col-j) > pfirst)
 {
     pdest = 0 ;
     ncompactions++ ;
     for (row = 0 ; row < j ; row++)
     {
  if (Up [row] != (-1))
  {
      ;
      ;
      p = Up [row] ;
      ;
      p2 = p + (Front_ncols [row] - Front_npivcol [row]) ;
      Up [row] = pdest ;
      for ( ; p < p2 ; p++)
      {
   ;
   ;
   ;
   Ai [pdest++] = Ai [p] ;
   ;
      }
      ;
  }
     }
 }
 if (pdest + (n_col-j) > pfirst)
 {
     return ((0)) ;
 }
 if (jlast != (-1) && Link [j] == jlast)
 {
     ;
     ;
     Up [j] = Up [jlast] ;
     Up [jlast] = (-1) ;
     parent = n_col ;
     for (p = Up [j] ; p < pdest ; )
     {
  j3 = Ai [p] ;
  ;
  ;
  ;
  ;
  if (j == j3)
  {
      ;
      Ai [p] = Ai [--pdest] ;
  }
  else
  {
      if (j3 < parent)
      {
   parent = j3 ;
      }
      p++ ;
  }
     }
     Link [j] = Link [jlast] ;
     ;
     thickness = (Front_nrows [jlast] - Front_npivcol [jlast]) ;
     ;
 }
 else
 {
     Up [j] = pdest ;
     parent = n_col ;
     thickness = 0 ;
     Wflag = j ;
 }
 ;
 W [j] = Wflag ;
 ;
 ;
 jnext = n_col ;
 for (knext = krow ; knext < n_row ; knext++)
 {
     ;
     ;
     jnext = Ai [Ap [knext]] ;
     ;
     if (jnext != j)
     {
  break ;
     }
 }
 if (knext == n_row)
 {
     jnext = n_col ;
 }
 ;
 ;
 for (k = krow ; k < knext ; k++)
 {
     p = Ap [k] ;
     p2 = Ap [k+1] ;
     ;
     ;
     ;
     ;
     ;
     ;
     ;
     for ( ; p < p2 ; p++)
     {
  col = Ai [p] ;
  ;
  ;
  if (W [col] != Wflag)
  {
      Ai [pdest++] = col ;
      ;
      W [col] = Wflag ;
      if (col < parent)
      {
   parent = col ;
      }
  }
     }
     ;
     thickness++ ;
 }
 krow = knext ;
 pfirst = Ap [knext] ;
 for (k = Link [j] ; k != (-1) ; k = Link [k])
 {
     ;
     ;
     ;
     p = Up [k] ;
     ;
     p2 = p + (Front_ncols [k] - Front_npivcol [k]) ;
     ;
     ;
     ;
     for ( ; p < p2 ; p++)
     {
  col = Ai [p] ;
  ;
  ;
  if (W [col] != Wflag)
  {
      Ai [pdest++] = col ;
      ;
      W [col] = Wflag ;
      if (col < parent)
      {
   parent = col ;
      }
  }
     }
     ;
     Up [k] = (-1) ;
     ;
     thickness += (Front_nrows [k] - Front_npivcol [k]) ;
     ;
 }
 for (j2 = j+1 ; j2 < jnext ; j2++)
 {
     ;
     if (W [j2] != Wflag || Link [j2] != (-1))
     {
  break ;
     }
 }
 ;
 ;
 jnext = j2 ;
 j2-- ;
 ;
 ;
 npivots = j2-j+1 ;
 ;
 if (j2 > j)
 {
     ;
     ;
     ;
     parent = n_col ;
     p2 = pdest ;
     pdest = Up [j] ;
     for (p = Up [j] ; p < p2 ; p++)
     {
  col = Ai [p] ;
  ;
  ;
  if (col > j2)
  {
      Ai [pdest++] = col ;
      if (col < parent)
      {
   parent = col ;
      }
  }
     }
 }
 ;
 ;
 if (parent == n_col)
 {
     parent = (-1) ;
 }
 npivcol = npivots ;
 fallrows = thickness ;
 fallcols = npivots + pdest - Up [j] ;
 fpiv = (((npivcol) < (fallrows)) ? (npivcol) : (fallrows)) ;
 frows = fallrows - fpiv ;
 fcols = fallcols - fpiv ;
 if (frows == 0 || fcols == 0)
 {
     ;
     Up [j] = (-1) ;
     parent = (-1) ;
 }
 Front_npivcol [j] = npivots ;
 Front_nrows [j] = fallrows ;
 Front_ncols [j] = fallcols ;
 Front_parent [j] = parent ;
 ;
 ;
 nfr++ ;
 if (parent != (-1))
 {
     Link [j] = Link [parent] ;
     Link [parent] = j ;
 }
 ;
 jlast = j ;
    }
    *nfr_out = nfr ;
    Front_order = W ;
    if (fixQ)
    {
 ;
 k = 0 ;
#pragma novector
 for (j = 0 ; j < n_col ; j++)
 {
     if (Front_npivcol [j] > 0)
     {
  Front_order [j] = k++ ;
  ;
     }
     else
     {
  Front_order [j] = (-1) ;
     }
 }
    }
    else
    {
 Front_child = Ap ;
 Front_sibling = Link ;
 Front_stack = Ai ;
 Front_size = Front_stack + n_col ;
 umf_i_fsize (n_col, Front_size, Front_nrows, Front_ncols,
     Front_parent, Front_npivcol) ;
 amd_postorder (n_col, Front_parent, Front_npivcol, Front_size,
     Front_order, Front_child, Front_sibling, Front_stack) ;
 Winv = Ai ;
 for (k = 0 ; k < nfr ; k++)
 {
     Winv [k] = (-1) ;
 }
 ;
 for (i = 0 ; i < n_col ; i++)
 {
     k = Front_order [i] ;
     if (k != (-1))
     {
  ;
  ;
  ;
  Winv [k] = i ;
     }
 }
 kk = 0 ;
 for (k = 0 ; k < nfr ; k++)
 {
     i = Winv [k] ;
     ;
     ;
     ;
     for (npiv = 0 ; npiv < Front_npivcol [i] ; npiv++)
     {
  Up [kk] = i + npiv ;
  ;
  kk++ ;
     }
 }
 ;
    }
    umf_i_apply_order (Front_npivcol, Front_order, Ai, n_col, nfr) ;
    umf_i_apply_order (Front_nrows, Front_order, Ai, n_col, nfr) ;
    umf_i_apply_order (Front_ncols, Front_order, Ai, n_col, nfr) ;
    umf_i_apply_order (Front_parent, Front_order, Ai, n_col, nfr) ;
    for (i = 0 ; i < nfr ; i++)
    {
 parent = Front_parent [i] ;
 if (parent != (-1))
 {
     ;
     ;
     Front_parent [i] = Front_order [parent] ;
 }
    }
    *p_ncompactions = ncompactions ;
    return ((1)) ;
}

variable_types:
Ai
int []

variable_types:
Ap
int []

variable_types:
Up
int []

variable_types: fixQ int

variable_types:
W
int []

variable_types:
Link
int []

variable_types: col int

variable_types: k int

variable_types: row int

variable_types: pdest int

variable_types: p int

variable_types: thickness int

variable_types: npivots int

variable_types: nfr int

variable_types: i int

variable_types:
Winv
int *

variable_types: kk int

variable_types: npiv int

variable_types: jnext int

variable_types: krow int

variable_types: knext int

variable_types: pfirst int

variable_types: jlast int

variable_types: ncompactions int

variable_types: Wflag int

variable_types: npivcol int

variable_types: fallrows int

variable_types: fallcols int

variable_types: fpiv int

variable_types: frows int

variable_types: fcols int


decompiled_code:
__int64 __fastcall umfdl_mem_alloc_head_block(_QWORD *a1, __int64 a2)
{
__int64 result; // rax
__int64 v3; // rsi
__int64 v4; // rsi

result = a1[14];
if ( a1[15] - result < a2 )
return 0LL;
v3 = result + a2;
a1[14] = v3;
v4 = a1[36] + v3;
if ( v4 < a1[38] )
v4 = a1[38];
a1[38] = v4;
return result;
}

original_code:
long umfdl_mem_alloc_head_block
(
    NumericType *Numeric,
    long nunits
)
{
    long 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:
long umfdl_mem_alloc_head_block(struct NumericType *Numeric, long nunits)
{
    long p; long 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; long scale; long valid; union Unit_union { struct { long size; } header; double xxxxxx; } *Memory; long ihead; long *Rperm; long ulen; double *D; long do_recip; double *Rs; long n_row; long tail_usage; long maxnrows; } *

variable_types: nunits long

variable_types: p long

variable_types: usage long