decompiled_code:
__int64 __fastcall B2ask(__int64 a1, __int64 a2, int a3, double *a4)
{
__int64 result; // rax
__int64 v5; // rdx
__int64 v6; // rdx
__int64 v7; // rdx
__int64 v8; // rdx
__int64 v9; // rdx
__int64 v10; // rdx
__int64 v11; // rdx
__int64 v12; // rdx
__int64 v13; // rdx
__int64 v14; // rdx
__int64 v15; // rdx
__int64 v16; // rdx
__int64 v17; // rdx
__int64 v18; // rdx
__int64 v19; // rdx
__int64 v20; // rdx
__int64 v21; // rdx
__int64 v22; // rdx
__int64 v23; // rdx
__int64 v24; // rdx
__int64 v25; // rdx
__int64 v26; // rdx
__int64 v27; // rdx
__int64 v28; // rdx
__int64 v29; // rdx
__int64 v30; // rdx
__int64 v31; // rdx
__int64 v32; // rdx
__int64 v33; // rdx
__int64 v34; // rdx
__int64 v35; // rdx
__int64 v36; // rdx

switch ( a3 )
{
case 1:
*a4 = *(double *)(a2 + 64);
result = 0LL;
break;
case 2:
*a4 = *(double *)(a2 + 56);
result = 0LL;
break;
case 3:
*a4 = *(double *)(a2 + 80);
result = 0LL;
break;
case 4:
*a4 = *(double *)(a2 + 72);
result = 0LL;
break;
case 5:
*a4 = *(double *)(a2 + 112);
result = 0LL;
break;
case 6:
*a4 = *(double *)(a2 + 104);
result = 0LL;
break;
case 7:
*a4 = *(double *)(a2 + 96);
result = 0LL;
break;
case 8:
*a4 = *(double *)(a2 + 88);
result = 0LL;
break;
case 9:
*a4 = (double)*(int *)(a2 + 176);
result = 0LL;
break;
case 10:
*a4 = *(double *)(a2 + 136);
result = 0LL;
break;
case 11:
*a4 = *(double *)(a2 + 144);
result = 0LL;
break;
case 12:
*a4 = *(double *)(a2 + 152);
result = 0LL;
break;
case 241:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 28);
result = 0LL;
break;
case 242:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 32);
result = 0LL;
break;
case 243:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 36);
result = 0LL;
break;
case 244:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 40);
result = 0LL;
break;
case 245:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 44);
result = 0LL;
break;
case 246:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 48);
result = 0LL;
break;
case 247:
v5 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v5 )
{
*a4 = *(double *)(v5 + 8LL * *(int *)(a2 + 24));
result = 0LL;
}
break;
case 248:
v6 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v6 )
{
*a4 = *(double *)(v6 + 8LL * *(int *)(a2 + 24) + 8);
result = 0LL;
}
break;
case 249:
v7 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v7 )
{
*a4 = *(double *)(v7 + 8LL * *(int *)(a2 + 24) + 16);
result = 0LL;
}
break;
case 250:
v8 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v8 )
{
*a4 = *(double *)(v8 + 8LL * *(int *)(a2 + 24) + 24);
result = 0LL;
}
break;
case 251:
v9 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v9 )
{
*a4 = *(double *)(v9 + 8LL * *(int *)(a2 + 24) + 32);
result = 0LL;
}
break;
case 252:
v10 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v10 )
{
*a4 = *(double *)(v10 + 8LL * *(int *)(a2 + 24) + 40);
result = 0LL;
}
break;
case 253:
v11 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v11 )
{
*a4 = *(double *)(v11 + 8LL * *(int *)(a2 + 24) + 48);
result = 0LL;
}
break;
case 254:
v12 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v12 )
{
*a4 = *(double *)(v12 + 8LL * *(int *)(a2 + 24) + 56);
result = 0LL;
}
break;
case 255:
v13 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v13 )
{
*a4 = *(double *)(v13 + 8LL * *(int *)(a2 + 24) + 64);
result = 0LL;
}
break;
case 256:
v14 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v14 )
{
*a4 = *(double *)(v14 + 8LL * *(int *)(a2 + 24) + 72);
result = 0LL;
}
break;
case 257:
v15 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v15 )
{
*a4 = *(double *)(v15 + 8LL * *(int *)(a2 + 24) + 80);
result = 0LL;
}
break;
case 258:
v16 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v16 )
{
*a4 = *(double *)(v16 + 8LL * *(int *)(a2 + 24) + 88);
result = 0LL;
}
break;
case 259:
v17 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v17 )
{
*a4 = *(double *)(v17 + 8LL * *(int *)(a2 + 24) + 96);
result = 0LL;
}
break;
case 260:
v18 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v18 )
{
*a4 = *(double *)(v18 + 8LL * *(int *)(a2 + 24) + 104);
result = 0LL;
}
break;
case 261:
v19 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v19 )
{
*a4 = *(double *)(v19 + 8LL * *(int *)(a2 + 24) + 112);
result = 0LL;
}
break;
case 262:
v20 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v20 )
{
*a4 = *(double *)(v20 + 8LL * *(int *)(a2 + 24) + 120);
result = 0LL;
}
break;
case 263:
v21 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v21 )
{
*a4 = *(double *)(v21 + 8LL * *(int *)(a2 + 24) + 128);
result = 0LL;
}
break;
case 264:
v22 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v22 )
{
*a4 = *(double *)(v22 + 8LL * *(int *)(a2 + 24) + 136);
result = 0LL;
}
break;
case 265:
v23 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v23 )
{
*a4 = *(double *)(v23 + 8LL * *(int *)(a2 + 24) + 144);
result = 0LL;
}
break;
case 266:
v24 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v24 )
{
*a4 = *(double *)(v24 + 8LL * *(int *)(a2 + 24) + 152);
result = 0LL;
}
break;
case 267:
v25 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v25 )
{
*a4 = *(double *)(v25 + 8LL * *(int *)(a2 + 24) + 160);
result = 0LL;
}
break;
case 268:
v26 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v26 )
{
*a4 = *(double *)(v26 + 8LL * *(int *)(a2 + 24) + 168);
result = 0LL;
}
break;
case 269:
v27 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v27 )
{
*a4 = *(double *)(v27 + 8LL * *(int *)(a2 + 24) + 192);
result = 0LL;
}
break;
case 270:
v28 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v28 )
{
*a4 = *(double *)(v28 + 8LL * *(int *)(a2 + 24) + 200);
result = 0LL;
}
break;
case 271:
v29 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v29 )
{
*a4 = *(double *)(v29 + 8LL * *(int *)(a2 + 24) + 208);
result = 0LL;
}
break;
case 272:
v30 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v30 )
{
*a4 = *(double *)(v30 + 8LL * *(int *)(a2 + 24) + 216);
result = 0LL;
}
break;
case 273:
v31 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v31 )
{
*a4 = *(double *)(v31 + 8LL * *(int *)(a2 + 24) + 224);
result = 0LL;
}
break;
case 274:
v32 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v32 )
{
*a4 = *(double *)(v32 + 8LL * *(int *)(a2 + 24) + 232);
result = 0LL;
}
break;
case 275:
v33 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v33 )
{
*a4 = *(double *)(v33 + 8LL * *(int *)(a2 + 24) + 240);
result = 0LL;
}
break;
case 276:
v34 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v34 )
{
*a4 = *(double *)(v34 + 8LL * *(int *)(a2 + 24) + 248);
result = 0LL;
}
break;
case 277:
v35 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v35 )
{
*a4 = *(double *)(v35 + 8LL * *(int *)(a2 + 24) + 264);
result = 0LL;
}
break;
case 278:
v36 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v36 )
{
*a4 = *(double *)(v36 + 8LL * *(int *)(a2 + 24) + 272);
result = 0LL;
}
break;
case 279:
*a4 = *(double *)(a2 + 120);
result = 0LL;
break;
case 280:
*a4 = *(double *)(a2 + 128);
result = 0LL;
break;
default:
result = 7LL;
break;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, int a3, double *a4)
{
__int64 result; // rax
__int64 v5; // rdx
__int64 v6; // rdx
__int64 v7; // rdx
__int64 v8; // rdx
__int64 v9; // rdx
__int64 v10; // rdx
__int64 v11; // rdx
__int64 v12; // rdx
__int64 v13; // rdx
__int64 v14; // rdx
__int64 v15; // rdx
__int64 v16; // rdx
__int64 v17; // rdx
__int64 v18; // rdx
__int64 v19; // rdx
__int64 v20; // rdx
__int64 v21; // rdx
__int64 v22; // rdx
__int64 v23; // rdx
__int64 v24; // rdx
__int64 v25; // rdx
__int64 v26; // rdx
__int64 v27; // rdx
__int64 v28; // rdx
__int64 v29; // rdx
__int64 v30; // rdx
__int64 v31; // rdx
__int64 v32; // rdx
__int64 v33; // rdx
__int64 v34; // rdx
__int64 v35; // rdx
__int64 v36; // rdx

switch ( a3 )
{
case 1:
*a4 = *(double *)(a2 + 64);
result = 0LL;
break;
case 2:
*a4 = *(double *)(a2 + 56);
result = 0LL;
break;
case 3:
*a4 = *(double *)(a2 + 80);
result = 0LL;
break;
case 4:
*a4 = *(double *)(a2 + 72);
result = 0LL;
break;
case 5:
*a4 = *(double *)(a2 + 112);
result = 0LL;
break;
case 6:
*a4 = *(double *)(a2 + 104);
result = 0LL;
break;
case 7:
*a4 = *(double *)(a2 + 96);
result = 0LL;
break;
case 8:
*a4 = *(double *)(a2 + 88);
result = 0LL;
break;
case 9:
*a4 = (double)*(int *)(a2 + 176);
result = 0LL;
break;
case 10:
*a4 = *(double *)(a2 + 136);
result = 0LL;
break;
case 11:
*a4 = *(double *)(a2 + 144);
result = 0LL;
break;
case 12:
*a4 = *(double *)(a2 + 152);
result = 0LL;
break;
case 241:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 28);
result = 0LL;
break;
case 242:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 32);
result = 0LL;
break;
case 243:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 36);
result = 0LL;
break;
case 244:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 40);
result = 0LL;
break;
case 245:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 44);
result = 0LL;
break;
case 246:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 48);
result = 0LL;
break;
case 247:
v5 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v5 )
{
*a4 = *(double *)(v5 + 8LL * *(int *)(a2 + 24));
result = 0LL;
}
break;
case 248:
v6 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v6 )
{
*a4 = *(double *)(v6 + 8LL * *(int *)(a2 + 24) + 8);
result = 0LL;
}
break;
case 249:
v7 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v7 )
{
*a4 = *(double *)(v7 + 8LL * *(int *)(a2 + 24) + 16);
result = 0LL;
}
break;
case 250:
v8 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v8 )
{
*a4 = *(double *)(v8 + 8LL * *(int *)(a2 + 24) + 24);
result = 0LL;
}
break;
case 251:
v9 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v9 )
{
*a4 = *(double *)(v9 + 8LL * *(int *)(a2 + 24) + 32);
result = 0LL;
}
break;
case 252:
v10 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v10 )
{
*a4 = *(double *)(v10 + 8LL * *(int *)(a2 + 24) + 40);
result = 0LL;
}
break;
case 253:
v11 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v11 )
{
*a4 = *(double *)(v11 + 8LL * *(int *)(a2 + 24) + 48);
result = 0LL;
}
break;
case 254:
v12 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v12 )
{
*a4 = *(double *)(v12 + 8LL * *(int *)(a2 + 24) + 56);
result = 0LL;
}
break;
case 255:
v13 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v13 )
{
*a4 = *(double *)(v13 + 8LL * *(int *)(a2 + 24) + 64);
result = 0LL;
}
break;
case 256:
v14 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v14 )
{
*a4 = *(double *)(v14 + 8LL * *(int *)(a2 + 24) + 72);
result = 0LL;
}
break;
case 257:
v15 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v15 )
{
*a4 = *(double *)(v15 + 8LL * *(int *)(a2 + 24) + 80);
result = 0LL;
}
break;
case 258:
v16 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v16 )
{
*a4 = *(double *)(v16 + 8LL * *(int *)(a2 + 24) + 88);
result = 0LL;
}
break;
case 259:
v17 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v17 )
{
*a4 = *(double *)(v17 + 8LL * *(int *)(a2 + 24) + 96);
result = 0LL;
}
break;
case 260:
v18 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v18 )
{
*a4 = *(double *)(v18 + 8LL * *(int *)(a2 + 24) + 104);
result = 0LL;
}
break;
case 261:
v19 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v19 )
{
*a4 = *(double *)(v19 + 8LL * *(int *)(a2 + 24) + 112);
result = 0LL;
}
break;
case 262:
v20 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v20 )
{
*a4 = *(double *)(v20 + 8LL * *(int *)(a2 + 24) + 120);
result = 0LL;
}
break;
case 263:
v21 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v21 )
{
*a4 = *(double *)(v21 + 8LL * *(int *)(a2 + 24) + 128);
result = 0LL;
}
break;
case 264:
v22 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v22 )
{
*a4 = *(double *)(v22 + 8LL * *(int *)(a2 + 24) + 136);
result = 0LL;
}
break;
case 265:
v23 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v23 )
{
*a4 = *(double *)(v23 + 8LL * *(int *)(a2 + 24) + 144);
result = 0LL;
}
break;
case 266:
v24 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v24 )
{
*a4 = *(double *)(v24 + 8LL * *(int *)(a2 + 24) + 152);
result = 0LL;
}
break;
case 267:
v25 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v25 )
{
*a4 = *(double *)(v25 + 8LL * *(int *)(a2 + 24) + 160);
result = 0LL;
}
break;
case 268:
v26 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v26 )
{
*a4 = *(double *)(v26 + 8LL * *(int *)(a2 + 24) + 168);
result = 0LL;
}
break;
case 269:
v27 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v27 )
{
*a4 = *(double *)(v27 + 8LL * *(int *)(a2 + 24) + 192);
result = 0LL;
}
break;
case 270:
v28 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v28 )
{
*a4 = *(double *)(v28 + 8LL * *(int *)(a2 + 24) + 200);
result = 0LL;
}
break;
case 271:
v29 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v29 )
{
*a4 = *(double *)(v29 + 8LL * *(int *)(a2 + 24) + 208);
result = 0LL;
}
break;
case 272:
v30 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v30 )
{
*a4 = *(double *)(v30 + 8LL * *(int *)(a2 + 24) + 216);
result = 0LL;
}
break;
case 273:
v31 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v31 )
{
*a4 = *(double *)(v31 + 8LL * *(int *)(a2 + 24) + 224);
result = 0LL;
}
break;
case 274:
v32 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v32 )
{
*a4 = *(double *)(v32 + 8LL * *(int *)(a2 + 24) + 232);
result = 0LL;
}
break;
case 275:
v33 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v33 )
{
*a4 = *(double *)(v33 + 8LL * *(int *)(a2 + 24) + 240);
result = 0LL;
}
break;
case 276:
v34 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v34 )
{
*a4 = *(double *)(v34 + 8LL * *(int *)(a2 + 24) + 248);
result = 0LL;
}
break;
case 277:
v35 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v35 )
{
*a4 = *(double *)(v35 + 8LL * *(int *)(a2 + 24) + 264);
result = 0LL;
}
break;
case 278:
v36 = *(_QWORD *)(a1 + 280);
result = 0LL;
if ( v36 )
{
*a4 = *(double *)(v36 + 8LL * *(int *)(a2 + 24) + 272);
result = 0LL;
}
break;
case 279:
*a4 = *(double *)(a2 + 120);
result = 0LL;
break;
case 280:
*a4 = *(double *)(a2 + 128);
result = 0LL;
break;
default:
result = 7LL;
break;
}
return result;
}

original_code:
int
B2ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
      IFvalue *select)
{
    B2instance *here = (B2instance*)inst;
    switch(which) {
        case 2:
            value->rValue = here->B2l;
            return(0);
        case 1:
            value->rValue = here->B2w;
            value->rValue *= here->B2m;
            return(0);
        case 14:
            value->rValue = here->B2m;
            return(0);
        case 3:
            value->rValue = here->B2sourceArea;
            value->rValue *= here->B2m;
            return(0);
        case 4:
            value->rValue = here->B2drainArea;
            value->rValue *= here->B2m;
            return(0);
        case 5:
            value->rValue = here->B2sourcePerimeter;
            value->rValue *= here->B2m;
            return(0);
        case 6:
            value->rValue = here->B2drainPerimeter;
            value->rValue *= here->B2m;
            return(0);
        case 7:
            value->rValue = here->B2sourceSquares;
            value->rValue *= here->B2m;
            return(0);
        case 8:
            value->rValue = here->B2drainSquares;
            value->rValue *= here->B2m;
            return(0);
        case 9:
            value->rValue = here->B2off;
            return(0);
        case 10:
            value->rValue = here->B2icVBS;
            return(0);
        case 11:
            value->rValue = here->B2icVDS;
            return(0);
        case 12:
            value->rValue = here->B2icVGS;
            return(0);
        case 241:
            value->iValue = here->B2dNode;
            return(0);
        case 242:
            value->iValue = here->B2gNode;
            return(0);
        case 243:
            value->iValue = here->B2sNode;
            return(0);
        case 244:
            value->iValue = here->B2bNode;
            return(0);
        case 245:
            value->iValue = here->B2dNodePrime;
            return(0);
        case 246:
            value->iValue = here->B2sNodePrime;
            return(0);
        case 279:
            value->rValue = here->B2sourceConductance;
            value->rValue *= here->B2m;
            return(0);
        case 280:
            value->rValue = here->B2drainConductance;
            value->rValue *= here->B2m;
            return(0);
        case 247:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 0);
            return(0);
        case 248:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 1);
            return(0);
        case 249:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 2);
            return(0);
        case 250:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 3);
            return(0);
        case 251:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 4);
            value->rValue *= here->B2m;
            return(0);
        case 252:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 5);
            value->rValue *= here->B2m;
            return(0);
        case 253:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 6);
            value->rValue *= here->B2m;
            return(0);
        case 254:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 7);
            value->rValue *= here->B2m;
            return(0);
        case 255:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 8);
            value->rValue *= here->B2m;
            return(0);
        case 256:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 9);
            value->rValue *= here->B2m;
            return(0);
        case 257:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 10);
            value->rValue *= here->B2m;
            return(0);
        case 258:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 11);
            value->rValue *= here->B2m;
            return(0);
        case 259:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 12);
            value->rValue *= here->B2m;
            return(0);
        case 260:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 13);
            value->rValue *= here->B2m;
            return(0);
        case 261:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 14);
            value->rValue *= here->B2m;
            return(0);
        case 262:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 15);
            value->rValue *= here->B2m;
            return(0);
        case 263:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 16);
            value->rValue *= here->B2m;
            return(0);
        case 264:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 17);
            value->rValue *= here->B2m;
            return(0);
        case 265:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 18);
            value->rValue *= here->B2m;
            return(0);
        case 266:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 19);
            value->rValue *= here->B2m;
            return(0);
        case 267:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 20);
            value->rValue *= here->B2m;
            return(0);
        case 268:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 21);
            value->rValue *= here->B2m;
            return(0);
        case 269:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 24);
            value->rValue *= here->B2m;
            return(0);
        case 270:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 25);
            value->rValue *= here->B2m;
            return(0);
        case 271:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 26);
            value->rValue *= here->B2m;
            return(0);
        case 272:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 27);
            value->rValue *= here->B2m;
            return(0);
        case 273:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 28);
            value->rValue *= here->B2m;
            return(0);
        case 274:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 29);
            value->rValue *= here->B2m;
            return(0);
        case 275:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 30);
            value->rValue *= here->B2m;
            return(0);
        case 276:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 31);
            return(0);
        case 277:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 33);
            value->rValue *= here->B2m;
            return(0);
        case 278:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 34);
            value->rValue *= here->B2m;
            return(0);
        default:
            return(7);
    }
}

canonical_original_code:
int B2ask(struct CKTcircuit *ckt, struct sGENinstance *inst, int which, union uIFvalue *value, union uIFvalue *select)
{
    struct sBSIM2instance *here = (B2instance*)inst;
    switch(which) {
        case 2:
            value->rValue = here->B2l;
            return(0);
        case 1:
            value->rValue = here->B2w;
            value->rValue *= here->B2m;
            return(0);
        case 14:
            value->rValue = here->B2m;
            return(0);
        case 3:
            value->rValue = here->B2sourceArea;
            value->rValue *= here->B2m;
            return(0);
        case 4:
            value->rValue = here->B2drainArea;
            value->rValue *= here->B2m;
            return(0);
        case 5:
            value->rValue = here->B2sourcePerimeter;
            value->rValue *= here->B2m;
            return(0);
        case 6:
            value->rValue = here->B2drainPerimeter;
            value->rValue *= here->B2m;
            return(0);
        case 7:
            value->rValue = here->B2sourceSquares;
            value->rValue *= here->B2m;
            return(0);
        case 8:
            value->rValue = here->B2drainSquares;
            value->rValue *= here->B2m;
            return(0);
        case 9:
            value->rValue = here->B2off;
            return(0);
        case 10:
            value->rValue = here->B2icVBS;
            return(0);
        case 11:
            value->rValue = here->B2icVDS;
            return(0);
        case 12:
            value->rValue = here->B2icVGS;
            return(0);
        case 241:
            value->iValue = here->B2dNode;
            return(0);
        case 242:
            value->iValue = here->B2gNode;
            return(0);
        case 243:
            value->iValue = here->B2sNode;
            return(0);
        case 244:
            value->iValue = here->B2bNode;
            return(0);
        case 245:
            value->iValue = here->B2dNodePrime;
            return(0);
        case 246:
            value->iValue = here->B2sNodePrime;
            return(0);
        case 279:
            value->rValue = here->B2sourceConductance;
            value->rValue *= here->B2m;
            return(0);
        case 280:
            value->rValue = here->B2drainConductance;
            value->rValue *= here->B2m;
            return(0);
        case 247:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 0);
            return(0);
        case 248:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 1);
            return(0);
        case 249:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 2);
            return(0);
        case 250:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 3);
            return(0);
        case 251:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 4);
            value->rValue *= here->B2m;
            return(0);
        case 252:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 5);
            value->rValue *= here->B2m;
            return(0);
        case 253:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 6);
            value->rValue *= here->B2m;
            return(0);
        case 254:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 7);
            value->rValue *= here->B2m;
            return(0);
        case 255:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 8);
            value->rValue *= here->B2m;
            return(0);
        case 256:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 9);
            value->rValue *= here->B2m;
            return(0);
        case 257:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 10);
            value->rValue *= here->B2m;
            return(0);
        case 258:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 11);
            value->rValue *= here->B2m;
            return(0);
        case 259:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 12);
            value->rValue *= here->B2m;
            return(0);
        case 260:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 13);
            value->rValue *= here->B2m;
            return(0);
        case 261:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 14);
            value->rValue *= here->B2m;
            return(0);
        case 262:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 15);
            value->rValue *= here->B2m;
            return(0);
        case 263:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 16);
            value->rValue *= here->B2m;
            return(0);
        case 264:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 17);
            value->rValue *= here->B2m;
            return(0);
        case 265:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 18);
            value->rValue *= here->B2m;
            return(0);
        case 266:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 19);
            value->rValue *= here->B2m;
            return(0);
        case 267:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 20);
            value->rValue *= here->B2m;
            return(0);
        case 268:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 21);
            value->rValue *= here->B2m;
            return(0);
        case 269:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 24);
            value->rValue *= here->B2m;
            return(0);
        case 270:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 25);
            value->rValue *= here->B2m;
            return(0);
        case 271:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 26);
            value->rValue *= here->B2m;
            return(0);
        case 272:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 27);
            value->rValue *= here->B2m;
            return(0);
        case 273:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 28);
            value->rValue *= here->B2m;
            return(0);
        case 274:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 29);
            value->rValue *= here->B2m;
            return(0);
        case 275:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 30);
            value->rValue *= here->B2m;
            return(0);
        case 276:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 31);
            return(0);
        case 277:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 33);
            value->rValue *= here->B2m;
            return(0);
        case 278:
            value->rValue = *(ckt->CKTstates[0] + here->B2states+ 34);
            value->rValue *= here->B2m;
            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 sGENinstance *

variable_types:
select
union uIFvalue *

variable_types: struct sBSIM2instance { struct sBSIM2model { int B2modType; struct sBSIM2model *B2nextModel; struct sBSIM2instance *B2instances; char *B2modName; int B2type; int pad; double B2vfb0; double B2vfbL; double B2vfbW; double B2phi0; double B2phiL; double B2phiW; double B2k10; double B2k1L; double B2k1W; double B2k20; double B2k2L; double B2k2W; double B2eta00; double B2eta0L; double B2eta0W; double B2etaB0; double B2etaBL; double B2etaBW; double B2deltaL; double B2deltaW; double B2mob00; double B2mob0B0; double B2mob0BL; double B2mob0BW; double B2mobs00; double B2mobs0L; double B2mobs0W; double B2mobsB0; double B2mobsBL; double B2mobsBW; double B2mob200; double B2mob20L; double B2mob20W; double B2mob2B0; double B2mob2BL; double B2mob2BW; double B2mob2G0; double B2mob2GL; double B2mob2GW; double B2mob300; double B2mob30L; double B2mob30W; double B2mob3B0; double B2mob3BL; double B2mob3BW; double B2mob3G0; double B2mob3GL; double B2mob3GW; double B2mob400; double B2mob40L; double B2mob40W; double B2mob4B0; double B2mob4BL; double B2mob4BW; double B2mob4G0; double B2mob4GL; double B2mob4GW; double B2ua00; double B2ua0L; double B2ua0W; double B2uaB0; double B2uaBL; double B2uaBW; double B2ub00; double B2ub0L; double B2ub0W; double B2ubB0; double B2ubBL; double B2ubBW; double B2u100; double B2u10L; double B2u10W; double B2u1B0; double B2u1BL; double B2u1BW; double B2u1D0; double B2u1DL; double B2u1DW; double B2n00; double B2n0L; double B2n0W; double B2nB0; double B2nBL; double B2nBW; double B2nD0; double B2nDL; double B2nDW; double B2vof00; double B2vof0L; double B2vof0W; double B2vofB0; double B2vofBL; double B2vofBW; double B2vofD0; double B2vofDL; double B2vofDW; double B2ai00; double B2ai0L; double B2ai0W; double B2aiB0; double B2aiBL; double B2aiBW; double B2bi00; double B2bi0L; double B2bi0W; double B2biB0; double B2biBL; double B2biBW; double B2vghigh0; double B2vghighL; double B2vghighW; double B2vglow0; double B2vglowL; double B2vglowW; double B2tox; double B2Cox; double B2temp; double B2vdd; double B2vdd2; double B2vgg; double B2vgg2; double B2vbb; double B2vbb2; double B2gateSourceOverlapCap; double B2gateDrainOverlapCap; double B2gateBulkOverlapCap; double B2Vtm; double B2sheetResistance; double B2jctSatCurDensity; double B2bulkJctPotential; double B2bulkJctBotGradingCoeff; double B2bulkJctSideGradingCoeff; double B2sidewallJctPotential; double B2unitAreaJctCap; double B2unitLengthSidewallJctCap; double B2defaultWidth; double B2deltaLength; double B2fNcoef; double B2fNexp; struct bsim2SizeDependParam { double Width; double Length; double B2vfb; double B2phi; double B2k1; double B2k2; double B2eta0; double B2etaB; double B2beta0; double B2beta0B; double B2betas0; double B2betasB; double B2beta20; double B2beta2B; double B2beta2G; double B2beta30; double B2beta3B; double B2beta3G; double B2beta40; double B2beta4B; double B2beta4G; double B2ua0; double B2uaB; double B2ub0; double B2ubB; double B2u10; double B2u1B; double B2u1D; double B2n0; double B2nB; double B2nD; double B2vof0; double B2vofB; double B2vofD; double B2ai0; double B2aiB; double B2bi0; double B2biB; double B2vghigh; double B2vglow; double B2GDoverlapCap; double B2GSoverlapCap; double B2GBoverlapCap; double SqrtPhi; double Phis3; double CoxWL; double One_Third_CoxWL; double Two_Third_CoxWL; double Arg; double B2vt0; struct bsim2SizeDependParam *pNext; } *pSizeDependParamKnot; unsigned int B2channelChargePartitionFlag; unsigned int B2vfb0Given; unsigned int B2vfbLGiven; unsigned int B2vfbWGiven; unsigned int B2phi0Given; unsigned int B2phiLGiven; unsigned int B2phiWGiven; unsigned int B2k10Given; unsigned int B2k1LGiven; unsigned int B2k1WGiven; unsigned int B2k20Given; unsigned int B2k2LGiven; unsigned int B2k2WGiven; unsigned int B2eta00Given; unsigned int B2eta0LGiven; unsigned int B2eta0WGiven; unsigned int B2etaB0Given; unsigned int B2etaBLGiven; unsigned int B2etaBWGiven; unsigned int B2deltaLGiven; unsigned int B2deltaWGiven; unsigned int B2mob00Given; unsigned int B2mob0B0Given; unsigned int B2mob0BLGiven; unsigned int B2mob0BWGiven; unsigned int B2mobs00Given; unsigned int B2mobs0LGiven; unsigned int B2mobs0WGiven; unsigned int B2mobsB0Given; unsigned int B2mobsBLGiven; unsigned int B2mobsBWGiven; unsigned int B2mob200Given; unsigned int B2mob20LGiven; unsigned int B2mob20WGiven; unsigned int B2mob2B0Given; unsigned int B2mob2BLGiven; unsigned int B2mob2BWGiven; unsigned int B2mob2G0Given; unsigned int B2mob2GLGiven; unsigned int B2mob2GWGiven; unsigned int B2mob300Given; unsigned int B2mob30LGiven; unsigned int B2mob30WGiven; unsigned int B2mob3B0Given; unsigned int B2mob3BLGiven; unsigned int B2mob3BWGiven; unsigned int B2mob3G0Given; unsigned int B2mob3GLGiven; unsigned int B2mob3GWGiven; unsigned int B2mob400Given; unsigned int B2mob40LGiven; unsigned int B2mob40WGiven; unsigned int B2mob4B0Given; unsigned int B2mob4BLGiven; unsigned int B2mob4BWGiven; unsigned int B2mob4G0Given; unsigned int B2mob4GLGiven; unsigned int B2mob4GWGiven; unsigned int B2ua00Given; unsigned int B2ua0LGiven; unsigned int B2ua0WGiven; unsigned int B2uaB0Given; unsigned int B2uaBLGiven; unsigned int B2uaBWGiven; unsigned int B2ub00Given; unsigned int B2ub0LGiven; unsigned int B2ub0WGiven; unsigned int B2ubB0Given; unsigned int B2ubBLGiven; unsigned int B2ubBWGiven; unsigned int B2u100Given; unsigned int B2u10LGiven; unsigned int B2u10WGiven; unsigned int B2u1B0Given; unsigned int B2u1BLGiven; unsigned int B2u1BWGiven; unsigned int B2u1D0Given; unsigned int B2u1DLGiven; unsigned int B2u1DWGiven; unsigned int B2n00Given; unsigned int B2n0LGiven; unsigned int B2n0WGiven; unsigned int B2nB0Given; unsigned int B2nBLGiven; unsigned int B2nBWGiven; unsigned int B2nD0Given; unsigned int B2nDLGiven; unsigned int B2nDWGiven; unsigned int B2vof00Given; unsigned int B2vof0LGiven; unsigned int B2vof0WGiven; unsigned int B2vofB0Given; unsigned int B2vofBLGiven; unsigned int B2vofBWGiven; unsigned int B2vofD0Given; unsigned int B2vofDLGiven; unsigned int B2vofDWGiven; unsigned int B2ai00Given; unsigned int B2ai0LGiven; unsigned int B2ai0WGiven; unsigned int B2aiB0Given; unsigned int B2aiBLGiven; unsigned int B2aiBWGiven; unsigned int B2bi00Given; unsigned int B2bi0LGiven; unsigned int B2bi0WGiven; unsigned int B2biB0Given; unsigned int B2biBLGiven; unsigned int B2biBWGiven; unsigned int B2vghigh0Given; unsigned int B2vghighLGiven; unsigned int B2vghighWGiven; unsigned int B2vglow0Given; unsigned int B2vglowLGiven; unsigned int B2vglowWGiven; unsigned int B2toxGiven; unsigned int B2tempGiven; unsigned int B2vddGiven; unsigned int B2vggGiven; unsigned int B2vbbGiven; unsigned int B2gateSourceOverlapCapGiven; unsigned int B2gateDrainOverlapCapGiven; unsigned int B2gateBulkOverlapCapGiven; unsigned int B2channelChargePartitionFlagGiven; unsigned int B2sheetResistanceGiven; unsigned int B2jctSatCurDensityGiven; unsigned int B2bulkJctPotentialGiven; unsigned int B2bulkJctBotGradingCoeffGiven; unsigned int B2sidewallJctPotentialGiven; unsigned int B2bulkJctSideGradingCoeffGiven; unsigned int B2unitAreaJctCapGiven; unsigned int B2unitLengthSidewallJctCapGiven; unsigned int B2defaultWidthGiven; unsigned int B2deltaLengthGiven; unsigned int B2fNcoefGiven; unsigned int B2fNexpGiven; unsigned int B2typeGiven; } *B2modPtr; struct sBSIM2instance *B2nextInstance; char *B2name; int B2owner; int B2states; int B2dNode; int B2gNode; int B2sNode; int B2bNode; int B2dNodePrime; int B2sNodePrime; double B2l; double B2w; double B2m; double B2drainArea; double B2sourceArea; double B2drainSquares; double B2sourceSquares; double B2drainPerimeter; double B2sourcePerimeter; double B2sourceConductance; double B2drainConductance; double B2icVBS; double B2icVDS; double B2icVGS; double B2von; double B2vdsat; int B2off; int B2mode; struct bsim2SizeDependParam *pParam; unsigned int B2lGiven; unsigned int B2wGiven; unsigned int B2mGiven; unsigned int B2drainAreaGiven; unsigned int B2sourceAreaGiven; unsigned int B2drainSquaresGiven; unsigned int B2sourceSquaresGiven; unsigned int B2drainPerimeterGiven; unsigned int B2sourcePerimeterGiven; unsigned int B2dNodePrimeSet; unsigned int B2sNodePrimeSet; unsigned int B2icVBSGiven; unsigned int B2icVDSGiven; unsigned int B2icVGSGiven; unsigned int B2vonGiven; unsigned int B2vdsatGiven; double *B2DdPtr; double *B2GgPtr; double *B2SsPtr; double *B2BbPtr; double *B2DPdpPtr; double *B2SPspPtr; double *B2DdpPtr; double *B2GbPtr; double *B2GdpPtr; double *B2GspPtr; double *B2SspPtr; double *B2BdpPtr; double *B2BspPtr; double *B2DPspPtr; double *B2DPdPtr; double *B2BgPtr; double *B2DPgPtr; double *B2SPgPtr; double *B2SPsPtr; double *B2DPbPtr; double *B2SPbPtr; double *B2SPdpPtr; double B2nVar[3][5]; } *

user_defined_types: struct sBSIM2instance { struct sBSIM2model *B2modPtr; struct sBSIM2instance *B2nextInstance; char *B2name; int B2owner; int B2states; int B2dNode; int B2gNode; int B2sNode; int B2bNode; int B2dNodePrime; int B2sNodePrime; double B2l; double B2w; double B2m; double B2drainArea; double B2sourceArea; double B2drainSquares; double B2sourceSquares; double B2drainPerimeter; double B2sourcePerimeter; double B2sourceConductance; double B2drainConductance; double B2icVBS; double B2icVDS; double B2icVGS; double B2von; double B2vdsat; int B2off; int B2mode; struct bsim2SizeDependParam *pParam; unsigned int B2lGiven; unsigned int B2wGiven; unsigned int B2mGiven; unsigned int B2drainAreaGiven; unsigned int B2sourceAreaGiven; unsigned int B2drainSquaresGiven; unsigned int B2sourceSquaresGiven; unsigned int B2drainPerimeterGiven; unsigned int B2sourcePerimeterGiven; unsigned int B2dNodePrimeSet; unsigned int B2sNodePrimeSet; unsigned int B2icVBSGiven; unsigned int B2icVDSGiven; unsigned int B2icVGSGiven; unsigned int B2vonGiven; unsigned int B2vdsatGiven; double *B2DdPtr; double *B2GgPtr; double *B2SsPtr; double *B2BbPtr; double *B2DPdpPtr; double *B2SPspPtr; double *B2DdpPtr; double *B2GbPtr; double *B2GdpPtr; double *B2GspPtr; double *B2SspPtr; double *B2BdpPtr; double *B2BspPtr; double *B2DPspPtr; double *B2DPdPtr; double *B2BgPtr; double *B2DPgPtr; double *B2SPgPtr; double *B2SPsPtr; double *B2DPbPtr; double *B2SPbPtr; double *B2SPdpPtr; double B2nVar[3][5]; }

user_defined_types: struct sIFcomplex { double real; double imag; }

user_defined_types: struct sIFparseTree { int numVars; int *varTypes; union uIFvalue *vars; int (*IFeval)(struct sIFparseTree *, double, double *, double *, double *); }

user_defined_types: struct sBSIM2model { int B2modType; struct sBSIM2model *B2nextModel; struct sBSIM2instance *B2instances; char *B2modName; int B2type; int pad; double B2vfb0; double B2vfbL; double B2vfbW; double B2phi0; double B2phiL; double B2phiW; double B2k10; double B2k1L; double B2k1W; double B2k20; double B2k2L; double B2k2W; double B2eta00; double B2eta0L; double B2eta0W; double B2etaB0; double B2etaBL; double B2etaBW; double B2deltaL; double B2deltaW; double B2mob00; double B2mob0B0; double B2mob0BL; double B2mob0BW; double B2mobs00; double B2mobs0L; double B2mobs0W; double B2mobsB0; double B2mobsBL; double B2mobsBW; double B2mob200; double B2mob20L; double B2mob20W; double B2mob2B0; double B2mob2BL; double B2mob2BW; double B2mob2G0; double B2mob2GL; double B2mob2GW; double B2mob300; double B2mob30L; double B2mob30W; double B2mob3B0; double B2mob3BL; double B2mob3BW; double B2mob3G0; double B2mob3GL; double B2mob3GW; double B2mob400; double B2mob40L; double B2mob40W; double B2mob4B0; double B2mob4BL; double B2mob4BW; double B2mob4G0; double B2mob4GL; double B2mob4GW; double B2ua00; double B2ua0L; double B2ua0W; double B2uaB0; double B2uaBL; double B2uaBW; double B2ub00; double B2ub0L; double B2ub0W; double B2ubB0; double B2ubBL; double B2ubBW; double B2u100; double B2u10L; double B2u10W; double B2u1B0; double B2u1BL; double B2u1BW; double B2u1D0; double B2u1DL; double B2u1DW; double B2n00; double B2n0L; double B2n0W; double B2nB0; double B2nBL; double B2nBW; double B2nD0; double B2nDL; double B2nDW; double B2vof00; double B2vof0L; double B2vof0W; double B2vofB0; double B2vofBL; double B2vofBW; double B2vofD0; double B2vofDL; double B2vofDW; double B2ai00; double B2ai0L; double B2ai0W; double B2aiB0; double B2aiBL; double B2aiBW; double B2bi00; double B2bi0L; double B2bi0W; double B2biB0; double B2biBL; double B2biBW; double B2vghigh0; double B2vghighL; double B2vghighW; double B2vglow0; double B2vglowL; double B2vglowW; double B2tox; double B2Cox; double B2temp; double B2vdd; double B2vdd2; double B2vgg; double B2vgg2; double B2vbb; double B2vbb2; double B2gateSourceOverlapCap; double B2gateDrainOverlapCap; double B2gateBulkOverlapCap; double B2Vtm; double B2sheetResistance; double B2jctSatCurDensity; double B2bulkJctPotential; double B2bulkJctBotGradingCoeff; double B2bulkJctSideGradingCoeff; double B2sidewallJctPotential; double B2unitAreaJctCap; double B2unitLengthSidewallJctCap; double B2defaultWidth; double B2deltaLength; double B2fNcoef; double B2fNexp; struct bsim2SizeDependParam *pSizeDependParamKnot; unsigned int B2channelChargePartitionFlag; unsigned int B2vfb0Given; unsigned int B2vfbLGiven; unsigned int B2vfbWGiven; unsigned int B2phi0Given; unsigned int B2phiLGiven; unsigned int B2phiWGiven; unsigned int B2k10Given; unsigned int B2k1LGiven; unsigned int B2k1WGiven; unsigned int B2k20Given; unsigned int B2k2LGiven; unsigned int B2k2WGiven; unsigned int B2eta00Given; unsigned int B2eta0LGiven; unsigned int B2eta0WGiven; unsigned int B2etaB0Given; unsigned int B2etaBLGiven; unsigned int B2etaBWGiven; unsigned int B2deltaLGiven; unsigned int B2deltaWGiven; unsigned int B2mob00Given; unsigned int B2mob0B0Given; unsigned int B2mob0BLGiven; unsigned int B2mob0BWGiven; unsigned int B2mobs00Given; unsigned int B2mobs0LGiven; unsigned int B2mobs0WGiven; unsigned int B2mobsB0Given; unsigned int B2mobsBLGiven; unsigned int B2mobsBWGiven; unsigned int B2mob200Given; unsigned int B2mob20LGiven; unsigned int B2mob20WGiven; unsigned int B2mob2B0Given; unsigned int B2mob2BLGiven; unsigned int B2mob2BWGiven; unsigned int B2mob2G0Given; unsigned int B2mob2GLGiven; unsigned int B2mob2GWGiven; unsigned int B2mob300Given; unsigned int B2mob30LGiven; unsigned int B2mob30WGiven; unsigned int B2mob3B0Given; unsigned int B2mob3BLGiven; unsigned int B2mob3BWGiven; unsigned int B2mob3G0Given; unsigned int B2mob3GLGiven; unsigned int B2mob3GWGiven; unsigned int B2mob400Given; unsigned int B2mob40LGiven; unsigned int B2mob40WGiven; unsigned int B2mob4B0Given; unsigned int B2mob4BLGiven; unsigned int B2mob4BWGiven; unsigned int B2mob4G0Given; unsigned int B2mob4GLGiven; unsigned int B2mob4GWGiven; unsigned int B2ua00Given; unsigned int B2ua0LGiven; unsigned int B2ua0WGiven; unsigned int B2uaB0Given; unsigned int B2uaBLGiven; unsigned int B2uaBWGiven; unsigned int B2ub00Given; unsigned int B2ub0LGiven; unsigned int B2ub0WGiven; unsigned int B2ubB0Given; unsigned int B2ubBLGiven; unsigned int B2ubBWGiven; unsigned int B2u100Given; unsigned int B2u10LGiven; unsigned int B2u10WGiven; unsigned int B2u1B0Given; unsigned int B2u1BLGiven; unsigned int B2u1BWGiven; unsigned int B2u1D0Given; unsigned int B2u1DLGiven; unsigned int B2u1DWGiven; unsigned int B2n00Given; unsigned int B2n0LGiven; unsigned int B2n0WGiven; unsigned int B2nB0Given; unsigned int B2nBLGiven; unsigned int B2nBWGiven; unsigned int B2nD0Given; unsigned int B2nDLGiven; unsigned int B2nDWGiven; unsigned int B2vof00Given; unsigned int B2vof0LGiven; unsigned int B2vof0WGiven; unsigned int B2vofB0Given; unsigned int B2vofBLGiven; unsigned int B2vofBWGiven; unsigned int B2vofD0Given; unsigned int B2vofDLGiven; unsigned int B2vofDWGiven; unsigned int B2ai00Given; unsigned int B2ai0LGiven; unsigned int B2ai0WGiven; unsigned int B2aiB0Given; unsigned int B2aiBLGiven; unsigned int B2aiBWGiven; unsigned int B2bi00Given; unsigned int B2bi0LGiven; unsigned int B2bi0WGiven; unsigned int B2biB0Given; unsigned int B2biBLGiven; unsigned int B2biBWGiven; unsigned int B2vghigh0Given; unsigned int B2vghighLGiven; unsigned int B2vghighWGiven; unsigned int B2vglow0Given; unsigned int B2vglowLGiven; unsigned int B2vglowWGiven; unsigned int B2toxGiven; unsigned int B2tempGiven; unsigned int B2vddGiven; unsigned int B2vggGiven; unsigned int B2vbbGiven; unsigned int B2gateSourceOverlapCapGiven; unsigned int B2gateDrainOverlapCapGiven; unsigned int B2gateBulkOverlapCapGiven; unsigned int B2channelChargePartitionFlagGiven; unsigned int B2sheetResistanceGiven; unsigned int B2jctSatCurDensityGiven; unsigned int B2bulkJctPotentialGiven; unsigned int B2bulkJctBotGradingCoeffGiven; unsigned int B2sidewallJctPotentialGiven; unsigned int B2bulkJctSideGradingCoeffGiven; unsigned int B2unitAreaJctCapGiven; unsigned int B2unitLengthSidewallJctCapGiven; unsigned int B2defaultWidthGiven; unsigned int B2deltaLengthGiven; unsigned int B2fNcoefGiven; unsigned int B2fNexpGiven; unsigned int B2typeGiven; }


CAPask

repo: gserdyuk/gnucap-a

decompiled_code:
__int64 __fastcall CAPask(__int64 a1, __int64 a2, int a3, double *a4)
{
__int64 result; // rax
int v7; // eax
__int64 v8; // rcx
int v9; // eax
__int64 v10; // rcx
__int64 v11; // rdi

switch ( a3 )
{
case 0:
result = 7LL;
break;
case 1:
*a4 = *(double *)(a2 + 40);
result = 0LL;
break;
case 2:
*a4 = *(double *)(a2 + 48);
result = 0LL;
break;
case 3:
*a4 = *(double *)(a2 + 72);
result = 0LL;
break;
case 4:
*a4 = *(double *)(a2 + 80);
result = 0LL;
break;
case 5:
v7 = *(_DWORD *)(a1 + 684);
if ( (v7 & 4) != 0 )
{
errMsg = (char *)calloc(1uLL, 0x30uLL);
errRtn = "CAPask";
strcpy(errMsg, "Current and power not available for ac analysis");
result = 111LL;
}
else
{
result = v7 & 8;
if ( (_DWORD)result )
{
result = 0LL;
if ( (*(_BYTE *)(a1 + 712) & 0x20) == 0 )
{
v8 = *(_QWORD *)(a1 + 280);
if ( v8 )
{
*a4 = *(double *)(v8 + 8LL * *(int *)(a2 + 24) + 8);
result = 0LL;
}
}
}
}
break;
case 6:
v9 = *(_DWORD *)(a1 + 684);
if ( (v9 & 4) != 0 )
{
errMsg = (char *)calloc(1uLL, 0x30uLL);
errRtn = "CAPask";
strcpy(errMsg, "Current and power not available for ac analysis");
result = 112LL;
}
else
{
result = v9 & 8;
if ( (_DWORD)result )
{
result = 0LL;
if ( (*(_BYTE *)(a1 + 712) & 0x20) == 0 )
{
v10 = *(_QWORD *)(a1 + 280);
if ( v10 )
{
v11 = *(_QWORD *)(a1 + 536);
if ( v11 )
{
*a4 = (*(double *)(v11 + 8LL * *(int *)(a2 + 28)) - *(double *)(v11 + 8LL * *(int *)(a2 + 32)))
* *(double *)(v10 + 8LL * *(int *)(a2 + 24) + 8);
result = 0LL;
}
}
}
}
}
break;
default:
result = 7LL;
break;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, int a3, double *a4)
{
__int64 result; // rax
int v7; // eax
__int64 v8; // rcx
int v9; // eax
__int64 v10; // rcx
__int64 v11; // rdi

switch ( a3 )
{
case 0:
result = 7LL;
break;
case 1:
*a4 = *(double *)(a2 + 40);
result = 0LL;
break;
case 2:
*a4 = *(double *)(a2 + 48);
result = 0LL;
break;
case 3:
*a4 = *(double *)(a2 + 72);
result = 0LL;
break;
case 4:
*a4 = *(double *)(a2 + 80);
result = 0LL;
break;
case 5:
v7 = *(_DWORD *)(a1 + 684);
if ( (v7 & 4) != 0 )
{
errMsg = (char *)calloc(1uLL, 0x30uLL);
errRtn = "CAPask";
strcpy(errMsg, "Current and power not available for ac analysis");
result = 111LL;
}
else
{
result = v7 & 8;
if ( (_DWORD)result )
{
result = 0LL;
if ( (*(_BYTE *)(a1 + 712) & 0x20) == 0 )
{
v8 = *(_QWORD *)(a1 + 280);
if ( v8 )
{
*a4 = *(double *)(v8 + 8LL * *(int *)(a2 + 24) + 8);
result = 0LL;
}
}
}
}
break;
case 6:
v9 = *(_DWORD *)(a1 + 684);
if ( (v9 & 4) != 0 )
{
errMsg = (char *)calloc(1uLL, 0x30uLL);
errRtn = "CAPask";
strcpy(errMsg, "Current and power not available for ac analysis");
result = 112LL;
}
else
{
result = v9 & 8;
if ( (_DWORD)result )
{
result = 0LL;
if ( (*(_BYTE *)(a1 + 712) & 0x20) == 0 )
{
v10 = *(_QWORD *)(a1 + 280);
if ( v10 )
{
v11 = *(_QWORD *)(a1 + 536);
if ( v11 )
{
*a4 = (*(double *)(v11 + 8LL * *(int *)(a2 + 28)) - *(double *)(v11 + 8LL * *(int *)(a2 + 32)))
* *(double *)(v10 + 8LL * *(int *)(a2 + 24) + 8);
result = 0LL;
}
}
}
}
}
break;
default:
result = 7LL;
break;
}
return result;
}

original_code:
int
CAPask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
       IFvalue *select)
{
    CAPinstance *here = (CAPinstance *)inst;
    double vr;
    double vi;
    double sr;
    double si;
    double vm;
    static char *msg = "Current and power not available for ac analysis";
    switch(which) {
        case 8:
     value->rValue = here->CAPtemp - (273.15);
     return(0);
 case 9:
     value->rValue = here->CAPdtemp;
     return(0);
        case 1:
            value->rValue=here->CAPcapac;
     value->rValue *= here->CAPm;
            return(0);
        case 2:
            value->rValue = here->CAPinitCond;
            return(0);
        case 3:
            value->rValue = here->CAPwidth;
            return(0);
        case 4:
            value->rValue = here->CAPlength;
            return(0);
 case 10:
     value->rValue = here->CAPscale;
     return(0);
 case 11:
     value->rValue = here->CAPm;
     return(0);
        case 6:
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned)(strlen(msg)+1));
                errRtn = "CAPask";
                strcpy(errMsg,msg);
                return((100 +11));
            } else if (ckt->CKTcurrentAnalysis & (1 | 2)) {
                value->rValue = 0;
            } else if (ckt->CKTcurrentAnalysis & 8) {
                if (ckt->CKTmode & 0x20) {
                    value->rValue = 0;
                } else {
                    value->rValue = *(ckt->CKTstates[0] + here->CAPstate+1);
                }
             } else value->rValue = *(ckt->CKTstates[0] + here->CAPstate+1);
     value->rValue *= here->CAPm;
     return(0);
        case 7:
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned)(strlen(msg)+1));
                errRtn = "CAPask";
                strcpy(errMsg,msg);
                return((100 +12));
            } else if (ckt->CKTcurrentAnalysis & (1 | 2)) {
                value->rValue = 0;
            } else if (ckt->CKTcurrentAnalysis & 8) {
                if (ckt->CKTmode & 0x20) {
                    value->rValue = 0;
                } else {
                    value->rValue = *(ckt->CKTstates[0] + here->CAPstate+1) *
                            (*(ckt->CKTrhsOld + here->CAPposNode) -
                            *(ckt->CKTrhsOld + here->CAPnegNode));
                }
            } else value->rValue = *(ckt->CKTstates[0] + here->CAPstate+1) *
                            (*(ckt->CKTrhsOld + here->CAPposNode) -
                            *(ckt->CKTrhsOld + here->CAPnegNode));
     value->rValue *= here->CAPm;
     return(0);
        case 206:
            if(ckt->CKTsenInfo){
               value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
                    here->CAPsenParmNo);
            }
            return(0);
        case 201:
            if(ckt->CKTsenInfo){
               value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                    here->CAPsenParmNo);
            }
            return(0);
        case 202:
            if(ckt->CKTsenInfo){
               value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                    here->CAPsenParmNo);
            }
            return(0);
        case 203:
            if(ckt->CKTsenInfo){
               vr = *(ckt->CKTrhsOld + select->iValue + 1);
               vi = *(ckt->CKTirhsOld + select->iValue + 1);
               vm = sqrt(vr*vr + vi*vi);
               if(vm == 0){
                 value->rValue = 0;
                 return(0);
               }
               sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                    here->CAPsenParmNo);
               si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                    here->CAPsenParmNo);
                   value->rValue = (vr * sr + vi * si)/vm;
            }
            return(0);
        case 204:
            if(ckt->CKTsenInfo){
               vr = *(ckt->CKTrhsOld + select->iValue + 1);
               vi = *(ckt->CKTirhsOld + select->iValue + 1);
               vm = vr*vr + vi*vi;
               if(vm == 0){
                 value->rValue = 0;
                 return(0);
               }
               sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                    here->CAPsenParmNo);
               si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                    here->CAPsenParmNo);
                   value->rValue = (vr * si - vi * sr)/vm;
            }
            return(0);
        case 205:
            if(ckt->CKTsenInfo){
                value->cValue.real=
                        *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->CAPsenParmNo);
                value->cValue.imag=
                        *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->CAPsenParmNo);
            }
            return(0);
        default:
            return(7);
        }
}

canonical_original_code:
int CAPask(struct CKTcircuit *ckt, struct sGENinstance *inst, int which, union uIFvalue *value, union uIFvalue *select)
{
    struct sCAPinstance *here = (CAPinstance *)inst;
    double vr;
    double vi;
    double sr;
    double si;
    double vm;
    static char *msg = "Current and power not available for ac analysis";
    switch(which) {
        case 8:
     value->rValue = here->CAPtemp - (273.15);
     return(0);
 case 9:
     value->rValue = here->CAPdtemp;
     return(0);
        case 1:
            value->rValue=here->CAPcapac;
     value->rValue *= here->CAPm;
            return(0);
        case 2:
            value->rValue = here->CAPinitCond;
            return(0);
        case 3:
            value->rValue = here->CAPwidth;
            return(0);
        case 4:
            value->rValue = here->CAPlength;
            return(0);
 case 10:
     value->rValue = here->CAPscale;
     return(0);
 case 11:
     value->rValue = here->CAPm;
     return(0);
        case 6:
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned int)(strlen(msg)+1));
                errRtn = "CAPask";
                strcpy(errMsg,msg);
                return((100 +11));
            } else if (ckt->CKTcurrentAnalysis & (1 | 2)) {
                value->rValue = 0;
            } else if (ckt->CKTcurrentAnalysis & 8) {
                if (ckt->CKTmode & 0x20) {
                    value->rValue = 0;
                } else {
                    value->rValue = *(ckt->CKTstates[0] + here->CAPstate+1);
                }
             } else value->rValue = *(ckt->CKTstates[0] + here->CAPstate+1);
     value->rValue *= here->CAPm;
     return(0);
        case 7:
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned int)(strlen(msg)+1));
                errRtn = "CAPask";
                strcpy(errMsg,msg);
                return((100 +12));
            } else if (ckt->CKTcurrentAnalysis & (1 | 2)) {
                value->rValue = 0;
            } else if (ckt->CKTcurrentAnalysis & 8) {
                if (ckt->CKTmode & 0x20) {
                    value->rValue = 0;
                } else {
                    value->rValue = *(ckt->CKTstates[0] + here->CAPstate+1) *
                            (*(ckt->CKTrhsOld + here->CAPposNode) -
                            *(ckt->CKTrhsOld + here->CAPnegNode));
                }
            } else value->rValue = *(ckt->CKTstates[0] + here->CAPstate+1) *
                            (*(ckt->CKTrhsOld + here->CAPposNode) -
                            *(ckt->CKTrhsOld + here->CAPnegNode));
     value->rValue *= here->CAPm;
     return(0);
        case 206:
            if(ckt->CKTsenInfo){
               value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
                    here->CAPsenParmNo);
            }
            return(0);
        case 201:
            if(ckt->CKTsenInfo){
               value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                    here->CAPsenParmNo);
            }
            return(0);
        case 202:
            if(ckt->CKTsenInfo){
               value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                    here->CAPsenParmNo);
            }
            return(0);
        case 203:
            if(ckt->CKTsenInfo){
               vr = *(ckt->CKTrhsOld + select->iValue + 1);
               vi = *(ckt->CKTirhsOld + select->iValue + 1);
               vm = sqrt(vr*vr + vi*vi);
               if(vm == 0){
                 value->rValue = 0;
                 return(0);
               }
               sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                    here->CAPsenParmNo);
               si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                    here->CAPsenParmNo);
                   value->rValue = (vr * sr + vi * si)/vm;
            }
            return(0);
        case 204:
            if(ckt->CKTsenInfo){
               vr = *(ckt->CKTrhsOld + select->iValue + 1);
               vi = *(ckt->CKTirhsOld + select->iValue + 1);
               vm = vr*vr + vi*vi;
               if(vm == 0){
                 value->rValue = 0;
                 return(0);
               }
               sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                    here->CAPsenParmNo);
               si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                    here->CAPsenParmNo);
                   value->rValue = (vr * si - vi * sr)/vm;
            }
            return(0);
        case 205:
            if(ckt->CKTsenInfo){
                value->cValue.real=
                        *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->CAPsenParmNo);
                value->cValue.imag=
                        *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->CAPsenParmNo);
            }
            return(0);
        default:
            return(7);
        }
}

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 sCAPinstance { struct sCAPmodel { int CAPmodType; struct sCAPmodel *CAPnextModel; struct sCAPinstance *CAPinstances; char *CAPmodName; double CAPtnom; double CAPtempCoeff1; double CAPtempCoeff2; double CAPmCap; double CAPcj; double CAPcjsw; double CAPdefWidth; double CAPdefLength; double CAPnarrow; double CAPshort; double CAPdi; double CAPthick; unsigned int CAPmCapGiven; unsigned int CAPcjGiven; unsigned int CAPcjswGiven; unsigned int CAPdefWidthGiven; unsigned int CAPdefLengthGiven; unsigned int CAPnarrowGiven; unsigned int CAPshortGiven; unsigned int CAPtnomGiven; unsigned int CAPtc1Given; unsigned int CAPtc2Given; unsigned int CAPdiGiven; unsigned int CAPthickGiven; } *CAPmodPtr; struct sCAPinstance *CAPnextInstance; char *CAPname; int CAPowner; int CAPstate; int CAPposNode; int CAPnegNode; double CAPtemp; double CAPdtemp; double CAPcapac; double CAPinitCond; double CAPwidth; double CAPlength; double CAPscale; double CAPm; double *CAPposPosptr; double *CAPnegNegptr; double *CAPposNegptr; double *CAPnegPosptr; unsigned int CAPcapGiven; unsigned int CAPicGiven; unsigned int CAPwidthGiven; unsigned int CAPlengthGiven; unsigned int CAPtempGiven; unsigned int CAPdtempGiven; unsigned int CAPscaleGiven; unsigned int CAPmGiven; int CAPsenParmNo; } *

variable_types: vr double

variable_types: vi double

variable_types: sr double

variable_types: si double

variable_types: vm double

variable_types:
msg
char *

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 sCAPinstance { struct sCAPmodel *CAPmodPtr; struct sCAPinstance *CAPnextInstance; char *CAPname; int CAPowner; int CAPstate; int CAPposNode; int CAPnegNode; double CAPtemp; double CAPdtemp; double CAPcapac; double CAPinitCond; double CAPwidth; double CAPlength; double CAPscale; double CAPm; double *CAPposPosptr; double *CAPnegNegptr; double *CAPposNegptr; double *CAPnegPosptr; unsigned int CAPcapGiven; unsigned int CAPicGiven; unsigned int CAPwidthGiven; unsigned int CAPlengthGiven; unsigned int CAPtempGiven; unsigned int CAPdtempGiven; unsigned int CAPscaleGiven; unsigned int CAPmGiven; int CAPsenParmNo; }

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

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

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


MESgetic

original_code:
int
MESgetic(GENmodel *inModel, CKTcircuit *ckt)
{
    MESmodel *model = (MESmodel*)inModel;
    MESinstance *here;
    for( ; model ; model = model->MESnextModel) {
        for(here = model->MESinstances; here ; here = here->MESnextInstance) {
     if (here->MESowner != ARCHme) continue;
            if(!here->MESicVDSGiven) {
                here->MESicVDS =
                        *(ckt->CKTrhs + here->MESdrainNode) -
                        *(ckt->CKTrhs + here->MESsourceNode);
            }
            if(!here->MESicVGSGiven) {
                here->MESicVGS =
                        *(ckt->CKTrhs + here->MESgateNode) -
                        *(ckt->CKTrhs + here->MESsourceNode);
            }
        }
    }
    return(0);
}

canonical_original_code:
int MESgetic(struct sGENmodel *inModel, struct CKTcircuit *ckt)
{
    struct sMESmodel *model = (MESmodel*)inModel;
    struct sMESinstance *here;
    for( ; model ; model = model->MESnextModel) {
        for(here = model->MESinstances; here ; here = here->MESnextInstance) {
     if (here->MESowner != ARCHme) continue;
            if(!here->MESicVDSGiven) {
                here->MESicVDS =
                        *(ckt->CKTrhs + here->MESdrainNode) -
                        *(ckt->CKTrhs + here->MESsourceNode);
            }
            if(!here->MESicVGSGiven) {
                here->MESicVGS =
                        *(ckt->CKTrhs + here->MESgateNode) -
                        *(ckt->CKTrhs + here->MESsourceNode);
            }
        }
    }
    return(0);
}

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


TRAaccept

original_code:
int
TRAaccept(CKTcircuit *ckt, GENmodel *inModel)
{
    TRAmodel *model = (TRAmodel *)inModel;
    TRAinstance *here;
    int i=0,j;
    double v1,v2,v3,v4;
    double v5,v6,d1,d2,d3,d4;
    double *from,*to;
    int error;
    for( ; model != ((void *)0); model = model->TRAnextModel ) {
        for (here = model->TRAinstances; here != ((void *)0) ;
                here=here->TRAnextInstance) {
     if (here->TRAowner != ARCHme) continue;
            if( (ckt->CKTtime - here->TRAtd) > *(here->TRAdelays+6)) {
                for(i=2;i<here->TRAsizeDelay &&
                    (ckt->CKTtime - here->TRAtd > *(here->TRAdelays+3*i));i++)
                        { ; }
                i -= 2;
                for(j=i;j<=here->TRAsizeDelay;j++) {
                    from = here->TRAdelays + 3*j;
                    to = here->TRAdelays + 3*(j-i);
                    *(to) = *(from);
                    *(to+1) = *(from+1);
                    *(to+2) = *(from+2);
                }
                here->TRAsizeDelay -= i;
            }
            if(ckt->CKTtime - *(here->TRAdelays+3*here->TRAsizeDelay) >
                    ckt->CKTminBreak) {
                if(here->TRAallocDelay <= here->TRAsizeDelay) {
                    here->TRAallocDelay += 5;
                    here->TRAdelays = (double *)trealloc((char *)((char *)here->TRAdelays),(unsigned)((here->TRAallocDelay+1)*3*sizeof(double)));
                }
                here->TRAsizeDelay ++;
                to = (here->TRAdelays +3*here->TRAsizeDelay);
                *to = ckt->CKTtime;
                to = (here->TRAdelays+1+3*here->TRAsizeDelay);
                *to = ( *(ckt->CKTrhsOld + here->TRAposNode2)
                     -*(ckt->CKTrhsOld + here->TRAnegNode2))
                    + *(ckt->CKTrhsOld + here->TRAbrEq2)*
                        here->TRAimped;
                *(here->TRAdelays+2+3*here->TRAsizeDelay) =
                    ( *(ckt->CKTrhsOld + here->TRAposNode1)
                     -*(ckt->CKTrhsOld + here->TRAnegNode1))
                    + *(ckt->CKTrhsOld + here->TRAbrEq1)*
                        here->TRAimped;
                v1 = *(here->TRAdelays+1+3*here->TRAsizeDelay);
                v2 = *(here->TRAdelays+1+3*(here->TRAsizeDelay-1));
                v3 = *(here->TRAdelays+1+3*(here->TRAsizeDelay-2));
                v4 = *(here->TRAdelays+2+3*here->TRAsizeDelay);
                v5 = *(here->TRAdelays+2+3*(here->TRAsizeDelay-1));
                v6 = *(here->TRAdelays+2+3*(here->TRAsizeDelay-2));
                d1 = (v1-v2)/ckt->CKTdeltaOld[0];
                d2 = (v2-v3)/ckt->CKTdeltaOld[1];
                d3 = (v4-v5)/ckt->CKTdeltaOld[0];
                d4 = (v5-v6)/ckt->CKTdeltaOld[1];
                if( (fabs(d1-d2) >= here->TRAreltol*((fabs(d1)) > (fabs(d2)) ? (fabs(d1)) : (fabs(d2)))+
                        here->TRAabstol) ||
                        (fabs(d3-d4) >= here->TRAreltol*((fabs(d3)) > (fabs(d4)) ? (fabs(d3)) : (fabs(d4)))+
                        here->TRAabstol) ) {
                    error = CKTsetBreak(ckt,
                            *(here->TRAdelays+3*here->TRAsizeDelay -3) +
                            here->TRAtd);
                    if(error) return(error);
                }
            }
        }
    }
    return(0);
}

canonical_original_code:
int TRAaccept(struct CKTcircuit *ckt, struct sGENmodel *inModel)
{
    struct sTRAmodel *model = (TRAmodel *)inModel;
    struct sTRAinstance *here;
    int i = 0; int j;
    double v1; double v2; double v3; double v4;
    double v5; double v6; double d1; double d2; double d3; double d4;
    double *from; double *to;
    int error;
    for( ; model != ((void *)0); model = model->TRAnextModel ) {
        for (here = model->TRAinstances; here != ((void *)0) ;
                here=here->TRAnextInstance) {
     if (here->TRAowner != ARCHme) continue;
            if( (ckt->CKTtime - here->TRAtd) > *(here->TRAdelays+6)) {
                for(i=2;i<here->TRAsizeDelay &&
                    (ckt->CKTtime - here->TRAtd > *(here->TRAdelays+3*i));i++)
                        { ; }
                i -= 2;
                for(j=i;j<=here->TRAsizeDelay;j++) {
                    from = here->TRAdelays + 3*j;
                    to = here->TRAdelays + 3*(j-i);
                    *(to) = *(from);
                    *(to+1) = *(from+1);
                    *(to+2) = *(from+2);
                }
                here->TRAsizeDelay -= i;
            }
            if(ckt->CKTtime - *(here->TRAdelays+3*here->TRAsizeDelay) >
                    ckt->CKTminBreak) {
                if(here->TRAallocDelay <= here->TRAsizeDelay) {
                    here->TRAallocDelay += 5;
                    here->TRAdelays = (double *)trealloc((char *)((char *)here->TRAdelays),(unsigned int)((here->TRAallocDelay+1)*3*sizeof(double)));
                }
                here->TRAsizeDelay ++;
                to = (here->TRAdelays +3*here->TRAsizeDelay);
                *to = ckt->CKTtime;
                to = (here->TRAdelays+1+3*here->TRAsizeDelay);
                *to = ( *(ckt->CKTrhsOld + here->TRAposNode2)
                     -*(ckt->CKTrhsOld + here->TRAnegNode2))
                    + *(ckt->CKTrhsOld + here->TRAbrEq2)*
                        here->TRAimped;
                *(here->TRAdelays+2+3*here->TRAsizeDelay) =
                    ( *(ckt->CKTrhsOld + here->TRAposNode1)
                     -*(ckt->CKTrhsOld + here->TRAnegNode1))
                    + *(ckt->CKTrhsOld + here->TRAbrEq1)*
                        here->TRAimped;
                v1 = *(here->TRAdelays+1+3*here->TRAsizeDelay);
                v2 = *(here->TRAdelays+1+3*(here->TRAsizeDelay-1));
                v3 = *(here->TRAdelays+1+3*(here->TRAsizeDelay-2));
                v4 = *(here->TRAdelays+2+3*here->TRAsizeDelay);
                v5 = *(here->TRAdelays+2+3*(here->TRAsizeDelay-1));
                v6 = *(here->TRAdelays+2+3*(here->TRAsizeDelay-2));
                d1 = (v1-v2)/ckt->CKTdeltaOld[0];
                d2 = (v2-v3)/ckt->CKTdeltaOld[1];
                d3 = (v4-v5)/ckt->CKTdeltaOld[0];
                d4 = (v5-v6)/ckt->CKTdeltaOld[1];
                if( (fabs(d1-d2) >= here->TRAreltol*((fabs(d1)) > (fabs(d2)) ? (fabs(d1)) : (fabs(d2)))+
                        here->TRAabstol) ||
                        (fabs(d3-d4) >= here->TRAreltol*((fabs(d3)) > (fabs(d4)) ? (fabs(d3)) : (fabs(d4)))+
                        here->TRAabstol) ) {
                    error = CKTsetBreak(ckt,
                            *(here->TRAdelays+3*here->TRAsizeDelay -3) +
                            here->TRAtd);
                    if(error) return(error);
                }
            }
        }
    }
    return(0);
}

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:
inModel
struct sGENmodel *

variable_types: struct sTRAmodel { int TRAmodType; struct sTRAmodel *TRAnextModel; struct sTRAinstance { struct sTRAmodel *TRAmodPtr; struct sTRAinstance *TRAnextInstance; char *TRAname; int TRAowner; int TRAstate; int TRAposNode1; int TRAnegNode1; int TRAposNode2; int TRAnegNode2; int TRAintNode1; int TRAintNode2; double TRAimped; double TRAconduct; double TRAtd; double TRAnl; double TRAf; double TRAinput1; double TRAinput2; double TRAinitVolt1; double TRAinitCur1; double TRAinitVolt2; double TRAinitCur2; double TRAreltol; double TRAabstol; double *TRAdelays; int TRAsizeDelay; int TRAallocDelay; int TRAbrEq1; int TRAbrEq2; double *TRAibr1Ibr2Ptr; double *TRAibr1Int1Ptr; double *TRAibr1Neg1Ptr; double *TRAibr1Neg2Ptr; double *TRAibr1Pos2Ptr; double *TRAibr2Ibr1Ptr; double *TRAibr2Int2Ptr; double *TRAibr2Neg1Ptr; double *TRAibr2Neg2Ptr; double *TRAibr2Pos1Ptr; double *TRAint1Ibr1Ptr; double *TRAint1Int1Ptr; double *TRAint1Pos1Ptr; double *TRAint2Ibr2Ptr; double *TRAint2Int2Ptr; double *TRAint2Pos2Ptr; double *TRAneg1Ibr1Ptr; double *TRAneg2Ibr2Ptr; double *TRApos1Int1Ptr; double *TRApos1Pos1Ptr; double *TRApos2Int2Ptr; double *TRApos2Pos2Ptr; unsigned int TRAimpedGiven; unsigned int TRAtdGiven; unsigned int TRAnlGiven; unsigned int TRAfGiven; unsigned int TRAicV1Given; unsigned int TRAicC1Given; unsigned int TRAicV2Given; unsigned int TRAicC2Given; unsigned int TRAreltolGiven; unsigned int TRAabstolGiven; } *TRAinstances; char *TRAmodName; } *

variable_types: struct sTRAinstance { struct sTRAmodel { int TRAmodType; struct sTRAmodel *TRAnextModel; struct sTRAinstance *TRAinstances; char *TRAmodName; } *TRAmodPtr; struct sTRAinstance *TRAnextInstance; char *TRAname; int TRAowner; int TRAstate; int TRAposNode1; int TRAnegNode1; int TRAposNode2; int TRAnegNode2; int TRAintNode1; int TRAintNode2; double TRAimped; double TRAconduct; double TRAtd; double TRAnl; double TRAf; double TRAinput1; double TRAinput2; double TRAinitVolt1; double TRAinitCur1; double TRAinitVolt2; double TRAinitCur2; double TRAreltol; double TRAabstol; double *TRAdelays; int TRAsizeDelay; int TRAallocDelay; int TRAbrEq1; int TRAbrEq2; double *TRAibr1Ibr2Ptr; double *TRAibr1Int1Ptr; double *TRAibr1Neg1Ptr; double *TRAibr1Neg2Ptr; double *TRAibr1Pos2Ptr; double *TRAibr2Ibr1Ptr; double *TRAibr2Int2Ptr; double *TRAibr2Neg1Ptr; double *TRAibr2Neg2Ptr; double *TRAibr2Pos1Ptr; double *TRAint1Ibr1Ptr; double *TRAint1Int1Ptr; double *TRAint1Pos1Ptr; double *TRAint2Ibr2Ptr; double *TRAint2Int2Ptr; double *TRAint2Pos2Ptr; double *TRAneg1Ibr1Ptr; double *TRAneg2Ibr2Ptr; double *TRApos1Int1Ptr; double *TRApos1Pos1Ptr; double *TRApos2Int2Ptr; double *TRApos2Pos2Ptr; unsigned int TRAimpedGiven; unsigned int TRAtdGiven; unsigned int TRAnlGiven; unsigned int TRAfGiven; unsigned int TRAicV1Given; unsigned int TRAicC1Given; unsigned int TRAicV2Given; unsigned int TRAicC2Given; unsigned int TRAreltolGiven; unsigned int TRAabstolGiven; } *

variable_types: i int

variable_types: j int

variable_types:
from
double *

variable_types:
to
double *

variable_types: error int


INDsetup

original_code:
int
INDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
{
    INDmodel *model = (INDmodel*)inModel;
    INDinstance *here;
    int error;
    CKTnode *tmp;
    for( ; model != ((void *)0); model = model->INDnextModel ) {
        if (!model->INDmIndGiven) {
             model->INDmInd = 0.0;
        }
 if (!model->INDtnomGiven) {
             model->INDtnom = ckt->CKTnomTemp;
        }
 if (!model->INDtc1Given) {
             model->INDtempCoeff1 = 0.0;
        }
        if (!model->INDtc2Given) {
             model->INDtempCoeff2 = 0.0;
        }
        if (!model->INDcsectGiven){
             model->INDcsect = 0.0;
        }
        if (!model->INDlengthGiven) {
             model->INDlength = 0.0;
        }
        if (!model->INDmodNtGiven) {
             model->INDmodNt = 0.0;
        }
        if (!model->INDmuGiven) {
             model->INDmu = 0.0;
        }
 if((model->INDlengthGiven)
              && (model->INDlength > 0.0)) {
  if (model->INDmuGiven)
                    model->INDspecInd = (model->INDmu * (1.25663706143592e-6)
       * model->INDcsect * model->INDcsect) / model->INDlength;
  else
                   model->INDspecInd = ((1.25663706143592e-6) * model->INDcsect
     * model->INDcsect ) / model->INDlength;
 } else {
         model->INDspecInd = 0.0;
 }
 if (!model->INDmIndGiven)
            model->INDmInd = model->INDmodNt * model->INDmodNt * model->INDspecInd;
        for (here = model->INDinstances; here != ((void *)0) ;
                here=here->INDnextInstance) {
     if (here->INDowner != ARCHme) goto matrixpointers;
            here->INDstate = *states;
            *states += 2 ;
            if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & 0x2) ){
                *states += 2 * (ckt->CKTsenInfo->SENparms);
            }
matrixpointers:
            if(here->INDbrEq == 0) {
                error = CKTmkCur(ckt,&tmp,here->INDname,"branch");
                if(error) return(error);
                here->INDbrEq = tmp->number;
            }
            if((here->INDposIbrptr = SMPmakeElt(matrix,here->INDposNode,here->INDbrEq))==(double *)((void *)0)){ return(8);}
            if((here->INDnegIbrptr = SMPmakeElt(matrix,here->INDnegNode,here->INDbrEq))==(double *)((void *)0)){ return(8);}
            if((here->INDibrNegptr = SMPmakeElt(matrix,here->INDbrEq,here->INDnegNode))==(double *)((void *)0)){ return(8);}
            if((here->INDibrPosptr = SMPmakeElt(matrix,here->INDbrEq,here->INDposNode))==(double *)((void *)0)){ return(8);}
            if((here->INDibrIbrptr = SMPmakeElt(matrix,here->INDbrEq,here->INDbrEq))==(double *)((void *)0)){ return(8);}
        }
    }
    return(0);
}

canonical_original_code:
int INDsetup(void *matrix, struct sGENmodel *inModel, struct CKTcircuit *ckt, int *states)
{
    struct sINDmodel *model = (INDmodel*)inModel;
    struct sINDinstance *here;
    int error;
    struct sCKTnode *tmp;
    for( ; model != ((void *)0); model = model->INDnextModel ) {
        if (!model->INDmIndGiven) {
             model->INDmInd = 0.0;
        }
 if (!model->INDtnomGiven) {
             model->INDtnom = ckt->CKTnomTemp;
        }
 if (!model->INDtc1Given) {
             model->INDtempCoeff1 = 0.0;
        }
        if (!model->INDtc2Given) {
             model->INDtempCoeff2 = 0.0;
        }
        if (!model->INDcsectGiven){
             model->INDcsect = 0.0;
        }
        if (!model->INDlengthGiven) {
             model->INDlength = 0.0;
        }
        if (!model->INDmodNtGiven) {
             model->INDmodNt = 0.0;
        }
        if (!model->INDmuGiven) {
             model->INDmu = 0.0;
        }
 if((model->INDlengthGiven)
              && (model->INDlength > 0.0)) {
  if (model->INDmuGiven)
                    model->INDspecInd = (model->INDmu * (1.25663706143592e-6)
       * model->INDcsect * model->INDcsect) / model->INDlength;
  else
                   model->INDspecInd = ((1.25663706143592e-6) * model->INDcsect
     * model->INDcsect ) / model->INDlength;
 } else {
         model->INDspecInd = 0.0;
 }
 if (!model->INDmIndGiven)
            model->INDmInd = model->INDmodNt * model->INDmodNt * model->INDspecInd;
        for (here = model->INDinstances; here != ((void *)0) ;
                here=here->INDnextInstance) {
     if (here->INDowner != ARCHme) goto matrixpointers;
            here->INDstate = *states;
            *states += 2 ;
            if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & 0x2) ){
                *states += 2 * (ckt->CKTsenInfo->SENparms);
            }
matrixpointers:
            if(here->INDbrEq == 0) {
                error = CKTmkCur(ckt,&tmp,here->INDname,"branch");
                if(error) return(error);
                here->INDbrEq = tmp->number;
            }
            if((here->INDposIbrptr = SMPmakeElt(matrix,here->INDposNode,here->INDbrEq))==(double *)((void *)0)){ return(8);}
            if((here->INDnegIbrptr = SMPmakeElt(matrix,here->INDnegNode,here->INDbrEq))==(double *)((void *)0)){ return(8);}
            if((here->INDibrNegptr = SMPmakeElt(matrix,here->INDbrEq,here->INDnegNode))==(double *)((void *)0)){ return(8);}
            if((here->INDibrPosptr = SMPmakeElt(matrix,here->INDbrEq,here->INDposNode))==(double *)((void *)0)){ return(8);}
            if((here->INDibrIbrptr = SMPmakeElt(matrix,here->INDbrEq,here->INDbrEq))==(double *)((void *)0)){ return(8);}
        }
    }
    return(0);
}

variable_types:
matrix
void *

variable_types:
states
int *

variable_types: struct sINDmodel { int INDmodType; struct sINDmodel *INDnextModel; struct sINDinstance { struct sINDmodel *INDmodPtr; struct sINDinstance *INDnextInstance; char *INDname; int INDowner; int INDstate; int INDposNode; int INDnegNode; int INDbrEq; double INDinduct; double INDm; double INDtemp; double INDdtemp; double INDscale; double INDnt; double INDinitCond; double *INDposIbrptr; double *INDnegIbrptr; double *INDibrNegptr; double *INDibrPosptr; double *INDibrIbrptr; unsigned int INDindGiven; unsigned int INDicGiven; unsigned int INDmGiven; unsigned int INDtempGiven; unsigned int INDdtempGiven; unsigned int INDscaleGiven; unsigned int INDntGiven; int INDsenParmNo; } *INDinstances; char *INDmodName; double INDmInd; double INDtnom; double INDtempCoeff1; double INDtempCoeff2; double INDcsect; double INDlength; double INDmodNt; double INDmu; unsigned int INDtnomGiven; unsigned int INDtc1Given; unsigned int INDtc2Given; unsigned int INDcsectGiven; unsigned int INDlengthGiven; unsigned int INDmodNtGiven; unsigned int INDmuGiven; unsigned int INDmIndGiven; double INDspecInd; } *

variable_types: struct sINDinstance { struct sINDmodel { int INDmodType; struct sINDmodel *INDnextModel; struct sINDinstance *INDinstances; char *INDmodName; double INDmInd; double INDtnom; double INDtempCoeff1; double INDtempCoeff2; double INDcsect; double INDlength; double INDmodNt; double INDmu; unsigned int INDtnomGiven; unsigned int INDtc1Given; unsigned int INDtc2Given; unsigned int INDcsectGiven; unsigned int INDlengthGiven; unsigned int INDmodNtGiven; unsigned int INDmuGiven; unsigned int INDmIndGiven; double INDspecInd; } *INDmodPtr; struct sINDinstance *INDnextInstance; char *INDname; int INDowner; int INDstate; int INDposNode; int INDnegNode; int INDbrEq; double INDinduct; double INDm; double INDtemp; double INDdtemp; double INDscale; double INDnt; double INDinitCond; double *INDposIbrptr; double *INDnegIbrptr; double *INDibrNegptr; double *INDibrPosptr; double *INDibrIbrptr; unsigned int INDindGiven; unsigned int INDicGiven; unsigned int INDmGiven; unsigned int INDtempGiven; unsigned int INDdtempGiven; unsigned int INDscaleGiven; unsigned int INDntGiven; int INDsenParmNo; } *

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


decompiled_code:
void __fastcall B3SOIlimit(_DWORD *a1, double a2, double a3, double a4)
{
double v4; // xmm1_8

v4 = a2 - a3;
if ( COERCE_DOUBLE(*(_QWORD *)&v4 & LC3) > a4 )
*a1 = 1;
}

canonical_decompiled_code:
void __fastcall func1(_DWORD *a1, double a2, double a3, double a4)
{
double v4; // xmm1_8

v4 = a2 - a3;
if ( COERCE_DOUBLE(*(_QWORD *)&v4 & LC3) > a4 )
*a1 = 1;
}

original_code:
double
B3SOIlimit(double vnew, double vold, double limit, int *check)
{
    double T0, T1;
    if (__builtin_isnan (vnew) || __builtin_isnan (vold))
    {
 fprintf(stderr, "Alberto says:  YOU TURKEY!  The limiting function received NaN.\n");
 fprintf(stderr, "New prediction returns to 0.0!\n");
        vnew = 0.0;
        *check = 1;
    }
    T0 = vnew - vold;
    T1 = fabs(T0);
    if (T1 > limit) {
        if (T0 > 0.0)
            vnew = vold + limit;
        else
            vnew = vold - limit;
 *check = 1;
    }
    return vnew;
}

canonical_original_code:
double B3SOIlimit(double vnew, double vold, double limit, int *check)
{
    double T0; double T1;
    if (__builtin_isnan (vnew) || __builtin_isnan (vold))
    {
 fprintf(stderr, "Alberto says:  YOU TURKEY!  The limiting function received NaN.\n");
 fprintf(stderr, "New prediction returns to 0.0!\n");
        vnew = 0.0;
        *check = 1;
    }
    T0 = vnew - vold;
    T1 = fabs(T0);
    if (T1 > limit) {
        if (T0 > 0.0)
            vnew = vold + limit;
        else
            vnew = vold - limit;
 *check = 1;
    }
    return vnew;
}

variable_types: vnew double

variable_types: vold double

variable_types: limit double

variable_types:
check
int *

return_type: double