original_code:
int
B1param(int param, IFvalue *value, GENinstance *inst,
        IFvalue *select)
{
    B1instance *here = (B1instance*)inst;
    switch(param) {
        case 1:
            here->B1w = value->rValue;
            here->B1wGiven = 1;
            break;
        case 2:
            here->B1l = value->rValue;
            here->B1lGiven = 1;
            break;
        case 14:
            here->B1m = value->rValue;
            here->B1mGiven = 1;
            break;
        case 3:
            here->B1sourceArea = value->rValue;
            here->B1sourceAreaGiven = 1;
            break;
        case 4:
            here->B1drainArea = value->rValue;
            here->B1drainAreaGiven = 1;
            break;
        case 5:
            here->B1sourcePerimeter = value->rValue;
            here->B1sourcePerimeterGiven = 1;
            break;
        case 6:
            here->B1drainPerimeter = value->rValue;
            here->B1drainPerimeterGiven = 1;
            break;
        case 7:
            here->B1sourceSquares = value->rValue;
            here->B1sourceSquaresGiven = 1;
            break;
        case 8:
            here->B1drainSquares = value->rValue;
            here->B1drainSquaresGiven = 1;
            break;
        case 9:
            here->B1off = value->iValue;
            break;
        case 10:
            here->B1icVBS = value->rValue;
            here->B1icVBSGiven = 1;
            break;
        case 11:
            here->B1icVDS = value->rValue;
            here->B1icVDSGiven = 1;
            break;
        case 12:
            here->B1icVGS = value->rValue;
            here->B1icVGSGiven = 1;
            break;
        case 13:
            switch(value->v.numValue){
                case 3:
                    here->B1icVBS = *(value->v.vec.rVec+2);
                    here->B1icVBSGiven = 1;
                case 2:
                    here->B1icVGS = *(value->v.vec.rVec+1);
                    here->B1icVGSGiven = 1;
                case 1:
                    here->B1icVDS = *(value->v.vec.rVec);
                    here->B1icVDSGiven = 1;
                    break;
                default:
                    return(7);
            }
            break;
        default:
            return(7);
    }
    return(0);
}

canonical_original_code:
int B1param(int param, union uIFvalue *value, struct sGENinstance *inst, union uIFvalue *select)
{
    struct sBSIM1instance *here = (B1instance*)inst;
    switch(param) {
        case 1:
            here->B1w = value->rValue;
            here->B1wGiven = 1;
            break;
        case 2:
            here->B1l = value->rValue;
            here->B1lGiven = 1;
            break;
        case 14:
            here->B1m = value->rValue;
            here->B1mGiven = 1;
            break;
        case 3:
            here->B1sourceArea = value->rValue;
            here->B1sourceAreaGiven = 1;
            break;
        case 4:
            here->B1drainArea = value->rValue;
            here->B1drainAreaGiven = 1;
            break;
        case 5:
            here->B1sourcePerimeter = value->rValue;
            here->B1sourcePerimeterGiven = 1;
            break;
        case 6:
            here->B1drainPerimeter = value->rValue;
            here->B1drainPerimeterGiven = 1;
            break;
        case 7:
            here->B1sourceSquares = value->rValue;
            here->B1sourceSquaresGiven = 1;
            break;
        case 8:
            here->B1drainSquares = value->rValue;
            here->B1drainSquaresGiven = 1;
            break;
        case 9:
            here->B1off = value->iValue;
            break;
        case 10:
            here->B1icVBS = value->rValue;
            here->B1icVBSGiven = 1;
            break;
        case 11:
            here->B1icVDS = value->rValue;
            here->B1icVDSGiven = 1;
            break;
        case 12:
            here->B1icVGS = value->rValue;
            here->B1icVGSGiven = 1;
            break;
        case 13:
            switch(value->v.numValue){
                case 3:
                    here->B1icVBS = *(value->v.vec.rVec+2);
                    here->B1icVBSGiven = 1;
                case 2:
                    here->B1icVGS = *(value->v.vec.rVec+1);
                    here->B1icVGSGiven = 1;
                case 1:
                    here->B1icVDS = *(value->v.vec.rVec);
                    here->B1icVDSGiven = 1;
                    break;
                default:
                    return(7);
            }
            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 *


JFETmAsk

repo: gserdyuk/gnucap-a

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

if ( a3 > 116 )
{
switch ( a3 )
{
case 302:
result = 0LL;
*a4 = *(double *)(a2 + 144);
break;
case 305:
if ( *(_DWORD *)(a2 + 32) == 1 )
*(_QWORD *)a4 = &LC0;
else
*(_QWORD *)a4 = &LC1;
result = 0LL;
break;
case 301:
result = 0LL;
*a4 = *(double *)(a2 + 136);
break;
default:
LABEL_9:
result = 7LL;
break;
}
}
else
{
result = 7LL;
if ( a3 > 100 )
{
switch ( a3 )
{
case 'e':
result = 0LL;
*a4 = *(double *)(a2 + 40);
break;
case 'f':
result = 0LL;
*a4 = *(double *)(a2 + 48);
break;
case 'g':
result = 0LL;
*a4 = *(double *)(a2 + 56);
break;
case 'h':
result = 0LL;
*a4 = *(double *)(a2 + 64);
break;
case 'i':
result = 0LL;
*a4 = *(double *)(a2 + 72);
break;
case 'j':
result = 0LL;
*a4 = *(double *)(a2 + 80);
break;
case 'k':
result = 0LL;
*a4 = *(double *)(a2 + 88);
break;
case 'l':
result = 0LL;
*a4 = *(double *)(a2 + 96);
break;
case 'm':
result = 0LL;
*a4 = *(double *)(a2 + 104);
break;
case 'n':
result = 0LL;
*a4 = *(double *)(a2 + 112);
break;
case 'q':
result = 0LL;
*a4 = *(double *)(a2 + 184) - 273.15;
break;
case 't':
result = 0LL;
*a4 = *(double *)(a2 + 168);
break;
default:
goto LABEL_9;
}
}
}
return result;
}

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

if ( a3 > 116 )
{
switch ( a3 )
{
case 302:
result = 0LL;
*a4 = *(double *)(a2 + 144);
break;
case 305:
if ( *(_DWORD *)(a2 + 32) == 1 )
*(_QWORD *)a4 = &LC0;
else
*(_QWORD *)a4 = &LC1;
result = 0LL;
break;
case 301:
result = 0LL;
*a4 = *(double *)(a2 + 136);
break;
default:
LABEL_9:
result = 7LL;
break;
}
}
else
{
result = 7LL;
if ( a3 > 100 )
{
switch ( a3 )
{
case 'e':
result = 0LL;
*a4 = *(double *)(a2 + 40);
break;
case 'f':
result = 0LL;
*a4 = *(double *)(a2 + 48);
break;
case 'g':
result = 0LL;
*a4 = *(double *)(a2 + 56);
break;
case 'h':
result = 0LL;
*a4 = *(double *)(a2 + 64);
break;
case 'i':
result = 0LL;
*a4 = *(double *)(a2 + 72);
break;
case 'j':
result = 0LL;
*a4 = *(double *)(a2 + 80);
break;
case 'k':
result = 0LL;
*a4 = *(double *)(a2 + 88);
break;
case 'l':
result = 0LL;
*a4 = *(double *)(a2 + 96);
break;
case 'm':
result = 0LL;
*a4 = *(double *)(a2 + 104);
break;
case 'n':
result = 0LL;
*a4 = *(double *)(a2 + 112);
break;
case 'q':
result = 0LL;
*a4 = *(double *)(a2 + 184) - 273.15;
break;
case 't':
result = 0LL;
*a4 = *(double *)(a2 + 168);
break;
default:
goto LABEL_9;
}
}
}
return result;
}

original_code:
int
JFETmAsk(CKTcircuit *ckt, GENmodel *inModel, int which, IFvalue *value)
{
    JFETmodel *model = (JFETmodel*)inModel;
    switch(which) {
        case 113:
            value->rValue = model->JFETtnom-(273.15);
            return(0);
        case 101:
            value->rValue = model->JFETthreshold;
            return(0);
        case 102:
            value->rValue = model->JFETbeta;
            return(0);
        case 103:
            value->rValue = model->JFETlModulation;
            return(0);
 case 116:
  value->rValue = model->JFETb;
  return(0);
        case 104:
            value->rValue = model->JFETdrainResist;
            return(0);
        case 105:
            value->rValue = model->JFETsourceResist;
            return(0);
        case 106:
            value->rValue = model->JFETcapGS;
            return(0);
        case 107:
            value->rValue = model->JFETcapGD;
            return(0);
        case 108:
            value->rValue = model->JFETgatePotential;
            return(0);
        case 109:
            value->rValue = model->JFETgateSatCurrent;
            return(0);
        case 110:
            value->rValue = model->JFETdepletionCapCoeff;
            return(0);
        case 301:
            value->rValue = model->JFETdrainConduct;
            return(0);
        case 302:
            value->rValue = model->JFETsourceConduct;
            return(0);
        case 305:
     if (model->JFETtype == 1)
                value->sValue = "njf";
     else
                value->sValue = "pjf";
            return(0);
        default:
            return(7);
    }
}

canonical_original_code:
int JFETmAsk(struct CKTcircuit *ckt, struct sGENmodel *inModel, int which, union uIFvalue *value)
{
    struct sJFETmodel *model = (JFETmodel*)inModel;
    switch(which) {
        case 113:
            value->rValue = model->JFETtnom-(273.15);
            return(0);
        case 101:
            value->rValue = model->JFETthreshold;
            return(0);
        case 102:
            value->rValue = model->JFETbeta;
            return(0);
        case 103:
            value->rValue = model->JFETlModulation;
            return(0);
 case 116:
  value->rValue = model->JFETb;
  return(0);
        case 104:
            value->rValue = model->JFETdrainResist;
            return(0);
        case 105:
            value->rValue = model->JFETsourceResist;
            return(0);
        case 106:
            value->rValue = model->JFETcapGS;
            return(0);
        case 107:
            value->rValue = model->JFETcapGD;
            return(0);
        case 108:
            value->rValue = model->JFETgatePotential;
            return(0);
        case 109:
            value->rValue = model->JFETgateSatCurrent;
            return(0);
        case 110:
            value->rValue = model->JFETdepletionCapCoeff;
            return(0);
        case 301:
            value->rValue = model->JFETdrainConduct;
            return(0);
        case 302:
            value->rValue = model->JFETsourceConduct;
            return(0);
        case 305:
     if (model->JFETtype == 1)
                value->sValue = "njf";
     else
                value->sValue = "pjf";
            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: 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; } *

return_type: int

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

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

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

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

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

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


RESask

original_code:
int
RESask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
       IFvalue *select)
{
    RESinstance *fast = (RESinstance *)inst;
    double vr;
    double vi;
    double sr;
    double si;
    double vm;
    static char *msg = "Current and power not available for ac analysis";
    switch(which) {
        case 8:
            value->rValue = fast->REStemp - (273.15);
            return(0);
 case 14:
            value->rValue = fast->RESdtemp;
            return(0);
        case 4:
            value->rValue = fast->RESconduct;
     value->rValue *= fast->RESm;
            return(0);
        case 1:
            value->rValue = fast->RESresist;
     value->rValue /= fast->RESm;
            return(0);
 case 11:
     value->rValue = fast->RESacConduct;
     value->rValue *= fast->RESm;
     return (0);
 case 10:
     value->rValue = fast->RESacResist;
     value->rValue /= fast->RESm;
     return(0);
        case 3:
            value->rValue = fast->RESlength;
            return(0);
        case 2:
            value->rValue = fast->RESwidth;
     return(0);
 case 13:
     value->rValue = fast->RESscale;
            return(0);
 case 12:
     value->rValue = fast->RESm;
     return(0);
 case 16:
     value->rValue = fast->REStc1;
     return(0);
 case 17:
     value->rValue = fast->REStc2;
     return(0);
 case 15:
     value->iValue = fast->RESnoisy;
     return(0);
        case 206:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
                        fast->RESsenParmNo);
            }
            return(0);
        case 201:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        fast->RESsenParmNo);
            }
            return(0);
        case 202:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        fast->RESsenParmNo);
            }
            return(0);
        case 203:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = sqrt(vr*vr + vi*vi);
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        fast->RESsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        fast->RESsenParmNo);
                value->rValue = (vr * sr + vi * si)/vm;
            }
            return(0);
        case 204:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = vr*vr + vi*vi;
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        fast->RESsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        fast->RESsenParmNo);
                value->rValue = (vr * si - vi * sr)/vm;
            }
            return(0);
        case 205:
            if(ckt->CKTsenInfo){
                value->cValue.real=
                        *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        fast->RESsenParmNo);
                value->cValue.imag=
                        *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        fast->RESsenParmNo);
            }
            return(0);
        case 6:
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned)(strlen(msg)+1));
                errRtn = "RESask";
                strcpy(errMsg,msg);
                return((100 +11));
            } else {
                value->rValue = (*(ckt->CKTrhsOld + fast->RESposNode) -
                        *(ckt->CKTrhsOld + fast->RESnegNode))
                        *fast->RESconduct;
  value->rValue *= fast->RESm;
            }
            return(0);
        case 7:
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned)(strlen(msg)+1));
                errRtn = "RESask";
                strcpy(errMsg,msg);
                return((100 +12));
            } else {
                value->rValue = (*(ckt->CKTrhsOld + fast->RESposNode) -
                        *(ckt->CKTrhsOld + fast->RESnegNode)) *
                        fast->RESconduct *
                        (*(ckt->CKTrhsOld + fast->RESposNode) -
                        *(ckt->CKTrhsOld + fast->RESnegNode));
  value->rValue *= fast->RESm;
            }
            return(0);
        default:
            return(7);
    }
}

canonical_original_code:
int RESask(struct CKTcircuit *ckt, struct sGENinstance *inst, int which, union uIFvalue *value, union uIFvalue *select)
{
    struct sRESinstance *fast = (RESinstance *)inst;
    double vr;
    double vi;
    double sr;
    double si;
    double vm;
    static char *msg = "Current and power not available for ac analysis";
    switch(which) {
        case 8:
            value->rValue = fast->REStemp - (273.15);
            return(0);
 case 14:
            value->rValue = fast->RESdtemp;
            return(0);
        case 4:
            value->rValue = fast->RESconduct;
     value->rValue *= fast->RESm;
            return(0);
        case 1:
            value->rValue = fast->RESresist;
     value->rValue /= fast->RESm;
            return(0);
 case 11:
     value->rValue = fast->RESacConduct;
     value->rValue *= fast->RESm;
     return (0);
 case 10:
     value->rValue = fast->RESacResist;
     value->rValue /= fast->RESm;
     return(0);
        case 3:
            value->rValue = fast->RESlength;
            return(0);
        case 2:
            value->rValue = fast->RESwidth;
     return(0);
 case 13:
     value->rValue = fast->RESscale;
            return(0);
 case 12:
     value->rValue = fast->RESm;
     return(0);
 case 16:
     value->rValue = fast->REStc1;
     return(0);
 case 17:
     value->rValue = fast->REStc2;
     return(0);
 case 15:
     value->iValue = fast->RESnoisy;
     return(0);
        case 206:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_Sap[select->iValue + 1]+
                        fast->RESsenParmNo);
            }
            return(0);
        case 201:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        fast->RESsenParmNo);
            }
            return(0);
        case 202:
            if(ckt->CKTsenInfo){
                value->rValue = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        fast->RESsenParmNo);
            }
            return(0);
        case 203:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = sqrt(vr*vr + vi*vi);
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        fast->RESsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        fast->RESsenParmNo);
                value->rValue = (vr * sr + vi * si)/vm;
            }
            return(0);
        case 204:
            if(ckt->CKTsenInfo){
                vr = *(ckt->CKTrhsOld + select->iValue + 1);
                vi = *(ckt->CKTirhsOld + select->iValue + 1);
                vm = vr*vr + vi*vi;
                if(vm == 0){
                    value->rValue = 0;
                    return(0);
                }
                sr = *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        fast->RESsenParmNo);
                si = *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        fast->RESsenParmNo);
                value->rValue = (vr * si - vi * sr)/vm;
            }
            return(0);
        case 205:
            if(ckt->CKTsenInfo){
                value->cValue.real=
                        *(ckt->CKTsenInfo->SEN_RHS[select->iValue + 1]+
                        fast->RESsenParmNo);
                value->cValue.imag=
                        *(ckt->CKTsenInfo->SEN_iRHS[select->iValue + 1]+
                        fast->RESsenParmNo);
            }
            return(0);
        case 6:
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned int)(strlen(msg)+1));
                errRtn = "RESask";
                strcpy(errMsg,msg);
                return((100 +11));
            } else {
                value->rValue = (*(ckt->CKTrhsOld + fast->RESposNode) -
                        *(ckt->CKTrhsOld + fast->RESnegNode))
                        *fast->RESconduct;
  value->rValue *= fast->RESm;
            }
            return(0);
        case 7:
            if (ckt->CKTcurrentAnalysis & 4) {
                errMsg = tmalloc((unsigned int)(strlen(msg)+1));
                errRtn = "RESask";
                strcpy(errMsg,msg);
                return((100 +12));
            } else {
                value->rValue = (*(ckt->CKTrhsOld + fast->RESposNode) -
                        *(ckt->CKTrhsOld + fast->RESnegNode)) *
                        fast->RESconduct *
                        (*(ckt->CKTrhsOld + fast->RESposNode) -
                        *(ckt->CKTrhsOld + fast->RESnegNode));
  value->rValue *= fast->RESm;
            }
            return(0);
        default:
            return(7);
    }
}

variable_types:
inst
struct sGENinstance *

variable_types: struct sRESinstance { 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; } *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]; } *

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

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

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

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

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

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


SWsetup

original_code:
int
SWsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
{
    SWmodel *model = (SWmodel *)inModel;
    SWinstance *here;
    for( ; model != ((void *)0); model = model->SWnextModel ) {
        if (!model->SWthreshGiven) {
            model->SWvThreshold = 0;
        }
        if (!model->SWhystGiven) {
            model->SWvHysteresis = 0;
        }
        if (!model->SWonGiven) {
            model->SWonConduct = 1.0;
            model->SWonResistance = 1.0/model->SWonConduct;
        }
        if (!model->SWoffGiven) {
            model->SWoffConduct = ckt->CKTgmin;
            model->SWoffResistance = 1.0/model->SWoffConduct;
        }
        for (here = model->SWinstances; here != ((void *)0) ;
                here=here->SWnextInstance) {
     if (here->SWowner != ARCHme) goto matrixpointers;
            here->SWstate = *states;
            *states += 2;
matrixpointers:
            if((here->SWposPosptr = SMPmakeElt(matrix,here->SWposNode,here->SWposNode))==(double *)((void *)0)){ return(8);}
            if((here->SWposNegptr = SMPmakeElt(matrix,here->SWposNode,here->SWnegNode))==(double *)((void *)0)){ return(8);}
            if((here->SWnegPosptr = SMPmakeElt(matrix,here->SWnegNode,here->SWposNode))==(double *)((void *)0)){ return(8);}
            if((here->SWnegNegptr = SMPmakeElt(matrix,here->SWnegNode,here->SWnegNode))==(double *)((void *)0)){ return(8);}
        }
    }
    return(0);
}

canonical_original_code:
int SWsetup(void *matrix, struct sGENmodel *inModel, struct CKTcircuit *ckt, int *states)
{
    struct sSWmodel *model = (SWmodel *)inModel;
    struct sSWinstance *here;
    for( ; model != ((void *)0); model = model->SWnextModel ) {
        if (!model->SWthreshGiven) {
            model->SWvThreshold = 0;
        }
        if (!model->SWhystGiven) {
            model->SWvHysteresis = 0;
        }
        if (!model->SWonGiven) {
            model->SWonConduct = 1.0;
            model->SWonResistance = 1.0/model->SWonConduct;
        }
        if (!model->SWoffGiven) {
            model->SWoffConduct = ckt->CKTgmin;
            model->SWoffResistance = 1.0/model->SWoffConduct;
        }
        for (here = model->SWinstances; here != ((void *)0) ;
                here=here->SWnextInstance) {
     if (here->SWowner != ARCHme) goto matrixpointers;
            here->SWstate = *states;
            *states += 2;
matrixpointers:
            if((here->SWposPosptr = SMPmakeElt(matrix,here->SWposNode,here->SWposNode))==(double *)((void *)0)){ return(8);}
            if((here->SWposNegptr = SMPmakeElt(matrix,here->SWposNode,here->SWnegNode))==(double *)((void *)0)){ return(8);}
            if((here->SWnegPosptr = SMPmakeElt(matrix,here->SWnegNode,here->SWposNode))==(double *)((void *)0)){ return(8);}
            if((here->SWnegNegptr = SMPmakeElt(matrix,here->SWnegNode,here->SWnegNode))==(double *)((void *)0)){ return(8);}
        }
    }
    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:
states
int *

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

variable_types: struct sSWinstance { 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; } *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]; } *


RESsetup

decompiled_code:
__int64 __fastcall RESsetup(__int64 a1, __int64 a2)
{
__int64 v2; // r12
__int64 v3; // rbx
__int64 v4; // rax
__int64 v5; // rax
__int64 v6; // rax
__int64 v7; // rax

if ( !a2 )
return 0LL;
v2 = a2;
while ( 1 )
{
v3 = *(_QWORD *)(v2 + 16);
if ( v3 )
break;
LABEL_11:
v2 = *(_QWORD *)(v2 + 8);
if ( !v2 )
return 0LL;
}
while ( 1 )
{
v7 = spGetElement(a1, *(unsigned int *)(v3 + 28), *(unsigned int *)(v3 + 28));
*(_QWORD *)(v3 + 80) = v7;
if ( !v7 )
return 8LL;
v4 = spGetElement(a1, *(unsigned int *)(v3 + 32), *(unsigned int *)(v3 + 32));
*(_QWORD *)(v3 + 88) = v4;
if ( !v4 )
return 8LL;
v5 = spGetElement(a1, *(unsigned int *)(v3 + 28), *(unsigned int *)(v3 + 32));
*(_QWORD *)(v3 + 96) = v5;
if ( !v5 )
return 8LL;
v6 = spGetElement(a1, *(unsigned int *)(v3 + 32), *(unsigned int *)(v3 + 28));
*(_QWORD *)(v3 + 104) = v6;
if ( !v6 )
return 8LL;
v3 = *(_QWORD *)(v3 + 8);
if ( !v3 )
goto LABEL_11;
}
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2)
{
__int64 v2; // r12
__int64 v3; // rbx
__int64 v4; // rax
__int64 v5; // rax
__int64 v6; // rax
__int64 v7; // rax

if ( !a2 )
return 0LL;
v2 = a2;
while ( 1 )
{
v3 = *(_QWORD *)(v2 + 16);
if ( v3 )
break;
LABEL_11:
v2 = *(_QWORD *)(v2 + 8);
if ( !v2 )
return 0LL;
}
while ( 1 )
{
v7 = spGetElement(a1, *(unsigned int *)(v3 + 28), *(unsigned int *)(v3 + 28));
*(_QWORD *)(v3 + 80) = v7;
if ( !v7 )
return 8LL;
v4 = spGetElement(a1, *(unsigned int *)(v3 + 32), *(unsigned int *)(v3 + 32));
*(_QWORD *)(v3 + 88) = v4;
if ( !v4 )
return 8LL;
v5 = spGetElement(a1, *(unsigned int *)(v3 + 28), *(unsigned int *)(v3 + 32));
*(_QWORD *)(v3 + 96) = v5;
if ( !v5 )
return 8LL;
v6 = spGetElement(a1, *(unsigned int *)(v3 + 32), *(unsigned int *)(v3 + 28));
*(_QWORD *)(v3 + 104) = v6;
if ( !v6 )
return 8LL;
v3 = *(_QWORD *)(v3 + 8);
if ( !v3 )
goto LABEL_11;
}
}

original_code:
int
RESsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit*ckt, int *state)
{
    RESmodel *model = (RESmodel *)inModel;
    RESinstance *here;
    for( ; model != ((void *)0); model = model->RESnextModel ) {
        for (here = model->RESinstances; here != ((void *)0) ;
                here=here->RESnextInstance) {
            if((here->RESposPosptr = SMPmakeElt(matrix,here->RESposNode,here->RESposNode))==(double *)((void *)0)){ return(8);};
            if((here->RESnegNegptr = SMPmakeElt(matrix,here->RESnegNode,here->RESnegNode))==(double *)((void *)0)){ return(8);};
            if((here->RESposNegptr = SMPmakeElt(matrix,here->RESposNode,here->RESnegNode))==(double *)((void *)0)){ return(8);};
            if((here->RESnegPosptr = SMPmakeElt(matrix,here->RESnegNode,here->RESposNode))==(double *)((void *)0)){ return(8);};
        }
    }
    return(0);
}

canonical_original_code:
int RESsetup(void *matrix, struct sGENmodel *inModel, struct CKTcircuit *ckt, int *state)
{
    struct sRESmodel *model = (RESmodel *)inModel;
    struct sRESinstance *here;
    for( ; model != ((void *)0); model = model->RESnextModel ) {
        for (here = model->RESinstances; here != ((void *)0) ;
                here=here->RESnextInstance) {
            if((here->RESposPosptr = SMPmakeElt(matrix,here->RESposNode,here->RESposNode))==(double *)((void *)0)){ return(8);};
            if((here->RESnegNegptr = SMPmakeElt(matrix,here->RESnegNode,here->RESnegNode))==(double *)((void *)0)){ return(8);};
            if((here->RESposNegptr = SMPmakeElt(matrix,here->RESposNode,here->RESnegNode))==(double *)((void *)0)){ return(8);};
            if((here->RESnegPosptr = SMPmakeElt(matrix,here->RESnegNode,here->RESposNode))==(double *)((void *)0)){ return(8);};
        }
    }
    return(0);
}

variable_types:
state
int *

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