// File: /workspace/github_cpp_makefile_star2_O1/NichtJens[P]lmf2txt/LMF_IO.cpp
// Function: LMF_IO::Read2TDC8PCI2Header()
__int32	LMF_IO::Read2TDC8PCI2Header()
/////////////////////////////////////////////////////////////////
{
	unsigned __int64 StartPosition = 0;
	__int32 old_byte_counter = 0;
	bool desperate_mode = false;

	TDC8PCI2.variable_event_length = 0;
	__int32 byte_counter;
	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 >> LMF_Version; byte_counter += sizeof(__int32);
	*input_lmf >> system_timeout; byte_counter += sizeof(__int32);		// system time-out
	
	if (LMF_Version >= 9 && DAQVersion >= 20110208) {				// handle new CStringArray information
		unsigned __int32 ui32CStringCount = system_timeout;			// # of defined CStrings

		__int32 iDummy;
		__int8 cDummy;
		for(unsigned __int32 ui32Count=0;ui32Count<ui32CStringCount;ui32Count++) {	// now read every CString
			*input_lmf >> iDummy; byte_counter += sizeof(__int32);					// how many characters to read
			for(unsigned __int32 ui32Count2=0;ui32Count2<(unsigned int)iDummy;ui32Count2++)		// read character by character
				input_lmf->read(&cDummy,1);							// skip over DAq-source code
			byte_counter += iDummy;
		}
		*input_lmf >> system_timeout; byte_counter += sizeof(__int32);		// again system time-out
	}
	
	*input_lmf >> time_reference; byte_counter += sizeof(__int32);
	*input_lmf >> common_mode; byte_counter += sizeof(__int32);			// 0 common start    1 common stop
	*input_lmf >> tdcresolution; byte_counter += sizeof(double);	// tdc resolution in ns

	*input_lmf >> TDCDataType; byte_counter += sizeof(__int32);
	*input_lmf >> timerange; byte_counter += sizeof(__int32);			// time range of the tdc in microseconds
	if (DAQVersion >= 20080507 && DAQVersion < 20110208) {
		TDC8PCI2.variable_event_length = 1;
		__int32 iDummy;
		unsigned __int64 i64temp;
		*input_lmf >> i64temp;		number_of_channels =__int32(i64temp);	byte_counter += sizeof(unsigned __int64);			// number of channels
		*input_lmf >> i64temp;		max_number_of_hits =__int32(i64temp);	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 >> i64temp;		number_of_channels2 =__int32(i64temp);	byte_counter += sizeof(unsigned __int64);			// number of channels2
		*input_lmf >> i64temp;		max_number_of_hits2 =__int32(i64temp);	byte_counter += sizeof(unsigned __int64);			// number of hits2
		*input_lmf >> iDummy;			byte_counter += sizeof(__int32);

		*input_lmf >> iDummy;			byte_counter += sizeof(__int32);

		*input_lmf >> iDummy;			byte_counter += sizeof(__int32);
		*input_lmf >> iDummy;			byte_counter += sizeof(__int32);
		*input_lmf >> iDummy;			byte_counter += sizeof(__int32);		// Sync Mode    (parameter 60)
		*input_lmf >> iDummy;			byte_counter += sizeof(__int32);		// IO address 2 (parameter 61)
		*input_lmf >> iDummy;			byte_counter += sizeof(__int32);
		*input_lmf >> iDummy;			byte_counter += sizeof(__int32);

		goto L200;
	}

	if (DAQVersion >= 20110208) {
		TDC8PCI2.variable_event_length = 1;
		__int32 iDummy;
		unsigned __int64 i64temp;
		*input_lmf >> i64temp;		number_of_channels =__int32(i64temp);	byte_counter += sizeof(unsigned __int64);			// number of channels
		*input_lmf >> i64temp;		max_number_of_hits =__int32(i64temp);	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 >> i64temp;		number_of_channels2 =__int32(i64temp);	byte_counter += sizeof(unsigned __int64);			// number of channels2
		*input_lmf >> i64temp;		max_number_of_hits2 =__int32(i64temp);	byte_counter += sizeof(unsigned __int64);			// number of hits2
		
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32); // indicator 2nd module
		
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32);
		
		
		
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32); // gate delay
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32); // gate open
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32); // write empty events
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32); // trigger at falling edge
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32); // trigger at rising edge
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32);
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32);
		
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32);
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32);

		*input_lmf >> iDummy;		byte_counter += sizeof(__int32); // gate delay
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32); // gate open
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32); // write empty events
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32); // trigger at falling edge
		*input_lmf >> iDummy;		byte_counter += sizeof(__int32); // trigger at rising edge
		if ((unsigned) byte_counter < User_header_size - 20) {
			*input_lmf >> iDummy;		byte_counter += sizeof(__int32);
			*input_lmf >> iDummy;		byte_counter += sizeof(__int32);
		}

		goto L200;
	}
	

	*input_lmf >> number_of_channels; byte_counter += sizeof(__int32);	// number of channels
	*input_lmf >> max_number_of_hits; byte_counter += sizeof(__int32);	// 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 >> number_of_channels2; byte_counter += sizeof(__int32);	// number of channels2
	*input_lmf >> max_number_of_hits2; byte_counter += sizeof(__int32);	// number of hits2
	*input_lmf >> data_format_in_userheader;	byte_counter += sizeof(__int32);				// data format (2=short integer)

//	input_lmf->flush();
	StartPosition = input_lmf->tell();
	old_byte_counter = byte_counter;
	desperate_mode = false;
L50:
	byte_counter = old_byte_counter;

//	TRY

	if (TDC8PCI2.use_normal_method_2nd_card) {
		if (DAQVersion >= 20020408) {
			*input_lmf >> TDC8PCI2.GateDelay_1st_card;			byte_counter += sizeof(__int32); // gate delay 1st card
			*input_lmf >> TDC8PCI2.OpenTime_1st_card ;			byte_counter += sizeof(__int32); // open time 1st card
			*input_lmf >> TDC8PCI2.WriteEmptyEvents_1st_card;	byte_counter += sizeof(__int32); // write empty events 1st card
			*input_lmf >> TDC8PCI2.TriggerFalling_1st_card;		byte_counter += sizeof(__int32); // trigger falling edge 1st card
			*input_lmf >> TDC8PCI2.TriggerRising_1st_card;		byte_counter += sizeof(__int32); // trigger rising edge 1st card
			*input_lmf >> TDC8PCI2.EmptyCounter_1st_card;		byte_counter += sizeof(__int32); // EmptyCounter 1st card
			*input_lmf >> TDC8PCI2.EmptyCounter_since_last_Event_1st_card;	byte_counter += sizeof(__int32); // Empty Counter since last event 1st card
		}
		*input_lmf >> TDC8PCI2.sync_test_on_off;			byte_counter += sizeof(__int32); // sync test on/off
		*input_lmf >> TDC8PCI2.io_address_2nd_card;			byte_counter += sizeof(__int32); // io address 2nd card
		*input_lmf >> TDC8PCI2.GateDelay_2nd_card;			byte_counter += sizeof(__int32); // gate delay 2nd card
		*input_lmf >> TDC8PCI2.OpenTime_2nd_card;			byte_counter += sizeof(__int32); // open time 2nd card
		*input_lmf >> TDC8PCI2.WriteEmptyEvents_2nd_card;	byte_counter += sizeof(__int32); // write empty events 2nd card
		*input_lmf >> TDC8PCI2.TriggerFallingEdge_2nd_card;	byte_counter += sizeof(__int32); // trigger falling edge 2nd card
		*input_lmf >> TDC8PCI2.TriggerRisingEdge_2nd_card;	byte_counter += sizeof(__int32); // trigger rising edge 2nd card
		*input_lmf >> TDC8PCI2.EmptyCounter_2nd_card;		byte_counter += sizeof(__int32); // EmptyCounter 2nd card
		*input_lmf >> TDC8PCI2.EmptyCounter_since_last_Event_2nd_card;	byte_counter += sizeof(__int32); // Empty Counter since last event 2nd card
	} else {
		*input_lmf >> module_2nd;							byte_counter += sizeof(__int32);	// indicator for 2nd module data
		*input_lmf >> TDC8PCI2.GateDelay_1st_card;			byte_counter += sizeof(__int32); // gate delay 1st card
		*input_lmf >> TDC8PCI2.OpenTime_1st_card ;			byte_counter += sizeof(__int32); // open time 1st card
		*input_lmf >> TDC8PCI2.WriteEmptyEvents_1st_card;	byte_counter += sizeof(__int32); // write empty events 1st card
		*input_lmf >> TDC8PCI2.TriggerFalling_1st_card;		byte_counter += sizeof(__int32); // trigger falling edge 1st card
		*input_lmf >> TDC8PCI2.TriggerRising_1st_card;		byte_counter += sizeof(__int32); // trigger rising edge 1st card

		*input_lmf >> TDC8PCI2.GateDelay_2nd_card;			byte_counter += sizeof(__int32); // gate delay 2nd card
		if (!desperate_mode) { // this is only a quick fix.
			*input_lmf >> TDC8PCI2.OpenTime_2nd_card;			byte_counter += sizeof(__int32); // open time 2nd card
			*input_lmf >> TDC8PCI2.WriteEmptyEvents_2nd_card;	byte_counter += sizeof(__int32); // write empty events 2nd card
			*input_lmf >> TDC8PCI2.TriggerFallingEdge_2nd_card;	byte_counter += sizeof(__int32); // trigger falling edge 2nd card
			*input_lmf >> TDC8PCI2.TriggerRisingEdge_2nd_card;	byte_counter += sizeof(__int32); // trigger rising edge 2nd card
		}
	}

/*
	CATCH( CArchiveException, e )
		if (!TDC8PCI2.use_normal_method_2nd_card) return 0;
		TDC8PCI2.use_normal_method_2nd_card = false;
		in_ar->Close(); delete in_ar; in_ar = 0;
		input_lmf->seek(StartPosition);
		in_ar = new CArchive(input_lmf,CArchive::load);
		goto L50;
	END_CATCH
*/

L200:

	if (DAQVersion < 20080507) {
		if ((unsigned) byte_counter != User_header_size - 12) {
			if (desperate_mode) return 0;
			if (!TDC8PCI2.use_normal_method_2nd_card) {
				desperate_mode = true;
			}
			TDC8PCI2.use_normal_method_2nd_card = false;
			input_lmf->seek(StartPosition);
			goto L50;
		}
	}

	if (DAQVersion >= 20080507 && DAQVersion < 20110208) {
		if ((unsigned) byte_counter != User_header_size - 20) {
			byte_counter = -1000; // XXX (this line is okay. I have put the XXX just to bring it to attention)
		}
	}

	return byte_counter;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl $0x0, 0x159c(%rdi)
movq 0x2b18(%rdi), %rdi
leaq 0x12c8(%rbx), %rsi
movl $0x8, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x2a4(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x2a8(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x129c(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
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 0x139ac
movslq 0x129c(%rbx), %rax
movb $0x0, (%r15,%rax)
leaq 0xa0(%rbx), %r14
movq 0xa8(%rbx), %r12
movq %r15, %rdi
callq 0x2090
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x21f0
movq %r15, %rdi
callq 0x21a0
movl 0x129c(%rbx), %r13d
movq 0x2b18(%rbx), %rdi
leaq 0x12a4(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x128c(%rbx), %r14
movq %r14, %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x1c, %r13d
cmpl $0x9, 0x12a4(%rbx)
jl 0x4b2e
cmpl $0x132db80, 0x280(%rbx) # imm = 0x132DB80
jb 0x4b2e
movq %r14, 0x10(%rsp)
movl (%r14), %ebp
testl %ebp, %ebp
je 0x4b14
xorl %r14d, %r14d
leaq 0x4(%rsp), %r12
movq 0x2b18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movl $0x4, %edx
callq 0x139ac
movl 0x8(%rsp), %eax
testl %eax, %eax
je 0x4b05
xorl %r15d, %r15d
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x139ac
incl %r15d
movl 0x8(%rsp), %eax
cmpl %eax, %r15d
jb 0x4ae5
addl $0x4, %r13d
addl %eax, %r13d
incl %r14d
cmpl %ebp, %r14d
jne 0x4ac4
movq 0x2b18(%rbx), %rdi
movq 0x10(%rsp), %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x4, %r13d
leaq 0x1558(%rbx), %r14
movq 0x2b18(%rbx), %rdi
leaq 0x240(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1294(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x12b8(%rbx), %rsi
movl $0x8, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x12ac(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x2b0(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movl 0x280(%rbx), %eax
leal -0x132677b(%rax), %ecx
cmpl $0x7404, %ecx           # imm = 0x7404
ja 0x4c2f
movl $0x1, 0x159c(%rbx)
movq 0x2b18(%rbx), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
movl $0x8, %edx
callq 0x139ac
movl (%r15), %eax
movl %eax, 0x2b4(%rbx)
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x139ac
movl (%r15), %eax
movl %eax, 0x2bc(%rbx)
leal 0x28(%r13), %r12d
movl 0x2b4(%rbx), %ecx
cmpl 0x2b70(%rbx), %ecx
jle 0x4ca4
movl $0x13, 0x12e0(%rbx)
jmp 0x4cba
cmpl $0x132db80, %eax        # imm = 0x132DB80
jb 0x4cc1
movl $0x1, 0x159c(%rbx)
movq 0x2b18(%rbx), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
movl $0x8, %edx
callq 0x139ac
movl (%r15), %eax
movl %eax, 0x2b4(%rbx)
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x139ac
movl (%r15), %eax
movl %eax, 0x2bc(%rbx)
leal 0x28(%r13), %r12d
movl 0x2b4(%rbx), %ecx
cmpl 0x2b70(%rbx), %ecx
jle 0x4d12
movl $0x13, 0x12e0(%rbx)
jmp 0x4d28
cmpl %eax, 0x2b74(%rbx)
jge 0x4d3d
movl $0x14, 0x12e0(%rbx)
xorl %ecx, %ecx
jmp 0x4e2a
movq 0x2b18(%rbx), %rdi
leaq 0x2b4(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x2bc(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movl 0x2b4(%rbx), %eax
cmpl 0x2b70(%rbx), %eax
jle 0x4e44
movl $0x13, 0x12e0(%rbx)
jmp 0x4e60
cmpl %eax, 0x2b74(%rbx)
jge 0x4e6a
movl $0x14, 0x12e0(%rbx)
xorl %ebp, %ebp
movl $0xfffe7960, %eax       # imm = 0xFFFE7960
testb %bpl, %bpl
je 0x53ea
jmp 0x4e37
movq 0x2b18(%rbx), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
movl $0x8, %edx
callq 0x139ac
movl (%r15), %eax
movl %eax, 0x2b8(%rbx)
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x139ac
movl (%r15), %eax
movl %eax, 0x2c0(%rbx)
movq 0x2b18(%rbx), %rdi
leaq 0x4(%rsp), %r15
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x58, %r13d
movb $0x1, %cl
movl %r13d, %r12d
movl $0xfffe7960, %eax       # imm = 0xFFFE7960
testb %cl, %cl
je 0x53ea
xorl %r15d, %r15d
xorl %r13d, %r13d
xorl %ebp, %ebp
jmp 0x5354
movl 0x2bc(%rbx), %eax
cmpl 0x2b74(%rbx), %eax
jle 0x5040
movl $0x14, 0x12e0(%rbx)
movl $0xfffe7960, %eax       # imm = 0xFFFE7960
jmp 0x53ea
movq 0x2b18(%rbx), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
movl $0x8, %edx
callq 0x139ac
movl (%r15), %eax
movl %eax, 0x2b8(%rbx)
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x139ac
movl (%r15), %eax
movl %eax, 0x2c0(%rbx)
movq 0x2b18(%rbx), %rdi
leaq 0x4(%rsp), %r15
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
leal 0x78(%r13), %r12d
movl 0x29c(%rbx), %eax
addl $-0x14, %eax
movb $0x1, %bpl
cmpl %eax, %r12d
jae 0x4d2a
movq 0x2b18(%rbx), %rdi
leaq 0x4(%rsp), %r15
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
subl $-0x80, %r13d
movl %r13d, %r12d
jmp 0x4d2a
movq 0x2b18(%rbx), %rdi
leaq 0x2b8(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x2c0(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x290(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x2c, %r13d
movq 0x2b18(%rbx), %rax
movq 0x20(%rax), %r15
xorl %ebp, %ebp
cmpb $0x1, 0x1575(%rbx)
jne 0x5242
cmpl $0x1317cb8, 0x280(%rbx) # imm = 0x1317CB8
movl %r13d, %r12d
jb 0x5161
movq 0x2b18(%rbx), %rdi
movq %r14, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x155c(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1560(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1564(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1568(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x156c(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1570(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
leal 0x1c(%r13), %r12d
movq 0x2b18(%rbx), %rdi
leaq 0x1578(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x157c(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1580(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1584(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1588(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x158c(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1590(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1594(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1598(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x24, %r12d
jmp 0x5354
movq 0x2b18(%rbx), %rdi
leaq 0x1288(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r14, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x155c(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1560(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1564(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1568(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1580(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
leal 0x1c(%r13), %r12d
testb $0x1, %bpl
jne 0x5354
movq 0x2b18(%rbx), %rdi
leaq 0x1584(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1588(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x158c(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1590(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
leal 0x2c(%r13), %r12d
movl 0x280(%rbx), %eax
cmpl $0x132677a, %eax        # imm = 0x132677A
ja 0x53c0
movl 0x29c(%rbx), %ecx
addl $-0xc, %ecx
cmpl %ecx, %r12d
je 0x53c0
testb $0x1, %bpl
jne 0x53e8
cmpb $0x0, 0x1575(%rbx)
movzbl %bpl, %eax
movl $0x1, %ebp
cmovnel %eax, %ebp
movb $0x0, 0x1575(%rbx)
movq 0x2b18(%rbx), %r12
movq (%r12), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x20c0
testl %eax, %eax
je 0x53b6
movl $0x1, 0x8(%r12)
jmp 0x5099
movq %r15, 0x20(%r12)
jmp 0x5099
addl $0xfecd9885, %eax       # imm = 0xFECD9885
cmpl $0x7404, %eax           # imm = 0x7404
ja 0x53e3
movl 0x29c(%rbx), %eax
addl $-0x14, %eax
cmpl %eax, %r12d
movl $0xfffffc18, %eax       # imm = 0xFFFFFC18
cmovel %r12d, %eax
jmp 0x53ea
movl %r12d, %eax
jmp 0x53ea
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop