// File: /workspace/github_cpp_makefile_star2_O3/NichtJens[P]lmf2txt/LMF_IO.cpp
// Function: LMF_IO::Clone()
LMF_IO * LMF_IO::Clone()
/////////////////////////////////////////////////////////////////
{
	LMF_IO * clone = new LMF_IO(num_channels,num_ions);
	if (!clone) return 0;

	clone->Versionstring			= this->Versionstring;
	clone->FilePathName				= this->FilePathName;
	clone->OutputFilePathName		= this->OutputFilePathName;
	clone->Comment					= this->Comment;
	clone->Comment_output			= this->Comment_output;
	clone->DAQ_info					= this->DAQ_info;
	clone->Camac_CIF				= this->Camac_CIF;
	
	clone->Starttime				= this->Starttime;
	clone->Stoptime					= this->Stoptime;
	clone->Starttime_output			= this->Starttime_output;
	clone->Stoptime_output			= this->Stoptime_output;
	
	clone->time_reference			= this->time_reference;
	clone->time_reference_output	= this->time_reference_output;
	
	clone->ArchiveFlag				= this->ArchiveFlag;
	clone->Cobold_Header_version	= this->Cobold_Header_version;
	clone->Cobold_Header_version_output	= this->Cobold_Header_version_output;
	
	clone->uint64_LMF_EventCounter	= this->uint64_LMF_EventCounter;
	clone->uint64_number_of_read_events	= this->uint64_number_of_read_events;
	clone->uint64_Numberofevents	= this->uint64_Numberofevents;
	
	clone->Numberofcoordinates		= this->Numberofcoordinates;
	clone->CTime_version			= this->CTime_version;
	clone->CTime_version_output		= this->CTime_version_output;
	clone->CTime_version_output		= this->CTime_version_output;
	clone->SIMPLE_DAQ_ID_Orignial	= this->SIMPLE_DAQ_ID_Orignial;
	clone->DAQVersion				= this->DAQVersion;
	clone->DAQVersion_output		= this->DAQVersion_output;
	clone->DAQ_ID					= this->DAQ_ID;
	clone->DAQ_ID_output			= this->DAQ_ID_output;
	clone->data_format_in_userheader	= this->data_format_in_userheader;
	clone->data_format_in_userheader_output	= this->data_format_in_userheader_output;
	
	clone->Headersize				= this->Headersize;
	clone->User_header_size			= this->User_header_size;
	clone->User_header_size_output	= this->User_header_size_output;
	
	clone->IOaddress				= this->IOaddress;
	clone->timestamp_format			= this->timestamp_format;
	clone->timestamp_format_output	= this->timestamp_format_output;
	clone->timerange				= this->timerange;
	
	clone->number_of_channels		= this->number_of_channels;
	clone->number_of_channels2		= this->number_of_channels2;
	clone->max_number_of_hits		= this->max_number_of_hits;
	clone->max_number_of_hits2		= this->max_number_of_hits2;
	
	clone->number_of_channels_output	= this->number_of_channels_output;
	clone->number_of_channels2_output	= this->number_of_channels2_output;
	clone->max_number_of_hits_output	= this->max_number_of_hits_output;
	clone->max_number_of_hits2_output	= this->max_number_of_hits2_output;
	
	clone->DAQSubVersion			= this->DAQSubVersion;
	clone->module_2nd				= this->module_2nd;
	clone->system_timeout			= this->system_timeout;
	clone->system_timeout_output	= this->system_timeout_output;
	clone->common_mode				= this->common_mode;
	clone->common_mode_output		= this->common_mode_output;
	clone->DAQ_info_Length			= this->DAQ_info_Length;
	clone->Camac_CIF_Length			= this->Camac_CIF_Length;
	clone->LMF_Version				= this->LMF_Version;
	clone->LMF_Version_output		= this->LMF_Version_output;
	clone->TDCDataType				= this->TDCDataType;
	
	clone->LMF_Header_version		= this->LMF_Header_version;
	
	clone->number_of_bytes_in_PostEventData = this->number_of_bytes_in_PostEventData;
	
	clone->tdcresolution			= this->tdcresolution;
	clone->tdcresolution_output		= this->tdcresolution_output;
	clone->frequency				= this->frequency;
	clone->DOUBLE_timestamp			= this->DOUBLE_timestamp;
	clone->ui64_timestamp			= this->ui64_timestamp;

	clone->number_of_CCFHistory_strings = this->number_of_CCFHistory_strings;
	clone->number_of_DAN_source_strings = this->number_of_DAN_source_strings;
	clone->number_of_DAQ_source_strings = this->number_of_DAQ_source_strings;
	clone->number_of_CCFHistory_strings_output = this->number_of_CCFHistory_strings_output;
	clone->number_of_DAN_source_strings_output = this->number_of_DAN_source_strings_output;
	clone->number_of_DAQ_source_strings_output = this->number_of_DAQ_source_strings_output;

	if (number_of_CCFHistory_strings >= 0) {
		clone->CCFHistory_strings = new std::string*[number_of_CCFHistory_strings];
		memset(clone->CCFHistory_strings,0,sizeof(std::string*)*number_of_CCFHistory_strings);
	}
	if (number_of_DAN_source_strings >= 0) {
		clone->DAN_source_strings = new std::string*[number_of_DAN_source_strings];
		memset(clone->DAN_source_strings,0,sizeof(std::string*)*number_of_DAN_source_strings);
	}
	if (number_of_DAQ_source_strings >= 0) {
		clone->DAQ_source_strings = new std::string*[number_of_DAQ_source_strings];
		memset(clone->DAQ_source_strings,0,sizeof(std::string*)*number_of_DAQ_source_strings);
	}
	if (this->CCFHistory_strings) {
		for (__int32 i=0;i<number_of_CCFHistory_strings;++i) {clone->CCFHistory_strings[i] = new std::string(); *clone->CCFHistory_strings[i] = *this->CCFHistory_strings[i];}
	}
	if (this->DAN_source_strings) {
		for (__int32 i=0;i<number_of_DAN_source_strings;++i) {clone->DAN_source_strings[i] = new std::string(); *clone->DAN_source_strings[i] = *this->DAN_source_strings[i];}
	}
	if (this->DAQ_source_strings) {
		for (__int32 i=0;i<number_of_DAQ_source_strings;++i) {clone->DAQ_source_strings[i] = new std::string(); *clone->DAQ_source_strings[i] = *this->DAQ_source_strings[i];}
	}

	if (number_of_CCFHistory_strings_output>=0) {
		clone->CCFHistory_strings_output = new std::string*[number_of_CCFHistory_strings_output];
		memset(clone->CCFHistory_strings_output,0,sizeof(std::string*)*number_of_CCFHistory_strings_output);
	}
	if (number_of_DAN_source_strings_output>=0) {
		clone->DAN_source_strings_output = new std::string*[number_of_DAN_source_strings_output];
		memset(clone->DAN_source_strings_output,0,sizeof(std::string*)*number_of_DAN_source_strings_output);
	}
	if (number_of_DAQ_source_strings_output>=0) {
		clone->DAQ_source_strings_output = new std::string*[number_of_DAQ_source_strings_output];
		memset(clone->DAQ_source_strings_output,0,sizeof(std::string*)*number_of_DAQ_source_strings_output);
	}
	if (this->CCFHistory_strings_output) {
		for (__int32 i=0;i<number_of_CCFHistory_strings_output;++i) {clone->CCFHistory_strings_output[i] = new std::string(); *clone->CCFHistory_strings_output[i] = *this->CCFHistory_strings_output[i];}
	}
	if (this->DAN_source_strings_output) {
		for (__int32 i=0;i<number_of_DAN_source_strings_output;++i) {clone->DAN_source_strings_output[i] = new std::string(); *clone->DAN_source_strings_output[i] = *this->DAN_source_strings_output[i];}
	}
	if (this->DAQ_source_strings_output) {
		for (__int32 i=0;i<number_of_DAQ_source_strings_output;++i) {clone->DAQ_source_strings_output[i] = new std::string(); *clone->DAQ_source_strings_output[i] = *this->DAQ_source_strings_output[i];}
	}

	clone->CCF_HISTORY_CODE_bitmasked = this->CCF_HISTORY_CODE_bitmasked;
	clone->DAN_SOURCE_CODE_bitmasked = this->DAN_SOURCE_CODE_bitmasked;
	clone->DAQ_SOURCE_CODE_bitmasked = this->DAQ_SOURCE_CODE_bitmasked;
	
	clone->errorflag				= this->errorflag;
	clone->skip_header				= this->skip_header;
	
	clone->uint64_number_of_written_events	= this->uint64_number_of_written_events;
	
	clone->not_Cobold_LMF			= this->not_Cobold_LMF;
	clone->Headersize_output		= this->Headersize_output;
	clone->output_byte_counter		= this->output_byte_counter;
	clone->Numberofcoordinates_output	= this->Numberofcoordinates_output;
	clone->must_read_first			= this->must_read_first;

	clone->num_channels				= this->num_channels;
	clone->num_ions					= this->num_ions;



// pointers and other special stuff:


//clone->InputFileIsOpen		= this->InputFileIsOpen;
//clone->in_ar					= this->in_ar;
//clone->input_lmf				= this->input_lmf;

//clone->OutputFileIsOpen			= this->OutputFileIsOpen;
//clone->out_ar					= this->out_ar;
//clone->output_lmf				= this->output_lmf;


	// TDC8PCI2
	clone->TDC8PCI2.GateDelay_1st_card			= this->TDC8PCI2.GateDelay_1st_card;
	clone->TDC8PCI2.OpenTime_1st_card			= this->TDC8PCI2.OpenTime_1st_card;
	clone->TDC8PCI2.WriteEmptyEvents_1st_card	= this->TDC8PCI2.WriteEmptyEvents_1st_card;
	clone->TDC8PCI2.TriggerFalling_1st_card		= this->TDC8PCI2.TriggerFalling_1st_card;
	clone->TDC8PCI2.TriggerRising_1st_card		= this->TDC8PCI2.TriggerRising_1st_card;
	clone->TDC8PCI2.EmptyCounter_1st_card		= this->TDC8PCI2.EmptyCounter_1st_card;
	clone->TDC8PCI2.EmptyCounter_since_last_Event_1st_card = this->TDC8PCI2.EmptyCounter_since_last_Event_1st_card;
	clone->TDC8PCI2.use_normal_method			= this->TDC8PCI2.use_normal_method;
	clone->TDC8PCI2.use_normal_method_2nd_card	= this->TDC8PCI2.use_normal_method_2nd_card;
	clone->TDC8PCI2.sync_test_on_off			= this->TDC8PCI2.sync_test_on_off;
	clone->TDC8PCI2.io_address_2nd_card			= this->TDC8PCI2.io_address_2nd_card;
	clone->TDC8PCI2.GateDelay_2nd_card			= this->TDC8PCI2.GateDelay_2nd_card;
	clone->TDC8PCI2.OpenTime_2nd_card			= this->TDC8PCI2.OpenTime_2nd_card;
	clone->TDC8PCI2.WriteEmptyEvents_2nd_card	= this->TDC8PCI2.WriteEmptyEvents_2nd_card;
	clone->TDC8PCI2.TriggerFallingEdge_2nd_card = this->TDC8PCI2.TriggerFallingEdge_2nd_card;
	clone->TDC8PCI2.TriggerRisingEdge_2nd_card	= this->TDC8PCI2.TriggerRisingEdge_2nd_card;
	clone->TDC8PCI2.EmptyCounter_2nd_card		= this->TDC8PCI2.EmptyCounter_2nd_card;
	clone->TDC8PCI2.EmptyCounter_since_last_Event_2nd_card = this->TDC8PCI2.EmptyCounter_since_last_Event_2nd_card;
	clone->TDC8PCI2.variable_event_length		= this->TDC8PCI2.variable_event_length;


	// HM1
	clone->HM1.FAK_DLL_Value			= this->HM1.FAK_DLL_Value;
	clone->HM1.Resolution_Flag			= this->HM1.Resolution_Flag;
	clone->HM1.trigger_mode_for_start	= this->HM1.trigger_mode_for_start;
	clone->HM1.trigger_mode_for_stop	= this->HM1.trigger_mode_for_stop;
	clone->HM1.Even_open_time			= this->HM1.Even_open_time;
	clone->HM1.Auto_Trigger				= this->HM1.Auto_Trigger;
	clone->HM1.set_bits_for_GP1			= this->HM1.set_bits_for_GP1;
	clone->HM1.ABM_m_xFrom				= this->HM1.ABM_m_xFrom;
	clone->HM1.ABM_m_xTo				= this->HM1.ABM_m_xTo;
	clone->HM1.ABM_m_yFrom				= this->HM1.ABM_m_yFrom;
	clone->HM1.ABM_m_yTo				= this->HM1.ABM_m_yTo;
	clone->HM1.ABM_m_xMin				= this->HM1.ABM_m_xMin;
	clone->HM1.ABM_m_xMax				= this->HM1.ABM_m_xMax;
	clone->HM1.ABM_m_yMin				= this->HM1.ABM_m_yMin;
	clone->HM1.ABM_m_yMax				= this->HM1.ABM_m_yMax;
	clone->HM1.ABM_m_xOffset			= this->HM1.ABM_m_xOffset;
	clone->HM1.ABM_m_yOffset			= this->HM1.ABM_m_yOffset;
	clone->HM1.ABM_m_zOffset			= this->HM1.ABM_m_zOffset;
	clone->HM1.ABM_Mode					= this->HM1.ABM_Mode;
	clone->HM1.ABM_OsziDarkInvert		= this->HM1.ABM_OsziDarkInvert;
	clone->HM1.ABM_ErrorHisto			= this->HM1.ABM_ErrorHisto;
	clone->HM1.ABM_XShift				= this->HM1.ABM_XShift;
	clone->HM1.ABM_YShift				= this->HM1.ABM_YShift;
	clone->HM1.ABM_ZShift				= this->HM1.ABM_ZShift;
	clone->HM1.ABM_ozShift				= this->HM1.ABM_ozShift;
	clone->HM1.ABM_wdShift				= this->HM1.ABM_wdShift;
	clone->HM1.ABM_ucLevelXY			= this->HM1.ABM_ucLevelXY;
	clone->HM1.ABM_ucLevelZ				= this->HM1.ABM_ucLevelZ;
	clone->HM1.ABM_uiABMXShift			= this->HM1.ABM_uiABMXShift;
	clone->HM1.ABM_uiABMYShift			= this->HM1.ABM_uiABMYShift;
	clone->HM1.ABM_uiABMZShift			= this->HM1.ABM_uiABMZShift;
	clone->HM1.use_normal_method		= this->HM1.use_normal_method;

	clone->HM1.TWOHM1_FAK_DLL_Value		= this->HM1.TWOHM1_FAK_DLL_Value;
	clone->HM1.TWOHM1_Resolution_Flag	= this->HM1.TWOHM1_Resolution_Flag;
	clone->HM1.TWOHM1_trigger_mode_for_start	= this->HM1.TWOHM1_trigger_mode_for_start;
	clone->HM1.TWOHM1_trigger_mode_for_stop		= this->HM1.TWOHM1_trigger_mode_for_stop;
	clone->HM1.TWOHM1_res_adjust		= this->HM1.TWOHM1_res_adjust;
	clone->HM1.TWOHM1_tdcresolution		= this->HM1.TWOHM1_tdcresolution;
	clone->HM1.TWOHM1_test_overflow		= this->HM1.TWOHM1_test_overflow;
	clone->HM1.TWOHM1_number_of_channels	= this->HM1.TWOHM1_number_of_channels;
	clone->HM1.TWOHM1_number_of_hits	= this->HM1.TWOHM1_number_of_hits;
	clone->HM1.TWOHM1_set_bits_for_GP1	= this->HM1.TWOHM1_set_bits_for_GP1;
	clone->HM1.TWOHM1_HM1_ID_1			= this->HM1.TWOHM1_HM1_ID_1;
	clone->HM1.TWOHM1_HM1_ID_2			= this->HM1.TWOHM1_HM1_ID_2;

	clone->TDC8HP.no_config_file_read	= this->TDC8HP.no_config_file_read;
	clone->TDC8HP.RisingEnable_p61		= this->TDC8HP.RisingEnable_p61;
	clone->TDC8HP.FallingEnable_p62		= this->TDC8HP.FallingEnable_p62;
	clone->TDC8HP.TriggerEdge_p63		= this->TDC8HP.TriggerEdge_p63;
	clone->TDC8HP.TriggerChannel_p64		= this->TDC8HP.TriggerChannel_p64;
	clone->TDC8HP.OutputLevel_p65		= this->TDC8HP.OutputLevel_p65;
	clone->TDC8HP.GroupingEnable_p66		= this->TDC8HP.GroupingEnable_p66;
	clone->TDC8HP.GroupingEnable_p66_output	= this->TDC8HP.GroupingEnable_p66_output;
	clone->TDC8HP.AllowOverlap_p67		= this->TDC8HP.AllowOverlap_p67;
	clone->TDC8HP.TriggerDeadTime_p68	= this->TDC8HP.TriggerDeadTime_p68;
	clone->TDC8HP.GroupRangeStart_p69	= this->TDC8HP.GroupRangeStart_p69;
	clone->TDC8HP.GroupRangeEnd_p70		= this->TDC8HP.GroupRangeEnd_p70;
	clone->TDC8HP.ExternalClock_p71		= this->TDC8HP.ExternalClock_p71;
	clone->TDC8HP.OutputRollOvers_p72	= this->TDC8HP.OutputRollOvers_p72;
	clone->TDC8HP.DelayTap0_p73			= this->TDC8HP.DelayTap0_p73;
	clone->TDC8HP.DelayTap1_p74			= this->TDC8HP.DelayTap1_p74;
	clone->TDC8HP.DelayTap2_p75			= this->TDC8HP.DelayTap2_p75;
	clone->TDC8HP.DelayTap3_p76			= this->TDC8HP.DelayTap3_p76;
	clone->TDC8HP.INL_p80				= this->TDC8HP.INL_p80;
	clone->TDC8HP.DNL_p81				= this->TDC8HP.DNL_p81;
	clone->TDC8HP.csConfigFile			= this->TDC8HP.csConfigFile;
	clone->TDC8HP.csINLFile				= this->TDC8HP.csINLFile;
	clone->TDC8HP.csDNLFile				= this->TDC8HP.csDNLFile;
	clone->TDC8HP.csConfigFile_Length	= this->TDC8HP.csConfigFile_Length;
	clone->TDC8HP.csINLFile_Length		= this->TDC8HP.csINLFile_Length;
	clone->TDC8HP.csDNLFile_Length		= this->TDC8HP.csDNLFile_Length;
	clone->TDC8HP.UserHeaderVersion		= this->TDC8HP.UserHeaderVersion;
	clone->TDC8HP.VHR_25ps				= this->TDC8HP.VHR_25ps;
	clone->TDC8HP.SyncValidationChannel	= this->TDC8HP.SyncValidationChannel;
	clone->TDC8HP.variable_event_length	= this->TDC8HP.variable_event_length;
	clone->TDC8HP.SSEEnable				= this->TDC8HP.SSEEnable;
	clone->TDC8HP.MMXEnable				= this->TDC8HP.MMXEnable;
	clone->TDC8HP.DMAEnable				= this->TDC8HP.DMAEnable;
	clone->TDC8HP.GroupTimeOut			= this->TDC8HP.GroupTimeOut;

	clone->TDC8HP.i32NumberOfDAQLoops   = this->TDC8HP.i32NumberOfDAQLoops;   
	clone->TDC8HP.TDC8HP_DriverVersion 	= this->TDC8HP.TDC8HP_DriverVersion; 	
	clone->TDC8HP.iTriggerChannelMask	= this->TDC8HP.iTriggerChannelMask;	
	clone->TDC8HP.iTime_zero_channel	= this->TDC8HP.iTime_zero_channel;	

	clone->TDC8HP.Number_of_TDCs = this->TDC8HP.Number_of_TDCs;
	for (__int32 i = 0;i<3;++i) {
		if (this->TDC8HP.TDC_info[i]) {
			clone->TDC8HP.TDC_info[i]->index				= this->TDC8HP.TDC_info[i]->index;
			clone->TDC8HP.TDC_info[i]->channelCount			= this->TDC8HP.TDC_info[i]->channelCount;
			clone->TDC8HP.TDC_info[i]->channelStart			= this->TDC8HP.TDC_info[i]->channelStart;
			clone->TDC8HP.TDC_info[i]->highResChannelCount	= this->TDC8HP.TDC_info[i]->highResChannelCount;
			clone->TDC8HP.TDC_info[i]->highResChannelStart	= this->TDC8HP.TDC_info[i]->highResChannelStart;
			clone->TDC8HP.TDC_info[i]->lowResChannelCount	= this->TDC8HP.TDC_info[i]->lowResChannelCount;
			clone->TDC8HP.TDC_info[i]->lowResChannelStart	= this->TDC8HP.TDC_info[i]->lowResChannelStart;
			clone->TDC8HP.TDC_info[i]->resolution			= this->TDC8HP.TDC_info[i]->resolution;
			clone->TDC8HP.TDC_info[i]->serialNumber			= this->TDC8HP.TDC_info[i]->serialNumber;
			clone->TDC8HP.TDC_info[i]->version				= this->TDC8HP.TDC_info[i]->version;
			clone->TDC8HP.TDC_info[i]->fifoSize				= this->TDC8HP.TDC_info[i]->fifoSize;
			clone->TDC8HP.TDC_info[i]->flashValid			= this->TDC8HP.TDC_info[i]->flashValid;
			memcpy(clone->TDC8HP.TDC_info[i]->INLCorrection,this->TDC8HP.TDC_info[i]->INLCorrection,sizeof(__int32)*8*1024);
			memcpy(clone->TDC8HP.TDC_info[i]->DNLData,this->TDC8HP.TDC_info[i]->DNLData,sizeof(__int16)*8*1024);
		}
	}




	clone->fADC8.driver_version					=	this->fADC8.driver_version;
	clone->fADC8.i32NumberOfDAQLoops			=	this->fADC8.i32NumberOfDAQLoops;
	clone->fADC8.number_of_bools				=	this->fADC8.number_of_bools;
	clone->fADC8.number_of_int32s				=	this->fADC8.number_of_int32s;
	clone->fADC8.number_of_uint32s				=	this->fADC8.number_of_uint32s;
	clone->fADC8.number_of_doubles				=	this->fADC8.number_of_doubles;
	clone->fADC8.GroupEndMarker					=	this->fADC8.GroupEndMarker;
	clone->fADC8.i32NumberOfADCmodules			=	this->fADC8.i32NumberOfADCmodules;
	clone->fADC8.iEnableGroupMode				=	this->fADC8.iEnableGroupMode;
	clone->fADC8.iTriggerChannel				=	this->fADC8.iTriggerChannel;
	clone->fADC8.iPreSamplings_in_4800ps_units	=	this->fADC8.iPreSamplings_in_4800ps_units;
	clone->fADC8.iPostSamplings_in_9600ps_units	=	this->fADC8.iPostSamplings_in_9600ps_units;
	clone->fADC8.iEnableTDCinputs				=	this->fADC8.iEnableTDCinputs;
	clone->fADC8.bReadCustomData				=	this->fADC8.bReadCustomData;
	clone->fADC8.veto_gate_length				=	this->fADC8.veto_gate_length;
	clone->fADC8.veto_delay_length				=	this->fADC8.veto_delay_length;
	clone->fADC8.veto_mask						=	this->fADC8.veto_mask;
	clone->fADC8.dGroupRangeStart				=	this->fADC8.dGroupRangeStart;
	clone->fADC8.dGroupRangeEnd					=	this->fADC8.dGroupRangeEnd;
	clone->fADC8.at_least_1_signal_was_written	=	this->fADC8.at_least_1_signal_was_written;
	for (__int32 m = 0;m<8;m++) {
		clone->fADC8.firmware_version[m]	= this->fADC8.firmware_version[m];
		clone->fADC8.serial_number[m]		= this->fADC8.serial_number[m];
		for (__int32 adc = 0;adc<2;adc++) {
			clone->fADC8.dSyncTimeOffset[m][adc]	=	this->fADC8.dSyncTimeOffset[m][adc];
			clone->fADC8.iChannelMode[m][adc]		=	this->fADC8.iChannelMode[m][adc]; // 0 = 1.25Gs, 1 = 2.5Gs, 2 = 5Gs
			clone->fADC8.iThreshold_GT[m][m]		=	this->fADC8.iThreshold_GT[m][m];
			clone->fADC8.iThreshold_LT[m][m]		=	this->fADC8.iThreshold_LT[m][m];
			clone->fADC8.iSynchronMode [m][adc]		=	this->fADC8.iSynchronMode [m][adc];
		}
		for (__int32 ch = 0;ch<2;ch++)
			clone->fADC8.GND_level[m][ch] = this->fADC8.GND_level[m][ch];
	}


	clone->fADC4.packet_count =				this->fADC4.packet_count;
	clone->fADC4.number_of_bools =			this->fADC4.number_of_bools;
	clone->fADC4.number_of_int32s =			this->fADC4.number_of_int32s;
	clone->fADC4.number_of_uint32s =		this->fADC4.number_of_uint32s;
	clone->fADC4.number_of_doubles =		this->fADC4.number_of_doubles;
	clone->fADC4.GroupEndMarker =			this->fADC4.GroupEndMarker;
	clone->fADC4.driver_version =			this->fADC4.driver_version;
	clone->fADC4.i32NumberOfDAQLoops =		this->fADC4.i32NumberOfDAQLoops;
	clone->fADC4.bReadCustomData =			this->fADC4.bReadCustomData;
	clone->fADC4.i32NumberOfADCmodules =	this->fADC4.i32NumberOfADCmodules;
	clone->fADC4.iTriggerChannel =			this->fADC4.iTriggerChannel;
	clone->fADC4.dGroupRangeStart =			this->fADC4.dGroupRangeStart;
	clone->fADC4.dGroupRangeEnd =			this->fADC4.dGroupRangeEnd;
	clone->fADC4.csConfigFile =				this->fADC4.csConfigFile;
	clone->fADC4.csINLFile =				this->fADC4.csINLFile;
	clone->fADC4.csDNLFile =				this->fADC4.csDNLFile;
	for (__int32 i=0;i<20;i++) clone->fADC4.bits_per_mVolt[i] = this->fADC4.bits_per_mVolt[i];

	return clone;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
movl $0x2b80, %edi           # imm = 0x2B80
callq 0x2130
movq %rax, %r14
movl 0x2b70(%rbx), %esi
movl 0x2b74(%rbx), %edx
movq %rax, %rdi
callq 0x2648
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20a0
leaq 0x20(%rbx), %rsi
leaq 0x20(%r14), %rdi
callq 0x20a0
leaq 0x40(%rbx), %rsi
leaq 0x40(%r14), %rdi
callq 0x20a0
leaq 0x60(%rbx), %rsi
leaq 0x60(%r14), %rdi
callq 0x20a0
movl $0x80, %edi
leaq (%rbx,%rdi), %rsi
addq %r14, %rdi
callq 0x20a0
movl $0xa0, %edi
leaq (%rbx,%rdi), %rsi
addq %r14, %rdi
callq 0x20a0
movl $0xc0, %edi
leaq (%rbx,%rdi), %rsi
addq %r14, %rdi
callq 0x20a0
movups 0x220(%rbx), %xmm0
movups %xmm0, 0x220(%r14)
movups 0x230(%rbx), %xmm0
movups %xmm0, 0x230(%r14)
movups 0x240(%rbx), %xmm0
movups %xmm0, 0x240(%r14)
movl 0x250(%rbx), %eax
movl %eax, 0x250(%r14)
movups 0x258(%rbx), %xmm0
movups %xmm0, 0x258(%r14)
movq 0x268(%rbx), %rax
movq %rax, 0x268(%r14)
movups 0x270(%rbx), %xmm0
movups %xmm0, 0x270(%r14)
movups 0x280(%rbx), %xmm0
movups %xmm0, 0x280(%r14)
movups 0x290(%rbx), %xmm0
movups %xmm0, 0x290(%r14)
movups 0x2a0(%rbx), %xmm0
movups %xmm0, 0x2a0(%r14)
movups 0x2b0(%rbx), %xmm0
movups %xmm0, 0x2b0(%r14)
movups 0x2c0(%rbx), %xmm0
movups %xmm0, 0x2c0(%r14)
movl 0x2d0(%rbx), %eax
movl %eax, 0x2d0(%r14)
movups 0x1290(%rbx), %xmm0
movups %xmm0, 0x1290(%r14)
movups 0x12a0(%rbx), %xmm0
movups %xmm0, 0x12a0(%r14)
movl 0x12b0(%rbx), %eax
movl %eax, 0x12b0(%r14)
movups 0x1280(%rbx), %xmm0
movups %xmm0, 0x1280(%r14)
movups 0x12b8(%rbx), %xmm0
movups %xmm0, 0x12b8(%r14)
movups 0x12c8(%rbx), %xmm0
movups %xmm0, 0x12c8(%r14)
movq 0x12d8(%rbx), %rax
movq %rax, 0x12d8(%r14)
movq 0x12f4(%rbx), %r12
movq %r12, 0x12f4(%r14)
movq 0x1310(%rbx), %rax
movq %rax, %xmm0
movq %rax, 0x1310(%r14)
movq %rbx, 0x8(%rsp)
movq 0x1328(%rbx), %r13
movq %r13, 0x1328(%r14)
testl %r12d, %r12d
js 0x1220b
movl %r12d, %r15d
shlq $0x3, %r15
movq %r15, %rdi
movdqa %xmm0, 0x10(%rsp)
callq 0x2030
movq %rax, 0x1300(%r14)
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x20b0
movdqa 0x10(%rsp), %xmm0
movq %r13, %xmm1
movd %xmm0, %ebp
testl %ebp, %ebp
js 0x12247
movl %ebp, %r15d
shlq $0x3, %r15
movq %r15, %rdi
movdqa %xmm1, 0x10(%rsp)
callq 0x2030
movq %rax, 0x1318(%r14)
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x20b0
movdqa 0x10(%rsp), %xmm1
movd %xmm1, %eax
testl %eax, %eax
js 0x12272
movl %eax, %r15d
shlq $0x3, %r15
movq %r15, %rdi
callq 0x2030
movq %rax, 0x1330(%r14)
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x20b0
movq 0x8(%rsp), %rbx
cmpq $0x0, 0x1300(%rbx)
sete %al
testl %r12d, %r12d
setle %cl
orb %al, %cl
jne 0x122e7
xorl %r15d, %r15d
movl $0x20, %edi
callq 0x2130
leaq 0x10(%rax), %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1300(%r14), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x1300(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq 0x1300(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x20a0
incq %r15
movslq 0x12f4(%rbx), %rax
cmpq %rax, %r15
jl 0x1228f
movl 0x1310(%rbx), %ebp
cmpq $0x0, 0x1318(%rbx)
je 0x1234a
testl %ebp, %ebp
jle 0x1234a
xorl %r15d, %r15d
movl $0x20, %edi
callq 0x2130
leaq 0x10(%rax), %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1318(%r14), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x1318(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq 0x1318(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x20a0
incq %r15
movslq 0x1310(%rbx), %rax
cmpq %rax, %r15
jl 0x122f8
cmpq $0x0, 0x1330(%rbx)
je 0x123b2
cmpl $0x0, 0x1328(%rbx)
jle 0x123b2
xorl %r15d, %r15d
movl $0x20, %edi
callq 0x2130
leaq 0x10(%rax), %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1330(%r14), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x1330(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq 0x1330(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x20a0
incq %r15
movslq 0x1328(%rbx), %rax
cmpq %rax, %r15
jl 0x12360
movslq 0x12f8(%rbx), %r12
testq %r12, %r12
js 0x123e2
leaq (,%r12,8), %r15
movq %r15, %rdi
callq 0x2030
movq %rax, 0x1308(%r14)
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x20b0
movq 0x8(%rsp), %rax
movslq 0x1314(%rax), %r13
testq %r13, %r13
js 0x12417
leaq (,%r13,8), %r15
movq %r15, %rdi
callq 0x2030
movq %rax, 0x1320(%r14)
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x20b0
movq 0x8(%rsp), %rax
movslq 0x132c(%rax), %r15
testq %r15, %r15
js 0x12448
shlq $0x3, %r15
movq %r15, %rdi
callq 0x2030
movq %rax, 0x1338(%r14)
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x20b0
movq 0x8(%rsp), %rcx
cmpq $0x0, 0x1308(%rcx)
sete %al
testl %r12d, %r12d
movq %rcx, %r12
setle %cl
orb %al, %cl
jne 0x124c4
xorl %r15d, %r15d
movl $0x20, %edi
callq 0x2130
leaq 0x10(%rax), %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1308(%r14), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x1308(%r12), %rax
movq (%rax,%r15,8), %rsi
movq 0x1308(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x20a0
incq %r15
movslq 0x12f8(%r12), %rax
cmpq %rax, %r15
jl 0x12468
movl 0x1314(%r12), %r13d
cmpq $0x0, 0x1320(%r12)
je 0x1252b
testl %r13d, %r13d
jle 0x1252b
xorl %r15d, %r15d
movl $0x20, %edi
callq 0x2130
leaq 0x10(%rax), %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1320(%r14), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x1320(%r12), %rax
movq (%rax,%r15,8), %rsi
movq 0x1320(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x20a0
incq %r15
movslq 0x1314(%r12), %rax
cmpq %rax, %r15
jl 0x124d7
cmpq $0x0, 0x1338(%r12)
je 0x12598
cmpl $0x0, 0x132c(%r12)
jle 0x12598
xorl %r15d, %r15d
movl $0x20, %edi
callq 0x2130
leaq 0x10(%rax), %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1338(%r14), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x1338(%r12), %rax
movq (%rax,%r15,8), %rsi
movq 0x1338(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x20a0
incq %r15
movslq 0x132c(%r12), %rax
cmpq %rax, %r15
jl 0x12544
movl 0x12f0(%r12), %eax
movl %eax, 0x12f0(%r14)
movq 0x12e8(%r12), %rax
movq %rax, 0x12e8(%r14)
movl 0x12e0(%r12), %eax
movl %eax, 0x12e0(%r14)
movb 0x12e4(%r12), %al
movb %al, 0x12e4(%r14)
movq 0x2b10(%r12), %rax
movq %rax, 0x2b10(%r14)
movb 0x2b3c(%r12), %al
movb %al, 0x2b3c(%r14)
movq 0x2b40(%r12), %rax
movq %rax, 0x2b40(%r14)
movl 0x2b48(%r12), %eax
movl %eax, 0x2b48(%r14)
movb 0x2b4c(%r12), %al
movb %al, 0x2b4c(%r14)
movq 0x2b70(%r12), %rax
movq %rax, 0x2b70(%r14)
movups 0x1558(%r12), %xmm0
movups %xmm0, 0x1558(%r14)
movq 0x1568(%r12), %rax
movq %rax, 0x1568(%r14)
movl 0x1570(%r12), %eax
movl %eax, 0x1570(%r14)
movb 0x1574(%r12), %al
movb %al, 0x1574(%r14)
movb 0x1575(%r12), %al
movb %al, 0x1575(%r14)
movups 0x1578(%r12), %xmm0
movups %xmm0, 0x1578(%r14)
movups 0x1588(%r12), %xmm0
movups %xmm0, 0x1588(%r14)
movq 0x1598(%r12), %rax
movq %rax, 0x1598(%r14)
movups 0x1340(%r12), %xmm0
movups %xmm0, 0x1340(%r14)
movups 0x1350(%r12), %xmm0
movups %xmm0, 0x1350(%r14)
movups 0x1360(%r12), %xmm0
movups %xmm0, 0x1360(%r14)
movups 0x1370(%r12), %xmm0
movups %xmm0, 0x1370(%r14)
movups 0x1380(%r12), %xmm0
movups %xmm0, 0x1380(%r14)
movups 0x1390(%r12), %xmm0
movups %xmm0, 0x1390(%r14)
movups 0x13a0(%r12), %xmm0
movups %xmm0, 0x13a0(%r14)
movq 0x13b0(%r12), %rax
movq %rax, 0x13b0(%r14)
movl 0x13b8(%r12), %eax
movl %eax, 0x13b8(%r14)
movb 0x13bc(%r12), %al
movb %al, 0x13bc(%r14)
movups 0x13c0(%r12), %xmm0
movups %xmm0, 0x13c0(%r14)
movl 0x13d0(%r12), %eax
movl %eax, 0x13d0(%r14)
movsd 0x13d8(%r12), %xmm0
movsd %xmm0, 0x13d8(%r14)
movups 0x13e0(%r12), %xmm0
movups %xmm0, 0x13e0(%r14)
movq 0x13f0(%r12), %rax
movq %rax, 0x13f0(%r14)
movl 0x13fc(%r12), %eax
movl %eax, 0x13fc(%r14)
movups 0x1400(%r12), %xmm0
movups %xmm0, 0x1400(%r14)
movups 0x1410(%r12), %xmm0
movups %xmm0, 0x1410(%r14)
movq 0x1420(%r12), %rax
movq %rax, 0x1420(%r14)
movups 0x1428(%r12), %xmm0
movups %xmm0, 0x1428(%r14)
movsd 0x1438(%r12), %xmm0
movsd %xmm0, 0x1438(%r14)
movups 0x1440(%r12), %xmm0
movups %xmm0, 0x1440(%r14)
movups 0x1450(%r12), %xmm0
movups %xmm0, 0x1450(%r14)
movl $0x1470, %edi           # imm = 0x1470
leaq (%r12,%rdi), %rsi
addq %r14, %rdi
callq 0x20a0
movl $0x1490, %edi           # imm = 0x1490
leaq (%r12,%rdi), %rsi
addq %r14, %rdi
callq 0x20a0
movl $0x14b0, %edi           # imm = 0x14B0
leaq (%r12,%rdi), %rsi
addq %r14, %rdi
callq 0x20a0
movups 0x14d0(%r12), %xmm0
movups %xmm0, 0x14d0(%r14)
movb 0x14e0(%r12), %al
movb %al, 0x14e0(%r14)
movq 0x14e4(%r12), %rax
movq %rax, 0x14e4(%r14)
movb 0x14ec(%r12), %al
movb %al, 0x14ec(%r14)
movb 0x14ed(%r12), %al
movb %al, 0x14ed(%r14)
movb 0x14ee(%r12), %al
movb %al, 0x14ee(%r14)
movsd 0x14f0(%r12), %xmm0
movsd %xmm0, 0x14f0(%r14)
movups 0x1518(%r12), %xmm0
movups %xmm0, 0x1518(%r14)
movl 0x14f8(%r12), %eax
movl %eax, 0x14f8(%r14)
movl $0x2a0, %r15d           # imm = 0x2A0
movq (%r12,%r15,8), %rax
testq %rax, %rax
je 0x12958
movq (%r14,%r15,8), %rbx
movups (%rax), %xmm0
movups %xmm0, (%rbx)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rbx)
movl 0x18(%rax), %ecx
movl %ecx, 0x18(%rbx)
movsd 0x20(%rax), %xmm0
movsd %xmm0, 0x20(%rbx)
movq 0x28(%rax), %rcx
movq %rcx, 0x28(%rbx)
movl 0x30(%rax), %ecx
movl %ecx, 0x30(%rbx)
movb 0x48(%rax), %cl
movb %cl, 0x48(%rbx)
movq 0x38(%rbx), %rdi
movq 0x38(%rax), %rsi
movl $0x8000, %edx           # imm = 0x8000
callq 0x20e0
movq 0x40(%rbx), %rdi
movq (%r12,%r15,8), %rax
movq 0x40(%rax), %rsi
movl $0x4000, %edx           # imm = 0x4000
callq 0x20e0
incq %r15
cmpq $0x2a3, %r15            # imm = 0x2A3
jne 0x128f1
movups 0x15a0(%r12), %xmm0
movups %xmm0, 0x15a0(%r14)
movups 0x15b0(%r12), %xmm0
movups %xmm0, 0x15b0(%r14)
movups 0x15c0(%r12), %xmm0
movups %xmm0, 0x15c0(%r14)
movl 0x15d0(%r12), %eax
movl %eax, 0x15d0(%r14)
movb 0x1854(%r12), %al
movb %al, 0x1854(%r14)
movq 0x1898(%r12), %rax
movq %rax, 0x1898(%r14)
movl 0x18a0(%r12), %eax
movl %eax, 0x18a0(%r14)
movups 0x19e8(%r12), %xmm0
movups %xmm0, 0x19e8(%r14)
movb 0x1a78(%r12), %al
movb %al, 0x1a78(%r14)
movl $0x19f8, %eax           # imm = 0x19F8
leaq (%r12,%rax), %rcx
movq %rcx, 0x68(%rsp)
addq %r14, %rax
movq %rax, 0x10(%rsp)
movl $0x15d4, %eax           # imm = 0x15D4
leaq (%r12,%rax), %rcx
movq %rcx, 0x58(%rsp)
addq %r14, %rax
movq %rax, 0x60(%rsp)
movl $0x1614, %eax           # imm = 0x1614
leaq (%r12,%rax), %rcx
movq %rcx, 0x48(%rsp)
addq %r14, %rax
movq %rax, 0x50(%rsp)
movl $0x1714, %eax           # imm = 0x1714
leaq (%r12,%rax), %rcx
movq %rcx, 0x38(%rsp)
addq %r14, %rax
movq %rax, 0x40(%rsp)
movl $0x1814, %eax           # imm = 0x1814
leaq (%r12,%rax), %rcx
movq %rcx, 0x28(%rsp)
addq %r14, %rax
movq %rax, 0x30(%rsp)
xorl %edx, %edx
movq %r14, 0x70(%rsp)
leaq (,%rdx,8), %rax
leaq (%rax,%rax,4), %r13
movl 0x1858(%r12,%rdx,4), %eax
movl %eax, 0x1858(%r14,%rdx,4)
movl 0x1878(%r12,%rdx,4), %eax
movl %eax, 0x1878(%r14,%rdx,4)
movq %rdx, %rax
shlq $0x5, %rax
movq 0x48(%rsp), %rcx
addq %rax, %rcx
movl (%rcx,%rdx,4), %ebp
movq 0x50(%rsp), %rcx
addq %rax, %rcx
leaq (%rcx,%rdx,4), %rcx
movq 0x38(%rsp), %rsi
addq %rax, %rsi
movl (%rsi,%rdx,4), %esi
addq 0x40(%rsp), %rax
leaq (%rax,%rdx,4), %r8
movb $0x1, %al
movq %rdx, %r12
shlq $0x4, %r12
movq 0x68(%rsp), %rdi
leaq (%rdi,%r12), %r10
addq 0x10(%rsp), %r12
movq 0x58(%rsp), %rdi
leaq (%rdi,%rdx,8), %rdi
movq 0x60(%rsp), %r9
leaq (%r9,%rdx,8), %r15
movq 0x28(%rsp), %r9
leaq (%r9,%rdx,8), %r9
movq 0x30(%rsp), %r11
leaq (%r11,%rdx,8), %r11
xorl %ebx, %ebx
movsd (%r10,%rbx,8), %xmm0
movsd %xmm0, (%r12,%rbx,8)
movl (%rdi,%rbx,4), %r14d
movl %r14d, (%r15,%rbx,4)
movl %ebp, (%rcx)
movl %esi, (%r8)
movl (%r9,%rbx,4), %r14d
movl %r14d, (%r11,%rbx,4)
movl $0x1, %ebx
testb $0x1, %al
movl $0x0, %eax
jne 0x12b03
movq 0x8(%rsp), %r12
movq 0x18a4(%r12,%r13), %rax
movq 0x70(%rsp), %r14
movq %rax, 0x18a4(%r14,%r13)
incq %rdx
cmpq $0x8, %rdx
jne 0x12a68
movups 0x1a94(%r12), %xmm0
movups %xmm0, 0x1a94(%r14)
movq 0x1ab8(%r12), %rax
movq %rax, 0x1ab8(%r14)
movl 0x1a80(%r12), %eax
movl %eax, 0x1a80(%r14)
movl 0x1a88(%r12), %eax
movl %eax, 0x1a88(%r14)
movb 0x1a8c(%r12), %al
movb %al, 0x1a8c(%r14)
movl 0x1a84(%r12), %eax
movl %eax, 0x1a84(%r14)
movl 0x1a90(%r12), %eax
movl %eax, 0x1a90(%r14)
movups 0x1aa8(%r12), %xmm0
movups %xmm0, 0x1aa8(%r14)
movl $0x2ab0, %edi           # imm = 0x2AB0
leaq (%r12,%rdi), %rsi
addq %r14, %rdi
callq 0x20a0
movl $0x2ad0, %edi           # imm = 0x2AD0
leaq (%r12,%rdi), %rsi
addq %r14, %rdi
callq 0x20a0
movl $0x2af0, %edi           # imm = 0x2AF0
leaq (%r12,%rdi), %rsi
addq %r14, %rdi
callq 0x20a0
movl $0x2a10, %eax           # imm = 0x2A10
addq %rax, %r12
movq %r14, %rdi
addq %rax, %rdi
movl $0xa0, %edx
movq %r12, %rsi
callq 0x20e0
movq %r14, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %rax, %r14
movl $0x2b80, %esi           # imm = 0x2B80
callq 0x2140
movq %r14, %rdi
callq 0x2220
nop