original_code:
int
B2delete(GENmodel *inModel, IFuid name, GENinstance **inInst)
{
    B2instance **fast = (B2instance**)inInst;
    B2model *model = (B2model*)inModel;
    B2instance **prev = ((void *)0);
    B2instance *here;
    for( ; model ; model = model->B2nextModel) {
        prev = &(model->B2instances);
        for(here = *prev; here ; here = *prev) {
            if(here->B2name == name || (fast && here==*fast) ) {
                *prev= here->B2nextInstance;
                {if (here) {txfree((char *)(here));(here) = 0;}};
                return(0);
            }
            prev = &(here->B2nextInstance);
        }
    }
    return(3);
}

canonical_original_code:
int B2delete(struct sGENmodel *inModel, char *name, struct sGENinstance **inInst)
{
    struct sBSIM2instance **fast = (B2instance**)inInst;
    struct sBSIM2model *model = (B2model*)inModel;
    struct sBSIM2instance **prev = ((void *)0);
    struct sBSIM2instance *here;
    for( ; model ; model = model->B2nextModel) {
        prev = &(model->B2instances);
        for(here = *prev; here ; here = *prev) {
            if(here->B2name == name || (fast && here==*fast) ) {
                *prev= here->B2nextInstance;
                {if (here) {txfree((char *)(here));(here) = 0;}};
                return(0);
            }
            prev = &(here->B2nextInstance);
        }
    }
    return(3);
}

variable_types:
name
char *

variable_types:
inInst
struct sGENinstance **

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

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

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

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

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


LTRAdelete

repo: gserdyuk/gnucap-a

original_code:
int
LTRAdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
{
  LTRAinstance **fast = (LTRAinstance **) kill;
  LTRAmodel *model = (LTRAmodel *) inModel;
  LTRAinstance **prev = ((void *)0);
  LTRAinstance *here;
  for (; model; model = model->LTRAnextModel) {
    prev = &(model->LTRAinstances);
    for (here = *prev; here; here = *prev) {
      if (here->LTRAname == name || (fast && here == *fast)) {
 *prev = here->LTRAnextInstance;
 {if (here) {txfree((char *)(here));(here) = 0;}};
 return (0);
      }
      prev = &(here->LTRAnextInstance);
    }
  }
  return (3);
}

canonical_original_code:
int LTRAdelete(struct sGENmodel *inModel, char *name, struct sGENinstance **kill)
{
  struct sLTRAinstance **fast = (LTRAinstance **) kill;
  struct sLTRAmodel *model = (LTRAmodel *) inModel;
  struct sLTRAinstance **prev = ((void *)0);
  struct sLTRAinstance *here;
  for (; model; model = model->LTRAnextModel) {
    prev = &(model->LTRAinstances);
    for (here = *prev; here; here = *prev) {
      if (here->LTRAname == name || (fast && here == *fast)) {
 *prev = here->LTRAnextInstance;
 {if (here) {txfree((char *)(here));(here) = 0;}};
 return (0);
      }
      prev = &(here->LTRAnextInstance);
    }
  }
  return (3);
}

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:
kill
struct sGENinstance **

variable_types: struct sLTRAinstance { struct sLTRAmodel { int LTRAmodType; struct sLTRAmodel *LTRAnextModel; struct sLTRAinstance *LTRAinstances; char *LTRAmodName; double LTRAh1dashFirstVal; double LTRAh2FirstVal; double LTRAh3dashFirstVal; double LTRAh1dashFirstCoeff; double LTRAh2FirstCoeff; double LTRAh3dashFirstCoeff; double *LTRAh1dashCoeffs; double *LTRAh2Coeffs; double *LTRAh3dashCoeffs; int LTRAmodelListSize; double LTRAconduct; double LTRAresist; double LTRAinduct; double LTRAcapac; double LTRAlength; double LTRAtd; double LTRAimped; double LTRAadmit; double LTRAalpha; double LTRAbeta; double LTRAattenuation; double LTRAcByR; double LTRArclsqr; double LTRAintH1dash; double LTRAintH2; double LTRAintH3dash; double LTRAnl; double LTRAf; double LTRAcoshlrootGR; double LTRArRsLrGRorG; double LTRArGsLrGRorR; int LTRAauxIndex; double LTRAstLineReltol; double LTRAchopReltol; double LTRAstLineAbstol; double LTRAchopAbstol; unsigned int LTRAreltolGiven; unsigned int LTRAabstolGiven; unsigned int LTRAtruncNR; unsigned int LTRAtruncDontCut; double LTRAmaxSafeStep; unsigned int LTRAresistGiven; unsigned int LTRAconductGiven; unsigned int LTRAinductGiven; unsigned int LTRAcapacGiven; unsigned int LTRAlengthGiven; unsigned int LTRAnlGiven; int LTRAlteConType; int LTRAhowToInterp; unsigned int LTRAprintFlag; int LTRAstepLimit; unsigned int LTRAfGiven; double LTRAabstol; double LTRAreltol; int LTRAspecialCase; } *LTRAmodPtr; struct sLTRAinstance *LTRAnextInstance; char *LTRAname; int LTRAowner; int LTRAstate; int LTRAposNode1; int LTRAnegNode1; int LTRAposNode2; int LTRAnegNode2; int LTRAbrEq1; int LTRAbrEq2; double LTRAinput1; double LTRAinput2; double LTRAinitVolt1; double LTRAinitCur1; double LTRAinitVolt2; double LTRAinitCur2; double *LTRAv1; double *LTRAi1; double *LTRAv2; double *LTRAi2; int LTRAinstListSize; double *LTRAibr1Ibr1Ptr; double *LTRAibr1Ibr2Ptr; double *LTRAibr1Pos1Ptr; double *LTRAibr1Neg1Ptr; double *LTRAibr1Pos2Ptr; double *LTRAibr1Neg2Ptr; double *LTRAibr2Ibr1Ptr; double *LTRAibr2Ibr2Ptr; double *LTRAibr2Pos1Ptr; double *LTRAibr2Neg1Ptr; double *LTRAibr2Pos2Ptr; double *LTRAibr2Neg2Ptr; double *LTRAneg1Ibr1Ptr; double *LTRAneg2Ibr2Ptr; double *LTRApos1Ibr1Ptr; double *LTRApos2Ibr2Ptr; double *LTRApos1Pos1Ptr; double *LTRAneg1Neg1Ptr; double *LTRApos2Pos2Ptr; double *LTRAneg2Neg2Ptr; unsigned int LTRAicV1Given; unsigned int LTRAicC1Given; unsigned int LTRAicV2Given; unsigned int LTRAicC2Given; } **

variable_types: struct sLTRAmodel { int LTRAmodType; struct sLTRAmodel *LTRAnextModel; struct sLTRAinstance { struct sLTRAmodel *LTRAmodPtr; struct sLTRAinstance *LTRAnextInstance; char *LTRAname; int LTRAowner; int LTRAstate; int LTRAposNode1; int LTRAnegNode1; int LTRAposNode2; int LTRAnegNode2; int LTRAbrEq1; int LTRAbrEq2; double LTRAinput1; double LTRAinput2; double LTRAinitVolt1; double LTRAinitCur1; double LTRAinitVolt2; double LTRAinitCur2; double *LTRAv1; double *LTRAi1; double *LTRAv2; double *LTRAi2; int LTRAinstListSize; double *LTRAibr1Ibr1Ptr; double *LTRAibr1Ibr2Ptr; double *LTRAibr1Pos1Ptr; double *LTRAibr1Neg1Ptr; double *LTRAibr1Pos2Ptr; double *LTRAibr1Neg2Ptr; double *LTRAibr2Ibr1Ptr; double *LTRAibr2Ibr2Ptr; double *LTRAibr2Pos1Ptr; double *LTRAibr2Neg1Ptr; double *LTRAibr2Pos2Ptr; double *LTRAibr2Neg2Ptr; double *LTRAneg1Ibr1Ptr; double *LTRAneg2Ibr2Ptr; double *LTRApos1Ibr1Ptr; double *LTRApos2Ibr2Ptr; double *LTRApos1Pos1Ptr; double *LTRAneg1Neg1Ptr; double *LTRApos2Pos2Ptr; double *LTRAneg2Neg2Ptr; unsigned int LTRAicV1Given; unsigned int LTRAicC1Given; unsigned int LTRAicV2Given; unsigned int LTRAicC2Given; } *LTRAinstances; char *LTRAmodName; double LTRAh1dashFirstVal; double LTRAh2FirstVal; double LTRAh3dashFirstVal; double LTRAh1dashFirstCoeff; double LTRAh2FirstCoeff; double LTRAh3dashFirstCoeff; double *LTRAh1dashCoeffs; double *LTRAh2Coeffs; double *LTRAh3dashCoeffs; int LTRAmodelListSize; double LTRAconduct; double LTRAresist; double LTRAinduct; double LTRAcapac; double LTRAlength; double LTRAtd; double LTRAimped; double LTRAadmit; double LTRAalpha; double LTRAbeta; double LTRAattenuation; double LTRAcByR; double LTRArclsqr; double LTRAintH1dash; double LTRAintH2; double LTRAintH3dash; double LTRAnl; double LTRAf; double LTRAcoshlrootGR; double LTRArRsLrGRorG; double LTRArGsLrGRorR; int LTRAauxIndex; double LTRAstLineReltol; double LTRAchopReltol; double LTRAstLineAbstol; double LTRAchopAbstol; unsigned int LTRAreltolGiven; unsigned int LTRAabstolGiven; unsigned int LTRAtruncNR; unsigned int LTRAtruncDontCut; double LTRAmaxSafeStep; unsigned int LTRAresistGiven; unsigned int LTRAconductGiven; unsigned int LTRAinductGiven; unsigned int LTRAcapacGiven; unsigned int LTRAlengthGiven; unsigned int LTRAnlGiven; int LTRAlteConType; int LTRAhowToInterp; unsigned int LTRAprintFlag; int LTRAstepLimit; unsigned int LTRAfGiven; double LTRAabstol; double LTRAreltol; int LTRAspecialCase; } *

return_type: int

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


DIOmAsk

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

switch ( a3 )
{
case 'e':
result = 0LL;
*a4 = a2[5];
break;
case 'f':
result = 0LL;
*a4 = a2[6];
break;
case 'g':
result = 0LL;
*a4 = a2[8];
break;
case 'h':
result = 0LL;
*a4 = a2[9];
break;
case 'i':
result = 0LL;
*a4 = a2[10];
break;
case 'j':
result = 0LL;
*a4 = a2[11];
break;
case 'k':
result = 0LL;
*a4 = a2[12];
break;
case 'l':
result = 0LL;
*a4 = a2[13];
break;
case 'm':
result = 0LL;
*a4 = a2[14];
break;
case 'n':
result = 0LL;
*a4 = a2[15];
break;
case 'o':
result = 0LL;
*a4 = a2[16];
break;
case 'p':
result = 0LL;
*a4 = a2[17];
break;
case 'r':
result = 0LL;
*a4 = a2[7];
break;
case 's':
result = 0LL;
*a4 = a2[20] - 273.15;
break;
default:
result = 7LL;
break;
}
return result;
}

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

switch ( a3 )
{
case 'e':
result = 0LL;
*a4 = a2[5];
break;
case 'f':
result = 0LL;
*a4 = a2[6];
break;
case 'g':
result = 0LL;
*a4 = a2[8];
break;
case 'h':
result = 0LL;
*a4 = a2[9];
break;
case 'i':
result = 0LL;
*a4 = a2[10];
break;
case 'j':
result = 0LL;
*a4 = a2[11];
break;
case 'k':
result = 0LL;
*a4 = a2[12];
break;
case 'l':
result = 0LL;
*a4 = a2[13];
break;
case 'm':
result = 0LL;
*a4 = a2[14];
break;
case 'n':
result = 0LL;
*a4 = a2[15];
break;
case 'o':
result = 0LL;
*a4 = a2[16];
break;
case 'p':
result = 0LL;
*a4 = a2[17];
break;
case 'r':
result = 0LL;
*a4 = a2[7];
break;
case 's':
result = 0LL;
*a4 = a2[20] - 273.15;
break;
default:
result = 7LL;
break;
}
return result;
}

original_code:
int
DIOmAsk (CKTcircuit *ckt, GENmodel *inModel, int which, IFvalue *value)
{
    DIOmodel *model = (DIOmodel*)inModel;
    switch (which) {
        case 101:
            value->rValue = model->DIOsatCur;
            return(0);
        case 118:
            value->rValue = model->DIOsatSWCur;
            return(0);
        case 115:
            value->rValue = model->DIOnomTemp-(273.15);
            return(0);
        case 102:
            value->rValue = model->DIOresist;
            return(0);
        case 129:
            value->rValue = model->DIOresistTemp1;
            return(0);
        case 130:
            value->rValue = model->DIOresistTemp2;
            return(0);
        case 103:
            value->rValue = model->DIOemissionCoeff;
            return(0);
        case 104:
            value->rValue = model->DIOtransitTime;
            return(0);
        case 125:
            value->rValue = model->DIOtranTimeTemp1;
            return(0);
        case 126:
            value->rValue = model->DIOtranTimeTemp2;
            return(0);
        case 105:
            value->rValue = model->DIOjunctionCap;
            return(0);
        case 106:
            value->rValue = model->DIOjunctionPot;
            return(0);
        case 107:
            value->rValue = model->DIOgradingCoeff;
            return(0);
        case 127:
            value->rValue = model->DIOgradCoeffTemp1;
            return(0);
        case 128:
            value->rValue = model->DIOgradCoeffTemp2;
            return(0);
        case 119:
            value->rValue = model->DIOjunctionSWCap;
            return(0);
        case 120:
            value->rValue = model->DIOjunctionSWPot;
            return(0);
        case 121:
            value->rValue = model->DIOgradingSWCoeff;
            return(0);
        case 122:
            value->rValue = model->DIOforwardKneeCurrent;
            return(0);
        case 123:
            value->rValue = model->DIOreverseKneeCurrent;
            return(0);
        case 108:
            value->rValue = model->DIOactivationEnergy;
            return (0);
        case 109:
            value->rValue = model->DIOsaturationCurrentExp;
            return(0);
        case 110:
            value->rValue = model->DIOdepletionCapCoeff;
            return(0);
 case 124:
     value->rValue = model->DIOdepletionSWcapCoeff;
            return(0);
        case 116:
            value->rValue = model->DIOfNcoef;
            return(0);
        case 117:
            value->rValue = model->DIOfNexp;
            return(0);
        case 111:
            value->rValue = model->DIObreakdownVoltage;
            return(0);
        case 112:
            value->rValue = model->DIObreakdownCurrent;
            return(0);
        case 114:
            value->rValue = model->DIOconductance;
            return(0);
        default:
            return(7);
        }
}

canonical_original_code:
int DIOmAsk(struct CKTcircuit *ckt, struct sGENmodel *inModel, int which, union uIFvalue *value)
{
    struct sDIOmodel *model = (DIOmodel*)inModel;
    switch (which) {
        case 101:
            value->rValue = model->DIOsatCur;
            return(0);
        case 118:
            value->rValue = model->DIOsatSWCur;
            return(0);
        case 115:
            value->rValue = model->DIOnomTemp-(273.15);
            return(0);
        case 102:
            value->rValue = model->DIOresist;
            return(0);
        case 129:
            value->rValue = model->DIOresistTemp1;
            return(0);
        case 130:
            value->rValue = model->DIOresistTemp2;
            return(0);
        case 103:
            value->rValue = model->DIOemissionCoeff;
            return(0);
        case 104:
            value->rValue = model->DIOtransitTime;
            return(0);
        case 125:
            value->rValue = model->DIOtranTimeTemp1;
            return(0);
        case 126:
            value->rValue = model->DIOtranTimeTemp2;
            return(0);
        case 105:
            value->rValue = model->DIOjunctionCap;
            return(0);
        case 106:
            value->rValue = model->DIOjunctionPot;
            return(0);
        case 107:
            value->rValue = model->DIOgradingCoeff;
            return(0);
        case 127:
            value->rValue = model->DIOgradCoeffTemp1;
            return(0);
        case 128:
            value->rValue = model->DIOgradCoeffTemp2;
            return(0);
        case 119:
            value->rValue = model->DIOjunctionSWCap;
            return(0);
        case 120:
            value->rValue = model->DIOjunctionSWPot;
            return(0);
        case 121:
            value->rValue = model->DIOgradingSWCoeff;
            return(0);
        case 122:
            value->rValue = model->DIOforwardKneeCurrent;
            return(0);
        case 123:
            value->rValue = model->DIOreverseKneeCurrent;
            return(0);
        case 108:
            value->rValue = model->DIOactivationEnergy;
            return (0);
        case 109:
            value->rValue = model->DIOsaturationCurrentExp;
            return(0);
        case 110:
            value->rValue = model->DIOdepletionCapCoeff;
            return(0);
 case 124:
     value->rValue = model->DIOdepletionSWcapCoeff;
            return(0);
        case 116:
            value->rValue = model->DIOfNcoef;
            return(0);
        case 117:
            value->rValue = model->DIOfNexp;
            return(0);
        case 111:
            value->rValue = model->DIObreakdownVoltage;
            return(0);
        case 112:
            value->rValue = model->DIObreakdownCurrent;
            return(0);
        case 114:
            value->rValue = model->DIOconductance;
            return(0);
        default:
            return(7);
        }
}

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

variable_types:
inModel
struct sGENmodel *

variable_types: which int

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

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

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


MESsetup

original_code:
int
MESsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
{
    MESmodel *model = (MESmodel*)inModel;
    MESinstance *here;
    int error;
    CKTnode *tmp;
    for( ; model != ((void *)0); model = model->MESnextModel ) {
        if( (model->MEStype != 1) && (model->MEStype != -1) ) {
            model->MEStype = 1;
        }
        if(!model->MESthresholdGiven) {
            model->MESthreshold = -2;
        }
        if(!model->MESbetaGiven) {
            model->MESbeta = 2.5e-3;
        }
        if(!model->MESbGiven) {
            model->MESb = 0.3;
        }
        if(!model->MESalphaGiven) {
            model->MESalpha = 2;
        }
        if(!model->MESlModulationGiven) {
            model->MESlModulation = 0;
        }
        if(!model->MESdrainResistGiven) {
            model->MESdrainResist = 0;
        }
        if(!model->MESsourceResistGiven) {
            model->MESsourceResist = 0;
        }
        if(!model->MEScapGSGiven) {
            model->MEScapGS = 0;
        }
        if(!model->MEScapGDGiven) {
            model->MEScapGD = 0;
        }
        if(!model->MESgatePotentialGiven) {
            model->MESgatePotential = 1;
        }
        if(!model->MESgateSatCurrentGiven) {
            model->MESgateSatCurrent = 1e-14;
        }
        if(!model->MESdepletionCapCoeffGiven) {
            model->MESdepletionCapCoeff = .5;
        }
 if(!model->MESfNcoefGiven) {
     model->MESfNcoef = 0;
 }
 if(!model->MESfNexpGiven) {
     model->MESfNexp = 1;
 }
        for (here = model->MESinstances; here != ((void *)0) ;
                here=here->MESnextInstance) {
     if (here->MESowner != ARCHme) goto matrixpointers;
            if(!here->MESareaGiven) {
                here->MESarea = 1.0;
            }
            if(!here->MESmGiven) {
                here->MESm = 1.0;
            }
            here->MESstate = *states;
            *states += 13;
matrixpointers:
            if(model->MESsourceResist != 0 && here->MESsourcePrimeNode==0) {
                error = CKTmkVolt(ckt,&tmp,here->MESname,"source");
                if(error) return(error);
                here->MESsourcePrimeNode = tmp->number;
                if (ckt->CKTcopyNodesets) {
      CKTnode *tmpNode;
      IFuid tmpName;
                  if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==0) {
                     if (tmpNode->nsGiven) {
                       tmp->nodeset=tmpNode->nodeset;
                       tmp->nsGiven=tmpNode->nsGiven;
                     }
                  }
                }
            } else {
                here->MESsourcePrimeNode = here->MESsourceNode;
            }
            if(model->MESdrainResist != 0 && here->MESdrainPrimeNode==0) {
                error = CKTmkVolt(ckt,&tmp,here->MESname,"drain");
                if(error) return(error);
                here->MESdrainPrimeNode = tmp->number;
                if (ckt->CKTcopyNodesets) {
      CKTnode *tmpNode;
      IFuid tmpName;
                  if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==0) {
                     if (tmpNode->nsGiven) {
                       tmp->nodeset=tmpNode->nodeset;
                       tmp->nsGiven=tmpNode->nsGiven;
                     }
                  }
                }
            } else {
                here->MESdrainPrimeNode = here->MESdrainNode;
            }
            if((here->MESdrainDrainPrimePtr = SMPmakeElt(matrix,here->MESdrainNode,here->MESdrainPrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESgateDrainPrimePtr = SMPmakeElt(matrix,here->MESgateNode,here->MESdrainPrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESgateSourcePrimePtr = SMPmakeElt(matrix,here->MESgateNode,here->MESsourcePrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESsourceSourcePrimePtr = SMPmakeElt(matrix,here->MESsourceNode,here->MESsourcePrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESdrainPrimeDrainPtr = SMPmakeElt(matrix,here->MESdrainPrimeNode,here->MESdrainNode))==(double *)((void *)0)){ return(8);}
            if((here->MESdrainPrimeGatePtr = SMPmakeElt(matrix,here->MESdrainPrimeNode,here->MESgateNode))==(double *)((void *)0)){ return(8);}
            if((here->MESdrainPrimeSourcePrimePtr = SMPmakeElt(matrix,here->MESdrainPrimeNode,here->MESsourcePrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESsourcePrimeGatePtr = SMPmakeElt(matrix,here->MESsourcePrimeNode,here->MESgateNode))==(double *)((void *)0)){ return(8);}
            if((here->MESsourcePrimeSourcePtr = SMPmakeElt(matrix,here->MESsourcePrimeNode,here->MESsourceNode))==(double *)((void *)0)){ return(8);}
            if((here->MESsourcePrimeDrainPrimePtr = SMPmakeElt(matrix,here->MESsourcePrimeNode,here->MESdrainPrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESdrainDrainPtr = SMPmakeElt(matrix,here->MESdrainNode,here->MESdrainNode))==(double *)((void *)0)){ return(8);}
            if((here->MESgateGatePtr = SMPmakeElt(matrix,here->MESgateNode,here->MESgateNode))==(double *)((void *)0)){ return(8);}
            if((here->MESsourceSourcePtr = SMPmakeElt(matrix,here->MESsourceNode,here->MESsourceNode))==(double *)((void *)0)){ return(8);}
            if((here->MESdrainPrimeDrainPrimePtr = SMPmakeElt(matrix,here->MESdrainPrimeNode,here->MESdrainPrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESsourcePrimeSourcePrimePtr = SMPmakeElt(matrix,here->MESsourcePrimeNode,here->MESsourcePrimeNode))==(double *)((void *)0)){ return(8);}
        }
    }
    return(0);
}

canonical_original_code:
int MESsetup(void *matrix, struct sGENmodel *inModel, struct CKTcircuit *ckt, int *states)
{
    struct sMESmodel *model = (MESmodel*)inModel;
    struct sMESinstance *here;
    int error;
    struct sCKTnode *tmp;
    for( ; model != ((void *)0); model = model->MESnextModel ) {
        if( (model->MEStype != 1) && (model->MEStype != -1) ) {
            model->MEStype = 1;
        }
        if(!model->MESthresholdGiven) {
            model->MESthreshold = -2;
        }
        if(!model->MESbetaGiven) {
            model->MESbeta = 2.5e-3;
        }
        if(!model->MESbGiven) {
            model->MESb = 0.3;
        }
        if(!model->MESalphaGiven) {
            model->MESalpha = 2;
        }
        if(!model->MESlModulationGiven) {
            model->MESlModulation = 0;
        }
        if(!model->MESdrainResistGiven) {
            model->MESdrainResist = 0;
        }
        if(!model->MESsourceResistGiven) {
            model->MESsourceResist = 0;
        }
        if(!model->MEScapGSGiven) {
            model->MEScapGS = 0;
        }
        if(!model->MEScapGDGiven) {
            model->MEScapGD = 0;
        }
        if(!model->MESgatePotentialGiven) {
            model->MESgatePotential = 1;
        }
        if(!model->MESgateSatCurrentGiven) {
            model->MESgateSatCurrent = 1e-14;
        }
        if(!model->MESdepletionCapCoeffGiven) {
            model->MESdepletionCapCoeff = .5;
        }
 if(!model->MESfNcoefGiven) {
     model->MESfNcoef = 0;
 }
 if(!model->MESfNexpGiven) {
     model->MESfNexp = 1;
 }
        for (here = model->MESinstances; here != ((void *)0) ;
                here=here->MESnextInstance) {
     if (here->MESowner != ARCHme) goto matrixpointers;
            if(!here->MESareaGiven) {
                here->MESarea = 1.0;
            }
            if(!here->MESmGiven) {
                here->MESm = 1.0;
            }
            here->MESstate = *states;
            *states += 13;
matrixpointers:
            if(model->MESsourceResist != 0 && here->MESsourcePrimeNode==0) {
                error = CKTmkVolt(ckt,&tmp,here->MESname,"source");
                if(error) return(error);
                here->MESsourcePrimeNode = tmp->number;
                if (ckt->CKTcopyNodesets) {
      struct sCKTnode *tmpNode;
      char *tmpName;
                  if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==0) {
                     if (tmpNode->nsGiven) {
                       tmp->nodeset=tmpNode->nodeset;
                       tmp->nsGiven=tmpNode->nsGiven;
                     }
                  }
                }
            } else {
                here->MESsourcePrimeNode = here->MESsourceNode;
            }
            if(model->MESdrainResist != 0 && here->MESdrainPrimeNode==0) {
                error = CKTmkVolt(ckt,&tmp,here->MESname,"drain");
                if(error) return(error);
                here->MESdrainPrimeNode = tmp->number;
                if (ckt->CKTcopyNodesets) {
      struct sCKTnode *tmpNode;
      char *tmpName;
                  if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==0) {
                     if (tmpNode->nsGiven) {
                       tmp->nodeset=tmpNode->nodeset;
                       tmp->nsGiven=tmpNode->nsGiven;
                     }
                  }
                }
            } else {
                here->MESdrainPrimeNode = here->MESdrainNode;
            }
            if((here->MESdrainDrainPrimePtr = SMPmakeElt(matrix,here->MESdrainNode,here->MESdrainPrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESgateDrainPrimePtr = SMPmakeElt(matrix,here->MESgateNode,here->MESdrainPrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESgateSourcePrimePtr = SMPmakeElt(matrix,here->MESgateNode,here->MESsourcePrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESsourceSourcePrimePtr = SMPmakeElt(matrix,here->MESsourceNode,here->MESsourcePrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESdrainPrimeDrainPtr = SMPmakeElt(matrix,here->MESdrainPrimeNode,here->MESdrainNode))==(double *)((void *)0)){ return(8);}
            if((here->MESdrainPrimeGatePtr = SMPmakeElt(matrix,here->MESdrainPrimeNode,here->MESgateNode))==(double *)((void *)0)){ return(8);}
            if((here->MESdrainPrimeSourcePrimePtr = SMPmakeElt(matrix,here->MESdrainPrimeNode,here->MESsourcePrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESsourcePrimeGatePtr = SMPmakeElt(matrix,here->MESsourcePrimeNode,here->MESgateNode))==(double *)((void *)0)){ return(8);}
            if((here->MESsourcePrimeSourcePtr = SMPmakeElt(matrix,here->MESsourcePrimeNode,here->MESsourceNode))==(double *)((void *)0)){ return(8);}
            if((here->MESsourcePrimeDrainPrimePtr = SMPmakeElt(matrix,here->MESsourcePrimeNode,here->MESdrainPrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESdrainDrainPtr = SMPmakeElt(matrix,here->MESdrainNode,here->MESdrainNode))==(double *)((void *)0)){ return(8);}
            if((here->MESgateGatePtr = SMPmakeElt(matrix,here->MESgateNode,here->MESgateNode))==(double *)((void *)0)){ return(8);}
            if((here->MESsourceSourcePtr = SMPmakeElt(matrix,here->MESsourceNode,here->MESsourceNode))==(double *)((void *)0)){ return(8);}
            if((here->MESdrainPrimeDrainPrimePtr = SMPmakeElt(matrix,here->MESdrainPrimeNode,here->MESdrainPrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->MESsourcePrimeSourcePrimePtr = SMPmakeElt(matrix,here->MESsourcePrimeNode,here->MESsourcePrimeNode))==(double *)((void *)0)){ return(8);}
        }
    }
    return(0);
}

variable_types:
matrix
void *

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

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

variable_types: error int

variable_types:
tmpName
char *


INDacLoad

original_code:
int
INDacLoad(GENmodel *inModel, CKTcircuit *ckt)
{
    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 = ckt->CKTomega * here->INDinduct;
            *(here->INDposIbrptr) += 1;
            *(here->INDnegIbrptr) -= 1;
            *(here->INDibrPosptr) += 1;
            *(here->INDibrNegptr) -= 1;
            *(here->INDibrIbrptr +1) -= val;
        }
    }
    return(0);
}

canonical_original_code:
int INDacLoad(struct sGENmodel *inModel, struct CKTcircuit *ckt)
{
    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 = ckt->CKTomega * here->INDinduct;
            *(here->INDposIbrptr) += 1;
            *(here->INDnegIbrptr) -= 1;
            *(here->INDibrPosptr) += 1;
            *(here->INDibrNegptr) -= 1;
            *(here->INDibrIbrptr +1) -= val;
        }
    }
    return(0);
}

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

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


DIOsetup

original_code:
int
DIOsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
{
    DIOmodel *model = (DIOmodel*)inModel;
    DIOinstance *here;
    int error;
    CKTnode *tmp;
    for( ; model != ((void *)0); model = model->DIOnextModel ) {
        if(!model->DIOemissionCoeffGiven) {
            model->DIOemissionCoeff = 1;
        }
        if(!model->DIOsatCurGiven) {
            model->DIOsatCur = 1e-14;
        }
        if(!model->DIOsatSWCurGiven) {
            model->DIOsatSWCur = 0.0;
        }
        if(!model->DIObreakdownCurrentGiven) {
            model->DIObreakdownCurrent = 1e-3;
        }
        if(!model->DIOjunctionPotGiven){
            model->DIOjunctionPot = 1;
        }
        if(!model->DIOgradingCoeffGiven) {
            model->DIOgradingCoeff = .5;
        }
 if(!model->DIOgradCoeffTemp1Given) {
            model->DIOgradCoeffTemp1 = 0.0;
        }
 if(!model->DIOgradCoeffTemp2Given) {
            model->DIOgradCoeffTemp2 = 0.0;
        }
        if(!model->DIOdepletionCapCoeffGiven) {
            model->DIOdepletionCapCoeff = .5;
        }
 if(!model->DIOdepletionSWcapCoeffGiven) {
            model->DIOdepletionSWcapCoeff = .5;
        }
        if(!model->DIOtransitTimeGiven) {
            model->DIOtransitTime = 0;
        }
 if(!model->DIOtranTimeTemp1Given) {
            model->DIOtranTimeTemp1 = 0.0;
        }
 if(!model->DIOtranTimeTemp2Given) {
            model->DIOtranTimeTemp2 = 0.0;
        }
        if(!model->DIOjunctionCapGiven) {
            model->DIOjunctionCap = 0;
        }
        if(!model->DIOjunctionSWCapGiven) {
            model->DIOjunctionSWCap = 0;
        }
        if(!model->DIOjunctionSWPotGiven){
            model->DIOjunctionSWPot = 1;
        }
        if(!model->DIOgradingSWCoeffGiven) {
            model->DIOgradingSWCoeff = .33;
        }
        if(!model->DIOforwardKneeCurrentGiven) {
            model->DIOforwardKneeCurrent = 1e-3;
        }
        if(!model->DIOreverseKneeCurrentGiven) {
            model->DIOreverseKneeCurrent = 1e-3;
        }
        if(!model->DIOactivationEnergyGiven) {
            model->DIOactivationEnergy = 1.11;
        }
        if(!model->DIOsaturationCurrentExpGiven) {
            model->DIOsaturationCurrentExp = 3;
        }
 if(!model->DIOfNcoefGiven) {
     model->DIOfNcoef = 0.0;
 }
 if(!model->DIOfNexpGiven) {
     model->DIOfNexp = 1.0;
 }
 if(!model->DIOresistTemp1Given) {
     model->DIOresistTemp1 = 0.0;
 }
        if(!model->DIOresistTemp2Given) {
     model->DIOresistTemp2 = 0.0;
 }
        for (here = model->DIOinstances; here != ((void *)0) ;
                here=here->DIOnextInstance) {
     if (here->DIOowner != ARCHme) goto matrixpointers;
            if(!here->DIOareaGiven) {
                here->DIOarea = 1;
            }
            if(!here->DIOpjGiven) {
                here->DIOpj = 0;
            }
            if(!here->DIOmGiven) {
                here->DIOm = 1;
            }
            here->DIOstate = *states;
            *states += 5;
            if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & 0x2) ){
                *states += 2 * (ckt->CKTsenInfo->SENparms);
            }
matrixpointers:
            if(model->DIOresist == 0) {
                here->DIOposPrimeNode = here->DIOposNode;
            } else if(here->DIOposPrimeNode == 0) {
             CKTnode *tmpNode;
               IFuid tmpName;
                error = CKTmkVolt(ckt,&tmp,here->DIOname,"internal");
                if(error) return(error);
                here->DIOposPrimeNode = tmp->number;
                if (ckt->CKTcopyNodesets) {
                  if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==0) {
                     if (tmpNode->nsGiven) {
                       tmp->nodeset=tmpNode->nodeset;
                       tmp->nsGiven=tmpNode->nsGiven;
                     }
                  }
                }
            }
            if((here->DIOposPosPrimePtr = SMPmakeElt(matrix,here->DIOposNode,here->DIOposPrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->DIOnegPosPrimePtr = SMPmakeElt(matrix,here->DIOnegNode,here->DIOposPrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->DIOposPrimePosPtr = SMPmakeElt(matrix,here->DIOposPrimeNode,here->DIOposNode))==(double *)((void *)0)){ return(8);}
            if((here->DIOposPrimeNegPtr = SMPmakeElt(matrix,here->DIOposPrimeNode,here->DIOnegNode))==(double *)((void *)0)){ return(8);}
            if((here->DIOposPosPtr = SMPmakeElt(matrix,here->DIOposNode,here->DIOposNode))==(double *)((void *)0)){ return(8);}
            if((here->DIOnegNegPtr = SMPmakeElt(matrix,here->DIOnegNode,here->DIOnegNode))==(double *)((void *)0)){ return(8);}
            if((here->DIOposPrimePosPrimePtr = SMPmakeElt(matrix,here->DIOposPrimeNode,here->DIOposPrimeNode))==(double *)((void *)0)){ return(8);}
        }
    }
    return(0);
}

canonical_original_code:
int DIOsetup(void *matrix, struct sGENmodel *inModel, struct CKTcircuit *ckt, int *states)
{
    struct sDIOmodel *model = (DIOmodel*)inModel;
    struct sDIOinstance *here;
    int error;
    struct sCKTnode *tmp;
    for( ; model != ((void *)0); model = model->DIOnextModel ) {
        if(!model->DIOemissionCoeffGiven) {
            model->DIOemissionCoeff = 1;
        }
        if(!model->DIOsatCurGiven) {
            model->DIOsatCur = 1e-14;
        }
        if(!model->DIOsatSWCurGiven) {
            model->DIOsatSWCur = 0.0;
        }
        if(!model->DIObreakdownCurrentGiven) {
            model->DIObreakdownCurrent = 1e-3;
        }
        if(!model->DIOjunctionPotGiven){
            model->DIOjunctionPot = 1;
        }
        if(!model->DIOgradingCoeffGiven) {
            model->DIOgradingCoeff = .5;
        }
 if(!model->DIOgradCoeffTemp1Given) {
            model->DIOgradCoeffTemp1 = 0.0;
        }
 if(!model->DIOgradCoeffTemp2Given) {
            model->DIOgradCoeffTemp2 = 0.0;
        }
        if(!model->DIOdepletionCapCoeffGiven) {
            model->DIOdepletionCapCoeff = .5;
        }
 if(!model->DIOdepletionSWcapCoeffGiven) {
            model->DIOdepletionSWcapCoeff = .5;
        }
        if(!model->DIOtransitTimeGiven) {
            model->DIOtransitTime = 0;
        }
 if(!model->DIOtranTimeTemp1Given) {
            model->DIOtranTimeTemp1 = 0.0;
        }
 if(!model->DIOtranTimeTemp2Given) {
            model->DIOtranTimeTemp2 = 0.0;
        }
        if(!model->DIOjunctionCapGiven) {
            model->DIOjunctionCap = 0;
        }
        if(!model->DIOjunctionSWCapGiven) {
            model->DIOjunctionSWCap = 0;
        }
        if(!model->DIOjunctionSWPotGiven){
            model->DIOjunctionSWPot = 1;
        }
        if(!model->DIOgradingSWCoeffGiven) {
            model->DIOgradingSWCoeff = .33;
        }
        if(!model->DIOforwardKneeCurrentGiven) {
            model->DIOforwardKneeCurrent = 1e-3;
        }
        if(!model->DIOreverseKneeCurrentGiven) {
            model->DIOreverseKneeCurrent = 1e-3;
        }
        if(!model->DIOactivationEnergyGiven) {
            model->DIOactivationEnergy = 1.11;
        }
        if(!model->DIOsaturationCurrentExpGiven) {
            model->DIOsaturationCurrentExp = 3;
        }
 if(!model->DIOfNcoefGiven) {
     model->DIOfNcoef = 0.0;
 }
 if(!model->DIOfNexpGiven) {
     model->DIOfNexp = 1.0;
 }
 if(!model->DIOresistTemp1Given) {
     model->DIOresistTemp1 = 0.0;
 }
        if(!model->DIOresistTemp2Given) {
     model->DIOresistTemp2 = 0.0;
 }
        for (here = model->DIOinstances; here != ((void *)0) ;
                here=here->DIOnextInstance) {
     if (here->DIOowner != ARCHme) goto matrixpointers;
            if(!here->DIOareaGiven) {
                here->DIOarea = 1;
            }
            if(!here->DIOpjGiven) {
                here->DIOpj = 0;
            }
            if(!here->DIOmGiven) {
                here->DIOm = 1;
            }
            here->DIOstate = *states;
            *states += 5;
            if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & 0x2) ){
                *states += 2 * (ckt->CKTsenInfo->SENparms);
            }
matrixpointers:
            if(model->DIOresist == 0) {
                here->DIOposPrimeNode = here->DIOposNode;
            } else if(here->DIOposPrimeNode == 0) {
             struct sCKTnode *tmpNode;
               char *tmpName;
                error = CKTmkVolt(ckt,&tmp,here->DIOname,"internal");
                if(error) return(error);
                here->DIOposPrimeNode = tmp->number;
                if (ckt->CKTcopyNodesets) {
                  if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==0) {
                     if (tmpNode->nsGiven) {
                       tmp->nodeset=tmpNode->nodeset;
                       tmp->nsGiven=tmpNode->nsGiven;
                     }
                  }
                }
            }
            if((here->DIOposPosPrimePtr = SMPmakeElt(matrix,here->DIOposNode,here->DIOposPrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->DIOnegPosPrimePtr = SMPmakeElt(matrix,here->DIOnegNode,here->DIOposPrimeNode))==(double *)((void *)0)){ return(8);}
            if((here->DIOposPrimePosPtr = SMPmakeElt(matrix,here->DIOposPrimeNode,here->DIOposNode))==(double *)((void *)0)){ return(8);}
            if((here->DIOposPrimeNegPtr = SMPmakeElt(matrix,here->DIOposPrimeNode,here->DIOnegNode))==(double *)((void *)0)){ return(8);}
            if((here->DIOposPosPtr = SMPmakeElt(matrix,here->DIOposNode,here->DIOposNode))==(double *)((void *)0)){ return(8);}
            if((here->DIOnegNegPtr = SMPmakeElt(matrix,here->DIOnegNode,here->DIOnegNode))==(double *)((void *)0)){ return(8);}
            if((here->DIOposPrimePosPrimePtr = SMPmakeElt(matrix,here->DIOposPrimeNode,here->DIOposPrimeNode))==(double *)((void *)0)){ return(8);}
        }
    }
    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 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: 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 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]; }


JFETacLoad

original_code:
int
JFETacLoad(GENmodel *inModel, CKTcircuit *ckt)
{
    JFETmodel *model = (JFETmodel*)inModel;
    JFETinstance *here;
    double gdpr;
    double gspr;
    double gm;
    double gds;
    double ggs;
    double xgs;
    double ggd;
    double xgd;
    double m;
    for( ; model != ((void *)0); model = model->JFETnextModel ) {
        for( here = model->JFETinstances; here != ((void *)0);
                here = here->JFETnextInstance) {
     if (here->JFETowner != ARCHme) continue;
            gdpr=model->JFETdrainConduct * here->JFETarea;
            gspr=model->JFETsourceConduct * here->JFETarea;
            gm= *(ckt->CKTstates[0] + here->JFETstate+5) ;
            gds= *(ckt->CKTstates[0] + here->JFETstate+6) ;
            ggs= *(ckt->CKTstates[0] + here->JFETstate+7) ;
            xgs= *(ckt->CKTstates[0] + here->JFETstate+9) * ckt->CKTomega ;
            ggd= *(ckt->CKTstates[0] + here->JFETstate+8) ;
            xgd= *(ckt->CKTstates[0] + here->JFETstate+11) * ckt->CKTomega ;
            m = here->JFETm;
            *(here->JFETdrainDrainPtr ) += m * (gdpr);
            *(here->JFETgateGatePtr ) += m * (ggd+ggs);
            *(here->JFETgateGatePtr +1) += m * (xgd+xgs);
            *(here->JFETsourceSourcePtr ) += m * (gspr);
            *(here->JFETdrainPrimeDrainPrimePtr ) += m * (gdpr+gds+ggd);
            *(here->JFETdrainPrimeDrainPrimePtr +1) += m * (xgd);
            *(here->JFETsourcePrimeSourcePrimePtr ) += m * (gspr+gds+gm+ggs);
            *(here->JFETsourcePrimeSourcePrimePtr +1) += m * (xgs);
            *(here->JFETdrainDrainPrimePtr ) -= m * (gdpr);
            *(here->JFETgateDrainPrimePtr ) -= m * (ggd);
            *(here->JFETgateDrainPrimePtr +1) -= m * (xgd);
            *(here->JFETgateSourcePrimePtr ) -= m * (ggs);
            *(here->JFETgateSourcePrimePtr +1) -= m * (xgs);
            *(here->JFETsourceSourcePrimePtr ) -= m * (gspr);
            *(here->JFETdrainPrimeDrainPtr ) -= m * (gdpr);
            *(here->JFETdrainPrimeGatePtr ) += m * (-ggd+gm);
            *(here->JFETdrainPrimeGatePtr +1) -= m * (xgd);
            *(here->JFETdrainPrimeSourcePrimePtr ) += m * (-gds-gm);
            *(here->JFETsourcePrimeGatePtr ) += m * (-ggs-gm);
            *(here->JFETsourcePrimeGatePtr +1) -= m * (xgs);
            *(here->JFETsourcePrimeSourcePtr ) -= m * (gspr);
            *(here->JFETsourcePrimeDrainPrimePtr ) -= m * (gds);
        }
    }
    return(0);
}

canonical_original_code:
int JFETacLoad(struct sGENmodel *inModel, struct CKTcircuit *ckt)
{
    struct sJFETmodel *model = (JFETmodel*)inModel;
    struct sJFETinstance *here;
    double gdpr;
    double gspr;
    double gm;
    double gds;
    double ggs;
    double xgs;
    double ggd;
    double xgd;
    double m;
    for( ; model != ((void *)0); model = model->JFETnextModel ) {
        for( here = model->JFETinstances; here != ((void *)0);
                here = here->JFETnextInstance) {
     if (here->JFETowner != ARCHme) continue;
            gdpr=model->JFETdrainConduct * here->JFETarea;
            gspr=model->JFETsourceConduct * here->JFETarea;
            gm= *(ckt->CKTstates[0] + here->JFETstate+5) ;
            gds= *(ckt->CKTstates[0] + here->JFETstate+6) ;
            ggs= *(ckt->CKTstates[0] + here->JFETstate+7) ;
            xgs= *(ckt->CKTstates[0] + here->JFETstate+9) * ckt->CKTomega ;
            ggd= *(ckt->CKTstates[0] + here->JFETstate+8) ;
            xgd= *(ckt->CKTstates[0] + here->JFETstate+11) * ckt->CKTomega ;
            m = here->JFETm;
            *(here->JFETdrainDrainPtr ) += m * (gdpr);
            *(here->JFETgateGatePtr ) += m * (ggd+ggs);
            *(here->JFETgateGatePtr +1) += m * (xgd+xgs);
            *(here->JFETsourceSourcePtr ) += m * (gspr);
            *(here->JFETdrainPrimeDrainPrimePtr ) += m * (gdpr+gds+ggd);
            *(here->JFETdrainPrimeDrainPrimePtr +1) += m * (xgd);
            *(here->JFETsourcePrimeSourcePrimePtr ) += m * (gspr+gds+gm+ggs);
            *(here->JFETsourcePrimeSourcePrimePtr +1) += m * (xgs);
            *(here->JFETdrainDrainPrimePtr ) -= m * (gdpr);
            *(here->JFETgateDrainPrimePtr ) -= m * (ggd);
            *(here->JFETgateDrainPrimePtr +1) -= m * (xgd);
            *(here->JFETgateSourcePrimePtr ) -= m * (ggs);
            *(here->JFETgateSourcePrimePtr +1) -= m * (xgs);
            *(here->JFETsourceSourcePrimePtr ) -= m * (gspr);
            *(here->JFETdrainPrimeDrainPtr ) -= m * (gdpr);
            *(here->JFETdrainPrimeGatePtr ) += m * (-ggd+gm);
            *(here->JFETdrainPrimeGatePtr +1) -= m * (xgd);
            *(here->JFETdrainPrimeSourcePrimePtr ) += m * (-gds-gm);
            *(here->JFETsourcePrimeGatePtr ) += m * (-ggs-gm);
            *(here->JFETsourcePrimeGatePtr +1) -= m * (xgs);
            *(here->JFETsourcePrimeSourcePtr ) -= m * (gspr);
            *(here->JFETsourcePrimeDrainPrimePtr ) -= m * (gds);
        }
    }
    return(0);
}

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

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

variable_types: gdpr double

variable_types: gspr double

variable_types: gm double

variable_types: gds double

variable_types: ggs double

variable_types: xgs double

variable_types: ggd double

variable_types: xgd double

variable_types: m double