original_code:
int
B1trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep)
{
    B1model *model = (B1model*)inModel;
    B1instance *here;
    for( ; model != ((void *)0); model = model->B1nextModel) {
        for(here=model->B1instances;here!=((void *)0);here = here->B1nextInstance){
     if (here->B1owner != ARCHme) continue;
            CKTterr(here->B1states+ 12,ckt,timeStep);
            CKTterr(here->B1states+ 14,ckt,timeStep);
            CKTterr(here->B1states+ 16,ckt,timeStep);
        }
    }
    return(0);
}

canonical_original_code:
int B1trunc(struct sGENmodel *inModel, struct CKTcircuit *ckt, double *timeStep)
{
    struct sBSIM1model *model = (B1model*)inModel;
    struct sBSIM1instance *here;
    for( ; model != ((void *)0); model = model->B1nextModel) {
        for(here=model->B1instances;here!=((void *)0);here = here->B1nextInstance){
     if (here->B1owner != ARCHme) continue;
            CKTterr(here->B1states+ 12,ckt,timeStep);
            CKTterr(here->B1states+ 14,ckt,timeStep);
            CKTterr(here->B1states+ 16,ckt,timeStep);
        }
    }
    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:
timeStep
double *

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


MESacLoad

repo: gserdyuk/gnucap-a

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

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

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

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

variable_types: gdpr double

variable_types: gspr double

variable_types: gm double

variable_types: gds double

variable_types: ggs double

variable_types: xgs double

variable_types: ggd double

variable_types: xgd double

variable_types: m double

return_type: int

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

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 sGENinstance { struct sGENmodel *GENmodPtr; struct sGENinstance *GENnextInstance; char *GENname; int GENowner; int GENstate; int GENnode1; int GENnode2; int GENnode3; int GENnode4; int GENnode5; int GENnode6; int GENnode7; }

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

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

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

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


SWmAsk

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

switch ( a3 )
{
case 'f':
result = 0LL;
*a4 = a2[4];
break;
case 'g':
result = 0LL;
*a4 = a2[5];
break;
case 'h':
result = 0LL;
*a4 = a2[6];
break;
case 'i':
result = 0LL;
*a4 = a2[7];
break;
case 'j':
result = 0LL;
*a4 = a2[8];
break;
case 'k':
result = 0LL;
*a4 = a2[9];
break;
case 'l':
result = 0LL;
*a4 = a2[10];
break;
case 'm':
result = 0LL;
*a4 = a2[11];
break;
default:
JUMPOUT(0x9ELL);
}
return result;
}

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

switch ( a3 )
{
case 'f':
result = 0LL;
*a4 = a2[4];
break;
case 'g':
result = 0LL;
*a4 = a2[5];
break;
case 'h':
result = 0LL;
*a4 = a2[6];
break;
case 'i':
result = 0LL;
*a4 = a2[7];
break;
case 'j':
result = 0LL;
*a4 = a2[8];
break;
case 'k':
result = 0LL;
*a4 = a2[9];
break;
case 'l':
result = 0LL;
*a4 = a2[10];
break;
case 'm':
result = 0LL;
*a4 = a2[11];
break;
default:
JUMPOUT(0x9ELL);
}
return result;
}

original_code:
int
SWmAsk(CKTcircuit *ckt, GENmodel *inModel, int which, IFvalue *value)
{
    SWmodel *model = (SWmodel *)inModel;
    switch(which) {
        case 102:
            value->rValue = model->SWonResistance;
            return (0);
        case 103:
            value->rValue = model->SWoffResistance;
            return (0);
        case 104:
            value->rValue = model->SWvThreshold;
            return (0);
        case 105:
            value->rValue = model->SWvHysteresis;
            return (0);
        case 106:
            value->rValue = model->SWonConduct;
            return (0);
        case 107:
            value->rValue = model->SWoffConduct;
            return (0);
        default:
            return (7);
    }
}

canonical_original_code:
int SWmAsk(struct CKTcircuit *ckt, struct sGENmodel *inModel, int which, union uIFvalue *value)
{
    struct sSWmodel *model = (SWmodel *)inModel;
    switch(which) {
        case 102:
            value->rValue = model->SWonResistance;
            return (0);
        case 103:
            value->rValue = model->SWoffResistance;
            return (0);
        case 104:
            value->rValue = model->SWvThreshold;
            return (0);
        case 105:
            value->rValue = model->SWvHysteresis;
            return (0);
        case 106:
            value->rValue = model->SWonConduct;
            return (0);
        case 107:
            value->rValue = model->SWoffConduct;
            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:
inModel
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 sSWmodel { int SWmodType; struct sSWmodel *SWnextModel; struct sSWinstance { struct sSWmodel *SWmodPtr; struct sSWinstance *SWnextInstance; char *SWname; int SWowner; int SWstate; int SWposNode; int SWnegNode; int SWposCntrlNode; int SWnegCntrlNode; double *SWposPosptr; double *SWnegPosptr; double *SWposNegptr; double *SWnegNegptr; double SWcond; unsigned int SWzero_stateGiven; double SWnVar[3]; } *SWinstances; char *SWmodName; double SWonResistance; double SWoffResistance; double SWvThreshold; double SWvHysteresis; double SWonConduct; double SWoffConduct; unsigned int SWonGiven; unsigned int SWoffGiven; unsigned int SWthreshGiven; unsigned int SWhystGiven; } *

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 sSWmodel { int SWmodType; struct sSWmodel *SWnextModel; struct sSWinstance *SWinstances; char *SWmodName; double SWonResistance; double SWoffResistance; double SWvThreshold; double SWvHysteresis; double SWonConduct; double SWoffConduct; unsigned int SWonGiven; unsigned int SWoffGiven; unsigned int SWthreshGiven; unsigned int SWhystGiven; }


DIOparam

original_code:
int
DIOparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
{
    DIOinstance *here = (DIOinstance*)inst;
    switch(param) {
        case 1:
            here->DIOarea = value->rValue;
            here->DIOareaGiven = 1;
            break;
        case 19:
            here->DIOpj = value->rValue;
            here->DIOpjGiven = 1;
            break;
        case 20:
            here->DIOm = value->rValue;
            here->DIOmGiven = 1;
            break;
        case 11:
            here->DIOtemp = value->rValue+(273.15);
            here->DIOtempGiven = 1;
            break;
 case 21:
            here->DIOdtemp = value->rValue;
            here->DIOdtempGiven = 1;
            break;
        case 3:
            here->DIOoff = value->iValue;
            break;
        case 2:
            here->DIOinitCond = value->rValue;
            break;
        case 9:
            here->DIOsenParmNo = value->iValue;
            break;
        default:
            return(7);
    }
    return(0);
}

canonical_original_code:
int DIOparam(int param, union uIFvalue *value, struct sGENinstance *inst, union uIFvalue *select)
{
    struct sDIOinstance *here = (DIOinstance*)inst;
    switch(param) {
        case 1:
            here->DIOarea = value->rValue;
            here->DIOareaGiven = 1;
            break;
        case 19:
            here->DIOpj = value->rValue;
            here->DIOpjGiven = 1;
            break;
        case 20:
            here->DIOm = value->rValue;
            here->DIOmGiven = 1;
            break;
        case 11:
            here->DIOtemp = value->rValue+(273.15);
            here->DIOtempGiven = 1;
            break;
 case 21:
            here->DIOdtemp = value->rValue;
            here->DIOdtempGiven = 1;
            break;
        case 3:
            here->DIOoff = value->iValue;
            break;
        case 2:
            here->DIOinitCond = value->rValue;
            break;
        case 9:
            here->DIOsenParmNo = value->iValue;
            break;
        default:
            return(7);
    }
    return(0);
}

variable_types: param int

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

variable_types:
select
union uIFvalue *

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

user_defined_types: struct 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]; }

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

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


RESmParam

decompiled_code:
__int64 __fastcall RESmParam(int a1, double *a2, __int64 a3)
{
__int64 result; // rax
double v4; // xmm0_8
double v5; // xmm0_8
double v6; // xmm0_8
double v7; // xmm0_8
double v8; // xmm0_8
double v9; // xmm0_8

switch ( a1 )
{
case 'e':
v5 = *a2;
result = 0LL;
*(_BYTE *)(a3 + 80) |= 2u;
*(double *)(a3 + 40) = v5;
break;
case 'f':
v6 = *a2;
result = 0LL;
*(_BYTE *)(a3 + 80) |= 4u;
*(double *)(a3 + 48) = v6;
break;
case 'g':
v7 = *a2;
result = 0LL;
*(_BYTE *)(a3 + 80) |= 8u;
*(double *)(a3 + 56) = v7;
break;
case 'h':
v8 = *a2;
result = 0LL;
*(_BYTE *)(a3 + 80) |= 0x10u;
*(double *)(a3 + 64) = v8;
break;
case 'i':
v9 = *a2;
result = 0LL;
*(_BYTE *)(a3 + 80) |= 0x20u;
*(double *)(a3 + 72) = v9;
break;
case 'j':
result = 0LL;
break;
case 'k':
v4 = *a2 + 273.15;
result = 0LL;
*(_BYTE *)(a3 + 80) |= 1u;
*(double *)(a3 + 32) = v4;
break;
default:
JUMPOUT(0x92LL);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, double *a2, __int64 a3)
{
__int64 result; // rax
double v4; // xmm0_8
double v5; // xmm0_8
double v6; // xmm0_8
double v7; // xmm0_8
double v8; // xmm0_8
double v9; // xmm0_8

switch ( a1 )
{
case 'e':
v5 = *a2;
result = 0LL;
*(_BYTE *)(a3 + 80) |= 2u;
*(double *)(a3 + 40) = v5;
break;
case 'f':
v6 = *a2;
result = 0LL;
*(_BYTE *)(a3 + 80) |= 4u;
*(double *)(a3 + 48) = v6;
break;
case 'g':
v7 = *a2;
result = 0LL;
*(_BYTE *)(a3 + 80) |= 8u;
*(double *)(a3 + 56) = v7;
break;
case 'h':
v8 = *a2;
result = 0LL;
*(_BYTE *)(a3 + 80) |= 0x10u;
*(double *)(a3 + 64) = v8;
break;
case 'i':
v9 = *a2;
result = 0LL;
*(_BYTE *)(a3 + 80) |= 0x20u;
*(double *)(a3 + 72) = v9;
break;
case 'j':
result = 0LL;
break;
case 'k':
v4 = *a2 + 273.15;
result = 0LL;
*(_BYTE *)(a3 + 80) |= 1u;
*(double *)(a3 + 32) = v4;
break;
default:
JUMPOUT(0x92LL);
}
return result;
}

original_code:
int
RESmParam(int param, IFvalue *value, GENmodel *inModel)
{
    RESmodel *model = (RESmodel *)inModel;
    switch(param) {
        case 107:
            model->REStnom = value->rValue+(273.15);
            model->REStnomGiven = 1;
            break;
        case 101:
            model->REStempCoeff1 = value->rValue;
            model->REStc1Given = 1;
            break;
        case 102:
            model->REStempCoeff2 = value->rValue;
            model->REStc2Given = 1;
            break;
        case 103:
            model->RESsheetRes = value->rValue;
            model->RESsheetResGiven = 1;
            break;
        case 104:
            model->RESdefWidth = value->rValue;
            model->RESdefWidthGiven = 1;
            break;
        case 105:
            model->RESnarrow = value->rValue;
            model->RESnarrowGiven = 1;
            break;
        case 108:
            model->RESshort = value->rValue;
            model->RESshortGiven = 1;
            break;
 case 109:
     model->RESfNcoef = value->rValue;
     model->RESfNcoefGiven = 1;
     break;
 case 110:
     model->RESfNexp = value->rValue;
     model->RESfNexpGiven = 1;
     break;
        case 106:
            break;
        default:
            return(7);
    }
    return(0);
}

canonical_original_code:
int RESmParam(int param, union uIFvalue *value, struct sGENmodel *inModel)
{
    struct sRESmodel *model = (RESmodel *)inModel;
    switch(param) {
        case 107:
            model->REStnom = value->rValue+(273.15);
            model->REStnomGiven = 1;
            break;
        case 101:
            model->REStempCoeff1 = value->rValue;
            model->REStc1Given = 1;
            break;
        case 102:
            model->REStempCoeff2 = value->rValue;
            model->REStc2Given = 1;
            break;
        case 103:
            model->RESsheetRes = value->rValue;
            model->RESsheetResGiven = 1;
            break;
        case 104:
            model->RESdefWidth = value->rValue;
            model->RESdefWidthGiven = 1;
            break;
        case 105:
            model->RESnarrow = value->rValue;
            model->RESnarrowGiven = 1;
            break;
        case 108:
            model->RESshort = value->rValue;
            model->RESshortGiven = 1;
            break;
 case 109:
     model->RESfNcoef = value->rValue;
     model->RESfNcoefGiven = 1;
     break;
 case 110:
     model->RESfNexp = value->rValue;
     model->RESfNexpGiven = 1;
     break;
        case 106:
            break;
        default:
            return(7);
    }
    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 sRESmodel { int RESmodType; struct sRESmodel *RESnextModel; struct sRESinstance { struct sRESmodel *RESmodPtr; struct sRESinstance *RESnextInstance; char *RESname; int RESowner; int RESstate; int RESposNode; int RESnegNode; double REStemp; double RESdtemp; double RESconduct; double RESresist; double REScurrent; double RESacResist; double RESacConduct; double RESwidth; double RESlength; double RESscale; double RESm; double REStc1; double REStc2; int RESnoisy; double *RESposPosptr; double *RESnegNegptr; double *RESposNegptr; double *RESnegPosptr; unsigned int RESresGiven; unsigned int RESwidthGiven; unsigned int RESlengthGiven; unsigned int RESscaleGiven; unsigned int REStempGiven; unsigned int RESdtempGiven; unsigned int RESacresGiven; unsigned int RESmGiven; unsigned int REStc1Given; unsigned int REStc2Given; unsigned int RESnoisyGiven; int RESsenParmNo; double RESnVar[3][3]; } *RESinstances; char *RESmodName; double REStnom; double REStempCoeff1; double REStempCoeff2; double RESsheetRes; double RESdefWidth; double RESnarrow; double RESshort; double RESfNcoef; double RESfNexp; unsigned int REStnomGiven; unsigned int REStc1Given; unsigned int REStc2Given; unsigned int RESsheetResGiven; unsigned int RESdefWidthGiven; unsigned int RESnarrowGiven; unsigned int RESshortGiven; unsigned int RESfNcoefGiven; unsigned int RESfNexpGiven; } *

user_defined_types: struct sRESmodel { int RESmodType; struct sRESmodel *RESnextModel; struct sRESinstance *RESinstances; char *RESmodName; double REStnom; double REStempCoeff1; double REStempCoeff2; double RESsheetRes; double RESdefWidth; double RESnarrow; double RESshort; double RESfNcoef; double RESfNexp; unsigned int REStnomGiven; unsigned int REStc1Given; unsigned int REStc2Given; unsigned int RESsheetResGiven; unsigned int RESdefWidthGiven; unsigned int RESnarrowGiven; unsigned int RESshortGiven; unsigned int RESfNcoefGiven; unsigned int RESfNexpGiven; }


DIOtemp

decompiled_code:
__int64 __fastcall DIOtemp(__int64 a1, double *a2)
{
__int64 v2; // r14
double v3; // xmm0_8
double v4; // xmm0_8
double v5; // xmm1_8
double v6; // xmm0_8
double v7; // xmm2_8
double v8; // xmm0_8
__int64 v9; // r15
double v10; // xmm1_8
double v11; // rbx
double v12; // xmm0_8
double v13; // xmm4_8
double v14; // xmm8_8
double v15; // xmm2_8
double v16; // xmm9_8
double v17; // xmm0_8
double v18; // xmm1_8
double v19; // xmm6_8
double v20; // xmm5_8
double v21; // xmm0_8
double v22; // xmm0_8
double v23; // xmm0_8
double v24; // xmm0_8
double v25; // xmm2_8
double v26; // xmm4_8
char *v27; // rax
char *v28; // rbx
double v29; // xmm2_8
double v30; // xmm0_8
int v31; // ebx
double v32; // xmm3_8
double v33; // xmm0_8
double v34; // xmm2_8
double v35; // xmm1_8
double v36; // xmm0_8
char *v37; // rax
char *v38; // rbx
double v40; // [rsp+0h] [rbp-78h]
double v41; // [rsp+8h] [rbp-70h]
double v42; // [rsp+8h] [rbp-70h]
double v43; // [rsp+8h] [rbp-70h]
double v44; // [rsp+10h] [rbp-68h]
double v45; // [rsp+10h] [rbp-68h]
double v46; // [rsp+10h] [rbp-68h]
double v47; // [rsp+10h] [rbp-68h]
double v48; // [rsp+18h] [rbp-60h]
double v49; // [rsp+18h] [rbp-60h]
double v50; // [rsp+18h] [rbp-60h]
double v51; // [rsp+28h] [rbp-50h]
double v52; // [rsp+30h] [rbp-48h]
double v53; // [rsp+38h] [rbp-40h]

if ( a1 )
{
v2 = a1;
while ( 1 )
{
if ( (*(_BYTE *)(v2 + 33) & 0x10) != 0 )
{
v3 = *(double *)(v2 + 160);
}
else
{
v3 = a2[53];
*(double *)(v2 + 160) = v3;
}
v53 = v3 * CONSTKoverQ;
if ( *(double *)(v2 + 96) > 0.9 )
{
(*(void (**)(__int64, const char *, ...))(SPfrontEnd + 24LL))(
1LL,
"%s: grading coefficient too large, limited to 0.9",
(const char *)(v2 + 24));
*(_QWORD *)(v2 + 96) = LC2;
}
if ( *(double *)(v2 + 104) < 0.1 )
{
(*(void (**)(__int64, const char *, ...))(SPfrontEnd + 24LL))(
1LL,
"%s: activation energy too small, limited to 0.1",
(const char *)(v2 + 24));
*(_QWORD *)(v2 + 104) = LC4;
}
v4 = *(double *)(v2 + 120);
if ( v4 > 0.95 )
{
(*(void (**)(__int64, const char *, ...))(SPfrontEnd + 24LL))(
1LL,
"%s: coefficient Fc too large, limited to 0.95",
(const char *)(v2 + 24));
*(_QWORD *)(v2 + 120) = LC6;
v5 = *(double *)&LC0;
}
else
{
v5 = 1.0 - v4;
}
v6 = 0.0;
if ( (*(_BYTE *)(v2 + 32) & 2) != 0 )
{
v7 = *(double *)(v2 + 48);
if ( v7 != 0.0 )
v6 = 1.0 / v7;
}
*(double *)(v2 + 56) = v6;
v8 = log(v5);
v9 = *(_QWORD *)(v2 + 16);
v52 = v8;
if ( v9 )
break;
LABEL_32:
*(double *)(v2 + 144) = exp((*(double *)(v2 + 96) + 1.0) * v52);
*(double *)(v2 + 152) = 1.0 - (*(double *)(v2 + 96) + 1.0) * *(double *)(v2 + 120);
v2 = *(_QWORD *)(v2 + 8);
if ( !v2 )
return 0LL;
}
while ( 1 )
{
if ( (*(_BYTE *)(v9 + 96) & 8) != 0 )
{
v10 = *(double *)(v9 + 120);
}
else
{
v10 = a2[52];
*(double *)(v9 + 120) = v10;
}
v40 = CONSTKoverQ * v10;
v11 = log(v10 / 300.15);
v44 = *(double *)(v2 + 160);
v12 = log(v44 / 300.15);
v13 = *(double *)(v2 + 96);
v14 = *(double *)(v2 + 160);
v15 = (*(double *)(v2 + 88)
- ((COERCE_DOUBLE(COERCE_UNSIGNED_INT64(1.16 - 0.000702 * v44 * v44 / (v44 + 1108.0)) ^ LC13)
/ (v44
* 2.7612452e-23)
+ 1.345444239894147e20)
* 1.6021918e-19
+ v12 * 1.5)
* (-2.0
* v53))
/ (v44
/ 300.15);
v16 = *(double *)(v2 + 80) / (((v14 - 300.15) * 0.0004 - (*(double *)(v2 + 88) - v15) / v15) * v13 + 1.0);
v17 = ((COERCE_DOUBLE(COERCE_UNSIGNED_INT64(1.16 - 0.000702 * v10 * v10 / (v10 + 1108.0)) ^ LC13)
/ (v10
* 2.7612452e-23)
+ 1.345444239894147e20)
* 1.6021918e-19
+ v11 * 1.5)
* (-2.0
* v40)
+ v10 / 300.15 * v15;
*(double *)(v9 + 128) = v17;
v18 = *(double *)(v2 + 64);
v19 = *(double *)(v9 + 120) / v14;
v41 = *(double *)(v2 + 40);
v20 = (*(double *)(v9 + 120) - 300.15) * 0.0004 - (v17 - v15) / v15;
v21 = (v19 - 1.0) * *(double *)(v2 + 104) / (v40 * v18);
*(double *)(v9 + 136) = (v20 * v13 + 1.0) * v16;
v45 = v21;
v48 = *(double *)(v2 + 112) / v18;
v22 = log(v19);
v23 = exp(v22 * v48 + v45) * v41;
v42 = *(double *)(v9 + 128);
*(double *)(v9 + 152) = v23;
v24 = (1.0 - exp((1.0 - *(double *)(v2 + 96)) * v52)) * v42;
v43 = v40 * *(double *)(v2 + 64);
*(double *)(v9 + 168) = v24 / (1.0 - *(double *)(v2 + 96));
*(double *)(v9 + 144) = *(double *)(v2 + 120) * *(double *)(v9 + 128);
*(double *)(v9 + 160) = log(v43 / (*(double *)(v9 + 152) * CONSTroot2)) * v43;
if ( (*(_BYTE *)(v2 + 33) & 4) != 0 )
{
v25 = *(double *)(v2 + 128);
v26 = *(double *)(v2 + 136);
v46 = *(double *)(v9 + 152) * v25 / v40;
if ( v46 <= v26 )
{
v31 = 25;
v47 = *(double *)(v2 + 136);
v51 = a2[100] * v26;
v32 = (v25 - log(v26 / *(double *)(v9 + 152) + 1.0) * v40) / v40;
while ( 1 )
{
v49 = *(double *)(v2 + 128);
v33 = log(v47 / *(double *)(v9 + 152) + 1.0 - v32);
v34 = v49;
v50 = *(double *)(v9 + 152);
v29 = v34 - v33 * v40;
v32 = v29 / v40;
v35 = (exp((*(double *)(v2 + 128) - v29) / v40) - 1.0 + v29 / v40) * v50;
v36 = v35 - v47;
if ( v35 - v47 < 0.0 )
*(_QWORD *)&v36 = COERCE_UNSIGNED_INT64(v35 - v47) ^ LC13;
if ( v51 >= v36 )
break;
if ( !--v31 )
{
v37 = (char *)calloc(1uLL, 0x64uLL);
v38 = v37;
if ( !v37 )
return 8LL;
sprintf(v37, "%%s: unable to match forward and reverse diode regions: bv = %g, ibv = %g", v29, v35);
(*(void (__fastcall **)(__int64, char *, __int64, double, double, double))(SPfrontEnd + 24LL))(
1LL,
v38,
v9 + 16,
v29,
v35,
v29);
free(v38);
break;
}
}
}
else
{
v27 = (char *)calloc(1uLL, 0xC8uLL);
v28 = v27;
if ( !v27 )
return 8LL;
sprintf(
v27,
"%%s: breakdown current increased to %g to resolve\nincompatability with specified saturation current",
v46);
(*(void (__fastcall **)(__int64, char *, __int64))(SPfrontEnd + 24LL))(1LL, v28, v9 + 16);
free(v28);
v29 = *(double *)(v2 + 128);
}
*(double *)(v9 + 176) = v29;
}
v30 = *(double *)(v9 + 152) * *(double *)(v9 + 104);
*(double *)(v9 + 184) = v43;
*(double *)(v9 + 152) = v30;
v9 = *(_QWORD *)(v9 + 8);
if ( !v9 )
goto LABEL_32;
}
}
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, double *a2)
{
__int64 v2; // r14
double v3; // xmm0_8
double v4; // xmm0_8
double v5; // xmm1_8
double v6; // xmm0_8
double v7; // xmm2_8
double v8; // xmm0_8
__int64 v9; // r15
double v10; // xmm1_8
double v11; // rbx
double v12; // xmm0_8
double v13; // xmm4_8
double v14; // xmm8_8
double v15; // xmm2_8
double v16; // xmm9_8
double v17; // xmm0_8
double v18; // xmm1_8
double v19; // xmm6_8
double v20; // xmm5_8
double v21; // xmm0_8
double v22; // xmm0_8
double v23; // xmm0_8
double v24; // xmm0_8
double v25; // xmm2_8
double v26; // xmm4_8
char *v27; // rax
char *v28; // rbx
double v29; // xmm2_8
double v30; // xmm0_8
int v31; // ebx
double v32; // xmm3_8
double v33; // xmm0_8
double v34; // xmm2_8
double v35; // xmm1_8
double v36; // xmm0_8
char *v37; // rax
char *v38; // rbx
double v40; // [rsp+0h] [rbp-78h]
double v41; // [rsp+8h] [rbp-70h]
double v42; // [rsp+8h] [rbp-70h]
double v43; // [rsp+8h] [rbp-70h]
double v44; // [rsp+10h] [rbp-68h]
double v45; // [rsp+10h] [rbp-68h]
double v46; // [rsp+10h] [rbp-68h]
double v47; // [rsp+10h] [rbp-68h]
double v48; // [rsp+18h] [rbp-60h]
double v49; // [rsp+18h] [rbp-60h]
double v50; // [rsp+18h] [rbp-60h]
double v51; // [rsp+28h] [rbp-50h]
double v52; // [rsp+30h] [rbp-48h]
double v53; // [rsp+38h] [rbp-40h]

if ( a1 )
{
v2 = a1;
while ( 1 )
{
if ( (*(_BYTE *)(v2 + 33) & 0x10) != 0 )
{
v3 = *(double *)(v2 + 160);
}
else
{
v3 = a2[53];
*(double *)(v2 + 160) = v3;
}
v53 = v3 * CONSTKoverQ;
if ( *(double *)(v2 + 96) > 0.9 )
{
(*(void (**)(__int64, const char *, ...))(SPfrontEnd + 24LL))(
1LL,
"%s: grading coefficient too large, limited to 0.9",
(const char *)(v2 + 24));
*(_QWORD *)(v2 + 96) = LC2;
}
if ( *(double *)(v2 + 104) < 0.1 )
{
(*(void (**)(__int64, const char *, ...))(SPfrontEnd + 24LL))(
1LL,
"%s: activation energy too small, limited to 0.1",
(const char *)(v2 + 24));
*(_QWORD *)(v2 + 104) = LC4;
}
v4 = *(double *)(v2 + 120);
if ( v4 > 0.95 )
{
(*(void (**)(__int64, const char *, ...))(SPfrontEnd + 24LL))(
1LL,
"%s: coefficient Fc too large, limited to 0.95",
(const char *)(v2 + 24));
*(_QWORD *)(v2 + 120) = LC6;
v5 = *(double *)&LC0;
}
else
{
v5 = 1.0 - v4;
}
v6 = 0.0;
if ( (*(_BYTE *)(v2 + 32) & 2) != 0 )
{
v7 = *(double *)(v2 + 48);
if ( v7 != 0.0 )
v6 = 1.0 / v7;
}
*(double *)(v2 + 56) = v6;
v8 = log(v5);
v9 = *(_QWORD *)(v2 + 16);
v52 = v8;
if ( v9 )
break;
LABEL_32:
*(double *)(v2 + 144) = exp((*(double *)(v2 + 96) + 1.0) * v52);
*(double *)(v2 + 152) = 1.0 - (*(double *)(v2 + 96) + 1.0) * *(double *)(v2 + 120);
v2 = *(_QWORD *)(v2 + 8);
if ( !v2 )
return 0LL;
}
while ( 1 )
{
if ( (*(_BYTE *)(v9 + 96) & 8) != 0 )
{
v10 = *(double *)(v9 + 120);
}
else
{
v10 = a2[52];
*(double *)(v9 + 120) = v10;
}
v40 = CONSTKoverQ * v10;
v11 = log(v10 / 300.15);
v44 = *(double *)(v2 + 160);
v12 = log(v44 / 300.15);
v13 = *(double *)(v2 + 96);
v14 = *(double *)(v2 + 160);
v15 = (*(double *)(v2 + 88)
- ((COERCE_DOUBLE(COERCE_UNSIGNED_INT64(1.16 - 0.000702 * v44 * v44 / (v44 + 1108.0)) ^ LC13)
/ (v44
* 2.7612452e-23)
+ 1.345444239894147e20)
* 1.6021918e-19
+ v12 * 1.5)
* (-2.0
* v53))
/ (v44
/ 300.15);
v16 = *(double *)(v2 + 80) / (((v14 - 300.15) * 0.0004 - (*(double *)(v2 + 88) - v15) / v15) * v13 + 1.0);
v17 = ((COERCE_DOUBLE(COERCE_UNSIGNED_INT64(1.16 - 0.000702 * v10 * v10 / (v10 + 1108.0)) ^ LC13)
/ (v10
* 2.7612452e-23)
+ 1.345444239894147e20)
* 1.6021918e-19
+ v11 * 1.5)
* (-2.0
* v40)
+ v10 / 300.15 * v15;
*(double *)(v9 + 128) = v17;
v18 = *(double *)(v2 + 64);
v19 = *(double *)(v9 + 120) / v14;
v41 = *(double *)(v2 + 40);
v20 = (*(double *)(v9 + 120) - 300.15) * 0.0004 - (v17 - v15) / v15;
v21 = (v19 - 1.0) * *(double *)(v2 + 104) / (v40 * v18);
*(double *)(v9 + 136) = (v20 * v13 + 1.0) * v16;
v45 = v21;
v48 = *(double *)(v2 + 112) / v18;
v22 = log(v19);
v23 = exp(v22 * v48 + v45) * v41;
v42 = *(double *)(v9 + 128);
*(double *)(v9 + 152) = v23;
v24 = (1.0 - exp((1.0 - *(double *)(v2 + 96)) * v52)) * v42;
v43 = v40 * *(double *)(v2 + 64);
*(double *)(v9 + 168) = v24 / (1.0 - *(double *)(v2 + 96));
*(double *)(v9 + 144) = *(double *)(v2 + 120) * *(double *)(v9 + 128);
*(double *)(v9 + 160) = log(v43 / (*(double *)(v9 + 152) * CONSTroot2)) * v43;
if ( (*(_BYTE *)(v2 + 33) & 4) != 0 )
{
v25 = *(double *)(v2 + 128);
v26 = *(double *)(v2 + 136);
v46 = *(double *)(v9 + 152) * v25 / v40;
if ( v46 <= v26 )
{
v31 = 25;
v47 = *(double *)(v2 + 136);
v51 = a2[100] * v26;
v32 = (v25 - log(v26 / *(double *)(v9 + 152) + 1.0) * v40) / v40;
while ( 1 )
{
v49 = *(double *)(v2 + 128);
v33 = log(v47 / *(double *)(v9 + 152) + 1.0 - v32);
v34 = v49;
v50 = *(double *)(v9 + 152);
v29 = v34 - v33 * v40;
v32 = v29 / v40;
v35 = (exp((*(double *)(v2 + 128) - v29) / v40) - 1.0 + v29 / v40) * v50;
v36 = v35 - v47;
if ( v35 - v47 < 0.0 )
*(_QWORD *)&v36 = COERCE_UNSIGNED_INT64(v35 - v47) ^ LC13;
if ( v51 >= v36 )
break;
if ( !--v31 )
{
v37 = (char *)calloc(1uLL, 0x64uLL);
v38 = v37;
if ( !v37 )
return 8LL;
sprintf(v37, "%%s: unable to match forward and reverse diode regions: bv = %g, ibv = %g", v29, v35);
(*(void (__fastcall **)(__int64, char *, __int64, double, double, double))(SPfrontEnd + 24LL))(
1LL,
v38,
v9 + 16,
v29,
v35,
v29);
free(v38);
break;
}
}
}
else
{
v27 = (char *)calloc(1uLL, 0xC8uLL);
v28 = v27;
if ( !v27 )
return 8LL;
sprintf(
v27,
"%%s: breakdown current increased to %g to resolve\nincompatability with specified saturation current",
v46);
(*(void (__fastcall **)(__int64, char *, __int64))(SPfrontEnd + 24LL))(1LL, v28, v9 + 16);
free(v28);
v29 = *(double *)(v2 + 128);
}
*(double *)(v9 + 176) = v29;
}
v30 = *(double *)(v9 + 152) * *(double *)(v9 + 104);
*(double *)(v9 + 184) = v43;
*(double *)(v9 + 152) = v30;
v9 = *(_QWORD *)(v9 + 8);
if ( !v9 )
goto LABEL_32;
}
}
return 0LL;
}

original_code:
int
DIOtemp(GENmodel *inModel, CKTcircuit *ckt)
{
    DIOmodel *model = (DIOmodel*)inModel;
    double xfc, xfcs;
    double vte;
    double cbv;
    double xbv;
    double xcbv;
    double tol;
    double vt;
    double vtnom;
    double difference;
    double factor;
    DIOinstance *here;
    int iter;
    char *emsg;
    for( ; model != ((void *)0); model = model->DIOnextModel ) {
        if(!model->DIOnomTempGiven) {
            model->DIOnomTemp = ckt->CKTnomTemp;
        }
        vtnom = CONSTKoverQ * model->DIOnomTemp;
        if(model->DIOgradingCoeff>.9) {
            (*(SPfrontEnd->IFerror))(0x1,
                    "%s: grading coefficient too large, limited to 0.9",
                    &(model->DIOmodName));
            model->DIOgradingCoeff=.9;
        }
        if(model->DIOactivationEnergy<.1) {
            (*(SPfrontEnd->IFerror))(0x1,
                    "%s: activation energy too small, limited to 0.1",
                    &(model->DIOmodName));
            model->DIOactivationEnergy=.1;
        }
        if(model->DIOdepletionCapCoeff>.95) {
            (*(SPfrontEnd->IFerror))(0x1,
                    "%s: coefficient Fc too large, limited to 0.95",
                    &(model->DIOmodName));
            model->DIOdepletionCapCoeff=.95;
        }
        if(model->DIOdepletionSWcapCoeff>.95) {
            (*(SPfrontEnd->IFerror))(0x1,
                    "%s: coefficient Fcs too large, limited to 0.95",
                    &(model->DIOmodName));
            model->DIOdepletionSWcapCoeff=.95;
        }
        if((!model->DIOresistGiven) || (model->DIOresist==0)) {
            model->DIOconductance = 0.0;
        } else {
            model->DIOconductance = 1/model->DIOresist;
        }
        xfc=log(1-model->DIOdepletionCapCoeff);
 xfcs=log(1-model->DIOdepletionSWcapCoeff);
        for(here=model->DIOinstances;here;here=here->DIOnextInstance) {
            double egfet1,arg1,fact1,pbfact1,pbo,gmaold,pboSW,gmaSWold;
            double fact2,pbfact,arg,egfet,gmanew,gmaSWnew;
     if (here->DIOowner != ARCHme) continue;
     if(!here->DIOdtempGiven) here->DIOdtemp = 0.0;
     if(!here->DIOtempGiven)
         here->DIOtemp = ckt->CKTtemp + here->DIOdtemp;
    difference = here->DIOtemp - model->DIOnomTemp;
    factor = 1.0 + (model->DIOgradCoeffTemp1 * difference)
                        + (model->DIOgradCoeffTemp2 * difference * difference);
           here->DIOtGradingCoeff = model->DIOgradingCoeff * factor;
          if(here->DIOtGradingCoeff>.9) {
              (*(SPfrontEnd->IFerror))(0x1,
                    "%s: temperature adjusted grading coefficient too large, limited to 0.9",
                    &(here->DIOname));
              here->DIOtGradingCoeff=.9;
              }
            vt = CONSTKoverQ * here->DIOtemp;
            fact2 = here->DIOtemp/300.15;
            egfet = 1.16-(7.02e-4*here->DIOtemp*here->DIOtemp)/
                    (here->DIOtemp+1108);
            arg = -egfet/(2*(1.3806226e-23)*here->DIOtemp) +
                    1.1150877/((1.3806226e-23)*(300.15 +300.15));
            pbfact = -2*vt*(1.5*log(fact2)+(1.6021918e-19)*arg);
            egfet1 = 1.16 - (7.02e-4*model->DIOnomTemp*model->DIOnomTemp)/
                    (model->DIOnomTemp+1108);
            arg1 = -egfet1/((1.3806226e-23)*2*model->DIOnomTemp) +
                    1.1150877/(2*(1.3806226e-23)*300.15);
            fact1 = model->DIOnomTemp/300.15;
            pbfact1 = -2 * vtnom*(1.5*log(fact1)+(1.6021918e-19)*arg1);
            pbo = (model->DIOjunctionPot-pbfact1)/fact1;
            gmaold = (model->DIOjunctionPot -pbo)/pbo;
            here->DIOtJctCap = model->DIOjunctionCap/
                    (1+here->DIOtGradingCoeff*
                    (400e-6*(model->DIOnomTemp-300.15)-gmaold) );
            here->DIOtJctPot = pbfact+fact2*pbo;
            gmanew = (here->DIOtJctPot-pbo)/pbo;
            here->DIOtJctCap *= 1+here->DIOtGradingCoeff*
                    (400e-6*(here->DIOtemp-300.15)-gmanew);
            pboSW = (model->DIOjunctionSWPot-pbfact1)/fact1;
            gmaSWold = (model->DIOjunctionSWPot -pboSW)/pboSW;
            here->DIOtJctSWCap = model->DIOjunctionSWCap/
                    (1+model->DIOgradingSWCoeff*
                    (400e-6*(model->DIOnomTemp-300.15)-gmaSWold) );
            here->DIOtJctSWPot = pbfact+fact2*pboSW;
            gmaSWnew = (here->DIOtJctSWPot-pboSW)/pboSW;
            here->DIOtJctSWCap *= 1+model->DIOgradingSWCoeff*
                    (400e-6*(here->DIOtemp-300.15)-gmaSWnew);
            here->DIOtSatCur = model->DIOsatCur * exp(
                    ((here->DIOtemp/model->DIOnomTemp)-1) *
                    model->DIOactivationEnergy/(model->DIOemissionCoeff*vt) +
                    model->DIOsaturationCurrentExp/model->DIOemissionCoeff*
                    log(here->DIOtemp/model->DIOnomTemp) );
            here->DIOtSatSWCur = model->DIOsatSWCur * exp(
                    ((here->DIOtemp/model->DIOnomTemp)-1) *
                    model->DIOactivationEnergy/(model->DIOemissionCoeff*vt) +
                    model->DIOsaturationCurrentExp/model->DIOemissionCoeff*
                    log(here->DIOtemp/model->DIOnomTemp) );
            here->DIOtF1=here->DIOtJctPot*
                    (1-exp((1-here->DIOtGradingCoeff)*xfc))/
                    (1-here->DIOtGradingCoeff);
            here->DIOtDepCap=model->DIOdepletionCapCoeff*
                    here->DIOtJctPot;
            vte=model->DIOemissionCoeff*vt;
            here->DIOtVcrit=vte*
                          log(vte/(CONSTroot2*here->DIOtSatCur*here->DIOarea));
            if (model->DIObreakdownVoltageGiven){
                cbv=model->DIObreakdownCurrent*here->DIOarea*here->DIOm;
                if (cbv < here->DIOtSatCur*here->DIOarea*here->DIOm *
                          model->DIObreakdownVoltage/vt) {
                    cbv=here->DIOtSatCur*here->DIOarea*here->DIOm *
                        model->DIObreakdownVoltage/vt;
                    emsg = tmalloc((unsigned)(100));
                    if(emsg == (char *)((void *)0)) return(8);
                    (void)sprintf(emsg,
                    "%%s: breakdown current increased to %g to resolve",
                            cbv);
                    (*(SPfrontEnd->IFerror))(0x1,emsg,&(here->DIOname));
                    {if (emsg) {txfree((char *)(emsg));(emsg) = 0;}};
                    (*(SPfrontEnd->IFerror))(0x1,
                    "incompatibility with specified saturation current",(IFuid*)((void *)0));
                    xbv=model->DIObreakdownVoltage;
                } else {
                    tol=ckt->CKTreltol*cbv;
                    xbv=model->DIObreakdownVoltage-vt*log(1+cbv/
                            (here->DIOtSatCur*here->DIOarea*here->DIOm));
                    iter=0;
                    for(iter=0 ; iter < 25 ; iter++) {
                        xbv=model->DIObreakdownVoltage-vt*log(cbv/
                                (here->DIOtSatCur*here->DIOarea*here->DIOm)+1-xbv/vt);
                        xcbv=here->DIOtSatCur*here->DIOarea*here->DIOm *
                             (exp((model->DIObreakdownVoltage-xbv)/vt)-1+xbv/vt);
                        if (fabs(xcbv-cbv) <= tol) goto matched;
                    }
                    emsg = tmalloc((unsigned)(100));
                    if(emsg == (char *)((void *)0)) return(8);
                    (void)sprintf(emsg,
                    "%%s: unable to match forward and reverse diode regions: bv = %g, ibv = %g",
                            xbv,xcbv);
                    (*(SPfrontEnd->IFerror))(0x1,emsg,&here->DIOname);
                    {if (emsg) {txfree((char *)(emsg));(emsg) = 0;}};
                }
                matched:
                here->DIOtBrkdwnV = xbv;
            }
     difference = here->DIOtemp - model->DIOnomTemp;
     factor = 1.0 + (model->DIOtranTimeTemp1 * difference)
                  + (model->DIOtranTimeTemp2 * difference * difference);
     here->DIOtTransitTime = model->DIOtransitTime * factor;
     here->DIOtConductance = model->DIOconductance;
     if(model->DIOresistGiven && model->DIOresist!=0.0) {
                difference = here->DIOtemp - model->DIOnomTemp;
         factor = 1.0 + (model->DIOresistTemp1) * difference
               + (model->DIOresistTemp2 * difference * difference);
         here->DIOtConductance = model->DIOconductance / factor;
            }
            here->DIOtF2=exp((1+here->DIOtGradingCoeff)*xfc);
            here->DIOtF3=1-model->DIOdepletionCapCoeff*
                    (1+here->DIOtGradingCoeff);
            here->DIOtF2SW=exp((1+model->DIOgradingSWCoeff)*xfcs);
            here->DIOtF3SW=1-model->DIOdepletionSWcapCoeff*
                    (1+model->DIOgradingSWCoeff);
 }
    }
    return(0);
}

canonical_original_code:
int DIOtemp(struct sGENmodel *inModel, struct CKTcircuit *ckt)
{
    struct sDIOmodel *model = (DIOmodel*)inModel;
    double xfc; double xfcs;
    double vte;
    double cbv;
    double xbv;
    double xcbv;
    double tol;
    double vt;
    double vtnom;
    double difference;
    double factor;
    struct sDIOinstance *here;
    int iter;
    char *emsg;
    for( ; model != ((void *)0); model = model->DIOnextModel ) {
        if(!model->DIOnomTempGiven) {
            model->DIOnomTemp = ckt->CKTnomTemp;
        }
        vtnom = CONSTKoverQ * model->DIOnomTemp;
        if(model->DIOgradingCoeff>.9) {
            (*(SPfrontEnd->IFerror))(0x1,
                    "%s: grading coefficient too large, limited to 0.9",
                    &(model->DIOmodName));
            model->DIOgradingCoeff=.9;
        }
        if(model->DIOactivationEnergy<.1) {
            (*(SPfrontEnd->IFerror))(0x1,
                    "%s: activation energy too small, limited to 0.1",
                    &(model->DIOmodName));
            model->DIOactivationEnergy=.1;
        }
        if(model->DIOdepletionCapCoeff>.95) {
            (*(SPfrontEnd->IFerror))(0x1,
                    "%s: coefficient Fc too large, limited to 0.95",
                    &(model->DIOmodName));
            model->DIOdepletionCapCoeff=.95;
        }
        if(model->DIOdepletionSWcapCoeff>.95) {
            (*(SPfrontEnd->IFerror))(0x1,
                    "%s: coefficient Fcs too large, limited to 0.95",
                    &(model->DIOmodName));
            model->DIOdepletionSWcapCoeff=.95;
        }
        if((!model->DIOresistGiven) || (model->DIOresist==0)) {
            model->DIOconductance = 0.0;
        } else {
            model->DIOconductance = 1/model->DIOresist;
        }
        xfc=log(1-model->DIOdepletionCapCoeff);
 xfcs=log(1-model->DIOdepletionSWcapCoeff);
        for(here=model->DIOinstances;here;here=here->DIOnextInstance) {
            double egfet1; double arg1; double fact1; double pbfact1; double pbo; double gmaold; double pboSW; double gmaSWold;
            double fact2; double pbfact; double arg; double egfet; double gmanew; double gmaSWnew;
     if (here->DIOowner != ARCHme) continue;
     if(!here->DIOdtempGiven) here->DIOdtemp = 0.0;
     if(!here->DIOtempGiven)
         here->DIOtemp = ckt->CKTtemp + here->DIOdtemp;
    difference = here->DIOtemp - model->DIOnomTemp;
    factor = 1.0 + (model->DIOgradCoeffTemp1 * difference)
                        + (model->DIOgradCoeffTemp2 * difference * difference);
           here->DIOtGradingCoeff = model->DIOgradingCoeff * factor;
          if(here->DIOtGradingCoeff>.9) {
              (*(SPfrontEnd->IFerror))(0x1,
                    "%s: temperature adjusted grading coefficient too large, limited to 0.9",
                    &(here->DIOname));
              here->DIOtGradingCoeff=.9;
              }
            vt = CONSTKoverQ * here->DIOtemp;
            fact2 = here->DIOtemp/300.15;
            egfet = 1.16-(7.02e-4*here->DIOtemp*here->DIOtemp)/
                    (here->DIOtemp+1108);
            arg = -egfet/(2*(1.3806226e-23)*here->DIOtemp) +
                    1.1150877/((1.3806226e-23)*(300.15 +300.15));
            pbfact = -2*vt*(1.5*log(fact2)+(1.6021918e-19)*arg);
            egfet1 = 1.16 - (7.02e-4*model->DIOnomTemp*model->DIOnomTemp)/
                    (model->DIOnomTemp+1108);
            arg1 = -egfet1/((1.3806226e-23)*2*model->DIOnomTemp) +
                    1.1150877/(2*(1.3806226e-23)*300.15);
            fact1 = model->DIOnomTemp/300.15;
            pbfact1 = -2 * vtnom*(1.5*log(fact1)+(1.6021918e-19)*arg1);
            pbo = (model->DIOjunctionPot-pbfact1)/fact1;
            gmaold = (model->DIOjunctionPot -pbo)/pbo;
            here->DIOtJctCap = model->DIOjunctionCap/
                    (1+here->DIOtGradingCoeff*
                    (400e-6*(model->DIOnomTemp-300.15)-gmaold) );
            here->DIOtJctPot = pbfact+fact2*pbo;
            gmanew = (here->DIOtJctPot-pbo)/pbo;
            here->DIOtJctCap *= 1+here->DIOtGradingCoeff*
                    (400e-6*(here->DIOtemp-300.15)-gmanew);
            pboSW = (model->DIOjunctionSWPot-pbfact1)/fact1;
            gmaSWold = (model->DIOjunctionSWPot -pboSW)/pboSW;
            here->DIOtJctSWCap = model->DIOjunctionSWCap/
                    (1+model->DIOgradingSWCoeff*
                    (400e-6*(model->DIOnomTemp-300.15)-gmaSWold) );
            here->DIOtJctSWPot = pbfact+fact2*pboSW;
            gmaSWnew = (here->DIOtJctSWPot-pboSW)/pboSW;
            here->DIOtJctSWCap *= 1+model->DIOgradingSWCoeff*
                    (400e-6*(here->DIOtemp-300.15)-gmaSWnew);
            here->DIOtSatCur = model->DIOsatCur * exp(
                    ((here->DIOtemp/model->DIOnomTemp)-1) *
                    model->DIOactivationEnergy/(model->DIOemissionCoeff*vt) +
                    model->DIOsaturationCurrentExp/model->DIOemissionCoeff*
                    log(here->DIOtemp/model->DIOnomTemp) );
            here->DIOtSatSWCur = model->DIOsatSWCur * exp(
                    ((here->DIOtemp/model->DIOnomTemp)-1) *
                    model->DIOactivationEnergy/(model->DIOemissionCoeff*vt) +
                    model->DIOsaturationCurrentExp/model->DIOemissionCoeff*
                    log(here->DIOtemp/model->DIOnomTemp) );
            here->DIOtF1=here->DIOtJctPot*
                    (1-exp((1-here->DIOtGradingCoeff)*xfc))/
                    (1-here->DIOtGradingCoeff);
            here->DIOtDepCap=model->DIOdepletionCapCoeff*
                    here->DIOtJctPot;
            vte=model->DIOemissionCoeff*vt;
            here->DIOtVcrit=vte*
                          log(vte/(CONSTroot2*here->DIOtSatCur*here->DIOarea));
            if (model->DIObreakdownVoltageGiven){
                cbv=model->DIObreakdownCurrent*here->DIOarea*here->DIOm;
                if (cbv < here->DIOtSatCur*here->DIOarea*here->DIOm *
                          model->DIObreakdownVoltage/vt) {
                    cbv=here->DIOtSatCur*here->DIOarea*here->DIOm *
                        model->DIObreakdownVoltage/vt;
                    emsg = tmalloc((unsigned int)(100));
                    if(emsg == (char *)((void *)0)) return(8);
                    (void)sprintf(emsg,
                    "%%s: breakdown current increased to %g to resolve",
                            cbv);
                    (*(SPfrontEnd->IFerror))(0x1,emsg,&(here->DIOname));
                    {if (emsg) {txfree((char *)(emsg));(emsg) = 0;}};
                    (*(SPfrontEnd->IFerror))(0x1,
                    "incompatibility with specified saturation current",(char **)((void *)0));
                    xbv=model->DIObreakdownVoltage;
                } else {
                    tol=ckt->CKTreltol*cbv;
                    xbv=model->DIObreakdownVoltage-vt*log(1+cbv/
                            (here->DIOtSatCur*here->DIOarea*here->DIOm));
                    iter=0;
                    for(iter=0 ; iter < 25 ; iter++) {
                        xbv=model->DIObreakdownVoltage-vt*log(cbv/
                                (here->DIOtSatCur*here->DIOarea*here->DIOm)+1-xbv/vt);
                        xcbv=here->DIOtSatCur*here->DIOarea*here->DIOm *
                             (exp((model->DIObreakdownVoltage-xbv)/vt)-1+xbv/vt);
                        if (fabs(xcbv-cbv) <= tol) goto matched;
                    }
                    emsg = tmalloc((unsigned int)(100));
                    if(emsg == (char *)((void *)0)) return(8);
                    (void)sprintf(emsg,
                    "%%s: unable to match forward and reverse diode regions: bv = %g, ibv = %g",
                            xbv,xcbv);
                    (*(SPfrontEnd->IFerror))(0x1,emsg,&here->DIOname);
                    {if (emsg) {txfree((char *)(emsg));(emsg) = 0;}};
                }
                matched:
                here->DIOtBrkdwnV = xbv;
            }
     difference = here->DIOtemp - model->DIOnomTemp;
     factor = 1.0 + (model->DIOtranTimeTemp1 * difference)
                  + (model->DIOtranTimeTemp2 * difference * difference);
     here->DIOtTransitTime = model->DIOtransitTime * factor;
     here->DIOtConductance = model->DIOconductance;
     if(model->DIOresistGiven && model->DIOresist!=0.0) {
                difference = here->DIOtemp - model->DIOnomTemp;
         factor = 1.0 + (model->DIOresistTemp1) * difference
               + (model->DIOresistTemp2 * difference * difference);
         here->DIOtConductance = model->DIOconductance / factor;
            }
            here->DIOtF2=exp((1+here->DIOtGradingCoeff)*xfc);
            here->DIOtF3=1-model->DIOdepletionCapCoeff*
                    (1+here->DIOtGradingCoeff);
            here->DIOtF2SW=exp((1+model->DIOgradingSWCoeff)*xfcs);
            here->DIOtF3SW=1-model->DIOdepletionSWcapCoeff*
                    (1+model->DIOgradingSWCoeff);
 }
    }
    return(0);
}

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

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

variable_types: xfc double

variable_types: xfcs double

variable_types: vte double

variable_types: cbv double

variable_types: xbv double

variable_types: xcbv double

variable_types: tol double

variable_types: vt double

variable_types: vtnom double

variable_types: difference double

variable_types: factor double

variable_types: iter int

variable_types:
emsg
char *

variable_types: pbo double

variable_types: gmaold double

variable_types: pboSW double

variable_types: gmaSWold double

variable_types: pbfact double

variable_types: arg double

variable_types: egfet double

variable_types: gmanew double

variable_types: gmaSWnew double

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


JFETgetic

original_code:
int
JFETgetic(GENmodel *inModel, CKTcircuit *ckt)
{
    JFETmodel *model = (JFETmodel*)inModel;
    JFETinstance *here;
    for( ; model ; model = model->JFETnextModel) {
        for(here = model->JFETinstances; here ; here = here->JFETnextInstance) {
     if (here->JFETowner != ARCHme) continue;
            if(!here->JFETicVDSGiven) {
                here->JFETicVDS =
                        *(ckt->CKTrhs + here->JFETdrainNode) -
                        *(ckt->CKTrhs + here->JFETsourceNode);
            }
            if(!here->JFETicVGSGiven) {
                here->JFETicVGS =
                        *(ckt->CKTrhs + here->JFETgateNode) -
                        *(ckt->CKTrhs + here->JFETsourceNode);
            }
        }
    }
    return(0);
}

canonical_original_code:
int JFETgetic(struct sGENmodel *inModel, struct CKTcircuit *ckt)
{
    struct sJFETmodel *model = (JFETmodel*)inModel;
    struct sJFETinstance *here;
    for( ; model ; model = model->JFETnextModel) {
        for(here = model->JFETinstances; here ; here = here->JFETnextInstance) {
     if (here->JFETowner != ARCHme) continue;
            if(!here->JFETicVDSGiven) {
                here->JFETicVDS =
                        *(ckt->CKTrhs + here->JFETdrainNode) -
                        *(ckt->CKTrhs + here->JFETsourceNode);
            }
            if(!here->JFETicVGSGiven) {
                here->JFETicVGS =
                        *(ckt->CKTrhs + here->JFETgateNode) -
                        *(ckt->CKTrhs + here->JFETsourceNode);
            }
        }
    }
    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 sJFETmodel { int JFETmodType; struct sJFETmodel *JFETnextModel; struct sJFETinstance { struct sJFETmodel *JFETmodPtr; struct sJFETinstance *JFETnextInstance; char *JFETname; int JFETowner; int JFETstate; int JFETdrainNode; int JFETgateNode; int JFETsourceNode; int JFETdrainPrimeNode; int JFETsourcePrimeNode; double *JFETdrainDrainPrimePtr; double *JFETgateDrainPrimePtr; double *JFETgateSourcePrimePtr; double *JFETsourceSourcePrimePtr; double *JFETdrainPrimeDrainPtr; double *JFETdrainPrimeGatePtr; double *JFETdrainPrimeSourcePrimePtr; double *JFETsourcePrimeGatePtr; double *JFETsourcePrimeSourcePtr; double *JFETsourcePrimeDrainPrimePtr; double *JFETdrainDrainPtr; double *JFETgateGatePtr; double *JFETsourceSourcePtr; double *JFETdrainPrimeDrainPrimePtr; double *JFETsourcePrimeSourcePrimePtr; int JFETmode; double JFETdCoeffs[21]; double JFETnVar[3][5]; unsigned int JFEToff; unsigned int JFETareaGiven; unsigned int JFETmGiven; unsigned int JFETicVDSGiven; unsigned int JFETicVGSGiven; unsigned int JFETtempGiven; unsigned int JFETdtempGiven; double JFETarea; double JFETm; double JFETicVDS; double JFETicVGS; double JFETtemp; double JFETdtemp; double JFETtSatCur; double JFETtGatePot; double JFETtCGS; double JFETtCGD; double JFETcorDepCap; double JFETvcrit; double JFETf1; } *JFETinstances; char *JFETmodName; int JFETtype; double JFETthreshold; double JFETbeta; double JFETlModulation; double JFETdrainResist; double JFETsourceResist; double JFETcapGS; double JFETcapGD; double JFETgatePotential; double JFETgateSatCurrent; double JFETdepletionCapCoeff; double JFETfNcoef; double JFETfNexp; double JFETdrainConduct; double JFETsourceConduct; double JFETf2; double JFETf3; double JFETb; double JFETbFac; double JFETtnom; unsigned int JFETthresholdGiven; unsigned int JFETbetaGiven; unsigned int JFETlModulationGiven; unsigned int JFETdrainResistGiven; unsigned int JFETsourceResistGiven; unsigned int JFETcapGSGiven; unsigned int JFETcapGDGiven; unsigned int JFETgatePotentialGiven; unsigned int JFETgateSatCurrentGiven; unsigned int JFETdepletionCapCoeffGiven; unsigned int JFETbGiven; unsigned int JFETtnomGiven; unsigned int JFETfNcoefGiven; unsigned int JFETfNexpGiven; } *

variable_types: struct sJFETinstance { struct sJFETmodel { int JFETmodType; struct sJFETmodel *JFETnextModel; struct sJFETinstance *JFETinstances; char *JFETmodName; int JFETtype; double JFETthreshold; double JFETbeta; double JFETlModulation; double JFETdrainResist; double JFETsourceResist; double JFETcapGS; double JFETcapGD; double JFETgatePotential; double JFETgateSatCurrent; double JFETdepletionCapCoeff; double JFETfNcoef; double JFETfNexp; double JFETdrainConduct; double JFETsourceConduct; double JFETf2; double JFETf3; double JFETb; double JFETbFac; double JFETtnom; unsigned int JFETthresholdGiven; unsigned int JFETbetaGiven; unsigned int JFETlModulationGiven; unsigned int JFETdrainResistGiven; unsigned int JFETsourceResistGiven; unsigned int JFETcapGSGiven; unsigned int JFETcapGDGiven; unsigned int JFETgatePotentialGiven; unsigned int JFETgateSatCurrentGiven; unsigned int JFETdepletionCapCoeffGiven; unsigned int JFETbGiven; unsigned int JFETtnomGiven; unsigned int JFETfNcoefGiven; unsigned int JFETfNexpGiven; } *JFETmodPtr; struct sJFETinstance *JFETnextInstance; char *JFETname; int JFETowner; int JFETstate; int JFETdrainNode; int JFETgateNode; int JFETsourceNode; int JFETdrainPrimeNode; int JFETsourcePrimeNode; double *JFETdrainDrainPrimePtr; double *JFETgateDrainPrimePtr; double *JFETgateSourcePrimePtr; double *JFETsourceSourcePrimePtr; double *JFETdrainPrimeDrainPtr; double *JFETdrainPrimeGatePtr; double *JFETdrainPrimeSourcePrimePtr; double *JFETsourcePrimeGatePtr; double *JFETsourcePrimeSourcePtr; double *JFETsourcePrimeDrainPrimePtr; double *JFETdrainDrainPtr; double *JFETgateGatePtr; double *JFETsourceSourcePtr; double *JFETdrainPrimeDrainPrimePtr; double *JFETsourcePrimeSourcePrimePtr; int JFETmode; double JFETdCoeffs[21]; double JFETnVar[3][5]; unsigned int JFEToff; unsigned int JFETareaGiven; unsigned int JFETmGiven; unsigned int JFETicVDSGiven; unsigned int JFETicVGSGiven; unsigned int JFETtempGiven; unsigned int JFETdtempGiven; double JFETarea; double JFETm; double JFETicVDS; double JFETicVGS; double JFETtemp; double JFETdtemp; double JFETtSatCur; double JFETtGatePot; double JFETtCGS; double JFETtCGD; double JFETcorDepCap; double JFETvcrit; double JFETf1; } *