BJTmAsk

repo: gserdyuk/gnucap-a

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

switch ( a3 )
{
case 103:
result = 0LL;
*a4 = *(double *)(a2 + 48);
break;
case 104:
result = 0LL;
*a4 = *(double *)(a2 + 56);
break;
case 105:
result = 0LL;
*a4 = *(double *)(a2 + 64);
break;
case 106:
result = 0LL;
*a4 = *(double *)(a2 + 72);
break;
case 107:
result = 0LL;
*a4 = *(double *)(a2 + 80);
break;
case 108:
result = 0LL;
*a4 = *(double *)(a2 + 88);
break;
case 109:
result = 0LL;
*a4 = *(double *)(a2 + 96);
break;
case 110:
result = 0LL;
*a4 = *(double *)(a2 + 104);
break;
case 111:
result = 0LL;
*a4 = *(double *)(a2 + 112);
break;
case 112:
result = 0LL;
*a4 = *(double *)(a2 + 120);
break;
case 113:
result = 0LL;
*a4 = *(double *)(a2 + 128);
break;
case 114:
result = 0LL;
*a4 = *(double *)(a2 + 136);
break;
case 115:
result = 0LL;
*a4 = *(double *)(a2 + 144);
break;
case 116:
result = 0LL;
*a4 = *(double *)(a2 + 152);
break;
case 117:
result = 0LL;
*a4 = *(double *)(a2 + 160);
break;
case 118:
result = 0LL;
*a4 = *(double *)(a2 + 168);
break;
case 119:
result = 0LL;
*a4 = *(double *)(a2 + 176);
break;
case 120:
result = 0LL;
*a4 = *(double *)(a2 + 184);
break;
case 121:
result = 0LL;
*a4 = *(double *)(a2 + 192);
break;
case 122:
result = 0LL;
*a4 = *(double *)(a2 + 200);
break;
case 123:
result = 0LL;
*a4 = *(double *)(a2 + 208);
break;
case 124:
result = 0LL;
*a4 = *(double *)(a2 + 216);
break;
case 125:
result = 0LL;
*a4 = *(double *)(a2 + 224);
break;
case 126:
result = 0LL;
*a4 = *(double *)(a2 + 232);
break;
case 127:
result = 0LL;
*a4 = *(double *)(a2 + 240);
break;
case 128:
result = 0LL;
*a4 = *(double *)(a2 + 248);
break;
case 129:
result = 0LL;
*a4 = *(double *)(a2 + 256);
break;
case 130:
result = 0LL;
*a4 = *(double *)(a2 + 264);
break;
case 131:
result = 0LL;
*a4 = *(double *)(a2 + 272);
break;
case 132:
result = 0LL;
*a4 = *(double *)(a2 + 280);
break;
case 133:
result = 0LL;
*a4 = *(double *)(a2 + 288);
break;
case 134:
result = 0LL;
*a4 = *(double *)(a2 + 296);
break;
case 135:
result = 0LL;
*a4 = *(double *)(a2 + 304);
break;
case 136:
result = 0LL;
*a4 = *(double *)(a2 + 312);
break;
case 137:
result = 0LL;
*a4 = *(double *)(a2 + 320);
break;
case 138:
result = 0LL;
*a4 = *(double *)(a2 + 328);
break;
case 139:
result = 0LL;
*a4 = *(double *)(a2 + 336);
break;
case 140:
result = 0LL;
*a4 = *(double *)(a2 + 344);
break;
case 141:
result = 0LL;
*a4 = *(double *)(a2 + 40) - 273.15;
break;
case 301:
result = 0LL;
*a4 = *(double *)(a2 + 368);
break;
case 302:
result = 0LL;
*a4 = *(double *)(a2 + 376);
break;
case 303:
result = 0LL;
*a4 = *(double *)(a2 + 384);
break;
case 304:
result = 0LL;
*a4 = *(double *)(a2 + 392);
break;
case 305:
result = 0LL;
*a4 = *(double *)(a2 + 400);
break;
case 306:
result = 0LL;
*a4 = *(double *)(a2 + 408);
break;
case 307:
result = 0LL;
*a4 = *(double *)(a2 + 416);
break;
case 308:
result = 0LL;
*a4 = *(double *)(a2 + 424);
break;
case 309:
if ( *(_DWORD *)(a2 + 32) == 1 )
*(_QWORD *)a4 = &LC1;
else
*(_QWORD *)a4 = &LC2;
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

switch ( a3 )
{
case 103:
result = 0LL;
*a4 = *(double *)(a2 + 48);
break;
case 104:
result = 0LL;
*a4 = *(double *)(a2 + 56);
break;
case 105:
result = 0LL;
*a4 = *(double *)(a2 + 64);
break;
case 106:
result = 0LL;
*a4 = *(double *)(a2 + 72);
break;
case 107:
result = 0LL;
*a4 = *(double *)(a2 + 80);
break;
case 108:
result = 0LL;
*a4 = *(double *)(a2 + 88);
break;
case 109:
result = 0LL;
*a4 = *(double *)(a2 + 96);
break;
case 110:
result = 0LL;
*a4 = *(double *)(a2 + 104);
break;
case 111:
result = 0LL;
*a4 = *(double *)(a2 + 112);
break;
case 112:
result = 0LL;
*a4 = *(double *)(a2 + 120);
break;
case 113:
result = 0LL;
*a4 = *(double *)(a2 + 128);
break;
case 114:
result = 0LL;
*a4 = *(double *)(a2 + 136);
break;
case 115:
result = 0LL;
*a4 = *(double *)(a2 + 144);
break;
case 116:
result = 0LL;
*a4 = *(double *)(a2 + 152);
break;
case 117:
result = 0LL;
*a4 = *(double *)(a2 + 160);
break;
case 118:
result = 0LL;
*a4 = *(double *)(a2 + 168);
break;
case 119:
result = 0LL;
*a4 = *(double *)(a2 + 176);
break;
case 120:
result = 0LL;
*a4 = *(double *)(a2 + 184);
break;
case 121:
result = 0LL;
*a4 = *(double *)(a2 + 192);
break;
case 122:
result = 0LL;
*a4 = *(double *)(a2 + 200);
break;
case 123:
result = 0LL;
*a4 = *(double *)(a2 + 208);
break;
case 124:
result = 0LL;
*a4 = *(double *)(a2 + 216);
break;
case 125:
result = 0LL;
*a4 = *(double *)(a2 + 224);
break;
case 126:
result = 0LL;
*a4 = *(double *)(a2 + 232);
break;
case 127:
result = 0LL;
*a4 = *(double *)(a2 + 240);
break;
case 128:
result = 0LL;
*a4 = *(double *)(a2 + 248);
break;
case 129:
result = 0LL;
*a4 = *(double *)(a2 + 256);
break;
case 130:
result = 0LL;
*a4 = *(double *)(a2 + 264);
break;
case 131:
result = 0LL;
*a4 = *(double *)(a2 + 272);
break;
case 132:
result = 0LL;
*a4 = *(double *)(a2 + 280);
break;
case 133:
result = 0LL;
*a4 = *(double *)(a2 + 288);
break;
case 134:
result = 0LL;
*a4 = *(double *)(a2 + 296);
break;
case 135:
result = 0LL;
*a4 = *(double *)(a2 + 304);
break;
case 136:
result = 0LL;
*a4 = *(double *)(a2 + 312);
break;
case 137:
result = 0LL;
*a4 = *(double *)(a2 + 320);
break;
case 138:
result = 0LL;
*a4 = *(double *)(a2 + 328);
break;
case 139:
result = 0LL;
*a4 = *(double *)(a2 + 336);
break;
case 140:
result = 0LL;
*a4 = *(double *)(a2 + 344);
break;
case 141:
result = 0LL;
*a4 = *(double *)(a2 + 40) - 273.15;
break;
case 301:
result = 0LL;
*a4 = *(double *)(a2 + 368);
break;
case 302:
result = 0LL;
*a4 = *(double *)(a2 + 376);
break;
case 303:
result = 0LL;
*a4 = *(double *)(a2 + 384);
break;
case 304:
result = 0LL;
*a4 = *(double *)(a2 + 392);
break;
case 305:
result = 0LL;
*a4 = *(double *)(a2 + 400);
break;
case 306:
result = 0LL;
*a4 = *(double *)(a2 + 408);
break;
case 307:
result = 0LL;
*a4 = *(double *)(a2 + 416);
break;
case 308:
result = 0LL;
*a4 = *(double *)(a2 + 424);
break;
case 309:
if ( *(_DWORD *)(a2 + 32) == 1 )
*(_QWORD *)a4 = &LC1;
else
*(_QWORD *)a4 = &LC2;
result = 0LL;
break;
default:
result = 7LL;
break;
}
return result;
}

original_code:
int
BJTmAsk(CKTcircuit *ckt, GENmodel *instPtr, int which, IFvalue *value)
{
    BJTmodel *here = (BJTmodel*)instPtr;
    switch(which) {
        case 143:
            value->rValue = here->BJTtnom-(273.15);
            return(0);
        case 103:
            value->rValue = here->BJTsatCur;
            return(0);
        case 104:
            value->rValue = here->BJTbetaF;
            return(0);
        case 105:
            value->rValue = here->BJTemissionCoeffF;
            return(0);
        case 106:
            value->rValue = here->BJTearlyVoltF;
            return(0);
        case 107:
            value->rValue = here->BJTrollOffF;
            return(0);
        case 108:
            value->rValue = here->BJTleakBEcurrent;
            return(0);
        case 109:
            value->rValue = here->BJTc2;
            return(0);
        case 110:
            value->rValue = here->BJTleakBEemissionCoeff;
            return(0);
        case 111:
            value->rValue = here->BJTbetaR;
            return(0);
        case 112:
            value->rValue = here->BJTemissionCoeffR;
            return(0);
        case 113:
            value->rValue = here->BJTearlyVoltR;
            return(0);
        case 114:
            value->rValue = here->BJTrollOffR;
            return(0);
        case 115:
            value->rValue = here->BJTleakBCcurrent;
            return(0);
        case 116:
            value->rValue = here->BJTc4;
            return(0);
        case 117:
            value->rValue = here->BJTleakBCemissionCoeff;
            return(0);
        case 118:
            value->rValue = here->BJTbaseResist;
            return(0);
        case 119:
            value->rValue = here->BJTbaseCurrentHalfResist;
            return(0);
        case 120:
            value->rValue = here->BJTminBaseResist;
            return(0);
        case 121:
            value->rValue = here->BJTemitterResist;
            return(0);
        case 122:
            value->rValue = here->BJTcollectorResist;
            return(0);
        case 123:
            value->rValue = here->BJTdepletionCapBE;
            return(0);
        case 124:
            value->rValue = here->BJTpotentialBE;
            return(0);
        case 125:
            value->rValue = here->BJTjunctionExpBE;
            return(0);
        case 126:
            value->rValue = here->BJTtransitTimeF;
            return(0);
        case 127:
            value->rValue = here->BJTtransitTimeBiasCoeffF;
            return(0);
        case 128:
            value->rValue = here->BJTtransitTimeFVBC;
            return(0);
        case 129:
            value->rValue = here->BJTtransitTimeHighCurrentF;
            return(0);
        case 130:
            value->rValue = here->BJTexcessPhase;
            return(0);
        case 131:
            value->rValue = here->BJTdepletionCapBC;
            return(0);
        case 132:
            value->rValue = here->BJTpotentialBC;
            return(0);
        case 133:
            value->rValue = here->BJTjunctionExpBC;
            return(0);
        case 134:
            value->rValue = here->BJTbaseFractionBCcap;
            return(0);
        case 135:
            value->rValue = here->BJTtransitTimeR;
            return(0);
        case 136:
            value->rValue = here->BJTcapCS;
            return(0);
        case 137:
            value->rValue = here->BJTpotentialSubstrate;
            return(0);
        case 138:
            value->rValue = here->BJTexponentialSubstrate;
            return(0);
        case 139:
            value->rValue = here->BJTbetaExp;
            return(0);
        case 140:
            value->rValue = here->BJTenergyGap;
            return(0);
        case 141:
            value->rValue = here->BJTtempExpIS;
            return(0);
        case 142:
            value->rValue = here->BJTdepletionCapCoeff;
            return(0);
        case 301:
            value->rValue = here->BJTinvEarlyVoltF;
            return(0);
        case 302:
            value->rValue = here->BJTinvEarlyVoltR;
            return(0);
        case 303:
            value->rValue = here->BJTinvRollOffF;
            return(0);
        case 304:
            value->rValue = here->BJTinvRollOffR;
            return(0);
        case 305:
            value->rValue = here->BJTcollectorConduct;
            return(0);
        case 306:
            value->rValue = here->BJTemitterConduct;
            return(0);
        case 307:
            value->rValue = here->BJTtransitTimeVBCFactor;
            return(0);
        case 308:
            value->rValue = here->BJTexcessPhaseFactor;
            return(0);
 case 145:
     if (here->BJTfNcoefGiven)
         value->rValue = here->BJTfNcoef;
     else
         value->rValue = 0.0;
            return(0);
 case 144:
     if (here->BJTfNexpGiven)
         value->rValue = here->BJTfNexp;
     else
         value->rValue = 0.0;
            return(0);
 case 309:
     if (here->BJTtype == 1)
         value->sValue = "npn";
     else
         value->sValue = "pnp";
            return(0);
        default:
            return(7);
    }
}

canonical_original_code:
int BJTmAsk(struct CKTcircuit *ckt, struct sGENmodel *instPtr, int which, union uIFvalue *value)
{
    struct sBJTmodel *here = (BJTmodel*)instPtr;
    switch(which) {
        case 143:
            value->rValue = here->BJTtnom-(273.15);
            return(0);
        case 103:
            value->rValue = here->BJTsatCur;
            return(0);
        case 104:
            value->rValue = here->BJTbetaF;
            return(0);
        case 105:
            value->rValue = here->BJTemissionCoeffF;
            return(0);
        case 106:
            value->rValue = here->BJTearlyVoltF;
            return(0);
        case 107:
            value->rValue = here->BJTrollOffF;
            return(0);
        case 108:
            value->rValue = here->BJTleakBEcurrent;
            return(0);
        case 109:
            value->rValue = here->BJTc2;
            return(0);
        case 110:
            value->rValue = here->BJTleakBEemissionCoeff;
            return(0);
        case 111:
            value->rValue = here->BJTbetaR;
            return(0);
        case 112:
            value->rValue = here->BJTemissionCoeffR;
            return(0);
        case 113:
            value->rValue = here->BJTearlyVoltR;
            return(0);
        case 114:
            value->rValue = here->BJTrollOffR;
            return(0);
        case 115:
            value->rValue = here->BJTleakBCcurrent;
            return(0);
        case 116:
            value->rValue = here->BJTc4;
            return(0);
        case 117:
            value->rValue = here->BJTleakBCemissionCoeff;
            return(0);
        case 118:
            value->rValue = here->BJTbaseResist;
            return(0);
        case 119:
            value->rValue = here->BJTbaseCurrentHalfResist;
            return(0);
        case 120:
            value->rValue = here->BJTminBaseResist;
            return(0);
        case 121:
            value->rValue = here->BJTemitterResist;
            return(0);
        case 122:
            value->rValue = here->BJTcollectorResist;
            return(0);
        case 123:
            value->rValue = here->BJTdepletionCapBE;
            return(0);
        case 124:
            value->rValue = here->BJTpotentialBE;
            return(0);
        case 125:
            value->rValue = here->BJTjunctionExpBE;
            return(0);
        case 126:
            value->rValue = here->BJTtransitTimeF;
            return(0);
        case 127:
            value->rValue = here->BJTtransitTimeBiasCoeffF;
            return(0);
        case 128:
            value->rValue = here->BJTtransitTimeFVBC;
            return(0);
        case 129:
            value->rValue = here->BJTtransitTimeHighCurrentF;
            return(0);
        case 130:
            value->rValue = here->BJTexcessPhase;
            return(0);
        case 131:
            value->rValue = here->BJTdepletionCapBC;
            return(0);
        case 132:
            value->rValue = here->BJTpotentialBC;
            return(0);
        case 133:
            value->rValue = here->BJTjunctionExpBC;
            return(0);
        case 134:
            value->rValue = here->BJTbaseFractionBCcap;
            return(0);
        case 135:
            value->rValue = here->BJTtransitTimeR;
            return(0);
        case 136:
            value->rValue = here->BJTcapCS;
            return(0);
        case 137:
            value->rValue = here->BJTpotentialSubstrate;
            return(0);
        case 138:
            value->rValue = here->BJTexponentialSubstrate;
            return(0);
        case 139:
            value->rValue = here->BJTbetaExp;
            return(0);
        case 140:
            value->rValue = here->BJTenergyGap;
            return(0);
        case 141:
            value->rValue = here->BJTtempExpIS;
            return(0);
        case 142:
            value->rValue = here->BJTdepletionCapCoeff;
            return(0);
        case 301:
            value->rValue = here->BJTinvEarlyVoltF;
            return(0);
        case 302:
            value->rValue = here->BJTinvEarlyVoltR;
            return(0);
        case 303:
            value->rValue = here->BJTinvRollOffF;
            return(0);
        case 304:
            value->rValue = here->BJTinvRollOffR;
            return(0);
        case 305:
            value->rValue = here->BJTcollectorConduct;
            return(0);
        case 306:
            value->rValue = here->BJTemitterConduct;
            return(0);
        case 307:
            value->rValue = here->BJTtransitTimeVBCFactor;
            return(0);
        case 308:
            value->rValue = here->BJTexcessPhaseFactor;
            return(0);
 case 145:
     if (here->BJTfNcoefGiven)
         value->rValue = here->BJTfNcoef;
     else
         value->rValue = 0.0;
            return(0);
 case 144:
     if (here->BJTfNexpGiven)
         value->rValue = here->BJTfNexp;
     else
         value->rValue = 0.0;
            return(0);
 case 309:
     if (here->BJTtype == 1)
         value->sValue = "npn";
     else
         value->sValue = "pnp";
            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:
instPtr
struct sGENmodel *

variable_types: which int

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

variable_types: struct sBJTmodel { int BJTmodType; struct sBJTmodel *BJTnextModel; struct sBJTinstance { struct sBJTmodel *BJTmodPtr; struct sBJTinstance *BJTnextInstance; char *BJTname; int BJTowner; int BJTstate; int BJTcolNode; int BJTbaseNode; int BJTemitNode; int BJTsubstNode; int BJTcolPrimeNode; int BJTbasePrimeNode; int BJTemitPrimeNode; double BJTarea; double BJTareab; double BJTareac; double BJTm; double BJTicVBE; double BJTicVCE; double BJTtemp; double BJTdtemp; double BJTtSatCur; double BJTtBetaF; double BJTtBetaR; double BJTtBEleakCur; double BJTtBCleakCur; double BJTtBEcap; double BJTtBEpot; double BJTtBCcap; double BJTtBCpot; double BJTtDepCap; double BJTtf1; double BJTtf4; double BJTtf5; double BJTtVcrit; double *BJTcolColPrimePtr; double *BJTbaseBasePrimePtr; double *BJTemitEmitPrimePtr; double *BJTcolPrimeColPtr; double *BJTcolPrimeBasePrimePtr; double *BJTcolPrimeEmitPrimePtr; double *BJTbasePrimeBasePtr; double *BJTbasePrimeColPrimePtr; double *BJTbasePrimeEmitPrimePtr; double *BJTemitPrimeEmitPtr; double *BJTemitPrimeColPrimePtr; double *BJTemitPrimeBasePrimePtr; double *BJTcolColPtr; double *BJTbaseBasePtr; double *BJTemitEmitPtr; double *BJTcolPrimeColPrimePtr; double *BJTbasePrimeBasePrimePtr; double *BJTemitPrimeEmitPrimePtr; double *BJTsubstSubstPtr; double *BJTcolPrimeSubstPtr; double *BJTsubstColPrimePtr; double *BJTbaseColPrimePtr; double *BJTcolPrimeBasePtr; unsigned int BJToff; unsigned int BJTtempGiven; unsigned int BJTdtempGiven; unsigned int BJTareaGiven; unsigned int BJTareabGiven; unsigned int BJTareacGiven; unsigned int BJTmGiven; unsigned int BJTicVBEGiven; unsigned int BJTicVCEGiven; unsigned int BJTsenPertFlag; int BJTsenParmNo; double BJTcapbe; double BJTcapbc; double BJTcapcs; double BJTcapbx; double *BJTsens; double BJTdCoeffs[65]; double BJTnVar[3][7]; } *BJTinstances; char *BJTmodName; int BJTtype; double BJTtnom; double BJTsatCur; double BJTbetaF; double BJTemissionCoeffF; double BJTearlyVoltF; double BJTrollOffF; double BJTleakBEcurrent; double BJTc2; double BJTleakBEemissionCoeff; double BJTbetaR; double BJTemissionCoeffR; double BJTearlyVoltR; double BJTrollOffR; double BJTleakBCcurrent; double BJTc4; double BJTleakBCemissionCoeff; double BJTbaseResist; double BJTbaseCurrentHalfResist; double BJTminBaseResist; double BJTemitterResist; double BJTcollectorResist; double BJTdepletionCapBE; double BJTpotentialBE; double BJTjunctionExpBE; double BJTtransitTimeF; double BJTtransitTimeBiasCoeffF; double BJTtransitTimeFVBC; double BJTtransitTimeHighCurrentF; double BJTexcessPhase; double BJTdepletionCapBC; double BJTpotentialBC; double BJTjunctionExpBC; double BJTbaseFractionBCcap; double BJTtransitTimeR; double BJTcapCS; double BJTpotentialSubstrate; double BJTexponentialSubstrate; double BJTbetaExp; double BJTenergyGap; double BJTtempExpIS; double BJTdepletionCapCoeff; double BJTfNcoef; double BJTfNexp; double BJTinvEarlyVoltF; double BJTinvEarlyVoltR; double BJTinvRollOffF; double BJTinvRollOffR; double BJTcollectorConduct; double BJTemitterConduct; double BJTtransitTimeVBCFactor; double BJTexcessPhaseFactor; double BJTf2; double BJTf3; double BJTf6; double BJTf7; unsigned int BJTtnomGiven; unsigned int BJTsatCurGiven; unsigned int BJTbetaFGiven; unsigned int BJTemissionCoeffFGiven; unsigned int BJTearlyVoltFGiven; unsigned int BJTrollOffFGiven; unsigned int BJTleakBEcurrentGiven; unsigned int BJTc2Given; unsigned int BJTleakBEemissionCoeffGiven; unsigned int BJTbetaRGiven; unsigned int BJTemissionCoeffRGiven; unsigned int BJTearlyVoltRGiven; unsigned int BJTrollOffRGiven; unsigned int BJTleakBCcurrentGiven; unsigned int BJTc4Given; unsigned int BJTleakBCemissionCoeffGiven; unsigned int BJTbaseResistGiven; unsigned int BJTbaseCurrentHalfResistGiven; unsigned int BJTminBaseResistGiven; unsigned int BJTemitterResistGiven; unsigned int BJTcollectorResistGiven; unsigned int BJTdepletionCapBEGiven; unsigned int BJTpotentialBEGiven; unsigned int BJTjunctionExpBEGiven; unsigned int BJTtransitTimeFGiven; unsigned int BJTtransitTimeBiasCoeffFGiven; unsigned int BJTtransitTimeFVBCGiven; unsigned int BJTtransitTimeHighCurrentFGiven; unsigned int BJTexcessPhaseGiven; unsigned int BJTdepletionCapBCGiven; unsigned int BJTpotentialBCGiven; unsigned int BJTjunctionExpBCGiven; unsigned int BJTbaseFractionBCcapGiven; unsigned int BJTtransitTimeRGiven; unsigned int BJTcapCSGiven; unsigned int BJTpotentialSubstrateGiven; unsigned int BJTexponentialSubstrateGiven; unsigned int BJTbetaExpGiven; unsigned int BJTenergyGapGiven; unsigned int BJTtempExpISGiven; unsigned int BJTdepletionCapCoeffGiven; unsigned int BJTfNcoefGiven; unsigned int BJTfNexpGiven; } *

return_type: int

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 sBJTmodel { int BJTmodType; struct sBJTmodel *BJTnextModel; struct sBJTinstance *BJTinstances; char *BJTmodName; int BJTtype; double BJTtnom; double BJTsatCur; double BJTbetaF; double BJTemissionCoeffF; double BJTearlyVoltF; double BJTrollOffF; double BJTleakBEcurrent; double BJTc2; double BJTleakBEemissionCoeff; double BJTbetaR; double BJTemissionCoeffR; double BJTearlyVoltR; double BJTrollOffR; double BJTleakBCcurrent; double BJTc4; double BJTleakBCemissionCoeff; double BJTbaseResist; double BJTbaseCurrentHalfResist; double BJTminBaseResist; double BJTemitterResist; double BJTcollectorResist; double BJTdepletionCapBE; double BJTpotentialBE; double BJTjunctionExpBE; double BJTtransitTimeF; double BJTtransitTimeBiasCoeffF; double BJTtransitTimeFVBC; double BJTtransitTimeHighCurrentF; double BJTexcessPhase; double BJTdepletionCapBC; double BJTpotentialBC; double BJTjunctionExpBC; double BJTbaseFractionBCcap; double BJTtransitTimeR; double BJTcapCS; double BJTpotentialSubstrate; double BJTexponentialSubstrate; double BJTbetaExp; double BJTenergyGap; double BJTtempExpIS; double BJTdepletionCapCoeff; double BJTfNcoef; double BJTfNexp; double BJTinvEarlyVoltF; double BJTinvEarlyVoltR; double BJTinvRollOffF; double BJTinvRollOffR; double BJTcollectorConduct; double BJTemitterConduct; double BJTtransitTimeVBCFactor; double BJTexcessPhaseFactor; double BJTf2; double BJTf3; double BJTf6; double BJTf7; unsigned int BJTtnomGiven; unsigned int BJTsatCurGiven; unsigned int BJTbetaFGiven; unsigned int BJTemissionCoeffFGiven; unsigned int BJTearlyVoltFGiven; unsigned int BJTrollOffFGiven; unsigned int BJTleakBEcurrentGiven; unsigned int BJTc2Given; unsigned int BJTleakBEemissionCoeffGiven; unsigned int BJTbetaRGiven; unsigned int BJTemissionCoeffRGiven; unsigned int BJTearlyVoltRGiven; unsigned int BJTrollOffRGiven; unsigned int BJTleakBCcurrentGiven; unsigned int BJTc4Given; unsigned int BJTleakBCemissionCoeffGiven; unsigned int BJTbaseResistGiven; unsigned int BJTbaseCurrentHalfResistGiven; unsigned int BJTminBaseResistGiven; unsigned int BJTemitterResistGiven; unsigned int BJTcollectorResistGiven; unsigned int BJTdepletionCapBEGiven; unsigned int BJTpotentialBEGiven; unsigned int BJTjunctionExpBEGiven; unsigned int BJTtransitTimeFGiven; unsigned int BJTtransitTimeBiasCoeffFGiven; unsigned int BJTtransitTimeFVBCGiven; unsigned int BJTtransitTimeHighCurrentFGiven; unsigned int BJTexcessPhaseGiven; unsigned int BJTdepletionCapBCGiven; unsigned int BJTpotentialBCGiven; unsigned int BJTjunctionExpBCGiven; unsigned int BJTbaseFractionBCcapGiven; unsigned int BJTtransitTimeRGiven; unsigned int BJTcapCSGiven; unsigned int BJTpotentialSubstrateGiven; unsigned int BJTexponentialSubstrateGiven; unsigned int BJTbetaExpGiven; unsigned int BJTenergyGapGiven; unsigned int BJTtempExpISGiven; unsigned int BJTdepletionCapCoeffGiven; unsigned int BJTfNcoefGiven; unsigned int BJTfNexpGiven; }

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


DIOdSetup

original_code:
int
DIOdSetup(DIOmodel *model, CKTcircuit *ckt)
{
 DIOinstance *here;
 double arg;
 double csat;
 double czero;
 double czof2;
 double evd;
 double evrev;
 double gd;
 double sarg;
 double vd;
 double vt;
 double vte;
 double g2,g3;
 double cdiff2,cdiff3;
 double cjunc1,cjunc2,cjunc3;
        double cd;
 double czeroSW;
 double cjunc1SW,cjunc2SW,cjunc3SW;
 for( ; model != ((void *)0); model = model->DIOnextModel ) {
  for (here = model->DIOinstances; here != ((void *)0) ;
                here=here->DIOnextInstance) {
      if (here->DIOowner != ARCHme) continue;
                        csat=(here->DIOtSatCur*here->DIOarea+here->DIOtSatSWCur*here->DIOpj)*here->DIOm;
   vt = CONSTKoverQ * here->DIOtemp;
   vte=model->DIOemissionCoeff * vt;
       vd = *(ckt->CKTrhsOld + (here->DIOposPrimeNode)) -
   *(ckt->CKTrhsOld + (here->DIOnegNode));
   if (vd >= -3*vte) {
    evd = exp(vd/vte);
                                cd = csat*(evd-1);
    gd = csat*evd/vte;
    g2 = 0.5 * gd / vte;
    cdiff2 = g2 * here->DIOtTransitTime;
    g3 = g2 / 3 / vte;
    cdiff3 = g3 * here->DIOtTransitTime;
    gd = gd + ckt->CKTgmin;
   }
   else if((!(here->DIOtBrkdwnV))||
       (vd >= -here->DIOtBrkdwnV)) {
           arg=3*vte/(vd*CONSTe);
                                arg = arg * arg * arg;
    cd = -csat * (1 + arg);
                                gd = csat * 3 * arg / vd;
    g2 = -4 * gd / vd;
    g3 = 5 * g2 / vd;
    cdiff2 = cdiff3 = 0.0;
    gd = gd + ckt->CKTgmin;
   }
   else {
    evrev=exp(-(here->DIOtBrkdwnV+vd)/vt);
    cd = -csat*evrev;
                                gd = csat*evrev/vte;
    gd=csat*evrev/vt;
    g2 = -gd/2/vt;
    g3 = -g2/3/vt;
    cdiff3 = cdiff2 = 0;
   }
                        czero=here->DIOtJctCap*here->DIOarea*here->DIOm;
   if (czero != 0.0) {
     if (vd < here->DIOtDepCap){
      arg=1-vd/model->DIOjunctionPot;
      sarg=exp(-here->DIOtGradingCoeff*log(arg));
      cjunc1 = czero*sarg;
      cjunc2 = cjunc1/2/model->DIOjunctionPot*here->DIOtGradingCoeff/arg;
      cjunc3 = cjunc2/3/model->DIOjunctionPot/arg*(here->DIOtGradingCoeff + 1);
     }
     else {
      czof2=czero/here->DIOtF2;
      cjunc2 = czof2/2/model->DIOjunctionPot*here->DIOtGradingCoeff;
      cjunc3 =0.0;
     }
   }
   else
   {
     cjunc1 = cjunc2 = cjunc3 = 0.0;
   }
                        czeroSW=+here->DIOtJctSWCap*here->DIOpj*here->DIOm;
   if (czeroSW != 0.0) {
     if (vd < here->DIOtDepCap){
      arg=1-vd/model->DIOjunctionSWPot;
      sarg=exp(-model->DIOgradingSWCoeff*log(arg));
      cjunc1SW = czeroSW*sarg;
      cjunc2SW = cjunc1SW/2/model->DIOjunctionSWPot*model->DIOgradingSWCoeff/arg;
      cjunc3SW = cjunc2SW/3/model->DIOjunctionSWPot/arg*(model->DIOgradingSWCoeff + 1);
     }
     else {
      czof2=czeroSW/here->DIOtF2SW;
      cjunc2SW = czof2/2/model->DIOjunctionSWPot*model->DIOgradingSWCoeff;
      cjunc3SW = 0.0;
     }
   }
   else
   {
     cjunc1SW = cjunc2SW = cjunc3SW = 0.0;
   }
   here->DIOdCoeffs[0] = g2;
   here->DIOdCoeffs[1] = g3;
   here->DIOdCoeffs[2] = cdiff2;
   here->DIOdCoeffs[3] = cdiff3;
   here->DIOdCoeffs[4] = cjunc2+cjunc2SW;
   here->DIOdCoeffs[5] = cjunc3+cjunc3SW;
  }
 }
  return(0);
}

canonical_original_code:
int DIOdSetup(struct sDIOmodel *model, struct CKTcircuit *ckt)
{
 struct sDIOinstance *here;
 double arg;
 double csat;
 double czero;
 double czof2;
 double evd;
 double evrev;
 double gd;
 double sarg;
 double vd;
 double vt;
 double vte;
 double g2; double g3;
 double cdiff2; double cdiff3;
 double cjunc1; double cjunc2; double cjunc3;
        double cd;
 double czeroSW;
 double cjunc1SW; double cjunc2SW; double cjunc3SW;
 for( ; model != ((void *)0); model = model->DIOnextModel ) {
  for (here = model->DIOinstances; here != ((void *)0) ;
                here=here->DIOnextInstance) {
      if (here->DIOowner != ARCHme) continue;
                        csat=(here->DIOtSatCur*here->DIOarea+here->DIOtSatSWCur*here->DIOpj)*here->DIOm;
   vt = CONSTKoverQ * here->DIOtemp;
   vte=model->DIOemissionCoeff * vt;
       vd = *(ckt->CKTrhsOld + (here->DIOposPrimeNode)) -
   *(ckt->CKTrhsOld + (here->DIOnegNode));
   if (vd >= -3*vte) {
    evd = exp(vd/vte);
                                cd = csat*(evd-1);
    gd = csat*evd/vte;
    g2 = 0.5 * gd / vte;
    cdiff2 = g2 * here->DIOtTransitTime;
    g3 = g2 / 3 / vte;
    cdiff3 = g3 * here->DIOtTransitTime;
    gd = gd + ckt->CKTgmin;
   }
   else if((!(here->DIOtBrkdwnV))||
       (vd >= -here->DIOtBrkdwnV)) {
           arg=3*vte/(vd*CONSTe);
                                arg = arg * arg * arg;
    cd = -csat * (1 + arg);
                                gd = csat * 3 * arg / vd;
    g2 = -4 * gd / vd;
    g3 = 5 * g2 / vd;
    cdiff2 = cdiff3 = 0.0;
    gd = gd + ckt->CKTgmin;
   }
   else {
    evrev=exp(-(here->DIOtBrkdwnV+vd)/vt);
    cd = -csat*evrev;
                                gd = csat*evrev/vte;
    gd=csat*evrev/vt;
    g2 = -gd/2/vt;
    g3 = -g2/3/vt;
    cdiff3 = cdiff2 = 0;
   }
                        czero=here->DIOtJctCap*here->DIOarea*here->DIOm;
   if (czero != 0.0) {
     if (vd < here->DIOtDepCap){
      arg=1-vd/model->DIOjunctionPot;
      sarg=exp(-here->DIOtGradingCoeff*log(arg));
      cjunc1 = czero*sarg;
      cjunc2 = cjunc1/2/model->DIOjunctionPot*here->DIOtGradingCoeff/arg;
      cjunc3 = cjunc2/3/model->DIOjunctionPot/arg*(here->DIOtGradingCoeff + 1);
     }
     else {
      czof2=czero/here->DIOtF2;
      cjunc2 = czof2/2/model->DIOjunctionPot*here->DIOtGradingCoeff;
      cjunc3 =0.0;
     }
   }
   else
   {
     cjunc1 = cjunc2 = cjunc3 = 0.0;
   }
                        czeroSW=+here->DIOtJctSWCap*here->DIOpj*here->DIOm;
   if (czeroSW != 0.0) {
     if (vd < here->DIOtDepCap){
      arg=1-vd/model->DIOjunctionSWPot;
      sarg=exp(-model->DIOgradingSWCoeff*log(arg));
      cjunc1SW = czeroSW*sarg;
      cjunc2SW = cjunc1SW/2/model->DIOjunctionSWPot*model->DIOgradingSWCoeff/arg;
      cjunc3SW = cjunc2SW/3/model->DIOjunctionSWPot/arg*(model->DIOgradingSWCoeff + 1);
     }
     else {
      czof2=czeroSW/here->DIOtF2SW;
      cjunc2SW = czof2/2/model->DIOjunctionSWPot*model->DIOgradingSWCoeff;
      cjunc3SW = 0.0;
     }
   }
   else
   {
     cjunc1SW = cjunc2SW = cjunc3SW = 0.0;
   }
   here->DIOdCoeffs[0] = g2;
   here->DIOdCoeffs[1] = g3;
   here->DIOdCoeffs[2] = cdiff2;
   here->DIOdCoeffs[3] = cdiff3;
   here->DIOdCoeffs[4] = cjunc2+cjunc2SW;
   here->DIOdCoeffs[5] = cjunc3+cjunc3SW;
  }
 }
  return(0);
}

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

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

variable_types: arg double

variable_types: csat double

variable_types: czero double

variable_types: evd double

variable_types: evrev double

variable_types: gd double

variable_types: sarg double

variable_types: vd double

variable_types: vt double

variable_types: vte double

variable_types: cd double

variable_types: czeroSW double

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


TRAload

original_code:
int
TRAload(GENmodel *inModel, CKTcircuit *ckt)
{
    TRAmodel *model = (TRAmodel *)inModel;
    TRAinstance *here;
    double t1,t2,t3;
    double f1,f2,f3;
    int i;
    for( ; model != ((void *)0); model = model->TRAnextModel ) {
        for (here = model->TRAinstances; here != ((void *)0) ;
                here=here->TRAnextInstance) {
     if (here->TRAowner != ARCHme) continue;
            *(here->TRApos1Pos1Ptr) += here->TRAconduct;
            *(here->TRApos1Int1Ptr) -= here->TRAconduct;
            *(here->TRAneg1Ibr1Ptr) -= 1;
            *(here->TRApos2Pos2Ptr) += here->TRAconduct;
            *(here->TRAneg2Ibr2Ptr) -= 1;
            *(here->TRAint1Pos1Ptr) -= here->TRAconduct;
            *(here->TRAint1Int1Ptr) += here->TRAconduct;
            *(here->TRAint1Ibr1Ptr) += 1;
            *(here->TRAint2Int2Ptr) += here->TRAconduct;
            *(here->TRAint2Ibr2Ptr) += 1;
            *(here->TRAibr1Neg1Ptr) -= 1;
            *(here->TRAibr1Int1Ptr) += 1;
            *(here->TRAibr2Neg2Ptr) -= 1;
            *(here->TRAibr2Int2Ptr) += 1;
            *(here->TRApos2Int2Ptr) -= here->TRAconduct;
            *(here->TRAint2Pos2Ptr) -= here->TRAconduct;
            if(ckt->CKTmode & 0x70) {
                *(here->TRAibr1Pos2Ptr) -= 1;
                *(here->TRAibr1Neg2Ptr) += 1;
                *(here->TRAibr1Ibr2Ptr) -= (1-ckt->CKTgmin)*here->TRAimped;
                *(here->TRAibr2Pos1Ptr) -= 1;
                *(here->TRAibr2Neg1Ptr) += 1;
                *(here->TRAibr2Ibr1Ptr) -= (1-ckt->CKTgmin)*here->TRAimped;
            } else {
                if (ckt->CKTmode & 0x1000) {
                    if(ckt->CKTmode & 0x10000l) {
                        here->TRAinput1 = here->TRAinitVolt2 + here->TRAinitCur2
                            * here->TRAimped;
                        here->TRAinput2 = here->TRAinitVolt1 + here->TRAinitCur1
                            * here->TRAimped;
                    } else {
                        here->TRAinput1 =
                            ( *(ckt->CKTrhsOld+here->TRAposNode2)
                            - *(ckt->CKTrhsOld+here->TRAnegNode2) )
                            + ( *(ckt->CKTrhsOld+here->TRAbrEq2)
                                *here->TRAimped);
                        here->TRAinput2 =
                            ( *(ckt->CKTrhsOld+here->TRAposNode1)
                            - *(ckt->CKTrhsOld+here->TRAnegNode1) )
                            + ( *(ckt->CKTrhsOld+here->TRAbrEq1)
                                *here->TRAimped);
                    }
                    *(here->TRAdelays ) = -2*here->TRAtd;
                    *(here->TRAdelays+3) = -here->TRAtd;
                    *(here->TRAdelays+6) = 0;
                    *(here->TRAdelays+1) = *(here->TRAdelays +4) =
                            *(here->TRAdelays+7) = here->TRAinput1;
                    *(here->TRAdelays+2) = *(here->TRAdelays +5) =
                            *(here->TRAdelays+8) = here->TRAinput2;
                    here->TRAsizeDelay = 2;
                } else {
                    if(ckt->CKTmode & 0x2000) {
                        for(i=2;(i<here->TRAsizeDelay) &&
                            (*(here->TRAdelays +3*i) <=
                            (ckt->CKTtime-here->TRAtd));i++) {; }
                        t1 = *(here->TRAdelays + (3*(i-2)));
                        t2 = *(here->TRAdelays + (3*(i-1)));
                        t3 = *(here->TRAdelays + (3*(i )));
                        if( (t2-t1)==0 || (t3-t2) == 0) continue;
                        f1 = (ckt->CKTtime - here->TRAtd - t2) *
                             (ckt->CKTtime - here->TRAtd - t3) ;
                        f2 = (ckt->CKTtime - here->TRAtd - t1) *
                             (ckt->CKTtime - here->TRAtd - t3) ;
                        f3 = (ckt->CKTtime - here->TRAtd - t1) *
                             (ckt->CKTtime - here->TRAtd - t2) ;
                        if((t2-t1)==0) {
                            f1=0;
                            f2=0;
                        } else {
                            f1 /= (t1-t2);
                            f2 /= (t2-t1);
                        }
                        if((t3-t2)==0) {
                            f2=0;
                            f3=0;
                        } else {
                            f2 /= (t2-t3);
                            f3 /= (t2-t3);
                        }
                        if((t3-t1)==0) {
                            f1=0;
                            f2=0;
                        } else {
                            f1 /= (t1-t3);
                            f3 /= (t1-t3);
                        }
                        here->TRAinput1 = f1 * *(here->TRAdelays + (3*(i-2))+1)
                                        + f2 * *(here->TRAdelays + (3*(i-1))+1)
                                        + f3 * *(here->TRAdelays + (3*(i ))+1);
                        here->TRAinput2 = f1 * *(here->TRAdelays + (3*(i-2))+2)
                                        + f2 * *(here->TRAdelays + (3*(i-1))+2)
                                        + f3 * *(here->TRAdelays + (3*(i ))+2);
                    }
                }
            *(ckt->CKTrhs + here->TRAbrEq1) += here->TRAinput1;
            *(ckt->CKTrhs + here->TRAbrEq2) += here->TRAinput2;
            }
        }
    }
    return(0);
}

canonical_original_code:
int TRAload(struct sGENmodel *inModel, struct CKTcircuit *ckt)
{
    struct sTRAmodel *model = (TRAmodel *)inModel;
    struct sTRAinstance *here;
    double t1; double t2; double t3;
    double f1; double f2; double f3;
    int i;
    for( ; model != ((void *)0); model = model->TRAnextModel ) {
        for (here = model->TRAinstances; here != ((void *)0) ;
                here=here->TRAnextInstance) {
     if (here->TRAowner != ARCHme) continue;
            *(here->TRApos1Pos1Ptr) += here->TRAconduct;
            *(here->TRApos1Int1Ptr) -= here->TRAconduct;
            *(here->TRAneg1Ibr1Ptr) -= 1;
            *(here->TRApos2Pos2Ptr) += here->TRAconduct;
            *(here->TRAneg2Ibr2Ptr) -= 1;
            *(here->TRAint1Pos1Ptr) -= here->TRAconduct;
            *(here->TRAint1Int1Ptr) += here->TRAconduct;
            *(here->TRAint1Ibr1Ptr) += 1;
            *(here->TRAint2Int2Ptr) += here->TRAconduct;
            *(here->TRAint2Ibr2Ptr) += 1;
            *(here->TRAibr1Neg1Ptr) -= 1;
            *(here->TRAibr1Int1Ptr) += 1;
            *(here->TRAibr2Neg2Ptr) -= 1;
            *(here->TRAibr2Int2Ptr) += 1;
            *(here->TRApos2Int2Ptr) -= here->TRAconduct;
            *(here->TRAint2Pos2Ptr) -= here->TRAconduct;
            if(ckt->CKTmode & 0x70) {
                *(here->TRAibr1Pos2Ptr) -= 1;
                *(here->TRAibr1Neg2Ptr) += 1;
                *(here->TRAibr1Ibr2Ptr) -= (1-ckt->CKTgmin)*here->TRAimped;
                *(here->TRAibr2Pos1Ptr) -= 1;
                *(here->TRAibr2Neg1Ptr) += 1;
                *(here->TRAibr2Ibr1Ptr) -= (1-ckt->CKTgmin)*here->TRAimped;
            } else {
                if (ckt->CKTmode & 0x1000) {
                    if(ckt->CKTmode & 0x10000l) {
                        here->TRAinput1 = here->TRAinitVolt2 + here->TRAinitCur2
                            * here->TRAimped;
                        here->TRAinput2 = here->TRAinitVolt1 + here->TRAinitCur1
                            * here->TRAimped;
                    } else {
                        here->TRAinput1 =
                            ( *(ckt->CKTrhsOld+here->TRAposNode2)
                            - *(ckt->CKTrhsOld+here->TRAnegNode2) )
                            + ( *(ckt->CKTrhsOld+here->TRAbrEq2)
                                *here->TRAimped);
                        here->TRAinput2 =
                            ( *(ckt->CKTrhsOld+here->TRAposNode1)
                            - *(ckt->CKTrhsOld+here->TRAnegNode1) )
                            + ( *(ckt->CKTrhsOld+here->TRAbrEq1)
                                *here->TRAimped);
                    }
                    *(here->TRAdelays ) = -2*here->TRAtd;
                    *(here->TRAdelays+3) = -here->TRAtd;
                    *(here->TRAdelays+6) = 0;
                    *(here->TRAdelays+1) = *(here->TRAdelays +4) =
                            *(here->TRAdelays+7) = here->TRAinput1;
                    *(here->TRAdelays+2) = *(here->TRAdelays +5) =
                            *(here->TRAdelays+8) = here->TRAinput2;
                    here->TRAsizeDelay = 2;
                } else {
                    if(ckt->CKTmode & 0x2000) {
                        for(i=2;(i<here->TRAsizeDelay) &&
                            (*(here->TRAdelays +3*i) <=
                            (ckt->CKTtime-here->TRAtd));i++) {; }
                        t1 = *(here->TRAdelays + (3*(i-2)));
                        t2 = *(here->TRAdelays + (3*(i-1)));
                        t3 = *(here->TRAdelays + (3*(i )));
                        if( (t2-t1)==0 || (t3-t2) == 0) continue;
                        f1 = (ckt->CKTtime - here->TRAtd - t2) *
                             (ckt->CKTtime - here->TRAtd - t3) ;
                        f2 = (ckt->CKTtime - here->TRAtd - t1) *
                             (ckt->CKTtime - here->TRAtd - t3) ;
                        f3 = (ckt->CKTtime - here->TRAtd - t1) *
                             (ckt->CKTtime - here->TRAtd - t2) ;
                        if((t2-t1)==0) {
                            f1=0;
                            f2=0;
                        } else {
                            f1 /= (t1-t2);
                            f2 /= (t2-t1);
                        }
                        if((t3-t2)==0) {
                            f2=0;
                            f3=0;
                        } else {
                            f2 /= (t2-t3);
                            f3 /= (t2-t3);
                        }
                        if((t3-t1)==0) {
                            f1=0;
                            f2=0;
                        } else {
                            f1 /= (t1-t3);
                            f3 /= (t1-t3);
                        }
                        here->TRAinput1 = f1 * *(here->TRAdelays + (3*(i-2))+1)
                                        + f2 * *(here->TRAdelays + (3*(i-1))+1)
                                        + f3 * *(here->TRAdelays + (3*(i ))+1);
                        here->TRAinput2 = f1 * *(here->TRAdelays + (3*(i-2))+2)
                                        + f2 * *(here->TRAdelays + (3*(i-1))+2)
                                        + f3 * *(here->TRAdelays + (3*(i ))+2);
                    }
                }
            *(ckt->CKTrhs + here->TRAbrEq1) += here->TRAinput1;
            *(ckt->CKTrhs + here->TRAbrEq2) += here->TRAinput2;
            }
        }
    }
    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 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


decompiled_code:
__int64 __fastcall B1pzLoad(__int64 a1, __int64 a2, double *a3)
{
__int64 v4; // rax
__int64 v5; // r14
double v6; // xmm12_8
__int64 v7; // rdx
double v8; // xmm3_8
double v9; // xmm15_8
double v10; // xmm4_8
double v11; // xmm8_8
double v12; // xmm14_8
double v13; // xmm5_8
double v14; // xmm2_8
double v15; // xmm1_8
double v16; // rcx
double v17; // xmm9_8
double v18; // xmm11_8
double v19; // xmm7_8
double v20; // xmm6_8
double v21; // xmm10_8
double v22; // xmm0_8
double v23; // xmm10_8
double v24; // xmm2_8
double v25; // xmm10_8
double v26; // xmm14_8
double v27; // xmm1_8
__int64 v28; // xmm10_8
double v29; // xmm15_8
double v30; // xmm14_8
double *v31; // rsi
double v32; // xmm5_8
double v33; // xmm4_8
double v34; // xmm0_8
double v35; // xmm3_8
double *v36; // r12
double *v37; // rbp
double *v38; // rbx
double v39; // xmm8_8
double v40; // xmm0_8
double *v41; // rsi
double v42; // xmm7_8
double *v43; // r11
double *v44; // rsi
double *v45; // rsi
double *v46; // rsi
double *v47; // r10
double *v48; // r9
double *v49; // r8
double *v50; // rdi
double *v51; // rsi
double v52; // xmm0_8
double *v53; // rcx
double *v54; // r13
double *v55; // rdx
double v56; // xmm14_8
double v57; // xmm9_8
double v58; // xmm1_8
double *v59; // rsi
double v61; // [rsp+0h] [rbp-98h]
double v62; // [rsp+8h] [rbp-90h]
double v63; // [rsp+10h] [rbp-88h]
double v64; // [rsp+18h] [rbp-80h]
double v65; // [rsp+20h] [rbp-78h]
double v66; // [rsp+28h] [rbp-70h]
double v67; // [rsp+30h] [rbp-68h]
double v68; // [rsp+38h] [rbp-60h]
double v69; // [rsp+40h] [rbp-58h]
__int64 v70; // [rsp+48h] [rbp-50h]
__int64 v71; // [rsp+50h] [rbp-48h]
__int64 i; // [rsp+58h] [rbp-40h]

for ( i = a1; i; i = *(_QWORD *)(i + 8) )
{
v4 = *(_QWORD *)(i + 16);
if ( v4 )
{
v5 = *(_QWORD *)(a2 + 280);
do
{
if ( *(int *)(v4 + 180) >= 0 )
{
v68 = 0.0;
v71 = LC0;
v70 = LC1;
v69 = *(double *)&LC1;
}
else
{
v69 = 0.0;
v71 = LC1;
v70 = LC0;
v68 = *(double *)&LC1;
}
v6 = *(double *)(v4 + 120);
v63 = *(double *)(v4 + 128);
v7 = 8 * (*(int *)(v4 + 24) + 7LL);
v8 = *(double *)(v5 + v7 + 112);
v9 = *(double *)(v5 + v7 + 168);
v64 = *(double *)(v5 + v7);
v10 = *(double *)(v5 + v7 + 104);
v65 = *(double *)(v5 + v7 + 8);
v11 = *(double *)(v5 + v7 + 136);
v12 = *(double *)(v5 + v7 + 176);
v67 = *(double *)(v5 + v7 + 24);
v13 = *(double *)(v5 + v7 + 96);
v14 = *(double *)(v5 + v7 + 120);
v15 = *(double *)(v5 + v7 + 128);
v16 = v9 - *(double *)(v4 + 344);
v17 = *(double *)(v5 + v7 + 184);
v18 = *(double *)(v5 + v7 + 32);
v66 = *(double *)(v5 + v7 + 16);
v19 = *(double *)(v5 + v7 + 152);
v20 = *(double *)(v4 + 344) + v11 + v12;
v21 = *(double *)(v5 + v7 + 88);
v22 = v21 + *(double *)(v4 + 344);
v61 = v21 + v8 + v9 + *(double *)(v4 + 352);
v23 = v13 + v14;
v24 = v14 - v11;
v25 = v23 + v12;
v26 = v10 + v15;
v27 = v15 - v19;
v62 = v25;
v28 = *(_QWORD *)&v25 ^ LC3;
v29 = *(double *)(v4 + 352) + v19 - (v26 + v17);
v30 = *(double *)(v4 + 360);
v31 = *(double **)(v4 + 424);
v32 = v13 - *(double *)(v4 + 344);
v33 = v10 - *(double *)(v4 + 352);
v34 = v22 + *(double *)(v4 + 352) + v30;
v35 = v8 - v30;
v36 = *(double **)(v4 + 440);
v37 = *(double **)(v4 + 448);
v38 = *(double **)(v4 + 456);
*v31 = *v31 + *a3 * v34;
v39 = a3[1] * v34;
v40 = COERCE_DOUBLE(*(_QWORD *)&v34 ^ LC3) - v32 - v33;
v31[1] = v31[1] + v39;
v41 = *(double **)(v4 + 472);
v42 = COERCE_DOUBLE(*(_QWORD *)&v35 ^ LC3) - v24 - v27;
*v36 = *a3 * v42 + *v36;
v36[1] = v42 * a3[1] + v36[1];
*v37 = *v37 + *a3 * v20;
v37[1] = v37[1] + a3[1] * v20;
*v38 = *v38 + *a3 * v29;
v38[1] = v38[1] + a3[1] * v29;
v43 = *(double **)(v4 + 504);
*v41 = *v41 + *a3 * v40;
v41[1] = v40 * a3[1] + v41[1];
v44 = *(double **)(v4 + 480);
*v44 = *a3 * v32 + *v44;
v44[1] = v32 * a3[1] + v44[1];
v45 = *(double **)(v4 + 488);
*v45 = *a3 * v33 + *v45;
v45[1] = v33 * a3[1] + v45[1];
v46 = *(double **)(v4 + 536);
*v46 = *a3 * v35 + *v46;
v46[1] = v35 * a3[1] + v46[1];
*v43 = *a3 * v24 + *v43;
v47 = *(double **)(v4 + 512);
v48 = *(double **)(v4 + 544);
v49 = *(double **)(v4 + 568);
v50 = *(double **)(v4 + 520);
v51 = *(double **)(v4 + 552);
v43[1] = v24 * a3[1] + v43[1];
*v47 = *a3 * v27 + *v47;
v47[1] = v27 * a3[1] + v47[1];
*v48 = v16 * *a3 + *v48;
v48[1] = v16 * a3[1] + v48[1];
v52 = COERCE_DOUBLE(*(_QWORD *)&v16 ^ LC3) - v20 - v17;
*v49 = *a3 * v52 + *v49;
v49[1] = v52 * a3[1] + v49[1];
*v50 = *a3 * v17 + *v50;
v50[1] = a3[1] * v17 + v50[1];
v53 = *(double **)(v4 + 576);
v54 = *(double **)(v4 + 416);
*v51 = COERCE_DOUBLE(*(_QWORD *)&v61 ^ LC3) * *a3 + *v51;
v55 = *(double **)(v4 + 584);
v56 = v61 + v62 - v29;
v51[1] = COERCE_DOUBLE(*(_QWORD *)&v61 ^ LC3) * a3[1] + v51[1];
*v53 = *a3 * v56 + *v53;
v53[1] = v56 * a3[1] + v53[1];
*v55 = *a3 * *(double *)&v28 + *v55;
v55[1] = *(double *)&v28 * a3[1] + v55[1];
*v54 = *v54 + v63;
**(double **)(v4 + 432) = **(double **)(v4 + 432) + v6;
*v36 = v67 + v18 + *v36;
v57 = v68 * (v64 + v66);
v58 = (v64 + v66) * v69;
*v37 = v63 + v65 + v67 + v57 + *v37;
*v38 = v65 + v6 + v18 + v58 + *v38;
**(double **)(v4 + 464) = **(double **)(v4 + 464) - v63;
**(double **)(v4 + 496) = **(double **)(v4 + 496) - v6;
*v43 = *v43 - v67;
*v47 = *v47 - v18;
**(double **)(v4 + 528) = **(double **)(v4 + 528) - v63;
*v48 = v64 * *(double *)&v70 + *v48;
*v49 = v66 * *(double *)&v70 - v67 + *v49;
*v50 = COERCE_DOUBLE(*(_QWORD *)&v65 ^ LC3) - v58 + *v50;
*v51 = *v51 + v64 * *(double *)&v71;
v59 = *(double **)(v4 + 560);
v4 = *(_QWORD *)(v4 + 8);
*v59 = *v59 - v6;
*v53 = COERCE_DOUBLE(*(_QWORD *)&v18 ^ LC3) - v66 * *(double *)&v70 + *v53;
*v55 = COERCE_DOUBLE(*(_QWORD *)&v65 ^ LC3) - v57 + *v55;
}
while ( v4 );
}
}
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2, double *a3)
{
__int64 v4; // rax
__int64 v5; // r14
double v6; // xmm12_8
__int64 v7; // rdx
double v8; // xmm3_8
double v9; // xmm15_8
double v10; // xmm4_8
double v11; // xmm8_8
double v12; // xmm14_8
double v13; // xmm5_8
double v14; // xmm2_8
double v15; // xmm1_8
double v16; // rcx
double v17; // xmm9_8
double v18; // xmm11_8
double v19; // xmm7_8
double v20; // xmm6_8
double v21; // xmm10_8
double v22; // xmm0_8
double v23; // xmm10_8
double v24; // xmm2_8
double v25; // xmm10_8
double v26; // xmm14_8
double v27; // xmm1_8
__int64 v28; // xmm10_8
double v29; // xmm15_8
double v30; // xmm14_8
double *v31; // rsi
double v32; // xmm5_8
double v33; // xmm4_8
double v34; // xmm0_8
double v35; // xmm3_8
double *v36; // r12
double *v37; // rbp
double *v38; // rbx
double v39; // xmm8_8
double v40; // xmm0_8
double *v41; // rsi
double v42; // xmm7_8
double *v43; // r11
double *v44; // rsi
double *v45; // rsi
double *v46; // rsi
double *v47; // r10
double *v48; // r9
double *v49; // r8
double *v50; // rdi
double *v51; // rsi
double v52; // xmm0_8
double *v53; // rcx
double *v54; // r13
double *v55; // rdx
double v56; // xmm14_8
double v57; // xmm9_8
double v58; // xmm1_8
double *v59; // rsi
double v61; // [rsp+0h] [rbp-98h]
double v62; // [rsp+8h] [rbp-90h]
double v63; // [rsp+10h] [rbp-88h]
double v64; // [rsp+18h] [rbp-80h]
double v65; // [rsp+20h] [rbp-78h]
double v66; // [rsp+28h] [rbp-70h]
double v67; // [rsp+30h] [rbp-68h]
double v68; // [rsp+38h] [rbp-60h]
double v69; // [rsp+40h] [rbp-58h]
__int64 v70; // [rsp+48h] [rbp-50h]
__int64 v71; // [rsp+50h] [rbp-48h]
__int64 i; // [rsp+58h] [rbp-40h]

for ( i = a1; i; i = *(_QWORD *)(i + 8) )
{
v4 = *(_QWORD *)(i + 16);
if ( v4 )
{
v5 = *(_QWORD *)(a2 + 280);
do
{
if ( *(int *)(v4 + 180) >= 0 )
{
v68 = 0.0;
v71 = LC0;
v70 = LC1;
v69 = *(double *)&LC1;
}
else
{
v69 = 0.0;
v71 = LC1;
v70 = LC0;
v68 = *(double *)&LC1;
}
v6 = *(double *)(v4 + 120);
v63 = *(double *)(v4 + 128);
v7 = 8 * (*(int *)(v4 + 24) + 7LL);
v8 = *(double *)(v5 + v7 + 112);
v9 = *(double *)(v5 + v7 + 168);
v64 = *(double *)(v5 + v7);
v10 = *(double *)(v5 + v7 + 104);
v65 = *(double *)(v5 + v7 + 8);
v11 = *(double *)(v5 + v7 + 136);
v12 = *(double *)(v5 + v7 + 176);
v67 = *(double *)(v5 + v7 + 24);
v13 = *(double *)(v5 + v7 + 96);
v14 = *(double *)(v5 + v7 + 120);
v15 = *(double *)(v5 + v7 + 128);
v16 = v9 - *(double *)(v4 + 344);
v17 = *(double *)(v5 + v7 + 184);
v18 = *(double *)(v5 + v7 + 32);
v66 = *(double *)(v5 + v7 + 16);
v19 = *(double *)(v5 + v7 + 152);
v20 = *(double *)(v4 + 344) + v11 + v12;
v21 = *(double *)(v5 + v7 + 88);
v22 = v21 + *(double *)(v4 + 344);
v61 = v21 + v8 + v9 + *(double *)(v4 + 352);
v23 = v13 + v14;
v24 = v14 - v11;
v25 = v23 + v12;
v26 = v10 + v15;
v27 = v15 - v19;
v62 = v25;
v28 = *(_QWORD *)&v25 ^ LC3;
v29 = *(double *)(v4 + 352) + v19 - (v26 + v17);
v30 = *(double *)(v4 + 360);
v31 = *(double **)(v4 + 424);
v32 = v13 - *(double *)(v4 + 344);
v33 = v10 - *(double *)(v4 + 352);
v34 = v22 + *(double *)(v4 + 352) + v30;
v35 = v8 - v30;
v36 = *(double **)(v4 + 440);
v37 = *(double **)(v4 + 448);
v38 = *(double **)(v4 + 456);
*v31 = *v31 + *a3 * v34;
v39 = a3[1] * v34;
v40 = COERCE_DOUBLE(*(_QWORD *)&v34 ^ LC3) - v32 - v33;
v31[1] = v31[1] + v39;
v41 = *(double **)(v4 + 472);
v42 = COERCE_DOUBLE(*(_QWORD *)&v35 ^ LC3) - v24 - v27;
*v36 = *a3 * v42 + *v36;
v36[1] = v42 * a3[1] + v36[1];
*v37 = *v37 + *a3 * v20;
v37[1] = v37[1] + a3[1] * v20;
*v38 = *v38 + *a3 * v29;
v38[1] = v38[1] + a3[1] * v29;
v43 = *(double **)(v4 + 504);
*v41 = *v41 + *a3 * v40;
v41[1] = v40 * a3[1] + v41[1];
v44 = *(double **)(v4 + 480);
*v44 = *a3 * v32 + *v44;
v44[1] = v32 * a3[1] + v44[1];
v45 = *(double **)(v4 + 488);
*v45 = *a3 * v33 + *v45;
v45[1] = v33 * a3[1] + v45[1];
v46 = *(double **)(v4 + 536);
*v46 = *a3 * v35 + *v46;
v46[1] = v35 * a3[1] + v46[1];
*v43 = *a3 * v24 + *v43;
v47 = *(double **)(v4 + 512);
v48 = *(double **)(v4 + 544);
v49 = *(double **)(v4 + 568);
v50 = *(double **)(v4 + 520);
v51 = *(double **)(v4 + 552);
v43[1] = v24 * a3[1] + v43[1];
*v47 = *a3 * v27 + *v47;
v47[1] = v27 * a3[1] + v47[1];
*v48 = v16 * *a3 + *v48;
v48[1] = v16 * a3[1] + v48[1];
v52 = COERCE_DOUBLE(*(_QWORD *)&v16 ^ LC3) - v20 - v17;
*v49 = *a3 * v52 + *v49;
v49[1] = v52 * a3[1] + v49[1];
*v50 = *a3 * v17 + *v50;
v50[1] = a3[1] * v17 + v50[1];
v53 = *(double **)(v4 + 576);
v54 = *(double **)(v4 + 416);
*v51 = COERCE_DOUBLE(*(_QWORD *)&v61 ^ LC3) * *a3 + *v51;
v55 = *(double **)(v4 + 584);
v56 = v61 + v62 - v29;
v51[1] = COERCE_DOUBLE(*(_QWORD *)&v61 ^ LC3) * a3[1] + v51[1];
*v53 = *a3 * v56 + *v53;
v53[1] = v56 * a3[1] + v53[1];
*v55 = *a3 * *(double *)&v28 + *v55;
v55[1] = *(double *)&v28 * a3[1] + v55[1];
*v54 = *v54 + v63;
**(double **)(v4 + 432) = **(double **)(v4 + 432) + v6;
*v36 = v67 + v18 + *v36;
v57 = v68 * (v64 + v66);
v58 = (v64 + v66) * v69;
*v37 = v63 + v65 + v67 + v57 + *v37;
*v38 = v65 + v6 + v18 + v58 + *v38;
**(double **)(v4 + 464) = **(double **)(v4 + 464) - v63;
**(double **)(v4 + 496) = **(double **)(v4 + 496) - v6;
*v43 = *v43 - v67;
*v47 = *v47 - v18;
**(double **)(v4 + 528) = **(double **)(v4 + 528) - v63;
*v48 = v64 * *(double *)&v70 + *v48;
*v49 = v66 * *(double *)&v70 - v67 + *v49;
*v50 = COERCE_DOUBLE(*(_QWORD *)&v65 ^ LC3) - v58 + *v50;
*v51 = *v51 + v64 * *(double *)&v71;
v59 = *(double **)(v4 + 560);
v4 = *(_QWORD *)(v4 + 8);
*v59 = *v59 - v6;
*v53 = COERCE_DOUBLE(*(_QWORD *)&v18 ^ LC3) - v66 * *(double *)&v70 + *v53;
*v55 = COERCE_DOUBLE(*(_QWORD *)&v65 ^ LC3) - v57 + *v55;
}
while ( v4 );
}
}
return 0LL;
}

original_code:
int
B1pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
{
    B1model *model = (B1model*)inModel;
    B1instance *here;
    int xnrm;
    int xrev;
    double gdpr;
    double gspr;
    double gm;
    double gds;
    double gmbs;
    double gbd;
    double gbs;
    double capbd;
    double capbs;
    double xcggb;
    double xcgdb;
    double xcgsb;
    double xcbgb;
    double xcbdb;
    double xcbsb;
    double xcddb;
    double xcssb;
    double xcdgb;
    double xcsgb;
    double xcdsb;
    double xcsdb;
    double cggb;
    double cgdb;
    double cgsb;
    double cbgb;
    double cbdb;
    double cbsb;
    double cddb;
    double cdgb;
    double cdsb;
    double m;
    for( ; model != ((void *)0); model = model->B1nextModel) {
        for(here = model->B1instances; here!= ((void *)0);
                here = here->B1nextInstance) {
     if (here->B1owner != ARCHme) continue;
            if (here->B1mode >= 0) {
                xnrm=1;
                xrev=0;
            } else {
                xnrm=0;
                xrev=1;
            }
            gdpr=here->B1drainConductance;
            gspr=here->B1sourceConductance;
            gm= *(ckt->CKTstates[0] + here->B1states+ 7);
            gds= *(ckt->CKTstates[0] + here->B1states+ 8);
            gmbs= *(ckt->CKTstates[0] + here->B1states+ 9);
            gbd= *(ckt->CKTstates[0] + here->B1states+ 10);
            gbs= *(ckt->CKTstates[0] + here->B1states+ 11);
            capbd= *(ckt->CKTstates[0] + here->B1states+ 24);
            capbs= *(ckt->CKTstates[0] + here->B1states+ 26);
            cggb = *(ckt->CKTstates[0] + here->B1states+ 18);
            cgsb = *(ckt->CKTstates[0] + here->B1states+ 20);
            cgdb = *(ckt->CKTstates[0] + here->B1states+ 19);
            cbgb = *(ckt->CKTstates[0] + here->B1states+ 21);
            cbsb = *(ckt->CKTstates[0] + here->B1states+ 23);
            cbdb = *(ckt->CKTstates[0] + here->B1states+ 22);
            cdgb = *(ckt->CKTstates[0] + here->B1states+ 28);
            cdsb = *(ckt->CKTstates[0] + here->B1states+ 30);
            cddb = *(ckt->CKTstates[0] + here->B1states+ 29);
            xcdgb = (cdgb - here->B1GDoverlapCap) ;
            xcddb = (cddb + capbd + here->B1GDoverlapCap) ;
            xcdsb = cdsb ;
            xcsgb = -(cggb + cbgb + cdgb + here->B1GSoverlapCap ) ;
            xcsdb = -(cgdb + cbdb + cddb) ;
            xcssb = (capbs + here->B1GSoverlapCap - (cgsb+cbsb+cdsb)) ;
            xcggb = (cggb + here->B1GDoverlapCap + here->B1GSoverlapCap +
                    here->B1GBoverlapCap) ;
            xcgdb = (cgdb - here->B1GDoverlapCap ) ;
            xcgsb = (cgsb - here->B1GSoverlapCap) ;
            xcbgb = (cbgb - here->B1GBoverlapCap) ;
            xcbdb = (cbdb - capbd ) ;
            xcbsb = (cbsb - capbs ) ;
            m = here->B1m;
            *(here->B1GgPtr ) += m * (xcggb * s->real);
            *(here->B1GgPtr +1) += m * (xcggb * s->imag);
            *(here->B1BbPtr ) += m * ((-xcbgb-xcbdb-xcbsb) * s->real);
            *(here->B1BbPtr +1) += m * ((-xcbgb-xcbdb-xcbsb) * s->imag);
            *(here->B1DPdpPtr ) += m * (xcddb * s->real);
            *(here->B1DPdpPtr +1) += m * (xcddb * s->imag);
            *(here->B1SPspPtr ) += m * (xcssb * s->real);
            *(here->B1SPspPtr +1) += m * (xcssb * s->imag);
            *(here->B1GbPtr ) += m * ((-xcggb-xcgdb-xcgsb) * s->real);
            *(here->B1GbPtr +1) += m * ((-xcggb-xcgdb-xcgsb) * s->imag);
            *(here->B1GdpPtr ) += m * (xcgdb * s->real);
            *(here->B1GdpPtr +1) += m * (xcgdb * s->imag);
            *(here->B1GspPtr ) += m * (xcgsb * s->real);
            *(here->B1GspPtr +1) += m * (xcgsb * s->imag);
            *(here->B1BgPtr ) += m * (xcbgb * s->real);
            *(here->B1BgPtr +1) += m * (xcbgb * s->imag);
            *(here->B1BdpPtr ) += m * (xcbdb * s->real);
            *(here->B1BdpPtr +1) += m * (xcbdb * s->imag);
            *(here->B1BspPtr ) += m * (xcbsb * s->real);
            *(here->B1BspPtr +1) += m * (xcbsb * s->imag);
            *(here->B1DPgPtr ) += m * (xcdgb * s->real);
            *(here->B1DPgPtr +1) += m * (xcdgb * s->imag);
            *(here->B1DPbPtr ) += m * ((-xcdgb-xcddb-xcdsb) * s->real);
            *(here->B1DPbPtr +1) += m * ((-xcdgb-xcddb-xcdsb) * s->imag);
            *(here->B1DPspPtr ) += m * (xcdsb * s->real);
            *(here->B1DPspPtr +1) += m * (xcdsb * s->imag);
            *(here->B1SPgPtr ) += m * (xcsgb * s->real);
            *(here->B1SPgPtr +1) += m * (xcsgb * s->imag);
            *(here->B1SPbPtr ) += m * ((-xcsgb-xcsdb-xcssb) * s->real);
            *(here->B1SPbPtr +1) += m * ((-xcsgb-xcsdb-xcssb) * s->imag);
            *(here->B1SPdpPtr ) += m * (xcsdb * s->real);
            *(here->B1SPdpPtr +1) += m * (xcsdb * s->imag);
            *(here->B1DdPtr) += m * (gdpr);
            *(here->B1SsPtr) += m * (gspr);
            *(here->B1BbPtr) += m * (gbd+gbs);
            *(here->B1DPdpPtr) += m * (gdpr+gds+gbd+xrev*(gm+gmbs));
            *(here->B1SPspPtr) += m * (gspr+gds+gbs+xnrm*(gm+gmbs));
            *(here->B1DdpPtr) -= m * (gdpr);
            *(here->B1SspPtr) -= m * (gspr);
            *(here->B1BdpPtr) -= m * (gbd);
            *(here->B1BspPtr) -= m * (gbs);
            *(here->B1DPdPtr) -= m * (gdpr);
            *(here->B1DPgPtr) += m * ((xnrm-xrev)*gm);
            *(here->B1DPbPtr) += m * (-gbd+(xnrm-xrev)*gmbs);
            *(here->B1DPspPtr) += m * (-gds-xnrm*(gm+gmbs));
            *(here->B1SPgPtr) += m * (-(xnrm-xrev)*gm);
            *(here->B1SPsPtr) -= m * (gspr);
            *(here->B1SPbPtr) += m * (-gbs-(xnrm-xrev)*gmbs);
            *(here->B1SPdpPtr) += m * (-gds-xrev*(gm+gmbs));
        }
    }
    return(0);
}

canonical_original_code:
int B1pzLoad(struct sGENmodel *inModel, struct CKTcircuit *ckt, struct SPcomplex *s)
{
    struct sBSIM1model *model = (B1model*)inModel;
    struct sBSIM1instance *here;
    int xnrm;
    int xrev;
    double gdpr;
    double gspr;
    double gm;
    double gds;
    double gmbs;
    double gbd;
    double gbs;
    double capbd;
    double capbs;
    double xcggb;
    double xcgdb;
    double xcgsb;
    double xcbgb;
    double xcbdb;
    double xcbsb;
    double xcddb;
    double xcssb;
    double xcdgb;
    double xcsgb;
    double xcdsb;
    double xcsdb;
    double cggb;
    double cgdb;
    double cgsb;
    double cbgb;
    double cbdb;
    double cbsb;
    double cddb;
    double cdgb;
    double cdsb;
    double m;
    for( ; model != ((void *)0); model = model->B1nextModel) {
        for(here = model->B1instances; here!= ((void *)0);
                here = here->B1nextInstance) {
     if (here->B1owner != ARCHme) continue;
            if (here->B1mode >= 0) {
                xnrm=1;
                xrev=0;
            } else {
                xnrm=0;
                xrev=1;
            }
            gdpr=here->B1drainConductance;
            gspr=here->B1sourceConductance;
            gm= *(ckt->CKTstates[0] + here->B1states+ 7);
            gds= *(ckt->CKTstates[0] + here->B1states+ 8);
            gmbs= *(ckt->CKTstates[0] + here->B1states+ 9);
            gbd= *(ckt->CKTstates[0] + here->B1states+ 10);
            gbs= *(ckt->CKTstates[0] + here->B1states+ 11);
            capbd= *(ckt->CKTstates[0] + here->B1states+ 24);
            capbs= *(ckt->CKTstates[0] + here->B1states+ 26);
            cggb = *(ckt->CKTstates[0] + here->B1states+ 18);
            cgsb = *(ckt->CKTstates[0] + here->B1states+ 20);
            cgdb = *(ckt->CKTstates[0] + here->B1states+ 19);
            cbgb = *(ckt->CKTstates[0] + here->B1states+ 21);
            cbsb = *(ckt->CKTstates[0] + here->B1states+ 23);
            cbdb = *(ckt->CKTstates[0] + here->B1states+ 22);
            cdgb = *(ckt->CKTstates[0] + here->B1states+ 28);
            cdsb = *(ckt->CKTstates[0] + here->B1states+ 30);
            cddb = *(ckt->CKTstates[0] + here->B1states+ 29);
            xcdgb = (cdgb - here->B1GDoverlapCap) ;
            xcddb = (cddb + capbd + here->B1GDoverlapCap) ;
            xcdsb = cdsb ;
            xcsgb = -(cggb + cbgb + cdgb + here->B1GSoverlapCap ) ;
            xcsdb = -(cgdb + cbdb + cddb) ;
            xcssb = (capbs + here->B1GSoverlapCap - (cgsb+cbsb+cdsb)) ;
            xcggb = (cggb + here->B1GDoverlapCap + here->B1GSoverlapCap +
                    here->B1GBoverlapCap) ;
            xcgdb = (cgdb - here->B1GDoverlapCap ) ;
            xcgsb = (cgsb - here->B1GSoverlapCap) ;
            xcbgb = (cbgb - here->B1GBoverlapCap) ;
            xcbdb = (cbdb - capbd ) ;
            xcbsb = (cbsb - capbs ) ;
            m = here->B1m;
            *(here->B1GgPtr ) += m * (xcggb * s->real);
            *(here->B1GgPtr +1) += m * (xcggb * s->imag);
            *(here->B1BbPtr ) += m * ((-xcbgb-xcbdb-xcbsb) * s->real);
            *(here->B1BbPtr +1) += m * ((-xcbgb-xcbdb-xcbsb) * s->imag);
            *(here->B1DPdpPtr ) += m * (xcddb * s->real);
            *(here->B1DPdpPtr +1) += m * (xcddb * s->imag);
            *(here->B1SPspPtr ) += m * (xcssb * s->real);
            *(here->B1SPspPtr +1) += m * (xcssb * s->imag);
            *(here->B1GbPtr ) += m * ((-xcggb-xcgdb-xcgsb) * s->real);
            *(here->B1GbPtr +1) += m * ((-xcggb-xcgdb-xcgsb) * s->imag);
            *(here->B1GdpPtr ) += m * (xcgdb * s->real);
            *(here->B1GdpPtr +1) += m * (xcgdb * s->imag);
            *(here->B1GspPtr ) += m * (xcgsb * s->real);
            *(here->B1GspPtr +1) += m * (xcgsb * s->imag);
            *(here->B1BgPtr ) += m * (xcbgb * s->real);
            *(here->B1BgPtr +1) += m * (xcbgb * s->imag);
            *(here->B1BdpPtr ) += m * (xcbdb * s->real);
            *(here->B1BdpPtr +1) += m * (xcbdb * s->imag);
            *(here->B1BspPtr ) += m * (xcbsb * s->real);
            *(here->B1BspPtr +1) += m * (xcbsb * s->imag);
            *(here->B1DPgPtr ) += m * (xcdgb * s->real);
            *(here->B1DPgPtr +1) += m * (xcdgb * s->imag);
            *(here->B1DPbPtr ) += m * ((-xcdgb-xcddb-xcdsb) * s->real);
            *(here->B1DPbPtr +1) += m * ((-xcdgb-xcddb-xcdsb) * s->imag);
            *(here->B1DPspPtr ) += m * (xcdsb * s->real);
            *(here->B1DPspPtr +1) += m * (xcdsb * s->imag);
            *(here->B1SPgPtr ) += m * (xcsgb * s->real);
            *(here->B1SPgPtr +1) += m * (xcsgb * s->imag);
            *(here->B1SPbPtr ) += m * ((-xcsgb-xcsdb-xcssb) * s->real);
            *(here->B1SPbPtr +1) += m * ((-xcsgb-xcsdb-xcssb) * s->imag);
            *(here->B1SPdpPtr ) += m * (xcsdb * s->real);
            *(here->B1SPdpPtr +1) += m * (xcsdb * s->imag);
            *(here->B1DdPtr) += m * (gdpr);
            *(here->B1SsPtr) += m * (gspr);
            *(here->B1BbPtr) += m * (gbd+gbs);
            *(here->B1DPdpPtr) += m * (gdpr+gds+gbd+xrev*(gm+gmbs));
            *(here->B1SPspPtr) += m * (gspr+gds+gbs+xnrm*(gm+gmbs));
            *(here->B1DdpPtr) -= m * (gdpr);
            *(here->B1SspPtr) -= m * (gspr);
            *(here->B1BdpPtr) -= m * (gbd);
            *(here->B1BspPtr) -= m * (gbs);
            *(here->B1DPdPtr) -= m * (gdpr);
            *(here->B1DPgPtr) += m * ((xnrm-xrev)*gm);
            *(here->B1DPbPtr) += m * (-gbd+(xnrm-xrev)*gmbs);
            *(here->B1DPspPtr) += m * (-gds-xnrm*(gm+gmbs));
            *(here->B1SPgPtr) += m * (-(xnrm-xrev)*gm);
            *(here->B1SPsPtr) -= m * (gspr);
            *(here->B1SPbPtr) += m * (-gbs-(xnrm-xrev)*gmbs);
            *(here->B1SPdpPtr) += m * (-gds-xrev*(gm+gmbs));
        }
    }
    return(0);
}

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

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

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

variable_types: xnrm int

variable_types: xrev int

variable_types: gdpr double

variable_types: gspr double

variable_types: gm double

variable_types: gds double

variable_types: gmbs double

variable_types: gbd double

variable_types: gbs double

variable_types: capbd double

variable_types: capbs double

variable_types: xcggb double

variable_types: xcgdb double

variable_types: xcgsb double

variable_types: xcbgb double

variable_types: xcbdb double

variable_types: xcbsb double

variable_types: xcddb double

variable_types: xcssb double

variable_types: xcdgb double

variable_types: xcsgb double

variable_types: xcdsb double

variable_types: xcsdb double

variable_types: cggb double

variable_types: cgdb double

variable_types: cgsb double

variable_types: cbgb double

variable_types: cbdb double

variable_types: cbsb double

variable_types: cddb double

variable_types: cdgb double

variable_types: cdsb double

variable_types: m double