decompiled_code:
__int64 __fastcall get_cut_skin(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, double a7, double a8, double a9, int a10)
{
__int64 result; // rax
double v12; // xmm0_8
double v13; // xmm0_8

result = (unsigned int)a10;
if ( a10 > 0 )
{
result = 1LL;
do
{
*(double *)(a1 + 8 * result) = *(double *)(a3 + 8 * result) + a7 + a8;
v12 = *(double *)(a6 + 8 * result) + a7 + a8;
*(double *)(a4 + 8 * result) = v12;
*(double *)(a4 + 8 * result) = fmin(v12, *(double *)(a1 + 8 * result));
*(double *)(a2 + 8 * result) = *(double *)(a3 + 8 * result) + a7 + a8 + a9;
v13 = *(double *)(a6 + 8 * result) + a7 + a8 + a9;
*(double *)(a5 + 8 * result) = v13;
*(double *)(a5 + 8 * result) = fmin(v13, *(double *)(a1 + 8 * result));
*(double *)(a1 + 8 * result) = *(double *)(a1 + 8 * result) * *(double *)(a1 + 8 * result);
*(double *)(a4 + 8 * result) = *(double *)(a4 + 8 * result) * *(double *)(a4 + 8 * result);
*(double *)(a2 + 8 * result) = *(double *)(a2 + 8 * result) * *(double *)(a2 + 8 * result);
*(double *)(a5 + 8 * result) = *(double *)(a5 + 8 * result) * *(double *)(a5 + 8 * result);
++result;
}
while ( a10 + 1 != result );
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, double a7, double a8, double a9, int a10)
{
__int64 result; // rax
double v12; // xmm0_8
double v13; // xmm0_8

result = (unsigned int)a10;
if ( a10 > 0 )
{
result = 1LL;
do
{
*(double *)(a1 + 8 * result) = *(double *)(a3 + 8 * result) + a7 + a8;
v12 = *(double *)(a6 + 8 * result) + a7 + a8;
*(double *)(a4 + 8 * result) = v12;
*(double *)(a4 + 8 * result) = fmin(v12, *(double *)(a1 + 8 * result));
*(double *)(a2 + 8 * result) = *(double *)(a3 + 8 * result) + a7 + a8 + a9;
v13 = *(double *)(a6 + 8 * result) + a7 + a8 + a9;
*(double *)(a5 + 8 * result) = v13;
*(double *)(a5 + 8 * result) = fmin(v13, *(double *)(a1 + 8 * result));
*(double *)(a1 + 8 * result) = *(double *)(a1 + 8 * result) * *(double *)(a1 + 8 * result);
*(double *)(a4 + 8 * result) = *(double *)(a4 + 8 * result) * *(double *)(a4 + 8 * result);
*(double *)(a2 + 8 * result) = *(double *)(a2 + 8 * result) * *(double *)(a2 + 8 * result);
*(double *)(a5 + 8 * result) = *(double *)(a5 + 8 * result) * *(double *)(a5 + 8 * result);
++result;
}
while ( a10 + 1 != result );
}
return result;
}

original_code:
void get_cut_skin(double *cutskin,double *cutskin_root,double *cutoff,
                  double *cutskin_res,double *cutskin_root_res,
                  double *cutoff_res,double skin,double spread,
                  double brnch_root_skin,int ninter)
  {
  int i;
  for(i=1;i<=ninter;i++){
      cutskin[i] = cutoff[i] + skin + spread;
      cutskin_res[i] = cutoff_res[i] + skin + spread;
      cutskin_res[i] = (cutskin_res[i] < cutskin[i] ?
                             cutskin_res[i]:cutskin[i]);
      cutskin_root[i] = cutoff[i] + skin + spread + brnch_root_skin;
      cutskin_root_res[i] = cutoff_res[i] + skin + spread + brnch_root_skin;
      cutskin_root_res[i] = (cutskin_root_res[i] < cutskin[i] ?
                             cutskin_root_res[i]:cutskin[i]);
      cutskin[i] = cutskin[i]*cutskin[i];
      cutskin_res[i] = cutskin_res[i]*cutskin_res[i];
      cutskin_root[i] = cutskin_root[i]*cutskin_root[i];
      cutskin_root_res[i] = cutskin_root_res[i]*cutskin_root_res[i];
    }
}

canonical_original_code:
void get_cut_skin(double *cutskin, double *cutskin_root, double *cutoff, double *cutskin_res, double *cutskin_root_res, double *cutoff_res, double skin, double spread, double brnch_root_skin, int ninter)
  {
  int i;
  for(i=1;i<=ninter;i++){
      cutskin[i] = cutoff[i] + skin + spread;
      cutskin_res[i] = cutoff_res[i] + skin + spread;
      cutskin_res[i] = (cutskin_res[i] < cutskin[i] ?
                             cutskin_res[i]:cutskin[i]);
      cutskin_root[i] = cutoff[i] + skin + spread + brnch_root_skin;
      cutskin_root_res[i] = cutoff_res[i] + skin + spread + brnch_root_skin;
      cutskin_root_res[i] = (cutskin_root_res[i] < cutskin[i] ?
                             cutskin_root_res[i]:cutskin[i]);
      cutskin[i] = cutskin[i]*cutskin[i];
      cutskin_res[i] = cutskin_res[i]*cutskin_res[i];
      cutskin_root[i] = cutskin_root[i]*cutskin_root[i];
      cutskin_root_res[i] = cutskin_root_res[i]*cutskin_root_res[i];
    }
}

variable_types:
cutskin
double *

variable_types:
cutoff
double *

variable_types: ninter int

variable_types: i int


repo: TuckermanGroup/PINY

original_code:
void find_max_brnch_root_dist(CLATOMS_POS *clatoms_pos,
                              int nbrnch_tot,int *brnch_atm_list,
                              int *brnch_atm_root,double *brnch_root_dist_max,
                              int pi_beads)
{
  int i,ip;
  double dist_max;
  double *x,*y,*z;
  double x_1,x_2,y_1,y_2,z_1,z_2,r2;
  dist_max = 0.0;
  for(ip=1;ip<=pi_beads;ip++){
   x = clatoms_pos[ip].x;
   y = clatoms_pos[ip].y;
   z = clatoms_pos[ip].z;
   for(i=1;i<=nbrnch_tot;i++){
    x_1 = x[brnch_atm_list[i]];
    y_1 = y[brnch_atm_list[i]];
    z_1 = z[brnch_atm_list[i]];
    x_2 = x[brnch_atm_root[i]];
    y_2 = y[brnch_atm_root[i]];
    z_2 = z[brnch_atm_root[i]];
    r2 = (x_2 - x_1)*(x_2 - x_1) + (y_2 - y_1)*(y_2 - y_1) +
          (z_2 - z_1)*(z_2 - z_1);
    dist_max = (((dist_max)>(r2))?(dist_max):(r2));
   }
  }
  dist_max = sqrt(dist_max);
  *brnch_root_dist_max = dist_max;
}

canonical_original_code:
void find_max_brnch_root_dist(struct clatoms_pos *clatoms_pos, int nbrnch_tot, int *brnch_atm_list, int *brnch_atm_root, double *brnch_root_dist_max, int pi_beads)
{
  int i; int ip;
  double dist_max;
  double *x; double *y; double *z;
  double x_1; double x_2; double y_1; double y_2; double z_1; double z_2; double r2;
  dist_max = 0.0;
  for(ip=1;ip<=pi_beads;ip++){
   x = clatoms_pos[ip].x;
   y = clatoms_pos[ip].y;
   z = clatoms_pos[ip].z;
   for(i=1;i<=nbrnch_tot;i++){
    x_1 = x[brnch_atm_list[i]];
    y_1 = y[brnch_atm_list[i]];
    z_1 = z[brnch_atm_list[i]];
    x_2 = x[brnch_atm_root[i]];
    y_2 = y[brnch_atm_root[i]];
    z_2 = z[brnch_atm_root[i]];
    r2 = (x_2 - x_1)*(x_2 - x_1) + (y_2 - y_1)*(y_2 - y_1) +
          (z_2 - z_1)*(z_2 - z_1);
    dist_max = (((dist_max)>(r2))?(dist_max):(r2));
   }
  }
  dist_max = sqrt(dist_max);
  *brnch_root_dist_max = dist_max;
}

variable_types: struct clatoms_pos { double *mass; double *x; double *vx; double *fx; double *fxt; double *fxm; double *hess_xx; } *

variable_types: ip int

variable_types:
x
double *

variable_types:
y
double *

variable_types:
z
double *

return_type: void


original_code:
void check_root_safety(CLATOMS_POS *clatoms_pos,NBR_LIST *nbr_list,
                       INTERACT *interact,int pi_beads)
{
 double brnch_root_dist_max,brnch_root_dist_max_now;
 double brnch_root_skin_br,brnch_root_skin_bb;
 double safety_br,safety_bb;
 double brnch_root_skin=interact->brnch_root_skin;
 double cutdif_min_brnch_brnch=nbr_list->brnch_root.cutdif_min_brnch_brnch;
 double cutdif_min_brnch_root=nbr_list->brnch_root.cutdif_min_brnch_root;
     brnch_root_dist_max = nbr_list->brnch_root.brnch_root_dist_max;
     find_max_brnch_root_dist(clatoms_pos,
                              nbr_list->brnch_root.nbrnch_tot,
                              nbr_list->brnch_root.brnch_atm_list,
                              nbr_list->brnch_root.brnch_atm_root,
                              &brnch_root_dist_max_now,
                              pi_beads);
     brnch_root_dist_max = (((brnch_root_dist_max)>(brnch_root_dist_max_now))?(brnch_root_dist_max):(brnch_root_dist_max_now));
     nbr_list->brnch_root.brnch_root_dist_max = brnch_root_dist_max;
     safety_br = cutdif_min_brnch_root - brnch_root_dist_max+brnch_root_skin;
     safety_bb = cutdif_min_brnch_brnch-2*brnch_root_dist_max+brnch_root_skin;
     if(safety_br<0.0 || safety_bb<0.0){
       brnch_root_skin += (-(((safety_br)<(safety_bb))?(safety_br):(safety_bb)) + 0.1);
       interact->brnch_root_skin = brnch_root_skin;
       get_cut_skin(interact->cutskin,
             interact->cutskin_root,
             interact->cutoff,
             interact->cutskin_res,
             interact->cutskin_root_res,
             interact->cutoff_res,
             interact->skin,
             interact->spread_now,
             interact->brnch_root_skin,
             interact->nter_typ);
       printf("$$$$$$$$$$$$$$$$$$$$_warning_$$$$$$$$$$$$$$$$$$$$\n");
       printf("Your branch root safety is less than zero, %gA or %gA < 0\n",
               safety_br*(.529177),safety_bb*(.529177));
       printf("Increasing the branch root skin to %g A\n",brnch_root_skin*(.529177));
       printf("$$$$$$$$$$$$$$$$$$$$_warning_$$$$$$$$$$$$$$$$$$$$\n");
     }
}

canonical_original_code:
void check_root_safety(struct clatoms_pos *clatoms_pos, struct nbr_list *nbr_list, struct interact *interact, int pi_beads)
{
 double brnch_root_dist_max; double brnch_root_dist_max_now;
 double brnch_root_skin_br; double brnch_root_skin_bb;
 double safety_br; double safety_bb;
 double brnch_root_skin = interact->brnch_root_skin;
 double cutdif_min_brnch_brnch = nbr_list->brnch_root.cutdif_min_brnch_brnch;
 double cutdif_min_brnch_root = nbr_list->brnch_root.cutdif_min_brnch_root;
     brnch_root_dist_max = nbr_list->brnch_root.brnch_root_dist_max;
     find_max_brnch_root_dist(clatoms_pos,
                              nbr_list->brnch_root.nbrnch_tot,
                              nbr_list->brnch_root.brnch_atm_list,
                              nbr_list->brnch_root.brnch_atm_root,
                              &brnch_root_dist_max_now,
                              pi_beads);
     brnch_root_dist_max = (((brnch_root_dist_max)>(brnch_root_dist_max_now))?(brnch_root_dist_max):(brnch_root_dist_max_now));
     nbr_list->brnch_root.brnch_root_dist_max = brnch_root_dist_max;
     safety_br = cutdif_min_brnch_root - brnch_root_dist_max+brnch_root_skin;
     safety_bb = cutdif_min_brnch_brnch-2*brnch_root_dist_max+brnch_root_skin;
     if(safety_br<0.0 || safety_bb<0.0){
       brnch_root_skin += (-(((safety_br)<(safety_bb))?(safety_br):(safety_bb)) + 0.1);
       interact->brnch_root_skin = brnch_root_skin;
       get_cut_skin(interact->cutskin,
             interact->cutskin_root,
             interact->cutoff,
             interact->cutskin_res,
             interact->cutskin_root_res,
             interact->cutoff_res,
             interact->skin,
             interact->spread_now,
             interact->brnch_root_skin,
             interact->nter_typ);
       printf("$$$$$$$$$$$$$$$$$$$$_warning_$$$$$$$$$$$$$$$$$$$$\n");
       printf("Your branch root safety is less than zero, %gA or %gA < 0\n",
               safety_br*(.529177),safety_bb*(.529177));
       printf("Increasing the branch root skin to %g A\n",brnch_root_skin*(.529177));
       printf("$$$$$$$$$$$$$$$$$$$$_warning_$$$$$$$$$$$$$$$$$$$$\n");
     }
}

variable_types: struct nbr_list { int iver; int ilnk; int nolst; int brnch_root_list_opt; double *x0; struct verlist { int iver_init; int iver_fill; int nolst_ver_update; int jver_pad; int nmem_min_lst; int nver_lst; int nver_lst_res; int nver_lst_now; int nver_lst_now_res; int *nter; int *jter; int *jver_off; int *nter_res; int *jter_res; int *jver_off_res; double mem_safe; } verlist; struct lnklist { int ilnk_init; int lnk_for_odd; int ncell_div_avg; int lnk_excl_safe; int lnk_vol_safe; int ncell_a; int natm_cell_max; int lnk_list_dim; int nshft_lnk; int nshft_lnk_res; double vol_lnk_map; double rcut_max; int *lnk_list; int *ishft_a; int *iexl_chk; int *ishft_a_res; int *iexl_chk_res; int *natm_cell; double *shft_wght; double *shft_wght_res; double *hmat_lnk; } lnklist; struct brnch_root { int nbrnch_tot; int nroot_tot; int natm_add_tot; int nbrnch_root_max; double brnch_root_dist_max; double cutdif_min_brnch_root; double cutdif_min_brnch_brnch; double cutdif_min_brnch_root_res; double cutdif_min_brnch_brnch_res; double r2_nocheck_dist; double r2_nocheck_dist_res; double cutskin_bb_min; double cutskin_bb_min_res; int *brnch_atm_list; int *brnch_atm_root; int *root_atm_list; int *root_atm_map; int *brnch_atm_map; int *nbrnch_of_root_big; int *nbrnch_of_root; int **ibrnch_of_root; int *natm_add; int *iatm_add; int *iatm_add_off; } brnch_root; } *

variable_types: struct interact { int nsplin; int iswit_vdw; int dielectric_opt; int ishave_opt; int nter_typ; int nsplin_tot; int ninter_mall; int nsplin_mall_tot; int *inter_map_index; double dielectric_rheal; double dielectric_cut; double dielectric_eps; double brnch_root_skin; double skin; double brnch_root_cut; double rheal_res; double pten_inter_guess; double pten_kin_guess; double clong; double clong_res; double spread_now; double spread_lnk; double brnch_root_skin_lnk; double cutoff_max; double *cutoff; double *cutoff_res; double *cutti; double *cutskin; double *cutskin_res; double *cutskin_root; double *cutskin_root_res; double *vcut_coul; double *rmin_spl; double *dr_spl; double *cv0; double *cdv0; double *cv0_c; double *cdv0_c; } *

user_defined_types: struct clatoms_pos { double *mass; double *x; double *vx; double *fx; double *fxt; double *fxm; double *hess_xx; }

user_defined_types: struct nbr_list { int iver; int ilnk; int nolst; int brnch_root_list_opt; double *x0; struct verlist verlist; struct lnklist lnklist; struct brnch_root brnch_root; }


original_code:
void nbr_list_control(CLATOMS_INFO *clatoms_info,CLATOMS_POS *clatoms_pos,
                      FOR_SCR *for_scr,ATOMMAPS *atommaps,
                      CELL *cell,INTERACT *interact,
                      TIMEINFO *timeinfo, NBR_LIST *nbr_list,EXCL *excl,
                      INTRA_SCR *intra_scr,STAT_AVG *stat_avg,COMMUNICATE
                      *communicate,int error_check_on,
                      CLASS_COMM_FORC_PKG *class_comm_forc_pkg)
{
  int MPI_INT = 1;
  int MPI_DOUBLE = 1;
  int MPI_CHAR = 1;
  int MPI_MAX = 1;
  int MPI_SUM = 1;
  int MPI_ANY_TAG = 1;
  int MPI_ANY_SOURCE = 1;
  int *MPI_BOTTOM = {0};
 double brnch_root_dist_max,brnch_root_dist_max_now;
 double brnch_root_skin_br,brnch_root_skin_bb,brnch_root_skin;
 double safety_br,safety_bb;
 int iflag,iflag_tmp;
 int ninter,i;
 int numprocs = communicate->np_beads;
 int brnch_root_list_opt = nbr_list->brnch_root_list_opt;
 int pi_beads=clatoms_info->pi_beads;
  ("neighbor list control");
  ninter = (atommaps->natm_typ*(atommaps->natm_typ+1))/2;
  if(brnch_root_list_opt>0){
    check_root_safety(clatoms_pos,nbr_list,interact,pi_beads);
  }
  if(clatoms_info->pi_beads>1){
   get_pimd_spread(clatoms_info,clatoms_pos,&(interact->spread_now),
                   communicate);
   get_cut_skin(interact->cutskin,
         interact->cutskin_root,
         interact->cutoff,
         interact->cutskin_res,
         interact->cutskin_root_res,
         interact->cutoff_res,
         interact->skin,
         interact->spread_now,
         interact->brnch_root_skin,
         interact->nter_typ);
  }
  if((nbr_list->ilnk)==1){
    make_lnk_lst(clatoms_info,&clatoms_pos[1],
                 nbr_list,cell,for_scr,intra_scr,timeinfo,excl,interact,
                 error_check_on);
           }
  if((nbr_list->iver)==1){
      check_ver_list(clatoms_info,&clatoms_pos[1],
                     nbr_list,interact,&iflag);
      if(numprocs > 1){
        iflag_tmp = iflag;
        Allreduce(&iflag_tmp,&iflag,1,MPI_INT,MPI_MAX,0,
                                           communicate->comm_beads);
      }
      if(iflag == 1){
        (stat_avg->updates) += 1.0;
        (stat_avg->itime_update) = timeinfo->itime;
         verlist_control(clatoms_info,&clatoms_pos[1],
                         nbr_list,excl,atommaps,cell,
                         intra_scr,for_scr,timeinfo,interact,error_check_on,
                         class_comm_forc_pkg);
               }
           }
  ("neighbor list control");
}

canonical_original_code:
void nbr_list_control(struct clatoms_info *clatoms_info, struct clatoms_pos *clatoms_pos, struct for_scr *for_scr, struct atommaps *atommaps, struct cell *cell, struct interact *interact, struct timeinfo *timeinfo, struct nbr_list *nbr_list, struct excl *excl, struct intra_scr *intra_scr, struct stat_avg *stat_avg, struct communicate *communicate, int error_check_on, struct class_comm_forc_pkg *class_comm_forc_pkg)
{
  int MPI_INT = 1;
  int MPI_DOUBLE = 1;
  int MPI_CHAR = 1;
  int MPI_MAX = 1;
  int MPI_SUM = 1;
  int MPI_ANY_TAG = 1;
  int MPI_ANY_SOURCE = 1;
  int *MPI_BOTTOM = {0};
 double brnch_root_dist_max; double brnch_root_dist_max_now;
 double brnch_root_skin_br; double brnch_root_skin_bb; double brnch_root_skin;
 double safety_br; double safety_bb;
 int iflag; int iflag_tmp;
 int ninter; int i;
 int numprocs = communicate->np_beads;
 int brnch_root_list_opt = nbr_list->brnch_root_list_opt;
 int pi_beads = clatoms_info->pi_beads;
  ("neighbor list control");
  ninter = (atommaps->natm_typ*(atommaps->natm_typ+1))/2;
  if(brnch_root_list_opt>0){
    check_root_safety(clatoms_pos,nbr_list,interact,pi_beads);
  }
  if(clatoms_info->pi_beads>1){
   get_pimd_spread(clatoms_info,clatoms_pos,&(interact->spread_now),
                   communicate);
   get_cut_skin(interact->cutskin,
         interact->cutskin_root,
         interact->cutoff,
         interact->cutskin_res,
         interact->cutskin_root_res,
         interact->cutoff_res,
         interact->skin,
         interact->spread_now,
         interact->brnch_root_skin,
         interact->nter_typ);
  }
  if((nbr_list->ilnk)==1){
    make_lnk_lst(clatoms_info,&clatoms_pos[1],
                 nbr_list,cell,for_scr,intra_scr,timeinfo,excl,interact,
                 error_check_on);
           }
  if((nbr_list->iver)==1){
      check_ver_list(clatoms_info,&clatoms_pos[1],
                     nbr_list,interact,&iflag);
      if(numprocs > 1){
        iflag_tmp = iflag;
        Allreduce(&iflag_tmp,&iflag,1,MPI_INT,MPI_MAX,0,
                                           communicate->comm_beads);
      }
      if(iflag == 1){
        (stat_avg->updates) += 1.0;
        (stat_avg->itime_update) = timeinfo->itime;
         verlist_control(clatoms_info,&clatoms_pos[1],
                         nbr_list,excl,atommaps,cell,
                         intra_scr,for_scr,timeinfo,interact,error_check_on,
                         class_comm_forc_pkg);
               }
           }
  ("neighbor list control");
}

variable_types: struct clatoms_info { int natm_tot; int pi_beads; int pi_beads_proc; int pi_beads_proc_st; int pi_beads_proc_end; int nfree; int nfree_pimd; int nchrg; int pi_beads_full_ter; int pi_beads_res_ter; int pi_beads_full_tra; int pi_beads_res_tra; int cg_reset_flag; int natm_mall; int nchrg_mall; int hess_calc; int natm_proc; int N_H2; int i_H2_start; int nab_initio; int myatm_start; double gamma_adb; double wght_pimd; double pi_temperature; double pi_beads_full_ter_wght; double pi_beads_res_ter_wght; double pi_beads_full_tra_wght; double pi_beads_res_tra_wght; double rcut_spread; double mass_sc_fact; int *ip_lab; int *ichrg; int *cp_vlnc_up; int *cp_atm_flag; double *mass; double *q; double *alp_pol; double *b_neut; double *roll_sc; double *text_atm; double *text_mol; double *xold; double *prekf; double *xmod; double alp_ewd; } *

variable_types: struct for_scr { int nlen; int nsplin_t; int num_brk; int intact; double wght_lnk; double wght_ter; double wght_ter_res; double wght_tra; double wght_tra_res; double wght_pimd; int *j_indext; int *i_indext2; int *j_lnk; int *j_index; int *num_brk_i; int *iexcl; int *index_atm; } *

variable_types: struct atommaps { int nmol_typ; int nres_typ; int natm_typ; int nfreeze; int nfreeze_mall; int natm_typ_mall; int nres_typ_max; int nres_max; int nres_tot; int nres_sum; int pimd_freez_typ; char (*atm_typ)[50]; char (*res_typ)[50]; char (*mol_typ)[50]; int *nmol_jmol_typ; int *nres_1mol_jmol_typ; int *jatm_jmol_typ_strt; int *jres_jmol_typ_strt; int *ires_typ_jres_jmol_typ; int *jatm_jres_1mol_jmol_typ_strt; int *natm_1mol_jmol_typ; int *natm_jres_jmol_typ; int *nfree_1mol_jmol_typ; int *nfree_jres_jmol_typ; int *icons_jmol_typ; int *icons_jres_jmol_typ; int *natm_jmol_typ; int *iatm_mol_typ; int *iatm_res_typ; int *iatm_atm_typ; int *iatm_atm_typ_nl; int *iatm_atm_typ_nl_rev; int *imap_atm_typ_nl; int *imap_atm_typ_nl_gh; int *iatm_mol_num; int *iatm_proc_num; int *iatm_res_num; int *ighost_flag; int *freeze_flag; int *freeze_map; int *atom_label; int *cp_atm_lst; } *

variable_types: struct cell { int iperd; int intra_perds; int cubic_box_flag; int hmat_int_typ; int hmat_cons_typ; int imov_cp_box; double vol; double vol_cp; double vol0; double area; double alpha_conv_dual; double *hmat; double *hmat_ewd; double *hmat_cp; double *cp_box_center; double *cp_box_center_rel; double *cp_vbox_center; double *cp_fbox_center; } *

variable_types: struct timeinfo { int ntime; int ix_respa; int int_res_ter; int nres_ter; int int_res_tor; int int_res_pimd; int iget_pe_real_inter_freq; int exit_flag; double dt; } *

variable_types: struct excl { int nlst; int nlst_root; int num_cp; int *num; int *j; int *j_off; int *j1_cp; } *

variable_types: struct intra_scr { int nlen; double wght_ter; double wght_ter_res; double wght_tra; double wght_tra_res; double int_res_inter; int *iatm_typ; int *jatm_typ; double *vpot; double *p11; double *p21; double *p31; double *x1; double *x2; double *x3; double *x4; double *x5; double *x6; double *x7; double *x8; double *fx1; double *fx2; double *fx3; double *fx4; double *dx12; double *dx13; double *dx23; double *dx42; double *dx43; double *dx56; double *dx57; double *dx67; double *dx86; double *dx87; double *c_0; double *dc_0; double *ds_0; double *s_0; double *eq; double *m1; double *vx1; double *vx2; double *sc_1; double *sc; double *q1; double *rmin; double *dri; double *vcut_coul; double *del_r; double *swit; double *cutoff_res; } *

variable_types: struct stat_avg { int nexclt; int iter_shake; int iswit_vdw; int itime_update; int iter_shake_cp; int write_cp_atm_flag; double vintert; double vintrat; double vsurft; double vbondt; double vbend_bndt; double vbend_bnd_bond; double vbondt_watts; double vreal; double vvdw; double vlong; double vbond_free; double vbar_free; double kinet; double kinet_v; double vol; double kinet_nhc; double kinet_nhc_bead; double aikinet_nhc_bead; double akinet_nhc_bead; double vpot_v; double vpotnhc; double aiter_shake; double iter_23; double aiter_23; double aiter_21; double iter_23r; double aiter_23r; double aiter_21r; double acella; double aicella; double acellab; double aicellab; double apress; double press_inter; double apress_inter; double apress_intra; double press_kin; double apress_kin; double econv0; double cp_kconv0; double cpu1; double updates; double kinet_cp_up; double kinet_cp_dn; double kinet_cp; double kinet_nhc_cp; double vpotnhc_cp; double cp_ehart; double cp_eext; double cp_exc; double cp_muxc; double cp_eke; double cp_enl; double aiter_shake_cp; double maxfc; double pi_ke_prim; double api_ke_prim; double aipi_ke_prim; double kin_harm; double *apten; double fc_mag_up; double fc_max_up; double fatm_max; double count_diag_srot; double econv_now; double isokconv; } *

variable_types: struct communicate { int np_beads; int myid; int myid_bead_forc; int myid_bead; int myid_bead_prime; int myid_state; int myid_forc; int myid_forc_source; int myid_forc_target; int world; int comm_beads; int comm_beads_forc; int comm_states; int comm_forc; int comm_forc_source; int comm_forc_target; int comm_faux; } *

variable_types: struct class_comm_forc_pkg { int num_proc; int myid; int myatm_start; int mytherm_start; int *displs_atm; int *displs_therm; int comm; int world; double dbl_num_proc; struct class_plimpton_ind { int num_proc_source; int num_proc_target; int myid_source; int myid_target; int natoms_tot; int *index_src; int *index_src_even; int *index_src_odd; int *index_trg; int *index_trg_even; int *index_trg_odd; int *displs_atm_trg; int *displs_atm_src; int *src_odd_end; int *src_even_end; int *trg_odd_end; int *trg_even_end; int *src_odd_begin; int *src_even_begin; int *trg_odd_begin; int *trg_even_begin; int my_src_odd_counts; int my_src_even_counts; int my_trg_odd_counts; int my_trg_even_counts; int *my_src_odd; int *my_src_even; int *my_trg_odd; int *my_trg_even; int **jmax; int *jmin; int **imax; int source; int target; } plimpton_ind; } *

variable_types: iflag int

variable_types: numprocs int

user_defined_types: struct interact { int nsplin; int iswit_vdw; int dielectric_opt; int ishave_opt; int nter_typ; int nsplin_tot; int ninter_mall; int nsplin_mall_tot; int *inter_map_index; double dielectric_rheal; double dielectric_cut; double dielectric_eps; double brnch_root_skin; double skin; double brnch_root_cut; double rheal_res; double pten_inter_guess; double pten_kin_guess; double clong; double clong_res; double spread_now; double spread_lnk; double brnch_root_skin_lnk; double cutoff_max; double *cutoff; double *cutoff_res; double *cutti; double *cutskin; double *cutskin_res; double *cutskin_root; double *cutskin_root_res; double *vcut_coul; double *rmin_spl; double *dr_spl; double *cv0; double *cdv0; double *cv0_c; double *cdv0_c; }

user_defined_types: struct class_comm_forc_pkg { int num_proc; int myid; int myatm_start; int mytherm_start; int *displs_atm; int *displs_therm; int comm; int world; double dbl_num_proc; struct class_plimpton_ind plimpton_ind; }

user_defined_types: struct verlist { int iver_init; int iver_fill; int nolst_ver_update; int jver_pad; int nmem_min_lst; int nver_lst; int nver_lst_res; int nver_lst_now; int nver_lst_now_res; int *nter; int *jter; int *jver_off; int *nter_res; int *jter_res; int *jver_off_res; double mem_safe; }

user_defined_types: struct lnklist { int ilnk_init; int lnk_for_odd; int ncell_div_avg; int lnk_excl_safe; int lnk_vol_safe; int ncell_a; int natm_cell_max; int lnk_list_dim; int nshft_lnk; int nshft_lnk_res; double vol_lnk_map; double rcut_max; int *lnk_list; int *ishft_a; int *iexl_chk; int *ishft_a_res; int *iexl_chk_res; int *natm_cell; double *shft_wght; double *shft_wght_res; double *hmat_lnk; }

user_defined_types: struct brnch_root { int nbrnch_tot; int nroot_tot; int natm_add_tot; int nbrnch_root_max; double brnch_root_dist_max; double cutdif_min_brnch_root; double cutdif_min_brnch_brnch; double cutdif_min_brnch_root_res; double cutdif_min_brnch_brnch_res; double r2_nocheck_dist; double r2_nocheck_dist_res; double cutskin_bb_min; double cutskin_bb_min_res; int *brnch_atm_list; int *brnch_atm_root; int *root_atm_list; int *root_atm_map; int *brnch_atm_map; int *nbrnch_of_root_big; int *nbrnch_of_root; int **ibrnch_of_root; int *natm_add; int *iatm_add; int *iatm_add_off; }


decompiled_code:
__int64 __fastcall comm_clatoms_list(__int64 a1, unsigned int a2)
{
int v2; // er13
unsigned int v3; // er14
unsigned int v4; // er12

v2 = *(_DWORD *)(a1 + 56);
v3 = *(_DWORD *)(a1 + 4);
v4 = *(_DWORD *)(a1 + 52);
Barrier(a2);
if ( v2 > 0 )
Bcast(*(_QWORD *)(a1 + 168) + 4LL, (unsigned int)v2, 1LL, 0LL, a2);
Bcast(*(_QWORD *)(a1 + 160) + 4LL, v3, 1LL, 0LL, a2);
Barrier(a2);
Bcast(*(_QWORD *)(a1 + 176) + 4LL, v4, 1LL, 0LL, a2);
Barrier(a2);
Bcast(*(_QWORD *)(a1 + 184) + 4LL, v4, 1LL, 0LL, a2);
Barrier(a2);
Bcast(*(_QWORD *)(a1 + 192) + 4LL, v4, 1LL, 0LL, a2);
return Barrier(a2);
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, unsigned int a2)
{
int v2; // er13
unsigned int v3; // er14
unsigned int v4; // er12

v2 = *(_DWORD *)(a1 + 56);
v3 = *(_DWORD *)(a1 + 4);
v4 = *(_DWORD *)(a1 + 52);
Barrier(a2);
if ( v2 > 0 )
Bcast(*(_QWORD *)(a1 + 168) + 4LL, (unsigned int)v2, 1LL, 0LL, a2);
Bcast(*(_QWORD *)(a1 + 160) + 4LL, v3, 1LL, 0LL, a2);
Barrier(a2);
Bcast(*(_QWORD *)(a1 + 176) + 4LL, v4, 1LL, 0LL, a2);
Barrier(a2);
Bcast(*(_QWORD *)(a1 + 184) + 4LL, v4, 1LL, 0LL, a2);
Barrier(a2);
Bcast(*(_QWORD *)(a1 + 192) + 4LL, v4, 1LL, 0LL, a2);
return Barrier(a2);
}

original_code:
void comm_clatoms_list(CLATOMS_INFO *clatoms_info,int world)
{
  int MPI_INT = 1;
  int MPI_DOUBLE = 1;
  int MPI_CHAR = 1;
  int MPI_MAX = 1;
  int MPI_SUM = 1;
  int MPI_ANY_TAG = 1;
  int MPI_ANY_SOURCE = 1;
  int *MPI_BOTTOM = {0};
  int pi_beads = clatoms_info->pi_beads;
  int nchrg_mall = clatoms_info->nchrg_mall;
  int natm_mall = clatoms_info->natm_mall;
  int iii,i;
  Barrier(world);
  if(nchrg_mall>0){
    Bcast(&(clatoms_info->ichrg[1]),nchrg_mall,MPI_INT,0,world);
  }
  Bcast(&(clatoms_info->ip_lab[1]), pi_beads,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(clatoms_info->cp_vlnc_up[1]), natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(clatoms_info->cp_vlnc_dn[1]), natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(clatoms_info->cp_atm_flag[1]), natm_mall,MPI_INT,0,world);
  Barrier(world);
}

canonical_original_code:
void comm_clatoms_list(struct clatoms_info *clatoms_info, int world)
{
  int MPI_INT = 1;
  int MPI_DOUBLE = 1;
  int MPI_CHAR = 1;
  int MPI_MAX = 1;
  int MPI_SUM = 1;
  int MPI_ANY_TAG = 1;
  int MPI_ANY_SOURCE = 1;
  int *MPI_BOTTOM = {0};
  int pi_beads = clatoms_info->pi_beads;
  int nchrg_mall = clatoms_info->nchrg_mall;
  int natm_mall = clatoms_info->natm_mall;
  int iii; int i;
  Barrier(world);
  if(nchrg_mall>0){
    Bcast(&(clatoms_info->ichrg[1]),nchrg_mall,MPI_INT,0,world);
  }
  Bcast(&(clatoms_info->ip_lab[1]), pi_beads,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(clatoms_info->cp_vlnc_up[1]), natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(clatoms_info->cp_vlnc_dn[1]), natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(clatoms_info->cp_atm_flag[1]), natm_mall,MPI_INT,0,world);
  Barrier(world);
}

variable_types: world int

variable_types: iii int

variable_types: i int

user_defined_types: struct clatoms_info { int natm_tot; int pi_beads; int pi_beads_proc; int pi_beads_proc_st; int pi_beads_proc_end; int nfree; int nfree_pimd; int nchrg; int pi_beads_full_ter; int pi_beads_res_ter; int pi_beads_full_tra; int pi_beads_res_tra; int cg_reset_flag; int natm_mall; int nchrg_mall; int hess_calc; int natm_proc; int N_H2; int i_H2_start; int nab_initio; int myatm_start; double gamma_adb; double wght_pimd; double pi_temperature; double pi_beads_full_ter_wght; double pi_beads_res_ter_wght; double pi_beads_full_tra_wght; double pi_beads_res_tra_wght; double rcut_spread; double mass_sc_fact; int *ip_lab; int *ichrg; int *cp_vlnc_up; int *cp_atm_flag; double *mass; double *q; double *alp_pol; double *b_neut; double *roll_sc; double *text_atm; double *text_mol; double *xold; double *prekf; double *xmod; double alp_ewd; }


decompiled_code:
__int64 __fastcall comm_ghost_atoms_list(__int64 a1, unsigned int a2)
{
int v2; // er12
int v3; // er13
__int64 result; // rax

v2 = *(_DWORD *)(a1 + 8);
if ( v2 > 0 )
{
v3 = *(_DWORD *)(a1 + 16);
Bcast(*(_QWORD *)(a1 + 24) + 4LL, (unsigned int)v2, 1LL, 0LL, a2);
Barrier(a2);
Bcast(*(_QWORD *)(a1 + 32) + 4LL, (unsigned int)v2, 1LL, 0LL, a2);
result = Barrier(a2);
if ( v3 > 0 )
{
Bcast(*(_QWORD *)(*(_QWORD *)(a1 + 40) + 8LL) + 4LL, (unsigned int)(v3 * v2), 1LL, 0LL, a2);
result = Barrier(a2);
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, unsigned int a2)
{
int v2; // er12
int v3; // er13
__int64 result; // rax

v2 = *(_DWORD *)(a1 + 8);
if ( v2 > 0 )
{
v3 = *(_DWORD *)(a1 + 16);
Bcast(*(_QWORD *)(a1 + 24) + 4LL, (unsigned int)v2, 1LL, 0LL, a2);
Barrier(a2);
Bcast(*(_QWORD *)(a1 + 32) + 4LL, (unsigned int)v2, 1LL, 0LL, a2);
result = Barrier(a2);
if ( v3 > 0 )
{
Bcast(*(_QWORD *)(*(_QWORD *)(a1 + 40) + 8LL) + 4LL, (unsigned int)(v3 * v2), 1LL, 0LL, a2);
result = Barrier(a2);
}
}
return result;
}

original_code:
void comm_ghost_atoms_list(GHOST_ATOMS *ghost_atoms,int world)
{
  int MPI_INT = 1;
  int MPI_DOUBLE = 1;
  int MPI_CHAR = 1;
  int MPI_MAX = 1;
  int MPI_SUM = 1;
  int MPI_ANY_TAG = 1;
  int MPI_ANY_SOURCE = 1;
  int *MPI_BOTTOM = {0};
  int nghost_mall = ghost_atoms->nghost_mall;
  int ncomp_mall = ghost_atoms->ncomp_mall;
  if(nghost_mall>0){
    Bcast(&(ghost_atoms->ighost_map[1]),nghost_mall,MPI_INT,0,world);
    Barrier(world);
    Bcast(&(ghost_atoms->natm_comp[1]),nghost_mall,MPI_INT,0,world);
    Barrier(world);
    if(ncomp_mall>0){
      Bcast(&(ghost_atoms->iatm_comp[1][1]),(ncomp_mall*nghost_mall),
                                            MPI_INT,0,world);
      Barrier(world);
    }
  }
}

canonical_original_code:
void comm_ghost_atoms_list(struct ghost_atoms *ghost_atoms, int world)
{
  int MPI_INT = 1;
  int MPI_DOUBLE = 1;
  int MPI_CHAR = 1;
  int MPI_MAX = 1;
  int MPI_SUM = 1;
  int MPI_ANY_TAG = 1;
  int MPI_ANY_SOURCE = 1;
  int *MPI_BOTTOM = {0};
  int nghost_mall = ghost_atoms->nghost_mall;
  int ncomp_mall = ghost_atoms->ncomp_mall;
  if(nghost_mall>0){
    Bcast(&(ghost_atoms->ighost_map[1]),nghost_mall,MPI_INT,0,world);
    Barrier(world);
    Bcast(&(ghost_atoms->natm_comp[1]),nghost_mall,MPI_INT,0,world);
    Barrier(world);
    if(ncomp_mall>0){
      Bcast(&(ghost_atoms->iatm_comp[1][1]),(ncomp_mall*nghost_mall),
                                            MPI_INT,0,world);
      Barrier(world);
    }
  }
}

variable_types: struct ghost_atoms { int nghost_tot; int natm_comp_max; int nghost_mall; int nghost_old; int ncomp_mall; int ncomp_old; int *ighost_map; int *natm_comp; int **iatm_comp; double **coef; } *


decompiled_code:
__int64 __fastcall comm_atommaps_list(unsigned int *a1, unsigned int a2, unsigned int a3)
{
unsigned int v4; // er13
unsigned int v5; // er14
int v6; // er15

v4 = *a1;
v5 = a1[8];
v6 = a1[4];
Bcast(*((_QWORD *)a1 + 9) + 4LL, *a1, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 10) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 11) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 12) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
if ( (int)v5 > 0 )
{
Bcast(*((_QWORD *)a1 + 13) + 4LL, v5, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 14) + 4LL, v5, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 15) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 16) + 4LL, v5, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 17) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 18) + 4LL, v5, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 19) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 20) + 4LL, v5, 1LL, 0LL, a3);
}
else
{
Bcast(*((_QWORD *)a1 + 15) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 17) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 19) + 4LL, v4, 1LL, 0LL, a3);
}
Barrier(a3);
Bcast(*((_QWORD *)a1 + 22) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 23) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 24) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 29) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 31) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 32) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 33) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
if ( v6 > 0 )
{
Bcast(*((_QWORD *)a1 + 34) + 4LL, (unsigned int)v6, 1LL, 0LL, a3);
Barrier(a3);
}
Bcast(*((_QWORD *)a1 + 35) + 4LL, a2, 1LL, 0LL, a3);
return Barrier(a3);
}

canonical_decompiled_code:
__int64 __fastcall func2(unsigned int *a1, unsigned int a2, unsigned int a3)
{
unsigned int v4; // er13
unsigned int v5; // er14
int v6; // er15

v4 = *a1;
v5 = a1[8];
v6 = a1[4];
Bcast(*((_QWORD *)a1 + 9) + 4LL, *a1, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 10) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 11) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 12) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
if ( (int)v5 > 0 )
{
Bcast(*((_QWORD *)a1 + 13) + 4LL, v5, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 14) + 4LL, v5, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 15) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 16) + 4LL, v5, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 17) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 18) + 4LL, v5, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 19) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 20) + 4LL, v5, 1LL, 0LL, a3);
}
else
{
Bcast(*((_QWORD *)a1 + 15) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 17) + 4LL, v4, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 19) + 4LL, v4, 1LL, 0LL, a3);
}
Barrier(a3);
Bcast(*((_QWORD *)a1 + 22) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 23) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 24) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 29) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 31) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 32) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
Bcast(*((_QWORD *)a1 + 33) + 4LL, a2, 1LL, 0LL, a3);
Barrier(a3);
if ( v6 > 0 )
{
Bcast(*((_QWORD *)a1 + 34) + 4LL, (unsigned int)v6, 1LL, 0LL, a3);
Barrier(a3);
}
Bcast(*((_QWORD *)a1 + 35) + 4LL, a2, 1LL, 0LL, a3);
return Barrier(a3);
}

original_code:
void comm_atommaps_list(ATOMMAPS *atommaps,int natm_mall,int world)
{
  int MPI_INT = 1;
  int MPI_DOUBLE = 1;
  int MPI_CHAR = 1;
  int MPI_MAX = 1;
  int MPI_SUM = 1;
  int MPI_ANY_TAG = 1;
  int MPI_ANY_SOURCE = 1;
  int *MPI_BOTTOM = {0};
  int nres_typ_max = atommaps->nres_typ_max;
  int natm_typ_mall = atommaps->natm_typ_mall;
  int nfreeze_mall = atommaps->nfreeze_mall;
  int nres_tot = atommaps->nres_tot;
  int nmol_typ = atommaps->nmol_typ;
  int nres_sum = atommaps->nres_sum;
  int iii,i;
  Bcast(&(atommaps->nmol_jmol_typ[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->nres_1mol_jmol_typ[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->jatm_jmol_typ_strt[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->jres_jmol_typ_strt[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  if(nres_tot>0){
    Bcast(&(atommaps->ires_typ_jres_jmol_typ[1]),nres_tot,MPI_INT,0,world);
    Barrier(world);
    Bcast(&(atommaps->jatm_jres_1mol_jmol_typ_strt[1]),nres_tot,MPI_INT,0,world);
    Barrier(world);
  }
  Bcast(&(atommaps->natm_1mol_jmol_typ[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  if(nres_tot>0){
    Bcast(&(atommaps->natm_jres_jmol_typ[1]),nres_tot,MPI_INT,0,world);
    Barrier(world);
  }
  Bcast(&(atommaps->nfree_1mol_jmol_typ[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  if(nres_tot>0){
    Bcast(&(atommaps->nfree_jres_jmol_typ[1]),nres_tot,MPI_INT,0,world);
    Barrier(world);
  }
  Bcast(&(atommaps->icons_jmol_typ[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  if(nres_tot>0){
    Bcast(&(atommaps->icons_jres_jmol_typ[1]),nres_tot,MPI_INT,0,world);
    Barrier(world);
  }
  Bcast(&(atommaps->iatm_mol_typ[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->iatm_res_typ[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->iatm_atm_typ[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->iatm_mol_num[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->iatm_res_num[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->ighost_flag[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->freeze_flag[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  if(nfreeze_mall>0){
    Bcast(&(atommaps->freeze_map[1]),nfreeze_mall,MPI_INT,0,world);
    Barrier(world);
  }
  Bcast(&(atommaps->atom_label[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
}

canonical_original_code:
void comm_atommaps_list(struct atommaps *atommaps, int natm_mall, int world)
{
  int MPI_INT = 1;
  int MPI_DOUBLE = 1;
  int MPI_CHAR = 1;
  int MPI_MAX = 1;
  int MPI_SUM = 1;
  int MPI_ANY_TAG = 1;
  int MPI_ANY_SOURCE = 1;
  int *MPI_BOTTOM = {0};
  int nres_typ_max = atommaps->nres_typ_max;
  int natm_typ_mall = atommaps->natm_typ_mall;
  int nfreeze_mall = atommaps->nfreeze_mall;
  int nres_tot = atommaps->nres_tot;
  int nmol_typ = atommaps->nmol_typ;
  int nres_sum = atommaps->nres_sum;
  int iii; int i;
  Bcast(&(atommaps->nmol_jmol_typ[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->nres_1mol_jmol_typ[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->jatm_jmol_typ_strt[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->jres_jmol_typ_strt[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  if(nres_tot>0){
    Bcast(&(atommaps->ires_typ_jres_jmol_typ[1]),nres_tot,MPI_INT,0,world);
    Barrier(world);
    Bcast(&(atommaps->jatm_jres_1mol_jmol_typ_strt[1]),nres_tot,MPI_INT,0,world);
    Barrier(world);
  }
  Bcast(&(atommaps->natm_1mol_jmol_typ[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  if(nres_tot>0){
    Bcast(&(atommaps->natm_jres_jmol_typ[1]),nres_tot,MPI_INT,0,world);
    Barrier(world);
  }
  Bcast(&(atommaps->nfree_1mol_jmol_typ[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  if(nres_tot>0){
    Bcast(&(atommaps->nfree_jres_jmol_typ[1]),nres_tot,MPI_INT,0,world);
    Barrier(world);
  }
  Bcast(&(atommaps->icons_jmol_typ[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
  if(nres_tot>0){
    Bcast(&(atommaps->icons_jres_jmol_typ[1]),nres_tot,MPI_INT,0,world);
    Barrier(world);
  }
  Bcast(&(atommaps->iatm_mol_typ[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->iatm_res_typ[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->iatm_atm_typ[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->iatm_mol_num[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->iatm_res_num[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->ighost_flag[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  Bcast(&(atommaps->freeze_flag[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
  if(nfreeze_mall>0){
    Bcast(&(atommaps->freeze_map[1]),nfreeze_mall,MPI_INT,0,world);
    Barrier(world);
  }
  Bcast(&(atommaps->atom_label[1]),natm_mall,MPI_INT,0,world);
  Barrier(world);
}

user_defined_types: struct atommaps { int nmol_typ; int nres_typ; int natm_typ; int nfreeze; int nfreeze_mall; int natm_typ_mall; int nres_typ_max; int nres_max; int nres_tot; int nres_sum; int pimd_freez_typ; char (*atm_typ)[50]; char (*res_typ)[50]; char (*mol_typ)[50]; int *nmol_jmol_typ; int *nres_1mol_jmol_typ; int *jatm_jmol_typ_strt; int *jres_jmol_typ_strt; int *ires_typ_jres_jmol_typ; int *jatm_jres_1mol_jmol_typ_strt; int *natm_1mol_jmol_typ; int *natm_jres_jmol_typ; int *nfree_1mol_jmol_typ; int *nfree_jres_jmol_typ; int *icons_jmol_typ; int *icons_jres_jmol_typ; int *natm_jmol_typ; int *iatm_mol_typ; int *iatm_res_typ; int *iatm_atm_typ; int *iatm_atm_typ_nl; int *iatm_atm_typ_nl_rev; int *imap_atm_typ_nl; int *imap_atm_typ_nl_gh; int *iatm_mol_num; int *iatm_proc_num; int *iatm_res_num; int *ighost_flag; int *freeze_flag; int *freeze_map; int *atom_label; int *cp_atm_lst; }


decompiled_code:
__int64 __fastcall comm_class_parse_list(_QWORD *a1, unsigned int a2, unsigned int a3)
{
Barrier(a3);
Bcast(a1[8] + 4LL, a2, 1LL, 0LL, a3);
Bcast(a1[9] + 4LL, a2, 1LL, 0LL, a3);
Bcast(a1[10] + 4LL, a2, 1LL, 0LL, a3);
Bcast(a1[11] + 4LL, a2, 1LL, 0LL, a3);
Bcast(a1[12] + 4LL, a2, 1LL, 0LL, a3);
Bcast(a1[13] + 4LL, a2, 1LL, 0LL, a3);
return Barrier(a3);
}

canonical_decompiled_code:
__int64 __fastcall func3(_QWORD *a1, unsigned int a2, unsigned int a3)
{
Barrier(a3);
Bcast(a1[8] + 4LL, a2, 1LL, 0LL, a3);
Bcast(a1[9] + 4LL, a2, 1LL, 0LL, a3);
Bcast(a1[10] + 4LL, a2, 1LL, 0LL, a3);
Bcast(a1[11] + 4LL, a2, 1LL, 0LL, a3);
Bcast(a1[12] + 4LL, a2, 1LL, 0LL, a3);
Bcast(a1[13] + 4LL, a2, 1LL, 0LL, a3);
return Barrier(a3);
}

original_code:
void comm_class_parse_list(CLASS_PARSE *class_parse,int nmol_typ,int world)
{
  int MPI_INT = 1;
  int MPI_DOUBLE = 1;
  int MPI_CHAR = 1;
  int MPI_MAX = 1;
  int MPI_SUM = 1;
  int MPI_ANY_TAG = 1;
  int MPI_ANY_SOURCE = 1;
  int *MPI_BOTTOM = {0};
  Barrier(world);
  Bcast(&(class_parse->imol_nhc_opt[1]),nmol_typ,MPI_INT,0,world);
  Bcast(&(class_parse->ionfo_opt[1]),nmol_typ,MPI_INT,0,world);
  Bcast(&(class_parse->ires_bond_conv[1]),nmol_typ,MPI_INT,0,world);
  Bcast(&(class_parse->mol_freeze_opt[1]),nmol_typ,MPI_INT,0,world);
  Bcast(&(class_parse->mol_hydrog_mass_opt[1]),nmol_typ,MPI_INT,0,world);
  Bcast(&(class_parse->mol_hydrog_con_opt[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
}

canonical_original_code:
void comm_class_parse_list(struct class_parse *class_parse, int nmol_typ, int world)
{
  int MPI_INT = 1;
  int MPI_DOUBLE = 1;
  int MPI_CHAR = 1;
  int MPI_MAX = 1;
  int MPI_SUM = 1;
  int MPI_ANY_TAG = 1;
  int MPI_ANY_SOURCE = 1;
  int *MPI_BOTTOM = {0};
  Barrier(world);
  Bcast(&(class_parse->imol_nhc_opt[1]),nmol_typ,MPI_INT,0,world);
  Bcast(&(class_parse->ionfo_opt[1]),nmol_typ,MPI_INT,0,world);
  Bcast(&(class_parse->ires_bond_conv[1]),nmol_typ,MPI_INT,0,world);
  Bcast(&(class_parse->mol_freeze_opt[1]),nmol_typ,MPI_INT,0,world);
  Bcast(&(class_parse->mol_hydrog_mass_opt[1]),nmol_typ,MPI_INT,0,world);
  Bcast(&(class_parse->mol_hydrog_con_opt[1]),nmol_typ,MPI_INT,0,world);
  Barrier(world);
}

variable_types: struct class_parse { int ivx_smpl; int ivx_scale; int kmax_ewd; int istart; int ishift_pot; int initial_spread_opt; int zero_com_vel; double tau_vol; double tau_nhc_def; int *imol_nhc_opt; int *ionfo_opt; int *ires_bond_conv; int *mol_freeze_opt; int *mol_hydrog_mass_opt; int *mol_hydrog_con_opt; double *tau_nhc_mol; double *text_nhc_mol; double *mol_hydrog_mass_val; } *


decompiled_code:
__int64 __fastcall communicate_class_list(_DWORD *a1, __int64 a2, _QWORD *a3)
{
unsigned int v4; // ebp
unsigned int v5; // er14
unsigned int v6; // er13

v4 = a1[822];
v5 = a1[13];
v6 = a1[144];
comm_clatoms_list((__int64)a1, v4);
Barrier(v4);
comm_ghost_atoms_list((__int64)(a1 + 130), v4);
Barrier(v4);
comm_atommaps_list(a1 + 144, v5, v4);
Barrier(v4);
comm_class_parse_list(a3, v6, v4);
return Barrier(v4);
}

canonical_decompiled_code:
__int64 __fastcall func4(_DWORD *a1, __int64 a2, _QWORD *a3)
{
unsigned int v4; // ebp
unsigned int v5; // er14
unsigned int v6; // er13

v4 = a1[822];
v5 = a1[13];
v6 = a1[144];
func0((__int64)a1, v4);
Barrier(v4);
func1((__int64)(a1 + 130), v4);
Barrier(v4);
func2(a1 + 144, v5, v4);
Barrier(v4);
func3(a3, v6, v4);
return Barrier(v4);
}

original_code:
void communicate_class_list(CLASS *class,GENERAL_DATA *general_data,
                            CLASS_PARSE *class_parse,int pimd_on)
{
  int i,iii;
  int natm_mall = class->clatoms_info.natm_mall;
  int nktot = general_data->ewald.nktot;
  int nmol_typ = class->atommaps.nmol_typ;
  int world = class->communicate.world;
  comm_clatoms_list(&(class->clatoms_info),world); Barrier(world);
  comm_ghost_atoms_list(&(class->ghost_atoms),world); Barrier(world);
  comm_atommaps_list(&(class->atommaps),natm_mall,world); Barrier(world);
  comm_class_parse_list(class_parse,nmol_typ,world); Barrier(world);
}

canonical_original_code:
void communicate_class_list(struct class *class, struct general_data *general_data, struct class_parse *class_parse, int pimd_on)
{
  int i; int iii;
  int natm_mall = class->clatoms_info.natm_mall;
  int nktot = general_data->ewald.nktot;
  int nmol_typ = class->atommaps.nmol_typ;
  int world = class->communicate.world;
  comm_clatoms_list(&(class->clatoms_info),world); Barrier(world);
  comm_ghost_atoms_list(&(class->ghost_atoms),world); Barrier(world);
  comm_atommaps_list(&(class->atommaps),natm_mall,world); Barrier(world);
  comm_class_parse_list(class_parse,nmol_typ,world); Barrier(world);
}

variable_types: struct class { struct clatoms_info { int natm_tot; int pi_beads; int pi_beads_proc; int pi_beads_proc_st; int pi_beads_proc_end; int nfree; int nfree_pimd; int nchrg; int pi_beads_full_ter; int pi_beads_res_ter; int pi_beads_full_tra; int pi_beads_res_tra; int cg_reset_flag; int natm_mall; int nchrg_mall; int hess_calc; int natm_proc; int N_H2; int i_H2_start; int nab_initio; int myatm_start; double gamma_adb; double wght_pimd; double pi_temperature; double pi_beads_full_ter_wght; double pi_beads_res_ter_wght; double pi_beads_full_tra_wght; double pi_beads_res_tra_wght; double rcut_spread; double mass_sc_fact; int *ip_lab; int *ichrg; int *cp_vlnc_up; int *cp_atm_flag; double *mass; double *q; double *alp_pol; double *b_neut; double *roll_sc; double *text_atm; double *text_mol; double *xold; double *prekf; double *xmod; double alp_ewd; } clatoms_info; struct clatoms_tran { int pi_beads_proc; int pi_atm_proc; int pi_atm_proc_use; int pi_proc_rem; int nwork; int *sendcounts; int *senddspls; int *ifax; double *rat1_stag; double *path_eig; double *work; double *work3; double *x_trans; double *x_temp; double *xt_temp; } clatoms_tran; struct clatoms_pos { double *mass; double *x; double *vx; double *fx; double *fxt; double *fxm; double *hess_xx; } *clatoms_pos; struct ghost_atoms { int nghost_tot; int natm_comp_max; int nghost_mall; int nghost_old; int ncomp_mall; int ncomp_old; int *ighost_map; int *natm_comp; int **iatm_comp; double **coef; } ghost_atoms; struct atommaps { int nmol_typ; int nres_typ; int natm_typ; int nfreeze; int nfreeze_mall; int natm_typ_mall; int nres_typ_max; int nres_max; int nres_tot; int nres_sum; int pimd_freez_typ; char (*atm_typ)[50]; char (*res_typ)[50]; char (*mol_typ)[50]; int *nmol_jmol_typ; int *nres_1mol_jmol_typ; int *jatm_jmol_typ_strt; int *jres_jmol_typ_strt; int *ires_typ_jres_jmol_typ; int *jatm_jres_1mol_jmol_typ_strt; int *natm_1mol_jmol_typ; int *natm_jres_jmol_typ; int *nfree_1mol_jmol_typ; int *nfree_jres_jmol_typ; int *icons_jmol_typ; int *icons_jres_jmol_typ; int *natm_jmol_typ; int *iatm_mol_typ; int *iatm_res_typ; int *iatm_atm_typ; int *iatm_atm_typ_nl; int *iatm_atm_typ_nl_rev; int *imap_atm_typ_nl; int *imap_atm_typ_nl_gh; int *iatm_mol_num; int *iatm_proc_num; int *iatm_res_num; int *ighost_flag; int *freeze_flag; int *freeze_map; int *atom_label; int *cp_atm_lst; } atommaps; struct therm_info { int num_nhc; int len_nhc; int nres_nhc; int nyosh_nhc; int therm_typ; int num_nhc_proc; int num_nhc_share; int mytherm_start; double dt_nhc; int *inhc_x; int *itherm_nshare; double *ditherm_nshare_i; int *map_share; double *text_nhc; double *wdti; double **mass_nhc; } therm_info_class; struct therm_info therm_info_bead; struct therm_pos { double **x_nhc; double x_nhc_tot; } therm_class; struct therm_pos *therm_bead; struct vel_samp_class { int ivel_smpl_on; int ivel_scale_on; int nvx_smpl; int nvx_scale; int nvnhc_smpl; int iseed; double qseed; } vel_samp_class; struct energy_ctrl { int pme_on; int int_res_ter; int isep_vvdw; int iswit_vdw; int block_std_on; int iget_pe_real_inter_freq; int iget_pe_real_inter; int itime; int iget_full_inter; int iget_full_intra; int iget_full_pimd; } energy_ctrl; struct nbr_list { int iver; int ilnk; int nolst; int brnch_root_list_opt; double *x0; struct verlist { int iver_init; int iver_fill; int nolst_ver_update; int jver_pad; int nmem_min_lst; int nver_lst; int nver_lst_res; int nver_lst_now; int nver_lst_now_res; int *nter; int *jter; int *jver_off; int *nter_res; int *jter_res; int *jver_off_res; double mem_safe; } verlist; struct lnklist { int ilnk_init; int lnk_for_odd; int ncell_div_avg; int lnk_excl_safe; int lnk_vol_safe; int ncell_a; int natm_cell_max; int lnk_list_dim; int nshft_lnk; int nshft_lnk_res; double vol_lnk_map; double rcut_max; int *lnk_list; int *ishft_a; int *iexl_chk; int *ishft_a_res; int *iexl_chk_res; int *natm_cell; double *shft_wght; double *shft_wght_res; double *hmat_lnk; } lnklist; struct brnch_root { int nbrnch_tot; int nroot_tot; int natm_add_tot; int nbrnch_root_max; double brnch_root_dist_max; double cutdif_min_brnch_root; double cutdif_min_brnch_brnch; double cutdif_min_brnch_root_res; double cutdif_min_brnch_brnch_res; double r2_nocheck_dist; double r2_nocheck_dist_res; double cutskin_bb_min; double cutskin_bb_min_res; int *brnch_atm_list; int *brnch_atm_root; int *root_atm_list; int *root_atm_map; int *brnch_atm_map; int *nbrnch_of_root_big; int *nbrnch_of_root; int **ibrnch_of_root; int *natm_add; int *iatm_add; int *iatm_add_off; } brnch_root; } nbr_list; struct interact { int nsplin; int iswit_vdw; int dielectric_opt; int ishave_opt; int nter_typ; int nsplin_tot; int ninter_mall; int nsplin_mall_tot; int *inter_map_index; double dielectric_rheal; double dielectric_cut; double dielectric_eps; double brnch_root_skin; double skin; double brnch_root_cut; double rheal_res; double pten_inter_guess; double pten_kin_guess; double clong; double clong_res; double spread_now; double spread_lnk; double brnch_root_skin_lnk; double cutoff_max; double *cutoff; double *cutoff_res; double *cutti; double *cutskin; double *cutskin_res; double *cutskin_root; double *cutskin_root_res; double *vcut_coul; double *rmin_spl; double *dr_spl; double *cv0; double *cdv0; double *cv0_c; double *cdv0_c; } interact; struct int_scr { double v_lnv; double *x; double *vx; double *gx; double **x_nhc; double *vgmat; double *x_vol_nhc; double *sc; double *sc_temp; double *atm_kin; double *step_up; struct therm_scr { double *sc; double *atm_kin; } *therm_scr; } int_scr; struct ewd_scr { double *q; double *x; double *fx; double *heli; double *cossc; double *fx2; double *temp; double *helr_now; } ewd_scr; struct for_scr { int nlen; int nsplin_t; int num_brk; int intact; double wght_lnk; double wght_ter; double wght_ter_res; double wght_tra; double wght_tra_res; double wght_pimd; int *j_indext; int *i_indext2; int *j_lnk; int *j_index; int *num_brk_i; int *iexcl; int *index_atm; } for_scr; double tot_memory; struct part_mesh { int pme_on; int kmax_pme; int n_interp; int pme_res_on; int kmax_pme_res; int n_interp_res; int pme_para_opt; int nlen_pme; int nktot_pme; int ngrid_a; int nktot_pme_res; int ngrid_a_res; int ninterp_mall; int ninterp_tot_mall; int *iatemp; int *nc; int **igrid_a; int **igrid_now; double ecut; double ecut_res; double *bweight_tot_res; double *bweight_tot; double *qgrid; double *qgrid_scr; double *qgrid_tmp_real; double *qgrid_tmp_imag; double *frac_a; double *aj; double **ua; double **mn_a; double **dmn_a; double **qgrid_now; } part_mesh; struct surface { int isurf_on; int natm_typ; int nsplin_surf; int nsplin_tot; double zheal; double surface_height; double *surface_pot; double *surface_forc; double *zcut_off; double *dz_spl; double *dzi_spl; double *zmin_spl; char surface_type[50]; } surface; struct communicate { int np_beads; int myid; int myid_bead_forc; int myid_bead; int myid_bead_prime; int myid_state; int myid_forc; int myid_forc_source; int myid_forc_target; int world; int comm_beads; int comm_beads_forc; int comm_states; int comm_forc; int comm_forc_source; int comm_forc_target; int comm_faux; } communicate; struct class_comm_forc_pkg { int num_proc; int myid; int myatm_start; int mytherm_start; int *displs_atm; int *displs_therm; int comm; int world; double dbl_num_proc; struct class_plimpton_ind { int num_proc_source; int num_proc_target; int myid_source; int myid_target; int natoms_tot; int *index_src; int *index_src_even; int *index_src_odd; int *index_trg; int *index_trg_even; int *index_trg_odd; int *displs_atm_trg; int *displs_atm_src; int *src_odd_end; int *src_even_end; int *trg_odd_end; int *trg_even_end; int *src_odd_begin; int *src_even_begin; int *trg_odd_begin; int *trg_even_begin; int my_src_odd_counts; int my_src_even_counts; int my_trg_odd_counts; int my_trg_even_counts; int *my_src_odd; int *my_src_even; int *my_trg_odd; int *my_trg_even; int **jmax; int *jmin; int **imax; int source; int target; } plimpton_ind; } class_comm_forc_pkg; } *

variable_types: struct general_data { struct simopts { int md; int pimd; int minimize; int cp; int cp_pimd; int cp_wave; int cp_wave_pimd; int cp_wave_min_pimd; int cp_min; int cp_wave_min; int debug; int debug_pimd; int debug_cp; int debug_cp_pimd; int pi_beads; int pi_md_typ; int initial_spread_opt; int anneal_opt; double ann_rate; double ann_start_temp; double ann_target_temp; } simopts; struct minopts { int min_std; int min_cg; int min_diis; int diis_hist_len; int cp_min_std; int cp_min_cg; int cp_min_diis; int cp_diis_hist_len; int cp_cg_line_min_len; int min_atm_com_fix_opt; double tol_coef; double tol_atom; } minopts; struct ensopts { int nve; } ensopts; struct filenames { char *iname; char *dname; char *dnamec; char *cpname; char *ksname; char *elfname; char *cvname; char *ccname; char *cpparname; char *centname; char *forcename; int low_lim_par; int high_lim_par; int iwrite_screen; int iwrite_inst; int iwrite_dump; int iwrite_kseigs; int iwrite_confv; int iwrite_confp; int iwrite_par_confp; int iwrite_confc; int iwrite_path_cent; int ifile_open; int iwrite_conf_binary; int iwrite_units; int iwrite_atm_for; int iwrite_elf; } filenames; struct statepoint { double pext; } statepoint; struct cell { int iperd; int intra_perds; int cubic_box_flag; int hmat_int_typ; int hmat_cons_typ; int imov_cp_box; double vol; double vol_cp; double vol0; double area; double alpha_conv_dual; double *hmat; double *hmat_ewd; double *hmat_cp; double *cp_box_center; double *cp_box_center_rel; double *cp_vbox_center; double *cp_fbox_center; } cell; struct timeinfo { int ntime; int ix_respa; int int_res_ter; int nres_ter; int int_res_tor; int int_res_pimd; int iget_pe_real_inter_freq; int exit_flag; double dt; } timeinfo; struct baro { int len_nhc; double x_lnv; double v_lnv_glob; double v_lnv_g; double f_lnv_p; double vol; double mass_lnv; double c2_lnv; double roll_scv; double roll_scg; double roll_scg0; double x_lnv_o; double v_lnv_g_wght; double area; double *x_vol_nhc; double *f_vol_nhc; double *hmato; } baro; struct par_rahman { double vol; double mass_hm; double c1_hm; double roll_scg; double roll_scg0; double area; double *vgmat; double *vgmat_glob; double *fgmat_p; double *roll_mtv; double *roll_mtvv; double *vtemps; double *vexpdt; double *vtempx; double *hmat_t; double *fv1; double *vgmat_g_wght; } par_rahman; struct ptens { double *tvten; double *pvten; double *pvten_inc; double *pvten_tmp_res; double *pvten_inc_t1; double *pvten_inc_a; double *pvten_inc_old; double *count_inc; double *pvten_inc_glob; double *pvten_mode; } ptens; struct stat_avg { int nexclt; int iter_shake; int iswit_vdw; int itime_update; int iter_shake_cp; int write_cp_atm_flag; double vintert; double vintrat; double vsurft; double vbondt; double vbend_bndt; double vbend_bnd_bond; double vbondt_watts; double vreal; double vvdw; double vlong; double vbond_free; double vbar_free; double kinet; double kinet_v; double vol; double kinet_nhc; double kinet_nhc_bead; double aikinet_nhc_bead; double akinet_nhc_bead; double vpot_v; double vpotnhc; double aiter_shake; double iter_23; double aiter_23; double aiter_21; double iter_23r; double aiter_23r; double aiter_21r; double acella; double aicella; double acellab; double aicellab; double apress; double press_inter; double apress_inter; double apress_intra; double press_kin; double apress_kin; double econv0; double cp_kconv0; double cpu1; double updates; double kinet_cp_up; double kinet_cp_dn; double kinet_cp; double kinet_nhc_cp; double vpotnhc_cp; double cp_ehart; double cp_eext; double cp_exc; double cp_muxc; double cp_eke; double cp_enl; double aiter_shake_cp; double maxfc; double pi_ke_prim; double api_ke_prim; double aipi_ke_prim; double kin_harm; double *apten; double fc_mag_up; double fc_max_up; double fatm_max; double count_diag_srot; double econv_now; double isokconv; } stat_avg; struct ewald { int nsplin_g; int nktot; int nktot_res; int nktot_mall; int nktot_res_mall; int nkc_max; int nkb_max; double alp_ewd; double self_erf; double ecut; double ecut_clus; double alp_clus; double gs_max; int *kastr; int *ibrk1; int *kastr_res; int *ibrk1_res; double *clus_corr_r; double *clus_corr_r_res; double *cvgs_2d0; double *vgc_1d_y; } ewald; struct para_fft_pkg3d { int nktot; int ncoef_use; int nfft_size; int nfft; int igeneric_opt; int scale_opt; int len_ifax; int nwork1; double ecut; int comm; int num_proc; int *map_proc; int *recv_counts_rho; int *recv_counts_coef; int *map_pme_dn; int *recvcounts_pme_dn; int *sendcounts_pme_dn; int *map_pme_up; int *recvcounts_pme_up; int *sendcounts_pme_up; int ndata_kc; int nkf3; int str_fft_kc_proc; int ska_fft_kc_proc; int skb_fft_kc_proc; int *sendcounts_fft_kc; int *recvcounts_fft_kc; int *sum_fft_kc_proc; int nka_fft_kc; int *ka_fft_kc; int *ifax_c_f; double *work_1c_f; double *work_1c_r; int ndata_kb; int nkf2; int str_fft_kb_proc; int ska_fft_kb_proc; int skc_fft_kb_proc; int *ska_fft_kb_proc_all; int *skc_fft_kb_proc_all; int *sendcounts_fft_kb; int *recvcounts_fft_kb; int *sum_fft_kb_proc; int *ifax_b_f; double *work_1b_f; double *work_1b_r; int ndata_ka; int nkf1; int str_fft_ka_proc; int skb_fft_ka_proc; int skc_fft_ka_proc; int *skb_fft_ka_proc_all; int *skc_fft_ka_proc_all; int *sendcounts_fft_ka; int *recvcounts_fft_ka; int *ifax_a_f; double *work_1a_f; double *work_1a_r; int *send_counts_row_big_small; int *recv_counts_row_big_small; int *sdispls_row_big_small; int *rdispls_row_big_small; int *send_counts_dual_map; int *recv_counts_dual_map; int *sdispls_dual_map; int *rdispls_dual_map; int *send_counts_row_big_small_upack; int *recv_counts_row_big_small_upack; int *sdispls_row_big_small_upack; int *rdispls_row_big_small_upack; int *send_counts_dual_map_upack; int *recv_counts_dual_map_upack; int *sdispls_dual_map_upack; int *rdispls_dual_map_upack; int *send_counts_ioff_big_small; int *recv_counts_ioff_big_small; int *sdispls_ioff_big_small; int *rdispls_ioff_big_small; } pme_fft_pkg; struct para_fft_pkg3d pme_res_fft_pkg; int error_check_on; } *

variable_types: nktot int

user_defined_types: struct class { struct clatoms_info clatoms_info; struct clatoms_tran clatoms_tran; struct clatoms_pos *clatoms_pos; struct ghost_atoms ghost_atoms; struct atommaps atommaps; struct therm_info therm_info_class; struct therm_info therm_info_bead; struct therm_pos therm_class; struct therm_pos *therm_bead; struct vel_samp_class vel_samp_class; struct energy_ctrl energy_ctrl; struct nbr_list nbr_list; struct interact interact; struct int_scr int_scr; struct ewd_scr ewd_scr; struct for_scr for_scr; double tot_memory; struct part_mesh part_mesh; struct surface surface; struct communicate communicate; struct class_comm_forc_pkg class_comm_forc_pkg; }

user_defined_types: struct general_data { struct simopts simopts; struct minopts minopts; struct ensopts ensopts; struct filenames filenames; struct statepoint statepoint; struct cell cell; struct timeinfo timeinfo; struct baro baro; struct par_rahman par_rahman; struct ptens ptens; struct stat_avg stat_avg; struct ewald ewald; struct para_fft_pkg3d pme_fft_pkg; struct para_fft_pkg3d pme_res_fft_pkg; int error_check_on; }

user_defined_types: struct class_parse { int ivx_smpl; int ivx_scale; int kmax_ewd; int istart; int ishift_pot; int initial_spread_opt; int zero_com_vel; double tau_vol; double tau_nhc_def; int *imol_nhc_opt; int *ionfo_opt; int *ires_bond_conv; int *mol_freeze_opt; int *mol_hydrog_mass_opt; int *mol_hydrog_con_opt; double *tau_nhc_mol; double *text_nhc_mol; double *mol_hydrog_mass_val; }

user_defined_types: struct int_scr { double v_lnv; double *x; double *vx; double *gx; double **x_nhc; double *vgmat; double *x_vol_nhc; double *sc; double *sc_temp; double *atm_kin; double *step_up; struct therm_scr *therm_scr; }


original_code:
void fetch_freeze(CLASS_PARSE *class_parse, ATOMMAPS *atommaps,
                  BUILD_INTRA *build_intra, START_INDEX *start_index,
                  CLATOMS_INFO *clatoms_info, int jmol_typ) {
  int i, iii, nfreeze_now, iresidue_off, nresidue, count;
  int count_atm,ires;
  double cut_heavy;
  double *mass = clatoms_info->mass;
  if (class_parse->mol_freeze_opt[jmol_typ] == 0) {
    for(i=start_index->natm+1; i<=clatoms_info->natm_tot; i++) {
      atommaps->freeze_flag[i] = 0;
    }
  }
  if (class_parse->mol_freeze_opt[jmol_typ] == 1) {
    for(i=start_index->natm+1; i<=clatoms_info->natm_tot; i++) {
      atommaps->freeze_flag[i] = atommaps->nfreeze + i-start_index->natm;
    }
    nfreeze_now = clatoms_info->natm_tot - start_index->natm;
    atommaps->nfreeze += nfreeze_now;
    if (atommaps->nfreeze > build_intra->nfreeze_max) {
      build_intra->nfreeze_max += (((100)>(nfreeze_now))?(100):(nfreeze_now));
      atommaps->freeze_map = (int *)crealloc(&(atommaps->freeze_map[1]),
                                             build_intra->nfreeze_max*
                                             sizeof(int))-1;
    }
    for(i=start_index->nfreeze+1; i<=atommaps->nfreeze; i++) {
      atommaps->freeze_map[i] = start_index->natm + i-start_index->nfreeze;
    }
    iresidue_off = atommaps->jres_jmol_typ_strt[jmol_typ] - 1;
    atommaps->nfree_1mol_jmol_typ[jmol_typ] = 0;
    atommaps->icons_jmol_typ[jmol_typ] = 0;
    nresidue = (((atommaps->nres_1mol_jmol_typ[jmol_typ])>(1))?(atommaps->nres_1mol_jmol_typ[jmol_typ]):(1));
    for(i=1; i<=nresidue; i++) {
      atommaps->nfree_jres_jmol_typ[(iresidue_off+i)] = 0.0;
    }
  }
  if (class_parse->mol_freeze_opt[jmol_typ] == 2) {
    nfreeze_now = atommaps->nfreeze;
    for(i=start_index->natm+1; i<=clatoms_info->natm_tot; i++) {
      if(atommaps->atom_label[i] == 1) {
        nfreeze_now++;
        atommaps->freeze_flag[i] = i;
      }
    }
    if (nfreeze_now > build_intra->nfreeze_max) {
      build_intra->nfreeze_max += (((100)>(nfreeze_now-atommaps->nfreeze))?(100):(nfreeze_now-atommaps->nfreeze));
      atommaps->freeze_map = (int *)crealloc(&(atommaps->freeze_map[1]),
                                             build_intra->nfreeze_max*
                                             sizeof(int))-1;
    }
    count = 0;
    count_atm = 0;
    iresidue_off = atommaps->jres_jmol_typ_strt[jmol_typ] - 1;
    ires = iresidue_off + 1;
    for(i=start_index->natm+1; i<=clatoms_info->natm_tot; i++) {
      count_atm++;
      if (count_atm > atommaps->natm_jres_jmol_typ[ires]) {
        count_atm = 1;
        ires++;
      }
      if (atommaps->atom_label[i] == 1) {
        count++;
        atommaps->freeze_map[(atommaps->nfreeze+count)] = i;
        atommaps->nfree_1mol_jmol_typ[jmol_typ] -= 3;
        atommaps->nfree_jres_jmol_typ[ires] -= 3;
      }
    }
    atommaps->nfreeze = nfreeze_now;
  }
  cut_heavy = 3.5;
  if (class_parse->mol_freeze_opt[jmol_typ] == 3) {
    nfreeze_now = atommaps->nfreeze;
    for(i=start_index->natm+1; i<=clatoms_info->natm_tot; i++) {
      if(mass[i] > cut_heavy) {
        nfreeze_now++;
        atommaps->freeze_flag[i] = i;
      }
    }
    if (nfreeze_now > build_intra->nfreeze_max) {
      printf(" reallocing freeze_map \n");
      build_intra->nfreeze_max += (((100)>(nfreeze_now-atommaps->nfreeze))?(100):(nfreeze_now-atommaps->nfreeze));
      atommaps->freeze_map = (int *)crealloc(&(atommaps->freeze_map[1]),
                                             build_intra->nfreeze_max*
                                             sizeof(int))-1;
    }
    count = 0;
    count_atm = 0;
    iresidue_off = atommaps->jres_jmol_typ_strt[jmol_typ] - 1;
    ires = iresidue_off + 1;
    for(i=start_index->natm+1; i<=clatoms_info->natm_tot; i++) {
      count_atm++;
      if (count_atm > atommaps->natm_jres_jmol_typ[ires]) {
        count_atm = 1;
        ires++;
      }
      if(mass[i] > cut_heavy) {
        count++;
        atommaps->freeze_map[(atommaps->nfreeze+count)] = i;
        atommaps->nfree_1mol_jmol_typ[jmol_typ] -= 3;
        atommaps->nfree_jres_jmol_typ[ires] -= 3;
      }
    }
    atommaps->nfreeze = nfreeze_now;
  }
}

canonical_original_code:
void fetch_freeze(struct class_parse *class_parse, struct atommaps *atommaps, struct build_intra *build_intra, struct start_index *start_index, struct clatoms_info *clatoms_info, int jmol_typ) {
  int i; int iii; int nfreeze_now; int iresidue_off; int nresidue; int count;
  int count_atm; int ires;
  double cut_heavy;
  double *mass = clatoms_info->mass;
  if (class_parse->mol_freeze_opt[jmol_typ] == 0) {
    for(i=start_index->natm+1; i<=clatoms_info->natm_tot; i++) {
      atommaps->freeze_flag[i] = 0;
    }
  }
  if (class_parse->mol_freeze_opt[jmol_typ] == 1) {
    for(i=start_index->natm+1; i<=clatoms_info->natm_tot; i++) {
      atommaps->freeze_flag[i] = atommaps->nfreeze + i-start_index->natm;
    }
    nfreeze_now = clatoms_info->natm_tot - start_index->natm;
    atommaps->nfreeze += nfreeze_now;
    if (atommaps->nfreeze > build_intra->nfreeze_max) {
      build_intra->nfreeze_max += (((100)>(nfreeze_now))?(100):(nfreeze_now));
      atommaps->freeze_map = (int *)crealloc(&(atommaps->freeze_map[1]),
                                             build_intra->nfreeze_max*
                                             sizeof(int))-1;
    }
    for(i=start_index->nfreeze+1; i<=atommaps->nfreeze; i++) {
      atommaps->freeze_map[i] = start_index->natm + i-start_index->nfreeze;
    }
    iresidue_off = atommaps->jres_jmol_typ_strt[jmol_typ] - 1;
    atommaps->nfree_1mol_jmol_typ[jmol_typ] = 0;
    atommaps->icons_jmol_typ[jmol_typ] = 0;
    nresidue = (((atommaps->nres_1mol_jmol_typ[jmol_typ])>(1))?(atommaps->nres_1mol_jmol_typ[jmol_typ]):(1));
    for(i=1; i<=nresidue; i++) {
      atommaps->nfree_jres_jmol_typ[(iresidue_off+i)] = 0.0;
    }
  }
  if (class_parse->mol_freeze_opt[jmol_typ] == 2) {
    nfreeze_now = atommaps->nfreeze;
    for(i=start_index->natm+1; i<=clatoms_info->natm_tot; i++) {
      if(atommaps->atom_label[i] == 1) {
        nfreeze_now++;
        atommaps->freeze_flag[i] = i;
      }
    }
    if (nfreeze_now > build_intra->nfreeze_max) {
      build_intra->nfreeze_max += (((100)>(nfreeze_now-atommaps->nfreeze))?(100):(nfreeze_now-atommaps->nfreeze));
      atommaps->freeze_map = (int *)crealloc(&(atommaps->freeze_map[1]),
                                             build_intra->nfreeze_max*
                                             sizeof(int))-1;
    }
    count = 0;
    count_atm = 0;
    iresidue_off = atommaps->jres_jmol_typ_strt[jmol_typ] - 1;
    ires = iresidue_off + 1;
    for(i=start_index->natm+1; i<=clatoms_info->natm_tot; i++) {
      count_atm++;
      if (count_atm > atommaps->natm_jres_jmol_typ[ires]) {
        count_atm = 1;
        ires++;
      }
      if (atommaps->atom_label[i] == 1) {
        count++;
        atommaps->freeze_map[(atommaps->nfreeze+count)] = i;
        atommaps->nfree_1mol_jmol_typ[jmol_typ] -= 3;
        atommaps->nfree_jres_jmol_typ[ires] -= 3;
      }
    }
    atommaps->nfreeze = nfreeze_now;
  }
  cut_heavy = 3.5;
  if (class_parse->mol_freeze_opt[jmol_typ] == 3) {
    nfreeze_now = atommaps->nfreeze;
    for(i=start_index->natm+1; i<=clatoms_info->natm_tot; i++) {
      if(mass[i] > cut_heavy) {
        nfreeze_now++;
        atommaps->freeze_flag[i] = i;
      }
    }
    if (nfreeze_now > build_intra->nfreeze_max) {
      printf(" reallocing freeze_map \n");
      build_intra->nfreeze_max += (((100)>(nfreeze_now-atommaps->nfreeze))?(100):(nfreeze_now-atommaps->nfreeze));
      atommaps->freeze_map = (int *)crealloc(&(atommaps->freeze_map[1]),
                                             build_intra->nfreeze_max*
                                             sizeof(int))-1;
    }
    count = 0;
    count_atm = 0;
    iresidue_off = atommaps->jres_jmol_typ_strt[jmol_typ] - 1;
    ires = iresidue_off + 1;
    for(i=start_index->natm+1; i<=clatoms_info->natm_tot; i++) {
      count_atm++;
      if (count_atm > atommaps->natm_jres_jmol_typ[ires]) {
        count_atm = 1;
        ires++;
      }
      if(mass[i] > cut_heavy) {
        count++;
        atommaps->freeze_map[(atommaps->nfreeze+count)] = i;
        atommaps->nfree_1mol_jmol_typ[jmol_typ] -= 3;
        atommaps->nfree_jres_jmol_typ[ires] -= 3;
      }
    }
    atommaps->nfreeze = nfreeze_now;
  }
}

variable_types: struct atommaps { int nmol_typ; int nres_typ; int natm_typ; int nfreeze; int nfreeze_mall; int natm_typ_mall; int nres_typ_max; int nres_max; int nres_tot; int nres_sum; int pimd_freez_typ; char (*atm_typ)[50]; char (*res_typ)[50]; char (*mol_typ)[50]; int *nmol_jmol_typ; int *nres_1mol_jmol_typ; int *jatm_jmol_typ_strt; int *jres_jmol_typ_strt; int *ires_typ_jres_jmol_typ; int *jatm_jres_1mol_jmol_typ_strt; int *natm_1mol_jmol_typ; int *natm_jres_jmol_typ; int *nfree_1mol_jmol_typ; int *nfree_jres_jmol_typ; int *icons_jmol_typ; int *icons_jres_jmol_typ; int *natm_jmol_typ; int *iatm_mol_typ; int *iatm_res_typ; int *iatm_atm_typ; int *iatm_atm_typ_nl; int *iatm_atm_typ_nl_rev; int *imap_atm_typ_nl; int *imap_atm_typ_nl_gh; int *iatm_mol_num; int *iatm_proc_num; int *iatm_res_num; int *ighost_flag; int *freeze_flag; int *freeze_map; int *atom_label; int *cp_atm_lst; } *

variable_types: struct build_intra { struct bond_site { char bond_site_name[5][50]; int branch_1[5]; int branch_2[5]; int valence; int improper_ind[5]; } *bond_site; int *mask_atm; int *index_atm; int *iatm_ind_chk; int *ires_ind_chk; int natm_1res_pure_now; int natm_tot_max; int nfreeze_max; int nfreeze_now; int natm_1res_now; int natm_1res_max; int natmind_1res_now; int natmind_1res_max; int nghost_now; int nghost_tot_max; int nbond_pow_max; int nbond_con_max; int nbond_nul_max; int nbond_typ_pow_max; int nbond_typ_con_max; struct CBOND { char atm1[50]; } *cbond_typ_pow; struct CBOND *cbond_typ_con; struct CBOND *cbond_typ_now; int nbend_pow_max; int nbend_con_max; int nbend_nul_max; int nbend_typ_pow_max; int nbend_typ_con_max; struct CBEND { char atm1[50]; } *cbend_typ_pow; struct CBEND *cbend_typ_con; struct CBEND *cbend_typ_now; int ntors_pow_max; int ntors_con_max; int ntors_nul_max; int ntors_typ_pow_max; int ntors_typ_con_max; struct CTORS { char atm1[50]; } *ctors_typ_pow; struct CTORS *ctors_typ_con; struct CTORS *ctors_typ_now; int nonfo_max; int nonfo_nul_max; int nonfo_typ_max; struct CBOND *confo_typ; struct CBOND *confo_typ_now; int nbend_bnd_max; int nbend_bnd_typ_max; struct CBEND *cbend_bnd_typ; struct CBEND *cbend_bnd_typ_now; int ngrp_33_max; int ngrp_watt_33_max; int ngrp_21_max; int ngrp_43_max; int ngrp_23_max; int ngrp_46_max; int ngrp_typ_21_max; int ngrp_typ_43_max; int ngrp_typ_33_max; int ngrp_typ_watt_33_max; int ngrp_typ_23_max; int ngrp_typ_46_max; struct CGRP_CONS { char atm1[50]; } *cgrp_typ_now; struct CGRP_CONS *cgrp_typ_21; struct CGRP_CONS *cgrp_typ_43; struct CGRP_CONS *cgrp_typ_33; struct CGRP_CONS *cgrp_typ_watt_33; struct CGRP_CONS *cgrp_typ_23; struct CGRP_CONS *cgrp_typ_46; int natm_typ_max; int nres_typ_max; char *strip1; int *ibend_bnd_typ_pure; int *ibend_bnd_typ_map; } *

variable_types: struct start_index { int nbond_pow; int nbond_con; int nbond_nul; int nbend_pow; int nbend_con; int nbend_nul; int ntors_pow; int ntors_con; int nfreeze; int ntors_nul; int nonfo; int nonfo_nul; int nbend_bnd; int natm; int nghost_tot; int ngrp_21; int ngrp_33; int ngrp_watt_33; int ngrp_43; int ngrp_23; int ngrp_46; } *

variable_types: struct clatoms_info { int natm_tot; int pi_beads; int pi_beads_proc; int pi_beads_proc_st; int pi_beads_proc_end; int nfree; int nfree_pimd; int nchrg; int pi_beads_full_ter; int pi_beads_res_ter; int pi_beads_full_tra; int pi_beads_res_tra; int cg_reset_flag; int natm_mall; int nchrg_mall; int hess_calc; int natm_proc; int N_H2; int i_H2_start; int nab_initio; int myatm_start; double gamma_adb; double wght_pimd; double pi_temperature; double pi_beads_full_ter_wght; double pi_beads_res_ter_wght; double pi_beads_full_tra_wght; double pi_beads_res_tra_wght; double rcut_spread; double mass_sc_fact; int *ip_lab; int *ichrg; int *cp_vlnc_up; int *cp_atm_flag; double *mass; double *q; double *alp_pol; double *b_neut; double *roll_sc; double *text_atm; double *text_mol; double *xold; double *prekf; double *xmod; double alp_ewd; } *

variable_types: nresidue int

variable_types: count int

variable_types: ires int

variable_types:
mass
double *

user_defined_types: struct build_intra { struct bond_site *bond_site; int *mask_atm; int *index_atm; int *iatm_ind_chk; int *ires_ind_chk; int natm_1res_pure_now; int natm_tot_max; int nfreeze_max; int nfreeze_now; int natm_1res_now; int natm_1res_max; int natmind_1res_now; int natmind_1res_max; int nghost_now; int nghost_tot_max; int nbond_pow_max; int nbond_con_max; int nbond_nul_max; int nbond_typ_pow_max; int nbond_typ_con_max; struct CBOND *cbond_typ_pow; struct CBOND *cbond_typ_con; struct CBOND *cbond_typ_now; int nbend_pow_max; int nbend_con_max; int nbend_nul_max; int nbend_typ_pow_max; int nbend_typ_con_max; struct CBEND *cbend_typ_pow; struct CBEND *cbend_typ_con; struct CBEND *cbend_typ_now; int ntors_pow_max; int ntors_con_max; int ntors_nul_max; int ntors_typ_pow_max; int ntors_typ_con_max; struct CTORS *ctors_typ_pow; struct CTORS *ctors_typ_con; struct CTORS *ctors_typ_now; int nonfo_max; int nonfo_nul_max; int nonfo_typ_max; struct CBOND *confo_typ; struct CBOND *confo_typ_now; int nbend_bnd_max; int nbend_bnd_typ_max; struct CBEND *cbend_bnd_typ; struct CBEND *cbend_bnd_typ_now; int ngrp_33_max; int ngrp_watt_33_max; int ngrp_21_max; int ngrp_43_max; int ngrp_23_max; int ngrp_46_max; int ngrp_typ_21_max; int ngrp_typ_43_max; int ngrp_typ_33_max; int ngrp_typ_watt_33_max; int ngrp_typ_23_max; int ngrp_typ_46_max; struct CGRP_CONS *cgrp_typ_now; struct CGRP_CONS *cgrp_typ_21; struct CGRP_CONS *cgrp_typ_43; struct CGRP_CONS *cgrp_typ_33; struct CGRP_CONS *cgrp_typ_watt_33; struct CGRP_CONS *cgrp_typ_23; struct CGRP_CONS *cgrp_typ_46; int natm_typ_max; int nres_typ_max; char *strip1; int *ibend_bnd_typ_pure; int *ibend_bnd_typ_map; }


original_code:
void freeze_con_check(ATOMMAPS *atommaps, BOND *bond, BEND *bend, TORS *tors,
                      GRP_BOND_CON *grp_bond_con) {
  int i, k1, k2, k3, k4;
  for(i=1; i<=bond->ncon; i++) {
    k1 = bond->j1_con[i];
    k2 = bond->j2_con[i];
    if ((atommaps->freeze_flag[k1] > 0) || (atommaps->freeze_flag[k2] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained bond.                              \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=bend->ncon; i++) {
    k1 = bend->j1_con[i];
    k2 = bend->j2_con[i];
    k3 = bend->j3_con[i];
    if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0) || (atommaps->freeze_flag[k3] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained bend.                              \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=tors->ncon; i++) {
    k1 = tors->j1_con[i];
    k2 = tors->j2_con[i];
    k3 = tors->j3_con[i];
    k4 = tors->j3_con[i];
    if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0) ||
       (atommaps->freeze_flag[k3] > 0) || (atommaps->freeze_flag[k4] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained torsion.                           \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=grp_bond_con->num_21; i++) {
    k1 = grp_bond_con->j1_21[i];
    k2 = grp_bond_con->j2_21[i];
    if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained group bond.                        \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=grp_bond_con->num_23; i++) {
    k1 = grp_bond_con->j1_23[i];
    k2 = grp_bond_con->j2_23[i];
    k3 = grp_bond_con->j3_23[i];
    if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0) ||
       (atommaps->freeze_flag[k3] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained group bond.                        \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=grp_bond_con->num_33; i++) {
    k1 = grp_bond_con->j1_33[i];
    k2 = grp_bond_con->j2_33[i];
    k3 = grp_bond_con->j3_33[i];
     if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0) ||
       (atommaps->freeze_flag[k3] > 0)){
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained group bond.                        \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=grp_bond_con->num_43; i++) {
    k1 = grp_bond_con->j1_43[i];
    k2 = grp_bond_con->j2_43[i];
    k3 = grp_bond_con->j3_43[i];
    k4 = grp_bond_con->j4_43[i];
    if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0) ||
       (atommaps->freeze_flag[k3] > 0) ||
       (atommaps->freeze_flag[k4] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained group bond.                        \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=grp_bond_con->num_46; i++) {
    k1 = grp_bond_con->j1_46[i];
    k2 = grp_bond_con->j2_46[i];
    k3 = grp_bond_con->j3_46[i];
    k4 = grp_bond_con->j4_46[i];
    if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0) ||
       (atommaps->freeze_flag[k3] > 0) || (atommaps->freeze_flag[k4] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained group bond.                        \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
}

canonical_original_code:
void freeze_con_check(struct atommaps *atommaps, struct bond *bond, struct bend *bend, struct tors *tors, struct grp_bond_con *grp_bond_con) {
  int i; int k1; int k2; int k3; int k4;
  for(i=1; i<=bond->ncon; i++) {
    k1 = bond->j1_con[i];
    k2 = bond->j2_con[i];
    if ((atommaps->freeze_flag[k1] > 0) || (atommaps->freeze_flag[k2] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained bond.                              \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=bend->ncon; i++) {
    k1 = bend->j1_con[i];
    k2 = bend->j2_con[i];
    k3 = bend->j3_con[i];
    if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0) || (atommaps->freeze_flag[k3] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained bend.                              \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=tors->ncon; i++) {
    k1 = tors->j1_con[i];
    k2 = tors->j2_con[i];
    k3 = tors->j3_con[i];
    k4 = tors->j3_con[i];
    if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0) ||
       (atommaps->freeze_flag[k3] > 0) || (atommaps->freeze_flag[k4] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained torsion.                           \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=grp_bond_con->num_21; i++) {
    k1 = grp_bond_con->j1_21[i];
    k2 = grp_bond_con->j2_21[i];
    if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained group bond.                        \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=grp_bond_con->num_23; i++) {
    k1 = grp_bond_con->j1_23[i];
    k2 = grp_bond_con->j2_23[i];
    k3 = grp_bond_con->j3_23[i];
    if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0) ||
       (atommaps->freeze_flag[k3] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained group bond.                        \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=grp_bond_con->num_33; i++) {
    k1 = grp_bond_con->j1_33[i];
    k2 = grp_bond_con->j2_33[i];
    k3 = grp_bond_con->j3_33[i];
     if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0) ||
       (atommaps->freeze_flag[k3] > 0)){
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained group bond.                        \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=grp_bond_con->num_43; i++) {
    k1 = grp_bond_con->j1_43[i];
    k2 = grp_bond_con->j2_43[i];
    k3 = grp_bond_con->j3_43[i];
    k4 = grp_bond_con->j4_43[i];
    if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0) ||
       (atommaps->freeze_flag[k3] > 0) ||
       (atommaps->freeze_flag[k4] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained group bond.                        \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
  for(i=1; i<=grp_bond_con->num_46; i++) {
    k1 = grp_bond_con->j1_46[i];
    k2 = grp_bond_con->j2_46[i];
    k3 = grp_bond_con->j3_46[i];
    k4 = grp_bond_con->j4_46[i];
    if((atommaps->freeze_flag[k1] > 0) ||
       (atommaps->freeze_flag[k2] > 0) ||
       (atommaps->freeze_flag[k3] > 0) || (atommaps->freeze_flag[k4] > 0)) {
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      printf("You are freezing atoms that are involved in a  \n");
      printf("constrained group bond.                        \n");
      printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
      fflush(stdout);
      exit(1);
    }
  }
}

variable_types: struct bond { int npow; int ntyp_pow; int ncon; int ntyp_con; int nbond_pow_mall; int nbond_typ_pow_mall; int nbond_con_mall; int nbond_typ_con_mall; int block_pow_on; int ncon_tot; int ncon_max; int nblock_pow; int nblock_con; int *j1_pow; int *jtyp_pow; int *j1_con; int *jtyp_con; int *iblock_pow_size; int *iblock_pow_conflict_1; int *iblock_con_size; int *iblock_con_conflict_1; double *eq_pow; double *eq_pow_res; double *c_0; double *dc_0; double *al_con; double *eq_con; } *

variable_types: struct bend { int npow; int ntyp_pow; int ncon; int ntyp_con; int nbend_pow_mall; int nbend_typ_pow_mall; int nbend_con_mall; int nbend_typ_con_mall; int block_pow_on; int ncon_tot; int nblock_pow; int nblock_con; int *j1_pow; int *jtyp_pow; int *j1_con; int *jtyp_con; int *iblock_pow_size; int *iblock_pow_conflict_1; int *iblock_pow_conflict_3; int *iblock_con_size; int *iblock_con_conflict_1; int *iblock_con_conflict_3; double *eq_pow; double *c_0; double *s_0; double *dc_0; double *ds_0; double *al_con; double *eq_con; } *

variable_types: struct tors { int npow; int ntyp_pow; int nimpr; int ncon; int ntyp_con; int ntors_pow_mall; int ntors_typ_pow_mall; int ntors_con_mall; int ntors_typ_con_mall; int block_pow_on; int block_con_on; int ncon_tot; int nblock_pow; int nblock_con; int *j1_pow; int *jtyp_pow; int *j1_con; int *jtyp_con; int *iblock_pow_size; int *iblock_pow_conflict_1; int *iblock_pow_conflict_3; int *iblock_con_size; int *iblock_con_conflict_1; int *iblock_con_conflict_3; double *c_0; double *s_0; double *dc_0; double *ds_0; double *eq_pow; double *al_con; double *eq_con; } *

variable_types: struct grp_bond_con { int num_33; int num_21; int num_43; int ntyp_33; int num_23; int ntyp_23; int num_46; int ntyp_46; int max_iter; int ngrp_21_mall; int ngrp_33_mall; int ngrp_43_mall; int ngrp_23_mall; int ngrp_46_mall; int ngrp_typ_21_mall; int ngrp_typ_33_mall; int ngrp_typ_43_mall; int ngrp_typ_23_mall; int ngrp_typ_46_mall; int num_21_tot; double tol; int *j1_33; int *j1_21; int *j2_43; int *jtyp_33; int *j1_23; int *jtyp_23; int *j1_46; int *jtyp_46; double **al_33; double **al_23; double **al_21; double **eq_21; double **al_46; int ncons_gather_tot; int ncons_gather; int ncons_gather_max; int *ind_gather_fwd; int *ind_gather_bck; int *ind_gather_scr; } *