LTRAmParam

original_code:
int
LTRAmParam(int param, IFvalue *value, GENmodel *inModel)
{
  LTRAmodel *mods = (LTRAmodel *) inModel;
  switch (param) {
  case 0:
    break;
  case 11:
    mods->LTRAreltol = value->rValue;
    mods->LTRAreltolGiven = 1;
    break;
  case 12:
    mods->LTRAabstol = value->rValue;
    mods->LTRAabstolGiven = 1;
    break;
  case 42:
    mods->LTRAstLineReltol = value->rValue;
    break;
  case 43:
    mods->LTRAstLineAbstol = value->rValue;
    break;
  case 44:
    mods->LTRAchopReltol = value->rValue;
    break;
  case 45:
    mods->LTRAchopAbstol = value->rValue;
    break;
  case 46:
    mods->LTRAtruncNR = 1;
    break;
  case 47:
    mods->LTRAtruncDontCut = 1;
    break;
  case 1:
    mods->LTRAresist = value->rValue;
    mods->LTRAresistGiven = 1;
    break;
  case 2:
    mods->LTRAinduct = value->rValue;
    mods->LTRAinductGiven = 1;
    break;
  case 3:
    mods->LTRAconduct = value->rValue;
    mods->LTRAconductGiven = 1;
    break;
  case 4:
    mods->LTRAcapac = value->rValue;
    mods->LTRAcapacGiven = 1;
    break;
  case 5:
    mods->LTRAlength = value->rValue;
    mods->LTRAlengthGiven = 1;
    break;
  case 22:
    mods->LTRAnl = value->rValue;
    mods->LTRAnlGiven = 1;
    break;
  case 23:
    mods->LTRAf = value->rValue;
    mods->LTRAfGiven = 1;
    break;
  case 26:
    mods->LTRAlteConType = 26;
    break;
  case 27:
    mods->LTRAlteConType = 27;
    break;
  case 28:
    mods->LTRAlteConType = 28;
    break;
  case 29:
    mods->LTRAprintFlag = 1;
    break;
  case 30:
    mods->LTRAprintFlag = 0;
    break;
  case 32:
    mods->LTRAstepLimit = 32;
    break;
  case 33:
    mods->LTRAstepLimit = 33;
    break;
  case 34:
    mods->LTRAhowToInterp = 34;
    break;
  case 35:
    mods->LTRAhowToInterp = 35;
    break;
  case 36:
    mods->LTRAhowToInterp = 36;
    break;
  default:
    return (7);
  }
  return (0);
}

canonical_original_code:
int LTRAmParam(int param, union uIFvalue *value, struct sGENmodel *inModel)
{
  struct sLTRAmodel *mods = (LTRAmodel *) inModel;
  switch (param) {
  case 0:
    break;
  case 11:
    mods->LTRAreltol = value->rValue;
    mods->LTRAreltolGiven = 1;
    break;
  case 12:
    mods->LTRAabstol = value->rValue;
    mods->LTRAabstolGiven = 1;
    break;
  case 42:
    mods->LTRAstLineReltol = value->rValue;
    break;
  case 43:
    mods->LTRAstLineAbstol = value->rValue;
    break;
  case 44:
    mods->LTRAchopReltol = value->rValue;
    break;
  case 45:
    mods->LTRAchopAbstol = value->rValue;
    break;
  case 46:
    mods->LTRAtruncNR = 1;
    break;
  case 47:
    mods->LTRAtruncDontCut = 1;
    break;
  case 1:
    mods->LTRAresist = value->rValue;
    mods->LTRAresistGiven = 1;
    break;
  case 2:
    mods->LTRAinduct = value->rValue;
    mods->LTRAinductGiven = 1;
    break;
  case 3:
    mods->LTRAconduct = value->rValue;
    mods->LTRAconductGiven = 1;
    break;
  case 4:
    mods->LTRAcapac = value->rValue;
    mods->LTRAcapacGiven = 1;
    break;
  case 5:
    mods->LTRAlength = value->rValue;
    mods->LTRAlengthGiven = 1;
    break;
  case 22:
    mods->LTRAnl = value->rValue;
    mods->LTRAnlGiven = 1;
    break;
  case 23:
    mods->LTRAf = value->rValue;
    mods->LTRAfGiven = 1;
    break;
  case 26:
    mods->LTRAlteConType = 26;
    break;
  case 27:
    mods->LTRAlteConType = 27;
    break;
  case 28:
    mods->LTRAlteConType = 28;
    break;
  case 29:
    mods->LTRAprintFlag = 1;
    break;
  case 30:
    mods->LTRAprintFlag = 0;
    break;
  case 32:
    mods->LTRAstepLimit = 32;
    break;
  case 33:
    mods->LTRAstepLimit = 33;
    break;
  case 34:
    mods->LTRAhowToInterp = 34;
    break;
  case 35:
    mods->LTRAhowToInterp = 35;
    break;
  case 36:
    mods->LTRAhowToInterp = 36;
    break;
  default:
    return (7);
  }
  return (0);
}

variable_types: param int

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

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

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

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


LTRAparam

repo: gserdyuk/gnucap-a

original_code:
int
LTRAparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
{
  LTRAinstance *here = (LTRAinstance *) inst;
  switch (param) {
  case 6:
    here->LTRAinitVolt1 = value->rValue;
    here->LTRAicV1Given = 1;
    break;
  case 7:
    here->LTRAinitCur1 = value->rValue;
    here->LTRAicC1Given = 1;
    break;
  case 8:
    here->LTRAinitVolt2 = value->rValue;
    here->LTRAicV2Given = 1;
    break;
  case 9:
    here->LTRAinitCur2 = value->rValue;
    here->LTRAicC2Given = 1;
    break;
  case 10:
    switch (value->v.numValue) {
    case 4:
      here->LTRAinitCur2 = *(value->v.vec.rVec + 3);
      break;
    case 3:
      here->LTRAinitVolt2 = *(value->v.vec.rVec + 2);
      break;
    case 2:
      here->LTRAinitCur1 = *(value->v.vec.rVec + 1);
      break;
    case 1:
      here->LTRAinitVolt1 = *(value->v.vec.rVec);
      break;
    default:
      return (7);
    }
    break;
  default:
    return (7);
  }
  return (0);
}

canonical_original_code:
int LTRAparam(int param, union uIFvalue *value, struct sGENinstance *inst, union uIFvalue *select)
{
  struct sLTRAinstance *here = (LTRAinstance *) inst;
  switch (param) {
  case 6:
    here->LTRAinitVolt1 = value->rValue;
    here->LTRAicV1Given = 1;
    break;
  case 7:
    here->LTRAinitCur1 = value->rValue;
    here->LTRAicC1Given = 1;
    break;
  case 8:
    here->LTRAinitVolt2 = value->rValue;
    here->LTRAicV2Given = 1;
    break;
  case 9:
    here->LTRAinitCur2 = value->rValue;
    here->LTRAicC2Given = 1;
    break;
  case 10:
    switch (value->v.numValue) {
    case 4:
      here->LTRAinitCur2 = *(value->v.vec.rVec + 3);
      break;
    case 3:
      here->LTRAinitVolt2 = *(value->v.vec.rVec + 2);
      break;
    case 2:
      here->LTRAinitCur1 = *(value->v.vec.rVec + 1);
      break;
    case 1:
      here->LTRAinitVolt1 = *(value->v.vec.rVec);
      break;
    default:
      return (7);
    }
    break;
  default:
    return (7);
  }
  return (0);
}

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

variable_types:
select
union uIFvalue *

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

return_type: int

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

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

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


CAPparam

original_code:
int
CAPparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
{
    CAPinstance *here = (CAPinstance*)inst;
    switch(param) {
        case 1:
            here->CAPcapac = value->rValue;
     if (!here->CAPmGiven)
         here->CAPm = 1.0;
            here->CAPcapGiven = 1;
            break;
        case 2:
            here->CAPinitCond = value->rValue;
            here->CAPicGiven = 1;
            break;
        case 8:
            here->CAPtemp = value->rValue + (273.15);
            here->CAPtempGiven = 1;
            break;
        case 9:
            here->CAPdtemp = value->rValue;
            here->CAPdtempGiven = 1;
            break;
        case 3:
            here->CAPwidth = value->rValue;
            here->CAPwidthGiven = 1;
            break;
        case 4:
            here->CAPlength = value->rValue;
            here->CAPlengthGiven = 1;
            break;
        case 11:
            here->CAPm = value->rValue;
            here->CAPmGiven = 1;
            break;
        case 10:
            here->CAPscale = value->rValue;
            here->CAPscaleGiven = 1;
            break;
        case 5:
            here->CAPsenParmNo = value->iValue;
            break;
        default:
            return(7);
    }
    return(0);
}

canonical_original_code:
int CAPparam(int param, union uIFvalue *value, struct sGENinstance *inst, union uIFvalue *select)
{
    struct sCAPinstance *here = (CAPinstance*)inst;
    switch(param) {
        case 1:
            here->CAPcapac = value->rValue;
     if (!here->CAPmGiven)
         here->CAPm = 1.0;
            here->CAPcapGiven = 1;
            break;
        case 2:
            here->CAPinitCond = value->rValue;
            here->CAPicGiven = 1;
            break;
        case 8:
            here->CAPtemp = value->rValue + (273.15);
            here->CAPtempGiven = 1;
            break;
        case 9:
            here->CAPdtemp = value->rValue;
            here->CAPdtempGiven = 1;
            break;
        case 3:
            here->CAPwidth = value->rValue;
            here->CAPwidthGiven = 1;
            break;
        case 4:
            here->CAPlength = value->rValue;
            here->CAPlengthGiven = 1;
            break;
        case 11:
            here->CAPm = value->rValue;
            here->CAPmGiven = 1;
            break;
        case 10:
            here->CAPscale = value->rValue;
            here->CAPscaleGiven = 1;
            break;
        case 5:
            here->CAPsenParmNo = value->iValue;
            break;
        default:
            return(7);
    }
    return(0);
}

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

user_defined_types: struct sCAPinstance { struct sCAPmodel *CAPmodPtr; struct sCAPinstance *CAPnextInstance; char *CAPname; int CAPowner; int CAPstate; int CAPposNode; int CAPnegNode; double CAPtemp; double CAPdtemp; double CAPcapac; double CAPinitCond; double CAPwidth; double CAPlength; double CAPscale; double CAPm; double *CAPposPosptr; double *CAPnegNegptr; double *CAPposNegptr; double *CAPnegPosptr; unsigned int CAPcapGiven; unsigned int CAPicGiven; unsigned int CAPwidthGiven; unsigned int CAPlengthGiven; unsigned int CAPtempGiven; unsigned int CAPdtempGiven; unsigned int CAPscaleGiven; unsigned int CAPmGiven; int CAPsenParmNo; }

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


TRAparam

original_code:
int
TRAparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
{
    TRAinstance *here = (TRAinstance *)inst;
    switch(param) {
        case 10:
            here->TRAreltol = value->rValue;
            here->TRAreltolGiven = 1;
            break;
        case 11:
            here->TRAabstol = value->rValue;
            here->TRAabstolGiven = 1;
            break;
        case 1:
            here->TRAimped = value->rValue;
            here->TRAimpedGiven = 1;
            break;
        case 2:
            here->TRAtd = value->rValue;
            here->TRAtdGiven = 1;
            break;
        case 3:
            here->TRAnl= value->rValue;
            here->TRAnlGiven = 1;
            break;
        case 4:
            here->TRAf= value->rValue;
            here->TRAfGiven = 1;
            break;
        case 5:
            here->TRAinitVolt1 = value->rValue;
            here->TRAicV1Given = 1;
            break;
        case 6:
            here->TRAinitCur1 = value->rValue;
            here->TRAicC1Given = 1;
            break;
        case 7:
            here->TRAinitVolt2 = value->rValue;
            here->TRAicV2Given = 1;
            break;
        case 8:
            here->TRAinitCur2 = value->rValue;
            here->TRAicC2Given = 1;
            break;
        case 9:
            switch(value->v.numValue){
                case 4:
                    here->TRAinitCur2 = *(value->v.vec.rVec+3);
                    break;
                case 3:
                    here->TRAinitVolt2 = *(value->v.vec.rVec+2);
                    break;
                case 2:
                    here->TRAinitCur1 = *(value->v.vec.rVec+1);
                    break;
                case 1:
                    here->TRAinitVolt1 = *(value->v.vec.rVec);
                    break;
                default:
                    return(7);
            }
            break;
        default:
            return(7);
    }
    return(0);
}

canonical_original_code:
int TRAparam(int param, union uIFvalue *value, struct sGENinstance *inst, union uIFvalue *select)
{
    struct sTRAinstance *here = (TRAinstance *)inst;
    switch(param) {
        case 10:
            here->TRAreltol = value->rValue;
            here->TRAreltolGiven = 1;
            break;
        case 11:
            here->TRAabstol = value->rValue;
            here->TRAabstolGiven = 1;
            break;
        case 1:
            here->TRAimped = value->rValue;
            here->TRAimpedGiven = 1;
            break;
        case 2:
            here->TRAtd = value->rValue;
            here->TRAtdGiven = 1;
            break;
        case 3:
            here->TRAnl= value->rValue;
            here->TRAnlGiven = 1;
            break;
        case 4:
            here->TRAf= value->rValue;
            here->TRAfGiven = 1;
            break;
        case 5:
            here->TRAinitVolt1 = value->rValue;
            here->TRAicV1Given = 1;
            break;
        case 6:
            here->TRAinitCur1 = value->rValue;
            here->TRAicC1Given = 1;
            break;
        case 7:
            here->TRAinitVolt2 = value->rValue;
            here->TRAicV2Given = 1;
            break;
        case 8:
            here->TRAinitCur2 = value->rValue;
            here->TRAicC2Given = 1;
            break;
        case 9:
            switch(value->v.numValue){
                case 4:
                    here->TRAinitCur2 = *(value->v.vec.rVec+3);
                    break;
                case 3:
                    here->TRAinitVolt2 = *(value->v.vec.rVec+2);
                    break;
                case 2:
                    here->TRAinitCur1 = *(value->v.vec.rVec+1);
                    break;
                case 1:
                    here->TRAinitVolt1 = *(value->v.vec.rVec);
                    break;
                default:
                    return(7);
            }
            break;
        default:
            return(7);
    }
    return(0);
}

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

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


JFETdSetup

decompiled_code:
__int64 __fastcall JFETdSetup(__int64 a1, __int64 a2)
{
__int64 v2; // r12
__int64 v3; // r14
double v4; // xmm9_8
double v5; // xmm12_8
double v6; // xmm6_8
double v7; // xmm8_8
double v8; // xmm4_8
double v9; // xmm8_8
double v10; // xmm11_8
double v11; // xmm10_8
double v12; // xmm4_8
double v13; // xmm9_8
double v14; // xmm7_8
double v15; // xmm3_8
double v16; // xmm2_8
double v17; // xmm15_8
double v18; // xmm0_8
double v19; // xmm6_8
double v20; // xmm2_8
double v21; // xmm12_8
double v22; // rcx
double v23; // xmm6_8
double v24; // xmm1_8
double v25; // xmm6_8
double v26; // xmm15_8
double v27; // xmm5_8
double v28; // xmm2_8
double v29; // xmm14_8
double v30; // xmm0_8
__int64 v31; // xmm1_8
double v32; // xmm12_8
double v33; // xmm14_8
__int64 v34; // rax
double v35; // xmm3_8
double v36; // xmm4_8
double v37; // xmm7_8
double v38; // xmm1_8
double v39; // xmm5_8
int v40; // eax
double v41; // xmm1_8
double v42; // xmm5_8
double v43; // xmm2_8
double v44; // rax
double v45; // xmm8_8
double v46; // xmm0_8
double v47; // xmm6_8
double v48; // r13
double v49; // rbp
double v50; // xmm0_8
double v51; // xmm0_8
double v52; // xmm9_8
double v53; // xmm0_8
double v54; // xmm0_8
double v55; // xmm6_8
double v56; // xmm8_8
double v57; // xmm7_8
double v58; // xmm12_8
double v59; // xmm12_8
double v60; // xmm14_8
double v61; // xmm14_8
double v62; // rax
double v63; // xmm3_8
double v64; // xmm0_8
double v65; // xmm4_8
double v66; // xmm2_8
double v67; // xmm0_8
double v69; // xmm0_8
double v70; // xmm0_8
double v71; // [rsp+0h] [rbp-C0h]
double v72; // [rsp+0h] [rbp-C0h]
double v73; // [rsp+8h] [rbp-B8h]
double v74; // [rsp+8h] [rbp-B8h]
double v75; // [rsp+10h] [rbp-B0h]
double v76; // [rsp+18h] [rbp-A8h]
double v77; // [rsp+18h] [rbp-A8h]
double v78; // [rsp+20h] [rbp-A0h]
double v79; // [rsp+28h] [rbp-98h]
double v80; // [rsp+30h] [rbp-90h]
double v81; // [rsp+30h] [rbp-90h]
double v82; // [rsp+60h] [rbp-60h]
double v83; // [rsp+68h] [rbp-58h]
double v84; // [rsp+70h] [rbp-50h]
double v85; // [rsp+78h] [rbp-48h]

if ( !a1 )
return 0LL;
v2 = a1;
do
{
v3 = *(_QWORD *)(v2 + 16);
if ( v3 )
{
v4 = (double)*(int *)(v2 + 32);
do
{
v34 = *(_QWORD *)(a2 + 536);
v35 = *(double *)(v3 + 472);
v36 = *(double *)(v2 + 48);
v37 = *(double *)(v3 + 504) * v35;
v38 = *(double *)(v34 + 8LL * *(int *)(v3 + 32)) - *(double *)(v34 + 8LL * *(int *)(v3 + 44));
v39 = *(double *)(v34 + 8LL * *(int *)(v3 + 32)) - *(double *)(v34 + 8LL * *(int *)(v3 + 40));
v40 = 1;
v41 = v38 * v4;
v42 = v39 * v4;
v43 = v41 - v42;
if ( v41 - v42 < 0.0 )
{
v44 = v42;
*(_QWORD *)&v43 ^= LC2;
v42 = v41;
v41 = v44;
v40 = -1;
}
v45 = *(double *)(v3 + 496);
v46 = CONSTKoverQ;
*(_DWORD *)(v3 + 168) = v40;
v47 = v45 * v46;
if ( v45 * -5.0 * v46 < v41 )
{
v81 = v42;
v74 = v36;
v51 = exp(v41 / v47);
v47 = *(double *)(v3 + 496) * CONSTKoverQ;
v52 = v51;
v53 = *(double *)(a2 + 824);
v42 = v81;
v36 = v74;
v79 = v52 * v37 / v47 + v53;
v75 = (v79 - v53) / (v47 + v47);
v48 = v75 / (3.0 * v47);
}
else
{
v48 = 0.0;
v75 = 0.0;
v79 = COERCE_DOUBLE(*(_QWORD *)&v37 ^ LC2) / v41 + *(double *)(a2 + 824);
}
if ( -5.0 * v47 < v42 )
{
v77 = v36;
v72 = v42;
v54 = exp(v42 / v47);
v55 = *(double *)(v3 + 496) * CONSTKoverQ;
v56 = *(double *)(a2 + 824);
v42 = v72;
v57 = v37 * v54 / v55;
v78 = v57 + v56;
v73 = (v57 + v56 - v56) / (v55 + v55);
v49 = v73 / (v55 * 3.0);
v36 = v77;
}
else
{
v49 = 0.0;
v73 = 0.0;
v78 = COERCE_DOUBLE(*(_QWORD *)&v37 ^ LC2) / v42 + *(double *)(a2 + 824);
}
v50 = v41 - *(double *)(v2 + 40);
if ( v50 > 0.0 )
{
v5 = *(double *)(v2 + 56);
v6 = v36 * v35;
v7 = (v5 * v43 + 1.0) * (v36 * v35);
v8 = v5 + v5;
v9 = v7 + v7;
if ( v43 < v50 )
{
v13 = v9 * v43;
v14 = (v43 * v8 + 1.0) * (v6 + v6);
v63 = 3.0 * v5 * v43;
v11 = (v8 * v50 - 1.0 - v63) * (v6 + v6);
v64 = v50 - v43 + v50 - v43;
v65 = (v41 - *(double *)(v2 + 40)) * 4.0 * v43;
v66 = v43 * v63;
v9 = 0.0;
v10 = 4.0 * v6 * v5;
v15 = -6.0 * v6 * v5;
v67 = v64 + v65 * v5;
v12 = 0.0;
v80 = (v67 - v66) * v6;
}
else
{
v10 = 0.0;
v11 = 0.0;
v12 = v8 * v6;
v13 = v50 * v9;
v14 = v50 * v12;
v80 = v5 * v6 * v50 * v50;
v15 = 0.0;
}
}
else
{
v10 = 0.0;
v12 = 0.0;
v14 = 0.0;
v80 = 0.0;
v9 = 0.0;
v13 = 0.0;
v15 = 0.0;
v11 = 0.0;
}
v16 = *(double *)(v3 + 472);
v17 = *(double *)(v3 + 536);
v18 = *(double *)(v3 + 512);
v19 = *(double *)(v3 + 520) * v16;
v20 = v16 * *(double *)(v3 + 528);
v21 = v18 + v18;
v71 = *(double *)(v2 + 152);
v22 = v20;
if ( v17 > v41 )
{
v60 = 1.0 - v41 / v18;
if ( v60 < 0.0 )
{
v83 = v42;
v82 = v12;
v70 = sqrt(v60);
v17 = *(double *)(v3 + 536);
v61 = v70;
v22 = v20;
v18 = *(double *)(v3 + 512);
v12 = v82;
v62 = v18 + v18;
v42 = v83;
}
else
{
v61 = sqrt(v60);
v62 = v18 + v18;
}
v24 = v19 / v61;
v25 = v19 / v61 / (4.0 * v18 * v61 * v61);
v76 = v25 / (v61 * (v62 * v61));
}
else
{
v23 = v19 / v71;
v76 = 0.0;
v24 = (v41 / v21 + *(double *)(v2 + 160)) * v23;
v25 = v23 / v21 * 0.5;
}
if ( v17 > v42 )
{
v58 = 1.0 - v42 / v18;
if ( v58 < 0.0 )
{
v85 = v22;
v84 = v12;
v69 = sqrt(v58);
v12 = v84;
v22 = v85;
v59 = v69;
v18 = *(double *)(v3 + 512);
}
else
{
v59 = sqrt(v58);
}
v27 = v22 / v59;
v28 = v22 / v59 / (4.0 * v18 * v59 * v59);
v26 = v28 / (v59 * ((v18 + v18) * v59));
}
else
{
v26 = 0.0;
v27 = (v42 / v21 + *(double *)(v2 + 160)) * (v22 / v71);
v28 = v22 / v71 / v21 * 0.5;
}
if ( *(_DWORD *)(v3 + 168) == 1 )
{
*(double *)(v3 + 280) = v48;
v33 = v12;
*(double *)(v3 + 304) = v27;
*(double *)(v3 + 184) = v80;
*(double *)(v3 + 296) = v24;
v31 = 0LL;
*(double *)(v3 + 248) = v79;
*(double *)(v3 + 288) = v49;
*(double *)(v3 + 256) = v78;
v30 = v9;
*(double *)(v3 + 176) = v13;
*(double *)(v3 + 328) = v76;
*(double *)(v3 + 336) = v26;
}
else
{
*(double *)(v3 + 296) = v27;
v29 = v14 + v14;
v14 = v14 + v9;
*(double *)(v3 + 280) = v49;
*(double *)(v3 + 288) = v48;
*(_QWORD *)(v3 + 176) = *(_QWORD *)&v13 ^ LC2;
*(_QWORD *)&v30 = *(_QWORD *)&v9 ^ LC2;
*(double *)(v3 + 304) = v24;
v31 = LC1;
*(double *)(v3 + 328) = v26;
*(double *)(v3 + 336) = v76;
v15 = v15 + 0.0 + (v12 + v10) * 3.0;
*(double *)(v3 + 184) = v80 + v13;
v32 = v11 + v9 + v29;
v33 = v12 + 0.0;
*(_QWORD *)&v11 = *(_QWORD *)&v32 ^ LC2;
*(_QWORD *)&v10 = COERCE_UNSIGNED_INT64(v10 + v12 + v12 + 0.0) ^ LC2;
*(double *)(v3 + 248) = v78;
*(double *)(v3 + 256) = v79;
}
v4 = (double)*(int *)(v2 + 32);
*(_QWORD *)(v3 + 216) = v31;
*(double *)(v3 + 224) = v15 / 6.0;
*(double *)(v3 + 232) = v33 * 0.5;
*(double *)(v3 + 208) = v14 * v4;
*(double *)(v3 + 312) = v25 * v4;
*(double *)(v3 + 320) = v28 * v4;
*(double *)(v3 + 192) = v30 * (0.5 * v4);
*(double *)(v3 + 200) = 0.5 * v4 * v11;
*(double *)(v3 + 272) = v73 * v4;
*(double *)(v3 + 240) = 0.5 * v10;
*(double *)(v3 + 264) = v75 * v4;
v3 = *(_QWORD *)(v3 + 8);
}
while ( v3 );
}
v2 = *(_QWORD *)(v2 + 8);
}
while ( v2 );
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2)
{
__int64 v2; // r12
__int64 v3; // r14
double v4; // xmm9_8
double v5; // xmm12_8
double v6; // xmm6_8
double v7; // xmm8_8
double v8; // xmm4_8
double v9; // xmm8_8
double v10; // xmm11_8
double v11; // xmm10_8
double v12; // xmm4_8
double v13; // xmm9_8
double v14; // xmm7_8
double v15; // xmm3_8
double v16; // xmm2_8
double v17; // xmm15_8
double v18; // xmm0_8
double v19; // xmm6_8
double v20; // xmm2_8
double v21; // xmm12_8
double v22; // rcx
double v23; // xmm6_8
double v24; // xmm1_8
double v25; // xmm6_8
double v26; // xmm15_8
double v27; // xmm5_8
double v28; // xmm2_8
double v29; // xmm14_8
double v30; // xmm0_8
__int64 v31; // xmm1_8
double v32; // xmm12_8
double v33; // xmm14_8
__int64 v34; // rax
double v35; // xmm3_8
double v36; // xmm4_8
double v37; // xmm7_8
double v38; // xmm1_8
double v39; // xmm5_8
int v40; // eax
double v41; // xmm1_8
double v42; // xmm5_8
double v43; // xmm2_8
double v44; // rax
double v45; // xmm8_8
double v46; // xmm0_8
double v47; // xmm6_8
double v48; // r13
double v49; // rbp
double v50; // xmm0_8
double v51; // xmm0_8
double v52; // xmm9_8
double v53; // xmm0_8
double v54; // xmm0_8
double v55; // xmm6_8
double v56; // xmm8_8
double v57; // xmm7_8
double v58; // xmm12_8
double v59; // xmm12_8
double v60; // xmm14_8
double v61; // xmm14_8
double v62; // rax
double v63; // xmm3_8
double v64; // xmm0_8
double v65; // xmm4_8
double v66; // xmm2_8
double v67; // xmm0_8
double v69; // xmm0_8
double v70; // xmm0_8
double v71; // [rsp+0h] [rbp-C0h]
double v72; // [rsp+0h] [rbp-C0h]
double v73; // [rsp+8h] [rbp-B8h]
double v74; // [rsp+8h] [rbp-B8h]
double v75; // [rsp+10h] [rbp-B0h]
double v76; // [rsp+18h] [rbp-A8h]
double v77; // [rsp+18h] [rbp-A8h]
double v78; // [rsp+20h] [rbp-A0h]
double v79; // [rsp+28h] [rbp-98h]
double v80; // [rsp+30h] [rbp-90h]
double v81; // [rsp+30h] [rbp-90h]
double v82; // [rsp+60h] [rbp-60h]
double v83; // [rsp+68h] [rbp-58h]
double v84; // [rsp+70h] [rbp-50h]
double v85; // [rsp+78h] [rbp-48h]

if ( !a1 )
return 0LL;
v2 = a1;
do
{
v3 = *(_QWORD *)(v2 + 16);
if ( v3 )
{
v4 = (double)*(int *)(v2 + 32);
do
{
v34 = *(_QWORD *)(a2 + 536);
v35 = *(double *)(v3 + 472);
v36 = *(double *)(v2 + 48);
v37 = *(double *)(v3 + 504) * v35;
v38 = *(double *)(v34 + 8LL * *(int *)(v3 + 32)) - *(double *)(v34 + 8LL * *(int *)(v3 + 44));
v39 = *(double *)(v34 + 8LL * *(int *)(v3 + 32)) - *(double *)(v34 + 8LL * *(int *)(v3 + 40));
v40 = 1;
v41 = v38 * v4;
v42 = v39 * v4;
v43 = v41 - v42;
if ( v41 - v42 < 0.0 )
{
v44 = v42;
*(_QWORD *)&v43 ^= LC2;
v42 = v41;
v41 = v44;
v40 = -1;
}
v45 = *(double *)(v3 + 496);
v46 = CONSTKoverQ;
*(_DWORD *)(v3 + 168) = v40;
v47 = v45 * v46;
if ( v45 * -5.0 * v46 < v41 )
{
v81 = v42;
v74 = v36;
v51 = exp(v41 / v47);
v47 = *(double *)(v3 + 496) * CONSTKoverQ;
v52 = v51;
v53 = *(double *)(a2 + 824);
v42 = v81;
v36 = v74;
v79 = v52 * v37 / v47 + v53;
v75 = (v79 - v53) / (v47 + v47);
v48 = v75 / (3.0 * v47);
}
else
{
v48 = 0.0;
v75 = 0.0;
v79 = COERCE_DOUBLE(*(_QWORD *)&v37 ^ LC2) / v41 + *(double *)(a2 + 824);
}
if ( -5.0 * v47 < v42 )
{
v77 = v36;
v72 = v42;
v54 = exp(v42 / v47);
v55 = *(double *)(v3 + 496) * CONSTKoverQ;
v56 = *(double *)(a2 + 824);
v42 = v72;
v57 = v37 * v54 / v55;
v78 = v57 + v56;
v73 = (v57 + v56 - v56) / (v55 + v55);
v49 = v73 / (v55 * 3.0);
v36 = v77;
}
else
{
v49 = 0.0;
v73 = 0.0;
v78 = COERCE_DOUBLE(*(_QWORD *)&v37 ^ LC2) / v42 + *(double *)(a2 + 824);
}
v50 = v41 - *(double *)(v2 + 40);
if ( v50 > 0.0 )
{
v5 = *(double *)(v2 + 56);
v6 = v36 * v35;
v7 = (v5 * v43 + 1.0) * (v36 * v35);
v8 = v5 + v5;
v9 = v7 + v7;
if ( v43 < v50 )
{
v13 = v9 * v43;
v14 = (v43 * v8 + 1.0) * (v6 + v6);
v63 = 3.0 * v5 * v43;
v11 = (v8 * v50 - 1.0 - v63) * (v6 + v6);
v64 = v50 - v43 + v50 - v43;
v65 = (v41 - *(double *)(v2 + 40)) * 4.0 * v43;
v66 = v43 * v63;
v9 = 0.0;
v10 = 4.0 * v6 * v5;
v15 = -6.0 * v6 * v5;
v67 = v64 + v65 * v5;
v12 = 0.0;
v80 = (v67 - v66) * v6;
}
else
{
v10 = 0.0;
v11 = 0.0;
v12 = v8 * v6;
v13 = v50 * v9;
v14 = v50 * v12;
v80 = v5 * v6 * v50 * v50;
v15 = 0.0;
}
}
else
{
v10 = 0.0;
v12 = 0.0;
v14 = 0.0;
v80 = 0.0;
v9 = 0.0;
v13 = 0.0;
v15 = 0.0;
v11 = 0.0;
}
v16 = *(double *)(v3 + 472);
v17 = *(double *)(v3 + 536);
v18 = *(double *)(v3 + 512);
v19 = *(double *)(v3 + 520) * v16;
v20 = v16 * *(double *)(v3 + 528);
v21 = v18 + v18;
v71 = *(double *)(v2 + 152);
v22 = v20;
if ( v17 > v41 )
{
v60 = 1.0 - v41 / v18;
if ( v60 < 0.0 )
{
v83 = v42;
v82 = v12;
v70 = sqrt(v60);
v17 = *(double *)(v3 + 536);
v61 = v70;
v22 = v20;
v18 = *(double *)(v3 + 512);
v12 = v82;
v62 = v18 + v18;
v42 = v83;
}
else
{
v61 = sqrt(v60);
v62 = v18 + v18;
}
v24 = v19 / v61;
v25 = v19 / v61 / (4.0 * v18 * v61 * v61);
v76 = v25 / (v61 * (v62 * v61));
}
else
{
v23 = v19 / v71;
v76 = 0.0;
v24 = (v41 / v21 + *(double *)(v2 + 160)) * v23;
v25 = v23 / v21 * 0.5;
}
if ( v17 > v42 )
{
v58 = 1.0 - v42 / v18;
if ( v58 < 0.0 )
{
v85 = v22;
v84 = v12;
v69 = sqrt(v58);
v12 = v84;
v22 = v85;
v59 = v69;
v18 = *(double *)(v3 + 512);
}
else
{
v59 = sqrt(v58);
}
v27 = v22 / v59;
v28 = v22 / v59 / (4.0 * v18 * v59 * v59);
v26 = v28 / (v59 * ((v18 + v18) * v59));
}
else
{
v26 = 0.0;
v27 = (v42 / v21 + *(double *)(v2 + 160)) * (v22 / v71);
v28 = v22 / v71 / v21 * 0.5;
}
if ( *(_DWORD *)(v3 + 168) == 1 )
{
*(double *)(v3 + 280) = v48;
v33 = v12;
*(double *)(v3 + 304) = v27;
*(double *)(v3 + 184) = v80;
*(double *)(v3 + 296) = v24;
v31 = 0LL;
*(double *)(v3 + 248) = v79;
*(double *)(v3 + 288) = v49;
*(double *)(v3 + 256) = v78;
v30 = v9;
*(double *)(v3 + 176) = v13;
*(double *)(v3 + 328) = v76;
*(double *)(v3 + 336) = v26;
}
else
{
*(double *)(v3 + 296) = v27;
v29 = v14 + v14;
v14 = v14 + v9;
*(double *)(v3 + 280) = v49;
*(double *)(v3 + 288) = v48;
*(_QWORD *)(v3 + 176) = *(_QWORD *)&v13 ^ LC2;
*(_QWORD *)&v30 = *(_QWORD *)&v9 ^ LC2;
*(double *)(v3 + 304) = v24;
v31 = LC1;
*(double *)(v3 + 328) = v26;
*(double *)(v3 + 336) = v76;
v15 = v15 + 0.0 + (v12 + v10) * 3.0;
*(double *)(v3 + 184) = v80 + v13;
v32 = v11 + v9 + v29;
v33 = v12 + 0.0;
*(_QWORD *)&v11 = *(_QWORD *)&v32 ^ LC2;
*(_QWORD *)&v10 = COERCE_UNSIGNED_INT64(v10 + v12 + v12 + 0.0) ^ LC2;
*(double *)(v3 + 248) = v78;
*(double *)(v3 + 256) = v79;
}
v4 = (double)*(int *)(v2 + 32);
*(_QWORD *)(v3 + 216) = v31;
*(double *)(v3 + 224) = v15 / 6.0;
*(double *)(v3 + 232) = v33 * 0.5;
*(double *)(v3 + 208) = v14 * v4;
*(double *)(v3 + 312) = v25 * v4;
*(double *)(v3 + 320) = v28 * v4;
*(double *)(v3 + 192) = v30 * (0.5 * v4);
*(double *)(v3 + 200) = 0.5 * v4 * v11;
*(double *)(v3 + 272) = v73 * v4;
*(double *)(v3 + 240) = 0.5 * v10;
*(double *)(v3 + 264) = v75 * v4;
v3 = *(_QWORD *)(v3 + 8);
}
while ( v3 );
}
v2 = *(_QWORD *)(v2 + 8);
}
while ( v2 );
return 0LL;
}

original_code:
int
JFETdSetup(GENmodel *inModel, CKTcircuit *ckt)
{
    JFETmodel *model = (JFETmodel*)inModel;
    JFETinstance *here;
    double beta;
    double betap;
    double lcapgd1;
    double lcapgd2;
    double lcapgd3;
    double lcapgs2;
    double lcapgs3;
    double lcapgs1;
    double cd;
    double cdrain;
    double temp;
    double cg;
    double cgd;
    double csat;
    double czgd;
    double czgdf2;
    double czgs;
    double czgsf2;
    double evgd;
    double evgs;
    double fcpb2;
    double gdpr;
    double gds1;
    double gds2;
    double gds3;
    double lggd1;
    double lggd2;
    double lggd3;
    double lggs1;
    double lggs2;
    double lggs3;
    double gm1;
    double gm2;
    double gm3;
    double gmds;
    double gm2ds;
    double gmds2;
    double gspr;
    double sarg;
    double twob;
    double twop;
    double vds;
    double vgd;
    double vgs;
    double vgst;
    for( ; model != ((void *)0); model = model->JFETnextModel ) {
        for (here = model->JFETinstances; here != ((void *)0) ;
                here=here->JFETnextInstance) {
     if (here->JFETowner != ARCHme) continue;
            beta = model->JFETbeta * here->JFETarea * here->JFETm;
            gdpr=model->JFETdrainConduct*here->JFETarea * here->JFETm;
            gspr=model->JFETsourceConduct*here->JFETarea * here-> JFETm;
            csat=here->JFETtSatCur*here->JFETarea * here-> JFETm;
                vgs= model->JFETtype*(*(ckt->CKTrhsOld + here->JFETgateNode)
   - *(ckt->CKTrhsOld + here->JFETsourcePrimeNode));
                vgd= model->JFETtype*(*(ckt->CKTrhsOld + here->JFETgateNode)
   - *(ckt->CKTrhsOld + here->JFETdrainPrimeNode));
            vds=vgs-vgd;
     if (vds < 0.0) {
  vds = -vds;
  temp = vgs;
  vgs = vgd;
  vgd = temp;
  here->JFETmode = -1;
  } else {
  here->JFETmode = 1;
  }
            if (vgs <= -5*here->JFETtemp*CONSTKoverQ) {
                lggs1 = -csat/vgs+ckt->CKTgmin;
  lggs2=lggs3=0;
                cg = lggs1*vgs;
            } else {
                evgs = exp(vgs/(here->JFETtemp*CONSTKoverQ));
                lggs1 = csat*evgs/(here->JFETtemp*CONSTKoverQ)+ckt->CKTgmin;
  lggs2 = (lggs1-ckt->CKTgmin)/((here->JFETtemp*CONSTKoverQ)*2);
  lggs3 = lggs2/(3*(here->JFETtemp*CONSTKoverQ));
                cg = csat*(evgs-1)+ckt->CKTgmin*vgs;
            }
            if (vgd <= -5*(here->JFETtemp*CONSTKoverQ)) {
                lggd1 = -csat/vgd+ckt->CKTgmin;
  lggd2=lggd3=0;
                cgd = lggd1*vgd;
            } else {
                evgd = exp(vgd/(here->JFETtemp*CONSTKoverQ));
                lggd1 = csat*evgd/(here->JFETtemp*CONSTKoverQ)+ckt->CKTgmin;
  lggd2 = (lggd1-ckt->CKTgmin)/((here->JFETtemp*CONSTKoverQ)*2);
  lggd3 = lggd2/(3*(here->JFETtemp*CONSTKoverQ));
                cgd = csat*(evgd-1)+ckt->CKTgmin*vgd;
            }
            cg = cg+cgd;
                vgst=vgs-model->JFETthreshold;
                if (vgst <= 0) {
                    cdrain=0;
                    gm1=gm2=gm3=0;
                    gds1=gds2=gds3=0;
      gmds=gm2ds=gmds2=0;
                } else {
                    betap=beta*(1+model->JFETlModulation*vds);
                    twob=betap+betap;
                    if (vgst <= vds) {
                        cdrain=betap*vgst*vgst;
                        gm1=twob*vgst;
   gm2=twob;
   gm3=0;
                        gds1=model->JFETlModulation*beta*vgst*vgst;
   gds2=gds3=gmds2=0;
   gm2ds=2*model->JFETlModulation*beta;
   gmds=gm2ds*vgst;
                    } else {
                        cdrain=betap*vds*(vgst+vgst-vds);
                        gm1=twob*vds;
   gm2=0;
   gm3=0;
   gmds=(beta+beta)*(1+2*model->JFETlModulation*vds);
   gm2ds=0;
   gds2=2*beta*(2*model->JFETlModulation*vgst - 1 -
    3*model->JFETlModulation*vds);
                        gds1=beta*(2*(vgst-vds) + 4*vgst*vds*
  model->JFETlModulation - 3*model->JFETlModulation*vds*vds);
   gmds2=4*beta*model->JFETlModulation;
   gds3= -6*beta*model->JFETlModulation;
                    }
                }
            cd=cdrain-cgd;
                czgs=here->JFETtCGS*here->JFETarea * here->JFETm;
                czgd=here->JFETtCGD*here->JFETarea * here->JFETm;
                twop=here->JFETtGatePot+here->JFETtGatePot;
                fcpb2=here->JFETcorDepCap*here->JFETcorDepCap;
                czgsf2=czgs/model->JFETf2;
                czgdf2=czgd/model->JFETf2;
                if (vgs < here->JFETcorDepCap) {
                    sarg=sqrt(1-vgs/here->JFETtGatePot);
                    lcapgs1=czgs/sarg;
      lcapgs2=lcapgs1/(here->JFETtGatePot*4*sarg*sarg);
      lcapgs3=lcapgs2/(here->JFETtGatePot*2*sarg*sarg);
                } else {
                    lcapgs1=czgsf2*(model->JFETf3+vgs/twop);
      lcapgs2=czgsf2/twop*0.5;
      lcapgs3=0;
                }
                if (vgd < here->JFETcorDepCap) {
                    sarg=sqrt(1-vgd/here->JFETtGatePot);
                    lcapgd1=czgd/sarg;
      lcapgd2=lcapgd1/(here->JFETtGatePot*4*sarg*sarg);
      lcapgd3=lcapgd2/(here->JFETtGatePot*2*sarg*sarg);
                } else {
                    lcapgd1=czgdf2*(model->JFETf3+vgd/twop);
      lcapgd2=czgdf2/twop*0.5;
      lcapgd3=0;
                }
 if (here->JFETmode == 1)
  {
here->JFETdCoeffs[0] = gm1;
here->JFETdCoeffs[1] = gds1;
here->JFETdCoeffs[2] = gm2;
here->JFETdCoeffs[3] = gds2;
here->JFETdCoeffs[4] = gmds;
here->JFETdCoeffs[5] = gm3;
here->JFETdCoeffs[6] = gds3;
here->JFETdCoeffs[7] = gm2ds;
here->JFETdCoeffs[8] = gmds2;
here->JFETdCoeffs[9] = lggs1;
here->JFETdCoeffs[10] = lggd1;
here->JFETdCoeffs[11] = lggs2;
here->JFETdCoeffs[12] = lggd2;
here->JFETdCoeffs[13] = lggs3;
here->JFETdCoeffs[14] = lggd3;
here->JFETdCoeffs[15] = lcapgs1;
here->JFETdCoeffs[16] = lcapgd1;
here->JFETdCoeffs[17] = lcapgs2;
here->JFETdCoeffs[18] = lcapgd2;
here->JFETdCoeffs[19] = lcapgs3;
here->JFETdCoeffs[20] = lcapgd3;
} else {
here->JFETdCoeffs[0] = -gm1;
here->JFETdCoeffs[1] = gm1 + gds1;
here->JFETdCoeffs[2] = -gm2;
here->JFETdCoeffs[3] = -(gm2 + gds2 + 2*gmds);
here->JFETdCoeffs[4] = gm2 + gmds;
here->JFETdCoeffs[5] = -gm3;
here->JFETdCoeffs[6] = gm3 + gds3 + 3*(gm2ds + gmds2 ) ;
here->JFETdCoeffs[7] = gm3 + gm2ds;
here->JFETdCoeffs[8] = -(gm3 + 2*gm2ds + gmds2);
here->JFETdCoeffs[9] = lggd1;
here->JFETdCoeffs[10] = lggs1;
here->JFETdCoeffs[11] = lggd2;
here->JFETdCoeffs[12] = lggs2;
here->JFETdCoeffs[13] = lggd3;
here->JFETdCoeffs[14] = lggs3;
here->JFETdCoeffs[15] = lcapgd1;
here->JFETdCoeffs[16] = lcapgs1;
here->JFETdCoeffs[17] = lcapgd2;
here->JFETdCoeffs[18] = lcapgs2;
here->JFETdCoeffs[19] = lcapgd3;
here->JFETdCoeffs[20] = lcapgs3;
}
here->JFETdCoeffs[2] = 0.5*model->JFETtype*here->JFETdCoeffs[2];
here->JFETdCoeffs[3] = 0.5*model->JFETtype*here->JFETdCoeffs[3];
here->JFETdCoeffs[4] = model->JFETtype*here->JFETdCoeffs[4];
here->JFETdCoeffs[5] = here->JFETdCoeffs[5]/6.;
here->JFETdCoeffs[6] = here->JFETdCoeffs[6]/6.;
here->JFETdCoeffs[7] = 0.5*here->JFETdCoeffs[7];
here->JFETdCoeffs[8] = 0.5*here->JFETdCoeffs[8];
here->JFETdCoeffs[11] = model->JFETtype*lggs2;
here->JFETdCoeffs[12] = model->JFETtype*lggd2;
here->JFETdCoeffs[17] = model->JFETtype*lcapgs2;
here->JFETdCoeffs[18] = model->JFETtype*lcapgd2;
   }
   }
   return(0);
   }

canonical_original_code:
int JFETdSetup(struct sGENmodel *inModel, struct CKTcircuit *ckt)
{
    struct sJFETmodel *model = (JFETmodel*)inModel;
    struct sJFETinstance *here;
    double beta;
    double betap;
    double lcapgd1;
    double lcapgd2;
    double lcapgd3;
    double lcapgs2;
    double lcapgs3;
    double lcapgs1;
    double cd;
    double cdrain;
    double temp;
    double cg;
    double cgd;
    double csat;
    double czgd;
    double czgdf2;
    double czgs;
    double czgsf2;
    double evgd;
    double evgs;
    double fcpb2;
    double gdpr;
    double gds1;
    double gds2;
    double gds3;
    double lggd1;
    double lggd2;
    double lggd3;
    double lggs1;
    double lggs2;
    double lggs3;
    double gm1;
    double gm2;
    double gm3;
    double gmds;
    double gm2ds;
    double gmds2;
    double gspr;
    double sarg;
    double twob;
    double twop;
    double vds;
    double vgd;
    double vgs;
    double vgst;
    for( ; model != ((void *)0); model = model->JFETnextModel ) {
        for (here = model->JFETinstances; here != ((void *)0) ;
                here=here->JFETnextInstance) {
     if (here->JFETowner != ARCHme) continue;
            beta = model->JFETbeta * here->JFETarea * here->JFETm;
            gdpr=model->JFETdrainConduct*here->JFETarea * here->JFETm;
            gspr=model->JFETsourceConduct*here->JFETarea * here-> JFETm;
            csat=here->JFETtSatCur*here->JFETarea * here-> JFETm;
                vgs= model->JFETtype*(*(ckt->CKTrhsOld + here->JFETgateNode)
   - *(ckt->CKTrhsOld + here->JFETsourcePrimeNode));
                vgd= model->JFETtype*(*(ckt->CKTrhsOld + here->JFETgateNode)
   - *(ckt->CKTrhsOld + here->JFETdrainPrimeNode));
            vds=vgs-vgd;
     if (vds < 0.0) {
  vds = -vds;
  temp = vgs;
  vgs = vgd;
  vgd = temp;
  here->JFETmode = -1;
  } else {
  here->JFETmode = 1;
  }
            if (vgs <= -5*here->JFETtemp*CONSTKoverQ) {
                lggs1 = -csat/vgs+ckt->CKTgmin;
  lggs2=lggs3=0;
                cg = lggs1*vgs;
            } else {
                evgs = exp(vgs/(here->JFETtemp*CONSTKoverQ));
                lggs1 = csat*evgs/(here->JFETtemp*CONSTKoverQ)+ckt->CKTgmin;
  lggs2 = (lggs1-ckt->CKTgmin)/((here->JFETtemp*CONSTKoverQ)*2);
  lggs3 = lggs2/(3*(here->JFETtemp*CONSTKoverQ));
                cg = csat*(evgs-1)+ckt->CKTgmin*vgs;
            }
            if (vgd <= -5*(here->JFETtemp*CONSTKoverQ)) {
                lggd1 = -csat/vgd+ckt->CKTgmin;
  lggd2=lggd3=0;
                cgd = lggd1*vgd;
            } else {
                evgd = exp(vgd/(here->JFETtemp*CONSTKoverQ));
                lggd1 = csat*evgd/(here->JFETtemp*CONSTKoverQ)+ckt->CKTgmin;
  lggd2 = (lggd1-ckt->CKTgmin)/((here->JFETtemp*CONSTKoverQ)*2);
  lggd3 = lggd2/(3*(here->JFETtemp*CONSTKoverQ));
                cgd = csat*(evgd-1)+ckt->CKTgmin*vgd;
            }
            cg = cg+cgd;
                vgst=vgs-model->JFETthreshold;
                if (vgst <= 0) {
                    cdrain=0;
                    gm1=gm2=gm3=0;
                    gds1=gds2=gds3=0;
      gmds=gm2ds=gmds2=0;
                } else {
                    betap=beta*(1+model->JFETlModulation*vds);
                    twob=betap+betap;
                    if (vgst <= vds) {
                        cdrain=betap*vgst*vgst;
                        gm1=twob*vgst;
   gm2=twob;
   gm3=0;
                        gds1=model->JFETlModulation*beta*vgst*vgst;
   gds2=gds3=gmds2=0;
   gm2ds=2*model->JFETlModulation*beta;
   gmds=gm2ds*vgst;
                    } else {
                        cdrain=betap*vds*(vgst+vgst-vds);
                        gm1=twob*vds;
   gm2=0;
   gm3=0;
   gmds=(beta+beta)*(1+2*model->JFETlModulation*vds);
   gm2ds=0;
   gds2=2*beta*(2*model->JFETlModulation*vgst - 1 -
    3*model->JFETlModulation*vds);
                        gds1=beta*(2*(vgst-vds) + 4*vgst*vds*
  model->JFETlModulation - 3*model->JFETlModulation*vds*vds);
   gmds2=4*beta*model->JFETlModulation;
   gds3= -6*beta*model->JFETlModulation;
                    }
                }
            cd=cdrain-cgd;
                czgs=here->JFETtCGS*here->JFETarea * here->JFETm;
                czgd=here->JFETtCGD*here->JFETarea * here->JFETm;
                twop=here->JFETtGatePot+here->JFETtGatePot;
                fcpb2=here->JFETcorDepCap*here->JFETcorDepCap;
                czgsf2=czgs/model->JFETf2;
                czgdf2=czgd/model->JFETf2;
                if (vgs < here->JFETcorDepCap) {
                    sarg=sqrt(1-vgs/here->JFETtGatePot);
                    lcapgs1=czgs/sarg;
      lcapgs2=lcapgs1/(here->JFETtGatePot*4*sarg*sarg);
      lcapgs3=lcapgs2/(here->JFETtGatePot*2*sarg*sarg);
                } else {
                    lcapgs1=czgsf2*(model->JFETf3+vgs/twop);
      lcapgs2=czgsf2/twop*0.5;
      lcapgs3=0;
                }
                if (vgd < here->JFETcorDepCap) {
                    sarg=sqrt(1-vgd/here->JFETtGatePot);
                    lcapgd1=czgd/sarg;
      lcapgd2=lcapgd1/(here->JFETtGatePot*4*sarg*sarg);
      lcapgd3=lcapgd2/(here->JFETtGatePot*2*sarg*sarg);
                } else {
                    lcapgd1=czgdf2*(model->JFETf3+vgd/twop);
      lcapgd2=czgdf2/twop*0.5;
      lcapgd3=0;
                }
 if (here->JFETmode == 1)
  {
here->JFETdCoeffs[0] = gm1;
here->JFETdCoeffs[1] = gds1;
here->JFETdCoeffs[2] = gm2;
here->JFETdCoeffs[3] = gds2;
here->JFETdCoeffs[4] = gmds;
here->JFETdCoeffs[5] = gm3;
here->JFETdCoeffs[6] = gds3;
here->JFETdCoeffs[7] = gm2ds;
here->JFETdCoeffs[8] = gmds2;
here->JFETdCoeffs[9] = lggs1;
here->JFETdCoeffs[10] = lggd1;
here->JFETdCoeffs[11] = lggs2;
here->JFETdCoeffs[12] = lggd2;
here->JFETdCoeffs[13] = lggs3;
here->JFETdCoeffs[14] = lggd3;
here->JFETdCoeffs[15] = lcapgs1;
here->JFETdCoeffs[16] = lcapgd1;
here->JFETdCoeffs[17] = lcapgs2;
here->JFETdCoeffs[18] = lcapgd2;
here->JFETdCoeffs[19] = lcapgs3;
here->JFETdCoeffs[20] = lcapgd3;
} else {
here->JFETdCoeffs[0] = -gm1;
here->JFETdCoeffs[1] = gm1 + gds1;
here->JFETdCoeffs[2] = -gm2;
here->JFETdCoeffs[3] = -(gm2 + gds2 + 2*gmds);
here->JFETdCoeffs[4] = gm2 + gmds;
here->JFETdCoeffs[5] = -gm3;
here->JFETdCoeffs[6] = gm3 + gds3 + 3*(gm2ds + gmds2 ) ;
here->JFETdCoeffs[7] = gm3 + gm2ds;
here->JFETdCoeffs[8] = -(gm3 + 2*gm2ds + gmds2);
here->JFETdCoeffs[9] = lggd1;
here->JFETdCoeffs[10] = lggs1;
here->JFETdCoeffs[11] = lggd2;
here->JFETdCoeffs[12] = lggs2;
here->JFETdCoeffs[13] = lggd3;
here->JFETdCoeffs[14] = lggs3;
here->JFETdCoeffs[15] = lcapgd1;
here->JFETdCoeffs[16] = lcapgs1;
here->JFETdCoeffs[17] = lcapgd2;
here->JFETdCoeffs[18] = lcapgs2;
here->JFETdCoeffs[19] = lcapgd3;
here->JFETdCoeffs[20] = lcapgs3;
}
here->JFETdCoeffs[2] = 0.5*model->JFETtype*here->JFETdCoeffs[2];
here->JFETdCoeffs[3] = 0.5*model->JFETtype*here->JFETdCoeffs[3];
here->JFETdCoeffs[4] = model->JFETtype*here->JFETdCoeffs[4];
here->JFETdCoeffs[5] = here->JFETdCoeffs[5]/6.;
here->JFETdCoeffs[6] = here->JFETdCoeffs[6]/6.;
here->JFETdCoeffs[7] = 0.5*here->JFETdCoeffs[7];
here->JFETdCoeffs[8] = 0.5*here->JFETdCoeffs[8];
here->JFETdCoeffs[11] = model->JFETtype*lggs2;
here->JFETdCoeffs[12] = model->JFETtype*lggd2;
here->JFETdCoeffs[17] = model->JFETtype*lcapgs2;
here->JFETdCoeffs[18] = model->JFETtype*lcapgd2;
   }
   }
   return(0);
   }

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

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

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

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

variable_types: beta double

variable_types: betap double

variable_types: cd double

variable_types: cdrain double

variable_types: temp double

variable_types: cg double

variable_types: cgd double

variable_types: csat double

variable_types: czgd double

variable_types: czgs double

variable_types: evgd double

variable_types: evgs double

variable_types: gdpr double

variable_types: gmds double

variable_types: gspr double

variable_types: sarg double

variable_types: twob double

variable_types: twop double

variable_types: vds double

variable_types: vgd double

variable_types: vgs double

variable_types: vgst double

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


INDload

original_code:
int
INDload(GENmodel *inModel, CKTcircuit *ckt)
{
    INDmodel *model = (INDmodel*)inModel;
    INDinstance *here;
    double veq;
    double req;
    int error;
    MUTinstance *muthere;
    MUTmodel *mutmodel;
    int ktype;
    int itype;
    for( ; model != ((void *)0); model = model->INDnextModel ) {
        for (here = model->INDinstances; here != ((void *)0) ;
                here=here->INDnextInstance) {
     if (here->INDowner != ARCHme) continue;
            if(!(ckt->CKTmode & (0x70|0x2000))) {
                if(ckt->CKTmode & 0x10000l && ckt->CKTmode & 0x1000) {
                    *(ckt->CKTstates[0] + here->INDstate) = here->INDinduct *
                            here->INDinitCond;
                } else {
                    *(ckt->CKTstates[0] + here->INDstate) = here->INDinduct *
                            *(ckt->CKTrhsOld + here->INDbrEq);
                }
            }
        }
    }
    ktype = CKTtypelook("mutual");
    mutmodel = (MUTmodel *)(ckt->CKThead[ktype]);
    for( ; mutmodel != ((void *)0); mutmodel = mutmodel->MUTnextModel ) {
        for (muthere = mutmodel->MUTinstances; muthere != ((void *)0) ;
                muthere=muthere->MUTnextInstance) {
     if (muthere->MUTowner != ARCHme) continue;
            if(!(ckt->CKTmode& (0x70|0x2000))) {
                *(ckt->CKTstates[0] + muthere->MUTind1->INDstate) +=
                    muthere->MUTfactor * *(ckt->CKTrhsOld +
                    muthere->MUTind2->INDbrEq);
                *(ckt->CKTstates[0] + muthere->MUTind2->INDstate) +=
                    muthere->MUTfactor * *(ckt->CKTrhsOld +
                    muthere->MUTind1->INDbrEq);
            }
            *(muthere->MUTbr1br2) -= muthere->MUTfactor*ckt->CKTag[0];
            *(muthere->MUTbr2br1) -= muthere->MUTfactor*ckt->CKTag[0];
        }
    }
    itype = CKTtypelook("Inductor");
    model = (INDmodel *)(ckt->CKThead[itype]);
    for( ; model != ((void *)0); model = model->INDnextModel ) {
        for (here = model->INDinstances; here != ((void *)0) ;
                here=here->INDnextInstance) {
     if (here->INDowner != ARCHme) continue;
            if(ckt->CKTmode & 0x70) {
                req = 0.0;
                veq = 0.0;
            } else {
                    if (ckt->CKTmode & 0x1000) {
                        *(ckt->CKTstates[1] + here->INDstate) =
                                *(ckt->CKTstates[0] + here->INDstate);
                    }
                error=NIintegrate(ckt,&req,&veq,here->INDinduct,here->INDstate);
                if(error) return(error);
            }
            *(ckt->CKTrhs+here->INDbrEq) += veq;
     if(ckt->CKTmode & 0x1000) {
                *(ckt->CKTstates[1]+here->INDstate+1) =
                    *(ckt->CKTstates[0]+here->INDstate+1);
            }
            *(here->INDposIbrptr) += 1;
            *(here->INDnegIbrptr) -= 1;
            *(here->INDibrPosptr) += 1;
            *(here->INDibrNegptr) -= 1;
            *(here->INDibrIbrptr) -= req;
        }
    }
    return(0);
}

canonical_original_code:
int INDload(struct sGENmodel *inModel, struct CKTcircuit *ckt)
{
    struct sINDmodel *model = (INDmodel*)inModel;
    struct sINDinstance *here;
    double veq;
    double req;
    int error;
    struct sMUTinstance *muthere;
    struct sMUTmodel *mutmodel;
    int ktype;
    int itype;
    for( ; model != ((void *)0); model = model->INDnextModel ) {
        for (here = model->INDinstances; here != ((void *)0) ;
                here=here->INDnextInstance) {
     if (here->INDowner != ARCHme) continue;
            if(!(ckt->CKTmode & (0x70|0x2000))) {
                if(ckt->CKTmode & 0x10000l && ckt->CKTmode & 0x1000) {
                    *(ckt->CKTstates[0] + here->INDstate) = here->INDinduct *
                            here->INDinitCond;
                } else {
                    *(ckt->CKTstates[0] + here->INDstate) = here->INDinduct *
                            *(ckt->CKTrhsOld + here->INDbrEq);
                }
            }
        }
    }
    ktype = CKTtypelook("mutual");
    mutmodel = (struct sMUTmodel *)(ckt->CKThead[ktype]);
    for( ; mutmodel != ((void *)0); mutmodel = mutmodel->MUTnextModel ) {
        for (muthere = mutmodel->MUTinstances; muthere != ((void *)0) ;
                muthere=muthere->MUTnextInstance) {
     if (muthere->MUTowner != ARCHme) continue;
            if(!(ckt->CKTmode& (0x70|0x2000))) {
                *(ckt->CKTstates[0] + muthere->MUTind1->INDstate) +=
                    muthere->MUTfactor * *(ckt->CKTrhsOld +
                    muthere->MUTind2->INDbrEq);
                *(ckt->CKTstates[0] + muthere->MUTind2->INDstate) +=
                    muthere->MUTfactor * *(ckt->CKTrhsOld +
                    muthere->MUTind1->INDbrEq);
            }
            *(muthere->MUTbr1br2) -= muthere->MUTfactor*ckt->CKTag[0];
            *(muthere->MUTbr2br1) -= muthere->MUTfactor*ckt->CKTag[0];
        }
    }
    itype = CKTtypelook("Inductor");
    model = (struct sINDmodel *)(ckt->CKThead[itype]);
    for( ; model != ((void *)0); model = model->INDnextModel ) {
        for (here = model->INDinstances; here != ((void *)0) ;
                here=here->INDnextInstance) {
     if (here->INDowner != ARCHme) continue;
            if(ckt->CKTmode & 0x70) {
                req = 0.0;
                veq = 0.0;
            } else {
                    if (ckt->CKTmode & 0x1000) {
                        *(ckt->CKTstates[1] + here->INDstate) =
                                *(ckt->CKTstates[0] + here->INDstate);
                    }
                error=NIintegrate(ckt,&req,&veq,here->INDinduct,here->INDstate);
                if(error) return(error);
            }
            *(ckt->CKTrhs+here->INDbrEq) += veq;
     if(ckt->CKTmode & 0x1000) {
                *(ckt->CKTstates[1]+here->INDstate+1) =
                    *(ckt->CKTstates[0]+here->INDstate+1);
            }
            *(here->INDposIbrptr) += 1;
            *(here->INDnegIbrptr) -= 1;
            *(here->INDibrPosptr) += 1;
            *(here->INDibrNegptr) -= 1;
            *(here->INDibrIbrptr) -= req;
        }
    }
    return(0);
}

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

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

variable_types: struct 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: veq double

variable_types: req double

variable_types: error int

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

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

variable_types: ktype int

variable_types: itype int

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


DIOconvTest

original_code:
int
DIOconvTest(GENmodel *inModel, CKTcircuit *ckt)
{
    DIOmodel *model = (DIOmodel*)inModel;
    DIOinstance *here;
    double delvd,vd,cdhat,cd;
    double tol;
    for( ; model != ((void *)0); model = model->DIOnextModel ) {
        for (here = model->DIOinstances; here != ((void *)0) ;
                here=here->DIOnextInstance) {
     if (here->DIOowner != ARCHme) continue;
            vd = *(ckt->CKTrhsOld+here->DIOposPrimeNode)-
                    *(ckt->CKTrhsOld + here->DIOnegNode);
            delvd=vd- *(ckt->CKTstates[0] + here->DIOstate);
            cdhat= *(ckt->CKTstates[0] + here->DIOstate+1) +
                    *(ckt->CKTstates[0] + here->DIOstate+2) * delvd;
            cd= *(ckt->CKTstates[0] + here->DIOstate+1);
            tol=ckt->CKTreltol*
                    ((fabs(cdhat)) > (fabs(cd)) ? (fabs(cdhat)) : (fabs(cd)))+ckt->CKTabstol;
            if (fabs(cdhat-cd) > tol) {
                ckt->CKTnoncon++;
  ckt->CKTtroubleElt = (GENinstance *) here;
                return(0);
            }
        }
    }
    return(0);
}

canonical_original_code:
int DIOconvTest(struct sGENmodel *inModel, struct CKTcircuit *ckt)
{
    struct sDIOmodel *model = (DIOmodel*)inModel;
    struct sDIOinstance *here;
    double delvd; double vd; double cdhat; double cd;
    double tol;
    for( ; model != ((void *)0); model = model->DIOnextModel ) {
        for (here = model->DIOinstances; here != ((void *)0) ;
                here=here->DIOnextInstance) {
     if (here->DIOowner != ARCHme) continue;
            vd = *(ckt->CKTrhsOld+here->DIOposPrimeNode)-
                    *(ckt->CKTrhsOld + here->DIOnegNode);
            delvd=vd- *(ckt->CKTstates[0] + here->DIOstate);
            cdhat= *(ckt->CKTstates[0] + here->DIOstate+1) +
                    *(ckt->CKTstates[0] + here->DIOstate+2) * delvd;
            cd= *(ckt->CKTstates[0] + here->DIOstate+1);
            tol=ckt->CKTreltol*
                    ((fabs(cdhat)) > (fabs(cd)) ? (fabs(cdhat)) : (fabs(cd)))+ckt->CKTabstol;
            if (fabs(cdhat-cd) > tol) {
                ckt->CKTnoncon++;
  ckt->CKTtroubleElt = (struct sGENinstance *) here;
                return(0);
            }
        }
    }
    return(0);
}

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

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

variable_types: delvd double

variable_types: vd double

variable_types: cdhat double

variable_types: cd double

variable_types: tol double

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


MUTparam

original_code:
int
MUTparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
{
    MUTinstance *here = (MUTinstance*)inst;
    switch(param) {
        case 401:
            here->MUTcoupling = value->rValue;
            here->MUTindGiven = 1;
            break;
        case 402:
            here->MUTindName1 = value->uValue;
            break;
        case 403:
            here->MUTindName2 = value->uValue;
            break;
        case 404:
        here->MUTsenParmNo = value->iValue;
        break;
        default:
            return(7);
    }
    return(0);
}

canonical_original_code:
int MUTparam(int param, union uIFvalue *value, struct sGENinstance *inst, union uIFvalue *select)
{
    struct sMUTinstance *here = (MUTinstance*)inst;
    switch(param) {
        case 401:
            here->MUTcoupling = value->rValue;
            here->MUTindGiven = 1;
            break;
        case 402:
            here->MUTindName1 = value->uValue;
            break;
        case 403:
            here->MUTindName2 = value->uValue;
            break;
        case 404:
        here->MUTsenParmNo = value->iValue;
        break;
        default:
            return(7);
    }
    return(0);
}

variable_types: param int

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

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

variable_types:
select
union uIFvalue *

user_defined_types: struct sMUTmodel { int MUTmodType; struct sMUTmodel *MUTnextModel; struct sMUTinstance *MUTinstances; char *MUTmodName; }

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

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