// generated from file '../src/faust/gxamp8.dsp' by dsp2cc:
// Code generated with Faust 0.9.43 (http://faust.grame.fr)

#include "valve.h"
namespace gxamp8 {
static int 	iConst0;
static double 	fConst1;
static double 	fConst2;
static double 	fConst3;
static double 	fConst4;
static double 	fConst5;
static double 	fConst6;
static double 	fConst7;
static double 	fConst8;
static double 	fConst9;
static double 	fConst10;
static double 	fConst11;
static double 	fConst12;
static double 	fConst13;
static double 	fConst14;
static double 	fConst15;
static double 	fConst16;
static double 	fConst17;
static double 	fConst18;
static double 	fConst19;
static double 	fRec5[2];
FAUSTFLOAT 	fslider0;
FAUSTFLOAT	*fslider0_;
#define fslider0 (*fslider0_)
static double 	fRec6[2];
FAUSTFLOAT 	fslider1;
FAUSTFLOAT	*fslider1_;
#define fslider1 (*fslider1_)
static double 	fRec8[2];
static double 	fConst20;
static double 	fConst21;
static double 	fConst22;
static double 	fConst23;
static double 	fConst24;
static double 	fConst25;
static double 	fConst26;
static double 	fConst27;
static double 	fConst28;
static double 	fConst29;
static double 	fVec0[2];
static double 	fConst30;
static double 	fRec21[2];
static double 	fRec20[2];
static double 	fRec19[3];
static double 	fRec18[3];
FAUSTFLOAT 	fslider2;
FAUSTFLOAT	*fslider2_;
#define fslider2 (*fslider2_)
static double 	fRec22[2];
static double 	fConst31;
static double 	fConst32;
static double 	fConst33;
static double 	fConst34;
static double 	fConst35;
static double 	fRec23[2];
static double 	fRec17[3];
static double 	fConst36;
static double 	fConst37;
static double 	fRec16[2];
static double 	fConst38;
static double 	fConst39;
static double 	fConst40;
static double 	fConst41;
static double 	fRec26[2];
static double 	fRec25[3];
static double 	fRec24[2];
static double 	fRec15[2];
static double 	fConst42;
static double 	fRec14[2];
static double 	fRec27[2];
static double 	fRec13[3];
static double 	fRec12[2];
static double 	fConst43;
static double 	fConst44;
static double 	fConst45;
static double 	fConst46;
static double 	fRec30[2];
static double 	fRec29[3];
static double 	fRec28[2];
static double 	fRec11[2];
static double 	fRec31[2];
static double 	fRec10[3];
static double 	fRec9[2];
FAUSTFLOAT 	fslider3;
FAUSTFLOAT	*fslider3_;
#define fslider3 (*fslider3_)
static double 	fRec34[2];
static int 	IOTA;
static double 	fVec1[32768];
static int 	iConst47;
static double 	fRec33[2];
static double 	fConst48;
static double 	fRec32[2];
static double 	fConst49;
static double 	fConst50;
static double 	fConst51;
static double 	fConst52;
static double 	fConst53;
static double 	fConst54;
static double 	fConst55;
static double 	fConst56;
static double 	fConst57;
static double 	fConst58;
static double 	fConst59;
static double 	fConst60;
static double 	fConst61;
static double 	fConst62;
static double 	fConst63;
static double 	fConst64;
static double 	fConst65;
static double 	fConst66;
static double 	fConst67;
static double 	fConst68;
static double 	fConst69;
static double 	fConst70;
static double 	fConst71;
static double 	fConst72;
static double 	fConst73;
static double 	fConst74;
static double 	fConst75;
static double 	fConst76;
static double 	fConst77;
static double 	fConst78;
static double 	fRec42[3];
static double 	fVec2[2];
static double 	fConst79;
static double 	fRec41[2];
static double 	fConst80;
static double 	fRec40[2];
static double 	fRec39[3];
static double 	fVec3[2];
static double 	fConst81;
static double 	fConst82;
static double 	fRec38[2];
static double 	fRec37[3];
static double 	fConst83;
static double 	fRec36[3];
static double 	fConst84;
static double 	fConst85;
static double 	fConst86;
static double 	fConst87;
static double 	fRec46[2];
static double 	fRec45[3];
static double 	fVec4[2];
static double 	fConst88;
static double 	fConst89;
static double 	fRec44[2];
static double 	fRec43[3];
static double 	fConst90;
static double 	fConst91;
static double 	fConst92;
static double 	fConst93;
static double 	fRec50[2];
static double 	fRec49[3];
static double 	fConst94;
static double 	fRec48[3];
static double 	fRec47[3];
static double 	fRec52[2];
static double 	fRec51[3];
static double 	fVec5[2];
static double 	fRec35[2];
static double 	fVec6[2];
static double 	fRec7[2];
static double 	fRec4[3];
static double 	fConst95;
static double 	fRec3[2];
static double 	fRec55[2];
static double 	fRec54[3];
static double 	fRec53[2];
static double 	fVec7[3];
static double 	fConst96;
static double 	fConst97;
static double 	fRec2[3];
static double 	fConst98;
static double 	fConst99;
static double 	fRec1[3];
static double 	fConst100;
static double 	fConst101;
static double 	fRec0[3];
static int	fSamplingFreq;

static void clear_state(PluginDef* = 0)
{
	for (int i=0; i<2; i++) fRec5[i] = 0;
	for (int i=0; i<2; i++) fRec6[i] = 0;
	for (int i=0; i<2; i++) fRec8[i] = 0;
	for (int i=0; i<2; i++) fVec0[i] = 0;
	for (int i=0; i<2; i++) fRec21[i] = 0;
	for (int i=0; i<2; i++) fRec20[i] = 0;
	for (int i=0; i<3; i++) fRec19[i] = 0;
	for (int i=0; i<3; i++) fRec18[i] = 0;
	for (int i=0; i<2; i++) fRec22[i] = 0;
	for (int i=0; i<2; i++) fRec23[i] = 0;
	for (int i=0; i<3; i++) fRec17[i] = 0;
	for (int i=0; i<2; i++) fRec16[i] = 0;
	for (int i=0; i<2; i++) fRec26[i] = 0;
	for (int i=0; i<3; i++) fRec25[i] = 0;
	for (int i=0; i<2; i++) fRec24[i] = 0;
	for (int i=0; i<2; i++) fRec15[i] = 0;
	for (int i=0; i<2; i++) fRec14[i] = 0;
	for (int i=0; i<2; i++) fRec27[i] = 0;
	for (int i=0; i<3; i++) fRec13[i] = 0;
	for (int i=0; i<2; i++) fRec12[i] = 0;
	for (int i=0; i<2; i++) fRec30[i] = 0;
	for (int i=0; i<3; i++) fRec29[i] = 0;
	for (int i=0; i<2; i++) fRec28[i] = 0;
	for (int i=0; i<2; i++) fRec11[i] = 0;
	for (int i=0; i<2; i++) fRec31[i] = 0;
	for (int i=0; i<3; i++) fRec10[i] = 0;
	for (int i=0; i<2; i++) fRec9[i] = 0;
	for (int i=0; i<2; i++) fRec34[i] = 0;
	for (int i=0; i<32768; i++) fVec1[i] = 0;
	for (int i=0; i<2; i++) fRec33[i] = 0;
	for (int i=0; i<2; i++) fRec32[i] = 0;
	for (int i=0; i<3; i++) fRec42[i] = 0;
	for (int i=0; i<2; i++) fVec2[i] = 0;
	for (int i=0; i<2; i++) fRec41[i] = 0;
	for (int i=0; i<2; i++) fRec40[i] = 0;
	for (int i=0; i<3; i++) fRec39[i] = 0;
	for (int i=0; i<2; i++) fVec3[i] = 0;
	for (int i=0; i<2; i++) fRec38[i] = 0;
	for (int i=0; i<3; i++) fRec37[i] = 0;
	for (int i=0; i<3; i++) fRec36[i] = 0;
	for (int i=0; i<2; i++) fRec46[i] = 0;
	for (int i=0; i<3; i++) fRec45[i] = 0;
	for (int i=0; i<2; i++) fVec4[i] = 0;
	for (int i=0; i<2; i++) fRec44[i] = 0;
	for (int i=0; i<3; i++) fRec43[i] = 0;
	for (int i=0; i<2; i++) fRec50[i] = 0;
	for (int i=0; i<3; i++) fRec49[i] = 0;
	for (int i=0; i<3; i++) fRec48[i] = 0;
	for (int i=0; i<3; i++) fRec47[i] = 0;
	for (int i=0; i<2; i++) fRec52[i] = 0;
	for (int i=0; i<3; i++) fRec51[i] = 0;
	for (int i=0; i<2; i++) fVec5[i] = 0;
	for (int i=0; i<2; i++) fRec35[i] = 0;
	for (int i=0; i<2; i++) fVec6[i] = 0;
	for (int i=0; i<2; i++) fRec7[i] = 0;
	for (int i=0; i<3; i++) fRec4[i] = 0;
	for (int i=0; i<2; i++) fRec3[i] = 0;
	for (int i=0; i<2; i++) fRec55[i] = 0;
	for (int i=0; i<3; i++) fRec54[i] = 0;
	for (int i=0; i<2; i++) fRec53[i] = 0;
	for (int i=0; i<3; i++) fVec7[i] = 0;
	for (int i=0; i<3; i++) fRec2[i] = 0;
	for (int i=0; i<3; i++) fRec1[i] = 0;
	for (int i=0; i<3; i++) fRec0[i] = 0;
}

static void init(unsigned int samplingFreq, PluginDef* = 0)
{
	fSamplingFreq = samplingFreq;
	iConst0 = min(192000, max(1, fSamplingFreq));
	fConst1 = (31704.95306002819 / iConst0);
	fConst2 = (2 * cos(fConst1));
	fConst3 = (0.026178010471204185 * sin(fConst1));
	fConst4 = (fConst3 - 1);
	fConst5 = (49574.33207364693 / iConst0);
	fConst6 = (2 * cos(fConst5));
	fConst7 = (0.07042253521126761 * sin(fConst5));
	fConst8 = (fConst7 - 1);
	fConst9 = (60601.32228774711 / iConst0);
	fConst10 = (2 * cos(fConst9));
	fConst11 = (0.03546099290780142 * sin(fConst9));
	fConst12 = (fConst11 - 1);
	fConst13 = (1.0 / tan((97.38937226128358 / iConst0)));
	fConst14 = (1 + fConst13);
	fConst15 = (0 - ((1 - fConst13) / fConst14));
	fConst16 = (1.0 / tan((20517.741620594938 / iConst0)));
	fConst17 = (1 + fConst16);
	fConst18 = (0 - ((1 - fConst16) / fConst17));
	fConst19 = (0.0041 / fConst17);
	fConst20 = tan((37699.11184307752 / iConst0));
	fConst21 = (2 * (1 - (1.0 / faustpower<2>(fConst20))));
	fConst22 = (1.0 / fConst20);
	fConst23 = (1 + ((fConst22 - 0.7653668647301795) / fConst20));
	fConst24 = (1 + ((0.7653668647301795 + fConst22) / fConst20));
	fConst25 = (1.0 / fConst24);
	fConst26 = (1 + ((fConst22 - 1.8477590650225735) / fConst20));
	fConst27 = (1.0 / (1 + ((fConst22 + 1.8477590650225735) / fConst20)));
	fConst28 = (973.8937226128359 / iConst0);
	fConst29 = (1 - fConst28);
	fConst30 = (1.0 / (1 + fConst28));
	fConst31 = (2.0 / fConst24);
	fConst32 = (1.0 / tan((270.1769682087222 / iConst0)));
	fConst33 = (1 + fConst32);
	fConst34 = (0 - ((1 - fConst32) / fConst33));
	fConst35 = (0.027 / fConst33);
	fConst36 = (0 - fConst13);
	fConst37 = (0.1 / fConst14);
	fConst38 = (1.0 / tan((414.6902302738527 / iConst0)));
	fConst39 = (1 + fConst38);
	fConst40 = (0 - ((1 - fConst38) / fConst39));
	fConst41 = (0.015 / fConst39);
	fConst42 = (1.0 / fConst17);
	fConst43 = (1.0 / tan((609.4689747964198 / iConst0)));
	fConst44 = (1 + fConst43);
	fConst45 = (0 - ((1 - fConst43) / fConst44));
	fConst46 = (0.0082 / fConst44);
	IOTA = 0;
	iConst47 = int((int((0.1111111111111111 * iConst0)) & 65535));
	fConst48 = (0.009000000000000008 / iConst0);
	fConst49 = tan((942.4777960769379 / iConst0));
	fConst50 = (1.0 / faustpower<2>(fConst49));
	fConst51 = (2 * (1 - fConst50));
	fConst52 = (1.0 / fConst49);
	fConst53 = (1 + ((fConst52 - 1.0) / fConst49));
	fConst54 = (1.0 / (1 + ((1.0 + fConst52) / fConst49)));
	fConst55 = tan((3769.9111843077517 / iConst0));
	fConst56 = (1.0 / faustpower<2>(fConst55));
	fConst57 = (2 * (1 - fConst56));
	fConst58 = (1.0 / fConst55);
	fConst59 = (1 + ((fConst58 - 1.0000000000000004) / fConst55));
	fConst60 = (1 + ((fConst58 + 1.0000000000000004) / fConst55));
	fConst61 = (1.0 / fConst60);
	fConst62 = (1 + fConst58);
	fConst63 = (0 - ((1 - fConst58) / fConst62));
	fConst64 = tan((10053.096491487338 / iConst0));
	fConst65 = (1.0 / faustpower<2>(fConst64));
	fConst66 = (2 * (1 - fConst65));
	fConst67 = (1.0 / fConst64);
	fConst68 = (1 + ((fConst67 - 1.0000000000000004) / fConst64));
	fConst69 = (1 + ((1.0000000000000004 + fConst67) / fConst64));
	fConst70 = (1.0 / fConst69);
	fConst71 = (1 + fConst67);
	fConst72 = (0 - ((1 - fConst67) / fConst71));
	fConst73 = tan((47123.8898038469 / iConst0));
	fConst74 = (2 * (1 - (1.0 / faustpower<2>(fConst73))));
	fConst75 = (1.0 / fConst73);
	fConst76 = (1 + ((fConst75 - 1.414213562373095) / fConst73));
	fConst77 = (1 + ((1.414213562373095 + fConst75) / fConst73));
	fConst78 = (1.0 / fConst77);
	fConst79 = (1.0 / (fConst14 * fConst77));
	fConst80 = (1.0 / fConst71);
	fConst81 = (0 - fConst58);
	fConst82 = (1.0 / (fConst62 * fConst69));
	fConst83 = (2 * (0 - fConst56));
	fConst84 = (1 + ((fConst52 - 1.0000000000000004) / fConst49));
	fConst85 = (1.0 / (1 + ((fConst52 + 1.0000000000000004) / fConst49)));
	fConst86 = (1 + fConst52);
	fConst87 = (0 - ((1 - fConst52) / fConst86));
	fConst88 = (0 - fConst52);
	fConst89 = (1.0 / (fConst86 * fConst60));
	fConst90 = (2 * (0 - fConst50));
	fConst91 = (1 + ((fConst58 - 1.0) / fConst55));
	fConst92 = (1.0 / (1 + ((1.0 + fConst58) / fConst55)));
	fConst93 = (0 - fConst67);
	fConst94 = (2 * (0 - fConst65));
	fConst95 = (0.025 / fConst14);
	fConst96 = (0 - fConst10);
	fConst97 = (1.0 / (1 + fConst11));
	fConst98 = (0 - fConst6);
	fConst99 = (1.0 / (1 + fConst7));
	fConst100 = (0 - fConst2);
	fConst101 = (1.0 / (1 + fConst3));
	clear_state();
}

static void compute(int count, float *input0, float *output0, PluginDef *)
{
	double 	fSlow0 = (0.0010000000000000009 * pow(10,(0.05 * fslider0)));
	double 	fSlow1 = (1.000000000000001e-05 * fslider1);
	double 	fSlow2 = (0.0010000000000000009 * pow(10,(0.05 * fslider2)));
	double 	fSlow3 = fslider3;
	double 	fSlow4 = (1.25 * fSlow3);
	double 	fSlow5 = (2 * (fSlow3 - 0.5));
	double 	fSlow6 = (0.024937655860349125 * (1 - max(0, fSlow5)));
	double 	fSlow7 = pow(1e+01,(1.2 * fSlow3));
	double 	fSlow8 = (fConst85 * pow(1e+01,(2 * fSlow3)));
	double 	fSlow9 = pow(1e+01,(0.8 * fSlow3));
	double 	fSlow10 = (fConst85 * pow(1e+01,(0.9 * fSlow3)));
	double 	fSlow11 = (1 - max(0, (0 - fSlow5)));
	for (int i=0; i<count; i++) {
		fRec5[0] = ((fConst19 * (fRec4[1] + fRec4[2])) + (fConst18 * fRec5[1]));
		fRec6[0] = (fSlow0 + (0.999 * fRec6[1]));
		fRec8[0] = (fSlow1 + (0.999 * fRec8[1]));
		double fTemp0 = (double)input0[i];
		fVec0[0] = fTemp0;
		fRec21[0] = (fConst30 * ((fVec0[0] - fVec0[1]) + (fConst29 * fRec21[1])));
		fRec20[0] = (fConst30 * ((fRec21[0] - fRec21[1]) + (fConst29 * fRec20[1])));
		fRec19[0] = (fRec20[0] - (fConst27 * ((fConst26 * fRec19[2]) + (fConst21 * fRec19[1]))));
		fRec18[0] = ((fConst27 * (fRec19[2] + (fRec19[0] + (2 * fRec19[1])))) - (fConst25 * ((fConst23 * fRec18[2]) + (fConst21 * fRec18[1]))));
		fRec22[0] = (fSlow2 + (0.999 * fRec22[1]));
		fRec23[0] = ((fConst35 * (fRec17[1] + fRec17[2])) + (fConst34 * fRec23[1]));
		fRec17[0] = (Ftube(TUBE_TABLE_12AU7_68k, ((fRec23[0] + (fConst31 * (fRec22[0] * (fRec18[2] + (fRec18[0] + (2 * fRec18[1])))))) - 1.25724)) - 83.43555555555557);
		fRec16[0] = ((fConst37 * ((fConst36 * fRec17[1]) + (fConst13 * fRec17[0]))) + (fConst15 * fRec16[1]));
		fRec26[0] = ((fConst41 * (fRec25[1] + fRec25[2])) + (fConst40 * fRec26[1]));
		fRec25[0] = (Ftube(TUBE_TABLE_12AU7_250k, ((fRec26[0] + fRec15[1]) - 0.776162)) - 78.25586666666666);
		fRec24[0] = ((fConst37 * ((fConst36 * fRec25[1]) + (fConst13 * fRec25[0]))) + (fConst15 * fRec24[1]));
		fRec15[0] = ((0.6 * fRec24[0]) + fRec16[0]);
		fRec14[0] = ((fConst42 * (fRec15[0] + fRec15[1])) + (fConst18 * fRec14[1]));
		fRec27[0] = ((fConst41 * (fRec13[1] + fRec13[2])) + (fConst40 * fRec27[1]));
		fRec13[0] = (Ftube(TUBE_TABLE_12AU7_250k, ((fRec27[0] + fRec14[0]) - 0.776162)) - 78.25586666666666);
		fRec12[0] = ((fConst37 * ((fConst36 * fRec13[1]) + (fConst13 * fRec13[0]))) + (fConst15 * fRec12[1]));
		fRec30[0] = ((fConst46 * (fRec29[1] + fRec29[2])) + (fConst45 * fRec30[1]));
		fRec29[0] = (Ftube(TUBE_TABLE_12AU7_250k, ((fRec30[0] + fRec11[1]) - 0.445487)) - 75.67231707317073);
		fRec28[0] = ((fConst37 * ((fConst36 * fRec29[1]) + (fConst13 * fRec29[0]))) + (fConst15 * fRec28[1]));
		fRec11[0] = ((0.6 * fRec28[0]) + fRec12[0]);
		fRec31[0] = ((fConst46 * (fRec10[1] + fRec10[2])) + (fConst45 * fRec31[1]));
		fRec10[0] = (Ftube(TUBE_TABLE_12AU7_250k, ((fRec31[0] + fRec11[0]) - 0.445487)) - 75.67231707317073);
		fRec9[0] = ((fConst37 * ((fConst36 * fRec10[1]) + (fConst13 * fRec10[0]))) + (fConst15 * fRec9[1]));
		double fTemp1 = (fRec9[0] * (1 - fRec8[0]));
		double fTemp2 = (fRec9[0] * fRec8[0]);
		double fTemp3 = fabs(fTemp2);
		fRec34[0] = ((9.999999999998899e-05 * fTemp3) + (0.9999 * fRec34[1]));
		double fTemp4 = max(fRec34[0], fTemp3);
		fVec1[IOTA&32767] = fTemp4;
		fRec33[0] = ((fVec1[IOTA&32767] + fRec33[1]) - fVec1[(IOTA-iConst47)&32767]);
		fRec32[0] = ((fConst48 * fRec33[0]) + (0.999 * fRec32[1]));
		double fTemp5 = max(-1.0, min(-0.01, (fVec1[IOTA&32767] - (1.0 + (1.02 * fRec32[0])))));
		double fTemp6 = (0 - fTemp5);
		double fTemp7 = (40.1 * fTemp6);
		double fTemp8 = max(-600, fTemp7);
		double fTemp9 = (0 - fTemp8);
		double fTemp10 = (fTemp2 - fTemp5);
		double fTemp11 = (40.1 * fTemp10);
		double fTemp12 = max(-600, fTemp11);
		double fTemp13 = (0 - fTemp12);
		double fTemp14 = (((int((fabs(fTemp11) > 0.0001)))?((int((fTemp12 < -50)))?(exp(fTemp12) * fTemp13):(fTemp12 / (1 - exp(fTemp13)))):(1 + (fTemp10 * (20.05 + (134.00083333333336 * fTemp10))))) - ((int((fabs(fTemp7) > 0.0001)))?((int((fTemp8 < -50)))?(exp(fTemp8) * fTemp9):(fTemp8 / (1 - exp(fTemp9)))):(1 + (fTemp6 * (20.05 + (134.00083333333336 * fTemp6))))));
		double fTemp15 = (fConst51 * fRec36[1]);
		fRec42[0] = ((0.024937655860349125 * fTemp14) - (fConst78 * ((fConst76 * fRec42[2]) + (fConst74 * fRec42[1]))));
		double fTemp16 = (fRec42[2] + (fRec42[0] + (2 * fRec42[1])));
		fVec2[0] = fTemp16;
		fRec41[0] = ((fConst79 * ((fConst36 * fVec2[1]) + (fConst13 * fVec2[0]))) + (fConst15 * fRec41[1]));
		fRec40[0] = ((fConst80 * (fRec41[0] + fRec41[1])) + (fConst72 * fRec40[1]));
		fRec39[0] = (fRec40[0] - (fConst70 * ((fConst68 * fRec39[2]) + (fConst66 * fRec39[1]))));
		double fTemp17 = (fRec39[2] + (fRec39[0] + (2 * fRec39[1])));
		fVec3[0] = fTemp17;
		fRec38[0] = ((fConst82 * ((fConst81 * fVec3[1]) + (fConst58 * fVec3[0]))) + (fConst63 * fRec38[1]));
		fRec37[0] = (fRec38[0] - (fConst61 * ((fConst59 * fRec37[2]) + (fConst57 * fRec37[1]))));
		fRec36[0] = ((fConst61 * (((fConst56 * fRec37[0]) + (fConst83 * fRec37[1])) + (fConst56 * fRec37[2]))) - (fConst54 * ((fConst53 * fRec36[2]) + fTemp15)));
		double fTemp18 = max(-1, min(1, (fSlow7 * (fRec36[2] + (fConst54 * (fTemp15 + (fConst53 * fRec36[0])))))));
		fRec46[0] = ((fConst82 * (fVec3[0] + fVec3[1])) + (fConst63 * fRec46[1]));
		fRec45[0] = (fRec46[0] - (fConst61 * ((fConst59 * fRec45[2]) + (fConst57 * fRec45[1]))));
		double fTemp19 = (fRec45[2] + (fRec45[0] + (2 * fRec45[1])));
		fVec4[0] = fTemp19;
		fRec44[0] = ((fConst89 * ((fConst88 * fVec4[1]) + (fConst52 * fVec4[0]))) + (fConst87 * fRec44[1]));
		fRec43[0] = (fRec44[0] - (fConst85 * ((fConst84 * fRec43[2]) + (fConst51 * fRec43[1]))));
		double fTemp20 = max(-1, min(1, (fSlow8 * (((fConst50 * fRec43[0]) + (fConst90 * fRec43[1])) + (fConst50 * fRec43[2])))));
		double fTemp21 = (fConst51 * fRec47[1]);
		double fTemp22 = (fConst57 * fRec48[1]);
		fRec50[0] = ((fConst80 * ((fConst93 * fRec41[1]) + (fConst67 * fRec41[0]))) + (fConst72 * fRec50[1]));
		fRec49[0] = (fRec50[0] - (fConst70 * ((fConst68 * fRec49[2]) + (fConst66 * fRec49[1]))));
		fRec48[0] = ((fConst70 * (((fConst65 * fRec49[0]) + (fConst94 * fRec49[1])) + (fConst65 * fRec49[2]))) - (fConst92 * ((fConst91 * fRec48[2]) + fTemp22)));
		fRec47[0] = ((fRec48[2] + (fConst92 * (fTemp22 + (fConst91 * fRec48[0])))) - (fConst54 * ((fConst53 * fRec47[2]) + fTemp21)));
		double fTemp23 = max(-1, min(1, (fSlow9 * (fRec47[2] + (fConst54 * (fTemp21 + (fConst53 * fRec47[0])))))));
		fRec52[0] = ((fConst89 * (fVec4[0] + fVec4[1])) + (fConst87 * fRec52[1]));
		fRec51[0] = (fRec52[0] - (fConst85 * ((fConst84 * fRec51[2]) + (fConst51 * fRec51[1]))));
		double fTemp24 = max(-1, min(1, (fSlow10 * (fRec51[2] + (fRec51[0] + (2 * fRec51[1]))))));
		double fTemp25 = ((1.2589412 * (fTemp24 * (1 - (0.3333333333333333 * faustpower<2>(fTemp24))))) + (1.584893192 * ((fTemp23 * (1 - (0.3333333333333333 * faustpower<2>(fTemp23)))) + ((fTemp20 * (1 - (0.3333333333333333 * faustpower<2>(fTemp20)))) + (0.8413951417869425 * (fTemp18 * (1 - (0.3333333333333333 * faustpower<2>(fTemp18)))))))));
		fVec5[0] = fTemp25;
		fRec35[0] = ((fConst42 * (fVec5[0] + fVec5[1])) + (fConst18 * fRec35[1]));
		double fTemp26 = (((fSlow11 * fRec35[0]) + (fSlow6 * fTemp14)) + (fTemp1 * (1 + (fSlow4 * ((4 - (4 * fabs(fTemp1))) - 1)))));
		fVec6[0] = fTemp26;
		fRec7[0] = ((fConst42 * (fVec6[0] + fVec6[1])) + (fConst18 * fRec7[1]));
		double fTemp27 = (fRec7[0] * fRec6[0]);
		fRec4[0] = (Ftube(TUBE_TABLE_6V6_68k, ((fTemp27 + fRec5[0]) - 0.664541)) - 87.91682926829267);
		fRec3[0] = ((fConst95 * ((fConst36 * fRec4[1]) + (fConst13 * fRec4[0]))) + (fConst15 * fRec3[1]));
		fRec55[0] = ((fConst19 * (fRec54[1] + fRec54[2])) + (fConst18 * fRec55[1]));
		fRec54[0] = (Ftube(TUBE_TABLE_6V6_250k, ((fRec55[0] + fTemp27) - 0.659761)) - 89.08268292682925);
		fRec53[0] = ((fConst95 * ((fConst36 * fRec54[1]) + (fConst13 * fRec54[0]))) + (fConst15 * fRec53[1]));
		double fTemp28 = (min(0.7, fRec53[0]) + max(-0.75, fRec3[0]));
		fVec7[0] = fTemp28;
		fRec2[0] = (fConst97 * ((fVec7[2] + (fVec7[0] + (fConst96 * fVec7[1]))) + ((fConst12 * fRec2[2]) + (fConst10 * fRec2[1]))));
		fRec1[0] = (fConst99 * ((fRec2[2] + (fRec2[0] + (fConst98 * fRec2[1]))) + ((fConst8 * fRec1[2]) + (fConst6 * fRec1[1]))));
		fRec0[0] = (fConst101 * ((fRec1[2] + (fRec1[0] + (fConst100 * fRec1[1]))) + ((fConst4 * fRec0[2]) + (fConst2 * fRec0[1]))));
		output0[i] = (FAUSTFLOAT)fRec0[0];
		// post processing
		fRec0[2] = fRec0[1]; fRec0[1] = fRec0[0];
		fRec1[2] = fRec1[1]; fRec1[1] = fRec1[0];
		fRec2[2] = fRec2[1]; fRec2[1] = fRec2[0];
		fVec7[2] = fVec7[1]; fVec7[1] = fVec7[0];
		fRec53[1] = fRec53[0];
		fRec54[2] = fRec54[1]; fRec54[1] = fRec54[0];
		fRec55[1] = fRec55[0];
		fRec3[1] = fRec3[0];
		fRec4[2] = fRec4[1]; fRec4[1] = fRec4[0];
		fRec7[1] = fRec7[0];
		fVec6[1] = fVec6[0];
		fRec35[1] = fRec35[0];
		fVec5[1] = fVec5[0];
		fRec51[2] = fRec51[1]; fRec51[1] = fRec51[0];
		fRec52[1] = fRec52[0];
		fRec47[2] = fRec47[1]; fRec47[1] = fRec47[0];
		fRec48[2] = fRec48[1]; fRec48[1] = fRec48[0];
		fRec49[2] = fRec49[1]; fRec49[1] = fRec49[0];
		fRec50[1] = fRec50[0];
		fRec43[2] = fRec43[1]; fRec43[1] = fRec43[0];
		fRec44[1] = fRec44[0];
		fVec4[1] = fVec4[0];
		fRec45[2] = fRec45[1]; fRec45[1] = fRec45[0];
		fRec46[1] = fRec46[0];
		fRec36[2] = fRec36[1]; fRec36[1] = fRec36[0];
		fRec37[2] = fRec37[1]; fRec37[1] = fRec37[0];
		fRec38[1] = fRec38[0];
		fVec3[1] = fVec3[0];
		fRec39[2] = fRec39[1]; fRec39[1] = fRec39[0];
		fRec40[1] = fRec40[0];
		fRec41[1] = fRec41[0];
		fVec2[1] = fVec2[0];
		fRec42[2] = fRec42[1]; fRec42[1] = fRec42[0];
		fRec32[1] = fRec32[0];
		fRec33[1] = fRec33[0];
		IOTA = IOTA+1;
		fRec34[1] = fRec34[0];
		fRec9[1] = fRec9[0];
		fRec10[2] = fRec10[1]; fRec10[1] = fRec10[0];
		fRec31[1] = fRec31[0];
		fRec11[1] = fRec11[0];
		fRec28[1] = fRec28[0];
		fRec29[2] = fRec29[1]; fRec29[1] = fRec29[0];
		fRec30[1] = fRec30[0];
		fRec12[1] = fRec12[0];
		fRec13[2] = fRec13[1]; fRec13[1] = fRec13[0];
		fRec27[1] = fRec27[0];
		fRec14[1] = fRec14[0];
		fRec15[1] = fRec15[0];
		fRec24[1] = fRec24[0];
		fRec25[2] = fRec25[1]; fRec25[1] = fRec25[0];
		fRec26[1] = fRec26[0];
		fRec16[1] = fRec16[0];
		fRec17[2] = fRec17[1]; fRec17[1] = fRec17[0];
		fRec23[1] = fRec23[0];
		fRec22[1] = fRec22[0];
		fRec18[2] = fRec18[1]; fRec18[1] = fRec18[0];
		fRec19[2] = fRec19[1]; fRec19[1] = fRec19[0];
		fRec20[1] = fRec20[0];
		fRec21[1] = fRec21[0];
		fVec0[1] = fVec0[0];
		fRec8[1] = fRec8[0];
		fRec6[1] = fRec6[0];
		fRec5[1] = fRec5[0];
	}
}

static int register_params(const ParamReg& reg)
{
#undef fslider3
	fslider3_ = reg.registerVar("gxdistortion.drive","","SA","",&fslider3, 0.35, 0.0, 1.0, 0.01);
#undef fslider2
	fslider2_ = reg.registerVar("amp2.stage1.Pregain","","SA","",&fslider2, -6.0, -2e+01, 2e+01, 0.1);
#undef fslider1
	fslider1_ = reg.registerVar("gxdistortion.wet_dry","","SA","",&fslider1, 1e+02, 0.0, 1e+02, 1.0);
#undef fslider0
	fslider0_ = reg.registerVar("amp2.stage2.gain1","","SA","",&fslider0, -6.0, -2e+01, 2e+01, 0.1);
	return 0;
}

PluginDef plugin = {
    PLUGINDEF_VERSION,
    0,   // flags
    "pre 12AU7/ push-pull 6V6",  // id
    N_("pre 12AU7/ push-pull 6V6"),  // name
    0,  // groups
    compute,  // mono_audio
    0,  // stereo_audio
    init,  // set_samplerate
    0,  // activate plugin
    register_params,
    0,   // load_ui
    clear_state,  // clear_state
};

} // end namespace gxamp8
