// File: /workspace/github_cpp_makefile_star2_O2/NichtJens[P]lmf2txt/LMF_IO.cpp
// Function: LMF_IO::ReadTDC8HPHeader_LMFV_1_to_7(int)
__int32	LMF_IO::ReadTDC8HPHeader_LMFV_1_to_7(__int32 byte_counter_external)
/////////////////////////////////////////////////////////////////
{
	this->TDC8HP.ui32oldRollOver = 0;
	this->TDC8HP.ui64RollOvers = 0;
	this->TDC8HP.ui32AbsoluteTimeStamp = 0;
	this->TDC8HP.ui64TDC8HP_AbsoluteTimeStamp = 0;

	__int32		byte_counter = 0;

	unsigned __int64 StartPosition1 = input_lmf->tell();

	*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;
L50:
	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;
		if (LMF_Version >= 10) TDC8HP.UserHeaderVersion = 7;
	}
	
	if (TDC8HP.UserHeaderVersion >= 5) {
		input_lmf->seek(StartPosition1);
		if (TDC8HP.UserHeaderVersion < 7) return ReadTDC8HPHeader_LMFV_8_to_9();
		return ReadTDC8HPHeader_LMFV_10();
	}

	*input_lmf >> time_reference; byte_counter += sizeof(__int32);
	*input_lmf >> tdcresolution; byte_counter += sizeof(double);		// tdc resolution in ns
	if (tdcresolution < 0.0001 || tdcresolution > 100.) {
		if (TDC8HP.UserHeaderVersion != 0) return 0;
		TDC8HP.UserHeaderVersion = 1;

		input_lmf->seek(StartPosition);
		goto L50;
	}
	//tdcresolution = double(__int32(tdcresolution*1000000+0.01))/1000000.;
	if (TDC8HP.UserHeaderVersion >= 1) {
		*input_lmf >> TDCDataType; byte_counter += sizeof(__int32);
	}


	unsigned __int64 TempPosition = input_lmf->tell();
	bool bRead32bit = false;

L100:

	if (DAQVersion < 20080000 || bRead32bit) {
		*input_lmf >> number_of_channels; byte_counter += sizeof(__int32);			// number of channels
	} else {
		unsigned __int64 temp;
		*input_lmf >> temp;
		if (temp > 4000000000) {
			input_lmf->seek(TempPosition);
			bRead32bit = true;
			goto L100;
		}
		number_of_channels =__int32(temp);
		byte_counter += sizeof(unsigned __int64);			// number of channels
	}

	if (number_of_channels < 1 || number_of_channels > 100) {
		if (TDC8HP.UserHeaderVersion != 0) return 0;
//		in_ar->Close(); delete in_ar; in_ar = 0;
		input_lmf->seek(StartPosition);
//		in_ar = new CArchive(input_lmf,CArchive::load);
		goto L50;
	}


	if (DAQVersion < 20080000 || bRead32bit) {
		*input_lmf >> max_number_of_hits; byte_counter += sizeof(__int32);			// number of hits
	} else {
		unsigned __int64 temp;
		*input_lmf >> temp;
		max_number_of_hits =__int32(temp);
		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;}

	if (max_number_of_hits < 1 || max_number_of_hits > 100) {
		if (TDC8HP.UserHeaderVersion != 0) return 0;
//		in_ar->Close(); delete in_ar; in_ar = 0;
		input_lmf->seek(StartPosition);
//		in_ar = new CArchive(input_lmf,CArchive::load);
		goto L50;
	}

	*input_lmf >> data_format_in_userheader;	byte_counter += sizeof(__int32);	// data format (2=short integer)
	*input_lmf >> TDC8HP.no_config_file_read;	byte_counter += sizeof(__int32);	// parameter 60-1
	if (DAQVersion < 20080000 || bRead32bit) {
		unsigned __int32 temp;
		*input_lmf >> temp; TDC8HP.RisingEnable_p61 = temp;		byte_counter += sizeof(__int32);	// parameter 61-1
		*input_lmf >> temp; TDC8HP.FallingEnable_p62 = temp;		byte_counter += sizeof(__int32);	// parameter 62-1
	} else {
		*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 >> TDC8HP.OutputLevel_p65;		byte_counter += sizeof(__int32);	// parameter 65-1
	*input_lmf >> TDC8HP.GroupingEnable_p66;	byte_counter += sizeof(__int32);	// parameter 66-1
	*input_lmf >> TDC8HP.AllowOverlap_p67;		byte_counter += sizeof(__int32);	// 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 >> TDC8HP.ExternalClock_p71;		byte_counter += sizeof(__int32);	// parameter 71-1
	*input_lmf >> TDC8HP.OutputRollOvers_p72;	byte_counter += sizeof(__int32);	// 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 >> TDC8HP.INL_p80;				byte_counter += sizeof(__int32);	// parameter 80-1
	*input_lmf >> TDC8HP.DNL_p81;				byte_counter += sizeof(__int32);	// 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 (DAQVersion < 20080000) {
		if ((unsigned) byte_counter == User_header_size - 12 - 4) {  // Cobold 2002 v11
			if (TDC8HP.UserHeaderVersion < 2) TDC8HP.UserHeaderVersion = 2;
			*input_lmf >> TDC8HP.SyncValidationChannel;  byte_counter += sizeof(__int32); 	// parameter 77-1
		}
		if ((unsigned) byte_counter == User_header_size - 12 - 4 - 4) { // never used in official Cobold releases
			TDC8HP.UserHeaderVersion = 3;
			*input_lmf >> TDC8HP.SyncValidationChannel;  byte_counter += sizeof(__int32);
			*input_lmf >> TDC8HP.VHR_25ps;				 byte_counter += sizeof(bool);
		}
	} else {
		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);

		unsigned __int64 TempPosition = input_lmf->tell();
		bool bNoTDCInfoRead = false;
		__int32 old_byte_counter2 = byte_counter;

L200:
		byte_counter = old_byte_counter2;
		input_lmf->seek(TempPosition);

		if (!bNoTDCInfoRead) {
			// read TDCInfo
			*input_lmf >> TDC8HP.Number_of_TDCs;  byte_counter += sizeof(__int32);
				if (TDC8HP.Number_of_TDCs<0 || TDC8HP.Number_of_TDCs>3) {bNoTDCInfoRead = true;	goto L200;}
			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);
			}
		}

		bool bool_dummy;
		*input_lmf >> bool_dummy; byte_counter += sizeof(bool);
		*input_lmf >> bool_dummy; byte_counter += sizeof(bool);
		*input_lmf >> bool_dummy; byte_counter += sizeof(bool);
		*input_lmf >> bool_dummy; byte_counter += sizeof(bool);
		*input_lmf >> bool_dummy; byte_counter += sizeof(bool);

		*input_lmf >> TDC8HP.i32NumberOfDAQLoops;	byte_counter += sizeof(__int32);
		if (TDC8HP.i32NumberOfDAQLoops == 0x12345678) TDC8HP.i32NumberOfDAQLoops = 1;
		*input_lmf >> TDC8HP.TDC8HP_DriverVersion;	byte_counter += sizeof(__int32);
		if (TDC8HP.TDC8HP_DriverVersion == 0x12345678) TDC8HP.TDC8HP_DriverVersion = 0;
		*input_lmf >> TDC8HP.iTriggerChannelMask;	byte_counter += sizeof(__int32);
		if (TDC8HP.iTriggerChannelMask == 0x12345678) TDC8HP.iTriggerChannelMask = 0;
		*input_lmf >> TDC8HP.iTime_zero_channel;	byte_counter += sizeof(__int32);
		if (TDC8HP.iTime_zero_channel == 0x12345678) TDC8HP.iTime_zero_channel = -1;

		if (TDC8HP.i32NumberOfDAQLoops != 0x12345678) {
			if (TDC8HP.i32NumberOfDAQLoops<-2 || TDC8HP.i32NumberOfDAQLoops > 2e6) {bNoTDCInfoRead = true;	goto L200;}
		}
		
		if (TDC8HP.iTime_zero_channel != 0x12345678) {
			if (TDC8HP.iTime_zero_channel <-1 || TDC8HP.iTime_zero_channel  > 50)  {bNoTDCInfoRead = true;	goto L200;}
		}

		__int32 int_dummy;
		*input_lmf >> int_dummy; byte_counter += sizeof(__int32);

		double double_dummy;
		*input_lmf >> double_dummy; byte_counter += sizeof(double);
		*input_lmf >> double_dummy; byte_counter += sizeof(double);
		*input_lmf >> double_dummy; byte_counter += sizeof(double);
		*input_lmf >> double_dummy; byte_counter += sizeof(double);
		*input_lmf >> double_dummy; byte_counter += sizeof(double);
		
		if (!bNoTDCInfoRead && ((unsigned) (byte_counter_external + byte_counter) == User_header_size+4)) {bNoTDCInfoRead = true;	goto L200;}
	}
	
	if (bRead32bit && LMF_Version == 6) {
		TDC8HP.exotic_file_type = 1;
	}

	return byte_counter;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, 0x68(%rsp)
movq %rdi, %rbx
andq $0x0, 0x1548(%rdi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x1534(%rdi)
movq 0x2b18(%rdi), %rdi
movq 0x20(%rdi), %rax
movq %rax, 0x48(%rsp)
leaq 0x12c8(%rbx), %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
leaq 0x2a4(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x2a8(%rbx), %rsi
callq 0x10d66
movq 0x2b18(%rbx), %rdi
leaq 0x129c(%rbx), %rsi
callq 0x10fca
movslq 0x129c(%rbx), %r14
movq %r14, %rdi
incq %rdi
callq 0x2030
movq %rax, %r15
movq 0x2b18(%rbx), %rdi
movq %rax, %rsi
movl %r14d, %edx
callq 0x10d8a
movslq 0x129c(%rbx), %rax
movb $0x0, (%r15,%rax)
leaq 0xa0(%rbx), %rdi
movq %r15, %rsi
callq 0x2230
movq %r15, %rdi
callq 0x21a0
movl 0x129c(%rbx), %ecx
leal 0x14(%rcx), %eax
movl %eax, 0x28(%rsp)
movq 0x2b18(%rbx), %rax
movq 0x20(%rax), %r12
leaq 0x12a4(%rbx), %r14
addl $0x18, %ecx
movq %rcx, 0x30(%rsp)
leaq 0x240(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x12b8(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x12ac(%rbx), %rax
movq %rax, 0x58(%rsp)
leaq 0x2b4(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x2bc(%rbx), %rax
movq %rax, 0x50(%rsp)
leaq 0x40(%rsp), %r15
movl $0xee6b2800, %ebp       # imm = 0xEE6B2800
movq %r14, 0x60(%rsp)
movq %r12, 0x18(%rsp)
cmpl $0x1326581, 0x280(%rbx) # imm = 0x1326581
jb 0x4cbd
movl $0x4, 0x14dc(%rbx)
movq 0x2b18(%rbx), %rdi
jmp 0x4cd4
cmpl $0x0, 0x14dc(%rbx)
movq 0x2b18(%rbx), %rdi
movl 0x28(%rsp), %eax
movl %eax, %r13d
jle 0x4d0a
movq %r14, %rsi
callq 0x10fca
movl (%r14), %eax
cmpl $0x8, %eax
je 0x4ead
cmpl $0x9, %eax
jge 0x4eb2
cmpl $0x4, 0x14dc(%rbx)
jg 0x4ec1
movq 0x2b18(%rbx), %rdi
movq 0x30(%rsp), %r13
movq 0x8(%rsp), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x38(%rsp), %rsi
callq 0x110e4
movsd 0x12b8(%rbx), %xmm0
movsd 0xd343(%rip), %xmm1     # 0x12078
ucomisd %xmm0, %xmm1
ja 0x4d65
ucomisd 0xd33d(%rip), %xmm0     # 0x12080
ja 0x4d65
cmpl $0x0, 0x14dc(%rbx)
jle 0x4d81
movq 0x2b18(%rbx), %rdi
movq 0x58(%rsp), %rsi
callq 0x10fca
addl $0x10, %r13d
jmp 0x4d85
cmpl $0x0, 0x14dc(%rbx)
jne 0x4ea8
movl $0x1, 0x14dc(%rbx)
jmp 0x4e94
addl $0xc, %r13d
movq 0x2b18(%rbx), %rax
movq 0x20(%rax), %r14
xorl %r12d, %r12d
testb $0x1, %r12b
jne 0x4dd2
cmpl $0x132657f, 0x280(%rbx) # imm = 0x132657F
jbe 0x4dd2
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
callq 0x10d78
movq 0x40(%rsp), %rax
cmpq %rbp, %rax
jbe 0x4def
movq 0x2b18(%rbx), %rdi
movq %r14, %rsi
callq 0x235c
movb $0x1, %r12b
jmp 0x4d93
movq 0x2b18(%rbx), %rdi
movq 0x20(%rsp), %rsi
callq 0x10d66
addl $0x4, %r13d
movl 0x2b4(%rbx), %eax
jmp 0x4dfd
movq 0x20(%rsp), %rcx
movl %eax, (%rcx)
addl $0x8, %r13d
xorl %r12d, %r12d
addl $-0x65, %eax
cmpl $-0x65, %eax
jbe 0x4e81
cmpl $0x1326580, 0x280(%rbx) # imm = 0x1326580
setae %al
movl %r12d, %r14d
notb %r14b
testb %al, %r14b
jne 0x4e34
movq 0x2b18(%rbx), %rdi
movq 0x50(%rsp), %rsi
callq 0x10d66
addl $0x4, %r13d
jmp 0x4e51
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
callq 0x10d78
movl 0x40(%rsp), %eax
movl %eax, 0x2bc(%rbx)
addl $0x8, %r13d
movl 0x2b4(%rbx), %eax
cmpl 0x2b70(%rbx), %eax
jg 0x4f02
movl 0x2bc(%rbx), %eax
cmpl 0x2b74(%rbx), %eax
jg 0x4f0e
addl $-0x65, %eax
cmpl $-0x65, %eax
ja 0x4f20
cmpl $0x0, 0x14dc(%rbx)
movq 0x60(%rsp), %r14
movq 0x18(%rsp), %r12
jne 0x4ea8
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
callq 0x235c
jmp 0x4c9e
xorl %r14d, %r14d
jmp 0x4ef0
pushq $0x5
popq %rax
jmp 0x4ebb
sete %al
movzbl %al, %eax
xorl $0x7, %eax
movl %eax, 0x14dc(%rbx)
movq 0x2b18(%rbx), %rdi
movq 0x48(%rsp), %rsi
callq 0x235c
cmpl $0x6, 0x14dc(%rbx)
jg 0x4ee5
movq %rbx, %rdi
callq 0x8878
jmp 0x4eed
movq %rbx, %rdi
callq 0x91d6
movl %eax, %r14d
movl %r14d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x13, 0x12e0(%rbx)
jmp 0x4f18
movl $0x14, 0x12e0(%rbx)
movl $0xfffe7960, %r14d      # imm = 0xFFFE7960
jmp 0x4ef0
movq 0x2b18(%rbx), %rdi
leaq 0x290(%rbx), %r15
movq %r15, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x13fc(%rbx), %rsi
callq 0x10fca
cmpl $0x1326580, 0x280(%rbx) # imm = 0x1326580
setae %al
testb %al, %r14b
movq %r15, 0x8(%rsp)
jne 0x4f9d
movq 0x2b18(%rbx), %rdi
leaq 0x40(%rsp), %r15
movq %r15, %rsi
callq 0x10d66
movl (%r15), %eax
movq %rax, 0x1400(%rbx)
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
callq 0x10d66
movl (%r15), %eax
movq %rax, 0x1408(%rbx)
addl $0x10, %r13d
jmp 0x4fc7
movq 0x2b18(%rbx), %rdi
leaq 0x1400(%rbx), %rsi
callq 0x10d78
movq 0x2b18(%rbx), %rdi
leaq 0x1408(%rbx), %rsi
callq 0x10d78
addl $0x18, %r13d
movq 0x2b18(%rbx), %rdi
leaq 0x1410(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x1414(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x1418(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x141c(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x1424(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x1428(%rbx), %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
leaq 0x1430(%rbx), %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
leaq 0x1438(%rbx), %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
leaq 0x1440(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x1444(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x1448(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x144c(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x1450(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x1454(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x1458(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x145c(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x14d0(%rbx), %rsi
callq 0x10fca
movslq 0x14d0(%rbx), %r15
movq %r15, %rdi
incq %rdi
callq 0x2030
movq %rax, %rbp
movq 0x2b18(%rbx), %rdi
movq %rax, %rsi
movl %r15d, %edx
callq 0x10d8a
movslq 0x14d0(%rbx), %rax
xorl %r14d, %r14d
movb %r14b, (%rbp,%rax)
leaq 0x1470(%rbx), %rdi
movq %rbp, %rsi
callq 0x2230
movq %rbp, %rdi
callq 0x21a0
movq 0x2b18(%rbx), %rdi
leaq 0x14d4(%rbx), %rsi
addl 0x14d0(%rbx), %r13d
callq 0x10fca
movslq 0x14d4(%rbx), %r15
movq %r15, %rdi
incq %rdi
callq 0x2030
movq %rax, %rbp
movq 0x2b18(%rbx), %rdi
movq %rax, %rsi
movl %r15d, %edx
callq 0x10d8a
movslq 0x14d4(%rbx), %rax
movb %r14b, (%rbp,%rax)
leaq 0x1490(%rbx), %rdi
movq %rbp, %rsi
callq 0x2230
movq %rbp, %rdi
callq 0x21a0
movq 0x2b18(%rbx), %rdi
leaq 0x14d8(%rbx), %rsi
addl 0x14d4(%rbx), %r13d
callq 0x10fca
movslq 0x14d8(%rbx), %r15
movq %r15, %rdi
incq %rdi
callq 0x2030
movq %rax, %rbp
movq 0x2b18(%rbx), %rdi
movq %rax, %rsi
movl %r15d, %edx
callq 0x10d8a
movslq 0x14d8(%rbx), %rax
movb %r14b, (%rbp,%rax)
leaq 0x14b0(%rbx), %rdi
movq %rbp, %rsi
callq 0x2230
movq %rbp, %rdi
callq 0x21a0
movl 0x14d8(%rbx), %eax
leal (%rax,%r13), %r14d
addl $0x58, %r14d
cmpl $0x132657f, 0x280(%rbx) # imm = 0x132657F
ja 0x52de
movl 0x29c(%rbx), %eax
leal -0x10(%rax), %ecx
cmpl %ecx, %r14d
jne 0x527b
cmpl $0x1, 0x14dc(%rbx)
jg 0x525e
movl $0x2, 0x14dc(%rbx)
movq 0x2b18(%rbx), %rdi
leaq 0x14e4(%rbx), %rsi
callq 0x10fca
addl $0x4, %r14d
movl 0x29c(%rbx), %eax
addl $-0x14, %eax
cmpl %eax, %r14d
jne 0x52b7
movl $0x3, 0x14dc(%rbx)
movq 0x2b18(%rbx), %rdi
leaq 0x14e4(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x14e0(%rbx), %rsi
callq 0x1114e
addl $0x5, %r14d
movq 0x60(%rsp), %rax
cmpl $0x6, (%rax)
sete %al
andb %al, %r12b
cmpb $0x1, %r12b
jne 0x4ef0
movl $0x1, 0x13f8(%rbx)
jmp 0x4ef0
movq 0x8(%rsp), %rax
cmpl $-0x1, (%rax)
jne 0x52f2
movl $0x1, 0x14e8(%rbx)
movq 0x2b18(%rbx), %rdi
leaq 0x14e4(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x14e0(%rbx), %rsi
callq 0x1114e
movq 0x2b18(%rbx), %rdi
leaq 0x14f0(%rbx), %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
leaq 0x14ec(%rbx), %rsi
callq 0x1114e
movq 0x2b18(%rbx), %rdi
leaq 0x14ed(%rbx), %rsi
callq 0x1114e
movq 0x2b18(%rbx), %rdi
leaq 0x14ee(%rbx), %rsi
callq 0x1114e
leal 0x10(%r14), %ebp
movq 0x2b18(%rbx), %rdi
movq 0x20(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq 0x14f8(%rbx), %rax
movq %rax, 0x58(%rsp)
addl $0x14, %r14d
movq %r14, 0x50(%rsp)
leaq 0x1518(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x151c(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x1520(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x1524(%rbx), %rax
movq %rax, 0x28(%rsp)
xorl %r15d, %r15d
leaq 0x17(%rsp), %r13
movl %ebp, 0x48(%rsp)
movq 0x20(%rsp), %rsi
callq 0x235c
movl %ebp, %r14d
testb $0x1, %r15b
jne 0x5581
movq 0x2b18(%rbx), %rdi
movq 0x58(%rsp), %rsi
callq 0x10fca
movl 0x14f8(%rbx), %eax
cmpl $0x3, %eax
ja 0x5733
xorl %ebp, %ebp
movq 0x50(%rsp), %r14
cltq
cmpq %rax, %rbp
jge 0x557d
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rsi
addq $0x4, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rsi
addq $0x8, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rsi
addq $0xc, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rsi
addq $0x10, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rsi
addq $0x14, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rsi
addq $0x18, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rsi
addq $0x20, %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rsi
addq $0x28, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rsi
addq $0x2c, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rsi
addq $0x30, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rax
movq 0x38(%rax), %rsi
movl $0x8000, %edx           # imm = 0x8000
callq 0x10d8a
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rax
movq 0x40(%rax), %rsi
movl $0x4000, %edx           # imm = 0x4000
callq 0x10d8a
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%rbp,8), %rsi
addq $0x48, %rsi
callq 0x1114e
addl $0xc031, %r14d          # imm = 0xC031
incq %rbp
movl 0x14f8(%rbx), %eax
jmp 0x5407
movl 0x48(%rsp), %ebp
movq 0x2b18(%rbx), %rdi
movq %r13, %rsi
callq 0x1114e
movq 0x2b18(%rbx), %rdi
movq %r13, %rsi
callq 0x1114e
movq 0x2b18(%rbx), %rdi
movq %r13, %rsi
callq 0x1114e
movq 0x2b18(%rbx), %rdi
movq %r13, %rsi
callq 0x1114e
movq 0x2b18(%rbx), %rdi
movq %r13, %rsi
callq 0x1114e
movq 0x2b18(%rbx), %rdi
movq 0x8(%rsp), %rsi
callq 0x10fca
cmpl $0x12345678, 0x1518(%rbx) # imm = 0x12345678
jne 0x55f4
movq 0x8(%rsp), %rax
movl $0x1, (%rax)
movq 0x2b18(%rbx), %rdi
movq 0x38(%rsp), %rsi
callq 0x10d66
cmpl $0x12345678, 0x151c(%rbx) # imm = 0x12345678
jne 0x5619
movq 0x38(%rsp), %rax
andl $0x0, (%rax)
movq 0x2b18(%rbx), %rdi
movq 0x30(%rsp), %rsi
callq 0x10fca
cmpl $0x12345678, 0x1520(%rbx) # imm = 0x12345678
jne 0x563e
movq 0x30(%rsp), %rax
andl $0x0, (%rax)
movq 0x2b18(%rbx), %rdi
movq 0x28(%rsp), %rsi
callq 0x10fca
movl 0x1524(%rbx), %eax
cmpl $0x12345678, %eax       # imm = 0x12345678
jne 0x5667
movq 0x28(%rsp), %rax
orl $-0x1, (%rax)
pushq $-0x1
popq %rax
movq 0x8(%rsp), %rcx
movl (%rcx), %ecx
cmpl $0x12345678, %ecx       # imm = 0x12345678
setne %dl
addl $0xffe17b7f, %ecx       # imm = 0xFFE17B7F
cmpl $0xffe17b7d, %ecx       # imm = 0xFFE17B7D
setb %cl
andb %dl, %cl
addl $-0x33, %eax
cmpl $-0x34, %eax
setb %al
orb %cl, %al
jne 0x5733
movq %r15, 0x18(%rsp)
movl %ebp, %r15d
movq %r13, %rbp
movq 0x2b18(%rbx), %rdi
leaq 0x74(%rsp), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x40(%rsp), %r13
movq %r13, %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
movq %r13, %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
movq %r13, %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
movq %r13, %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
movq %r13, %rsi
callq 0x110e4
addl $0x41, %r14d
testb $0x1, 0x18(%rsp)
jne 0x52b7
movq 0x68(%rsp), %rax
addl %r14d, %eax
movl 0x29c(%rbx), %ecx
addl $0x4, %ecx
cmpl %ecx, %eax
jne 0x52b7
movq %rbp, %r13
movl %r15d, %ebp
movq 0x2b18(%rbx), %rdi
movb $0x1, %r15b
jmp 0x53c9