decompiled_code:
int __fastcall set_bend_params(__int64 a1, __int64 a2, __int64 a3, const char *a4, unsigned int a5, _DWORD *a6, _QWORD *a7, int *a8, __int64 a9, __int64 a10, unsigned int a11)
{
unsigned int v11; // eax
_DWORD *v13; // r13
int *v15; // r12
__int64 v16; // rbx
int v17; // er8
int v18; // er13
__int64 v19; // rax
const char *v20; // rdi
int v21; // er8
int v22; // er13
int v23; // er14
__int64 v24; // rdx
int v25; // eax
int v26; // eax
const char *v27; // r14
const char *v28; // rbp
bool v29; // zf
int v30; // eax
int v31; // eax
int v32; // er12
int v33; // eax
int v34; // ebx
__int64 v35; // rax
int v36; // eax
int v37; // eax
const char *v38; // r13
const char *v39; // rbp
int v40; // eax
int v41; // eax
int v42; // er12
int v43; // eax
int v44; // ebx
__int64 v45; // rsi
int v46; // eax
int v47; // edx
__int64 v48; // rcx
__int64 v49; // rdi
__int64 v50; // rdx
__int64 v51; // rdx
int v52; // eax
int v53; // ecx
int v54; // eax
__int64 v55; // rax
__int64 v56; // rsi
__int64 v57; // rax
__int64 v58; // rsi
__int64 v59; // rax
__int64 v60; // rsi
int v61; // eax
__int64 v62; // rax
__int64 v63; // rsi
__int64 v64; // rax
__int64 v65; // rsi
const char *v66; // rsi
__int64 v67; // rbp
const char *v68; // rsi
__int64 v69; // rbp
int v70; // eax
int v71; // edx
__int64 v72; // rdx
__int64 v73; // rcx
int v74; // eax
int v75; // edx
__int64 v76; // rdi
__int64 v77; // rax
__int64 v78; // rsi
__int64 v79; // rax
__int64 v80; // rsi
int v82; // [rsp+4h] [rbp-94h]
unsigned int v83; // [rsp+4h] [rbp-94h]
int v84; // [rsp+8h] [rbp-90h]
int v85; // [rsp+Ch] [rbp-8Ch]
int v86; // [rsp+10h] [rbp-88h]
int v87; // [rsp+10h] [rbp-88h]
int v88; // [rsp+10h] [rbp-88h]
int v89; // [rsp+10h] [rbp-88h]
int v90; // [rsp+14h] [rbp-84h]
int v91; // [rsp+14h] [rbp-84h]
int v92; // [rsp+14h] [rbp-84h]
int v93; // [rsp+14h] [rbp-84h]
char *s1; // [rsp+18h] [rbp-80h]
char *s1a; // [rsp+18h] [rbp-80h]
char *s2a; // [rsp+28h] [rbp-70h]
int v99; // [rsp+30h] [rbp-68h]
int v100; // [rsp+30h] [rbp-68h]
char *v101; // [rsp+30h] [rbp-68h]
__int64 v102; // [rsp+38h] [rbp-60h]
int v103; // [rsp+38h] [rbp-60h]
int v105; // [rsp+40h] [rbp-58h]
int v106; // [rsp+44h] [rbp-54h]
__int64 v107; // [rsp+48h] [rbp-50h]
int v108[15]; // [rsp+5Ch] [rbp-3Ch] BYREF

v11 = 1;
v13 = (_DWORD *)(a1 + 216);
v15 = a8;
v16 = a10;
do
{
if ( !*v13 && v13[1] == 1 )
{
v83 = v11;
keyword_miss(a1, a4, a3, v11);
v11 = v83;
}
++v11;
v13 += 53;
}
while ( v11 != 4 );
_isoc99_sscanf(a1 + 274, &LC0, v108);
v82 = v108[0];
if ( *(_DWORD *)(a10 + 64) < v108[0] || v108[0] < 0 )
keyarg_barf(a1, a4, a3, 1LL);
v86 = *(_DWORD *)(*(_QWORD *)(a10 + 8) + 4LL * v82);
if ( v86 > 0 )
v82 = *(_DWORD *)(*(_QWORD *)(a10 + 16) + 4LL * v82);
_isoc99_sscanf(a1 + 486, &LC0, v108);
v84 = v108[0];
if ( *(_DWORD *)(a10 + 64) < v108[0] || v108[0] < 0 )
keyarg_barf(a1, a4, a3, 2LL);
v90 = *(_DWORD *)(*(_QWORD *)(a10 + 8) + 4LL * v84);
if ( v90 > 0 )
v84 = *(_DWORD *)(*(_QWORD *)(a10 + 16) + 4LL * v84);
_isoc99_sscanf(a1 + 698, &LC0, v108);
v85 = v108[0];
if ( *(_DWORD *)(a10 + 64) < v108[0] || v108[0] < 0 )
keyarg_barf(a1, a4, a3, 3LL);
v17 = *(_DWORD *)(*(_QWORD *)(a10 + 8) + 4LL * v85);
if ( v17 > 0 )
v85 = *(_DWORD *)(*(_QWORD *)(a10 + 16) + 4LL * v85);
v99 = v17;
v18 = strcasecmp((const char *)(a1 + 1122), "con");
LODWORD(v19) = strcasecmp((const char *)(a1 + 1122), "off");
v20 = (const char *)(a1 + 1122);
v21 = v99;
if ( v18 )
{
v22 = 3;
if ( (_DWORD)v19 )
{
v22 = 1;
LODWORD(v19) = strcasecmp(v20, "on");
v21 = v99;
if ( (_DWORD)v19 )
{
v22 = 0;
LODWORD(v19) = keyarg_barf(a1, a4, a3, 5LL);
v21 = v99;
}
}
}
else if ( (_DWORD)v19 )
{
LODWORD(v19) = (_DWORD)a6;
if ( (int)a6[1] > 1 )
{
puts("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@");
puts("Constraints not implemented under ");
puts(" path integral dynamics. ");
LABEL_79:
puts("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@");
fflush(stdout);
exit(1);
}
v22 = 2;
}
else
{
v22 = 3;
}
v23 = v21 * v90 * v86;
if ( v23 != 1 )
return v19;
v24 = a7[24];
v87 = *(_DWORD *)(v24 + 4LL * (*a6 + v84));
v91 = *(_DWORD *)(v24 + 4LL * (*a6 + v85));
strcpy(*(char **)(a10 + 168), (const char *)(a7[6] + 50LL * *(int *)(v24 + 4LL * (v82 + *a6))));
strcpy((char *)(*(_QWORD *)(a10 + 168) + 50LL), (const char *)(a7[6] + 50LL * v87));
strcpy((char *)(*(_QWORD *)(a10 + 168) + 100LL), (const char *)(a7[6] + 50LL * v91));
LODWORD(v19) = (unsigned int)strcpy((char *)(*(_QWORD *)(a10 + 168) + 150LL), (const char *)(a1 + 1334));
if ( v22 == 1 )
{
v25 = *(_DWORD *)(a10 + 128);
if ( *a8 > v25 )
{
v54 = v25 + 100;
*(_DWORD *)(a10 + 128) = v54;
v55 = crealloc(*((_QWORD *)a8 + 8) + 4LL, 4LL * v54);
v56 = *(int *)(a10 + 128);
*((_QWORD *)a8 + 8) = v55 - 4;
v57 = crealloc(*((_QWORD *)a8 + 9) + 4LL, 4 * v56);
v58 = *(int *)(a10 + 128);
*((_QWORD *)a8 + 9) = v57 - 4;
v59 = crealloc(*((_QWORD *)a8 + 10) + 4LL, 4 * v58);
v60 = *(int *)(a10 + 128);
*((_QWORD *)a8 + 10) = v59 - 4;
*((_QWORD *)a8 + 11) = crealloc(*((_QWORD *)a8 + 11) + 4LL, 4 * v60) - 4;
}
v26 = a8[1];
v88 = v26;
v100 = v26 + 1;
v102 = *(_QWORD *)(a10 + 152);
v105 = *(_DWORD *)(a10 + 140);
if ( v26 > 0 )
{
v27 = *(const char **)(a10 + 168);
v92 = v26 + 1;
v28 = (const char *)(*(_QWORD *)(a10 + 152) + 300LL);
s1 = (char *)(v27 + 50);
s2a = (char *)(v27 + 150);
while ( 1 )
{
v32 = strcasecmp(v28 - 100, v27);
v33 = strcasecmp(v28 - 100, v27 + 100);
v34 = v33;
if ( v32 )
break;
if ( !strcasecmp(v28 - 50, s1) )
{
if ( !strcasecmp(v28, v27 + 100) )
{
v29 = strcasecmp(v28 + 50, s2a) == 0;
v30 = v92;
if ( v29 )
v30 = v22;
v92 = v30;
}
if ( !v34 )
goto LABEL_39;
}
LABEL_43:
v28 += 200;
if ( v88 == v22 )
{
v15 = a8;
v16 = a10;
if ( v92 <= v105 )
goto LABEL_81;
goto LABEL_85;
}
++v22;
}
if ( v33 || strcasecmp(v28 - 50, s1) )
goto LABEL_43;
LABEL_39:
if ( !strcasecmp(v28, v27) )
{
v29 = strcasecmp(v28 + 50, s2a) == 0;
v31 = v92;
if ( v29 )
v31 = v22;
v92 = v31;
}
goto LABEL_43;
}
if ( v100 > v105 )
{
v92 = v26 + 1;
LABEL_85:
*(_DWORD *)(v16 + 140) = v105 + 100;
*(_QWORD *)(v16 + 152) = crealloc(v102 + 200, 200LL * (v105 + 100)) - 200;
v100 = v15[1] + 1;
LABEL_81:
if ( v92 != v100 )
goto LABEL_82;
v102 = *(_QWORD *)(v16 + 152);
}
v66 = *(const char **)(v16 + 168);
v15[1] = v100;
v67 = 200LL * v100;
strcpy((char *)(v67 + v102), v66);
strcpy((char *)(v67 + *(_QWORD *)(v16 + 152) + 50), (const char *)(*(_QWORD *)(v16 + 168) + 50LL));
strcpy((char *)(v67 + *(_QWORD *)(v16 + 152) + 100), (const char *)(*(_QWORD *)(v16 + 168) + 100LL));
strcpy((char *)(*(_QWORD *)(v16 + 152) + v67 + 150), (const char *)(*(_QWORD *)(v16 + 168) + 150LL));
v92 = v100;
LABEL_82:
v51 = *((_QWORD *)v15 + 8);
v52 = *v15 + 1;
v53 = *a6 + v82;
*v15 = v52;
*(_DWORD *)(v51 + 4LL * v52) = v53;
*(_DWORD *)(*((_QWORD *)v15 + 9) + 4LL * *v15) = *a6 + v84;
*(_DWORD *)(*((_QWORD *)v15 + 10) + 4LL * *v15) = *a6 + v85;
v19 = *((_QWORD *)v15 + 11);
*(_DWORD *)(v19 + 4LL * *v15) = v92;
return v19;
}
if ( v22 != 2 )
{
if ( v22 == 3 )
{
v70 = *(_DWORD *)(a9 + 4);
v71 = *(_DWORD *)(a10 + 136);
if ( v70 >= v71 )
{
v75 = v71 + 100;
v76 = *(_QWORD *)(a9 + 32);
*(_DWORD *)(a10 + 136) = v75;
v77 = crealloc(v76 + 4, 4LL * v75);
v78 = *(int *)(a10 + 136);
*(_QWORD *)(a9 + 32) = v77 - 4;
v79 = crealloc(*(_QWORD *)(a9 + 40) + 4LL, 4 * v78);
v80 = *(int *)(a10 + 136);
*(_QWORD *)(a9 + 40) = v79 - 4;
v72 = crealloc(*(_QWORD *)(a9 + 48) + 4LL, 4 * v80) - 4;
v70 = *(_DWORD *)(a9 + 4);
*(_QWORD *)(a9 + 48) = v72;
}
else
{
v72 = *(_QWORD *)(a9 + 48);
}
v73 = *(_QWORD *)(a9 + 32);
v74 = v70 + 1;
*(_DWORD *)(a9 + 4) = v74;
*(_DWORD *)(v73 + 4LL * v74) = *a6 + v82;
*(_DWORD *)(*(_QWORD *)(a9 + 40) + 4LL * *(int *)(a9 + 4)) = *a6 + v84;
v19 = *(int *)(a9 + 4);
*(_DWORD *)(v72 + 4 * v19) = *a6 + v85;
}
return v19;
}
v35 = (int)(a11 + *(_DWORD *)(a7[12] + 4LL * (int)a5) - 1);
--*(_DWORD *)(a7[18] + 4 * v35);
*(_DWORD *)(a7[20] + 4 * v35) = 1;
v36 = *(_DWORD *)(a10 + 132);
if ( a8[2] >= v36 )
{
v61 = v36 + 100;
*(_DWORD *)(a10 + 132) = v61;
v62 = crealloc(*((_QWORD *)a8 + 12) + 4LL, 4LL * v61);
v63 = *(int *)(a10 + 132);
*((_QWORD *)a8 + 12) = v62 - 4;
v64 = crealloc(*((_QWORD *)a8 + 13) + 4LL, 4 * v63);
v65 = *(int *)(a10 + 132);
*((_QWORD *)a8 + 13) = v64 - 4;
*((_QWORD *)a8 + 15) = crealloc(*((_QWORD *)a8 + 15) + 4LL, 4 * v65) - 4;
}
v37 = a8[3];
v89 = v37;
v103 = v37 + 1;
v107 = *(_QWORD *)(a10 + 160);
v106 = *(_DWORD *)(a10 + 144);
if ( v37 > 0 )
{
v38 = *(const char **)(a10 + 168);
v93 = v37 + 1;
v39 = (const char *)(*(_QWORD *)(a10 + 160) + 300LL);
s1a = (char *)(v38 + 50);
v101 = (char *)(v38 + 150);
while ( 1 )
{
v42 = strcasecmp(v39 - 100, v38);
v43 = strcasecmp(v39 - 100, v38 + 100);
v44 = v43;
if ( v42 )
break;
if ( !strcasecmp(v39 - 50, s1a) )
{
if ( !strcasecmp(v39, v38 + 100) )
{
v29 = strcasecmp(v39 + 50, v101) == 0;
v40 = v93;
if ( v29 )
v40 = v23;
v93 = v40;
}
if ( !v44 )
goto LABEL_63;
}
LABEL_67:
v39 += 200;
if ( v89 == v23 )
{
v15 = a8;
v16 = a10;
if ( v93 <= v106 )
goto LABEL_74;
goto LABEL_88;
}
++v23;
}
if ( v43 || strcasecmp(v39 - 50, s1a) )
goto LABEL_67;
LABEL_63:
if ( !strcasecmp(v39, v38) )
{
v29 = strcasecmp(v39 + 50, v101) == 0;
v41 = v93;
if ( v29 )
v41 = v23;
v93 = v41;
}
goto LABEL_67;
}
if ( v103 <= v106 )
goto LABEL_92;
v93 = v37 + 1;
LABEL_88:
*(_DWORD *)(v16 + 144) = v106 + 100;
*(_QWORD *)(v16 + 160) = crealloc(v107 + 200, 200LL * (v106 + 100)) - 200;
v103 = v15[3] + 1;
LABEL_74:
if ( v93 == v103 )
{
v107 = *(_QWORD *)(v16 + 160);
LABEL_92:
v68 = *(const char **)(v16 + 168);
v15[3] = v103;
v69 = 200LL * v103;
strcpy((char *)(v69 + v107), v68);
strcpy((char *)(v69 + *(_QWORD *)(v16 + 160) + 50), (const char *)(*(_QWORD *)(v16 + 168) + 50LL));
strcpy((char *)(v69 + *(_QWORD *)(v16 + 160) + 100), (const char *)(*(_QWORD *)(v16 + 168) + 100LL));
strcpy((char *)(*(_QWORD *)(v16 + 160) + v69 + 150), (const char *)(*(_QWORD *)(v16 + 168) + 150LL));
v93 = v103;
}
v45 = *((_QWORD *)v15 + 12);
v46 = v15[2] + 1;
v47 = *a6 + v82;
v48 = *((_QWORD *)v15 + 13);
v15[2] = v46;
v49 = *((_QWORD *)v15 + 14);
*(_DWORD *)(v45 + 4LL * v46) = v47;
*(_DWORD *)(v48 + 4LL * v15[2]) = *a6 + v84;
*(_DWORD *)(v49 + 4LL * v15[2]) = *a6 + v85;
*(_DWORD *)(*((_QWORD *)v15 + 15) + 4LL * v15[2]) = v93;
v50 = v15[2];
v19 = a7[32];
if ( *(_DWORD *)(v19 + 4LL * *(int *)(v45 + 4 * v50))
|| *(_DWORD *)(v19 + 4LL * *(int *)(v48 + 4 * v50))
|| (LODWORD(v19) = *(_DWORD *)(v19 + 4LL * *(int *)(v49 + 4 * v50)), (_DWORD)v19) )
{
puts("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@");
puts("Ghost atoms are not permitted in constrained bends");
printf("in molecule index %d in residue index %d in file %s\n", a5, a11, a4);
goto LABEL_79;
}
return v19;
}

canonical_decompiled_code:
int __fastcall func0(__int64 a1, __int64 a2, __int64 a3, const char *a4, unsigned int a5, _DWORD *a6, _QWORD *a7, int *a8, __int64 a9, __int64 a10, unsigned int a11)
{
unsigned int v11; // eax
_DWORD *v13; // r13
int *v15; // r12
__int64 v16; // rbx
int v17; // er8
int v18; // er13
__int64 v19; // rax
const char *v20; // rdi
int v21; // er8
int v22; // er13
int v23; // er14
__int64 v24; // rdx
int v25; // eax
int v26; // eax
const char *v27; // r14
const char *v28; // rbp
bool v29; // zf
int v30; // eax
int v31; // eax
int v32; // er12
int v33; // eax
int v34; // ebx
__int64 v35; // rax
int v36; // eax
int v37; // eax
const char *v38; // r13
const char *v39; // rbp
int v40; // eax
int v41; // eax
int v42; // er12
int v43; // eax
int v44; // ebx
__int64 v45; // rsi
int v46; // eax
int v47; // edx
__int64 v48; // rcx
__int64 v49; // rdi
__int64 v50; // rdx
__int64 v51; // rdx
int v52; // eax
int v53; // ecx
int v54; // eax
__int64 v55; // rax
__int64 v56; // rsi
__int64 v57; // rax
__int64 v58; // rsi
__int64 v59; // rax
__int64 v60; // rsi
int v61; // eax
__int64 v62; // rax
__int64 v63; // rsi
__int64 v64; // rax
__int64 v65; // rsi
const char *v66; // rsi
__int64 v67; // rbp
const char *v68; // rsi
__int64 v69; // rbp
int v70; // eax
int v71; // edx
__int64 v72; // rdx
__int64 v73; // rcx
int v74; // eax
int v75; // edx
__int64 v76; // rdi
__int64 v77; // rax
__int64 v78; // rsi
__int64 v79; // rax
__int64 v80; // rsi
int v82; // [rsp+4h] [rbp-94h]
unsigned int v83; // [rsp+4h] [rbp-94h]
int v84; // [rsp+8h] [rbp-90h]
int v85; // [rsp+Ch] [rbp-8Ch]
int v86; // [rsp+10h] [rbp-88h]
int v87; // [rsp+10h] [rbp-88h]
int v88; // [rsp+10h] [rbp-88h]
int v89; // [rsp+10h] [rbp-88h]
int v90; // [rsp+14h] [rbp-84h]
int v91; // [rsp+14h] [rbp-84h]
int v92; // [rsp+14h] [rbp-84h]
int v93; // [rsp+14h] [rbp-84h]
char *s1; // [rsp+18h] [rbp-80h]
char *s1a; // [rsp+18h] [rbp-80h]
char *s2a; // [rsp+28h] [rbp-70h]
int v99; // [rsp+30h] [rbp-68h]
int v100; // [rsp+30h] [rbp-68h]
char *v101; // [rsp+30h] [rbp-68h]
__int64 v102; // [rsp+38h] [rbp-60h]
int v103; // [rsp+38h] [rbp-60h]
int v105; // [rsp+40h] [rbp-58h]
int v106; // [rsp+44h] [rbp-54h]
__int64 v107; // [rsp+48h] [rbp-50h]
int v108[15]; // [rsp+5Ch] [rbp-3Ch] BYREF

v11 = 1;
v13 = (_DWORD *)(a1 + 216);
v15 = a8;
v16 = a10;
do
{
if ( !*v13 && v13[1] == 1 )
{
v83 = v11;
keyword_miss(a1, a4, a3, v11);
v11 = v83;
}
++v11;
v13 += 53;
}
while ( v11 != 4 );
_isoc99_sscanf(a1 + 274, &LC0, v108);
v82 = v108[0];
if ( *(_DWORD *)(a10 + 64) < v108[0] || v108[0] < 0 )
keyarg_barf(a1, a4, a3, 1LL);
v86 = *(_DWORD *)(*(_QWORD *)(a10 + 8) + 4LL * v82);
if ( v86 > 0 )
v82 = *(_DWORD *)(*(_QWORD *)(a10 + 16) + 4LL * v82);
_isoc99_sscanf(a1 + 486, &LC0, v108);
v84 = v108[0];
if ( *(_DWORD *)(a10 + 64) < v108[0] || v108[0] < 0 )
keyarg_barf(a1, a4, a3, 2LL);
v90 = *(_DWORD *)(*(_QWORD *)(a10 + 8) + 4LL * v84);
if ( v90 > 0 )
v84 = *(_DWORD *)(*(_QWORD *)(a10 + 16) + 4LL * v84);
_isoc99_sscanf(a1 + 698, &LC0, v108);
v85 = v108[0];
if ( *(_DWORD *)(a10 + 64) < v108[0] || v108[0] < 0 )
keyarg_barf(a1, a4, a3, 3LL);
v17 = *(_DWORD *)(*(_QWORD *)(a10 + 8) + 4LL * v85);
if ( v17 > 0 )
v85 = *(_DWORD *)(*(_QWORD *)(a10 + 16) + 4LL * v85);
v99 = v17;
v18 = strcasecmp((const char *)(a1 + 1122), "con");
LODWORD(v19) = strcasecmp((const char *)(a1 + 1122), "off");
v20 = (const char *)(a1 + 1122);
v21 = v99;
if ( v18 )
{
v22 = 3;
if ( (_DWORD)v19 )
{
v22 = 1;
LODWORD(v19) = strcasecmp(v20, "on");
v21 = v99;
if ( (_DWORD)v19 )
{
v22 = 0;
LODWORD(v19) = keyarg_barf(a1, a4, a3, 5LL);
v21 = v99;
}
}
}
else if ( (_DWORD)v19 )
{
LODWORD(v19) = (_DWORD)a6;
if ( (int)a6[1] > 1 )
{
puts("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@");
puts("Constraints not implemented under ");
puts(" path integral dynamics. ");
LABEL_79:
puts("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@");
fflush(stdout);
exit(1);
}
v22 = 2;
}
else
{
v22 = 3;
}
v23 = v21 * v90 * v86;
if ( v23 != 1 )
return v19;
v24 = a7[24];
v87 = *(_DWORD *)(v24 + 4LL * (*a6 + v84));
v91 = *(_DWORD *)(v24 + 4LL * (*a6 + v85));
strcpy(*(char **)(a10 + 168), (const char *)(a7[6] + 50LL * *(int *)(v24 + 4LL * (v82 + *a6))));
strcpy((char *)(*(_QWORD *)(a10 + 168) + 50LL), (const char *)(a7[6] + 50LL * v87));
strcpy((char *)(*(_QWORD *)(a10 + 168) + 100LL), (const char *)(a7[6] + 50LL * v91));
LODWORD(v19) = (unsigned int)strcpy((char *)(*(_QWORD *)(a10 + 168) + 150LL), (const char *)(a1 + 1334));
if ( v22 == 1 )
{
v25 = *(_DWORD *)(a10 + 128);
if ( *a8 > v25 )
{
v54 = v25 + 100;
*(_DWORD *)(a10 + 128) = v54;
v55 = crealloc(*((_QWORD *)a8 + 8) + 4LL, 4LL * v54);
v56 = *(int *)(a10 + 128);
*((_QWORD *)a8 + 8) = v55 - 4;
v57 = crealloc(*((_QWORD *)a8 + 9) + 4LL, 4 * v56);
v58 = *(int *)(a10 + 128);
*((_QWORD *)a8 + 9) = v57 - 4;
v59 = crealloc(*((_QWORD *)a8 + 10) + 4LL, 4 * v58);
v60 = *(int *)(a10 + 128);
*((_QWORD *)a8 + 10) = v59 - 4;
*((_QWORD *)a8 + 11) = crealloc(*((_QWORD *)a8 + 11) + 4LL, 4 * v60) - 4;
}
v26 = a8[1];
v88 = v26;
v100 = v26 + 1;
v102 = *(_QWORD *)(a10 + 152);
v105 = *(_DWORD *)(a10 + 140);
if ( v26 > 0 )
{
v27 = *(const char **)(a10 + 168);
v92 = v26 + 1;
v28 = (const char *)(*(_QWORD *)(a10 + 152) + 300LL);
s1 = (char *)(v27 + 50);
s2a = (char *)(v27 + 150);
while ( 1 )
{
v32 = strcasecmp(v28 - 100, v27);
v33 = strcasecmp(v28 - 100, v27 + 100);
v34 = v33;
if ( v32 )
break;
if ( !strcasecmp(v28 - 50, s1) )
{
if ( !strcasecmp(v28, v27 + 100) )
{
v29 = strcasecmp(v28 + 50, s2a) == 0;
v30 = v92;
if ( v29 )
v30 = v22;
v92 = v30;
}
if ( !v34 )
goto LABEL_39;
}
LABEL_43:
v28 += 200;
if ( v88 == v22 )
{
v15 = a8;
v16 = a10;
if ( v92 <= v105 )
goto LABEL_81;
goto LABEL_85;
}
++v22;
}
if ( v33 || strcasecmp(v28 - 50, s1) )
goto LABEL_43;
LABEL_39:
if ( !strcasecmp(v28, v27) )
{
v29 = strcasecmp(v28 + 50, s2a) == 0;
v31 = v92;
if ( v29 )
v31 = v22;
v92 = v31;
}
goto LABEL_43;
}
if ( v100 > v105 )
{
v92 = v26 + 1;
LABEL_85:
*(_DWORD *)(v16 + 140) = v105 + 100;
*(_QWORD *)(v16 + 152) = crealloc(v102 + 200, 200LL * (v105 + 100)) - 200;
v100 = v15[1] + 1;
LABEL_81:
if ( v92 != v100 )
goto LABEL_82;
v102 = *(_QWORD *)(v16 + 152);
}
v66 = *(const char **)(v16 + 168);
v15[1] = v100;
v67 = 200LL * v100;
strcpy((char *)(v67 + v102), v66);
strcpy((char *)(v67 + *(_QWORD *)(v16 + 152) + 50), (const char *)(*(_QWORD *)(v16 + 168) + 50LL));
strcpy((char *)(v67 + *(_QWORD *)(v16 + 152) + 100), (const char *)(*(_QWORD *)(v16 + 168) + 100LL));
strcpy((char *)(*(_QWORD *)(v16 + 152) + v67 + 150), (const char *)(*(_QWORD *)(v16 + 168) + 150LL));
v92 = v100;
LABEL_82:
v51 = *((_QWORD *)v15 + 8);
v52 = *v15 + 1;
v53 = *a6 + v82;
*v15 = v52;
*(_DWORD *)(v51 + 4LL * v52) = v53;
*(_DWORD *)(*((_QWORD *)v15 + 9) + 4LL * *v15) = *a6 + v84;
*(_DWORD *)(*((_QWORD *)v15 + 10) + 4LL * *v15) = *a6 + v85;
v19 = *((_QWORD *)v15 + 11);
*(_DWORD *)(v19 + 4LL * *v15) = v92;
return v19;
}
if ( v22 != 2 )
{
if ( v22 == 3 )
{
v70 = *(_DWORD *)(a9 + 4);
v71 = *(_DWORD *)(a10 + 136);
if ( v70 >= v71 )
{
v75 = v71 + 100;
v76 = *(_QWORD *)(a9 + 32);
*(_DWORD *)(a10 + 136) = v75;
v77 = crealloc(v76 + 4, 4LL * v75);
v78 = *(int *)(a10 + 136);
*(_QWORD *)(a9 + 32) = v77 - 4;
v79 = crealloc(*(_QWORD *)(a9 + 40) + 4LL, 4 * v78);
v80 = *(int *)(a10 + 136);
*(_QWORD *)(a9 + 40) = v79 - 4;
v72 = crealloc(*(_QWORD *)(a9 + 48) + 4LL, 4 * v80) - 4;
v70 = *(_DWORD *)(a9 + 4);
*(_QWORD *)(a9 + 48) = v72;
}
else
{
v72 = *(_QWORD *)(a9 + 48);
}
v73 = *(_QWORD *)(a9 + 32);
v74 = v70 + 1;
*(_DWORD *)(a9 + 4) = v74;
*(_DWORD *)(v73 + 4LL * v74) = *a6 + v82;
*(_DWORD *)(*(_QWORD *)(a9 + 40) + 4LL * *(int *)(a9 + 4)) = *a6 + v84;
v19 = *(int *)(a9 + 4);
*(_DWORD *)(v72 + 4 * v19) = *a6 + v85;
}
return v19;
}
v35 = (int)(a11 + *(_DWORD *)(a7[12] + 4LL * (int)a5) - 1);
--*(_DWORD *)(a7[18] + 4 * v35);
*(_DWORD *)(a7[20] + 4 * v35) = 1;
v36 = *(_DWORD *)(a10 + 132);
if ( a8[2] >= v36 )
{
v61 = v36 + 100;
*(_DWORD *)(a10 + 132) = v61;
v62 = crealloc(*((_QWORD *)a8 + 12) + 4LL, 4LL * v61);
v63 = *(int *)(a10 + 132);
*((_QWORD *)a8 + 12) = v62 - 4;
v64 = crealloc(*((_QWORD *)a8 + 13) + 4LL, 4 * v63);
v65 = *(int *)(a10 + 132);
*((_QWORD *)a8 + 13) = v64 - 4;
*((_QWORD *)a8 + 15) = crealloc(*((_QWORD *)a8 + 15) + 4LL, 4 * v65) - 4;
}
v37 = a8[3];
v89 = v37;
v103 = v37 + 1;
v107 = *(_QWORD *)(a10 + 160);
v106 = *(_DWORD *)(a10 + 144);
if ( v37 > 0 )
{
v38 = *(const char **)(a10 + 168);
v93 = v37 + 1;
v39 = (const char *)(*(_QWORD *)(a10 + 160) + 300LL);
s1a = (char *)(v38 + 50);
v101 = (char *)(v38 + 150);
while ( 1 )
{
v42 = strcasecmp(v39 - 100, v38);
v43 = strcasecmp(v39 - 100, v38 + 100);
v44 = v43;
if ( v42 )
break;
if ( !strcasecmp(v39 - 50, s1a) )
{
if ( !strcasecmp(v39, v38 + 100) )
{
v29 = strcasecmp(v39 + 50, v101) == 0;
v40 = v93;
if ( v29 )
v40 = v23;
v93 = v40;
}
if ( !v44 )
goto LABEL_63;
}
LABEL_67:
v39 += 200;
if ( v89 == v23 )
{
v15 = a8;
v16 = a10;
if ( v93 <= v106 )
goto LABEL_74;
goto LABEL_88;
}
++v23;
}
if ( v43 || strcasecmp(v39 - 50, s1a) )
goto LABEL_67;
LABEL_63:
if ( !strcasecmp(v39, v38) )
{
v29 = strcasecmp(v39 + 50, v101) == 0;
v41 = v93;
if ( v29 )
v41 = v23;
v93 = v41;
}
goto LABEL_67;
}
if ( v103 <= v106 )
goto LABEL_92;
v93 = v37 + 1;
LABEL_88:
*(_DWORD *)(v16 + 144) = v106 + 100;
*(_QWORD *)(v16 + 160) = crealloc(v107 + 200, 200LL * (v106 + 100)) - 200;
v103 = v15[3] + 1;
LABEL_74:
if ( v93 == v103 )
{
v107 = *(_QWORD *)(v16 + 160);
LABEL_92:
v68 = *(const char **)(v16 + 168);
v15[3] = v103;
v69 = 200LL * v103;
strcpy((char *)(v69 + v107), v68);
strcpy((char *)(v69 + *(_QWORD *)(v16 + 160) + 50), (const char *)(*(_QWORD *)(v16 + 168) + 50LL));
strcpy((char *)(v69 + *(_QWORD *)(v16 + 160) + 100), (const char *)(*(_QWORD *)(v16 + 168) + 100LL));
strcpy((char *)(*(_QWORD *)(v16 + 160) + v69 + 150), (const char *)(*(_QWORD *)(v16 + 168) + 150LL));
v93 = v103;
}
v45 = *((_QWORD *)v15 + 12);
v46 = v15[2] + 1;
v47 = *a6 + v82;
v48 = *((_QWORD *)v15 + 13);
v15[2] = v46;
v49 = *((_QWORD *)v15 + 14);
*(_DWORD *)(v45 + 4LL * v46) = v47;
*(_DWORD *)(v48 + 4LL * v15[2]) = *a6 + v84;
*(_DWORD *)(v49 + 4LL * v15[2]) = *a6 + v85;
*(_DWORD *)(*((_QWORD *)v15 + 15) + 4LL * v15[2]) = v93;
v50 = v15[2];
v19 = a7[32];
if ( *(_DWORD *)(v19 + 4LL * *(int *)(v45 + 4 * v50))
|| *(_DWORD *)(v19 + 4LL * *(int *)(v48 + 4 * v50))
|| (LODWORD(v19) = *(_DWORD *)(v19 + 4LL * *(int *)(v49 + 4 * v50)), (_DWORD)v19) )
{
puts("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@");
puts("Ghost atoms are not permitted in constrained bends");
printf("in molecule index %d in residue index %d in file %s\n", a5, a11, a4);
goto LABEL_79;
}
return v19;
}

original_code:
void set_bend_params(DICT_WORD intra_dict[],int num_intra_dict,
       char *fun_key,char *file_name,int jmol_typ,
       CLATOMS_INFO *clatoms_info,ATOMMAPS *atommaps,
       BEND *bend,NULL_INTER_PARSE *null_inter_parse,
       BUILD_INTRA *build_intra, int iresidue, int ires_off)
{
  int num,index,ifound,igo;
  int itype1,itype2,itype3;
  int iatm_ind1,iatm_ind2,iatm_ind3;
  int imask1,imask2,imask3;
  int i,itype;
  for(i=1;i<=3;i++){
    if(intra_dict[i].iuset==0 && intra_dict[i].key_type==1){
      keyword_miss(intra_dict,file_name,fun_key,i);
    }
  }
  index = 1;
  sscanf(intra_dict[1].keyarg,"%d",&num);
  iatm_ind1 = num;
  if(iatm_ind1>build_intra->natmind_1res_now||iatm_ind1<0){
    keyarg_barf(intra_dict,file_name,fun_key,index);
  }
  imask1 = build_intra->mask_atm[iatm_ind1];
  if(imask1>0)iatm_ind1 = build_intra->index_atm[iatm_ind1];
  index = 2;
  sscanf(intra_dict[2].keyarg,"%d",&num);
  iatm_ind2 = num;
  if(iatm_ind2>build_intra->natmind_1res_now||iatm_ind2<0){
    keyarg_barf(intra_dict,file_name,fun_key,index);
  }
  imask2 = build_intra->mask_atm[iatm_ind2];
  if(imask2>0)iatm_ind2 = build_intra->index_atm[iatm_ind2];
  index = 3;
  sscanf(intra_dict[3].keyarg,"%d",&num);
  iatm_ind3 = num;
  if(iatm_ind3>build_intra->natmind_1res_now||iatm_ind3<0){
            keyarg_barf(intra_dict,file_name,fun_key,index);}
  imask3 = build_intra->mask_atm[iatm_ind3];
  if(imask3>0)iatm_ind3 = build_intra->index_atm[iatm_ind3];
  index = 5;
  ifound = 0;
  if(strcasecmp(intra_dict[5].keyarg,"on")==0) {ifound = 1;}
  if(strcasecmp(intra_dict[5].keyarg,"con")==0){ifound = 2;}
  if(strcasecmp(intra_dict[5].keyarg,"off")==0){ifound = 3;}
  if(ifound==0){
    keyarg_barf(intra_dict,file_name,fun_key,index);
  }
  if(ifound == 2 && clatoms_info->pi_beads>1){
        printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
        printf("Constraints not implemented under  \n");
        printf(" path integral dynamics.            \n");
        printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
        fflush(stdout);
        exit(1);
  }
  igo = imask1*imask2*imask3;
  if(igo==1){
    itype1 = atommaps->iatm_atm_typ[(clatoms_info->natm_tot+iatm_ind1)];
    itype2 = atommaps->iatm_atm_typ[(clatoms_info->natm_tot+iatm_ind2)];
    itype3 = atommaps->iatm_atm_typ[(clatoms_info->natm_tot+iatm_ind3)];
    strcpy(build_intra->cbend_typ_now->atm1,atommaps->atm_typ[itype1]);
    strcpy(build_intra->cbend_typ_now->atm2,atommaps->atm_typ[itype2]);
    strcpy(build_intra->cbend_typ_now->atm3,atommaps->atm_typ[itype3]);
    strcpy(build_intra->cbend_typ_now->label,intra_dict[6].keyarg);
  }
  if(ifound==1&&igo==1){
    if(bend->npow > build_intra->nbend_pow_max){
      build_intra->nbend_pow_max += 100;
      bend->j1_pow =(int*)crealloc(&(bend->j1_pow)[1],
       build_intra->nbend_pow_max*sizeof(int))-1;
      bend->j2_pow =(int*)crealloc(&(bend->j2_pow)[1],
       build_intra->nbend_pow_max*sizeof(int))-1;
      bend->j3_pow =(int*)crealloc(&(bend->j3_pow)[1],
       build_intra->nbend_pow_max*sizeof(int))-1;
      bend->jtyp_pow=(int*)crealloc(&(bend->jtyp_pow)[1],
        build_intra->nbend_pow_max*sizeof(int))-1;
    }
    itype = bend->ntyp_pow+1;
    for(i=1;i<=bend->ntyp_pow;i++){
      if((strcasecmp(build_intra->cbend_typ_pow[i].atm1,
       build_intra->cbend_typ_now->atm1)==0)
         &&(strcasecmp(build_intra->cbend_typ_pow[i].atm2,
         build_intra->cbend_typ_now->atm2)==0)
         &&(strcasecmp(build_intra->cbend_typ_pow[i].atm3,
         build_intra->cbend_typ_now->atm3)==0)
  &&(strcasecmp(build_intra->cbend_typ_pow[i].label,
         build_intra->cbend_typ_now->label)==0)) {itype=i;}
      if((strcasecmp(build_intra->cbend_typ_pow[i].atm1,
       build_intra->cbend_typ_now->atm3)==0)
         &&(strcasecmp(build_intra->cbend_typ_pow[i].atm2,
         build_intra->cbend_typ_now->atm2)==0)
         &&(strcasecmp(build_intra->cbend_typ_pow[i].atm3,
         build_intra->cbend_typ_now->atm1)==0)
  &&(strcasecmp(build_intra->cbend_typ_pow[i].label,
         build_intra->cbend_typ_now->label)==0)) {itype=i;}
    }
    if(itype>build_intra->nbend_typ_pow_max){
      build_intra->nbend_typ_pow_max += 100;
      build_intra->cbend_typ_pow =
 (CBEND *) crealloc(&build_intra->cbend_typ_pow[1],
      build_intra->nbend_typ_pow_max*sizeof(CBEND))-1;
    }
    if(itype==bend->ntyp_pow+1){
      bend->ntyp_pow++;
      strcpy(build_intra->cbend_typ_pow[itype].atm1,
      build_intra->cbend_typ_now->atm1);
      strcpy(build_intra->cbend_typ_pow[itype].atm2,
      build_intra->cbend_typ_now->atm2);
      strcpy(build_intra->cbend_typ_pow[itype].atm3,
      build_intra->cbend_typ_now->atm3);
      strcpy(build_intra->cbend_typ_pow[itype].label,
      build_intra->cbend_typ_now->label);
    }
    bend->npow += 1;
    bend->j1_pow[bend->npow] = iatm_ind1 + clatoms_info->natm_tot;
    bend->j2_pow[bend->npow] = iatm_ind2 + clatoms_info->natm_tot;
    bend->j3_pow[bend->npow] = iatm_ind3 + clatoms_info->natm_tot;
    bend->jtyp_pow[bend->npow] = itype;
  }
  if(ifound==2&&igo==1){
    ires_off = atommaps->jres_jmol_typ_strt[jmol_typ]-1;
    atommaps->nfree_jres_jmol_typ[ires_off+iresidue] -= 1;
    atommaps->icons_jres_jmol_typ[ires_off+iresidue] = 1;
    if(bend->ncon+1 > build_intra->nbend_con_max){
      build_intra->nbend_con_max += 100;
      bend->j1_con = (int *)crealloc(&(bend->j1_con)[1],
         build_intra->nbend_con_max*sizeof(int))-1;
      bend->j2_con = (int *)crealloc(&(bend->j2_con)[1],
         build_intra->nbend_con_max*sizeof(int))-1;
      bend->jtyp_con=(int *)crealloc(&(bend->jtyp_con)[1],
         build_intra->nbend_con_max*sizeof(int))-1;
    }
    itype = (bend->ntyp_con)+1;
    for(i=1;i<=bend->ntyp_con;i++){
      if((strcasecmp(build_intra->cbend_typ_con[i].atm1,
       build_intra->cbend_typ_now->atm1)==0)
         &&(strcasecmp(build_intra->cbend_typ_con[i].atm2,
         build_intra->cbend_typ_now->atm2)==0)
         &&(strcasecmp(build_intra->cbend_typ_con[i].atm3,
         build_intra->cbend_typ_now->atm3)==0)
  &&(strcasecmp(build_intra->cbend_typ_con[i].label,
         build_intra->cbend_typ_now->label)==0)) {itype=i;}
      if((strcasecmp(build_intra->cbend_typ_con[i].atm1,
       build_intra->cbend_typ_now->atm3)==0)
         &&(strcasecmp(build_intra->cbend_typ_con[i].atm2,
         build_intra->cbend_typ_now->atm2)==0)
         &&(strcasecmp(build_intra->cbend_typ_con[i].atm3,
         build_intra->cbend_typ_now->atm1)==0)
  &&(strcasecmp(build_intra->cbend_typ_con[i].label,
         build_intra->cbend_typ_now->label)==0)) {itype=i;}
    }
    if(itype>build_intra->nbend_typ_con_max){
      build_intra->nbend_typ_con_max += 100;
      build_intra->cbend_typ_con = (CBEND *)
 crealloc(&(build_intra->cbend_typ_con[1]),
   build_intra->nbend_typ_con_max*sizeof(CBEND))-1;
    }
    if(itype==(bend->ntyp_con)+1){
      bend->ntyp_con+=1;
      strcpy(build_intra->cbend_typ_con[itype].atm1,
      build_intra->cbend_typ_now->atm1);
      strcpy(build_intra->cbend_typ_con[itype].atm2,
      build_intra->cbend_typ_now->atm2);
      strcpy(build_intra->cbend_typ_con[itype].atm3,
      build_intra->cbend_typ_now->atm3);
      strcpy(build_intra->cbend_typ_con[itype].label,
      build_intra->cbend_typ_now->label);
    }
    bend->ncon += 1;
    bend->j1_con[bend->ncon] = iatm_ind1 + clatoms_info->natm_tot;
    bend->j2_con[bend->ncon] = iatm_ind2 + clatoms_info->natm_tot;
    bend->j3_con[bend->ncon] = iatm_ind3 + clatoms_info->natm_tot;
    bend->jtyp_con[bend->ncon] = itype;
    if((atommaps->ighost_flag[bend->j1_con[bend->ncon]]!=0)||
       (atommaps->ighost_flag[bend->j2_con[bend->ncon]]!=0)||
       (atommaps->ighost_flag[bend->j3_con[bend->ncon]]!=0)){
        printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
        printf("Ghost atoms are not permitted in constrained bends\n");
        printf("in molecule index %d in residue index %d in file %s\n",
                jmol_typ,iresidue,file_name);
        printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
        fflush(stdout);
        exit(1);
    }
  }
  if(ifound==3&&igo==1){
    if(null_inter_parse->nbend_nul+1 > build_intra->nbend_nul_max){
      build_intra->nbend_nul_max += 100;
      null_inter_parse->jbend1_nul =
 (int *) crealloc(&(null_inter_parse->jbend1_nul)[1],
    build_intra->nbend_nul_max*sizeof(int))-1;
      null_inter_parse->jbend2_nul =
 (int *) crealloc(&(null_inter_parse->jbend2_nul)[1],
    build_intra->nbend_nul_max*sizeof(int))-1;
      null_inter_parse->jbend3_nul =
 (int *) crealloc(&(null_inter_parse->jbend3_nul)[1],
    build_intra->nbend_nul_max*sizeof(int))-1;
    }
    null_inter_parse->nbend_nul += 1;
    (null_inter_parse->jbend1_nul)[(null_inter_parse->nbend_nul)] =
                       iatm_ind1 + clatoms_info->natm_tot;
    (null_inter_parse->jbend2_nul)[(null_inter_parse->nbend_nul)] =
                              iatm_ind2 + clatoms_info->natm_tot;
    (null_inter_parse->jbend3_nul)[(null_inter_parse->nbend_nul)] =
                              iatm_ind3 + clatoms_info->natm_tot;
  }
}

canonical_original_code:
void set_bend_params(struct dict_word intra_dict[], int num_intra_dict, char *fun_key, char *file_name, int jmol_typ, struct clatoms_info *clatoms_info, struct atommaps *atommaps, struct bend *bend, struct null_inter_parse *null_inter_parse, struct build_intra *build_intra, int iresidue, int ires_off)
{
  int num; int index; int ifound; int igo;
  int itype1; int itype2; int itype3;
  int iatm_ind1; int iatm_ind2; int iatm_ind3;
  int imask1; int imask2; int imask3;
  int i; int itype;
  for(i=1;i<=3;i++){
    if(intra_dict[i].iuset==0 && intra_dict[i].key_type==1){
      keyword_miss(intra_dict,file_name,fun_key,i);
    }
  }
  index = 1;
  sscanf(intra_dict[1].keyarg,"%d",&num);
  iatm_ind1 = num;
  if(iatm_ind1>build_intra->natmind_1res_now||iatm_ind1<0){
    keyarg_barf(intra_dict,file_name,fun_key,index);
  }
  imask1 = build_intra->mask_atm[iatm_ind1];
  if(imask1>0)iatm_ind1 = build_intra->index_atm[iatm_ind1];
  index = 2;
  sscanf(intra_dict[2].keyarg,"%d",&num);
  iatm_ind2 = num;
  if(iatm_ind2>build_intra->natmind_1res_now||iatm_ind2<0){
    keyarg_barf(intra_dict,file_name,fun_key,index);
  }
  imask2 = build_intra->mask_atm[iatm_ind2];
  if(imask2>0)iatm_ind2 = build_intra->index_atm[iatm_ind2];
  index = 3;
  sscanf(intra_dict[3].keyarg,"%d",&num);
  iatm_ind3 = num;
  if(iatm_ind3>build_intra->natmind_1res_now||iatm_ind3<0){
            keyarg_barf(intra_dict,file_name,fun_key,index);}
  imask3 = build_intra->mask_atm[iatm_ind3];
  if(imask3>0)iatm_ind3 = build_intra->index_atm[iatm_ind3];
  index = 5;
  ifound = 0;
  if(strcasecmp(intra_dict[5].keyarg,"on")==0) {ifound = 1;}
  if(strcasecmp(intra_dict[5].keyarg,"con")==0){ifound = 2;}
  if(strcasecmp(intra_dict[5].keyarg,"off")==0){ifound = 3;}
  if(ifound==0){
    keyarg_barf(intra_dict,file_name,fun_key,index);
  }
  if(ifound == 2 && clatoms_info->pi_beads>1){
        printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
        printf("Constraints not implemented under  \n");
        printf(" path integral dynamics.            \n");
        printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
        fflush(stdout);
        exit(1);
  }
  igo = imask1*imask2*imask3;
  if(igo==1){
    itype1 = atommaps->iatm_atm_typ[(clatoms_info->natm_tot+iatm_ind1)];
    itype2 = atommaps->iatm_atm_typ[(clatoms_info->natm_tot+iatm_ind2)];
    itype3 = atommaps->iatm_atm_typ[(clatoms_info->natm_tot+iatm_ind3)];
    strcpy(build_intra->cbend_typ_now->atm1,atommaps->atm_typ[itype1]);
    strcpy(build_intra->cbend_typ_now->atm2,atommaps->atm_typ[itype2]);
    strcpy(build_intra->cbend_typ_now->atm3,atommaps->atm_typ[itype3]);
    strcpy(build_intra->cbend_typ_now->label,intra_dict[6].keyarg);
  }
  if(ifound==1&&igo==1){
    if(bend->npow > build_intra->nbend_pow_max){
      build_intra->nbend_pow_max += 100;
      bend->j1_pow =(int *)crealloc(&(bend->j1_pow)[1],
       build_intra->nbend_pow_max*sizeof(int))-1;
      bend->j2_pow =(int *)crealloc(&(bend->j2_pow)[1],
       build_intra->nbend_pow_max*sizeof(int))-1;
      bend->j3_pow =(int *)crealloc(&(bend->j3_pow)[1],
       build_intra->nbend_pow_max*sizeof(int))-1;
      bend->jtyp_pow=(int *)crealloc(&(bend->jtyp_pow)[1],
        build_intra->nbend_pow_max*sizeof(int))-1;
    }
    itype = bend->ntyp_pow+1;
    for(i=1;i<=bend->ntyp_pow;i++){
      if((strcasecmp(build_intra->cbend_typ_pow[i].atm1,
       build_intra->cbend_typ_now->atm1)==0)
         &&(strcasecmp(build_intra->cbend_typ_pow[i].atm2,
         build_intra->cbend_typ_now->atm2)==0)
         &&(strcasecmp(build_intra->cbend_typ_pow[i].atm3,
         build_intra->cbend_typ_now->atm3)==0)
  &&(strcasecmp(build_intra->cbend_typ_pow[i].label,
         build_intra->cbend_typ_now->label)==0)) {itype=i;}
      if((strcasecmp(build_intra->cbend_typ_pow[i].atm1,
       build_intra->cbend_typ_now->atm3)==0)
         &&(strcasecmp(build_intra->cbend_typ_pow[i].atm2,
         build_intra->cbend_typ_now->atm2)==0)
         &&(strcasecmp(build_intra->cbend_typ_pow[i].atm3,
         build_intra->cbend_typ_now->atm1)==0)
  &&(strcasecmp(build_intra->cbend_typ_pow[i].label,
         build_intra->cbend_typ_now->label)==0)) {itype=i;}
    }
    if(itype>build_intra->nbend_typ_pow_max){
      build_intra->nbend_typ_pow_max += 100;
      build_intra->cbend_typ_pow =
 (struct CBEND *) crealloc(&build_intra->cbend_typ_pow[1],
      build_intra->nbend_typ_pow_max*sizeof(CBEND))-1;
    }
    if(itype==bend->ntyp_pow+1){
      bend->ntyp_pow++;
      strcpy(build_intra->cbend_typ_pow[itype].atm1,
      build_intra->cbend_typ_now->atm1);
      strcpy(build_intra->cbend_typ_pow[itype].atm2,
      build_intra->cbend_typ_now->atm2);
      strcpy(build_intra->cbend_typ_pow[itype].atm3,
      build_intra->cbend_typ_now->atm3);
      strcpy(build_intra->cbend_typ_pow[itype].label,
      build_intra->cbend_typ_now->label);
    }
    bend->npow += 1;
    bend->j1_pow[bend->npow] = iatm_ind1 + clatoms_info->natm_tot;
    bend->j2_pow[bend->npow] = iatm_ind2 + clatoms_info->natm_tot;
    bend->j3_pow[bend->npow] = iatm_ind3 + clatoms_info->natm_tot;
    bend->jtyp_pow[bend->npow] = itype;
  }
  if(ifound==2&&igo==1){
    ires_off = atommaps->jres_jmol_typ_strt[jmol_typ]-1;
    atommaps->nfree_jres_jmol_typ[ires_off+iresidue] -= 1;
    atommaps->icons_jres_jmol_typ[ires_off+iresidue] = 1;
    if(bend->ncon+1 > build_intra->nbend_con_max){
      build_intra->nbend_con_max += 100;
      bend->j1_con = (int *)crealloc(&(bend->j1_con)[1],
         build_intra->nbend_con_max*sizeof(int))-1;
      bend->j2_con = (int *)crealloc(&(bend->j2_con)[1],
         build_intra->nbend_con_max*sizeof(int))-1;
      bend->jtyp_con=(int *)crealloc(&(bend->jtyp_con)[1],
         build_intra->nbend_con_max*sizeof(int))-1;
    }
    itype = (bend->ntyp_con)+1;
    for(i=1;i<=bend->ntyp_con;i++){
      if((strcasecmp(build_intra->cbend_typ_con[i].atm1,
       build_intra->cbend_typ_now->atm1)==0)
         &&(strcasecmp(build_intra->cbend_typ_con[i].atm2,
         build_intra->cbend_typ_now->atm2)==0)
         &&(strcasecmp(build_intra->cbend_typ_con[i].atm3,
         build_intra->cbend_typ_now->atm3)==0)
  &&(strcasecmp(build_intra->cbend_typ_con[i].label,
         build_intra->cbend_typ_now->label)==0)) {itype=i;}
      if((strcasecmp(build_intra->cbend_typ_con[i].atm1,
       build_intra->cbend_typ_now->atm3)==0)
         &&(strcasecmp(build_intra->cbend_typ_con[i].atm2,
         build_intra->cbend_typ_now->atm2)==0)
         &&(strcasecmp(build_intra->cbend_typ_con[i].atm3,
         build_intra->cbend_typ_now->atm1)==0)
  &&(strcasecmp(build_intra->cbend_typ_con[i].label,
         build_intra->cbend_typ_now->label)==0)) {itype=i;}
    }
    if(itype>build_intra->nbend_typ_con_max){
      build_intra->nbend_typ_con_max += 100;
      build_intra->cbend_typ_con = (struct CBEND *)
 crealloc(&(build_intra->cbend_typ_con[1]),
   build_intra->nbend_typ_con_max*sizeof(CBEND))-1;
    }
    if(itype==(bend->ntyp_con)+1){
      bend->ntyp_con+=1;
      strcpy(build_intra->cbend_typ_con[itype].atm1,
      build_intra->cbend_typ_now->atm1);
      strcpy(build_intra->cbend_typ_con[itype].atm2,
      build_intra->cbend_typ_now->atm2);
      strcpy(build_intra->cbend_typ_con[itype].atm3,
      build_intra->cbend_typ_now->atm3);
      strcpy(build_intra->cbend_typ_con[itype].label,
      build_intra->cbend_typ_now->label);
    }
    bend->ncon += 1;
    bend->j1_con[bend->ncon] = iatm_ind1 + clatoms_info->natm_tot;
    bend->j2_con[bend->ncon] = iatm_ind2 + clatoms_info->natm_tot;
    bend->j3_con[bend->ncon] = iatm_ind3 + clatoms_info->natm_tot;
    bend->jtyp_con[bend->ncon] = itype;
    if((atommaps->ighost_flag[bend->j1_con[bend->ncon]]!=0)||
       (atommaps->ighost_flag[bend->j2_con[bend->ncon]]!=0)||
       (atommaps->ighost_flag[bend->j3_con[bend->ncon]]!=0)){
        printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
        printf("Ghost atoms are not permitted in constrained bends\n");
        printf("in molecule index %d in residue index %d in file %s\n",
                jmol_typ,iresidue,file_name);
        printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
        fflush(stdout);
        exit(1);
    }
  }
  if(ifound==3&&igo==1){
    if(null_inter_parse->nbend_nul+1 > build_intra->nbend_nul_max){
      build_intra->nbend_nul_max += 100;
      null_inter_parse->jbend1_nul =
 (int *) crealloc(&(null_inter_parse->jbend1_nul)[1],
    build_intra->nbend_nul_max*sizeof(int))-1;
      null_inter_parse->jbend2_nul =
 (int *) crealloc(&(null_inter_parse->jbend2_nul)[1],
    build_intra->nbend_nul_max*sizeof(int))-1;
      null_inter_parse->jbend3_nul =
 (int *) crealloc(&(null_inter_parse->jbend3_nul)[1],
    build_intra->nbend_nul_max*sizeof(int))-1;
    }
    null_inter_parse->nbend_nul += 1;
    (null_inter_parse->jbend1_nul)[(null_inter_parse->nbend_nul)] =
                       iatm_ind1 + clatoms_info->natm_tot;
    (null_inter_parse->jbend2_nul)[(null_inter_parse->nbend_nul)] =
                              iatm_ind2 + clatoms_info->natm_tot;
    (null_inter_parse->jbend3_nul)[(null_inter_parse->nbend_nul)] =
                              iatm_ind3 + clatoms_info->natm_tot;
  }
}

variable_types: struct dict_word { int iflag; char keyword[50]; char error_mes[100]; } []

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 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 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 null_inter_parse { int nbond_nul; int ntors_nul; int *jbond1_nul; int *jbend1_nul; int *jtors1_nul; int *jonfo1_nul; } *

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

variable_types: num int

variable_types: index int

variable_types: ifound int

variable_types: igo int

variable_types: itype int

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


repo: TuckermanGroup/PINY

variable_types:
hmat
double *

variable_types:
a
double *

variable_types:
b
double *

variable_types:
c
double *

variable_types:
tab
double *

variable_types:
tbc
double *

variable_types:
tac
double *

variable_types: tpi double

return_type: void


original_code:
void getdeth_avg(double *hmat,double *vol)
{
  (*vol) = (hmat[1]*(hmat[5]*hmat[9]-hmat[6]*hmat[8]) +
     hmat[2]*(hmat[6]*hmat[7]-hmat[4]*hmat[9]) +
     hmat[3]*(hmat[4]*hmat[8]-hmat[5]*hmat[7]));
}

canonical_original_code:
void getdeth_avg(double *hmat, double *vol)
{
  (*vol) = (hmat[1]*(hmat[5]*hmat[9]-hmat[6]*hmat[8]) +
     hmat[2]*(hmat[6]*hmat[7]-hmat[4]*hmat[9]) +
     hmat[3]*(hmat[4]*hmat[8]-hmat[5]*hmat[7]));
}

variable_types:
vol
double *


original_code:
void force_nolst(CLATOMS_INFO *clatoms_info,CLATOMS_POS *clatoms_pos,
                 FOR_SCR *for_scr,ATOMMAPS *atommaps,
                 CELL *cell,PTENS *ptens,INTERACT *interact,
                 ENERGY_CTRL *energy_ctrl, NBR_LIST *nbr_list, EXCL *excl,
                 INTRA_SCR *intra_scr, double *vreal,double *vvdw,
                 double *vcoul,CLASS_COMM_FORC_PKG *class_comm_forc_pkg)
{
  int ipart, jpart;
  int intact_tot;
  int intact_save;
  int num_call;
  int num_call_save;
  int lower,upper;
  int ifor_call;
  int intact_now;
  int jind_off;
  int nlen,natm_tot;
  int excl_nlst = excl->nlst;
  int lst_typ=1;
  int nskip,ipart_st;
  int *for_scr_intact = &(for_scr->intact);
  int *for_scr_num_brk = &(for_scr->num_brk);
  int *for_scr_num_brk_i = for_scr->num_brk_i;
  int *for_scr_i_index = for_scr->i_index;
  int *for_scr_j_index = for_scr->j_index;
  int *for_scr_iexcl = for_scr->iexcl;
  int *excl_j = excl->j;
  int *excl_j_off = excl->j_off;
  int *excl_num = excl->num;
  int myid_forc = class_comm_forc_pkg->myid;
  int np_forc = class_comm_forc_pkg->num_proc;
  ("force evaluation - no list");
  natm_tot = clatoms_info->natm_tot;
  nlen = for_scr->nlen;
  ipart_st = 2+myid_forc;
  nskip = np_forc;
  intact_save = 0;
  for(ipart=ipart_st;ipart<=natm_tot;ipart+=nskip){
    intact_save += (ipart-1-excl_num[ipart]);
  }
  num_call_save = intact_save/(nlen);
  if( (intact_save % (nlen))!=0 ){num_call_save += 1;}
  (*for_scr_intact) = 0;
  (*for_scr_num_brk) = 0;
  num_call = 0;
  intact_tot = 0;
  ipart_st = 2+myid_forc;
  nskip = np_forc;
  for(ipart=ipart_st;ipart<=natm_tot;ipart+=nskip){
    if(excl_nlst!=0){
       for(jpart=1;jpart<=ipart-1;jpart++){
         (for_scr_iexcl)[jpart] = 1;
       }
       lower = (excl_j_off)[ipart]+1;
       upper = (excl_num)[ipart]+(excl_j_off)[ipart];
       for(jpart=lower;jpart<=upper;jpart++){
         (for_scr_iexcl)[(excl_j)[jpart]] = 0;
       }
       intact_now = 0;
       for(jpart=1;jpart<=ipart-1;jpart++){
         if((for_scr_iexcl)[jpart]==1){
              intact_now += 1;
              (for_scr_iexcl)[intact_now] = jpart;
         }
       }
    }else{
       for(jpart=1;jpart<=ipart-1;jpart++){
           for_scr_iexcl[jpart] = jpart;
       }
       intact_now = (ipart-1);
    }
    lower = 1;
    upper = 0;
    while(upper!=intact_now){
      upper = intact_now;
      if(upper-lower+1+(*for_scr_intact)>nlen){
        upper = nlen-(*for_scr_intact)+lower-1;
      }
      jind_off = (*for_scr_intact)-lower+1;
      for(jpart=lower;jpart<=upper;jpart++){
        (for_scr_j_index)[(jpart+jind_off)]=(for_scr_iexcl)[jpart];
        (for_scr_i_index)[(jpart+jind_off)]=ipart;
      }
      (*for_scr_intact) += upper-lower+1;
      (*for_scr_num_brk) += 1;
      (for_scr_num_brk_i)[(*for_scr_num_brk)] = upper-lower+1;
      lower = upper+1;
      ifor_call = 0;
      if(*for_scr_intact == nlen) {ifor_call=1;}
      if( (ipart==(natm_tot))&&
         (upper==intact_now)&&
         ((*for_scr_intact)!=0) ){ifor_call=1;}
      if(ifor_call==1){
        force_npol(clatoms_info,clatoms_pos,
                   for_scr,atommaps,
                   cell,ptens,interact,energy_ctrl,intra_scr,vreal,
                   vvdw,vcoul,num_call,lst_typ);
        num_call += 1;
        intact_tot += (*for_scr_intact);
        (*for_scr_intact) = 0;
        (*for_scr_num_brk) = 0;
      }
    }
  }
  if((*for_scr_intact)!=0){
        force_npol(clatoms_info,clatoms_pos,
                   for_scr,atommaps,
                   cell,ptens,interact,energy_ctrl,intra_scr,vreal,
                   vvdw,vcoul,num_call,lst_typ);
        num_call += 1;
        intact_tot += (*for_scr_intact);
        (*for_scr_intact) = 0;
        (*for_scr_num_brk) = 0;
  }
  if(intact_tot!=intact_save){
    printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
    printf("Internal Error:\n ");
    printf("Incorrect number of interactions calculated\n ");
    printf("   in routine for_nolst \n ");
    printf("%d vs %d \n",intact_tot,intact_save);
    printf("Contact product support \n ");
    printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
    fflush(stdout);
    exit(1);
  }
  if(num_call!=num_call_save){
    printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
    printf("Internal Error:\n ");
    printf("Incorrect number of force calls\n ");
    printf("   in routine for_nolst \n ");
    printf("%d vs %d \n",num_call,num_call_save);
    printf("Contact product support \n ");
    printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
    fflush(stdout);
    exit(1);
  }
  ("force evaluation - no list");
}

canonical_original_code:
void force_nolst(struct clatoms_info *clatoms_info, struct clatoms_pos *clatoms_pos, struct for_scr *for_scr, struct atommaps *atommaps, struct cell *cell, struct ptens *ptens, struct interact *interact, struct energy_ctrl *energy_ctrl, struct nbr_list *nbr_list, struct excl *excl, struct intra_scr *intra_scr, double *vreal, double *vvdw, double *vcoul, struct class_comm_forc_pkg *class_comm_forc_pkg)
{
  int ipart; int jpart;
  int intact_tot;
  int intact_save;
  int num_call;
  int num_call_save;
  int lower; int upper;
  int ifor_call;
  int intact_now;
  int jind_off;
  int nlen; int natm_tot;
  int excl_nlst = excl->nlst;
  int lst_typ = 1;
  int nskip; int ipart_st;
  int *for_scr_intact = &(for_scr->intact);
  int *for_scr_num_brk = &(for_scr->num_brk);
  int *for_scr_num_brk_i = for_scr->num_brk_i;
  int *for_scr_i_index = for_scr->i_index;
  int *for_scr_j_index = for_scr->j_index;
  int *for_scr_iexcl = for_scr->iexcl;
  int *excl_j = excl->j;
  int *excl_j_off = excl->j_off;
  int *excl_num = excl->num;
  int myid_forc = class_comm_forc_pkg->myid;
  int np_forc = class_comm_forc_pkg->num_proc;
  ("force evaluation - no list");
  natm_tot = clatoms_info->natm_tot;
  nlen = for_scr->nlen;
  ipart_st = 2+myid_forc;
  nskip = np_forc;
  intact_save = 0;
  for(ipart=ipart_st;ipart<=natm_tot;ipart+=nskip){
    intact_save += (ipart-1-excl_num[ipart]);
  }
  num_call_save = intact_save/(nlen);
  if( (intact_save % (nlen))!=0 ){num_call_save += 1;}
  (*for_scr_intact) = 0;
  (*for_scr_num_brk) = 0;
  num_call = 0;
  intact_tot = 0;
  ipart_st = 2+myid_forc;
  nskip = np_forc;
  for(ipart=ipart_st;ipart<=natm_tot;ipart+=nskip){
    if(excl_nlst!=0){
       for(jpart=1;jpart<=ipart-1;jpart++){
         (for_scr_iexcl)[jpart] = 1;
       }
       lower = (excl_j_off)[ipart]+1;
       upper = (excl_num)[ipart]+(excl_j_off)[ipart];
       for(jpart=lower;jpart<=upper;jpart++){
         (for_scr_iexcl)[(excl_j)[jpart]] = 0;
       }
       intact_now = 0;
       for(jpart=1;jpart<=ipart-1;jpart++){
         if((for_scr_iexcl)[jpart]==1){
              intact_now += 1;
              (for_scr_iexcl)[intact_now] = jpart;
         }
       }
    }else{
       for(jpart=1;jpart<=ipart-1;jpart++){
           for_scr_iexcl[jpart] = jpart;
       }
       intact_now = (ipart-1);
    }
    lower = 1;
    upper = 0;
    while(upper!=intact_now){
      upper = intact_now;
      if(upper-lower+1+(*for_scr_intact)>nlen){
        upper = nlen-(*for_scr_intact)+lower-1;
      }
      jind_off = (*for_scr_intact)-lower+1;
      for(jpart=lower;jpart<=upper;jpart++){
        (for_scr_j_index)[(jpart+jind_off)]=(for_scr_iexcl)[jpart];
        (for_scr_i_index)[(jpart+jind_off)]=ipart;
      }
      (*for_scr_intact) += upper-lower+1;
      (*for_scr_num_brk) += 1;
      (for_scr_num_brk_i)[(*for_scr_num_brk)] = upper-lower+1;
      lower = upper+1;
      ifor_call = 0;
      if(*for_scr_intact == nlen) {ifor_call=1;}
      if( (ipart==(natm_tot))&&
         (upper==intact_now)&&
         ((*for_scr_intact)!=0) ){ifor_call=1;}
      if(ifor_call==1){
        force_npol(clatoms_info,clatoms_pos,
                   for_scr,atommaps,
                   cell,ptens,interact,energy_ctrl,intra_scr,vreal,
                   vvdw,vcoul,num_call,lst_typ);
        num_call += 1;
        intact_tot += (*for_scr_intact);
        (*for_scr_intact) = 0;
        (*for_scr_num_brk) = 0;
      }
    }
  }
  if((*for_scr_intact)!=0){
        force_npol(clatoms_info,clatoms_pos,
                   for_scr,atommaps,
                   cell,ptens,interact,energy_ctrl,intra_scr,vreal,
                   vvdw,vcoul,num_call,lst_typ);
        num_call += 1;
        intact_tot += (*for_scr_intact);
        (*for_scr_intact) = 0;
        (*for_scr_num_brk) = 0;
  }
  if(intact_tot!=intact_save){
    printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
    printf("Internal Error:\n ");
    printf("Incorrect number of interactions calculated\n ");
    printf("   in routine for_nolst \n ");
    printf("%d vs %d \n",intact_tot,intact_save);
    printf("Contact product support \n ");
    printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
    fflush(stdout);
    exit(1);
  }
  if(num_call!=num_call_save){
    printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
    printf("Internal Error:\n ");
    printf("Incorrect number of force calls\n ");
    printf("   in routine for_nolst \n ");
    printf("%d vs %d \n",num_call,num_call_save);
    printf("Contact product support \n ");
    printf("@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
    fflush(stdout);
    exit(1);
  }
  ("force evaluation - no list");
}

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 clatoms_pos { double *mass; double *x; double *vx; double *fx; double *fxt; double *fxm; double *hess_xx; } *

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

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

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

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 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:
vreal
double *

variable_types:
vvdw
double *

variable_types:
vcoul
double *

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

variable_types: jpart int

variable_types: lower int

variable_types: upper int

variable_types: nlen int

variable_types: nskip int

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

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