// File: NichtJens[P]lmf2txt/LMF_IO.cpp
// Function: LMF_IO::ReadTDC8HPHeader_LMFV_8_to_9()
__int32	LMF_IO::ReadTDC8HPHeader_LMFV_8_to_9()
// reads LMF headers from Cobold 2008 R2 (release August 2009)
/////////////////////////////////////////////////////////////////
{
	this->TDC8HP.ui32oldRollOver = 0;
	this->TDC8HP.ui64RollOvers = 0;
	this->TDC8HP.ui32AbsoluteTimeStamp = 0;
	this->TDC8HP.ui64TDC8HP_AbsoluteTimeStamp = 0;

	__int32		byte_counter = 0;

	*input_lmf >> frequency;	byte_counter += sizeof(double);		// frequency is always 4th value
	*input_lmf >> IOaddress;	byte_counter += sizeof(__int32);		// IO address (parameter 1) always 5th value
	*input_lmf >> timestamp_format;	byte_counter += sizeof(__int32);	// TimeInfo (parameter 2) always 6th value  (0,1,2)*32Bit

	*input_lmf >> DAQ_info_Length;	byte_counter += sizeof(__int32);		// Length of DAQInfo always 7th value
	__int8 * __int8_temp = new __int8[DAQ_info_Length+1];
	input_lmf->read(__int8_temp,DAQ_info_Length);	// DAQInfo always 8th value
	__int8_temp[DAQ_info_Length] = 0;
	DAQ_info = __int8_temp;
	delete[] __int8_temp; __int8_temp = 0;
	byte_counter += DAQ_info_Length;

//	input_lmf->flush();
//	unsigned __int64 StartPosition = input_lmf->tell();
	__int32 old_byte_counter = byte_counter;

	byte_counter = old_byte_counter;

	if (DAQVersion > 20080000) TDC8HP.UserHeaderVersion = 4;

	if (TDC8HP.UserHeaderVersion >= 1) {
		*input_lmf >> LMF_Version; byte_counter += sizeof(__int32);
		if (LMF_Version == 8) TDC8HP.UserHeaderVersion = 5;
		if (LMF_Version >= 9) TDC8HP.UserHeaderVersion = 6;
	}

	*input_lmf >> this->number_of_DAQ_source_strings;  byte_counter += sizeof(__int32);

	DAQ_source_strings = new std::string*[number_of_DAQ_source_strings];
	memset(DAQ_source_strings,0,sizeof(std::string*)*number_of_DAQ_source_strings);
	for (__int32 i=0;i<number_of_DAQ_source_strings;++i) {
		__int32 string_len;
		*input_lmf >> string_len;    byte_counter += sizeof(__int32);
		DAQ_source_strings[i] = new std::string();
		DAQ_source_strings[i]->reserve(string_len);
		while (string_len > 0) {
			__int8 c;
			*input_lmf >> c;     byte_counter += sizeof(__int8);
			*DAQ_source_strings[i] += c;
			--string_len;
		}
	}
	
	*input_lmf >> time_reference; byte_counter += sizeof(__int32);
	*input_lmf >> tdcresolution; byte_counter += sizeof(double);		// tdc resolution in ns
	*input_lmf >> TDCDataType; byte_counter += sizeof(__int32);

	unsigned __int64 temp_uint64;
	*input_lmf >> temp_uint64;
	number_of_channels =__int32(temp_uint64);
	byte_counter += sizeof(unsigned __int64);			// number of channels

	*input_lmf >> temp_uint64;
	max_number_of_hits =__int32(temp_uint64);
	byte_counter += sizeof(unsigned __int64);			// number of hits

	if (int(number_of_channels) > num_channels)	{errorflag = 19;	return -100000;}
	if (int(max_number_of_hits) > num_ions)		{errorflag = 20;	return -100000;}

	*input_lmf >> data_format_in_userheader;	byte_counter += sizeof(__int32);	// data format (2=short integer)

	bool temp_bool;

	*input_lmf >> temp_bool; TDC8HP.no_config_file_read = temp_bool; byte_counter += sizeof(bool);	// parameter 60-1
		
	*input_lmf >> TDC8HP.RisingEnable_p61;		byte_counter += sizeof(__int64);	// parameter 61-1
	*input_lmf >> TDC8HP.FallingEnable_p62;		byte_counter += sizeof(__int64);	// parameter 62-1
	*input_lmf >> TDC8HP.TriggerEdge_p63;		byte_counter += sizeof(__int32);	// parameter 63-1
	*input_lmf >> TDC8HP.TriggerChannel_p64;	byte_counter += sizeof(__int32);	// parameter 64-1

	*input_lmf >> temp_bool; TDC8HP.OutputLevel_p65    = temp_bool;	byte_counter += sizeof(bool);	// parameter 65-1
	*input_lmf >> temp_bool; TDC8HP.GroupingEnable_p66 = temp_bool;	byte_counter += sizeof(bool);	// parameter 66-1
	*input_lmf >> temp_bool; TDC8HP.AllowOverlap_p67   = temp_bool;	byte_counter += sizeof(bool);	// parameter 67-1

	*input_lmf >> TDC8HP.TriggerDeadTime_p68;	byte_counter += sizeof(double);		// parameter 68-1
	*input_lmf >> TDC8HP.GroupRangeStart_p69;	byte_counter += sizeof(double);		// parameter 69-1
	*input_lmf >> TDC8HP.GroupRangeEnd_p70;		byte_counter += sizeof(double);		// parameter 70-1

	*input_lmf >> temp_bool; TDC8HP.ExternalClock_p71   = temp_bool;	byte_counter += sizeof(bool);	// parameter 71-1
	*input_lmf >> temp_bool; TDC8HP.OutputRollOvers_p72 = temp_bool;	byte_counter += sizeof(bool);	// parameter 72-1

	*input_lmf >> TDC8HP.DelayTap0_p73;			byte_counter += sizeof(__int32);	// parameter 73-1
	*input_lmf >> TDC8HP.DelayTap1_p74;			byte_counter += sizeof(__int32);	// parameter 74-1
	*input_lmf >> TDC8HP.DelayTap2_p75;			byte_counter += sizeof(__int32);	// parameter 75-1
	*input_lmf >> TDC8HP.DelayTap3_p76;			byte_counter += sizeof(__int32);	// parameter 76-1

	*input_lmf >> temp_bool; TDC8HP.INL_p80 = temp_bool;	byte_counter += sizeof(bool);	// parameter 80-1
	*input_lmf >> temp_bool; TDC8HP.DNL_p81 = temp_bool;	byte_counter += sizeof(bool);	// parameter 81-1

	*input_lmf >> TDC8HP.csConfigFile_Length;
	byte_counter += sizeof(__int32);
	__int8_temp = new __int8[TDC8HP.csConfigFile_Length+1];
	input_lmf->read(__int8_temp,TDC8HP.csConfigFile_Length);
	__int8_temp[TDC8HP.csConfigFile_Length] = 0;
	TDC8HP.csConfigFile = __int8_temp;
	delete[] __int8_temp; __int8_temp = 0;
	byte_counter += TDC8HP.csConfigFile_Length;

	*input_lmf >> TDC8HP.csINLFile_Length;
	byte_counter += sizeof(__int32);
	__int8_temp = new __int8[TDC8HP.csINLFile_Length+1];
	input_lmf->read(__int8_temp,TDC8HP.csINLFile_Length);
	__int8_temp[TDC8HP.csINLFile_Length] = 0;
	TDC8HP.csINLFile = __int8_temp;
	delete[] __int8_temp; __int8_temp = 0;
	byte_counter += TDC8HP.csINLFile_Length;

	*input_lmf >> TDC8HP.csDNLFile_Length;
	byte_counter += sizeof(__int32);
	__int8_temp = new __int8[TDC8HP.csDNLFile_Length+1];
	input_lmf->read(__int8_temp,TDC8HP.csDNLFile_Length);
	__int8_temp[TDC8HP.csDNLFile_Length] = 0;
	TDC8HP.csDNLFile = __int8_temp;
	delete[] __int8_temp; __int8_temp = 0;
	byte_counter += TDC8HP.csDNLFile_Length;

	if (this->data_format_in_userheader == -1) TDC8HP.variable_event_length = 1;
	*input_lmf >> TDC8HP.SyncValidationChannel;  byte_counter += sizeof(__int32);
	*input_lmf >> TDC8HP.VHR_25ps;  byte_counter += sizeof(bool);
	*input_lmf >> TDC8HP.GroupTimeOut;  byte_counter += sizeof(double);
	*input_lmf >> TDC8HP.SSEEnable;  byte_counter += sizeof(bool);
	*input_lmf >> TDC8HP.MMXEnable;  byte_counter += sizeof(bool);
	*input_lmf >> TDC8HP.DMAEnable;  byte_counter += sizeof(bool);

	//// read TDCInfo
	*input_lmf >> TDC8HP.Number_of_TDCs;  byte_counter += sizeof(__int32);
	for(__int32 iCount=0;iCount<TDC8HP.Number_of_TDCs;++iCount) {
		*input_lmf >> TDC8HP.TDC_info[iCount]->index;				byte_counter += sizeof(__int32);
		*input_lmf >> TDC8HP.TDC_info[iCount]->channelCount;			byte_counter += sizeof(__int32);
		*input_lmf >> TDC8HP.TDC_info[iCount]->channelStart;			byte_counter += sizeof(__int32);
		*input_lmf >> TDC8HP.TDC_info[iCount]->highResChannelCount;	byte_counter += sizeof(__int32);
		*input_lmf >> TDC8HP.TDC_info[iCount]->highResChannelStart;	byte_counter += sizeof(__int32);
		*input_lmf >> TDC8HP.TDC_info[iCount]->lowResChannelCount;	byte_counter += sizeof(__int32);
		*input_lmf >> TDC8HP.TDC_info[iCount]->lowResChannelStart;	byte_counter += sizeof(__int32);
		*input_lmf >> TDC8HP.TDC_info[iCount]->resolution;			byte_counter += sizeof(double);
		*input_lmf >> TDC8HP.TDC_info[iCount]->serialNumber;			byte_counter += sizeof(__int32);
		*input_lmf >> TDC8HP.TDC_info[iCount]->version;				byte_counter += sizeof(__int32);
		*input_lmf >> TDC8HP.TDC_info[iCount]->fifoSize;				byte_counter += sizeof(__int32);
		input_lmf->read((__int8*)TDC8HP.TDC_info[iCount]->INLCorrection,sizeof(__int32)*8*1024);		byte_counter += sizeof(__int32)*8*1024;
		input_lmf->read((__int8*)TDC8HP.TDC_info[iCount]->DNLData,sizeof(unsigned __int16)*8*1024);	byte_counter += sizeof(unsigned __int16)*8*1024;
		*input_lmf >> TDC8HP.TDC_info[iCount]->flashValid;			byte_counter += sizeof(bool);
	}

	*input_lmf >> TDC8HP.number_of_bools; byte_counter += sizeof(__int32);
	for (__int32 i=0;i<TDC8HP.number_of_bools;++i) {
		bool bool_dummy;
		*input_lmf >> bool_dummy;	byte_counter += sizeof(bool);
	}

	*input_lmf >> TDC8HP.number_of_int32s; byte_counter += sizeof(__int32);

	*input_lmf >> TDC8HP.i32NumberOfDAQLoops;	byte_counter += sizeof(__int32);
	*input_lmf >> TDC8HP.TDC8HP_DriverVersion;	byte_counter += sizeof(__int32);
	*input_lmf >> TDC8HP.iTriggerChannelMask;	byte_counter += sizeof(__int32);
	*input_lmf >> TDC8HP.iTime_zero_channel;	byte_counter += sizeof(__int32); // 1 is first channel
	
	if (TDC8HP.UserHeaderVersion >= 6) {
		*input_lmf >> TDC8HP.BinsizeType;	byte_counter += sizeof(__int32); // 1 is first channel
		for (__int32 i=5;i<TDC8HP.number_of_int32s;++i) {
			__int32 int_dummy;
			*input_lmf >> int_dummy;	byte_counter += sizeof(__int32);
		}
	} else {
		for (__int32 i=4;i<TDC8HP.number_of_int32s;++i) {
			__int32 int_dummy;
			*input_lmf >> int_dummy;	byte_counter += sizeof(__int32);
		}
	}
	

	

	*input_lmf >> TDC8HP.number_of_doubles; byte_counter += sizeof(__int32);
	if (TDC8HP.UserHeaderVersion == 5) {
		for (__int32 i=0;i<TDC8HP.number_of_doubles;++i) {
			double double_dummy;
			*input_lmf >> double_dummy; byte_counter += sizeof(double);
		}
	}
	if (TDC8HP.UserHeaderVersion >= 6) {
		*input_lmf >> TDC8HP.OffsetTimeZeroChannel_s;  byte_counter += sizeof(double);
		for (__int32 i=1;i<TDC8HP.number_of_doubles;++i) {
			double double_dummy;
			*input_lmf >> double_dummy; byte_counter += sizeof(double);
		}
	}

	return byte_counter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0x88(%rbp)
movl $0x0, 0x1534(%rsi)
movq $0x0, 0x1538(%rsi)
movl $0x0, 0x1540(%rsi)
movq $0x0, 0x1548(%rsi)
movl $0x0, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x12c8, %rsi           # imm = 0x12C8
callq 0x1d1f0
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x8, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x2a4, %rsi            # imm = 0x2A4
callq 0x1cf60
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x2a8, %rsi            # imm = 0x2A8
callq 0x1cb80
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x129c, %rsi           # imm = 0x129C
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movl 0x129c(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq 0x2b18(%rax), %rdi
movq -0x20(%rbp), %rsi
movl 0x129c(%rax), %edx
callq 0x1cbe0
movq -0x88(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq 0x129c(%rdi), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rsi
addq $0xa0, %rdi
callq 0x2250
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, %rax
je 0xdb91
movq -0x80(%rbp), %rdi
callq 0x2240
movq -0x88(%rbp), %rax
movq $0x0, -0x20(%rbp)
movl 0x129c(%rax), %ecx
addl -0x14(%rbp), %ecx
movl %ecx, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movl %ecx, -0x24(%rbp)
movl -0x24(%rbp), %ecx
movl %ecx, -0x14(%rbp)
cmpl $0x1326580, 0x280(%rax) # imm = 0x1326580
jbe 0xdbd5
movq -0x88(%rbp), %rax
movl $0x4, 0x14dc(%rax)
movq -0x88(%rbp), %rax
cmpl $0x1, 0x14dc(%rax)
jl 0xdc4e
movq -0x88(%rbp), %rsi
movq 0x2b18(%rsi), %rdi
addq $0x12a4, %rsi           # imm = 0x12A4
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
cmpl $0x8, 0x12a4(%rax)
jne 0xdc2b
movq -0x88(%rbp), %rax
movl $0x5, 0x14dc(%rax)
movq -0x88(%rbp), %rax
cmpl $0x9, 0x12a4(%rax)
jl 0xdc4c
movq -0x88(%rbp), %rax
movl $0x6, 0x14dc(%rax)
jmp 0xdc4e
movq -0x88(%rbp), %rsi
movq 0x2b18(%rsi), %rdi
addq $0x1328, %rsi           # imm = 0x1328
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movslq 0x1328(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, 0x1330(%rax)
movq 0x1330(%rax), %rdi
movslq 0x1328(%rax), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x20d0
movl $0x0, -0x28(%rbp)
movq -0x88(%rbp), %rcx
movl -0x28(%rbp), %eax
cmpl 0x1328(%rcx), %eax
jge 0xddbd
movq -0x88(%rbp), %rax
movq 0x2b18(%rax), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1cf60
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movl $0x20, %edi
callq 0x2190
movq %rax, %rdi
movq %rdi, -0x90(%rbp)
callq 0x2260
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rax
movq 0x1330(%rax), %rcx
movslq -0x28(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x1330(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x22d0
cmpl $0x0, -0x2c(%rbp)
jle 0xddad
movq -0x88(%rbp), %rax
movq 0x2b18(%rax), %rdi
leaq -0x2d(%rbp), %rsi
callq 0x1d0e0
movq -0x88(%rbp), %rcx
movslq -0x14(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movb -0x2d(%rbp), %al
movq 0x1330(%rcx), %rcx
movslq -0x28(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movsbl %al, %esi
callq 0x2100
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xdd59
jmp 0xddaf
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xdcd3
movq -0x88(%rbp), %rsi
movq 0x2b18(%rsi), %rdi
addq $0x240, %rsi            # imm = 0x240
callq 0x1cf60
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x12b8, %rsi           # imm = 0x12B8
callq 0x1d1f0
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x8, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x12ac, %rsi           # imm = 0x12AC
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x1cbb0
movq -0x88(%rbp), %rax
movq -0x38(%rbp), %rcx
movl %ecx, 0x2b4(%rax)
movslq -0x14(%rbp), %rcx
addq $0x8, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
leaq -0x38(%rbp), %rsi
callq 0x1cbb0
movq -0x88(%rbp), %rcx
movq -0x38(%rbp), %rax
movl %eax, 0x2bc(%rcx)
movslq -0x14(%rbp), %rax
addq $0x8, %rax
movl %eax, -0x14(%rbp)
movl 0x2b4(%rcx), %eax
cmpl 0x2b70(%rcx), %eax
jle 0xdeb6
movq -0x88(%rbp), %rax
movl $0x13, 0x12e0(%rax)
movl $0xfffe7960, -0x4(%rbp) # imm = 0xFFFE7960
jmp 0xebd5
movq -0x88(%rbp), %rcx
movl 0x2bc(%rcx), %eax
cmpl 0x2b74(%rcx), %eax
jle 0xdee8
movq -0x88(%rbp), %rax
movl $0x14, 0x12e0(%rax)
movl $0xfffe7960, -0x4(%rbp) # imm = 0xFFFE7960
jmp 0xebd5
movq -0x88(%rbp), %rsi
movq 0x2b18(%rsi), %rdi
addq $0x290, %rsi            # imm = 0x290
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
leaq -0x39(%rbp), %rsi
callq 0x1d2d0
movq -0x88(%rbp), %rsi
movb -0x39(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x13fc(%rsi)
movslq -0x14(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x8, %rsi
callq 0x1cbb0
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x8, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x10, %rsi
callq 0x1cbb0
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x8, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x18, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x1c, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
leaq -0x39(%rbp), %rsi
callq 0x1d2d0
movq -0x88(%rbp), %rax
movb -0x39(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movl %ecx, 0x1418(%rax)
movslq -0x14(%rbp), %rcx
addq $0x1, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
leaq -0x39(%rbp), %rsi
callq 0x1d2d0
movq -0x88(%rbp), %rax
movb -0x39(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movl %ecx, 0x141c(%rax)
movslq -0x14(%rbp), %rcx
addq $0x1, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
leaq -0x39(%rbp), %rsi
callq 0x1d2d0
movq -0x88(%rbp), %rsi
movb -0x39(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x1424(%rsi)
movslq -0x14(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x30, %rsi
callq 0x1d1f0
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x8, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x38, %rsi
callq 0x1d1f0
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x8, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x40, %rsi
callq 0x1d1f0
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x8, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
leaq -0x39(%rbp), %rsi
callq 0x1d2d0
movq -0x88(%rbp), %rax
movb -0x39(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movl %ecx, 0x1440(%rax)
movslq -0x14(%rbp), %rcx
addq $0x1, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
leaq -0x39(%rbp), %rsi
callq 0x1d2d0
movq -0x88(%rbp), %rsi
movb -0x39(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x1444(%rsi)
movslq -0x14(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x50, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x54, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x58, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x5c, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
leaq -0x39(%rbp), %rsi
callq 0x1d2d0
movq -0x88(%rbp), %rax
movb -0x39(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movl %ecx, 0x1458(%rax)
movslq -0x14(%rbp), %rcx
addq $0x1, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
leaq -0x39(%rbp), %rsi
callq 0x1d2d0
movq -0x88(%rbp), %rsi
movb -0x39(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x145c(%rsi)
movslq -0x14(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0xd8, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movl 0x14d0(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq 0x2b18(%rax), %rdi
movq -0x20(%rbp), %rsi
movl 0x14d0(%rax), %edx
callq 0x1cbe0
movq -0x88(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq 0x14d0(%rdi), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rsi
addq $0x13f8, %rdi           # imm = 0x13F8
addq $0x78, %rdi
callq 0x2250
movq -0x20(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpq $0x0, %rax
je 0xe303
movq -0x98(%rbp), %rdi
callq 0x2240
movq -0x88(%rbp), %rsi
movq $0x0, -0x20(%rbp)
movl 0x14d0(%rsi), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0xdc, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movl 0x14d4(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq 0x2b18(%rax), %rdi
movq -0x20(%rbp), %rsi
movl 0x14d4(%rax), %edx
callq 0x1cbe0
movq -0x88(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq 0x14d4(%rdi), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rsi
addq $0x13f8, %rdi           # imm = 0x13F8
addq $0x98, %rdi
callq 0x2250
movq -0x20(%rbp), %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, %rax
je 0xe3c9
movq -0xa0(%rbp), %rdi
callq 0x2240
movq -0x88(%rbp), %rsi
movq $0x0, -0x20(%rbp)
movl 0x14d4(%rsi), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0xe0, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movl 0x14d8(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq 0x2b18(%rax), %rdi
movq -0x20(%rbp), %rsi
movl 0x14d8(%rax), %edx
callq 0x1cbe0
movq -0x88(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq 0x14d8(%rdi), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rsi
addq $0x13f8, %rdi           # imm = 0x13F8
addq $0xb8, %rdi
callq 0x2250
movq -0x20(%rbp), %rax
movq %rax, -0xa8(%rbp)
cmpq $0x0, %rax
je 0xe48f
movq -0xa8(%rbp), %rdi
callq 0x2240
movq -0x88(%rbp), %rax
movq $0x0, -0x20(%rbp)
movl 0x14d8(%rax), %ecx
addl -0x14(%rbp), %ecx
movl %ecx, -0x14(%rbp)
cmpl $-0x1, 0x290(%rax)
jne 0xe4c4
movq -0x88(%rbp), %rax
movl $0x1, 0x14e8(%rax)
movq -0x88(%rbp), %rsi
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0xec, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0xe8, %rsi
callq 0x1d2d0
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0xf8, %rsi
callq 0x1d1f0
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x8, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0xf4, %rsi
callq 0x1d2d0
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0xf5, %rsi
callq 0x1d2d0
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0xf6, %rsi
callq 0x1d2d0
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x100, %rsi            # imm = 0x100
callq 0x1cf60
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x88(%rbp), %rcx
movl -0x40(%rbp), %eax
cmpl 0x14f8(%rcx), %eax
jge 0xe8b3
movq -0x88(%rbp), %rax
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rsi
addq $0x4, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rsi
addq $0x8, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rsi
addq $0xc, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rsi
addq $0x10, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rsi
addq $0x14, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rsi
addq $0x18, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rsi
addq $0x20, %rsi
callq 0x1d1f0
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x8, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rsi
addq $0x28, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rsi
addq $0x2c, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rsi
addq $0x30, %rsi
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rax
movq 0x38(%rax), %rsi
movl $0x8000, %edx           # imm = 0x8000
callq 0x1cbe0
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x8000, %rcx           # imm = 0x8000
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rax
movq 0x40(%rax), %rsi
movl $0x4000, %edx           # imm = 0x4000
callq 0x1cbe0
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4000, %rcx           # imm = 0x4000
movl %ecx, -0x14(%rbp)
movq 0x2b18(%rax), %rdi
movslq -0x40(%rbp), %rcx
movq 0x1500(%rax,%rcx,8), %rsi
addq $0x48, %rsi
callq 0x1d2d0
movslq -0x14(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xe5ff
movq -0x88(%rbp), %rsi
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x130, %rsi            # imm = 0x130
callq 0x1cf60
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x88(%rbp), %rcx
movl -0x44(%rbp), %eax
cmpl 0x1528(%rcx), %eax
jge 0xe925
movq -0x88(%rbp), %rax
movq 0x2b18(%rax), %rdi
leaq -0x45(%rbp), %rsi
callq 0x1d2d0
movslq -0x14(%rbp), %rax
addq $0x1, %rax
movl %eax, -0x14(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xe8e6
movq -0x88(%rbp), %rsi
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x134, %rsi            # imm = 0x134
callq 0x1cf60
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x120, %rsi            # imm = 0x120
callq 0x1cf60
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x124, %rsi            # imm = 0x124
callq 0x1cb80
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x128, %rsi            # imm = 0x128
callq 0x1cf60
movq -0x88(%rbp), %rsi
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x12c, %rsi            # imm = 0x12C
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
cmpl $0x6, 0x14dc(%rax)
jl 0xea82
movq -0x88(%rbp), %rsi
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x70, %rsi
callq 0x1cf60
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movl $0x5, -0x4c(%rbp)
movq -0x88(%rbp), %rcx
movl -0x4c(%rbp), %eax
cmpl 0x152c(%rcx), %eax
jge 0xea80
movq -0x88(%rbp), %rax
movq 0x2b18(%rax), %rdi
leaq -0x50(%rbp), %rsi
callq 0x1cf60
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xea41
jmp 0xeaca
movl $0x4, -0x54(%rbp)
movq -0x88(%rbp), %rcx
movl -0x54(%rbp), %eax
cmpl 0x152c(%rcx), %eax
jge 0xeac8
movq -0x88(%rbp), %rax
movq 0x2b18(%rax), %rdi
leaq -0x58(%rbp), %rsi
callq 0x1cf60
movslq -0x14(%rbp), %rax
addq $0x4, %rax
movl %eax, -0x14(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xea89
jmp 0xeaca
movq -0x88(%rbp), %rsi
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x138, %rsi            # imm = 0x138
callq 0x1cf60
movq -0x88(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq $0x4, %rcx
movl %ecx, -0x14(%rbp)
cmpl $0x5, 0x14dc(%rax)
jne 0xeb4e
movl $0x0, -0x5c(%rbp)
movq -0x88(%rbp), %rcx
movl -0x5c(%rbp), %eax
cmpl 0x1530(%rcx), %eax
jge 0xeb4c
movq -0x88(%rbp), %rax
movq 0x2b18(%rax), %rdi
leaq -0x68(%rbp), %rsi
callq 0x1d1f0
movslq -0x14(%rbp), %rax
addq $0x8, %rax
movl %eax, -0x14(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xeb0d
jmp 0xeb4e
movq -0x88(%rbp), %rax
cmpl $0x6, 0x14dc(%rax)
jl 0xebcf
movq -0x88(%rbp), %rsi
movq 0x2b18(%rsi), %rdi
addq $0x13f8, %rsi           # imm = 0x13F8
addq $0x68, %rsi
callq 0x1d1f0
movslq -0x14(%rbp), %rax
addq $0x8, %rax
movl %eax, -0x14(%rbp)
movl $0x1, -0x6c(%rbp)
movq -0x88(%rbp), %rcx
movl -0x6c(%rbp), %eax
cmpl 0x1530(%rcx), %eax
jge 0xebcd
movq -0x88(%rbp), %rax
movq 0x2b18(%rax), %rdi
leaq -0x78(%rbp), %rsi
callq 0x1d1f0
movslq -0x14(%rbp), %rax
addq $0x8, %rax
movl %eax, -0x14(%rbp)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0xeb8e
jmp 0xebcf
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)