DIOdisto

decompiled_code:
__int64 __fastcall DIOdisto(__int64 a1, __int64 a2, double *a3)
{
__int64 result; // rax
_QWORD *v4; // rbx
double v6; // r13
double v7; // rbx
__int64 v8; // rcx
__int64 v9; // rdx
double v10; // rbx
double *v11; // rax
double *v12; // rax
double *v13; // rax
double *v14; // rax
__int64 v15; // r14
double v16; // r13
double v17; // rbx
double v18; // r13
__int64 v19; // rdx
__int64 v20; // rax
double v21; // r13
double v22; // rbx
double v23; // rbx
__int64 v24; // rdx
__int64 v25; // rax
double v26; // r13
double v27; // rbx
double v28; // rbx
double v29; // r13
__int64 v30; // rdx
__int64 v31; // rax
double v32; // xmm6_8
double v33; // rbx
__int64 v34; // rdx
__int64 v35; // rax
_QWORD *v36; // r15
double v37; // [rsp+0h] [rbp-A8h]
double v38; // [rsp+8h] [rbp-A0h]
double v39; // [rsp+8h] [rbp-A0h]
double v40; // [rsp+8h] [rbp-A0h]
double v41; // [rsp+10h] [rbp-98h]
double v42; // [rsp+10h] [rbp-98h]
double v43; // [rsp+10h] [rbp-98h]
double v44; // [rsp+10h] [rbp-98h]
double v45; // [rsp+10h] [rbp-98h]
double v46; // [rsp+18h] [rbp-90h]
double v47; // [rsp+18h] [rbp-90h]
double v48; // [rsp+18h] [rbp-90h]
double v49; // [rsp+18h] [rbp-90h]
double v50; // [rsp+18h] [rbp-90h]
double v51; // [rsp+20h] [rbp-88h]
double v52; // [rsp+20h] [rbp-88h]
double v53; // [rsp+20h] [rbp-88h]
double v54; // [rsp+20h] [rbp-88h]
double v55; // [rsp+20h] [rbp-88h]
double v56; // [rsp+20h] [rbp-88h]
double v57; // [rsp+28h] [rbp-80h]
double v58; // [rsp+28h] [rbp-80h]
double v59; // [rsp+28h] [rbp-80h]
double v60; // [rsp+28h] [rbp-80h]
double v61; // [rsp+28h] [rbp-80h]
double v62; // [rsp+30h] [rbp-78h]
double v63; // [rsp+30h] [rbp-78h]
double v64; // [rsp+30h] [rbp-78h]
double v65; // [rsp+30h] [rbp-78h]
double v66; // [rsp+30h] [rbp-78h]
double v67; // [rsp+30h] [rbp-78h]
double v68; // [rsp+30h] [rbp-78h]
double v69; // [rsp+38h] [rbp-70h]
double v70; // [rsp+38h] [rbp-70h]
double v71; // [rsp+38h] [rbp-70h]
__int64 v72; // [rsp+40h] [rbp-68h]
double v73; // [rsp+48h] [rbp-60h]
double v74; // [rsp+48h] [rbp-60h]
double v75; // [rsp+48h] [rbp-60h]
double v76; // [rsp+50h] [rbp-58h]
double v77; // [rsp+50h] [rbp-58h]
double v78; // [rsp+50h] [rbp-58h]
double v79; // [rsp+58h] [rbp-50h]
double v80; // [rsp+60h] [rbp-48h]
double v81; // [rsp+68h] [rbp-40h]

v72 = a2;
if ( (_DWORD)a1 == 1 )
return DIOdSetup(a2, a3);
result = 7LL;
if ( (unsigned int)(a1 - 4) <= 4 )
{
if ( a2 )
{
v4 = (_QWORD *)*((_QWORD *)a3 + 121);
do
{
if ( *(_QWORD *)(v72 + 16) )
{
v15 = *(_QWORD *)(v72 + 16);
v36 = v4;
do
{
switch ( (int)a1 )
{
case 4:
v6 = *(double *)(v15 + 224);
v51 = *(double *)(v15 + 240);
v7 = *(double *)(v15 + 256);
v8 = *(int *)(v15 + 36);
v9 = *(int *)(v15 + 32);
v41 = *(double *)(v36[12] + 8 * v8) - *(double *)(v36[12] + 8 * v9);
v46 = *(double *)(v36[13] + 8 * v8) - *(double *)(v36[13] + 8 * v9);
v37 = D1n2F1(v6, v41, v46);
v38 = D1i2F1(v6, v41, v46);
v10 = v7 + v51;
if ( v10 != 0.0 )
{
*(_QWORD *)&v52 = *((_QWORD *)a3 + 111) ^ LC1;
v37 = D1i2F1(v10, v41, v46) * v52 + v37;
v16 = a3[111];
v38 = v16 * D1n2F1(v10, v41, v46) + v38;
}
goto LABEL_9;
case 5:
v17 = *(double *)(v15 + 224);
v39 = *(double *)(v15 + 232);
v62 = *(double *)(v15 + 240);
v18 = *(double *)(v15 + 248);
v69 = *(double *)(v15 + 256);
v73 = *(double *)(v15 + 264);
v19 = *(int *)(v15 + 36);
v20 = *(int *)(v15 + 32);
v42 = *(double *)(v36[12] + 8 * v19) - *(double *)(v36[12] + 8 * v20);
v47 = *(double *)(v36[13] + 8 * v19) - *(double *)(v36[13] + 8 * v20);
v53 = *(double *)(v36[14] + 8 * v19) - *(double *)(v36[14] + 8 * v20);
v57 = *(double *)(v36[15] + 8 * v19) - *(double *)(v36[15] + 8 * v20);
v37 = D1n3F1(v17, v39, v42, v47, v53, v57);
v38 = D1i3F1(v17, v39, v42, v47, v53, v57);
v63 = v62 + v69;
if ( v63 != 0.0 )
{
*(_QWORD *)&v70 = *((_QWORD *)a3 + 111) ^ LC1;
v21 = v18 + v73;
v37 = D1i3F1(v63, v21, v42, v47, v53, v57) * v70 + v37;
v22 = a3[111];
v38 = v22 * D1n3F1(v63, v21, v42, v47, v53, v57) + v38;
}
goto LABEL_9;
case 6:
v23 = *(double *)(v15 + 224);
v58 = *(double *)(v15 + 240);
v64 = *(double *)(v15 + 256);
v24 = *(int *)(v15 + 36);
v25 = *(int *)(v15 + 32);
v43 = *(double *)(v36[12] + 8 * v24) - *(double *)(v36[12] + 8 * v25);
v48 = *(double *)(v36[13] + 8 * v24) - *(double *)(v36[13] + 8 * v25);
v54 = *(double *)(v36[18] + 8 * v24) - *(double *)(v36[18] + 8 * v25);
v26 = *(double *)(v36[19] + 8 * v24) - *(double *)(v36[19] + 8 * v25);
v37 = D1nF12(v23, v43, v48, v54, v26);
v38 = D1iF12(v23, v43, v48, v54, v26);
v59 = v58 + v64;
if ( v59 != 0.0 )
{
*(_QWORD *)&v65 = *((_QWORD *)a3 + 111) ^ LC1;
v37 = D1iF12(v59, v43, v48, v54, v26) * v65 + v37;
v27 = a3[111];
v38 = v27 * D1nF12(v59, v43, v48, v54, v26) + v38;
}
goto LABEL_9;
case 7:
v28 = *(double *)(v15 + 224);
v29 = *(double *)(v15 + 240);
v66 = *(double *)(v15 + 256);
v30 = *(int *)(v15 + 36);
v31 = *(int *)(v15 + 32);
v44 = *(double *)(v36[12] + 8 * v30) - *(double *)(v36[12] + 8 * v31);
v49 = *(double *)(v36[13] + 8 * v30) - *(double *)(v36[13] + 8 * v31);
v55 = *(double *)(v36[18] + 8 * v30) - *(double *)(v36[18] + 8 * v31);
*(_QWORD *)&v60 = COERCE_UNSIGNED_INT64(*(double *)(v36[19] + 8 * v30) - *(double *)(v36[19] + 8 * v31)) ^ LC1;
v37 = D1nF12(v28, v44, v49, v55, v60);
v38 = D1iF12(v28, v44, v49, v55, v60);
v32 = v29 + v66;
if ( v29 + v66 != 0.0 )
{
*(_QWORD *)&v67 = *((_QWORD *)a3 + 111) ^ LC1;
v37 = D1iF12(v32, v44, v49, v55, v60) * v67 + v37;
v33 = a3[111];
v38 = v33 * D1nF12(v32, v44, v49, v55, v60) + v38;
}
goto LABEL_9;
case 8:
v40 = *(double *)(v15 + 224);
v74 = *(double *)(v15 + 232);
v76 = *(double *)(v15 + 240);
v80 = *(double *)(v15 + 248);
v79 = *(double *)(v15 + 256);
v81 = *(double *)(v15 + 264);
v34 = *(int *)(v15 + 36);
v35 = *(int *)(v15 + 32);
v45 = *(double *)(v36[12] + 8 * v34) - *(double *)(v36[12] + 8 * v35);
v50 = *(double *)(v36[13] + 8 * v34) - *(double *)(v36[13] + 8 * v35);
v56 = *(double *)(v36[18] + 8 * v34) - *(double *)(v36[18] + 8 * v35);
*(_QWORD *)&v61 = COERCE_UNSIGNED_INT64(*(double *)(v36[19] + 8 * v34) - *(double *)(v36[19] + 8 * v35)) ^ LC1;
v68 = *(double *)(v36[14] + 8 * v34) - *(double *)(v36[14] + 8 * v35);
v71 = *(double *)(v36[15] + 8 * v34) - *(double *)(v36[15] + 8 * v35);
v37 = D1n2F12(v40, v74, v45, v50, v56, v61);
v38 = D1i2F12(v40, v74, v45, v50, v56, v61, v68, v71, a1, a2);
v75 = v76 + v79;
if ( v76 + v79 != 0.0 )
{
*(_QWORD *)&v77 = *((_QWORD *)a3 + 111) ^ LC1;
v37 = D1i2F12(v75, v80 + v81, v45, v50, v56, v61, v68, v71, a1, a2) * v77 + v37;
v78 = a3[111];
v38 = D1n2F12(v75, v80 + v81, v45, v50, v56, v61) * v78 + v38;
}
LABEL_9:
v11 = (double *)(*((_QWORD *)a3 + 66) + 8LL * *(int *)(v15 + 36));
*v11 = *v11 - v37;
v12 = (double *)(*((_QWORD *)a3 + 69) + 8LL * *(int *)(v15 + 36));
*v12 = *v12 - v38;
v13 = (double *)(*((_QWORD *)a3 + 66) + 8LL * *(int *)(v15 + 32));
*v13 = v37 + *v13;
v14 = (double *)(*((_QWORD *)a3 + 69) + 8LL * *(int *)(v15 + 32));
*v14 = v38 + *v14;
break;
default:
break;
}
v15 = *(_QWORD *)(v15 + 8);
}
while ( v15 );
v4 = v36;
}
result = *(_QWORD *)(v72 + 8);
v72 = result;
}
while ( result );
}
else
{
result = 0LL;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, double *a3)
{
__int64 result; // rax
_QWORD *v4; // rbx
double v6; // r13
double v7; // rbx
__int64 v8; // rcx
__int64 v9; // rdx
double v10; // rbx
double *v11; // rax
double *v12; // rax
double *v13; // rax
double *v14; // rax
__int64 v15; // r14
double v16; // r13
double v17; // rbx
double v18; // r13
__int64 v19; // rdx
__int64 v20; // rax
double v21; // r13
double v22; // rbx
double v23; // rbx
__int64 v24; // rdx
__int64 v25; // rax
double v26; // r13
double v27; // rbx
double v28; // rbx
double v29; // r13
__int64 v30; // rdx
__int64 v31; // rax
double v32; // xmm6_8
double v33; // rbx
__int64 v34; // rdx
__int64 v35; // rax
_QWORD *v36; // r15
double v37; // [rsp+0h] [rbp-A8h]
double v38; // [rsp+8h] [rbp-A0h]
double v39; // [rsp+8h] [rbp-A0h]
double v40; // [rsp+8h] [rbp-A0h]
double v41; // [rsp+10h] [rbp-98h]
double v42; // [rsp+10h] [rbp-98h]
double v43; // [rsp+10h] [rbp-98h]
double v44; // [rsp+10h] [rbp-98h]
double v45; // [rsp+10h] [rbp-98h]
double v46; // [rsp+18h] [rbp-90h]
double v47; // [rsp+18h] [rbp-90h]
double v48; // [rsp+18h] [rbp-90h]
double v49; // [rsp+18h] [rbp-90h]
double v50; // [rsp+18h] [rbp-90h]
double v51; // [rsp+20h] [rbp-88h]
double v52; // [rsp+20h] [rbp-88h]
double v53; // [rsp+20h] [rbp-88h]
double v54; // [rsp+20h] [rbp-88h]
double v55; // [rsp+20h] [rbp-88h]
double v56; // [rsp+20h] [rbp-88h]
double v57; // [rsp+28h] [rbp-80h]
double v58; // [rsp+28h] [rbp-80h]
double v59; // [rsp+28h] [rbp-80h]
double v60; // [rsp+28h] [rbp-80h]
double v61; // [rsp+28h] [rbp-80h]
double v62; // [rsp+30h] [rbp-78h]
double v63; // [rsp+30h] [rbp-78h]
double v64; // [rsp+30h] [rbp-78h]
double v65; // [rsp+30h] [rbp-78h]
double v66; // [rsp+30h] [rbp-78h]
double v67; // [rsp+30h] [rbp-78h]
double v68; // [rsp+30h] [rbp-78h]
double v69; // [rsp+38h] [rbp-70h]
double v70; // [rsp+38h] [rbp-70h]
double v71; // [rsp+38h] [rbp-70h]
__int64 v72; // [rsp+40h] [rbp-68h]
double v73; // [rsp+48h] [rbp-60h]
double v74; // [rsp+48h] [rbp-60h]
double v75; // [rsp+48h] [rbp-60h]
double v76; // [rsp+50h] [rbp-58h]
double v77; // [rsp+50h] [rbp-58h]
double v78; // [rsp+50h] [rbp-58h]
double v79; // [rsp+58h] [rbp-50h]
double v80; // [rsp+60h] [rbp-48h]
double v81; // [rsp+68h] [rbp-40h]

v72 = a2;
if ( (_DWORD)a1 == 1 )
return DIOdSetup(a2, a3);
result = 7LL;
if ( (unsigned int)(a1 - 4) <= 4 )
{
if ( a2 )
{
v4 = (_QWORD *)*((_QWORD *)a3 + 121);
do
{
if ( *(_QWORD *)(v72 + 16) )
{
v15 = *(_QWORD *)(v72 + 16);
v36 = v4;
do
{
switch ( (int)a1 )
{
case 4:
v6 = *(double *)(v15 + 224);
v51 = *(double *)(v15 + 240);
v7 = *(double *)(v15 + 256);
v8 = *(int *)(v15 + 36);
v9 = *(int *)(v15 + 32);
v41 = *(double *)(v36[12] + 8 * v8) - *(double *)(v36[12] + 8 * v9);
v46 = *(double *)(v36[13] + 8 * v8) - *(double *)(v36[13] + 8 * v9);
v37 = D1n2F1(v6, v41, v46);
v38 = D1i2F1(v6, v41, v46);
v10 = v7 + v51;
if ( v10 != 0.0 )
{
*(_QWORD *)&v52 = *((_QWORD *)a3 + 111) ^ LC1;
v37 = D1i2F1(v10, v41, v46) * v52 + v37;
v16 = a3[111];
v38 = v16 * D1n2F1(v10, v41, v46) + v38;
}
goto LABEL_9;
case 5:
v17 = *(double *)(v15 + 224);
v39 = *(double *)(v15 + 232);
v62 = *(double *)(v15 + 240);
v18 = *(double *)(v15 + 248);
v69 = *(double *)(v15 + 256);
v73 = *(double *)(v15 + 264);
v19 = *(int *)(v15 + 36);
v20 = *(int *)(v15 + 32);
v42 = *(double *)(v36[12] + 8 * v19) - *(double *)(v36[12] + 8 * v20);
v47 = *(double *)(v36[13] + 8 * v19) - *(double *)(v36[13] + 8 * v20);
v53 = *(double *)(v36[14] + 8 * v19) - *(double *)(v36[14] + 8 * v20);
v57 = *(double *)(v36[15] + 8 * v19) - *(double *)(v36[15] + 8 * v20);
v37 = D1n3F1(v17, v39, v42, v47, v53, v57);
v38 = D1i3F1(v17, v39, v42, v47, v53, v57);
v63 = v62 + v69;
if ( v63 != 0.0 )
{
*(_QWORD *)&v70 = *((_QWORD *)a3 + 111) ^ LC1;
v21 = v18 + v73;
v37 = D1i3F1(v63, v21, v42, v47, v53, v57) * v70 + v37;
v22 = a3[111];
v38 = v22 * D1n3F1(v63, v21, v42, v47, v53, v57) + v38;
}
goto LABEL_9;
case 6:
v23 = *(double *)(v15 + 224);
v58 = *(double *)(v15 + 240);
v64 = *(double *)(v15 + 256);
v24 = *(int *)(v15 + 36);
v25 = *(int *)(v15 + 32);
v43 = *(double *)(v36[12] + 8 * v24) - *(double *)(v36[12] + 8 * v25);
v48 = *(double *)(v36[13] + 8 * v24) - *(double *)(v36[13] + 8 * v25);
v54 = *(double *)(v36[18] + 8 * v24) - *(double *)(v36[18] + 8 * v25);
v26 = *(double *)(v36[19] + 8 * v24) - *(double *)(v36[19] + 8 * v25);
v37 = D1nF12(v23, v43, v48, v54, v26);
v38 = D1iF12(v23, v43, v48, v54, v26);
v59 = v58 + v64;
if ( v59 != 0.0 )
{
*(_QWORD *)&v65 = *((_QWORD *)a3 + 111) ^ LC1;
v37 = D1iF12(v59, v43, v48, v54, v26) * v65 + v37;
v27 = a3[111];
v38 = v27 * D1nF12(v59, v43, v48, v54, v26) + v38;
}
goto LABEL_9;
case 7:
v28 = *(double *)(v15 + 224);
v29 = *(double *)(v15 + 240);
v66 = *(double *)(v15 + 256);
v30 = *(int *)(v15 + 36);
v31 = *(int *)(v15 + 32);
v44 = *(double *)(v36[12] + 8 * v30) - *(double *)(v36[12] + 8 * v31);
v49 = *(double *)(v36[13] + 8 * v30) - *(double *)(v36[13] + 8 * v31);
v55 = *(double *)(v36[18] + 8 * v30) - *(double *)(v36[18] + 8 * v31);
*(_QWORD *)&v60 = COERCE_UNSIGNED_INT64(*(double *)(v36[19] + 8 * v30) - *(double *)(v36[19] + 8 * v31)) ^ LC1;
v37 = D1nF12(v28, v44, v49, v55, v60);
v38 = D1iF12(v28, v44, v49, v55, v60);
v32 = v29 + v66;
if ( v29 + v66 != 0.0 )
{
*(_QWORD *)&v67 = *((_QWORD *)a3 + 111) ^ LC1;
v37 = D1iF12(v32, v44, v49, v55, v60) * v67 + v37;
v33 = a3[111];
v38 = v33 * D1nF12(v32, v44, v49, v55, v60) + v38;
}
goto LABEL_9;
case 8:
v40 = *(double *)(v15 + 224);
v74 = *(double *)(v15 + 232);
v76 = *(double *)(v15 + 240);
v80 = *(double *)(v15 + 248);
v79 = *(double *)(v15 + 256);
v81 = *(double *)(v15 + 264);
v34 = *(int *)(v15 + 36);
v35 = *(int *)(v15 + 32);
v45 = *(double *)(v36[12] + 8 * v34) - *(double *)(v36[12] + 8 * v35);
v50 = *(double *)(v36[13] + 8 * v34) - *(double *)(v36[13] + 8 * v35);
v56 = *(double *)(v36[18] + 8 * v34) - *(double *)(v36[18] + 8 * v35);
*(_QWORD *)&v61 = COERCE_UNSIGNED_INT64(*(double *)(v36[19] + 8 * v34) - *(double *)(v36[19] + 8 * v35)) ^ LC1;
v68 = *(double *)(v36[14] + 8 * v34) - *(double *)(v36[14] + 8 * v35);
v71 = *(double *)(v36[15] + 8 * v34) - *(double *)(v36[15] + 8 * v35);
v37 = D1n2F12(v40, v74, v45, v50, v56, v61);
v38 = D1i2F12(v40, v74, v45, v50, v56, v61, v68, v71, a1, a2);
v75 = v76 + v79;
if ( v76 + v79 != 0.0 )
{
*(_QWORD *)&v77 = *((_QWORD *)a3 + 111) ^ LC1;
v37 = D1i2F12(v75, v80 + v81, v45, v50, v56, v61, v68, v71, a1, a2) * v77 + v37;
v78 = a3[111];
v38 = D1n2F12(v75, v80 + v81, v45, v50, v56, v61) * v78 + v38;
}
LABEL_9:
v11 = (double *)(*((_QWORD *)a3 + 66) + 8LL * *(int *)(v15 + 36));
*v11 = *v11 - v37;
v12 = (double *)(*((_QWORD *)a3 + 69) + 8LL * *(int *)(v15 + 36));
*v12 = *v12 - v38;
v13 = (double *)(*((_QWORD *)a3 + 66) + 8LL * *(int *)(v15 + 32));
*v13 = v37 + *v13;
v14 = (double *)(*((_QWORD *)a3 + 69) + 8LL * *(int *)(v15 + 32));
*v14 = v38 + *v14;
break;
default:
break;
}
v15 = *(_QWORD *)(v15 + 8);
}
while ( v15 );
v4 = v36;
}
result = *(_QWORD *)(v72 + 8);
v72 = result;
}
while ( result );
}
else
{
result = 0LL;
}
}
return result;
}

original_code:
int
DIOdisto( int mode, GENmodel *genmodel, CKTcircuit *ckt)
{
 DIOmodel *model = (DIOmodel *) genmodel;
 DISTOAN* job = (DISTOAN*) ckt->CKTcurJob;
 double g2,g3;
 double cdiff2,cdiff3;
 double cjunc2,cjunc3;
 double r1h1x,i1h1x;
 double r1h2x, i1h2x;
 double i1hm2x;
 double r2h11x,i2h11x;
 double r2h1m2x,i2h1m2x;
 double temp, itemp;
 DIOinstance *here;
if (mode == 1)
 return(DIOdSetup(model,ckt));
if ((mode == 4) || (mode == 5) ||
 (mode == 6) || (mode == 7) ||
 (mode == 8)) {
for( ; model != ((void *)0); model = model->DIOnextModel ) {
  for (here = model->DIOinstances; here != ((void *)0) ;
      here=here->DIOnextInstance) {
    if (here->DIOowner != ARCHme) continue;
    switch (mode) {
    case 4:
            g2=here->DIOdCoeffs[0];
     cdiff2=here->DIOdCoeffs[2];
     cjunc2=here->DIOdCoeffs[4];
     r1h1x = *(job->r1H1ptr + (here->DIOposPrimeNode)) -
   *(job->r1H1ptr + (here->DIOnegNode));
     i1h1x = *(job->i1H1ptr + (here->DIOposPrimeNode)) -
   *(job->i1H1ptr + (here->DIOnegNode));
     temp = D1n2F1(g2,r1h1x,i1h1x);
     itemp = D1i2F1(g2,r1h1x,i1h1x);
     if ((cdiff2 + cjunc2) != 0.0) {
     temp += - ckt->CKTomega * D1i2F1
    (cdiff2+cjunc2,r1h1x,i1h1x);
     itemp += ckt->CKTomega * D1n2F1
    ((cdiff2 + cjunc2),r1h1x,i1h1x);
     }
     *(ckt->CKTrhs + (here->DIOposPrimeNode)) -= temp;
     *(ckt->CKTirhs + (here->DIOposPrimeNode)) -= itemp;
     *(ckt->CKTrhs + (here->DIOnegNode)) += temp;
     *(ckt->CKTirhs + (here->DIOnegNode)) += itemp;
      break;
    case 5:
            g2=here->DIOdCoeffs[0];
     g3=here->DIOdCoeffs[1];
     cdiff2=here->DIOdCoeffs[2];
     cdiff3=here->DIOdCoeffs[3];
     cjunc2=here->DIOdCoeffs[4];
     cjunc3=here->DIOdCoeffs[5];
     r1h1x = *(job->r1H1ptr + (here->DIOposPrimeNode)) -
   *(job->r1H1ptr + (here->DIOnegNode));
     i1h1x = *(job->i1H1ptr + (here->DIOposPrimeNode)) -
   *(job->i1H1ptr + (here->DIOnegNode));
     r2h11x = *(job->r2H11ptr + (here->DIOposPrimeNode)) -
   *(job->r2H11ptr + (here->DIOnegNode));
     i2h11x = *(job->i2H11ptr + (here->DIOposPrimeNode)) -
   *(job->i2H11ptr + (here->DIOnegNode));
     temp = D1n3F1(g2,g3,r1h1x,i1h1x,r2h11x,
      i2h11x);
     itemp = D1i3F1(g2,g3,r1h1x,i1h1x,r2h11x,
      i2h11x);
     if ((cdiff2 + cjunc2) != 0.0) {
     temp += -ckt->CKTomega * D1i3F1
    (cdiff2+cjunc2,cdiff3+cjunc3,r1h1x,
      i1h1x,r2h11x,i2h11x);
     itemp += ckt->CKTomega * D1n3F1
    (cdiff2+cjunc2,cdiff3+cjunc3,r1h1x,
      i1h1x,r2h11x,i2h11x);
     }
     *(ckt->CKTrhs + (here->DIOposPrimeNode)) -= temp;
     *(ckt->CKTirhs + (here->DIOposPrimeNode)) -= itemp;
     *(ckt->CKTrhs + (here->DIOnegNode)) += temp;
     *(ckt->CKTirhs + (here->DIOnegNode)) += itemp;
      break;
    case 6:
            g2=here->DIOdCoeffs[0];
     g3=here->DIOdCoeffs[1];
     cdiff2=here->DIOdCoeffs[2];
     cdiff3=here->DIOdCoeffs[3];
     cjunc2=here->DIOdCoeffs[4];
     cjunc3=here->DIOdCoeffs[5];
     r1h1x = *(job->r1H1ptr + (here->DIOposPrimeNode)) -
   *(job->r1H1ptr + (here->DIOnegNode));
     i1h1x = *(job->i1H1ptr + (here->DIOposPrimeNode)) -
   *(job->i1H1ptr + (here->DIOnegNode));
     r1h2x = *(job->r1H2ptr + (here->DIOposPrimeNode)) -
   *(job->r1H2ptr + (here->DIOnegNode));
     i1h2x = *(job->i1H2ptr + (here->DIOposPrimeNode)) -
   *(job->i1H2ptr + (here->DIOnegNode));
     temp = D1nF12(g2,r1h1x,i1h1x,r1h2x,i1h2x);
     itemp = D1iF12(g2,r1h1x,i1h1x,r1h2x,i1h2x);
     if ((cdiff2 + cjunc2) != 0.0) {
     temp += - ckt->CKTomega * D1iF12
    (cdiff2+cjunc2,r1h1x,i1h1x,r1h2x,i1h2x);
     itemp += ckt->CKTomega * D1nF12
    (cdiff2+cjunc2,r1h1x,i1h1x,r1h2x,i1h2x);
     }
     *(ckt->CKTrhs + (here->DIOposPrimeNode)) -= temp;
     *(ckt->CKTirhs + (here->DIOposPrimeNode)) -= itemp;
     *(ckt->CKTrhs + (here->DIOnegNode)) += temp;
     *(ckt->CKTirhs + (here->DIOnegNode)) += itemp;
      break;
    case 7:
            g2=here->DIOdCoeffs[0];
     g3=here->DIOdCoeffs[1];
     cdiff2=here->DIOdCoeffs[2];
     cdiff3=here->DIOdCoeffs[3];
     cjunc2=here->DIOdCoeffs[4];
     cjunc3=here->DIOdCoeffs[5];
     r1h1x = *(job->r1H1ptr + (here->DIOposPrimeNode)) -
   *(job->r1H1ptr + (here->DIOnegNode));
     i1h1x = *(job->i1H1ptr + (here->DIOposPrimeNode)) -
   *(job->i1H1ptr + (here->DIOnegNode));
     r1h2x = *(job->r1H2ptr + (here->DIOposPrimeNode)) -
   *(job->r1H2ptr + (here->DIOnegNode));
     i1hm2x = -(*(job->i1H2ptr + (here->DIOposPrimeNode)) -
   *(job->i1H2ptr + (here->DIOnegNode)));
     temp = D1nF12(g2,r1h1x,i1h1x,r1h2x,i1hm2x);
     itemp = D1iF12(g2,r1h1x,i1h1x,r1h2x,i1hm2x);
     if ((cdiff2 + cjunc2) != 0.0) {
     temp += - ckt->CKTomega * D1iF12
    (cdiff2+cjunc2,r1h1x,i1h1x,r1h2x,i1hm2x);
     itemp += ckt->CKTomega * D1nF12
    (cdiff2+cjunc2,r1h1x,i1h1x,r1h2x,i1hm2x);
     }
     *(ckt->CKTrhs + (here->DIOposPrimeNode)) -= temp;
     *(ckt->CKTirhs + (here->DIOposPrimeNode)) -= itemp;
     *(ckt->CKTrhs + (here->DIOnegNode)) += temp;
     *(ckt->CKTirhs + (here->DIOnegNode)) += itemp;
      break;
    case 8:
            g2=here->DIOdCoeffs[0];
     g3=here->DIOdCoeffs[1];
     cdiff2=here->DIOdCoeffs[2];
     cdiff3=here->DIOdCoeffs[3];
     cjunc2=here->DIOdCoeffs[4];
     cjunc3=here->DIOdCoeffs[5];
     r1h1x = *(job->r1H1ptr + (here->DIOposPrimeNode)) -
   *(job->r1H1ptr + (here->DIOnegNode));
     i1h1x = *(job->i1H1ptr + (here->DIOposPrimeNode)) -
   *(job->i1H1ptr + (here->DIOnegNode));
     r1h2x = *(job->r1H2ptr + (here->DIOposPrimeNode)) -
   *(job->r1H2ptr + (here->DIOnegNode));
     i1hm2x = -(*(job->i1H2ptr + (here->DIOposPrimeNode)) -
   *(job->i1H2ptr + (here->DIOnegNode)));
     r2h11x = *(job->r2H11ptr + (here->DIOposPrimeNode)) -
   *(job->r2H11ptr + (here->DIOnegNode));
     i2h11x = *(job->i2H11ptr + (here->DIOposPrimeNode)) -
   *(job->i2H11ptr + (here->DIOnegNode));
     r2h1m2x = *(job->r2H1m2ptr + (here->DIOposPrimeNode)) -
   *(job->r2H1m2ptr + (here->DIOnegNode));
     i2h1m2x = *(job->i2H1m2ptr + (here->DIOposPrimeNode)) -
   *(job->i2H1m2ptr + (here->DIOnegNode));
     temp = D1n2F12(g2,g3,r1h1x,i1h1x,r1h2x,
    i1hm2x,r2h11x,i2h11x,
     r2h1m2x,i2h1m2x);
     itemp = D1i2F12(g2,g3,r1h1x,i1h1x,
    r1h2x,i1hm2x,r2h11x,i2h11x,
     r2h1m2x,i2h1m2x);
     if ((cdiff2 + cjunc2) != 0.0) {
     temp += -ckt->CKTomega *
     D1i2F12(cdiff2+cjunc2,cdiff3+cjunc3,
   r1h1x,i1h1x,r1h2x,i1hm2x,r2h11x,
    i2h11x,r2h1m2x,i2h1m2x);
     itemp += ckt->CKTomega *
     D1n2F12(cdiff2+cjunc2,cdiff3+cjunc3,
   r1h1x,i1h1x,r1h2x,i1hm2x,r2h11x,
    i2h11x,r2h1m2x,i2h1m2x);
     }
     *(ckt->CKTrhs + (here->DIOposPrimeNode)) -= temp;
     *(ckt->CKTirhs + (here->DIOposPrimeNode)) -= itemp;
     *(ckt->CKTrhs + (here->DIOnegNode)) += temp;
     *(ckt->CKTirhs + (here->DIOnegNode)) += itemp;
      break;
    default:
;
    }
  }
}
return(0);
}
  else
    return(7);
}

canonical_original_code:
int DIOdisto(int mode, struct sGENmodel *genmodel, struct CKTcircuit *ckt)
{
 struct sDIOmodel *model = (DIOmodel *) genmodel;
 struct DISTOAN *job = (DISTOAN*) ckt->CKTcurJob;
 double g2; double g3;
 double cdiff2; double cdiff3;
 double cjunc2; double cjunc3;
 double r1h1x; double i1h1x;
 double r1h2x; double i1h2x;
 double i1hm2x;
 double r2h11x; double i2h11x;
 double r2h1m2x; double i2h1m2x;
 double temp; double itemp;
 struct sDIOinstance *here;
if (mode == 1)
 return(DIOdSetup(model,ckt));
if ((mode == 4) || (mode == 5) ||
 (mode == 6) || (mode == 7) ||
 (mode == 8)) {
for( ; model != ((void *)0); model = model->DIOnextModel ) {
  for (here = model->DIOinstances; here != ((void *)0) ;
      here=here->DIOnextInstance) {
    if (here->DIOowner != ARCHme) continue;
    switch (mode) {
    case 4:
            g2=here->DIOdCoeffs[0];
     cdiff2=here->DIOdCoeffs[2];
     cjunc2=here->DIOdCoeffs[4];
     r1h1x = *(job->r1H1ptr + (here->DIOposPrimeNode)) -
   *(job->r1H1ptr + (here->DIOnegNode));
     i1h1x = *(job->i1H1ptr + (here->DIOposPrimeNode)) -
   *(job->i1H1ptr + (here->DIOnegNode));
     temp = D1n2F1(g2,r1h1x,i1h1x);
     itemp = D1i2F1(g2,r1h1x,i1h1x);
     if ((cdiff2 + cjunc2) != 0.0) {
     temp += - ckt->CKTomega * D1i2F1
    (cdiff2+cjunc2,r1h1x,i1h1x);
     itemp += ckt->CKTomega * D1n2F1
    ((cdiff2 + cjunc2),r1h1x,i1h1x);
     }
     *(ckt->CKTrhs + (here->DIOposPrimeNode)) -= temp;
     *(ckt->CKTirhs + (here->DIOposPrimeNode)) -= itemp;
     *(ckt->CKTrhs + (here->DIOnegNode)) += temp;
     *(ckt->CKTirhs + (here->DIOnegNode)) += itemp;
      break;
    case 5:
            g2=here->DIOdCoeffs[0];
     g3=here->DIOdCoeffs[1];
     cdiff2=here->DIOdCoeffs[2];
     cdiff3=here->DIOdCoeffs[3];
     cjunc2=here->DIOdCoeffs[4];
     cjunc3=here->DIOdCoeffs[5];
     r1h1x = *(job->r1H1ptr + (here->DIOposPrimeNode)) -
   *(job->r1H1ptr + (here->DIOnegNode));
     i1h1x = *(job->i1H1ptr + (here->DIOposPrimeNode)) -
   *(job->i1H1ptr + (here->DIOnegNode));
     r2h11x = *(job->r2H11ptr + (here->DIOposPrimeNode)) -
   *(job->r2H11ptr + (here->DIOnegNode));
     i2h11x = *(job->i2H11ptr + (here->DIOposPrimeNode)) -
   *(job->i2H11ptr + (here->DIOnegNode));
     temp = D1n3F1(g2,g3,r1h1x,i1h1x,r2h11x,
      i2h11x);
     itemp = D1i3F1(g2,g3,r1h1x,i1h1x,r2h11x,
      i2h11x);
     if ((cdiff2 + cjunc2) != 0.0) {
     temp += -ckt->CKTomega * D1i3F1
    (cdiff2+cjunc2,cdiff3+cjunc3,r1h1x,
      i1h1x,r2h11x,i2h11x);
     itemp += ckt->CKTomega * D1n3F1
    (cdiff2+cjunc2,cdiff3+cjunc3,r1h1x,
      i1h1x,r2h11x,i2h11x);
     }
     *(ckt->CKTrhs + (here->DIOposPrimeNode)) -= temp;
     *(ckt->CKTirhs + (here->DIOposPrimeNode)) -= itemp;
     *(ckt->CKTrhs + (here->DIOnegNode)) += temp;
     *(ckt->CKTirhs + (here->DIOnegNode)) += itemp;
      break;
    case 6:
            g2=here->DIOdCoeffs[0];
     g3=here->DIOdCoeffs[1];
     cdiff2=here->DIOdCoeffs[2];
     cdiff3=here->DIOdCoeffs[3];
     cjunc2=here->DIOdCoeffs[4];
     cjunc3=here->DIOdCoeffs[5];
     r1h1x = *(job->r1H1ptr + (here->DIOposPrimeNode)) -
   *(job->r1H1ptr + (here->DIOnegNode));
     i1h1x = *(job->i1H1ptr + (here->DIOposPrimeNode)) -
   *(job->i1H1ptr + (here->DIOnegNode));
     r1h2x = *(job->r1H2ptr + (here->DIOposPrimeNode)) -
   *(job->r1H2ptr + (here->DIOnegNode));
     i1h2x = *(job->i1H2ptr + (here->DIOposPrimeNode)) -
   *(job->i1H2ptr + (here->DIOnegNode));
     temp = D1nF12(g2,r1h1x,i1h1x,r1h2x,i1h2x);
     itemp = D1iF12(g2,r1h1x,i1h1x,r1h2x,i1h2x);
     if ((cdiff2 + cjunc2) != 0.0) {
     temp += - ckt->CKTomega * D1iF12
    (cdiff2+cjunc2,r1h1x,i1h1x,r1h2x,i1h2x);
     itemp += ckt->CKTomega * D1nF12
    (cdiff2+cjunc2,r1h1x,i1h1x,r1h2x,i1h2x);
     }
     *(ckt->CKTrhs + (here->DIOposPrimeNode)) -= temp;
     *(ckt->CKTirhs + (here->DIOposPrimeNode)) -= itemp;
     *(ckt->CKTrhs + (here->DIOnegNode)) += temp;
     *(ckt->CKTirhs + (here->DIOnegNode)) += itemp;
      break;
    case 7:
            g2=here->DIOdCoeffs[0];
     g3=here->DIOdCoeffs[1];
     cdiff2=here->DIOdCoeffs[2];
     cdiff3=here->DIOdCoeffs[3];
     cjunc2=here->DIOdCoeffs[4];
     cjunc3=here->DIOdCoeffs[5];
     r1h1x = *(job->r1H1ptr + (here->DIOposPrimeNode)) -
   *(job->r1H1ptr + (here->DIOnegNode));
     i1h1x = *(job->i1H1ptr + (here->DIOposPrimeNode)) -
   *(job->i1H1ptr + (here->DIOnegNode));
     r1h2x = *(job->r1H2ptr + (here->DIOposPrimeNode)) -
   *(job->r1H2ptr + (here->DIOnegNode));
     i1hm2x = -(*(job->i1H2ptr + (here->DIOposPrimeNode)) -
   *(job->i1H2ptr + (here->DIOnegNode)));
     temp = D1nF12(g2,r1h1x,i1h1x,r1h2x,i1hm2x);
     itemp = D1iF12(g2,r1h1x,i1h1x,r1h2x,i1hm2x);
     if ((cdiff2 + cjunc2) != 0.0) {
     temp += - ckt->CKTomega * D1iF12
    (cdiff2+cjunc2,r1h1x,i1h1x,r1h2x,i1hm2x);
     itemp += ckt->CKTomega * D1nF12
    (cdiff2+cjunc2,r1h1x,i1h1x,r1h2x,i1hm2x);
     }
     *(ckt->CKTrhs + (here->DIOposPrimeNode)) -= temp;
     *(ckt->CKTirhs + (here->DIOposPrimeNode)) -= itemp;
     *(ckt->CKTrhs + (here->DIOnegNode)) += temp;
     *(ckt->CKTirhs + (here->DIOnegNode)) += itemp;
      break;
    case 8:
            g2=here->DIOdCoeffs[0];
     g3=here->DIOdCoeffs[1];
     cdiff2=here->DIOdCoeffs[2];
     cdiff3=here->DIOdCoeffs[3];
     cjunc2=here->DIOdCoeffs[4];
     cjunc3=here->DIOdCoeffs[5];
     r1h1x = *(job->r1H1ptr + (here->DIOposPrimeNode)) -
   *(job->r1H1ptr + (here->DIOnegNode));
     i1h1x = *(job->i1H1ptr + (here->DIOposPrimeNode)) -
   *(job->i1H1ptr + (here->DIOnegNode));
     r1h2x = *(job->r1H2ptr + (here->DIOposPrimeNode)) -
   *(job->r1H2ptr + (here->DIOnegNode));
     i1hm2x = -(*(job->i1H2ptr + (here->DIOposPrimeNode)) -
   *(job->i1H2ptr + (here->DIOnegNode)));
     r2h11x = *(job->r2H11ptr + (here->DIOposPrimeNode)) -
   *(job->r2H11ptr + (here->DIOnegNode));
     i2h11x = *(job->i2H11ptr + (here->DIOposPrimeNode)) -
   *(job->i2H11ptr + (here->DIOnegNode));
     r2h1m2x = *(job->r2H1m2ptr + (here->DIOposPrimeNode)) -
   *(job->r2H1m2ptr + (here->DIOnegNode));
     i2h1m2x = *(job->i2H1m2ptr + (here->DIOposPrimeNode)) -
   *(job->i2H1m2ptr + (here->DIOnegNode));
     temp = D1n2F12(g2,g3,r1h1x,i1h1x,r1h2x,
    i1hm2x,r2h11x,i2h11x,
     r2h1m2x,i2h1m2x);
     itemp = D1i2F12(g2,g3,r1h1x,i1h1x,
    r1h2x,i1hm2x,r2h11x,i2h11x,
     r2h1m2x,i2h1m2x);
     if ((cdiff2 + cjunc2) != 0.0) {
     temp += -ckt->CKTomega *
     D1i2F12(cdiff2+cjunc2,cdiff3+cjunc3,
   r1h1x,i1h1x,r1h2x,i1hm2x,r2h11x,
    i2h11x,r2h1m2x,i2h1m2x);
     itemp += ckt->CKTomega *
     D1n2F12(cdiff2+cjunc2,cdiff3+cjunc3,
   r1h1x,i1h1x,r1h2x,i1hm2x,r2h11x,
    i2h11x,r2h1m2x,i2h1m2x);
     }
     *(ckt->CKTrhs + (here->DIOposPrimeNode)) -= temp;
     *(ckt->CKTirhs + (here->DIOposPrimeNode)) -= itemp;
     *(ckt->CKTrhs + (here->DIOnegNode)) += temp;
     *(ckt->CKTirhs + (here->DIOnegNode)) += itemp;
      break;
    default:
;
    }
  }
}
return(0);
}
  else
    return(7);
}

variable_types: mode int

variable_types: struct sGENmodel { int GENmodType; struct sGENmodel *GENnextModel; struct sGENinstance { struct sGENmodel *GENmodPtr; struct sGENinstance *GENnextInstance; char *GENname; int GENowner; int GENstate; int GENnode1; int GENnode2; int GENnode3; int GENnode4; int GENnode5; int GENnode6; int GENnode7; } *GENinstances; char *GENmodName; } *

variable_types: struct CKTcircuit { struct sGENmodel **CKThead; struct STATistics { int STATnumIter; int STATtranIter; int STAToldIter; int STATtimePts; int STATaccepted; int STATrejected; double STATtotAnalTime; double STATloadTime; double STATdecompTime; double STATsolveTime; double STATreorderTime; double STATcombineTime; double STATsyncTime; double STATtranTime; double STATtranDecompTime; double STATtranSolveTime; double STATtranLoadTime; double STATtranTruncTime; double STATtranCombTime; double STATtranSyncTime; double STATacTime; double STATacDecompTime; double STATacSolveTime; double STATacLoadTime; double STATacCombTime; double STATacSyncTime; } *CKTstat; double *CKTstates[8]; double CKTtime; double CKTdelta; double CKTdeltaOld[7]; double CKTtemp; double CKTnomTemp; double CKTvt; double CKTag[7]; double CKTagp[7]; int CKTorder; int CKTmaxOrder; int CKTintegrateMethod; void *CKTmatrix; int CKTniState; double *CKTrhs; double *CKTrhsOld; double *CKTrhsSpare; double *CKTirhs; double *CKTirhsOld; double *CKTirhsSpare; double *CKTpred; double *CKTsols[8]; double *CKTrhsOp; double *CKTsenRhs; double *CKTseniRhs; int CKTmaxEqNum; int CKTcurrentAnalysis; struct sCKTnode { char *name; int type; int number; double ic; double nodeset; double *ptr; struct sCKTnode *next; unsigned int icGiven; unsigned int nsGiven; } *CKTnodes; struct sCKTnode *CKTlastNode; int CKTnumStates; long CKTmode; int CKTbypass; int CKTdcMaxIter; int CKTdcTrcvMaxIter; int CKTtranMaxIter; int CKTbreakSize; int CKTbreak; double CKTsaveDelta; double CKTminBreak; double *CKTbreaks; double CKTabstol; double CKTpivotAbsTol; double CKTpivotRelTol; double CKTreltol; double CKTchgtol; double CKTvoltTol; double CKTgmin; double CKTgshunt; double CKTdelmin; double CKTtrtol; double CKTfinalTime; double CKTstep; double CKTmaxStep; double CKTinitTime; double CKTomega; double CKTsrcFact; double CKTdiagGmin; int CKTnumSrcSteps; int CKTnumGminSteps; double CKTgminFactor; int CKTnoncon; double CKTdefaultMosM; double CKTdefaultMosL; double CKTdefaultMosW; double CKTdefaultMosAD; double CKTdefaultMosAS; unsigned int CKThadNodeset; unsigned int CKTfixLimit; unsigned int CKTnoOpIter; unsigned int CKTisSetup; struct sJOB { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; } *CKTcurJob; struct SENstruct { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; int SENnumVal; char **SENdevices; char **SENparmNames; unsigned int SENinitflag; unsigned int SENicflag; unsigned int SENstatus; unsigned int SENacpertflag; int SENmode; int SENparms; double SENpertfac; double **SEN_Sap; double **SEN_RHS; double **SEN_iRHS; int SENsize; void *SEN_Jacmat; double *SEN_parmVal; char **SEN_parmName; } *CKTsenInfo; double *CKTtimePoints; double *CKTdeltaList; int CKTtimeListSize; int CKTtimeIndex; int CKTsizeIncr; unsigned int CKTtryToCompact; unsigned int CKTbadMos3; unsigned int CKTkeepOpInfo; unsigned int CKTcopyNodesets; unsigned int CKTnodeDamping; double CKTabsDv; double CKTrelDv; int CKTtroubleNode; struct sGENinstance *CKTtroubleElt; } *

variable_types: struct sDIOmodel { int DIOmodType; struct sDIOmodel *DIOnextModel; struct sDIOinstance { struct sDIOmodel *DIOmodPtr; struct sDIOinstance *DIOnextInstance; char *DIOname; int DIOowner; int DIOstate; int DIOposNode; int DIOnegNode; int DIOposPrimeNode; double *DIOposPosPrimePtr; double *DIOnegPosPrimePtr; double *DIOposPrimePosPtr; double *DIOposPrimeNegPtr; double *DIOposPosPtr; double *DIOnegNegPtr; double *DIOposPrimePosPrimePtr; double DIOcap; double *DIOsens; int DIOsenParmNo; unsigned int DIOoff; unsigned int DIOareaGiven; unsigned int DIOpjGiven; unsigned int DIOmGiven; unsigned int DIOinitCondGiven; unsigned int DIOsenPertFlag; unsigned int DIOtempGiven; unsigned int DIOdtempGiven; double DIOarea; double DIOpj; double DIOm; double DIOinitCond; double DIOtemp; double DIOdtemp; double DIOtJctPot; double DIOtJctCap; double DIOtJctSWPot; double DIOtJctSWCap; double DIOtTransitTime; double DIOtGradingCoeff; double DIOtConductance; double DIOtDepCap; double DIOtSatCur; double DIOtSatSWCur; double DIOtVcrit; double DIOtF1; double DIOtBrkdwnV; double DIOtF2; double DIOtF3; double DIOtF2SW; double DIOtF3SW; double DIOdCoeffs[6]; double DIOnVar[3][4]; } *DIOinstances; char *DIOmodName; unsigned int DIOsatCurGiven; unsigned int DIOsatSWCurGiven; unsigned int DIOresistGiven; unsigned int DIOresistTemp1Given; unsigned int DIOresistTemp2Given; unsigned int DIOemissionCoeffGiven; unsigned int DIOtransitTimeGiven; unsigned int DIOtranTimeTemp1Given; unsigned int DIOtranTimeTemp2Given; unsigned int DIOjunctionCapGiven; unsigned int DIOjunctionPotGiven; unsigned int DIOgradingCoeffGiven; unsigned int DIOgradCoeffTemp1Given; unsigned int DIOgradCoeffTemp2Given; unsigned int DIOjunctionSWCapGiven; unsigned int DIOjunctionSWPotGiven; unsigned int DIOgradingSWCoeffGiven; unsigned int DIOforwardKneeCurrentGiven; unsigned int DIOreverseKneeCurrentGiven; unsigned int DIOactivationEnergyGiven; unsigned int DIOsaturationCurrentExpGiven; unsigned int DIOdepletionCapCoeffGiven; unsigned int DIOdepletionSWcapCoeffGiven; unsigned int DIObreakdownVoltageGiven; unsigned int DIObreakdownCurrentGiven; unsigned int DIOnomTempGiven; unsigned int DIOfNcoefGiven; unsigned int DIOfNexpGiven; double DIOsatCur; double DIOsatSWCur; double DIOresist; double DIOresistTemp1; double DIOresistTemp2; double DIOconductance; double DIOemissionCoeff; double DIOtransitTime; double DIOtranTimeTemp1; double DIOtranTimeTemp2; double DIOjunctionCap; double DIOjunctionPot; double DIOgradingCoeff; double DIOgradCoeffTemp1; double DIOgradCoeffTemp2; double DIOjunctionSWCap; double DIOjunctionSWPot; double DIOgradingSWCoeff; double DIOforwardKneeCurrent; double DIOreverseKneeCurrent; double DIOactivationEnergy; double DIOsaturationCurrentExp; double DIOdepletionCapCoeff; double DIOdepletionSWcapCoeff; double DIObreakdownVoltage; double DIObreakdownCurrent; double DIOnomTemp; double DIOfNcoef; double DIOfNexp; } *

variable_types: struct DISTOAN { int JOBtype; struct sJOB { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; } *JOBnextJob; char *JOBname; double DstartF1; double DstopF1; double DfreqDelta; double DsaveF1; int DstepType; int DnumSteps; int Df2wanted; int Df2given; double Df2ovrF1; double Domega1; double Domega2; double *r1H1ptr; double *i1H1ptr; double *r2H11ptr; double *i2H11ptr; double *r3H11ptr; double *i3H11ptr; double *r1H2ptr; double *i1H2ptr; double *r2H12ptr; double *i2H12ptr; double *r2H1m2ptr; double *i2H1m2ptr; double *r3H1m2ptr; double *i3H1m2ptr; double **r1H1stor; double **i1H1stor; double **r2H11stor; double **i2H11stor; double **r3H11stor; double **i3H11stor; double **r1H2stor; double **i1H2stor; double **r2H12stor; double **i2H12stor; double **r2H1m2stor; double **i2H1m2stor; double **r3H1m2stor; double **i3H1m2stor; } *

variable_types: temp double

variable_types: itemp double

variable_types: struct sDIOinstance { struct sDIOmodel { int DIOmodType; struct sDIOmodel *DIOnextModel; struct sDIOinstance *DIOinstances; char *DIOmodName; unsigned int DIOsatCurGiven; unsigned int DIOsatSWCurGiven; unsigned int DIOresistGiven; unsigned int DIOresistTemp1Given; unsigned int DIOresistTemp2Given; unsigned int DIOemissionCoeffGiven; unsigned int DIOtransitTimeGiven; unsigned int DIOtranTimeTemp1Given; unsigned int DIOtranTimeTemp2Given; unsigned int DIOjunctionCapGiven; unsigned int DIOjunctionPotGiven; unsigned int DIOgradingCoeffGiven; unsigned int DIOgradCoeffTemp1Given; unsigned int DIOgradCoeffTemp2Given; unsigned int DIOjunctionSWCapGiven; unsigned int DIOjunctionSWPotGiven; unsigned int DIOgradingSWCoeffGiven; unsigned int DIOforwardKneeCurrentGiven; unsigned int DIOreverseKneeCurrentGiven; unsigned int DIOactivationEnergyGiven; unsigned int DIOsaturationCurrentExpGiven; unsigned int DIOdepletionCapCoeffGiven; unsigned int DIOdepletionSWcapCoeffGiven; unsigned int DIObreakdownVoltageGiven; unsigned int DIObreakdownCurrentGiven; unsigned int DIOnomTempGiven; unsigned int DIOfNcoefGiven; unsigned int DIOfNexpGiven; double DIOsatCur; double DIOsatSWCur; double DIOresist; double DIOresistTemp1; double DIOresistTemp2; double DIOconductance; double DIOemissionCoeff; double DIOtransitTime; double DIOtranTimeTemp1; double DIOtranTimeTemp2; double DIOjunctionCap; double DIOjunctionPot; double DIOgradingCoeff; double DIOgradCoeffTemp1; double DIOgradCoeffTemp2; double DIOjunctionSWCap; double DIOjunctionSWPot; double DIOgradingSWCoeff; double DIOforwardKneeCurrent; double DIOreverseKneeCurrent; double DIOactivationEnergy; double DIOsaturationCurrentExp; double DIOdepletionCapCoeff; double DIOdepletionSWcapCoeff; double DIObreakdownVoltage; double DIObreakdownCurrent; double DIOnomTemp; double DIOfNcoef; double DIOfNexp; } *DIOmodPtr; struct sDIOinstance *DIOnextInstance; char *DIOname; int DIOowner; int DIOstate; int DIOposNode; int DIOnegNode; int DIOposPrimeNode; double *DIOposPosPrimePtr; double *DIOnegPosPrimePtr; double *DIOposPrimePosPtr; double *DIOposPrimeNegPtr; double *DIOposPosPtr; double *DIOnegNegPtr; double *DIOposPrimePosPrimePtr; double DIOcap; double *DIOsens; int DIOsenParmNo; unsigned int DIOoff; unsigned int DIOareaGiven; unsigned int DIOpjGiven; unsigned int DIOmGiven; unsigned int DIOinitCondGiven; unsigned int DIOsenPertFlag; unsigned int DIOtempGiven; unsigned int DIOdtempGiven; double DIOarea; double DIOpj; double DIOm; double DIOinitCond; double DIOtemp; double DIOdtemp; double DIOtJctPot; double DIOtJctCap; double DIOtJctSWPot; double DIOtJctSWCap; double DIOtTransitTime; double DIOtGradingCoeff; double DIOtConductance; double DIOtDepCap; double DIOtSatCur; double DIOtSatSWCur; double DIOtVcrit; double DIOtF1; double DIOtBrkdwnV; double DIOtF2; double DIOtF3; double DIOtF2SW; double DIOtF3SW; double DIOdCoeffs[6]; double DIOnVar[3][4]; } *

user_defined_types: struct DISTOAN { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; double DstartF1; double DstopF1; double DfreqDelta; double DsaveF1; int DstepType; int DnumSteps; int Df2wanted; int Df2given; double Df2ovrF1; double Domega1; double Domega2; double *r1H1ptr; double *i1H1ptr; double *r2H11ptr; double *i2H11ptr; double *r3H11ptr; double *i3H11ptr; double *r1H2ptr; double *i1H2ptr; double *r2H12ptr; double *i2H12ptr; double *r2H1m2ptr; double *i2H1m2ptr; double *r3H1m2ptr; double *i3H1m2ptr; double **r1H1stor; double **i1H1stor; double **r2H11stor; double **i2H11stor; double **r3H11stor; double **i3H11stor; double **r1H2stor; double **i1H2stor; double **r2H12stor; double **i2H12stor; double **r2H1m2stor; double **i2H1m2stor; double **r3H1m2stor; double **i3H1m2stor; }


repo: gserdyuk/gnucap-a

decompiled_code:
__int64 __fastcall B1mAsk(__int64 a1, __int64 a2, int a3, _QWORD *a4)
{
__int64 result; // rax

switch ( a3 )
{
case 101:
*a4 = *(_QWORD *)(a2 + 40);
result = 0LL;
break;
case 102:
*a4 = *(_QWORD *)(a2 + 48);
result = 0LL;
break;
case 103:
*a4 = *(_QWORD *)(a2 + 56);
result = 0LL;
break;
case 104:
*a4 = *(_QWORD *)(a2 + 64);
result = 0LL;
break;
case 105:
*a4 = *(_QWORD *)(a2 + 72);
result = 0LL;
break;
case 106:
*a4 = *(_QWORD *)(a2 + 80);
result = 0LL;
break;
case 107:
*a4 = *(_QWORD *)(a2 + 88);
result = 0LL;
break;
case 108:
*a4 = *(_QWORD *)(a2 + 96);
result = 0LL;
break;
case 109:
*a4 = *(_QWORD *)(a2 + 104);
result = 0LL;
break;
case 110:
*a4 = *(_QWORD *)(a2 + 112);
result = 0LL;
break;
case 111:
*a4 = *(_QWORD *)(a2 + 120);
result = 0LL;
break;
case 112:
*a4 = *(_QWORD *)(a2 + 128);
result = 0LL;
break;
case 113:
*a4 = *(_QWORD *)(a2 + 136);
result = 0LL;
break;
case 114:
*a4 = *(_QWORD *)(a2 + 144);
result = 0LL;
break;
case 115:
*a4 = *(_QWORD *)(a2 + 152);
result = 0LL;
break;
case 116:
*a4 = *(_QWORD *)(a2 + 160);
result = 0LL;
break;
case 117:
*a4 = *(_QWORD *)(a2 + 168);
result = 0LL;
break;
case 118:
*a4 = *(_QWORD *)(a2 + 176);
result = 0LL;
break;
case 119:
*a4 = *(_QWORD *)(a2 + 184);
result = 0LL;
break;
case 120:
*a4 = *(_QWORD *)(a2 + 192);
result = 0LL;
break;
case 121:
*a4 = *(_QWORD *)(a2 + 200);
result = 0LL;
break;
case 122:
*a4 = *(_QWORD *)(a2 + 208);
result = 0LL;
break;
case 123:
*a4 = *(_QWORD *)(a2 + 216);
result = 0LL;
break;
case 124:
*a4 = *(_QWORD *)(a2 + 224);
result = 0LL;
break;
case 125:
*a4 = *(_QWORD *)(a2 + 232);
result = 0LL;
break;
case 126:
*a4 = *(_QWORD *)(a2 + 240);
result = 0LL;
break;
case 127:
*a4 = *(_QWORD *)(a2 + 248);
result = 0LL;
break;
case 128:
*a4 = *(_QWORD *)(a2 + 256);
result = 0LL;
break;
case 129:
*a4 = *(_QWORD *)(a2 + 264);
result = 0LL;
break;
case 130:
*a4 = *(_QWORD *)(a2 + 272);
result = 0LL;
break;
case 131:
*a4 = *(_QWORD *)(a2 + 280);
result = 0LL;
break;
case 132:
*a4 = *(_QWORD *)(a2 + 288);
result = 0LL;
break;
case 133:
*a4 = *(_QWORD *)(a2 + 296);
result = 0LL;
break;
case 134:
*a4 = *(_QWORD *)(a2 + 304);
result = 0LL;
break;
case 135:
*a4 = *(_QWORD *)(a2 + 312);
result = 0LL;
break;
case 136:
*a4 = *(_QWORD *)(a2 + 320);
result = 0LL;
break;
case 137:
*a4 = *(_QWORD *)(a2 + 328);
result = 0LL;
break;
case 138:
*a4 = *(_QWORD *)(a2 + 336);
result = 0LL;
break;
case 139:
*a4 = *(_QWORD *)(a2 + 344);
result = 0LL;
break;
case 140:
*a4 = *(_QWORD *)(a2 + 352);
result = 0LL;
break;
case 141:
*a4 = *(_QWORD *)(a2 + 360);
result = 0LL;
break;
case 142:
*a4 = *(_QWORD *)(a2 + 368);
result = 0LL;
break;
case 143:
*a4 = *(_QWORD *)(a2 + 376);
result = 0LL;
break;
case 144:
*a4 = *(_QWORD *)(a2 + 384);
result = 0LL;
break;
case 145:
*a4 = *(_QWORD *)(a2 + 392);
result = 0LL;
break;
case 146:
*a4 = *(_QWORD *)(a2 + 400);
result = 0LL;
break;
case 147:
*a4 = *(_QWORD *)(a2 + 408);
result = 0LL;
break;
case 148:
*a4 = *(_QWORD *)(a2 + 416);
result = 0LL;
break;
case 149:
*a4 = *(_QWORD *)(a2 + 424);
result = 0LL;
break;
case 150:
*a4 = *(_QWORD *)(a2 + 432);
result = 0LL;
break;
case 151:
*a4 = *(_QWORD *)(a2 + 440);
result = 0LL;
break;
case 152:
*a4 = *(_QWORD *)(a2 + 448);
result = 0LL;
break;
case 153:
*a4 = *(_QWORD *)(a2 + 456);
result = 0LL;
break;
case 154:
*a4 = *(_QWORD *)(a2 + 464);
result = 0LL;
break;
case 155:
*a4 = *(_QWORD *)(a2 + 472);
result = 0LL;
break;
case 156:
*a4 = *(_QWORD *)(a2 + 480);
result = 0LL;
break;
case 157:
*a4 = *(_QWORD *)(a2 + 488);
result = 0LL;
break;
case 158:
*a4 = *(_QWORD *)(a2 + 496);
result = 0LL;
break;
case 159:
*a4 = *(_QWORD *)(a2 + 504);
result = 0LL;
break;
case 160:
*a4 = *(_QWORD *)(a2 + 512);
result = 0LL;
break;
case 161:
*a4 = *(_QWORD *)(a2 + 520);
result = 0LL;
break;
case 162:
*a4 = *(_QWORD *)(a2 + 536);
result = 0LL;
break;
case 163:
*a4 = *(_QWORD *)(a2 + 544);
result = 0LL;
break;
case 164:
*a4 = *(_QWORD *)(a2 + 552);
result = 0LL;
break;
case 165:
*a4 = *(_QWORD *)(a2 + 560);
result = 0LL;
break;
case 166:
*a4 = *(_QWORD *)(a2 + 568);
result = 0LL;
break;
case 167:
*(_DWORD *)a4 = (int)*(double *)(a2 + 576);
result = 0LL;
break;
case 168:
*a4 = *(_QWORD *)(a2 + 584);
result = 0LL;
break;
case 169:
*a4 = *(_QWORD *)(a2 + 592);
result = 0LL;
break;
case 170:
*a4 = *(_QWORD *)(a2 + 600);
result = 0LL;
break;
case 171:
*a4 = *(_QWORD *)(a2 + 608);
result = 0LL;
break;
case 172:
*a4 = *(_QWORD *)(a2 + 624);
result = 0LL;
break;
case 173:
*a4 = *(_QWORD *)(a2 + 616);
result = 0LL;
break;
case 174:
*a4 = *(_QWORD *)(a2 + 632);
result = 0LL;
break;
case 175:
*a4 = *(_QWORD *)(a2 + 640);
result = 0LL;
break;
case 176:
*a4 = *(_QWORD *)(a2 + 648);
result = 0LL;
break;
case 177:
*a4 = *(_QWORD *)(a2 + 656);
result = 0LL;
break;
default:
result = 7LL;
break;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, int a3, _QWORD *a4)
{
__int64 result; // rax

switch ( a3 )
{
case 101:
*a4 = *(_QWORD *)(a2 + 40);
result = 0LL;
break;
case 102:
*a4 = *(_QWORD *)(a2 + 48);
result = 0LL;
break;
case 103:
*a4 = *(_QWORD *)(a2 + 56);
result = 0LL;
break;
case 104:
*a4 = *(_QWORD *)(a2 + 64);
result = 0LL;
break;
case 105:
*a4 = *(_QWORD *)(a2 + 72);
result = 0LL;
break;
case 106:
*a4 = *(_QWORD *)(a2 + 80);
result = 0LL;
break;
case 107:
*a4 = *(_QWORD *)(a2 + 88);
result = 0LL;
break;
case 108:
*a4 = *(_QWORD *)(a2 + 96);
result = 0LL;
break;
case 109:
*a4 = *(_QWORD *)(a2 + 104);
result = 0LL;
break;
case 110:
*a4 = *(_QWORD *)(a2 + 112);
result = 0LL;
break;
case 111:
*a4 = *(_QWORD *)(a2 + 120);
result = 0LL;
break;
case 112:
*a4 = *(_QWORD *)(a2 + 128);
result = 0LL;
break;
case 113:
*a4 = *(_QWORD *)(a2 + 136);
result = 0LL;
break;
case 114:
*a4 = *(_QWORD *)(a2 + 144);
result = 0LL;
break;
case 115:
*a4 = *(_QWORD *)(a2 + 152);
result = 0LL;
break;
case 116:
*a4 = *(_QWORD *)(a2 + 160);
result = 0LL;
break;
case 117:
*a4 = *(_QWORD *)(a2 + 168);
result = 0LL;
break;
case 118:
*a4 = *(_QWORD *)(a2 + 176);
result = 0LL;
break;
case 119:
*a4 = *(_QWORD *)(a2 + 184);
result = 0LL;
break;
case 120:
*a4 = *(_QWORD *)(a2 + 192);
result = 0LL;
break;
case 121:
*a4 = *(_QWORD *)(a2 + 200);
result = 0LL;
break;
case 122:
*a4 = *(_QWORD *)(a2 + 208);
result = 0LL;
break;
case 123:
*a4 = *(_QWORD *)(a2 + 216);
result = 0LL;
break;
case 124:
*a4 = *(_QWORD *)(a2 + 224);
result = 0LL;
break;
case 125:
*a4 = *(_QWORD *)(a2 + 232);
result = 0LL;
break;
case 126:
*a4 = *(_QWORD *)(a2 + 240);
result = 0LL;
break;
case 127:
*a4 = *(_QWORD *)(a2 + 248);
result = 0LL;
break;
case 128:
*a4 = *(_QWORD *)(a2 + 256);
result = 0LL;
break;
case 129:
*a4 = *(_QWORD *)(a2 + 264);
result = 0LL;
break;
case 130:
*a4 = *(_QWORD *)(a2 + 272);
result = 0LL;
break;
case 131:
*a4 = *(_QWORD *)(a2 + 280);
result = 0LL;
break;
case 132:
*a4 = *(_QWORD *)(a2 + 288);
result = 0LL;
break;
case 133:
*a4 = *(_QWORD *)(a2 + 296);
result = 0LL;
break;
case 134:
*a4 = *(_QWORD *)(a2 + 304);
result = 0LL;
break;
case 135:
*a4 = *(_QWORD *)(a2 + 312);
result = 0LL;
break;
case 136:
*a4 = *(_QWORD *)(a2 + 320);
result = 0LL;
break;
case 137:
*a4 = *(_QWORD *)(a2 + 328);
result = 0LL;
break;
case 138:
*a4 = *(_QWORD *)(a2 + 336);
result = 0LL;
break;
case 139:
*a4 = *(_QWORD *)(a2 + 344);
result = 0LL;
break;
case 140:
*a4 = *(_QWORD *)(a2 + 352);
result = 0LL;
break;
case 141:
*a4 = *(_QWORD *)(a2 + 360);
result = 0LL;
break;
case 142:
*a4 = *(_QWORD *)(a2 + 368);
result = 0LL;
break;
case 143:
*a4 = *(_QWORD *)(a2 + 376);
result = 0LL;
break;
case 144:
*a4 = *(_QWORD *)(a2 + 384);
result = 0LL;
break;
case 145:
*a4 = *(_QWORD *)(a2 + 392);
result = 0LL;
break;
case 146:
*a4 = *(_QWORD *)(a2 + 400);
result = 0LL;
break;
case 147:
*a4 = *(_QWORD *)(a2 + 408);
result = 0LL;
break;
case 148:
*a4 = *(_QWORD *)(a2 + 416);
result = 0LL;
break;
case 149:
*a4 = *(_QWORD *)(a2 + 424);
result = 0LL;
break;
case 150:
*a4 = *(_QWORD *)(a2 + 432);
result = 0LL;
break;
case 151:
*a4 = *(_QWORD *)(a2 + 440);
result = 0LL;
break;
case 152:
*a4 = *(_QWORD *)(a2 + 448);
result = 0LL;
break;
case 153:
*a4 = *(_QWORD *)(a2 + 456);
result = 0LL;
break;
case 154:
*a4 = *(_QWORD *)(a2 + 464);
result = 0LL;
break;
case 155:
*a4 = *(_QWORD *)(a2 + 472);
result = 0LL;
break;
case 156:
*a4 = *(_QWORD *)(a2 + 480);
result = 0LL;
break;
case 157:
*a4 = *(_QWORD *)(a2 + 488);
result = 0LL;
break;
case 158:
*a4 = *(_QWORD *)(a2 + 496);
result = 0LL;
break;
case 159:
*a4 = *(_QWORD *)(a2 + 504);
result = 0LL;
break;
case 160:
*a4 = *(_QWORD *)(a2 + 512);
result = 0LL;
break;
case 161:
*a4 = *(_QWORD *)(a2 + 520);
result = 0LL;
break;
case 162:
*a4 = *(_QWORD *)(a2 + 536);
result = 0LL;
break;
case 163:
*a4 = *(_QWORD *)(a2 + 544);
result = 0LL;
break;
case 164:
*a4 = *(_QWORD *)(a2 + 552);
result = 0LL;
break;
case 165:
*a4 = *(_QWORD *)(a2 + 560);
result = 0LL;
break;
case 166:
*a4 = *(_QWORD *)(a2 + 568);
result = 0LL;
break;
case 167:
*(_DWORD *)a4 = (int)*(double *)(a2 + 576);
result = 0LL;
break;
case 168:
*a4 = *(_QWORD *)(a2 + 584);
result = 0LL;
break;
case 169:
*a4 = *(_QWORD *)(a2 + 592);
result = 0LL;
break;
case 170:
*a4 = *(_QWORD *)(a2 + 600);
result = 0LL;
break;
case 171:
*a4 = *(_QWORD *)(a2 + 608);
result = 0LL;
break;
case 172:
*a4 = *(_QWORD *)(a2 + 624);
result = 0LL;
break;
case 173:
*a4 = *(_QWORD *)(a2 + 616);
result = 0LL;
break;
case 174:
*a4 = *(_QWORD *)(a2 + 632);
result = 0LL;
break;
case 175:
*a4 = *(_QWORD *)(a2 + 640);
result = 0LL;
break;
case 176:
*a4 = *(_QWORD *)(a2 + 648);
result = 0LL;
break;
case 177:
*a4 = *(_QWORD *)(a2 + 656);
result = 0LL;
break;
default:
result = 7LL;
break;
}
return result;
}

original_code:
int
B1mAsk(CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
{
    B1model *model = (B1model *)inst;
        switch(which) {
        case 101:
            value->rValue = model->B1vfb0;
            return(0);
        case 102:
            value->rValue = model->B1vfbL;
            return(0);
        case 103:
            value->rValue = model->B1vfbW;
            return(0);
        case 104:
            value->rValue = model->B1phi0;
            return(0);
        case 105:
            value->rValue = model->B1phiL;
            return(0);
        case 106:
            value->rValue = model->B1phiW;
            return(0);
        case 107:
            value->rValue = model->B1K10;
            return(0);
        case 108:
            value->rValue = model->B1K1L;
            return(0);
        case 109:
            value->rValue = model->B1K1W;
            return(0);
        case 110:
            value->rValue = model->B1K20;
            return(0);
        case 111:
            value->rValue = model->B1K2L;
            return(0);
        case 112:
            value->rValue = model->B1K2W;
            return(0);
        case 113:
            value->rValue = model->B1eta0;
            return(0);
        case 114:
            value->rValue = model->B1etaL;
            return(0);
        case 115:
            value->rValue = model->B1etaW;
            return(0);
        case 116:
            value->rValue = model->B1etaB0;
            return(0);
        case 117:
            value->rValue = model->B1etaBl;
            return(0);
        case 118:
            value->rValue = model->B1etaBw;
            return(0);
        case 119:
            value->rValue = model->B1etaD0;
            return(0);
        case 120:
            value->rValue = model->B1etaDl;
            return(0);
        case 121:
            value->rValue = model->B1etaDw;
            return(0);
        case 122:
            value->rValue = model->B1deltaL;
            return(0);
        case 123:
            value->rValue = model->B1deltaW;
            return(0);
        case 124:
            value->rValue = model->B1mobZero;
            return(0);
        case 125:
            value->rValue = model->B1mobZeroB0;
            return(0);
        case 126:
            value->rValue = model->B1mobZeroBl;
            return(0);
        case 127:
            value->rValue = model->B1mobZeroBw;
            return(0);
        case 128:
            value->rValue = model->B1mobVdd0;
            return(0);
        case 129:
            value->rValue = model->B1mobVddl;
            return(0);
        case 130:
            value->rValue = model->B1mobVddw;
            return(0);
        case 131:
            value->rValue = model->B1mobVddB0;
            return(0);
        case 132:
            value->rValue = model->B1mobVddBl;
            return(0);
        case 133:
            value->rValue = model->B1mobVddBw;
            return(0);
        case 134:
            value->rValue = model->B1mobVddD0;
            return(0);
        case 135:
            value->rValue = model->B1mobVddDl;
            return(0);
        case 136:
            value->rValue = model->B1mobVddDw;
            return(0);
        case 137:
            value->rValue = model->B1ugs0;
            return(0);
        case 138:
            value->rValue = model->B1ugsL;
            return(0);
        case 139:
            value->rValue = model->B1ugsW;
            return(0);
        case 140:
            value->rValue = model->B1ugsB0;
            return(0);
        case 141:
            value->rValue = model->B1ugsBL;
            return(0);
        case 142:
            value->rValue = model->B1ugsBW;
            return(0);
        case 143:
            value->rValue = model->B1uds0;
            return(0);
        case 144:
            value->rValue = model->B1udsL;
            return(0);
        case 145:
            value->rValue = model->B1udsW;
            return(0);
        case 146:
            value->rValue = model->B1udsB0;
            return(0);
        case 147:
            value->rValue = model->B1udsBL;
            return(0);
        case 148:
            value->rValue = model->B1udsBW;
            return(0);
        case 149:
            value->rValue = model->B1udsD0;
            return(0);
        case 150:
            value->rValue = model->B1udsDL;
            return(0);
        case 151:
            value->rValue = model->B1udsDW;
            return(0);
        case 152:
            value->rValue = model->B1subthSlope0;
            return(0);
        case 153:
            value->rValue = model->B1subthSlopeL;
            return(0);
        case 154:
            value->rValue = model->B1subthSlopeW;
            return(0);
        case 155:
            value->rValue = model->B1subthSlopeB0;
            return(0);
        case 156:
            value->rValue = model->B1subthSlopeBL;
            return(0);
        case 157:
            value->rValue = model->B1subthSlopeBW;
            return(0);
        case 158:
            value->rValue = model->B1subthSlopeD0;
            return(0);
        case 159:
            value->rValue = model->B1subthSlopeDL;
            return(0);
        case 160:
            value->rValue = model->B1subthSlopeDW;
            return(0);
        case 161:
            value->rValue = model->B1oxideThickness;
            return(0);
        case 162:
            value->rValue = model->B1temp;
            return(0);
        case 163:
            value->rValue = model->B1vdd;
            return(0);
        case 164:
            value->rValue = model->B1gateSourceOverlapCap;
            return(0);
        case 165:
            value->rValue = model->B1gateDrainOverlapCap;
            return(0);
        case 166:
            value->rValue = model->B1gateBulkOverlapCap;
            return(0);
        case 167:
            value->iValue = model->B1channelChargePartitionFlag;
            return(0);
        case 168:
            value->rValue = model->B1sheetResistance;
            return(0);
        case 169:
            value->rValue = model->B1jctSatCurDensity;
            return(0);
        case 170:
            value->rValue = model->B1bulkJctPotential;
            return(0);
        case 171:
            value->rValue = model->B1bulkJctBotGradingCoeff;
            return(0);
        case 172:
            value->rValue = model->B1sidewallJctPotential;
            return(0);
        case 173:
            value->rValue = model->B1bulkJctSideGradingCoeff;
            return(0);
        case 174:
            value->rValue = model->B1unitAreaJctCap;
            return(0);
        case 175:
            value->rValue = model->B1unitLengthSidewallJctCap;
            return(0);
        case 176:
            value->rValue = model->B1defaultWidth;
            return(0);
        case 177:
            value->rValue = model->B1deltaLength;
            return(0);
        case 181:
            value->rValue = model->B1fNexp;
            return(0);
        case 180:
            value->rValue = model->B1fNcoef;
            return(0);
        default:
            return(7);
    }
}

canonical_original_code:
int B1mAsk(struct CKTcircuit *ckt, struct sGENmodel *inst, int which, union uIFvalue *value)
{
    struct sBSIM1model *model = (B1model *)inst;
        switch(which) {
        case 101:
            value->rValue = model->B1vfb0;
            return(0);
        case 102:
            value->rValue = model->B1vfbL;
            return(0);
        case 103:
            value->rValue = model->B1vfbW;
            return(0);
        case 104:
            value->rValue = model->B1phi0;
            return(0);
        case 105:
            value->rValue = model->B1phiL;
            return(0);
        case 106:
            value->rValue = model->B1phiW;
            return(0);
        case 107:
            value->rValue = model->B1K10;
            return(0);
        case 108:
            value->rValue = model->B1K1L;
            return(0);
        case 109:
            value->rValue = model->B1K1W;
            return(0);
        case 110:
            value->rValue = model->B1K20;
            return(0);
        case 111:
            value->rValue = model->B1K2L;
            return(0);
        case 112:
            value->rValue = model->B1K2W;
            return(0);
        case 113:
            value->rValue = model->B1eta0;
            return(0);
        case 114:
            value->rValue = model->B1etaL;
            return(0);
        case 115:
            value->rValue = model->B1etaW;
            return(0);
        case 116:
            value->rValue = model->B1etaB0;
            return(0);
        case 117:
            value->rValue = model->B1etaBl;
            return(0);
        case 118:
            value->rValue = model->B1etaBw;
            return(0);
        case 119:
            value->rValue = model->B1etaD0;
            return(0);
        case 120:
            value->rValue = model->B1etaDl;
            return(0);
        case 121:
            value->rValue = model->B1etaDw;
            return(0);
        case 122:
            value->rValue = model->B1deltaL;
            return(0);
        case 123:
            value->rValue = model->B1deltaW;
            return(0);
        case 124:
            value->rValue = model->B1mobZero;
            return(0);
        case 125:
            value->rValue = model->B1mobZeroB0;
            return(0);
        case 126:
            value->rValue = model->B1mobZeroBl;
            return(0);
        case 127:
            value->rValue = model->B1mobZeroBw;
            return(0);
        case 128:
            value->rValue = model->B1mobVdd0;
            return(0);
        case 129:
            value->rValue = model->B1mobVddl;
            return(0);
        case 130:
            value->rValue = model->B1mobVddw;
            return(0);
        case 131:
            value->rValue = model->B1mobVddB0;
            return(0);
        case 132:
            value->rValue = model->B1mobVddBl;
            return(0);
        case 133:
            value->rValue = model->B1mobVddBw;
            return(0);
        case 134:
            value->rValue = model->B1mobVddD0;
            return(0);
        case 135:
            value->rValue = model->B1mobVddDl;
            return(0);
        case 136:
            value->rValue = model->B1mobVddDw;
            return(0);
        case 137:
            value->rValue = model->B1ugs0;
            return(0);
        case 138:
            value->rValue = model->B1ugsL;
            return(0);
        case 139:
            value->rValue = model->B1ugsW;
            return(0);
        case 140:
            value->rValue = model->B1ugsB0;
            return(0);
        case 141:
            value->rValue = model->B1ugsBL;
            return(0);
        case 142:
            value->rValue = model->B1ugsBW;
            return(0);
        case 143:
            value->rValue = model->B1uds0;
            return(0);
        case 144:
            value->rValue = model->B1udsL;
            return(0);
        case 145:
            value->rValue = model->B1udsW;
            return(0);
        case 146:
            value->rValue = model->B1udsB0;
            return(0);
        case 147:
            value->rValue = model->B1udsBL;
            return(0);
        case 148:
            value->rValue = model->B1udsBW;
            return(0);
        case 149:
            value->rValue = model->B1udsD0;
            return(0);
        case 150:
            value->rValue = model->B1udsDL;
            return(0);
        case 151:
            value->rValue = model->B1udsDW;
            return(0);
        case 152:
            value->rValue = model->B1subthSlope0;
            return(0);
        case 153:
            value->rValue = model->B1subthSlopeL;
            return(0);
        case 154:
            value->rValue = model->B1subthSlopeW;
            return(0);
        case 155:
            value->rValue = model->B1subthSlopeB0;
            return(0);
        case 156:
            value->rValue = model->B1subthSlopeBL;
            return(0);
        case 157:
            value->rValue = model->B1subthSlopeBW;
            return(0);
        case 158:
            value->rValue = model->B1subthSlopeD0;
            return(0);
        case 159:
            value->rValue = model->B1subthSlopeDL;
            return(0);
        case 160:
            value->rValue = model->B1subthSlopeDW;
            return(0);
        case 161:
            value->rValue = model->B1oxideThickness;
            return(0);
        case 162:
            value->rValue = model->B1temp;
            return(0);
        case 163:
            value->rValue = model->B1vdd;
            return(0);
        case 164:
            value->rValue = model->B1gateSourceOverlapCap;
            return(0);
        case 165:
            value->rValue = model->B1gateDrainOverlapCap;
            return(0);
        case 166:
            value->rValue = model->B1gateBulkOverlapCap;
            return(0);
        case 167:
            value->iValue = model->B1channelChargePartitionFlag;
            return(0);
        case 168:
            value->rValue = model->B1sheetResistance;
            return(0);
        case 169:
            value->rValue = model->B1jctSatCurDensity;
            return(0);
        case 170:
            value->rValue = model->B1bulkJctPotential;
            return(0);
        case 171:
            value->rValue = model->B1bulkJctBotGradingCoeff;
            return(0);
        case 172:
            value->rValue = model->B1sidewallJctPotential;
            return(0);
        case 173:
            value->rValue = model->B1bulkJctSideGradingCoeff;
            return(0);
        case 174:
            value->rValue = model->B1unitAreaJctCap;
            return(0);
        case 175:
            value->rValue = model->B1unitLengthSidewallJctCap;
            return(0);
        case 176:
            value->rValue = model->B1defaultWidth;
            return(0);
        case 177:
            value->rValue = model->B1deltaLength;
            return(0);
        case 181:
            value->rValue = model->B1fNexp;
            return(0);
        case 180:
            value->rValue = model->B1fNcoef;
            return(0);
        default:
            return(7);
    }
}

variable_types: struct CKTcircuit { struct sGENmodel { int GENmodType; struct sGENmodel *GENnextModel; struct sGENinstance { struct sGENmodel *GENmodPtr; struct sGENinstance *GENnextInstance; char *GENname; int GENowner; int GENstate; int GENnode1; int GENnode2; int GENnode3; int GENnode4; int GENnode5; int GENnode6; int GENnode7; } *GENinstances; char *GENmodName; } **CKThead; struct STATistics { int STATnumIter; int STATtranIter; int STAToldIter; int STATtimePts; int STATaccepted; int STATrejected; double STATtotAnalTime; double STATloadTime; double STATdecompTime; double STATsolveTime; double STATreorderTime; double STATcombineTime; double STATsyncTime; double STATtranTime; double STATtranDecompTime; double STATtranSolveTime; double STATtranLoadTime; double STATtranTruncTime; double STATtranCombTime; double STATtranSyncTime; double STATacTime; double STATacDecompTime; double STATacSolveTime; double STATacLoadTime; double STATacCombTime; double STATacSyncTime; } *CKTstat; double *CKTstates[8]; double CKTtime; double CKTdelta; double CKTdeltaOld[7]; double CKTtemp; double CKTnomTemp; double CKTvt; double CKTag[7]; double CKTagp[7]; int CKTorder; int CKTmaxOrder; int CKTintegrateMethod; void *CKTmatrix; int CKTniState; double *CKTrhs; double *CKTrhsOld; double *CKTrhsSpare; double *CKTirhs; double *CKTirhsOld; double *CKTirhsSpare; double *CKTpred; double *CKTsols[8]; double *CKTrhsOp; double *CKTsenRhs; double *CKTseniRhs; int CKTmaxEqNum; int CKTcurrentAnalysis; struct sCKTnode { char *name; int type; int number; double ic; double nodeset; double *ptr; struct sCKTnode *next; unsigned int icGiven; unsigned int nsGiven; } *CKTnodes; struct sCKTnode *CKTlastNode; int CKTnumStates; long CKTmode; int CKTbypass; int CKTdcMaxIter; int CKTdcTrcvMaxIter; int CKTtranMaxIter; int CKTbreakSize; int CKTbreak; double CKTsaveDelta; double CKTminBreak; double *CKTbreaks; double CKTabstol; double CKTpivotAbsTol; double CKTpivotRelTol; double CKTreltol; double CKTchgtol; double CKTvoltTol; double CKTgmin; double CKTgshunt; double CKTdelmin; double CKTtrtol; double CKTfinalTime; double CKTstep; double CKTmaxStep; double CKTinitTime; double CKTomega; double CKTsrcFact; double CKTdiagGmin; int CKTnumSrcSteps; int CKTnumGminSteps; double CKTgminFactor; int CKTnoncon; double CKTdefaultMosM; double CKTdefaultMosL; double CKTdefaultMosW; double CKTdefaultMosAD; double CKTdefaultMosAS; unsigned int CKThadNodeset; unsigned int CKTfixLimit; unsigned int CKTnoOpIter; unsigned int CKTisSetup; struct sJOB { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; } *CKTcurJob; struct SENstruct { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; int SENnumVal; char **SENdevices; char **SENparmNames; unsigned int SENinitflag; unsigned int SENicflag; unsigned int SENstatus; unsigned int SENacpertflag; int SENmode; int SENparms; double SENpertfac; double **SEN_Sap; double **SEN_RHS; double **SEN_iRHS; int SENsize; void *SEN_Jacmat; double *SEN_parmVal; char **SEN_parmName; } *CKTsenInfo; double *CKTtimePoints; double *CKTdeltaList; int CKTtimeListSize; int CKTtimeIndex; int CKTsizeIncr; unsigned int CKTtryToCompact; unsigned int CKTbadMos3; unsigned int CKTkeepOpInfo; unsigned int CKTcopyNodesets; unsigned int CKTnodeDamping; double CKTabsDv; double CKTrelDv; int CKTtroubleNode; struct sGENinstance *CKTtroubleElt; } *

variable_types:
inst
struct sGENmodel *

variable_types: which int

variable_types: union uIFvalue { int iValue; double rValue; struct sIFcomplex { double real; double imag; } cValue; char *sValue; char *uValue; void *nValue; struct sIFparseTree { int numVars; int *varTypes; union uIFvalue *vars; int (*IFeval)(struct sIFparseTree *, double, double *, double *, double *); } *tValue; struct { int numValue; union { int *iVec; double *rVec; struct sIFcomplex *cVec; char **sVec; char **uVec; void **nVec; } vec; } v; } *

variable_types: struct sBSIM1model { int B1modType; struct sBSIM1model *B1nextModel; struct sBSIM1instance { struct sBSIM1model *B1modPtr; struct sBSIM1instance *B1nextInstance; char *B1name; int B1owner; int B1states; int B1dNode; int B1gNode; int B1sNode; int B1bNode; int B1dNodePrime; int B1sNodePrime; double B1l; double B1w; double B1m; double B1drainArea; double B1sourceArea; double B1drainSquares; double B1sourceSquares; double B1drainPerimeter; double B1sourcePerimeter; double B1sourceConductance; double B1drainConductance; double B1icVBS; double B1icVDS; double B1icVGS; double B1von; double B1vdsat; int B1off; int B1mode; double B1vfb; double B1phi; double B1K1; double B1K2; double B1eta; double B1etaB; double B1etaD; double B1betaZero; double B1betaZeroB; double B1betaVdd; double B1betaVddB; double B1betaVddD; double B1ugs; double B1ugsB; double B1uds; double B1udsB; double B1udsD; double B1subthSlope; double B1subthSlopeB; double B1subthSlopeD; double B1GDoverlapCap; double B1GSoverlapCap; double B1GBoverlapCap; double B1vt0; double B1vdd; double B1temp; double B1oxideThickness; unsigned int B1channelChargePartitionFlag; unsigned int B1lGiven; unsigned int B1wGiven; unsigned int B1mGiven; unsigned int B1drainAreaGiven; unsigned int B1sourceAreaGiven; unsigned int B1drainSquaresGiven; unsigned int B1sourceSquaresGiven; unsigned int B1drainPerimeterGiven; unsigned int B1sourcePerimeterGiven; unsigned int B1dNodePrimeSet; unsigned int B1sNodePrimeSet; unsigned int B1icVBSGiven; unsigned int B1icVDSGiven; unsigned int B1icVGSGiven; unsigned int B1vonGiven; unsigned int B1vdsatGiven; double *B1DdPtr; double *B1GgPtr; double *B1SsPtr; double *B1BbPtr; double *B1DPdpPtr; double *B1SPspPtr; double *B1DdpPtr; double *B1GbPtr; double *B1GdpPtr; double *B1GspPtr; double *B1SspPtr; double *B1BdpPtr; double *B1BspPtr; double *B1DPspPtr; double *B1DPdPtr; double *B1BgPtr; double *B1DPgPtr; double *B1SPgPtr; double *B1SPsPtr; double *B1DPbPtr; double *B1SPbPtr; double *B1SPdpPtr; double B1dCoeffs[82]; double B1nVar[3][5]; } *B1instances; char *B1modName; int B1type; double B1vfb0; double B1vfbL; double B1vfbW; double B1phi0; double B1phiL; double B1phiW; double B1K10; double B1K1L; double B1K1W; double B1K20; double B1K2L; double B1K2W; double B1eta0; double B1etaL; double B1etaW; double B1etaB0; double B1etaBl; double B1etaBw; double B1etaD0; double B1etaDl; double B1etaDw; double B1deltaL; double B1deltaW; double B1mobZero; double B1mobZeroB0; double B1mobZeroBl; double B1mobZeroBw; double B1mobVdd0; double B1mobVddl; double B1mobVddw; double B1mobVddB0; double B1mobVddBl; double B1mobVddBw; double B1mobVddD0; double B1mobVddDl; double B1mobVddDw; double B1ugs0; double B1ugsL; double B1ugsW; double B1ugsB0; double B1ugsBL; double B1ugsBW; double B1uds0; double B1udsL; double B1udsW; double B1udsB0; double B1udsBL; double B1udsBW; double B1udsD0; double B1udsDL; double B1udsDW; double B1subthSlope0; double B1subthSlopeL; double B1subthSlopeW; double B1subthSlopeB0; double B1subthSlopeBL; double B1subthSlopeBW; double B1subthSlopeD0; double B1subthSlopeDL; double B1subthSlopeDW; double B1oxideThickness; double B1Cox; double B1temp; double B1vdd; double B1gateSourceOverlapCap; double B1gateDrainOverlapCap; double B1gateBulkOverlapCap; double B1channelChargePartitionFlag; double B1sheetResistance; double B1jctSatCurDensity; double B1bulkJctPotential; double B1bulkJctBotGradingCoeff; double B1bulkJctSideGradingCoeff; double B1sidewallJctPotential; double B1unitAreaJctCap; double B1unitLengthSidewallJctCap; double B1defaultWidth; double B1deltaLength; double B1fNcoef; double B1fNexp; unsigned int B1vfb0Given; unsigned int B1vfbLGiven; unsigned int B1vfbWGiven; unsigned int B1phi0Given; unsigned int B1phiLGiven; unsigned int B1phiWGiven; unsigned int B1K10Given; unsigned int B1K1LGiven; unsigned int B1K1WGiven; unsigned int B1K20Given; unsigned int B1K2LGiven; unsigned int B1K2WGiven; unsigned int B1eta0Given; unsigned int B1etaLGiven; unsigned int B1etaWGiven; unsigned int B1etaB0Given; unsigned int B1etaBlGiven; unsigned int B1etaBwGiven; unsigned int B1etaD0Given; unsigned int B1etaDlGiven; unsigned int B1etaDwGiven; unsigned int B1deltaLGiven; unsigned int B1deltaWGiven; unsigned int B1mobZeroGiven; unsigned int B1mobZeroB0Given; unsigned int B1mobZeroBlGiven; unsigned int B1mobZeroBwGiven; unsigned int B1mobVdd0Given; unsigned int B1mobVddlGiven; unsigned int B1mobVddwGiven; unsigned int B1mobVddB0Given; unsigned int B1mobVddBlGiven; unsigned int B1mobVddBwGiven; unsigned int B1mobVddD0Given; unsigned int B1mobVddDlGiven; unsigned int B1mobVddDwGiven; unsigned int B1ugs0Given; unsigned int B1ugsLGiven; unsigned int B1ugsWGiven; unsigned int B1ugsB0Given; unsigned int B1ugsBLGiven; unsigned int B1ugsBWGiven; unsigned int B1uds0Given; unsigned int B1udsLGiven; unsigned int B1udsWGiven; unsigned int B1udsB0Given; unsigned int B1udsBLGiven; unsigned int B1udsBWGiven; unsigned int B1udsD0Given; unsigned int B1udsDLGiven; unsigned int B1udsDWGiven; unsigned int B1subthSlope0Given; unsigned int B1subthSlopeLGiven; unsigned int B1subthSlopeWGiven; unsigned int B1subthSlopeB0Given; unsigned int B1subthSlopeBLGiven; unsigned int B1subthSlopeBWGiven; unsigned int B1subthSlopeD0Given; unsigned int B1subthSlopeDLGiven; unsigned int B1subthSlopeDWGiven; unsigned int B1oxideThicknessGiven; unsigned int B1tempGiven; unsigned int B1vddGiven; unsigned int B1gateSourceOverlapCapGiven; unsigned int B1gateDrainOverlapCapGiven; unsigned int B1gateBulkOverlapCapGiven; unsigned int B1channelChargePartitionFlagGiven; unsigned int B1sheetResistanceGiven; unsigned int B1jctSatCurDensityGiven; unsigned int B1bulkJctPotentialGiven; unsigned int B1bulkJctBotGradingCoeffGiven; unsigned int B1sidewallJctPotentialGiven; unsigned int B1bulkJctSideGradingCoeffGiven; unsigned int B1unitAreaJctCapGiven; unsigned int B1unitLengthSidewallJctCapGiven; unsigned int B1defaultWidthGiven; unsigned int B1deltaLengthGiven; unsigned int B1fNcoefGiven; unsigned int B1fNexpGiven; unsigned int B1typeGiven; } *

return_type: int

user_defined_types: struct CKTcircuit { struct sGENmodel **CKThead; struct STATistics *CKTstat; double *CKTstates[8]; double CKTtime; double CKTdelta; double CKTdeltaOld[7]; double CKTtemp; double CKTnomTemp; double CKTvt; double CKTag[7]; double CKTagp[7]; int CKTorder; int CKTmaxOrder; int CKTintegrateMethod; void *CKTmatrix; int CKTniState; double *CKTrhs; double *CKTrhsOld; double *CKTrhsSpare; double *CKTirhs; double *CKTirhsOld; double *CKTirhsSpare; double *CKTpred; double *CKTsols[8]; double *CKTrhsOp; double *CKTsenRhs; double *CKTseniRhs; int CKTmaxEqNum; int CKTcurrentAnalysis; struct sCKTnode *CKTnodes; struct sCKTnode *CKTlastNode; int CKTnumStates; long CKTmode; int CKTbypass; int CKTdcMaxIter; int CKTdcTrcvMaxIter; int CKTtranMaxIter; int CKTbreakSize; int CKTbreak; double CKTsaveDelta; double CKTminBreak; double *CKTbreaks; double CKTabstol; double CKTpivotAbsTol; double CKTpivotRelTol; double CKTreltol; double CKTchgtol; double CKTvoltTol; double CKTgmin; double CKTgshunt; double CKTdelmin; double CKTtrtol; double CKTfinalTime; double CKTstep; double CKTmaxStep; double CKTinitTime; double CKTomega; double CKTsrcFact; double CKTdiagGmin; int CKTnumSrcSteps; int CKTnumGminSteps; double CKTgminFactor; int CKTnoncon; double CKTdefaultMosM; double CKTdefaultMosL; double CKTdefaultMosW; double CKTdefaultMosAD; double CKTdefaultMosAS; unsigned int CKThadNodeset; unsigned int CKTfixLimit; unsigned int CKTnoOpIter; unsigned int CKTisSetup; struct sJOB *CKTcurJob; struct SENstruct *CKTsenInfo; double *CKTtimePoints; double *CKTdeltaList; int CKTtimeListSize; int CKTtimeIndex; int CKTsizeIncr; unsigned int CKTtryToCompact; unsigned int CKTbadMos3; unsigned int CKTkeepOpInfo; unsigned int CKTcopyNodesets; unsigned int CKTnodeDamping; double CKTabsDv; double CKTrelDv; int CKTtroubleNode; struct sGENinstance *CKTtroubleElt; }

user_defined_types: union uIFvalue { int iValue; double rValue; struct sIFcomplex cValue; char *sValue; char *uValue; void *nValue; struct sIFparseTree *tValue; struct { int numValue; union { int *iVec; double *rVec; struct sIFcomplex *cVec; char **sVec; char **uVec; void **nVec; } vec; } v; }

user_defined_types: struct sBSIM1model { int B1modType; struct sBSIM1model *B1nextModel; struct sBSIM1instance *B1instances; char *B1modName; int B1type; double B1vfb0; double B1vfbL; double B1vfbW; double B1phi0; double B1phiL; double B1phiW; double B1K10; double B1K1L; double B1K1W; double B1K20; double B1K2L; double B1K2W; double B1eta0; double B1etaL; double B1etaW; double B1etaB0; double B1etaBl; double B1etaBw; double B1etaD0; double B1etaDl; double B1etaDw; double B1deltaL; double B1deltaW; double B1mobZero; double B1mobZeroB0; double B1mobZeroBl; double B1mobZeroBw; double B1mobVdd0; double B1mobVddl; double B1mobVddw; double B1mobVddB0; double B1mobVddBl; double B1mobVddBw; double B1mobVddD0; double B1mobVddDl; double B1mobVddDw; double B1ugs0; double B1ugsL; double B1ugsW; double B1ugsB0; double B1ugsBL; double B1ugsBW; double B1uds0; double B1udsL; double B1udsW; double B1udsB0; double B1udsBL; double B1udsBW; double B1udsD0; double B1udsDL; double B1udsDW; double B1subthSlope0; double B1subthSlopeL; double B1subthSlopeW; double B1subthSlopeB0; double B1subthSlopeBL; double B1subthSlopeBW; double B1subthSlopeD0; double B1subthSlopeDL; double B1subthSlopeDW; double B1oxideThickness; double B1Cox; double B1temp; double B1vdd; double B1gateSourceOverlapCap; double B1gateDrainOverlapCap; double B1gateBulkOverlapCap; double B1channelChargePartitionFlag; double B1sheetResistance; double B1jctSatCurDensity; double B1bulkJctPotential; double B1bulkJctBotGradingCoeff; double B1bulkJctSideGradingCoeff; double B1sidewallJctPotential; double B1unitAreaJctCap; double B1unitLengthSidewallJctCap; double B1defaultWidth; double B1deltaLength; double B1fNcoef; double B1fNexp; unsigned int B1vfb0Given; unsigned int B1vfbLGiven; unsigned int B1vfbWGiven; unsigned int B1phi0Given; unsigned int B1phiLGiven; unsigned int B1phiWGiven; unsigned int B1K10Given; unsigned int B1K1LGiven; unsigned int B1K1WGiven; unsigned int B1K20Given; unsigned int B1K2LGiven; unsigned int B1K2WGiven; unsigned int B1eta0Given; unsigned int B1etaLGiven; unsigned int B1etaWGiven; unsigned int B1etaB0Given; unsigned int B1etaBlGiven; unsigned int B1etaBwGiven; unsigned int B1etaD0Given; unsigned int B1etaDlGiven; unsigned int B1etaDwGiven; unsigned int B1deltaLGiven; unsigned int B1deltaWGiven; unsigned int B1mobZeroGiven; unsigned int B1mobZeroB0Given; unsigned int B1mobZeroBlGiven; unsigned int B1mobZeroBwGiven; unsigned int B1mobVdd0Given; unsigned int B1mobVddlGiven; unsigned int B1mobVddwGiven; unsigned int B1mobVddB0Given; unsigned int B1mobVddBlGiven; unsigned int B1mobVddBwGiven; unsigned int B1mobVddD0Given; unsigned int B1mobVddDlGiven; unsigned int B1mobVddDwGiven; unsigned int B1ugs0Given; unsigned int B1ugsLGiven; unsigned int B1ugsWGiven; unsigned int B1ugsB0Given; unsigned int B1ugsBLGiven; unsigned int B1ugsBWGiven; unsigned int B1uds0Given; unsigned int B1udsLGiven; unsigned int B1udsWGiven; unsigned int B1udsB0Given; unsigned int B1udsBLGiven; unsigned int B1udsBWGiven; unsigned int B1udsD0Given; unsigned int B1udsDLGiven; unsigned int B1udsDWGiven; unsigned int B1subthSlope0Given; unsigned int B1subthSlopeLGiven; unsigned int B1subthSlopeWGiven; unsigned int B1subthSlopeB0Given; unsigned int B1subthSlopeBLGiven; unsigned int B1subthSlopeBWGiven; unsigned int B1subthSlopeD0Given; unsigned int B1subthSlopeDLGiven; unsigned int B1subthSlopeDWGiven; unsigned int B1oxideThicknessGiven; unsigned int B1tempGiven; unsigned int B1vddGiven; unsigned int B1gateSourceOverlapCapGiven; unsigned int B1gateDrainOverlapCapGiven; unsigned int B1gateBulkOverlapCapGiven; unsigned int B1channelChargePartitionFlagGiven; unsigned int B1sheetResistanceGiven; unsigned int B1jctSatCurDensityGiven; unsigned int B1bulkJctPotentialGiven; unsigned int B1bulkJctBotGradingCoeffGiven; unsigned int B1sidewallJctPotentialGiven; unsigned int B1bulkJctSideGradingCoeffGiven; unsigned int B1unitAreaJctCapGiven; unsigned int B1unitLengthSidewallJctCapGiven; unsigned int B1defaultWidthGiven; unsigned int B1deltaLengthGiven; unsigned int B1fNcoefGiven; unsigned int B1fNexpGiven; unsigned int B1typeGiven; }

user_defined_types: struct sGENmodel { int GENmodType; struct sGENmodel *GENnextModel; struct sGENinstance *GENinstances; char *GENmodName; }


MESpzLoad

original_code:
int
MESpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
{
    MESmodel *model = (MESmodel*)inModel;
    MESinstance *here;
    double gdpr;
    double gspr;
    double gm;
    double gds;
    double ggs;
    double xgs;
    double ggd;
    double xgd;
    double m;
    for( ; model != ((void *)0); model = model->MESnextModel ) {
        for( here = model->MESinstances; here != ((void *)0);
                here = here->MESnextInstance) {
     if (here->MESowner != ARCHme) continue;
            m = here->MESm;
            gdpr=model->MESdrainConduct * here->MESarea;
            gspr=model->MESsourceConduct * here->MESarea;
            gm= *(ckt->CKTstates[0] + here->MESstate+5) ;
            gds= *(ckt->CKTstates[0] + here->MESstate+6) ;
            ggs= *(ckt->CKTstates[0] + here->MESstate+7) ;
            xgs= *(ckt->CKTstates[0] + here->MESstate+9) ;
            ggd= *(ckt->CKTstates[0] + here->MESstate+8) ;
            xgd= *(ckt->CKTstates[0] + here->MESstate+11) ;
            *(here->MESdrainDrainPtr ) += m * gdpr;
            *(here->MESgateGatePtr ) += m * ggd+ggs;
            *(here->MESgateGatePtr ) += m * (xgd+xgs)*s->real;
            *(here->MESgateGatePtr +1) += m * (xgd+xgs)*s->imag;
            *(here->MESsourceSourcePtr ) += m * gspr;
            *(here->MESdrainPrimeDrainPrimePtr ) += m * gdpr+gds+ggd;
            *(here->MESdrainPrimeDrainPrimePtr ) += m * xgd*s->real;
            *(here->MESdrainPrimeDrainPrimePtr +1) += m * xgd*s->imag;
            *(here->MESsourcePrimeSourcePrimePtr ) += m * gspr+gds+gm+ggs;
            *(here->MESsourcePrimeSourcePrimePtr ) += m * xgs*s->real;
            *(here->MESsourcePrimeSourcePrimePtr +1) += m * xgs*s->imag;
            *(here->MESdrainDrainPrimePtr ) -= m * gdpr;
            *(here->MESgateDrainPrimePtr ) -= m * ggd;
            *(here->MESgateDrainPrimePtr ) -= m * xgd*s->real;
            *(here->MESgateDrainPrimePtr +1) -= m * xgd*s->imag;
            *(here->MESgateSourcePrimePtr ) -= m * ggs;
            *(here->MESgateSourcePrimePtr ) -= m * xgs*s->real;
            *(here->MESgateSourcePrimePtr +1) -= m * xgs*s->imag;
            *(here->MESsourceSourcePrimePtr ) -= m * gspr;
            *(here->MESdrainPrimeDrainPtr ) -= m * gdpr;
            *(here->MESdrainPrimeGatePtr ) += m * (-ggd+gm);
            *(here->MESdrainPrimeGatePtr ) -= m * xgd*s->real;
            *(here->MESdrainPrimeGatePtr +1) -= m * xgd*s->imag;
            *(here->MESdrainPrimeSourcePrimePtr ) += m * (-gds-gm);
            *(here->MESsourcePrimeGatePtr ) += m * (-ggs-gm);
            *(here->MESsourcePrimeGatePtr ) -= m * xgs*s->real;
            *(here->MESsourcePrimeGatePtr +1) -= m * xgs*s->imag;
            *(here->MESsourcePrimeSourcePtr ) -= m * gspr;
            *(here->MESsourcePrimeDrainPrimePtr ) -= m * gds;
        }
    }
    return(0);
}

canonical_original_code:
int MESpzLoad(struct sGENmodel *inModel, struct CKTcircuit *ckt, struct SPcomplex *s)
{
    struct sMESmodel *model = (MESmodel*)inModel;
    struct sMESinstance *here;
    double gdpr;
    double gspr;
    double gm;
    double gds;
    double ggs;
    double xgs;
    double ggd;
    double xgd;
    double m;
    for( ; model != ((void *)0); model = model->MESnextModel ) {
        for( here = model->MESinstances; here != ((void *)0);
                here = here->MESnextInstance) {
     if (here->MESowner != ARCHme) continue;
            m = here->MESm;
            gdpr=model->MESdrainConduct * here->MESarea;
            gspr=model->MESsourceConduct * here->MESarea;
            gm= *(ckt->CKTstates[0] + here->MESstate+5) ;
            gds= *(ckt->CKTstates[0] + here->MESstate+6) ;
            ggs= *(ckt->CKTstates[0] + here->MESstate+7) ;
            xgs= *(ckt->CKTstates[0] + here->MESstate+9) ;
            ggd= *(ckt->CKTstates[0] + here->MESstate+8) ;
            xgd= *(ckt->CKTstates[0] + here->MESstate+11) ;
            *(here->MESdrainDrainPtr ) += m * gdpr;
            *(here->MESgateGatePtr ) += m * ggd+ggs;
            *(here->MESgateGatePtr ) += m * (xgd+xgs)*s->real;
            *(here->MESgateGatePtr +1) += m * (xgd+xgs)*s->imag;
            *(here->MESsourceSourcePtr ) += m * gspr;
            *(here->MESdrainPrimeDrainPrimePtr ) += m * gdpr+gds+ggd;
            *(here->MESdrainPrimeDrainPrimePtr ) += m * xgd*s->real;
            *(here->MESdrainPrimeDrainPrimePtr +1) += m * xgd*s->imag;
            *(here->MESsourcePrimeSourcePrimePtr ) += m * gspr+gds+gm+ggs;
            *(here->MESsourcePrimeSourcePrimePtr ) += m * xgs*s->real;
            *(here->MESsourcePrimeSourcePrimePtr +1) += m * xgs*s->imag;
            *(here->MESdrainDrainPrimePtr ) -= m * gdpr;
            *(here->MESgateDrainPrimePtr ) -= m * ggd;
            *(here->MESgateDrainPrimePtr ) -= m * xgd*s->real;
            *(here->MESgateDrainPrimePtr +1) -= m * xgd*s->imag;
            *(here->MESgateSourcePrimePtr ) -= m * ggs;
            *(here->MESgateSourcePrimePtr ) -= m * xgs*s->real;
            *(here->MESgateSourcePrimePtr +1) -= m * xgs*s->imag;
            *(here->MESsourceSourcePrimePtr ) -= m * gspr;
            *(here->MESdrainPrimeDrainPtr ) -= m * gdpr;
            *(here->MESdrainPrimeGatePtr ) += m * (-ggd+gm);
            *(here->MESdrainPrimeGatePtr ) -= m * xgd*s->real;
            *(here->MESdrainPrimeGatePtr +1) -= m * xgd*s->imag;
            *(here->MESdrainPrimeSourcePrimePtr ) += m * (-gds-gm);
            *(here->MESsourcePrimeGatePtr ) += m * (-ggs-gm);
            *(here->MESsourcePrimeGatePtr ) -= m * xgs*s->real;
            *(here->MESsourcePrimeGatePtr +1) -= m * xgs*s->imag;
            *(here->MESsourcePrimeSourcePtr ) -= m * gspr;
            *(here->MESsourcePrimeDrainPrimePtr ) -= m * gds;
        }
    }
    return(0);
}

variable_types: struct SPcomplex { double real; double imag; } *

variable_types: struct sMESmodel { int MESmodType; struct sMESmodel *MESnextModel; struct sMESinstance { struct sMESmodel *MESmodPtr; struct sMESinstance *MESnextInstance; char *MESname; int MESowner; int MESstate; int MESdrainNode; int MESgateNode; int MESsourceNode; int MESdrainPrimeNode; int MESsourcePrimeNode; double MESarea; double MESm; double MESicVDS; double MESicVGS; double *MESdrainDrainPrimePtr; double *MESgateDrainPrimePtr; double *MESgateSourcePrimePtr; double *MESsourceSourcePrimePtr; double *MESdrainPrimeDrainPtr; double *MESdrainPrimeGatePtr; double *MESdrainPrimeSourcePrimePtr; double *MESsourcePrimeGatePtr; double *MESsourcePrimeSourcePtr; double *MESsourcePrimeDrainPrimePtr; double *MESdrainDrainPtr; double *MESgateGatePtr; double *MESsourceSourcePtr; double *MESdrainPrimeDrainPrimePtr; double *MESsourcePrimeSourcePrimePtr; int MESoff; unsigned int MESareaGiven; unsigned int MESmGiven; unsigned int MESicVDSGiven; unsigned int MESicVGSGiven; int MESmode; double MESdCoeffs[27]; double MESnVar[3][5]; } *MESinstances; char *MESmodName; int MEStype; double MESthreshold; double MESalpha; double MESbeta; double MESlModulation; double MESb; double MESdrainResist; double MESsourceResist; double MEScapGS; double MEScapGD; double MESgatePotential; double MESgateSatCurrent; double MESdepletionCapCoeff; double MESfNcoef; double MESfNexp; double MESdrainConduct; double MESsourceConduct; double MESdepletionCap; double MESf1; double MESf2; double MESf3; double MESvcrit; unsigned int MESthresholdGiven; unsigned int MESalphaGiven; unsigned int MESbetaGiven; unsigned int MESlModulationGiven; unsigned int MESbGiven; unsigned int MESdrainResistGiven; unsigned int MESsourceResistGiven; unsigned int MEScapGSGiven; unsigned int MEScapGDGiven; unsigned int MESgatePotentialGiven; unsigned int MESgateSatCurrentGiven; unsigned int MESdepletionCapCoeffGiven; unsigned int MESfNcoefGiven; unsigned int MESfNexpGiven; } *

variable_types: struct sMESinstance { struct sMESmodel { int MESmodType; struct sMESmodel *MESnextModel; struct sMESinstance *MESinstances; char *MESmodName; int MEStype; double MESthreshold; double MESalpha; double MESbeta; double MESlModulation; double MESb; double MESdrainResist; double MESsourceResist; double MEScapGS; double MEScapGD; double MESgatePotential; double MESgateSatCurrent; double MESdepletionCapCoeff; double MESfNcoef; double MESfNexp; double MESdrainConduct; double MESsourceConduct; double MESdepletionCap; double MESf1; double MESf2; double MESf3; double MESvcrit; unsigned int MESthresholdGiven; unsigned int MESalphaGiven; unsigned int MESbetaGiven; unsigned int MESlModulationGiven; unsigned int MESbGiven; unsigned int MESdrainResistGiven; unsigned int MESsourceResistGiven; unsigned int MEScapGSGiven; unsigned int MEScapGDGiven; unsigned int MESgatePotentialGiven; unsigned int MESgateSatCurrentGiven; unsigned int MESdepletionCapCoeffGiven; unsigned int MESfNcoefGiven; unsigned int MESfNexpGiven; } *MESmodPtr; struct sMESinstance *MESnextInstance; char *MESname; int MESowner; int MESstate; int MESdrainNode; int MESgateNode; int MESsourceNode; int MESdrainPrimeNode; int MESsourcePrimeNode; double MESarea; double MESm; double MESicVDS; double MESicVGS; double *MESdrainDrainPrimePtr; double *MESgateDrainPrimePtr; double *MESgateSourcePrimePtr; double *MESsourceSourcePrimePtr; double *MESdrainPrimeDrainPtr; double *MESdrainPrimeGatePtr; double *MESdrainPrimeSourcePrimePtr; double *MESsourcePrimeGatePtr; double *MESsourcePrimeSourcePtr; double *MESsourcePrimeDrainPrimePtr; double *MESdrainDrainPtr; double *MESgateGatePtr; double *MESsourceSourcePtr; double *MESdrainPrimeDrainPrimePtr; double *MESsourcePrimeSourcePrimePtr; int MESoff; unsigned int MESareaGiven; unsigned int MESmGiven; unsigned int MESicVDSGiven; unsigned int MESicVGSGiven; int MESmode; double MESdCoeffs[27]; double MESnVar[3][5]; } *

variable_types: gdpr double

variable_types: gspr double

variable_types: gm double

variable_types: gds double

variable_types: ggs double

variable_types: xgs double

variable_types: ggd double

variable_types: xgd double

variable_types: m double

user_defined_types: struct sGENinstance { struct sGENmodel *GENmodPtr; struct sGENinstance *GENnextInstance; char *GENname; int GENowner; int GENstate; int GENnode1; int GENnode2; int GENnode3; int GENnode4; int GENnode5; int GENnode6; int GENnode7; }

user_defined_types: struct STATistics { int STATnumIter; int STATtranIter; int STAToldIter; int STATtimePts; int STATaccepted; int STATrejected; double STATtotAnalTime; double STATloadTime; double STATdecompTime; double STATsolveTime; double STATreorderTime; double STATcombineTime; double STATsyncTime; double STATtranTime; double STATtranDecompTime; double STATtranSolveTime; double STATtranLoadTime; double STATtranTruncTime; double STATtranCombTime; double STATtranSyncTime; double STATacTime; double STATacDecompTime; double STATacSolveTime; double STATacLoadTime; double STATacCombTime; double STATacSyncTime; }

user_defined_types: struct sCKTnode { char *name; int type; int number; double ic; double nodeset; double *ptr; struct sCKTnode *next; unsigned int icGiven; unsigned int nsGiven; }

user_defined_types: struct sJOB { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; }

user_defined_types: struct SENstruct { int JOBtype; struct sJOB *JOBnextJob; char *JOBname; int SENnumVal; char **SENdevices; char **SENparmNames; unsigned int SENinitflag; unsigned int SENicflag; unsigned int SENstatus; unsigned int SENacpertflag; int SENmode; int SENparms; double SENpertfac; double **SEN_Sap; double **SEN_RHS; double **SEN_iRHS; int SENsize; void *SEN_Jacmat; double *SEN_parmVal; char **SEN_parmName; }