TRAtemp

original_code:
int
TRAtemp(GENmodel *inModel, CKTcircuit *ckt)
{
    TRAmodel *model = (TRAmodel *)inModel;
    TRAinstance *here;
    for( ; model != ((void *)0); model = model->TRAnextModel ) {
        for (here = model->TRAinstances; here != ((void *)0) ;
                here=here->TRAnextInstance) {
     if (here->TRAowner != ARCHme) continue;
            if(!here->TRAtdGiven) {
                here->TRAtd = here->TRAnl/here->TRAf;
            }
            here->TRAconduct = 1/here->TRAimped;
        }
    }
    return(0);
}

canonical_original_code:
int TRAtemp(struct sGENmodel *inModel, struct CKTcircuit *ckt)
{
    struct sTRAmodel *model = (TRAmodel *)inModel;
    struct sTRAinstance *here;
    for( ; model != ((void *)0); model = model->TRAnextModel ) {
        for (here = model->TRAinstances; here != ((void *)0) ;
                here=here->TRAnextInstance) {
     if (here->TRAowner != ARCHme) continue;
            if(!here->TRAtdGiven) {
                here->TRAtd = here->TRAnl/here->TRAf;
            }
            here->TRAconduct = 1/here->TRAimped;
        }
    }
    return(0);
}

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

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

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

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


CAPgetic

repo: gserdyuk/gnucap-a

original_code:
int
CAPgetic(GENmodel *inModel, CKTcircuit *ckt)
{
    CAPmodel *model = (CAPmodel*)inModel;
    CAPinstance *here;
    for( ; model ; model = model->CAPnextModel) {
        for(here = model->CAPinstances; here ; here = here->CAPnextInstance) {
     if (here->CAPowner != ARCHme) continue;
            if(!here->CAPicGiven) {
                here->CAPinitCond =
                        *(ckt->CKTrhs + here->CAPposNode) -
                        *(ckt->CKTrhs + here->CAPnegNode);
            }
        }
    }
    return(0);
}

canonical_original_code:
int CAPgetic(struct sGENmodel *inModel, struct CKTcircuit *ckt)
{
    struct sCAPmodel *model = (CAPmodel*)inModel;
    struct sCAPinstance *here;
    for( ; model ; model = model->CAPnextModel) {
        for(here = model->CAPinstances; here ; here = here->CAPnextInstance) {
     if (here->CAPowner != ARCHme) continue;
            if(!here->CAPicGiven) {
                here->CAPinitCond =
                        *(ckt->CKTrhs + here->CAPposNode) -
                        *(ckt->CKTrhs + here->CAPnegNode);
            }
        }
    }
    return(0);
}

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

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

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


INDpzLoad

original_code:
int
INDpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
{
    INDmodel *model = (INDmodel*)inModel;
    double val;
    INDinstance *here;
    for( ; model != ((void *)0); model = model->INDnextModel) {
        for( here = model->INDinstances;here != ((void *)0);
                here = here->INDnextInstance) {
     if (here->INDowner != ARCHme) continue;
            val = here->INDinduct;
            *(here->INDposIbrptr) += 1;
            *(here->INDnegIbrptr) -= 1;
            *(here->INDibrPosptr) += 1;
            *(here->INDibrNegptr) -= 1;
            *(here->INDibrIbrptr ) -= val * s->real;
            *(here->INDibrIbrptr +1) -= val * s->imag;
        }
    }
    return(0);
}

canonical_original_code:
int INDpzLoad(struct sGENmodel *inModel, struct CKTcircuit *ckt, struct SPcomplex *s)
{
    struct sINDmodel *model = (INDmodel*)inModel;
    double val;
    struct sINDinstance *here;
    for( ; model != ((void *)0); model = model->INDnextModel) {
        for( here = model->INDinstances;here != ((void *)0);
                here = here->INDnextInstance) {
     if (here->INDowner != ARCHme) continue;
            val = here->INDinduct;
            *(here->INDposIbrptr) += 1;
            *(here->INDnegIbrptr) -= 1;
            *(here->INDibrPosptr) += 1;
            *(here->INDibrNegptr) -= 1;
            *(here->INDibrIbrptr ) -= val * s->real;
            *(here->INDibrIbrptr +1) -= val * s->imag;
        }
    }
    return(0);
}

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

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

variable_types: val double

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


URCask

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

switch ( a3 )
{
case 1:
result = 0LL;
*a4 = *(_QWORD *)(a2 + 40);
break;
case 2:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 48);
result = 0LL;
break;
case 3:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 28);
result = 0LL;
break;
case 4:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 32);
result = 0LL;
break;
case 5:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 36);
result = 0LL;
break;
default:
result = 7LL;
break;
}
return result;
}

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

switch ( a3 )
{
case 1:
result = 0LL;
*a4 = *(_QWORD *)(a2 + 40);
break;
case 2:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 48);
result = 0LL;
break;
case 3:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 28);
result = 0LL;
break;
case 4:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 32);
result = 0LL;
break;
case 5:
*(_DWORD *)a4 = *(_DWORD *)(a2 + 36);
result = 0LL;
break;
default:
result = 7LL;
break;
}
return result;
}

original_code:
int
URCask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *select)
{
    URCinstance *here = (URCinstance *)inst;
    switch(which) {
        case 3:
            value->iValue = here->URCposNode;
            return (0);
        case 4:
            value->iValue = here->URCnegNode;
            return (0);
        case 5:
            value->iValue = here->URCgndNode;
            return (0);
        case 1:
            value->rValue = here->URClength;
            return (0);
        case 2:
            value->iValue = here->URClumps;
            return (0);
        default:
            return (7);
    }
}

canonical_original_code:
int URCask(struct CKTcircuit *ckt, struct sGENinstance *inst, int which, union uIFvalue *value, union uIFvalue *select)
{
    struct sURCinstance *here = (URCinstance *)inst;
    switch(which) {
        case 3:
            value->iValue = here->URCposNode;
            return (0);
        case 4:
            value->iValue = here->URCnegNode;
            return (0);
        case 5:
            value->iValue = here->URCgndNode;
            return (0);
        case 1:
            value->rValue = here->URClength;
            return (0);
        case 2:
            value->iValue = here->URClumps;
            return (0);
        default:
            return (7);
    }
}

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

variable_types:
inst
struct sGENinstance *

variable_types: 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:
select
union uIFvalue *

variable_types: struct sURCinstance { struct sURCmodel { int URCmodType; struct sURCmodel *URCnextModel; struct sURCinstance *URCinstances; char *URCmodName; double URCk; double URCfmax; double URCrPerL; double URCcPerL; double URCisPerL; double URCrsPerL; unsigned int URCkGiven; unsigned int URCfmaxGiven; unsigned int URCrPerLGiven; unsigned int URCcPerLGiven; unsigned int URCisPerLGiven; unsigned int URCrsPerLGiven; } *URCmodPtr; struct sURCinstance *URCnextInstance; char *URCname; int URCowner; int URCstate; int URCposNode; int URCnegNode; int URCgndNode; double URClength; int URClumps; unsigned int URClenGiven; unsigned int URClumpsGiven; } *

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 sURCinstance { struct sURCmodel *URCmodPtr; struct sURCinstance *URCnextInstance; char *URCname; int URCowner; int URCstate; int URCposNode; int URCnegNode; int URCgndNode; double URClength; int URClumps; unsigned int URClenGiven; unsigned int URClumpsGiven; }


DIOask

original_code:
int
DIOask (CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
        IFvalue *select)
{
    DIOinstance *here = (DIOinstance*)inst;
    double vr;
    double vi;
    double sr;
    double si;
    double vm;
    static char *msg = "Current and power not available for ac analysis";
    switch (which) {
        case 3:
            value->iValue = here->DIOoff;
            return(0);
        case 2:
            value->rValue = here->DIOinitCond;
            return(0);
        case 1:
            value->rValue = here->DIOarea;
            return(0);
        case 19:
            value->rValue = here->DIOpj;
            return(0);
        case 20:
            value->rValue = here->DIOm;
            return(0);
        case 11:
            value->rValue = here->DIOtemp-(273.15);
            return(0);
 case 21:
            value->rValue = here->DIOdtemp;
            return(0);
        case 5:
            value->rValue = *(ckt->CKTstates[0]+here->DIOstate);
            return(0);
        case 4:
            value->rValue = *(ckt->CKTstates[0]+here->DIOstate+1);
            return(0);
        case 18:
            value->rValue = here->DIOcap;
            return(0);
        case 6:
            value->rValue = *(ckt->CKTstates[0]+here->DIOstate+3);
            return(0);
        case 7:
            value->rValue = *(ckt->CKTstates[0]+here->DIOstate+4);
            return(0);
        case 8:
            value->rValue = *(ckt->CKTstates[0]+here->DIOstate+2);
            return(0);
        case 10 :
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned)(strlen(msg)+1));
                errRtn = "DIOask";
                strcpy(errMsg,msg);
                return((100 +12));
            } else {
                value->rValue = *(ckt->CKTstates[0] + here->DIOstate+1) *
                        *(ckt->CKTstates[0] + here->DIOstate);
            }
            return(0);
        case 17:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
                here->DIOsenParmNo);
            }
            return(0);
        case 12:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                here->DIOsenParmNo);
            }
            return(0);
        case 13:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                here->DIOsenParmNo);
            }
            return(0);
        case 14:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = sqrt(vr*vr + vi*vi);
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->DIOsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->DIOsenParmNo);
                value->rValue = (vr * sr + vi * si)/vm;
            }
            return(0);
        case 15:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = vr*vr + vi*vi;
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->DIOsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->DIOsenParmNo);
                value->rValue = (vr * si - vi * sr)/vm;
            }
            return(0);
        case 16:
            if(ckt->CKTsenInfo){
                value->cValue.real=
                        *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->DIOsenParmNo);
                value->cValue.imag=
                        *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->DIOsenParmNo);
            }
            return(0);
        default:
            return(7);
        }
}

canonical_original_code:
int DIOask(struct CKTcircuit *ckt, struct sGENinstance *inst, int which, union uIFvalue *value, union uIFvalue *select)
{
    struct sDIOinstance *here = (DIOinstance*)inst;
    double vr;
    double vi;
    double sr;
    double si;
    double vm;
    static char *msg = "Current and power not available for ac analysis";
    switch (which) {
        case 3:
            value->iValue = here->DIOoff;
            return(0);
        case 2:
            value->rValue = here->DIOinitCond;
            return(0);
        case 1:
            value->rValue = here->DIOarea;
            return(0);
        case 19:
            value->rValue = here->DIOpj;
            return(0);
        case 20:
            value->rValue = here->DIOm;
            return(0);
        case 11:
            value->rValue = here->DIOtemp-(273.15);
            return(0);
 case 21:
            value->rValue = here->DIOdtemp;
            return(0);
        case 5:
            value->rValue = *(ckt->CKTstates[0]+here->DIOstate);
            return(0);
        case 4:
            value->rValue = *(ckt->CKTstates[0]+here->DIOstate+1);
            return(0);
        case 18:
            value->rValue = here->DIOcap;
            return(0);
        case 6:
            value->rValue = *(ckt->CKTstates[0]+here->DIOstate+3);
            return(0);
        case 7:
            value->rValue = *(ckt->CKTstates[0]+here->DIOstate+4);
            return(0);
        case 8:
            value->rValue = *(ckt->CKTstates[0]+here->DIOstate+2);
            return(0);
        case 10 :
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned int)(strlen(msg)+1));
                errRtn = "DIOask";
                strcpy(errMsg,msg);
                return((100 +12));
            } else {
                value->rValue = *(ckt->CKTstates[0] + here->DIOstate+1) *
                        *(ckt->CKTstates[0] + here->DIOstate);
            }
            return(0);
        case 17:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
                here->DIOsenParmNo);
            }
            return(0);
        case 12:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                here->DIOsenParmNo);
            }
            return(0);
        case 13:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                here->DIOsenParmNo);
            }
            return(0);
        case 14:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = sqrt(vr*vr + vi*vi);
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->DIOsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->DIOsenParmNo);
                value->rValue = (vr * sr + vi * si)/vm;
            }
            return(0);
        case 15:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = vr*vr + vi*vi;
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->DIOsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->DIOsenParmNo);
                value->rValue = (vr * si - vi * sr)/vm;
            }
            return(0);
        case 16:
            if(ckt->CKTsenInfo){
                value->cValue.real=
                        *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->DIOsenParmNo);
                value->cValue.imag=
                        *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->DIOsenParmNo);
            }
            return(0);
        default:
            return(7);
        }
}

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

variable_types: vr double

variable_types: vi double

variable_types: sr double

variable_types: si double

variable_types: vm double

variable_types:
msg
char *

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


MUTask

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

if ( a3 == 402 )
{
*a4 = a2[5];
result = 0LL;
}
else if ( a3 == 403 )
{
*a4 = a2[6];
result = 0LL;
}
else
{
result = 7LL;
if ( a3 == 401 )
{
result = 0LL;
*a4 = a2[4];
}
}
return result;
}

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

if ( a3 == 402 )
{
*a4 = a2[5];
result = 0LL;
}
else if ( a3 == 403 )
{
*a4 = a2[6];
result = 0LL;
}
else
{
result = 7LL;
if ( a3 == 401 )
{
result = 0LL;
*a4 = a2[4];
}
}
return result;
}

original_code:
int
MUTask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
       IFvalue *select)
{
    MUTinstance *here = (MUTinstance*)inst;
    double vr;
    double vi;
    double sr;
    double si;
    double vm;
    switch(which) {
        case 401:
            value->rValue = here->MUTfactor;
            return(0);
        case 402:
            value->uValue = here->MUTindName1;
            return(0);
        case 403:
            value->uValue = here->MUTindName2;
            return(0);
        case 606:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
                        here->MUTsenParmNo);
            }
            return(0);
        case 601:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->MUTsenParmNo);
            }
            return(0);
        case 602:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->MUTsenParmNo);
            }
            return(0);
        case 603:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = sqrt(vr*vr + vi*vi);
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->MUTsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->MUTsenParmNo);
                value->rValue = (vr * sr + vi * si)/vm;
            }
            return(0);
        case 604:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = vr*vr + vi*vi;
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->MUTsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->MUTsenParmNo);
                value->rValue = (vr * si - vi * sr)/vm;
            }
            return(0);
        case 605:
            if(ckt->CKTsenInfo){
                value->cValue.real=
                        *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->MUTsenParmNo);
                value->cValue.imag=
                        *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->MUTsenParmNo);
            }
            return(0);
        default:
            return(7);
    }
}

canonical_original_code:
int MUTask(struct CKTcircuit *ckt, struct sGENinstance *inst, int which, union uIFvalue *value, union uIFvalue *select)
{
    struct sMUTinstance *here = (MUTinstance*)inst;
    double vr;
    double vi;
    double sr;
    double si;
    double vm;
    switch(which) {
        case 401:
            value->rValue = here->MUTfactor;
            return(0);
        case 402:
            value->uValue = here->MUTindName1;
            return(0);
        case 403:
            value->uValue = here->MUTindName2;
            return(0);
        case 606:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
                        here->MUTsenParmNo);
            }
            return(0);
        case 601:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->MUTsenParmNo);
            }
            return(0);
        case 602:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->MUTsenParmNo);
            }
            return(0);
        case 603:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = sqrt(vr*vr + vi*vi);
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->MUTsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->MUTsenParmNo);
                value->rValue = (vr * sr + vi * si)/vm;
            }
            return(0);
        case 604:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = vr*vr + vi*vi;
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->MUTsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->MUTsenParmNo);
                value->rValue = (vr * si - vi * sr)/vm;
            }
            return(0);
        case 605:
            if(ckt->CKTsenInfo){
                value->cValue.real=
                        *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        here->MUTsenParmNo);
                value->cValue.imag=
                        *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        here->MUTsenParmNo);
            }
            return(0);
        default:
            return(7);
    }
}

variable_types: struct sMUTinstance { struct sMUTmodel { int MUTmodType; struct sMUTmodel *MUTnextModel; struct sMUTinstance *MUTinstances; char *MUTmodName; } *MUTmodPtr; struct sMUTinstance *MUTnextInstance; char *MUTname; int MUTowner; double MUTcoupling; double MUTfactor; char *MUTindName1; char *MUTindName2; struct sINDinstance { struct sINDmodel { int INDmodType; struct sINDmodel *INDnextModel; struct sINDinstance *INDinstances; char *INDmodName; double INDmInd; double INDtnom; double INDtempCoeff1; double INDtempCoeff2; double INDcsect; double INDlength; double INDmodNt; double INDmu; unsigned int INDtnomGiven; unsigned int INDtc1Given; unsigned int INDtc2Given; unsigned int INDcsectGiven; unsigned int INDlengthGiven; unsigned int INDmodNtGiven; unsigned int INDmuGiven; unsigned int INDmIndGiven; double INDspecInd; } *INDmodPtr; struct sINDinstance *INDnextInstance; char *INDname; int INDowner; int INDstate; int INDposNode; int INDnegNode; int INDbrEq; double INDinduct; double INDm; double INDtemp; double INDdtemp; double INDscale; double INDnt; double INDinitCond; double *INDposIbrptr; double *INDnegIbrptr; double *INDibrNegptr; double *INDibrPosptr; double *INDibrIbrptr; unsigned int INDindGiven; unsigned int INDicGiven; unsigned int INDmGiven; unsigned int INDtempGiven; unsigned int INDdtempGiven; unsigned int INDscaleGiven; unsigned int INDntGiven; int INDsenParmNo; } *MUTind1; struct sINDinstance *MUTind2; double *MUTbr1br2; double *MUTbr2br1; unsigned int MUTindGiven; int MUTsenParmNo; } *

user_defined_types: struct sMUTinstance { struct sMUTmodel *MUTmodPtr; struct sMUTinstance *MUTnextInstance; char *MUTname; int MUTowner; double MUTcoupling; double MUTfactor; char *MUTindName1; char *MUTindName2; struct sINDinstance *MUTind1; struct sINDinstance *MUTind2; double *MUTbr1br2; double *MUTbr2br1; unsigned int MUTindGiven; int MUTsenParmNo; }

user_defined_types: struct sINDinstance { struct sINDmodel *INDmodPtr; struct sINDinstance *INDnextInstance; char *INDname; int INDowner; int INDstate; int INDposNode; int INDnegNode; int INDbrEq; double INDinduct; double INDm; double INDtemp; double INDdtemp; double INDscale; double INDnt; double INDinitCond; double *INDposIbrptr; double *INDnegIbrptr; double *INDibrNegptr; double *INDibrPosptr; double *INDibrIbrptr; unsigned int INDindGiven; unsigned int INDicGiven; unsigned int INDmGiven; unsigned int INDtempGiven; unsigned int INDdtempGiven; unsigned int INDscaleGiven; unsigned int INDntGiven; int INDsenParmNo; }


TRAsetup

original_code:
int
TRAsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state)
{
    TRAmodel *model = (TRAmodel *)inModel;
    TRAinstance *here;
    int error;
    CKTnode *tmp;
    for( ; model != ((void *)0); model = model->TRAnextModel ) {
        for (here = model->TRAinstances; here != ((void *)0) ;
                here=here->TRAnextInstance) {
            if(here->TRAbrEq1==0) {
                error = CKTmkVolt(ckt,&tmp,here->TRAname,"i1");
                if(error) return(error);
                here->TRAbrEq1 = tmp->number;
            }
            if(here->TRAbrEq2==0) {
                error = CKTmkVolt(ckt,&tmp,here->TRAname,"i2");
                if(error) return(error);
                here->TRAbrEq2 = tmp->number;
            }
            if(here->TRAintNode1==0) {
                error = CKTmkVolt(ckt,&tmp,here->TRAname,"int1");
                if(error) return(error);
                here->TRAintNode1 = tmp->number;
            }
            if(here->TRAintNode2==0) {
                error = CKTmkVolt(ckt,&tmp,here->TRAname,"int2");
                if(error) return(error);
                here->TRAintNode2 = tmp->number;
            }
            here->TRAdelays = (double *)tmalloc((unsigned)(15*sizeof(double)));
            here->TRAallocDelay = 4;
            if((here->TRAibr1Ibr2Ptr = SMPmakeElt(matrix,here->TRAbrEq1,here->TRAbrEq2))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr1Int1Ptr = SMPmakeElt(matrix,here->TRAbrEq1,here->TRAintNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr1Neg1Ptr = SMPmakeElt(matrix,here->TRAbrEq1,here->TRAnegNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr1Neg2Ptr = SMPmakeElt(matrix,here->TRAbrEq1,here->TRAnegNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr1Pos2Ptr = SMPmakeElt(matrix,here->TRAbrEq1,here->TRAposNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr2Ibr1Ptr = SMPmakeElt(matrix,here->TRAbrEq2,here->TRAbrEq1))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr2Int2Ptr = SMPmakeElt(matrix,here->TRAbrEq2,here->TRAintNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr2Neg1Ptr = SMPmakeElt(matrix,here->TRAbrEq2,here->TRAnegNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr2Neg2Ptr = SMPmakeElt(matrix,here->TRAbrEq2,here->TRAnegNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr2Pos1Ptr = SMPmakeElt(matrix,here->TRAbrEq2,here->TRAposNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRAint1Ibr1Ptr = SMPmakeElt(matrix,here->TRAintNode1,here->TRAbrEq1))==(double *)((void *)0)){ return(8);}
            if((here->TRAint1Int1Ptr = SMPmakeElt(matrix,here->TRAintNode1,here->TRAintNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRAint1Pos1Ptr = SMPmakeElt(matrix,here->TRAintNode1,here->TRAposNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRAint2Ibr2Ptr = SMPmakeElt(matrix,here->TRAintNode2,here->TRAbrEq2))==(double *)((void *)0)){ return(8);}
            if((here->TRAint2Int2Ptr = SMPmakeElt(matrix,here->TRAintNode2,here->TRAintNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRAint2Pos2Ptr = SMPmakeElt(matrix,here->TRAintNode2,here->TRAposNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRAneg1Ibr1Ptr = SMPmakeElt(matrix,here->TRAnegNode1,here->TRAbrEq1))==(double *)((void *)0)){ return(8);}
            if((here->TRAneg2Ibr2Ptr = SMPmakeElt(matrix,here->TRAnegNode2,here->TRAbrEq2))==(double *)((void *)0)){ return(8);}
            if((here->TRApos1Int1Ptr = SMPmakeElt(matrix,here->TRAposNode1,here->TRAintNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRApos1Pos1Ptr = SMPmakeElt(matrix,here->TRAposNode1,here->TRAposNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRApos2Int2Ptr = SMPmakeElt(matrix,here->TRAposNode2,here->TRAintNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRApos2Pos2Ptr = SMPmakeElt(matrix,here->TRAposNode2,here->TRAposNode2))==(double *)((void *)0)){ return(8);}
            if(!here->TRAnlGiven) {
                here->TRAnl = .25;
            }
            if(!here->TRAfGiven) {
                here->TRAf = 1e9;
            }
            if(!here->TRAreltolGiven) {
                here->TRAreltol = 1;
            }
            if(!here->TRAabstolGiven) {
                here->TRAabstol = 1;
            }
            if(!here->TRAimpedGiven) {
                (*(SPfrontEnd->IFerror))(0x2,
                        "%s: transmission line z0 must be given",
                        &(here->TRAname));
                return(7);
            }
        }
    }
    return(0);
}

canonical_original_code:
int TRAsetup(void *matrix, struct sGENmodel *inModel, struct CKTcircuit *ckt, int *state)
{
    struct sTRAmodel *model = (TRAmodel *)inModel;
    struct sTRAinstance *here;
    int error;
    struct sCKTnode *tmp;
    for( ; model != ((void *)0); model = model->TRAnextModel ) {
        for (here = model->TRAinstances; here != ((void *)0) ;
                here=here->TRAnextInstance) {
            if(here->TRAbrEq1==0) {
                error = CKTmkVolt(ckt,&tmp,here->TRAname,"i1");
                if(error) return(error);
                here->TRAbrEq1 = tmp->number;
            }
            if(here->TRAbrEq2==0) {
                error = CKTmkVolt(ckt,&tmp,here->TRAname,"i2");
                if(error) return(error);
                here->TRAbrEq2 = tmp->number;
            }
            if(here->TRAintNode1==0) {
                error = CKTmkVolt(ckt,&tmp,here->TRAname,"int1");
                if(error) return(error);
                here->TRAintNode1 = tmp->number;
            }
            if(here->TRAintNode2==0) {
                error = CKTmkVolt(ckt,&tmp,here->TRAname,"int2");
                if(error) return(error);
                here->TRAintNode2 = tmp->number;
            }
            here->TRAdelays = (double *)tmalloc((unsigned int)(15*sizeof(double)));
            here->TRAallocDelay = 4;
            if((here->TRAibr1Ibr2Ptr = SMPmakeElt(matrix,here->TRAbrEq1,here->TRAbrEq2))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr1Int1Ptr = SMPmakeElt(matrix,here->TRAbrEq1,here->TRAintNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr1Neg1Ptr = SMPmakeElt(matrix,here->TRAbrEq1,here->TRAnegNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr1Neg2Ptr = SMPmakeElt(matrix,here->TRAbrEq1,here->TRAnegNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr1Pos2Ptr = SMPmakeElt(matrix,here->TRAbrEq1,here->TRAposNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr2Ibr1Ptr = SMPmakeElt(matrix,here->TRAbrEq2,here->TRAbrEq1))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr2Int2Ptr = SMPmakeElt(matrix,here->TRAbrEq2,here->TRAintNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr2Neg1Ptr = SMPmakeElt(matrix,here->TRAbrEq2,here->TRAnegNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr2Neg2Ptr = SMPmakeElt(matrix,here->TRAbrEq2,here->TRAnegNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRAibr2Pos1Ptr = SMPmakeElt(matrix,here->TRAbrEq2,here->TRAposNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRAint1Ibr1Ptr = SMPmakeElt(matrix,here->TRAintNode1,here->TRAbrEq1))==(double *)((void *)0)){ return(8);}
            if((here->TRAint1Int1Ptr = SMPmakeElt(matrix,here->TRAintNode1,here->TRAintNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRAint1Pos1Ptr = SMPmakeElt(matrix,here->TRAintNode1,here->TRAposNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRAint2Ibr2Ptr = SMPmakeElt(matrix,here->TRAintNode2,here->TRAbrEq2))==(double *)((void *)0)){ return(8);}
            if((here->TRAint2Int2Ptr = SMPmakeElt(matrix,here->TRAintNode2,here->TRAintNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRAint2Pos2Ptr = SMPmakeElt(matrix,here->TRAintNode2,here->TRAposNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRAneg1Ibr1Ptr = SMPmakeElt(matrix,here->TRAnegNode1,here->TRAbrEq1))==(double *)((void *)0)){ return(8);}
            if((here->TRAneg2Ibr2Ptr = SMPmakeElt(matrix,here->TRAnegNode2,here->TRAbrEq2))==(double *)((void *)0)){ return(8);}
            if((here->TRApos1Int1Ptr = SMPmakeElt(matrix,here->TRAposNode1,here->TRAintNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRApos1Pos1Ptr = SMPmakeElt(matrix,here->TRAposNode1,here->TRAposNode1))==(double *)((void *)0)){ return(8);}
            if((here->TRApos2Int2Ptr = SMPmakeElt(matrix,here->TRAposNode2,here->TRAintNode2))==(double *)((void *)0)){ return(8);}
            if((here->TRApos2Pos2Ptr = SMPmakeElt(matrix,here->TRAposNode2,here->TRAposNode2))==(double *)((void *)0)){ return(8);}
            if(!here->TRAnlGiven) {
                here->TRAnl = .25;
            }
            if(!here->TRAfGiven) {
                here->TRAf = 1e9;
            }
            if(!here->TRAreltolGiven) {
                here->TRAreltol = 1;
            }
            if(!here->TRAabstolGiven) {
                here->TRAabstol = 1;
            }
            if(!here->TRAimpedGiven) {
                (*(SPfrontEnd->IFerror))(0x2,
                        "%s: transmission line z0 must be given",
                        &(here->TRAname));
                return(7);
            }
        }
    }
    return(0);
}

variable_types:
matrix
void *

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:
state
int *

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

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

variable_types: error int


URCparam

decompiled_code:
__int64 __fastcall URCparam(__int64 a1, int a2, double *a3, __int64 a4)
{
int v4; // eax
__int64 result; // rax
double v6; // xmm0_8

if ( a2 == 1 )
{
v6 = *a3;
result = 0LL;
*(_BYTE *)(a4 + 52) |= 1u;
*(double *)(a4 + 40) = v6;
}
else if ( a2 == 2 )
{
v4 = (int)*a3;
*(_BYTE *)(a4 + 52) |= 2u;
*(_DWORD *)(a4 + 48) = v4;
result = 0LL;
}
else
{
result = 7LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, int a2, double *a3, __int64 a4)
{
int v4; // eax
__int64 result; // rax
double v6; // xmm0_8

if ( a2 == 1 )
{
v6 = *a3;
result = 0LL;
*(_BYTE *)(a4 + 52) |= 1u;
*(double *)(a4 + 40) = v6;
}
else if ( a2 == 2 )
{
v4 = (int)*a3;
*(_BYTE *)(a4 + 52) |= 2u;
*(_DWORD *)(a4 + 48) = v4;
result = 0LL;
}
else
{
result = 7LL;
}
return result;
}

original_code:
int
URCparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
{
    URCinstance *here = (URCinstance *)inst;
    switch(param) {
        case 1:
            here->URClength = value->rValue;
            here->URClenGiven = 1;
            break;
        case 2:
            here->URClumps = value->rValue;
            here->URClumpsGiven = 1;
            break;
        default:
            return(7);
    }
    return(0);
}

canonical_original_code:
int URCparam(int param, union uIFvalue *value, struct sGENinstance *inst, union uIFvalue *select)
{
    struct sURCinstance *here = (URCinstance *)inst;
    switch(param) {
        case 1:
            here->URClength = value->rValue;
            here->URClenGiven = 1;
            break;
        case 2:
            here->URClumps = value->rValue;
            here->URClumpsGiven = 1;
            break;
        default:
            return(7);
    }
    return(0);
}

variable_types: param 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 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 *

user_defined_types: struct sURCmodel { int URCmodType; struct sURCmodel *URCnextModel; struct sURCinstance *URCinstances; char *URCmodName; double URCk; double URCfmax; double URCrPerL; double URCcPerL; double URCisPerL; double URCrsPerL; unsigned int URCkGiven; unsigned int URCfmaxGiven; unsigned int URCrPerLGiven; unsigned int URCcPerLGiven; unsigned int URCisPerLGiven; unsigned int URCrsPerLGiven; }


CAPload

original_code:
int
CAPload(GENmodel *inModel, CKTcircuit *ckt)
{
    CAPmodel *model = (CAPmodel*)inModel;
    CAPinstance *here;
    int cond1;
    double vcap;
    double geq;
    double ceq;
    int error;
    double m;
    if(ckt->CKTmode & (0x1|0x2|0x20) ) {
        cond1=
            ( ( (ckt->CKTmode & 0x70) &&
                (ckt->CKTmode & 0x200) )
            || ( ( ckt->CKTmode & 0x10000l) &&
                ( ckt->CKTmode & 0x1000) ) ) ;
        for( ; model != ((void *)0); model = model->CAPnextModel ) {
            for (here = model->CAPinstances; here != ((void *)0) ;
                    here=here->CAPnextInstance) {
  if (here->CAPowner != ARCHme) continue;
  m = here->CAPm;
                if(cond1) {
                    vcap = here->CAPinitCond;
                } else {
                    vcap = *(ckt->CKTrhsOld+here->CAPposNode) -
                        *(ckt->CKTrhsOld+here->CAPnegNode) ;
                }
                if(ckt->CKTmode & (0x1 | 0x2)) {
                        *(ckt->CKTstates[0]+here->CAPstate) = here->CAPcapac * vcap;
                        if((ckt->CKTmode & 0x1000)) {
                            *(ckt->CKTstates[1]+here->CAPstate) =
                                *(ckt->CKTstates[0]+here->CAPstate);
                        }
                    error = NIintegrate(ckt,&geq,&ceq,here->CAPcapac,
                            here->CAPstate);
                    if(error) return(error);
                    if(ckt->CKTmode & 0x1000) {
                        *(ckt->CKTstates[1]+here->CAPstate+1) =
                            *(ckt->CKTstates[0]+here->CAPstate+1);
                    }
                    *(here->CAPposPosptr) += m * geq;
                    *(here->CAPnegNegptr) += m * geq;
                    *(here->CAPposNegptr) -= m * geq;
                    *(here->CAPnegPosptr) -= m * geq;
                    *(ckt->CKTrhs+here->CAPposNode) -= m * ceq;
                    *(ckt->CKTrhs+here->CAPnegNode) += m * ceq;
                } else
      *(ckt->CKTstates[0]+here->CAPstate) = here->CAPcapac * vcap;
            }
        }
    }
    return(0);
}

canonical_original_code:
int CAPload(struct sGENmodel *inModel, struct CKTcircuit *ckt)
{
    struct sCAPmodel *model = (CAPmodel*)inModel;
    struct sCAPinstance *here;
    int cond1;
    double vcap;
    double geq;
    double ceq;
    int error;
    double m;
    if(ckt->CKTmode & (0x1|0x2|0x20) ) {
        cond1=
            ( ( (ckt->CKTmode & 0x70) &&
                (ckt->CKTmode & 0x200) )
            || ( ( ckt->CKTmode & 0x10000l) &&
                ( ckt->CKTmode & 0x1000) ) ) ;
        for( ; model != ((void *)0); model = model->CAPnextModel ) {
            for (here = model->CAPinstances; here != ((void *)0) ;
                    here=here->CAPnextInstance) {
  if (here->CAPowner != ARCHme) continue;
  m = here->CAPm;
                if(cond1) {
                    vcap = here->CAPinitCond;
                } else {
                    vcap = *(ckt->CKTrhsOld+here->CAPposNode) -
                        *(ckt->CKTrhsOld+here->CAPnegNode) ;
                }
                if(ckt->CKTmode & (0x1 | 0x2)) {
                        *(ckt->CKTstates[0]+here->CAPstate) = here->CAPcapac * vcap;
                        if((ckt->CKTmode & 0x1000)) {
                            *(ckt->CKTstates[1]+here->CAPstate) =
                                *(ckt->CKTstates[0]+here->CAPstate);
                        }
                    error = NIintegrate(ckt,&geq,&ceq,here->CAPcapac,
                            here->CAPstate);
                    if(error) return(error);
                    if(ckt->CKTmode & 0x1000) {
                        *(ckt->CKTstates[1]+here->CAPstate+1) =
                            *(ckt->CKTstates[0]+here->CAPstate+1);
                    }
                    *(here->CAPposPosptr) += m * geq;
                    *(here->CAPnegNegptr) += m * geq;
                    *(here->CAPposNegptr) -= m * geq;
                    *(here->CAPnegPosptr) -= m * geq;
                    *(ckt->CKTrhs+here->CAPposNode) -= m * ceq;
                    *(ckt->CKTrhs+here->CAPnegNode) += m * ceq;
                } else
      *(ckt->CKTstates[0]+here->CAPstate) = here->CAPcapac * vcap;
            }
        }
    }
    return(0);
}

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

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

variable_types: vcap double

variable_types: geq double

variable_types: ceq double

variable_types: m double