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

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

variable_types: struct NumericType { double flops; 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: dusage double

variable_types: e long

variable_types: nrows long

variable_types: ncols long

variable_types: nel long

variable_types: i long

variable_types:
Rows
long *

variable_types:
Cols
long *

variable_types: row long

variable_types: col long

variable_types:
E
long *

variable_types: usage long

variable_types:
ep
struct Element { long cdeg; } *


decompiled_code:
__int64 umf_l_cholmod()
{
return 0LL;
}

canonical_decompiled_code:
__int64 func0()
{
return 0LL;
}

original_code:
int umf_l_cholmod
(
    long nrow,
    long ncol,
    long symmetric,
    long Ap [ ],
    long Ai [ ],
    long Perm [ ],
    void *user_params,
    double user_info [3]
)
{
    return ((0)) ;
}

canonical_original_code:
int umf_l_cholmod(long nrow, long ncol, long symmetric, long Ap[], long Ai[], long Perm[], void *user_params, double user_info[3])
{
    return ((0)) ;
}

variable_types: nrow long

variable_types: ncol long

variable_types: symmetric long

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Perm
long []

return_type: int


decompiled_code:
__int64 start_interactive_graphics(void)
{
float v0; // xmm3_4
float v1; // xmm2_4
float v2; // xmm4_4
__m128i v3; // xmm5
float v4; // xmm0_4

world_dim_x = (float)(int)*g_CHIP;
world_dim_y = (float)(int)g_CHIP[1];
v0 = 0.06 * (float)-world_dim_y;
v1 = 1.06 * world_dim_x;
v2 = 1.06 * world_dim_y;
v3 = 0LL;
*(float *)v3.m128i_i32 = 0.06 * (float)-world_dim_x;
init_world(COERCE_FLOAT(_mm_cvtsi128_si32(v3)), v2, v1, v0);
update_message(*(char **)(g_args + 8LL));
v4 = 0.005 * world_dim_x;
block_len = LODWORD(v4);
draw_screen();
return event_loop((void (__fastcall *)(float, float))button_press, (void (*)(void))draw_screen);
}

canonical_decompiled_code:
__int64 func0(void)
{
float v0; // xmm3_4
float v1; // xmm2_4
float v2; // xmm4_4
__m128i v3; // xmm5
float v4; // xmm0_4

world_dim_x = (float)(int)*g_CHIP;
world_dim_y = (float)(int)g_CHIP[1];
v0 = 0.06 * (float)-world_dim_y;
v1 = 1.06 * world_dim_x;
v2 = 1.06 * world_dim_y;
v3 = 0LL;
*(float *)v3.m128i_i32 = 0.06 * (float)-world_dim_x;
init_world(COERCE_FLOAT(_mm_cvtsi128_si32(v3)), v2, v1, v0);
update_message(*(char **)(g_args + 8LL));
v4 = 0.005 * world_dim_x;
block_len = LODWORD(v4);
func1();
return event_loop((void (__fastcall *)(float, float))button_press, (void (*)(void))draw_screen);
}

original_code:
void start_interactive_graphics(void) {
    number_of_wire_pairs = FPGA->W / 2;
    channel_spacing = number_of_wire_pairs*4 + (number_of_wire_pairs + 1)*10;
    clb_len = 1.4*channel_spacing;
    world_dim = FPGA->grid_size*clb_len + (FPGA->grid_size + 1)*channel_spacing + clb_len;
    init_world(0., world_dim, world_dim, 0.);
    update_message("Testing graphics.....");
    draw_screen();
        event_loop(button_press, draw_screen);
}

canonical_original_code:
void start_interactive_graphics() {
    number_of_wire_pairs = FPGA->W / 2;
    channel_spacing = number_of_wire_pairs*4 + (number_of_wire_pairs + 1)*10;
    clb_len = 1.4*channel_spacing;
    world_dim = FPGA->grid_size*clb_len + (FPGA->grid_size + 1)*channel_spacing + clb_len;
    init_world(0., world_dim, world_dim, 0.);
    update_message("Testing graphics.....");
    draw_screen();
        event_loop(button_press, draw_screen);
}

return_type: void


decompiled_code:
__int64 draw_screen(void)
{
__int64 result; // rax
__int64 v1; // [rsp+10h] [rbp-20h]
_DWORD *v2; // [rsp+20h] [rbp-10h]
int j; // [rsp+28h] [rbp-8h]
int i; // [rsp+2Ch] [rbp-4h]

clearscreen();
v2 = (_DWORD *)build_gridsquare_list();
for ( i = 0; i < *v2; ++i )
;
drawline(0.0, 0.0, world_dim_x, 0.0);
drawline(0.0, 0.0, 0.0, world_dim_y);
drawline(0.0, world_dim_y, world_dim_x, world_dim_y);
drawline(world_dim_x, 0.0, world_dim_x, world_dim_y);
v1 = *((_QWORD *)g_CHIP + 1);
for ( j = 1; j <= *(_DWORD *)(v1 + 4); ++j )
draw_block(*(_QWORD *)(*(_QWORD *)(v1 + 8) + 8LL * j));
result = *(unsigned int *)(g_args + 32LL);
if ( (_DWORD)result )
{
if ( *((_QWORD *)g_CHIP + 9) )
{
setcolor(9);
draw_region(*((_QWORD *)g_CHIP + 9));
setcolor(1);
}
if ( *((_QWORD *)g_CHIP + 8) )
{
setcolor(8);
draw_region(*((_QWORD *)g_CHIP + 8));
setcolor(1);
}
if ( *((_QWORD *)g_CHIP + 10) )
{
setcolor(4);
draw_region(*((_QWORD *)g_CHIP + 10));
setcolor(1);
}
if ( *((_QWORD *)g_CHIP + 11) )
{
setcolor(7);
draw_region(*((_QWORD *)g_CHIP + 11));
setcolor(1);
}
result = *((_QWORD *)g_CHIP + 7);
if ( result )
result = draw_clusters(*((_QWORD *)g_CHIP + 7));
}
return result;
}

canonical_decompiled_code:
__int64 func1(void)
{
__int64 result; // rax
__int64 v1; // [rsp+10h] [rbp-20h]
_DWORD *v2; // [rsp+20h] [rbp-10h]
int j; // [rsp+28h] [rbp-8h]
int i; // [rsp+2Ch] [rbp-4h]

clearscreen();
v2 = (_DWORD *)build_gridsquare_list();
for ( i = 0; i < *v2; ++i )
;
drawline(0.0, 0.0, world_dim_x, 0.0);
drawline(0.0, 0.0, 0.0, world_dim_y);
drawline(0.0, world_dim_y, world_dim_x, world_dim_y);
drawline(world_dim_x, 0.0, world_dim_x, world_dim_y);
v1 = *((_QWORD *)g_CHIP + 1);
for ( j = 1; j <= *(_DWORD *)(v1 + 4); ++j )
func3(*(_QWORD *)(*(_QWORD *)(v1 + 8) + 8LL * j));
result = *(unsigned int *)(g_args + 32LL);
if ( (_DWORD)result )
{
if ( *((_QWORD *)g_CHIP + 9) )
{
setcolor(9);
func6(*((_QWORD *)g_CHIP + 9));
setcolor(1);
}
if ( *((_QWORD *)g_CHIP + 8) )
{
setcolor(8);
func6(*((_QWORD *)g_CHIP + 8));
setcolor(1);
}
if ( *((_QWORD *)g_CHIP + 10) )
{
setcolor(4);
func6(*((_QWORD *)g_CHIP + 10));
setcolor(1);
}
if ( *((_QWORD *)g_CHIP + 11) )
{
setcolor(7);
func6(*((_QWORD *)g_CHIP + 11));
setcolor(1);
}
result = *((_QWORD *)g_CHIP + 7);
if ( result )
result = func7(*((_QWORD *)g_CHIP + 7));
}
return result;
}

original_code:
void draw_screen(void) {
    clearscreen();
    drawline(0.,0.,world_dim,0.);
    drawline(0.,0.,0.,world_dim);
    drawline(world_dim,world_dim,0.,world_dim);
    drawline(world_dim,world_dim,world_dim,0.);
    corner_x_offset = (clb_len / 2) + channel_spacing;
    corner_y_offset = corner_x_offset;
    int x_coord, y_coord;
    for(x_coord = 0; x_coord < FPGA->grid_size + 1; x_coord++) {
        for(y_coord = 0; y_coord < FPGA->grid_size + 1; y_coord++) {
            t_switchblock* sb = get_sb(x_coord, y_coord);
            draw_routing_from_sb(sb);
        }
    }
    t_switchblocklist* switchblocklist = FPGA->switchblocklist;
    int switchblock_cnt;
    for(switchblock_cnt = 0; switchblock_cnt < switchblocklist->num_switchblocks; switchblock_cnt++) {
        t_switchblock* switchblock = switchblocklist->array_of_switchblocks[switchblock_cnt];
        draw_switchblock(switchblock);
    }
    t_blocklist* blocklist = FPGA->blocklist;
    int block_cnt;
    for(block_cnt = 0; block_cnt < blocklist->num_blocks; block_cnt++) {
        t_block* block = blocklist->array_of_blocks[block_cnt];
        draw_clb(block);
    }
    flushinput();
}

canonical_original_code:
void draw_screen() {
    clearscreen();
    drawline(0.,0.,world_dim,0.);
    drawline(0.,0.,0.,world_dim);
    drawline(world_dim,world_dim,0.,world_dim);
    drawline(world_dim,world_dim,world_dim,0.);
    corner_x_offset = (clb_len / 2) + channel_spacing;
    corner_y_offset = corner_x_offset;
    int x_coord; int y_coord;
    for(x_coord = 0; x_coord < FPGA->grid_size + 1; x_coord++) {
        for(y_coord = 0; y_coord < FPGA->grid_size + 1; y_coord++) {
            struct s_switchblock *sb = get_sb(x_coord, y_coord);
            draw_routing_from_sb(sb);
        }
    }
    struct s_switchblocklist *switchblocklist = FPGA->switchblocklist;
    int switchblock_cnt;
    for(switchblock_cnt = 0; switchblock_cnt < switchblocklist->num_switchblocks; switchblock_cnt++) {
        struct s_switchblock *switchblock = switchblocklist->array_of_switchblocks[switchblock_cnt];
        draw_switchblock(switchblock);
    }
    struct s_blocklist *blocklist = FPGA->blocklist;
    int block_cnt;
    for(block_cnt = 0; block_cnt < blocklist->num_blocks; block_cnt++) {
        struct s_block *block = blocklist->array_of_blocks[block_cnt];
        draw_clb(block);
    }
    flushinput();
}

variable_types: struct s_switchblocklist { struct s_switchblock { int x_coord; int y_coord; struct s_wire { int channel_x_coord; int channel_y_coord; struct s_switchblock **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; } ***adjacency_list; int *num_adjacencies; int *occupancy_list; } **array_of_switchblocks; unsigned long num_switchblocks; } *

variable_types: struct s_blocklist { struct s_block { int x_coord; int y_coord; struct s_pin { struct s_block *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 { 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_pins; int num_pins; } **array_of_blocks; unsigned long num_blocks; } *

user_defined_types: struct s_switchblocklist { struct s_switchblock **array_of_switchblocks; unsigned long num_switchblocks; }

user_defined_types: struct s_blocklist { struct s_block **array_of_blocks; unsigned long num_blocks; }

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


decompiled_code:
int __fastcall button_press(float a1, float a2)
{
return printf("User clicked at coordinates (%.2f, %.2f)\n", a1, a2);
}

canonical_decompiled_code:
int __fastcall func2(float a1, float a2)
{
return printf("User clicked at coordinates (%.2f, %.2f)\n", a1, a2);
}

original_code:
void button_press (float x, float y) {
     printf("User clicked at coordinates (%f, %f)\n", x, y);
}

canonical_original_code:
void button_press(float x, float y) {
     printf("User clicked at coordinates (%f, %f)\n", x, y);
}

variable_types: x float

variable_types: y float


original_code:
long umfzl_triplet_nomap_x
(
    long n_row,
    long n_col,
    long nz,
    const long Ti [ ],
    const long Tj [ ],
    long Ap [ ],
    long Ai [ ],
    long Rp [ ],
    long Rj [ ],
    long W [ ],
    long RowCount [ ]
    , const double Tx [ ]
    , double Ax [ ]
    , double Rx [ ]
    , const double Tz [ ]
    , double Az [ ]
    , double Rz [ ]
)
{
    long i, j, k, p, cp, p1, p2, pdest, pj ;
    long split = ((Tz) != (double *) ((void *)0)) && ((Az) != (double *) ((void *)0)) && ((Rz) != (double *) ((void *)0)) ;
    for (i = 0 ; i < n_row ; i++)
    {
 W [i] = 0 ;
    }
    for (k = 0 ; k < nz ; k++)
    {
 i = Ti [k] ;
 j = Tj [k] ;
 if (i < 0 || i >= n_row || j < 0 || j >= n_col)
 {
     return ((-8)) ;
 }
 W [i]++ ;
    }
    Rp [0] = 0 ;
    for (i = 0 ; i < n_row ; i++)
    {
 Rp [i+1] = Rp [i] + W [i] ;
 W [i] = Rp [i] ;
    }
    for (k = 0 ; k < nz ; k++)
    {
 p = W [Ti [k]]++ ;
 Rj [p] = Tj [k] ;
 if (split)
 {
     Rx [p] = Tx [k] ;
     Rz [p] = Tz [k] ;
 }
 else
 {
     Rx [2*p ] = Tx [2*k ] ;
     Rx [2*p+1] = Tx [2*k+1] ;
 }
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = (-1) ;
    }
    for (i = 0 ; i < n_row ; i++)
    {
 p1 = Rp [i] ;
 p2 = Rp [i+1] ;
 pdest = p1 ;
 for (p = p1 ; p < p2 ; p++)
 {
     j = Rj [p] ;
     ;
     pj = W [j] ;
     if (pj >= p1)
     {
  ;
  ;
  if (split)
  {
      Rx [pj] += Rx [p] ;
      Rz [pj] += Rz [p] ;
  }
  else
  {
      Rx[2*pj ] += Rx[2*p ] ;
      Rx[2*pj+1] += Rx[2*p+1] ;
  }
     }
     else
     {
  W [j] = pdest ;
  if (pdest != p)
  {
      Rj [pdest] = j ;
      if (split)
      {
   Rx [pdest] = Rx [p] ;
   Rz [pdest] = Rz [p] ;
      }
      else
      {
   Rx [2*pdest ] = Rx [2*p ] ;
   Rx [2*pdest+1] = Rx [2*p+1] ;
      }
  }
  pdest++ ;
     }
 }
 RowCount [i] = pdest - p1 ;
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = 0 ;
    }
    for (i = 0 ; i < n_row ; i++)
    {
 for (p = Rp [i] ; p < Rp [i] + RowCount [i] ; p++)
 {
     j = Rj [p] ;
     ;
     W [j]++ ;
 }
    }
    Ap [0] = 0 ;
    for (j = 0 ; j < n_col ; j++)
    {
 Ap [j+1] = Ap [j] + W [j] ;
    }
    for (j = 0 ; j < n_col ; j++)
    {
 W [j] = Ap [j] ;
    }
    for (i = 0 ; i < n_row ; i++)
    {
 for (p = Rp [i] ; p < Rp [i] + RowCount [i] ; p++)
 {
     cp = W [Rj [p]]++ ;
     Ai [cp] = i ;
     if (split)
     {
  Ax [cp] = Rx [p] ;
  Az [cp] = Rz [p] ;
     }
     else
     {
  Ax [2*cp ] = Rx [2*p ] ;
  Ax [2*cp+1] = Rx [2*p+1] ;
     }
 }
    }
    return ((0)) ;
}

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

variable_types: nz long

variable_types:
Ti
long []

variable_types:
Tj
long []

variable_types:
Rp
long []

variable_types:
Rj
long []

variable_types:
W
long []

variable_types:
RowCount
long []

variable_types:
Tx
double []

variable_types:
Ax
double []

variable_types:
Rx
double []

variable_types:
Tz
double []

variable_types:
Az
double []

variable_types:
Rz
double []

variable_types: i long

variable_types: j long

variable_types: k long

variable_types: p long

variable_types: cp long

variable_types: pdest long

variable_types: pj long

variable_types: split long

return_type: long


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

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

variable_types: nchains long

variable_types: nfr long

variable_types: esize long

variable_types: units double

return_type: double


decompiled_code:
__int64 umf_i_cholmod()
{
return 0LL;
}

original_code:
int umf_i_cholmod
(
    int nrow,
    int ncol,
    int symmetric,
    int Ap [ ],
    int Ai [ ],
    int Perm [ ],
    void *user_params,
    double user_info [3]
)
{
    return ((0)) ;
}

canonical_original_code:
int umf_i_cholmod(int nrow, int ncol, int symmetric, int Ap[], int Ai[], int Perm[], void *user_params, double user_info[3])
{
    return ((0)) ;
}

variable_types: nrow int

variable_types: ncol int

variable_types: symmetric int

variable_types:
Ap
int []

variable_types:
Ai
int []

variable_types:
Perm
int []


original_code:
int umf_i_singletons
(
    int n_row,
    int n_col,
    const int Ap [ ],
    const int Ai [ ],
    const int Quser [ ],
    int strategy,
    int do_singletons,
    int Cdeg [ ],
    int Cperm [ ],
    int Rdeg [ ],
    int Rperm [ ],
    int InvRperm [ ],
    int *p_n1,
    int *p_n1c,
    int *p_n1r,
    int *p_nempty_col,
    int *p_nempty_row,
    int *p_is_sym,
    int *p_max_rdeg,
    int Rp [ ],
    int Ri [ ],
    int W [ ],
    int Next [ ]
)
{
    int n1, s, col, row, p, p1, p2, cdeg, last_row, is_sym, k,
 nempty_row, nempty_col, max_cdeg, max_rdeg, n1c, n1r ;
    if (Ap [0] != 0 || Ap [n_col] < 0)
    {
 return ((-8)) ;
    }
    for (row = 0 ; row < n_row ; row++)
    {
 Rdeg [row] = 0 ;
    }
    for (col = 0 ; col < n_col ; col++)
    {
 p1 = Ap [col] ;
 p2 = Ap [col+1] ;
 cdeg = p2 - p1 ;
 if (cdeg < 0)
 {
     return ((-8)) ;
 }
 last_row = (-1) ;
 for (p = p1 ; p < p2 ; p++)
 {
     row = Ai [p] ;
     if (row <= last_row || row >= n_row)
     {
  return ((-8)) ;
     }
     Rdeg [row]++ ;
     last_row = row ;
 }
 Cdeg [col] = cdeg ;
    }
    if (!do_singletons)
    {
        n1 = 0 ;
        n1r = 0 ;
        n1c = 0 ;
    }
    else if (Quser != (int *) ((void *)0))
    {
 if (strategy == 1)
 {
     n1 = find_user_singletons (n_row, n_col, Ap, Ai, Quser,
      Cdeg, Rdeg, Cperm, Rperm, &n1r, &n1c, Rp, Ri, W) ;
 }
 else
 {
     n1 = 0 ;
     n1r = 0 ;
     n1c = 0 ;
 }
    }
    else
    {
 n1 = find_any_singletons (n_row, n_col, Ap, Ai,
  Cdeg, Rdeg, Cperm, Rperm, &n1r, &n1c, Rp, Ri, W, Next) ;
    }
    nempty_col = finish_permutation (n1, n_col, Cdeg, Quser, Cperm, &max_cdeg) ;
    if (Quser != (int *) ((void *)0) && strategy == 3)
    {
 ;
 nempty_row = finish_permutation (n1, n_row, Rdeg, Quser, Rperm,
     &max_rdeg) ;
    }
    else
    {
 nempty_row = finish_permutation (n1, n_row, Rdeg, (int *) ((void *)0), Rperm,
     &max_rdeg) ;
    }
    for (k = 0 ; k < n_row ; k++)
    {
 ;
 InvRperm [Rperm [k]] = k ;
    }
    if (n_row == n_col && nempty_row == nempty_col)
    {
 is_sym = (1) ;
 for (s = n1 ; is_sym &&
            s < n_col - nempty_col ; s++)
 {
     if (Cperm [s] != Rperm [s])
     {
  is_sym = (0) ;
     }
 }
    }
    else
    {
 is_sym = (0) ;
    }
    ;
    ;
    ;
    *p_n1 = n1 ;
    *p_n1r = n1r ;
    *p_n1c = n1c ;
    *p_is_sym = is_sym ;
    *p_nempty_col = nempty_col ;
    *p_nempty_row = nempty_row ;
    *p_max_rdeg = max_rdeg ;
    return ((0)) ;
}

canonical_original_code:
int umf_i_singletons(int n_row, int n_col, int Ap[], int Ai[], int Quser[], int strategy, int do_singletons, int Cdeg[], int Cperm[], int Rdeg[], int Rperm[], int InvRperm[], int *p_n1, int *p_n1c, int *p_n1r, int *p_nempty_col, int *p_nempty_row, int *p_is_sym, int *p_max_rdeg, int Rp[], int Ri[], int W[], int Next[])
{
    int n1; int s; int col; int row; int p; int p1; int p2; int cdeg; int last_row; int is_sym; int k; int nempty_row; int nempty_col; int max_cdeg; int max_rdeg; int n1c; int n1r;
    if (Ap [0] != 0 || Ap [n_col] < 0)
    {
 return ((-8)) ;
    }
    for (row = 0 ; row < n_row ; row++)
    {
 Rdeg [row] = 0 ;
    }
    for (col = 0 ; col < n_col ; col++)
    {
 p1 = Ap [col] ;
 p2 = Ap [col+1] ;
 cdeg = p2 - p1 ;
 if (cdeg < 0)
 {
     return ((-8)) ;
 }
 last_row = (-1) ;
 for (p = p1 ; p < p2 ; p++)
 {
     row = Ai [p] ;
     if (row <= last_row || row >= n_row)
     {
  return ((-8)) ;
     }
     Rdeg [row]++ ;
     last_row = row ;
 }
 Cdeg [col] = cdeg ;
    }
    if (!do_singletons)
    {
        n1 = 0 ;
        n1r = 0 ;
        n1c = 0 ;
    }
    else if (Quser != (int *) ((void *)0))
    {
 if (strategy == 1)
 {
     n1 = find_user_singletons (n_row, n_col, Ap, Ai, Quser,
      Cdeg, Rdeg, Cperm, Rperm, &n1r, &n1c, Rp, Ri, W) ;
 }
 else
 {
     n1 = 0 ;
     n1r = 0 ;
     n1c = 0 ;
 }
    }
    else
    {
 n1 = find_any_singletons (n_row, n_col, Ap, Ai,
  Cdeg, Rdeg, Cperm, Rperm, &n1r, &n1c, Rp, Ri, W, Next) ;
    }
    nempty_col = finish_permutation (n1, n_col, Cdeg, Quser, Cperm, &max_cdeg) ;
    if (Quser != (int *) ((void *)0) && strategy == 3)
    {
 ;
 nempty_row = finish_permutation (n1, n_row, Rdeg, Quser, Rperm,
     &max_rdeg) ;
    }
    else
    {
 nempty_row = finish_permutation (n1, n_row, Rdeg, (int *) ((void *)0), Rperm,
     &max_rdeg) ;
    }
    for (k = 0 ; k < n_row ; k++)
    {
 ;
 InvRperm [Rperm [k]] = k ;
    }
    if (n_row == n_col && nempty_row == nempty_col)
    {
 is_sym = (1) ;
 for (s = n1 ; is_sym &&
            s < n_col - nempty_col ; s++)
 {
     if (Cperm [s] != Rperm [s])
     {
  is_sym = (0) ;
     }
 }
    }
    else
    {
 is_sym = (0) ;
    }
    ;
    ;
    ;
    *p_n1 = n1 ;
    *p_n1r = n1r ;
    *p_n1c = n1c ;
    *p_is_sym = is_sym ;
    *p_nempty_col = nempty_col ;
    *p_nempty_row = nempty_row ;
    *p_max_rdeg = max_rdeg ;
    return ((0)) ;
}

variable_types:
Quser
int []

variable_types: strategy int

variable_types:
Cdeg
int []

variable_types:
Cperm
int []

variable_types:
Rdeg
int []

variable_types:
Rperm
int []

variable_types:
InvRperm
int []

variable_types:
Rp
int []

variable_types:
Ri
int []

variable_types:
W
int []

variable_types:
Next
int []

variable_types: s int

variable_types: col int

variable_types: row int

variable_types: p int

variable_types: cdeg int

variable_types: k int


decompiled_code:
__int64 __fastcall create_row_form(int a1, int a2, __int64 a3, __int64 a4, __int64 a5, _DWORD *a6, __int64 a7, _DWORD *a8)
{
__int64 result; // rax
int v11; // edx
__int64 i; // r11
int v13; // ecx
int *v14; // rdx
unsigned __int64 v15; // r9
__int64 v16; // rax
int *v17; // rcx

result = (unsigned int)a1;
*a6 = 0;
*a8 = 0;
if ( a1 > 0 )
{
for ( result = 0LL; result != a1; a8[result++] = v11 )
{
v11 = a6[result];
a6[result + 1] = v11 + *(_DWORD *)(a5 + 4 * result);
}
}
if ( a2 > 0 )
{
for ( i = 0LL; i != a2; ++i )
{
result = *(unsigned int *)(a3 + 4 * i + 4);
v13 = *(_DWORD *)(a3 + 4 * i);
if ( (int)result > v13 )
{
v14 = (int *)(a4 + 4LL * v13);
v15 = a4 + 4 + 4 * (v13 + (unsigned __int64)(unsigned int)(result - 1 - v13));
do
{
v16 = *v14++;
v17 = &a8[v16];
result = *v17;
*v17 = result + 1;
*(_DWORD *)(a7 + 4 * result) = i;
}
while ( v14 != (int *)v15 );
}
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, int a2, __int64 a3, __int64 a4, __int64 a5, _DWORD *a6, __int64 a7, _DWORD *a8)
{
__int64 result; // rax
int v11; // edx
__int64 i; // r11
int v13; // ecx
int *v14; // rdx
unsigned __int64 v15; // r9
__int64 v16; // rax
int *v17; // rcx

result = (unsigned int)a1;
*a6 = 0;
*a8 = 0;
if ( a1 > 0 )
{
for ( result = 0LL; result != a1; a8[result++] = v11 )
{
v11 = a6[result];
a6[result + 1] = v11 + *(_DWORD *)(a5 + 4 * result);
}
}
if ( a2 > 0 )
{
for ( i = 0LL; i != a2; ++i )
{
result = *(unsigned int *)(a3 + 4 * i + 4);
v13 = *(_DWORD *)(a3 + 4 * i);
if ( (int)result > v13 )
{
v14 = (int *)(a4 + 4LL * v13);
v15 = a4 + 4 + 4 * (v13 + (unsigned __int64)(unsigned int)(result - 1 - v13));
do
{
v16 = *v14++;
v17 = &a8[v16];
result = *v17;
*v17 = result + 1;
*(_DWORD *)(a7 + 4 * result) = i;
}
while ( v14 != (int *)v15 );
}
}
}
return result;
}

original_code:
static void create_row_form
(
    int n_row,
    int n_col,
    const int Ap [ ],
    const int Ai [ ],
    int Rdeg [ ],
    int Rp [ ],
    int Ri [ ],
    int W [ ]
)
{
    int row, col, p, p2 ;
    Rp [0] = 0 ;
    W [0] = 0 ;
    for (row = 0 ; row < n_row ; row++)
    {
 Rp [row+1] = Rp [row] + Rdeg [row] ;
 W [row] = Rp [row] ;
    }
    for (col = 0 ; col < n_col ; col++)
    {
 p2 = Ap [col+1] ;
 for (p = Ap [col] ; p < p2 ; p++)
 {
     Ri [W [Ai [p]]++] = col ;
 }
    }
}

canonical_original_code:
static void create_row_form(int n_row, int n_col, int Ap[], int Ai[], int Rdeg[], int Rp[], int Ri[], int W[])
{
    int row; int col; int p; int p2;
    Rp [0] = 0 ;
    W [0] = 0 ;
    for (row = 0 ; row < n_row ; row++)
    {
 Rp [row+1] = Rp [row] + Rdeg [row] ;
 W [row] = Rp [row] ;
    }
    for (col = 0 ; col < n_col ; col++)
    {
 p2 = Ap [col+1] ;
 for (p = Ap [col] ; p < p2 ; p++)
 {
     Ri [W [Ai [p]]++] = col ;
 }
    }
}

variable_types:
Ap
int []

variable_types:
Ai
int []


original_code:
static int order_singletons
(
    int k,
    int head,
    int tail,
    int Next [ ],
    int Xdeg [ ], int Xperm [ ], const int Xp [ ], const int Xi [ ],
    int Ydeg [ ], int Yperm [ ], const int Yp [ ], const int Yi [ ]
)
{
    int xpivot, x, y, ypivot, p, p2, deg ;
    while (head != (-1))
    {
 xpivot = head ;
 ;
 head = Next [xpivot] ;
 if (head == (-1)) tail = (-1) ;
 ;
 if (Xdeg [xpivot] != 1)
 {
     ;
     continue ;
 }
 ypivot = (-1) ;
 p2 = Xp [xpivot+1] ;
 for (p = Xp [xpivot] ; p < p2 ; p++)
 {
     y = Xi [p] ;
     ;
     if (Ydeg [y] >= 0)
     {
  ypivot = y ;
  break ;
     }
 }
 ;
 ;
 ;
 ;
 ;
 ;
 p2 = Yp [ypivot+1] ;
 for (p = Yp [ypivot] ; p < p2 ; p++)
 {
     x = Yi [p] ;
     ;
     if (Xdeg [x] < 0) continue ;
     ;
     if (x == xpivot) continue ;
     deg = --(Xdeg [x]) ;
     ;
     if (deg == 1)
     {
  Next [x] = (-1) ;
  if (head == (-1))
  {
      head = x ;
  }
  else
  {
      ;
      Next [tail] = x ;
  }
  tail = x ;
  ;
     }
 }
 Xdeg [xpivot] = (-(1)-2) ;
 Ydeg [ypivot] = (-(Ydeg [ypivot])-2) ;
 Xperm [k] = xpivot ;
 Yperm [k] = ypivot ;
 k++ ;
    }
    return (k) ;
}

canonical_original_code:
static int order_singletons(int k, int head, int tail, int Next[], int Xdeg[], int Xperm[], int Xp[], int Xi[], int Ydeg[], int Yperm[], int Yp[], int Yi[])
{
    int xpivot; int x; int y; int ypivot; int p; int p2; int deg;
    while (head != (-1))
    {
 xpivot = head ;
 ;
 head = Next [xpivot] ;
 if (head == (-1)) tail = (-1) ;
 ;
 if (Xdeg [xpivot] != 1)
 {
     ;
     continue ;
 }
 ypivot = (-1) ;
 p2 = Xp [xpivot+1] ;
 for (p = Xp [xpivot] ; p < p2 ; p++)
 {
     y = Xi [p] ;
     ;
     if (Ydeg [y] >= 0)
     {
  ypivot = y ;
  break ;
     }
 }
 ;
 ;
 ;
 ;
 ;
 ;
 p2 = Yp [ypivot+1] ;
 for (p = Yp [ypivot] ; p < p2 ; p++)
 {
     x = Yi [p] ;
     ;
     if (Xdeg [x] < 0) continue ;
     ;
     if (x == xpivot) continue ;
     deg = --(Xdeg [x]) ;
     ;
     if (deg == 1)
     {
  Next [x] = (-1) ;
  if (head == (-1))
  {
      head = x ;
  }
  else
  {
      ;
      Next [tail] = x ;
  }
  tail = x ;
  ;
     }
 }
 Xdeg [xpivot] = (-(1)-2) ;
 Ydeg [ypivot] = (-(Ydeg [ypivot])-2) ;
 Xperm [k] = xpivot ;
 Yperm [k] = ypivot ;
 k++ ;
    }
    return (k) ;
}

variable_types: head int

variable_types: tail int

variable_types:
Xdeg
int []

variable_types:
Xperm
int []

variable_types:
Xp
int []

variable_types:
Xi
int []

variable_types:
Ydeg
int []

variable_types:
Yperm
int []

variable_types:
Yp
int []

variable_types:
Yi
int []

variable_types: xpivot int

variable_types: x int

variable_types: y int

variable_types: ypivot int

variable_types: deg int


original_code:
static int find_any_singletons
(
    int n_row,
    int n_col,
    const int Ap [ ],
    const int Ai [ ],
    int Cdeg [ ],
    int Rdeg [ ],
    int Cperm [ ],
    int Rperm [ ],
    int *p_n1r,
    int *p_n1c,
    int Rp [ ],
    int Ri [ ],
    int W [ ],
    int Next [ ]
)
{
    int n1, col, row, row_form, head, tail, n1r, n1c ;
    n1 = 0 ;
    n1r = 0 ;
    n1c = 0 ;
    row_form = (0) ;
    head = (-1) ;
    tail = (-1) ;
    for (col = n_col-1 ; col >= 0 ; col--)
    {
 if (Cdeg [col] == 1)
 {
     if (head == (-1)) tail = col ;
     Next [col] = head ;
     head = col ;
     ;
 }
    }
    if (head != (-1))
    {
 create_row_form (n_row, n_col, Ap, Ai, Rdeg, Rp, Ri, W) ;
 row_form = (1) ;
 n1 = order_singletons (0, head, tail, Next,
  Cdeg, Cperm, Ap, Ai,
  Rdeg, Rperm, Rp, Ri
  ) ;
 n1c = n1 ;
    }
    head = (-1) ;
    tail = (-1) ;
    for (row = n_row-1 ; row >= 0 ; row--)
    {
 if (Rdeg [row] == 1)
 {
     if (head == (-1)) tail = row ;
     Next [row] = head ;
     head = row ;
     ;
 }
    }
    if (head != (-1))
    {
 if (!row_form)
 {
     create_row_form (n_row, n_col, Ap, Ai, Rdeg, Rp, Ri, W) ;
 }
 n1 = order_singletons (n1, head, tail, Next,
  Rdeg, Rperm, Rp, Ri,
  Cdeg, Cperm, Ap, Ai
  ) ;
 n1r = n1 - n1c ;
    }
    ;
    *p_n1r = n1r ;
    *p_n1c = n1c ;
    return (n1) ;
}

canonical_original_code:
static int find_any_singletons(int n_row, int n_col, int Ap[], int Ai[], int Cdeg[], int Rdeg[], int Cperm[], int Rperm[], int *p_n1r, int *p_n1c, int Rp[], int Ri[], int W[], int Next[])
{
    int n1; int col; int row; int row_form; int head; int tail; int n1r; int n1c;
    n1 = 0 ;
    n1r = 0 ;
    n1c = 0 ;
    row_form = (0) ;
    head = (-1) ;
    tail = (-1) ;
    for (col = n_col-1 ; col >= 0 ; col--)
    {
 if (Cdeg [col] == 1)
 {
     if (head == (-1)) tail = col ;
     Next [col] = head ;
     head = col ;
     ;
 }
    }
    if (head != (-1))
    {
 create_row_form (n_row, n_col, Ap, Ai, Rdeg, Rp, Ri, W) ;
 row_form = (1) ;
 n1 = order_singletons (0, head, tail, Next,
  Cdeg, Cperm, Ap, Ai,
  Rdeg, Rperm, Rp, Ri
  ) ;
 n1c = n1 ;
    }
    head = (-1) ;
    tail = (-1) ;
    for (row = n_row-1 ; row >= 0 ; row--)
    {
 if (Rdeg [row] == 1)
 {
     if (head == (-1)) tail = row ;
     Next [row] = head ;
     head = row ;
     ;
 }
    }
    if (head != (-1))
    {
 if (!row_form)
 {
     create_row_form (n_row, n_col, Ap, Ai, Rdeg, Rp, Ri, W) ;
 }
 n1 = order_singletons (n1, head, tail, Next,
  Rdeg, Rperm, Rp, Ri,
  Cdeg, Cperm, Ap, Ai
  ) ;
 n1r = n1 - n1c ;
    }
    ;
    *p_n1r = n1r ;
    *p_n1c = n1c ;
    return (n1) ;
}

variable_types:
Ap
int []

variable_types:
Cdeg
int []

variable_types:
Rdeg
int []

variable_types:
Cperm
int []

variable_types:
Rperm
int []

variable_types:
Rp
int []

variable_types:
Ri
int []

variable_types:
W
int []

variable_types:
Next
int []

variable_types: col int

variable_types: row int


original_code:
static int find_user_singletons
(
    int n_row,
    int n_col,
    const int Ap [ ],
    const int Ai [ ],
    const int Quser [ ],
    int Cdeg [ ],
    int Rdeg [ ],
    int Cperm [ ],
    int Rperm [ ],
    int *p_n1r,
    int *p_n1c,
    int Rp [ ],
    int Ri [ ],
    int W [ ]
)
{
    int n1, col, row, p, p2, pivcol, pivrow, found, k, n1r, n1c ;
    n1 = 0 ;
    n1r = 0 ;
    n1c = 0 ;
    *p_n1r = 0 ;
    *p_n1c = 0 ;
    pivcol = Quser [0] ;
    found = (Cdeg [pivcol] == 1) ;
    ;
    if (!found)
    {
 for (p = Ap [pivcol] ; p < Ap [pivcol+1] ; p++)
 {
     if (Rdeg [Ai [p]] == 1)
     {
  ;
  found = (1) ;
  break ;
     }
 }
    }
    if (!found)
    {
 return (0) ;
    }
    create_row_form (n_row, n_col, Ap, Ai, Rdeg, Rp, Ri, W) ;
    n1 = 0 ;
    for (k = 0 ; k < n_col ; k++)
    {
 pivcol = Quser [k] ;
 pivrow = (-1) ;
 found = (Cdeg [pivcol] == 1) ;
 if (found)
 {
     ;
     p2 = Ap [pivcol+1] ;
     for (p = Ap [pivcol] ; p < p2 ; p++)
     {
  row = Ai [p] ;
  ;
  if (Rdeg [row] >= 0)
  {
      pivrow = row ;
      break ;
  }
     }
     ;
     ;
     ;
     ;
     ;
     ;
     p2 = Rp [pivrow+1] ;
     for (p = Rp [pivrow] ; p < p2 ; p++)
     {
  col = Ri [p] ;
  ;
  if (Cdeg [col] < 0) continue ;
  ;
  Cdeg [col]-- ;
  ;
     }
     Cdeg [pivcol] = (-(1)-2) ;
     Rdeg [pivrow] = (-(Rdeg [pivrow])-2) ;
     n1c++ ;
 }
 else
 {
     p2 = Ap [pivcol+1] ;
     for (p = Ap [pivcol] ; p < p2 ; p++)
     {
  pivrow = Ai [p] ;
  if (Rdeg [pivrow] == 1)
  {
      ;
      found = (1) ;
      break ;
  }
     }
     if (!found)
     {
  ;
  break ;
     }
     ;
     ;
     ;
     ;
     ;
     p2 = Ap [pivcol+1] ;
     for (p = Ap [pivcol] ; p < p2 ; p++)
     {
  row = Ai [p] ;
  ;
  if (Rdeg [row] < 0) continue ;
  ;
  Rdeg [row]-- ;
  ;
     }
     Cdeg [pivcol] = (-(Cdeg [pivcol])-2) ;
     Rdeg [pivrow] = (-(1)-2) ;
     n1r++ ;
 }
 Cperm [k] = pivcol ;
 Rperm [k] = pivrow ;
 n1++ ;
    }
    ;
    ;
    *p_n1r = n1r ;
    *p_n1c = n1c ;
    return (n1) ;
}

canonical_original_code:
static int find_user_singletons(int n_row, int n_col, int Ap[], int Ai[], int Quser[], int Cdeg[], int Rdeg[], int Cperm[], int Rperm[], int *p_n1r, int *p_n1c, int Rp[], int Ri[], int W[])
{
    int n1; int col; int row; int p; int p2; int pivcol; int pivrow; int found; int k; int n1r; int n1c;
    n1 = 0 ;
    n1r = 0 ;
    n1c = 0 ;
    *p_n1r = 0 ;
    *p_n1c = 0 ;
    pivcol = Quser [0] ;
    found = (Cdeg [pivcol] == 1) ;
    ;
    if (!found)
    {
 for (p = Ap [pivcol] ; p < Ap [pivcol+1] ; p++)
 {
     if (Rdeg [Ai [p]] == 1)
     {
  ;
  found = (1) ;
  break ;
     }
 }
    }
    if (!found)
    {
 return (0) ;
    }
    create_row_form (n_row, n_col, Ap, Ai, Rdeg, Rp, Ri, W) ;
    n1 = 0 ;
    for (k = 0 ; k < n_col ; k++)
    {
 pivcol = Quser [k] ;
 pivrow = (-1) ;
 found = (Cdeg [pivcol] == 1) ;
 if (found)
 {
     ;
     p2 = Ap [pivcol+1] ;
     for (p = Ap [pivcol] ; p < p2 ; p++)
     {
  row = Ai [p] ;
  ;
  if (Rdeg [row] >= 0)
  {
      pivrow = row ;
      break ;
  }
     }
     ;
     ;
     ;
     ;
     ;
     ;
     p2 = Rp [pivrow+1] ;
     for (p = Rp [pivrow] ; p < p2 ; p++)
     {
  col = Ri [p] ;
  ;
  if (Cdeg [col] < 0) continue ;
  ;
  Cdeg [col]-- ;
  ;
     }
     Cdeg [pivcol] = (-(1)-2) ;
     Rdeg [pivrow] = (-(Rdeg [pivrow])-2) ;
     n1c++ ;
 }
 else
 {
     p2 = Ap [pivcol+1] ;
     for (p = Ap [pivcol] ; p < p2 ; p++)
     {
  pivrow = Ai [p] ;
  if (Rdeg [pivrow] == 1)
  {
      ;
      found = (1) ;
      break ;
  }
     }
     if (!found)
     {
  ;
  break ;
     }
     ;
     ;
     ;
     ;
     ;
     p2 = Ap [pivcol+1] ;
     for (p = Ap [pivcol] ; p < p2 ; p++)
     {
  row = Ai [p] ;
  ;
  if (Rdeg [row] < 0) continue ;
  ;
  Rdeg [row]-- ;
  ;
     }
     Cdeg [pivcol] = (-(Cdeg [pivcol])-2) ;
     Rdeg [pivrow] = (-(1)-2) ;
     n1r++ ;
 }
 Cperm [k] = pivcol ;
 Rperm [k] = pivrow ;
 n1++ ;
    }
    ;
    ;
    *p_n1r = n1r ;
    *p_n1c = n1c ;
    return (n1) ;
}

variable_types:
Ai
int []

variable_types:
Quser
int []

variable_types: p int

variable_types: pivcol int

variable_types: pivrow int

variable_types: found int

variable_types: k int


original_code:
static int finish_permutation
(
    int n1,
    int nx,
    int Xdeg [ ],
    const int Xuser [ ],
    int Xperm [ ],
    int *p_max_deg
)
{
    int nempty, x, deg, s, max_deg, k ;
    nempty = 0 ;
    s = n1 ;
    max_deg = 0 ;
    ;
    for (k = 0 ; k < nx ; k++)
    {
 x = (Xuser != (int *) ((void *)0)) ? Xuser [k] : k ;
 ;
 deg = Xdeg [x] ;
 if (deg == 0)
 {
     ;
     ;
     nempty++ ;
     Xperm [nx - nempty] = x ;
 }
 else if (deg > 0)
 {
     ;
     Xperm [s++] = x ;
     max_deg = (((max_deg) > (deg)) ? (max_deg) : (deg)) ;
 }
 else
 {
     Xdeg [x] = (-(deg)-2) ;
 }
    }
    ;
    *p_max_deg = max_deg ;
    return (nempty) ;
}

canonical_original_code:
static int finish_permutation(int n1, int nx, int Xdeg[], int Xuser[], int Xperm[], int *p_max_deg)
{
    int nempty; int x; int deg; int s; int max_deg; int k;
    nempty = 0 ;
    s = n1 ;
    max_deg = 0 ;
    ;
    for (k = 0 ; k < nx ; k++)
    {
 x = (Xuser != (int *) ((void *)0)) ? Xuser [k] : k ;
 ;
 deg = Xdeg [x] ;
 if (deg == 0)
 {
     ;
     ;
     nempty++ ;
     Xperm [nx - nempty] = x ;
 }
 else if (deg > 0)
 {
     ;
     Xperm [s++] = x ;
     max_deg = (((max_deg) > (deg)) ? (max_deg) : (deg)) ;
 }
 else
 {
     Xdeg [x] = (-(deg)-2) ;
 }
    }
    ;
    *p_max_deg = max_deg ;
    return (nempty) ;
}

variable_types: nx int

variable_types:
Xdeg
int []

variable_types:
Xuser
int []

variable_types:
Xperm
int []

variable_types: nempty int

variable_types: x int

variable_types: deg int

variable_types: s int


original_code:
int
umfpack_zi_wsolve
(
    int sys,
    const int Ap [ ],
    const int Ai [ ],
    const double Ax [ ],
    const double Az [ ],
    double Xx [ ],
    double Xz [ ],
    const double Bx [ ],
    const double Bz [ ],
    void *NumericHandle,
    const double Control [20],
    double User_Info [90]
    , int Pattern [ ],
    double W [ ]
)
{
    double Info2 [90], stats [2] ;
    double *Info ;
    NumericType *Numeric ;
    int n, i, irstep, status ;
    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 (!umfzi_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 (!W || !Pattern)
    {
 Info [0] = (-5) ;
 return ((-5)) ;
    }
    status = umfzi_solve (sys, Ap, Ai, Ax, Xx, Bx,
 Az, Xz, Bz,
 Numeric, irstep, Info, Pattern, W) ;
    Info [0] = status ;
    if (status >= 0)
    {
 umfpack_toc (stats) ;
 Info [86] = stats [0] ;
 Info [85] = stats [1] ;
    }
    return (status) ;
}

canonical_original_code:
int umfpack_zi_wsolve(int sys, int Ap[], int Ai[], double Ax[], double Az[], double Xx[], double Xz[], double Bx[], double Bz[], void *NumericHandle, double Control[20], double User_Info[90], int Pattern[], double W[])
{
    double Info2[90]; double stats[2];
    double *Info;
    struct NumericType *Numeric;
    int n; int i; int irstep; int status;
    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 (!umfzi_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 (!W || !Pattern)
    {
 Info [0] = (-5) ;
 return ((-5)) ;
    }
    status = umfzi_solve (sys, Ap, Ai, Ax, Xx, Bx,
 Az, Xz, Bz,
 Numeric, irstep, Info, Pattern, W) ;
    Info [0] = status ;
    if (status >= 0)
    {
 umfpack_toc (stats) ;
 Info [86] = stats [0] ;
 Info [85] = stats [1] ;
    }
    return (status) ;
}

variable_types: sys int

variable_types:
Ap
int []

variable_types:
Ax
double []

variable_types:
Az
double []

variable_types:
Xx
double []

variable_types:
Xz
double []

variable_types:
Bx
double []

variable_types:
Bz
double []

variable_types:
NumericHandle
void *

variable_types:
Control
double [20]

variable_types:
Pattern
int []

variable_types:
W
double []

variable_types:
stats
double [2]

variable_types:
Info
double *

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

variable_types: n int

variable_types: i int

variable_types: irstep int

variable_types: status int

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 umfdl_row_search
(
    NumericType *Numeric,
    WorkType *Work,
    SymbolicType *Symbolic,
    long cdeg0,
    long cdeg1,
    const long Pattern [ ],
    const long Pos [ ],
    long pivrow [2],
    long rdeg [2],
    long W_i [ ],
    long W_o [ ],
    long prior_pivrow [2],
    const double Wxy [ ],
    long pivcol,
    long freebie [ ]
)
{
    double maxval, toler, toler2, value, pivot [2] ;
    long i, row, deg, col, *Frpos, fnrows, *E, j, ncols, *Cols, *Rows,
 e, f, Wrpflag, *Fcpos, fncols, tpi, max_rdeg, nans_in_col, was_offdiag,
 diag_row, prefer_diagonal, *Wrp, found, *Diagonal_map ;
    Tuple *tp, *tpend, *tp1, *tp2 ;
    Unit *Memory, *p ;
    Element *ep ;
    long *Row_tuples, *Row_degree, *Row_tlen ;
    pivot [0] = 0. ;
    pivot [1] = 0. ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Row_tlen = Numeric->Uilen ;
    Wrp = Work->Wrp ;
    Frpos = Work->Frpos ;
    E = Work->E ;
    Memory = Numeric->Memory ;
    fnrows = Work->fnrows ;
    prefer_diagonal = Symbolic->prefer_diagonal ;
    Diagonal_map = Work->Diagonal_map ;
    if (Diagonal_map)
    {
 diag_row = Diagonal_map [pivcol] ;
 was_offdiag = diag_row < 0 ;
 if (was_offdiag)
 {
     diag_row = (-(diag_row)-2) ;
 }
 ;
    }
    else
    {
 diag_row = (-1) ;
 was_offdiag = (-1) ;
    }
    max_rdeg = Work->fncols_max ;
    maxval = 0.0 ;
    nans_in_col = (0) ;
    for (i = 0 ; i < cdeg1 ; i++)
    {
 { (value) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
 if (((value) != (value)))
 {
     nans_in_col = (1) ;
     maxval = value ;
     break ;
 }
 maxval = (((maxval) > (value)) ? (maxval) : (value)) ;
    }
    toler = Numeric->relpt * maxval ;
    toler2 = Numeric->relpt2 * maxval ;
    toler2 = was_offdiag ? toler : toler2 ;
    ;
    if (((toler) != (toler)) || ((toler2) != (toler2)))
    {
 nans_in_col = (1) ;
    }
    if (!nans_in_col)
    {
 found = (0) ;
 ;
 if (prefer_diagonal)
 {
     ;
     i = Pos [diag_row] ;
     if (i >= 0)
     {
  double a ;
  ;
  ;
  { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
  ;
  ;
  if (((a) != 0.) && a >= toler2)
  {
      ;
      found = (1) ;
      if (Frpos [diag_row] >= 0 && Frpos [diag_row] < fnrows)
      {
   pivrow [0] = diag_row ;
   pivrow [1] = (-1) ;
      }
      else
      {
   pivrow [0] = (-1) ;
   pivrow [1] = diag_row ;
      }
  }
     }
 }
 if (!found)
 {
     if (cdeg0 > 0)
     {
  for (i = 0 ; i < cdeg0 ; i++)
  {
      double a ;
      { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   ;
   ;
   ;
   if (deg < rdeg [0]
          || (deg == rdeg [0] && a > pivot [0])
      )
   {
       pivrow [0] = row ;
       rdeg [0] = deg ;
       pivot [0] = a ;
   }
      }
  }
  for ( ; i < cdeg1 ; i++)
  {
      double a ;
      { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   ;
   ;
   if (deg < rdeg [1]
          || (deg == rdeg [1] && a > pivot [1])
      )
   {
       pivrow [1] = row ;
       rdeg [1] = deg ;
       pivot [1] = a ;
   }
      }
  }
     }
     else
     {
  for (i = 0 ; i < cdeg1 ; i++)
  {
      double a ;
      { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   if (Frpos [row] >= 0 && Frpos [row] < fnrows)
   {
       ;
       if (deg < rdeg [0]
          || (deg == rdeg [0] && a > pivot [0])
          )
       {
    pivrow [0] = row ;
    rdeg [0] = deg ;
    pivot [0] = a ;
       }
   }
   else
   {
       ;
       if (deg < rdeg [1]
          || (deg == rdeg[1] && a > pivot [1])
          )
       {
    pivrow [1] = row ;
    rdeg [1] = deg ;
    pivot [1] = a ;
       }
   }
      }
  }
     }
 }
    }
    if (cdeg1 > 0 && pivrow [0] == (-1) && pivrow [1] == (-1))
    {
 ;
 row = Pattern [0] ;
 deg = Row_degree [row] ;
 if (Frpos [row] >= 0 && Frpos [row] < fnrows)
 {
     ;
     pivrow [0] = row ;
     rdeg [0] = deg ;
 }
 else
 {
     ;
     pivrow [1] = row ;
     rdeg [1] = deg ;
 }
 for (i = 1 ; i < cdeg1 ; i++)
 {
     row = Pattern [i] ;
     deg = Row_degree [row] ;
     if (Frpos [row] >= 0 && Frpos [row] < fnrows)
     {
  ;
  if (deg < rdeg [0] || (deg == rdeg [0] && row == diag_row))
  {
      pivrow [0] = row ;
      rdeg [0] = deg ;
  }
     }
     else
     {
  ;
  if (deg < rdeg [1] || (deg == rdeg [1] && row == diag_row))
  {
      pivrow [1] = row ;
      rdeg [1] = deg ;
  }
     }
 }
    }
    ;
    ;
    if (cdeg1 == 0)
    {
 if (fnrows > 0)
 {
     pivrow [0] = Work->Frows [0] ;
     ;
 }
 else
 {
     long *Front_leftmostdesc, *Front_1strow, *Front_new1strow, row1,
  row2, fleftmost, nfr, n_row, frontid ;
     ;
     Front_leftmostdesc = Symbolic->Front_leftmostdesc ;
     Front_1strow = Symbolic->Front_1strow ;
     Front_new1strow = Work->Front_new1strow ;
     nfr = Symbolic->nfr ;
     n_row = Numeric->n_row ;
     frontid = Work->frontid ;
     ;
     fleftmost = Front_leftmostdesc [frontid] ;
     row1 = Front_new1strow [fleftmost] ;
     row2 = Front_1strow [frontid+1] - 1 ;
     ;
     for (row = row1 ; row <= row2 ; row++)
     {
  ;
  if ((Row_degree [row] >= 0))
  {
      ;
      ;
      pivrow [1] = row ;
      ;
      break ;
  }
     }
     Front_new1strow [fleftmost] = row ;
     if (pivrow [1] == (-1))
     {
  row1 = Front_new1strow [nfr] ;
  row2 = n_row-1 ;
  ;
  for (row = row1 ; row <= row2 ; row++)
  {
      ;
      if ((Row_degree [row] >= 0))
      {
   ;
   ;
   pivrow [1] = row ;
   ;
   break ;
      }
  }
  Front_new1strow [nfr] = row ;
     }
     if (pivrow [1] == (-1))
     {
  ;
  ;
  return ((1)) ;
     }
 }
    }
    if (pivrow [0] != (-1))
    {
 freebie [0] = (pivrow [0] == prior_pivrow [0]) && (cdeg1 > 0) ;
 ;
 if (!freebie [0])
 {
     Fcpos = Work->Fcpos ;
     fncols = Work->fncols ;
     Wrpflag = Work->Wrpflag ;
     rdeg [0] = fncols ;
     ;
     ;
     ;
     if (Fcpos [pivcol] < 0)
     {
  ;
  if (rdeg [0] >= max_rdeg)
  {
      return ((-11)) ;
  }
  Wrp [pivcol] = Wrpflag ;
  W_i [rdeg [0]++] = pivcol ;
     }
     tpi = Row_tuples [pivrow [0]] ;
     if (tpi)
     {
  tp = (Tuple *) (Memory + tpi) ;
  tp1 = tp ;
  tp2 = tp ;
  tpend = tp + Row_tlen [pivrow [0]] ;
  for ( ; tp < tpend ; tp++)
  {
      e = tp->e ;
      ;
      if (!E [e])
      {
   continue ;
      }
      f = tp->f ;
      p = Memory + E [e] ;
      ep = (Element *) p ;
      p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
      Cols = (long *) p ;
      ncols = ep->ncols ;
      Rows = Cols + ncols ;
      if (Rows [f] == (-1))
      {
   continue ;
      }
      ;
      for (j = 0 ; j < ncols ; j++)
      {
   col = Cols [j] ;
   ;
   if ((col >= 0) && (Wrp [col] != Wrpflag)
       && Fcpos [col] <0)
   {
       ;
       if (rdeg [0] >= max_rdeg)
       {
    ;
    return ((-11)) ;
       }
       Wrp [col] = Wrpflag ;
       W_i [rdeg [0]++] = col ;
   }
      }
      *tp2++ = *tp ;
  }
  Row_tlen [pivrow [0]] = tp2 - tp1 ;
     }
     Work->Wrpflag++ ;
 }
    }
    if (pivrow [1] != (-1))
    {
 freebie [1] = (pivrow [1] == prior_pivrow [1]) && cdeg1 > 0 ;
 ;
 if (!freebie [1])
 {
     Wrpflag = Work->Wrpflag ;
     rdeg [1] = 0 ;
     ;
     ;
     ;
     ;
     if (rdeg [1] >= max_rdeg)
     {
  return ((-11)) ;
     }
     Wrp [pivcol] = Wrpflag ;
     W_o [rdeg [1]++] = pivcol ;
     tpi = Row_tuples [pivrow [1]] ;
     if (tpi)
     {
  tp = (Tuple *) (Memory + tpi) ;
  tp1 = tp ;
  tp2 = tp ;
  tpend = tp + Row_tlen [pivrow [1]] ;
  for ( ; tp < tpend ; tp++)
  {
      e = tp->e ;
      ;
      if (!E [e])
      {
   continue ;
      }
      f = tp->f ;
      p = Memory + E [e] ;
      ep = (Element *) p ;
      p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
      Cols = (long *) p ;
      ncols = ep->ncols ;
      Rows = Cols + ncols ;
      if (Rows [f] == (-1))
      {
   continue ;
      }
      ;
      for (j = 0 ; j < ncols ; j++)
      {
   col = Cols [j] ;
   ;
   if ((col >= 0) && (Wrp [col] != Wrpflag))
   {
       ;
       if (rdeg [1] >= max_rdeg)
       {
    ;
    return ((-11)) ;
       }
       Wrp [col] = Wrpflag ;
       W_o [rdeg [1]++] = col ;
   }
      }
      *tp2++ = *tp ;
  }
  Row_tlen [pivrow [1]] = tp2 - tp1 ;
     }
     Work->Wrpflag++ ;
 }
    }
    ;
    return ((0)) ;
}

canonical_original_code:
long umfdl_row_search(struct NumericType *Numeric, struct WorkType *Work, struct SymbolicType *Symbolic, long cdeg0, long cdeg1, long Pattern[], long Pos[], long pivrow[2], long rdeg[2], long W_i[], long W_o[], long prior_pivrow[2], double Wxy[], long pivcol, long freebie[])
{
    double maxval; double toler; double toler2; double value; double pivot[2];
    long i; long row; long deg; long col; long *Frpos; long fnrows; long *E; long j; long ncols; long *Cols; long *Rows; long e; long f; long Wrpflag; long *Fcpos; long fncols; long tpi; long max_rdeg; long nans_in_col; long was_offdiag; long diag_row; long prefer_diagonal; long *Wrp; long found; long *Diagonal_map;
    struct Tuple *tp; struct Tuple *tpend; struct Tuple *tp1; struct Tuple *tp2;
    union Unit_union *Memory; union Unit_union *p;
    struct Element *ep;
    long *Row_tuples; long *Row_degree; long *Row_tlen;
    pivot [0] = 0. ;
    pivot [1] = 0. ;
    Row_degree = Numeric->Rperm ;
    Row_tuples = Numeric->Uip ;
    Row_tlen = Numeric->Uilen ;
    Wrp = Work->Wrp ;
    Frpos = Work->Frpos ;
    E = Work->E ;
    Memory = Numeric->Memory ;
    fnrows = Work->fnrows ;
    prefer_diagonal = Symbolic->prefer_diagonal ;
    Diagonal_map = Work->Diagonal_map ;
    if (Diagonal_map)
    {
 diag_row = Diagonal_map [pivcol] ;
 was_offdiag = diag_row < 0 ;
 if (was_offdiag)
 {
     diag_row = (-(diag_row)-2) ;
 }
 ;
    }
    else
    {
 diag_row = (-1) ;
 was_offdiag = (-1) ;
    }
    max_rdeg = Work->fncols_max ;
    maxval = 0.0 ;
    nans_in_col = (0) ;
    for (i = 0 ; i < cdeg1 ; i++)
    {
 { (value) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
 if (((value) != (value)))
 {
     nans_in_col = (1) ;
     maxval = value ;
     break ;
 }
 maxval = (((maxval) > (value)) ? (maxval) : (value)) ;
    }
    toler = Numeric->relpt * maxval ;
    toler2 = Numeric->relpt2 * maxval ;
    toler2 = was_offdiag ? toler : toler2 ;
    ;
    if (((toler) != (toler)) || ((toler2) != (toler2)))
    {
 nans_in_col = (1) ;
    }
    if (!nans_in_col)
    {
 found = (0) ;
 ;
 if (prefer_diagonal)
 {
     ;
     i = Pos [diag_row] ;
     if (i >= 0)
     {
  double a;
  ;
  ;
  { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
  ;
  ;
  if (((a) != 0.) && a >= toler2)
  {
      ;
      found = (1) ;
      if (Frpos [diag_row] >= 0 && Frpos [diag_row] < fnrows)
      {
   pivrow [0] = diag_row ;
   pivrow [1] = (-1) ;
      }
      else
      {
   pivrow [0] = (-1) ;
   pivrow [1] = diag_row ;
      }
  }
     }
 }
 if (!found)
 {
     if (cdeg0 > 0)
     {
  for (i = 0 ; i < cdeg0 ; i++)
  {
      double a;
      { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   ;
   ;
   ;
   if (deg < rdeg [0]
          || (deg == rdeg [0] && a > pivot [0])
      )
   {
       pivrow [0] = row ;
       rdeg [0] = deg ;
       pivot [0] = a ;
   }
      }
  }
  for ( ; i < cdeg1 ; i++)
  {
      double a;
      { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   ;
   ;
   if (deg < rdeg [1]
          || (deg == rdeg [1] && a > pivot [1])
      )
   {
       pivrow [1] = row ;
       rdeg [1] = deg ;
       pivot [1] = a ;
   }
      }
  }
     }
     else
     {
  for (i = 0 ; i < cdeg1 ; i++)
  {
      double a;
      { (a) = ((((Wxy [i]) < 0.)) ? -(Wxy [i]) : (Wxy [i])) ; } ;
      ;
      ;
      if (((a) != 0.) && a >= toler)
      {
   row = Pattern [i] ;
   deg = Row_degree [row] ;
   if (Frpos [row] >= 0 && Frpos [row] < fnrows)
   {
       ;
       if (deg < rdeg [0]
          || (deg == rdeg [0] && a > pivot [0])
          )
       {
    pivrow [0] = row ;
    rdeg [0] = deg ;
    pivot [0] = a ;
       }
   }
   else
   {
       ;
       if (deg < rdeg [1]
          || (deg == rdeg[1] && a > pivot [1])
          )
       {
    pivrow [1] = row ;
    rdeg [1] = deg ;
    pivot [1] = a ;
       }
   }
      }
  }
     }
 }
    }
    if (cdeg1 > 0 && pivrow [0] == (-1) && pivrow [1] == (-1))
    {
 ;
 row = Pattern [0] ;
 deg = Row_degree [row] ;
 if (Frpos [row] >= 0 && Frpos [row] < fnrows)
 {
     ;
     pivrow [0] = row ;
     rdeg [0] = deg ;
 }
 else
 {
     ;
     pivrow [1] = row ;
     rdeg [1] = deg ;
 }
 for (i = 1 ; i < cdeg1 ; i++)
 {
     row = Pattern [i] ;
     deg = Row_degree [row] ;
     if (Frpos [row] >= 0 && Frpos [row] < fnrows)
     {
  ;
  if (deg < rdeg [0] || (deg == rdeg [0] && row == diag_row))
  {
      pivrow [0] = row ;
      rdeg [0] = deg ;
  }
     }
     else
     {
  ;
  if (deg < rdeg [1] || (deg == rdeg [1] && row == diag_row))
  {
      pivrow [1] = row ;
      rdeg [1] = deg ;
  }
     }
 }
    }
    ;
    ;
    if (cdeg1 == 0)
    {
 if (fnrows > 0)
 {
     pivrow [0] = Work->Frows [0] ;
     ;
 }
 else
 {
     long *Front_leftmostdesc; long *Front_1strow; long *Front_new1strow; long row1; long row2; long fleftmost; long nfr; long n_row; long frontid;
     ;
     Front_leftmostdesc = Symbolic->Front_leftmostdesc ;
     Front_1strow = Symbolic->Front_1strow ;
     Front_new1strow = Work->Front_new1strow ;
     nfr = Symbolic->nfr ;
     n_row = Numeric->n_row ;
     frontid = Work->frontid ;
     ;
     fleftmost = Front_leftmostdesc [frontid] ;
     row1 = Front_new1strow [fleftmost] ;
     row2 = Front_1strow [frontid+1] - 1 ;
     ;
     for (row = row1 ; row <= row2 ; row++)
     {
  ;
  if ((Row_degree [row] >= 0))
  {
      ;
      ;
      pivrow [1] = row ;
      ;
      break ;
  }
     }
     Front_new1strow [fleftmost] = row ;
     if (pivrow [1] == (-1))
     {
  row1 = Front_new1strow [nfr] ;
  row2 = n_row-1 ;
  ;
  for (row = row1 ; row <= row2 ; row++)
  {
      ;
      if ((Row_degree [row] >= 0))
      {
   ;
   ;
   pivrow [1] = row ;
   ;
   break ;
      }
  }
  Front_new1strow [nfr] = row ;
     }
     if (pivrow [1] == (-1))
     {
  ;
  ;
  return ((1)) ;
     }
 }
    }
    if (pivrow [0] != (-1))
    {
 freebie [0] = (pivrow [0] == prior_pivrow [0]) && (cdeg1 > 0) ;
 ;
 if (!freebie [0])
 {
     Fcpos = Work->Fcpos ;
     fncols = Work->fncols ;
     Wrpflag = Work->Wrpflag ;
     rdeg [0] = fncols ;
     ;
     ;
     ;
     if (Fcpos [pivcol] < 0)
     {
  ;
  if (rdeg [0] >= max_rdeg)
  {
      return ((-11)) ;
  }
  Wrp [pivcol] = Wrpflag ;
  W_i [rdeg [0]++] = pivcol ;
     }
     tpi = Row_tuples [pivrow [0]] ;
     if (tpi)
     {
  tp = (struct Tuple *) (Memory + tpi) ;
  tp1 = tp ;
  tp2 = tp ;
  tpend = tp + Row_tlen [pivrow [0]] ;
  for ( ; tp < tpend ; tp++)
  {
      e = tp->e ;
      ;
      if (!E [e])
      {
   continue ;
      }
      f = tp->f ;
      p = Memory + E [e] ;
      ep = (struct Element *) p ;
      p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
      Cols = (long *) p ;
      ncols = ep->ncols ;
      Rows = Cols + ncols ;
      if (Rows [f] == (-1))
      {
   continue ;
      }
      ;
      for (j = 0 ; j < ncols ; j++)
      {
   col = Cols [j] ;
   ;
   if ((col >= 0) && (Wrp [col] != Wrpflag)
       && Fcpos [col] <0)
   {
       ;
       if (rdeg [0] >= max_rdeg)
       {
    ;
    return ((-11)) ;
       }
       Wrp [col] = Wrpflag ;
       W_i [rdeg [0]++] = col ;
   }
      }
      *tp2++ = *tp ;
  }
  Row_tlen [pivrow [0]] = tp2 - tp1 ;
     }
     Work->Wrpflag++ ;
 }
    }
    if (pivrow [1] != (-1))
    {
 freebie [1] = (pivrow [1] == prior_pivrow [1]) && cdeg1 > 0 ;
 ;
 if (!freebie [1])
 {
     Wrpflag = Work->Wrpflag ;
     rdeg [1] = 0 ;
     ;
     ;
     ;
     ;
     if (rdeg [1] >= max_rdeg)
     {
  return ((-11)) ;
     }
     Wrp [pivcol] = Wrpflag ;
     W_o [rdeg [1]++] = pivcol ;
     tpi = Row_tuples [pivrow [1]] ;
     if (tpi)
     {
  tp = (struct Tuple *) (Memory + tpi) ;
  tp1 = tp ;
  tp2 = tp ;
  tpend = tp + Row_tlen [pivrow [1]] ;
  for ( ; tp < tpend ; tp++)
  {
      e = tp->e ;
      ;
      if (!E [e])
      {
   continue ;
      }
      f = tp->f ;
      p = Memory + E [e] ;
      ep = (struct Element *) p ;
      p += (((((sizeof (Element) * (1))) + (sizeof (Unit)) - 1) / (sizeof (Unit)))) ;
      Cols = (long *) p ;
      ncols = ep->ncols ;
      Rows = Cols + ncols ;
      if (Rows [f] == (-1))
      {
   continue ;
      }
      ;
      for (j = 0 ; j < ncols ; j++)
      {
   col = Cols [j] ;
   ;
   if ((col >= 0) && (Wrp [col] != Wrpflag))
   {
       ;
       if (rdeg [1] >= max_rdeg)
       {
    ;
    return ((-11)) ;
       }
       Wrp [col] = Wrpflag ;
       W_o [rdeg [1]++] = col ;
   }
      }
      *tp2++ = *tp ;
  }
  Row_tlen [pivrow [1]] = tp2 - tp1 ;
     }
     Work->Wrpflag++ ;
 }
    }
    ;
    return ((0)) ;
}

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

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

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

variable_types:
Pattern
long []

variable_types:
Pos
long []

variable_types:
pivrow
long [2]

variable_types:
rdeg
long [2]

variable_types:
Wxy
double []

variable_types: pivcol long

variable_types:
freebie
long []

variable_types: maxval double

variable_types: toler double

variable_types: value double

variable_types:
pivot
double [2]

variable_types: i long

variable_types: row long

variable_types: deg long

variable_types: col long

variable_types:
Frpos
long *

variable_types: fnrows long

variable_types:
E
long *

variable_types: j long

variable_types: ncols long

variable_types:
Cols
long *

variable_types:
Rows
long *

variable_types: e long

variable_types: f long

variable_types: Wrpflag long

variable_types:
Fcpos
long *

variable_types: fncols long

variable_types: tpi long

variable_types:
Wrp
long *

variable_types: found long

variable_types:
tp
struct Tuple { long e; } *

variable_types:
tpend
struct Tuple { long e; } *

variable_types:
ep
struct Element { long cdeg; } *

variable_types: a double

variable_types: fleftmost long

variable_types: nfr long

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


decompiled_code:
__int64 __fastcall umfpack_dl_symbolic(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, __int64 a7, __int64 a8)
{
return umfpack_dl_qsymbolic(a1, a2, a3, a4, a5, 0LL, a6, a7, a8);
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, __int64 a7, __int64 a8)
{
return umfpack_dl_qsymbolic(a1, a2, a3, a4, a5, 0LL, a6, a7, a8);
}

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

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

variable_types:
Ap
long []

variable_types:
Ai
long []

variable_types:
Ax
double []

variable_types:
SymbolicHandle
void **

variable_types:
Control
double [20]

variable_types:
Info
double [90]


decompiled_code:
__int64 __fastcall umf_l_report_perm(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5)
{
__int64 i; // rax
__int64 v7; // r13
__int64 v8; // rbp
__int64 v9; // rbx
__int64 *v10; // rax
__int64 v11; // rdx
__int64 (*v12)(const char *, ...); // rdx
__int64 v13; // r12
bool v16; // [rsp+Fh] [rbp-39h]

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

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

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

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

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

variable_types: n long

variable_types:
P
long []

variable_types:
W
long []

variable_types: prl long

variable_types: user long

variable_types: i long

variable_types: k long

variable_types: valid long


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

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

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

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

variable_types: j long

variable_types: row long

variable_types: col long

variable_types:
Frows
long *

variable_types:
Fcols
long *

variable_types:
Fcpos
long *

variable_types:
Frpos
long *

variable_types: fncols long

variable_types: fnrows long

variable_types:
Wrow
long *

variable_types: rrdeg long

variable_types: ccdeg long

variable_types:
Wm
long *

variable_types:
Fcblock
double *

variable_types:
Fl
double *

variable_types:
Wy
double *

variable_types:
Wx
double *


decompiled_code:
void *__fastcall zero_init_front(__int64 a1, __int64 a2, char *a3, __int64 a4)
{
__int64 v5; // r12
__int64 i; // rbp
void *v8; // rdi
void *result; // rax

if ( a1 > 0 )
{
v5 = 8 * a4;
for ( i = 0LL; i != a1; ++i )
{
v8 = a3;
a3 += v5;
if ( a2 > 0 )
result = memset(v8, 0, 8 * a2);
}
}
return result;
}

canonical_decompiled_code:
void *__fastcall func0(__int64 a1, __int64 a2, char *a3, __int64 a4)
{
__int64 v5; // r12
__int64 i; // rbp
void *v8; // rdi
void *result; // rax

if ( a1 > 0 )
{
v5 = 8 * a4;
for ( i = 0LL; i != a1; ++i )
{
v8 = a3;
a3 += v5;
if ( a2 > 0 )
result = memset(v8, 0, 8 * a2);
}
}
return result;
}

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

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

variable_types: m long

variable_types: n long

variable_types: d long

variable_types: i long

variable_types: j long

variable_types:
F
double *

variable_types:
Fj
double *


original_code:
int umfpack_zi_get_lunz
(
    int *lnz,
    int *unz,
    int *n_row,
    int *n_col,
    int *nz_udiag,
    void *NumericHandle
)
{
    NumericType *Numeric ;
    Numeric = (NumericType *) NumericHandle ;
    if (!umfzi_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_zi_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 (!umfzi_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:
NumericHandle
void *

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


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

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

variable_types: struct NumericType { double flops; 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: row long

variable_types: col long

variable_types:
Frows
long *

variable_types:
Fcols
long *

variable_types:
Fcpos
long *

variable_types:
Frpos
long *

variable_types: fncols long

variable_types: fnrows long

variable_types:
Wrow
long *

variable_types: rrdeg long

variable_types: ccdeg long

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


original_code:
static void zero_init_front (long m, long n, DoubleComplex *Fcblock, long d)
{
    long i, j ;
    DoubleComplex *F, *Fj = Fcblock ;
    for (j = 0 ; j < m ; j++)
    {
 F = Fj ;
 Fj += d ;
 for (i = 0 ; i < n ; i++)
 {
     { (*F).component [0] = 0. ; (*F).component [1] = 0. ; } ;
     F++ ;
 }
    }
}

canonical_original_code:
static void zero_init_front(long m, long n, struct DoubleComplex *Fcblock, long d)
{
    long i; long j;
    struct DoubleComplex *F; struct DoubleComplex *Fj = Fcblock;
    for (j = 0 ; j < m ; j++)
    {
 F = Fj ;
 Fj += d ;
 for (i = 0 ; i < n ; i++)
 {
     { (*F).component [0] = 0. ; (*F).component [1] = 0. ; } ;
     F++ ;
 }
    }
}

variable_types: m long

variable_types: n long

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

variable_types: d long

variable_types: i long

variable_types: j long


decompiled_code:
__int64 __fastcall umf_i_realloc(__int64 a1, int a2, unsigned __int64 a3)
{
unsigned __int64 v4; // rdx
__int64 result; // rax

if ( a2 <= 0 )
a2 = 1;
v4 = 0x7FFFFFFF % a3;
if ( 0x7FFFFFFF / a3 < a2 )
result = 0LL;
else
result = amd_realloc(a1, a3 * a2, v4);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, int a2, unsigned __int64 a3)
{
unsigned __int64 v4; // rdx
__int64 result; // rax

if ( a2 <= 0 )
a2 = 1;
v4 = 0x7FFFFFFF % a3;
if ( 0x7FFFFFFF / a3 < a2 )
result = 0LL;
else
result = amd_realloc(a1, a3 * a2, v4);
return result;
}

original_code:
void *umf_i_realloc
(
    void *p,
    int n_objects,
    size_t size_of_object
)
{
    size_t size ;
    void *p2 ;
    n_objects = (((1) > (n_objects)) ? (1) : (n_objects)) ;
    size = (size_t) n_objects ;
    ;
    if (size > 0x7fffffff / size_of_object)
    {
 return ((void *) ((void *)0)) ;
    }
    size *= size_of_object ;
    ;
    p2 = amd_realloc (p, size) ;
    ;
    return (p2) ;
}

canonical_original_code:
void *umf_i_realloc(void *p, int n_objects, unsigned long size_of_object)
{
    unsigned long size;
    void *p2;
    n_objects = (((1) > (n_objects)) ? (1) : (n_objects)) ;
    size = (unsigned long) n_objects ;
    ;
    if (size > 0x7fffffff / size_of_object)
    {
 return ((void *) ((void *)0)) ;
    }
    size *= size_of_object ;
    ;
    p2 = amd_realloc (p, size) ;
    ;
    return (p2) ;
}

variable_types:
p
void *

variable_types:
size
unsigned long

return_type: void *