// File: /workspace/github_cpp_makefile_star2_O1/NichtJens[P]lmf2txt/LMF_IO.cpp
// Function: LMF_IO::ReadfADC4Header_up_to_v11()
__int32	LMF_IO::ReadfADC4Header_up_to_v11()
{
	__int32 i32Dummy = 0;
	unsigned __int64 ui64Dummy = 0;
	double dDummy = 0.;
	bool bDummy = false;
	char cDummy = 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 >> LMF_Version; byte_counter += sizeof(__int32);
	
	*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;		byte_counter += sizeof(unsigned __int64);		// number of channels
	number_of_channels =__int32(temp_uint64);

	*input_lmf >> temp_uint64;		byte_counter += sizeof(unsigned __int64);		// number of hits
	max_number_of_hits =__int32(temp_uint64);

	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)

	*input_lmf >> fADC4.i32NumberOfADCmodules;	byte_counter += sizeof(__int32);


	__int32 check_value;
	*input_lmf >> check_value; byte_counter += sizeof(__int32);

	if (check_value == 12345678) {
		for (__int32 i=0;i<fADC4.i32NumberOfADCmodules;i++) {
			*input_lmf >> fADC4.ndigo_parameters[i].bandwidth;		byte_counter += sizeof(double);
			*input_lmf >> fADC4.ndigo_parameters[i].board_id;		byte_counter += sizeof(__int32);
			*input_lmf >> fADC4.ndigo_parameters[i].channel_mask;	byte_counter += sizeof(__int32);
			*input_lmf >> fADC4.ndigo_parameters[i].channels;		byte_counter += sizeof(__int32);
			*input_lmf >> fADC4.ndigo_parameters[i].sample_period;	byte_counter += sizeof(double);
			*input_lmf >> fADC4.ndigo_parameters[i].sample_rate;	byte_counter += sizeof(double);
			*input_lmf >> fADC4.ndigo_parameters[i].version;		byte_counter += sizeof(__int32);
		}
	} else {
			unsigned __int64 pos = input_lmf->tell(); input_lmf->seek(pos-4); byte_counter -= sizeof(__int32);
	for (__int32 i=0;i<fADC4.i32NumberOfADCmodules;i++) {
		input_lmf->read((char*)&fADC4.ndigo_parameters[i],sizeof(ndigo_param_info)); byte_counter += sizeof(ndigo_param_info);
				__int32 size_diff = sizeof(ndigo_param_info) - fADC4.ndigo_parameters[i].size;
				if (size_diff) {
					pos = input_lmf->tell(); input_lmf->seek(pos-size_diff); byte_counter -= size_diff;
				}
	}

	}

	



	for (unsigned __int32 i = 0; i < number_of_channels; i++) {
		*input_lmf >> fADC4.threshold_GT[i];	byte_counter += sizeof(double);
		*input_lmf >> fADC4.threshold_LT[i];	byte_counter += sizeof(double);
	}

	for (unsigned __int32 i = 0; i < number_of_channels; i++) {
		*input_lmf >> fADC4.set_DC_offset[i];	byte_counter += sizeof(double);
	}

	if (LMF_Version > 10) {
		for (unsigned __int32 i = 0; i < number_of_channels; i++) {
			*input_lmf >> fADC4.GND_level[i];	byte_counter += sizeof(double);
		}
	} else memset(fADC4.GND_level,0,80*sizeof(double));

	__int32 num_temp = fADC4.i32NumberOfADCmodules < 4 ? 4 : fADC4.i32NumberOfADCmodules;
	for (__int32 i=0;i<num_temp;i++) { // write ADC mode 4x1.25Gs or 2x2.5Gs or 1x5Gs)
		*input_lmf >> fADC4.sampling_mode[i];	byte_counter += sizeof(__int32);
	}

	*input_lmf >> i32Dummy;	byte_counter += sizeof(__int32); // precursor in steps of 3.2 ns
	*input_lmf >> i32Dummy;	byte_counter += sizeof(__int32); // length after end of signal in steps of 3.2 ns
	for (unsigned __int32 i=2;i<number_of_channels;i++) {
		*input_lmf >> i32Dummy;	byte_counter += sizeof(__int32); // read precursor and length for all other channels. Currently only for future use
		*input_lmf >> i32Dummy;	byte_counter += sizeof(__int32);
	}

	*input_lmf >> ui64Dummy;	byte_counter += sizeof(__int64);				// ui64RisingEnable
	*input_lmf >> ui64Dummy;	byte_counter += sizeof(__int64);				// ui64FallingEnable
	*input_lmf >> i32Dummy;		byte_counter += sizeof(__int32);				// i32TriggerEdge
	*input_lmf >> fADC4.iTriggerChannel;	byte_counter += sizeof(__int32);	// i32TriggerChannel
	fADC4.iTriggerChannel--;

	*input_lmf >> bDummy;	byte_counter += sizeof(bool);					// bOutputLevel
	*input_lmf >> fADC4.dGroupRangeStart;	byte_counter += sizeof(double);	// dGroupRangeStart
	*input_lmf >> fADC4.dGroupRangeEnd;		byte_counter += sizeof(double);	// dGroupRangeEnd

	*input_lmf >> i32Dummy;	byte_counter += sizeof(__int32);				// read Config file
	fADC4.csConfigFile = "";
	for(__int32 i32Count=0;i32Count<i32Dummy;i32Count++)
	{
		input_lmf->read(&cDummy,1);	byte_counter += sizeof(char);
		fADC4.csConfigFile += cDummy;
	}
	*input_lmf >> i32Dummy;	byte_counter += sizeof(__int32);				// read INL file
	fADC4.csINLFile = "";
	for(__int32 i32Count=0;i32Count<i32Dummy;i32Count++)
	{
		input_lmf->read(&cDummy,1);	byte_counter += sizeof(char);
		fADC4.csINLFile += cDummy;
	}
	*input_lmf >> i32Dummy;	byte_counter += sizeof(__int32);				// read DNL file
	fADC4.csDNLFile = "";
	for(__int32 i32Count=0;i32Count<i32Dummy;i32Count++)
	{
		input_lmf->read(&cDummy,1);	byte_counter += sizeof(char);
		fADC4.csDNLFile += cDummy;
	}

	*input_lmf >> i32Dummy;	byte_counter += sizeof(__int32);	// dummy
	*input_lmf >> dDummy;	byte_counter += sizeof(double);		// dGroupTimeout

	// 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);
	}

	// now handle additional bools
	*input_lmf >> fADC4.number_of_bools; byte_counter += sizeof(__int32);
	for (__int32 i=0;i<fADC4.number_of_bools;++i) {
		*input_lmf >> bDummy;	byte_counter += sizeof(bool);
	}


	// now handle additional 32Bit values (signed or unsigned)
	*input_lmf >> fADC4.number_of_int32s;		byte_counter += sizeof(__int32);
	if (fADC4.number_of_int32s == 3 && this->LMF_Version == 11) this->LMF_Version = 12; // dirty work around for old LMFs
	
	__int32 counter = fADC4.number_of_int32s;
	if (counter > 0) {*input_lmf >> fADC4.i32NumberOfDAQLoops;		counter--;	byte_counter += sizeof(__int32);}
	if (counter > 0) {*input_lmf >> TDC8HP.TDC8HP_DriverVersion;	counter--;	byte_counter += sizeof(__int32);}
	while (counter > 0) {
		*input_lmf >> i32Dummy;
		byte_counter += sizeof(__int32);
		counter--;
	}

	*input_lmf >> fADC4.number_of_doubles;		byte_counter += sizeof(__int32);
	counter = fADC4.number_of_doubles;
	if (LMF_Version > 10) {
		for (__int32 i=0;i<fADC4.i32NumberOfADCmodules;i++) {
			*input_lmf >> fADC4.bits_per_mVolt[i];	byte_counter += sizeof(double);
			counter--;
		}
	} else {
		*input_lmf >> dDummy; byte_counter += sizeof(double);	counter--;
		for (__int32 i=0;i<fADC4.i32NumberOfADCmodules;i++) fADC4.bits_per_mVolt[i] = dDummy;
	}
	while (counter >0)	{*input_lmf >> dDummy;	byte_counter += sizeof(double);	counter--;}

	*input_lmf >> i32Dummy;			byte_counter += sizeof(__int32);
	if (i32Dummy != 1234567) return 0;
	
	return byte_counter;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movl $0x0, 0x8(%rsp)
xorl %r12d, %r12d
movq %r12, 0x40(%rsp)
movq %r12, 0x20(%rsp)
movb %r12b, 0xf(%rsp)
movb %r12b, 0x7(%rsp)
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 %r12b, (%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), %ebp
movq 0x2b18(%rbx), %rdi
leaq 0x12a4(%rbx), %rsi
movq %rsi, 0x30(%rsp)
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1328(%rbx), %r15
movq %r15, %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x1c, %ebp
movslq 0x1328(%rbx), %rax
leaq (,%rax,8), %r12
testq %rax, %rax
movq $-0x1, %rdi
cmovnsq %r12, %rdi
callq 0x2030
movq %rax, 0x1330(%rbx)
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20b0
cmpl $0x0, 0x1328(%rbx)
jle 0x7325
xorl %r14d, %r14d
leaq 0x10(%rsp), %r12
leaq 0x1c(%rsp), %r13
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x4, %ebp
movl $0x20, %edi
callq 0x2130
leaq 0x10(%rax), %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1330(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
movq 0x1330(%rbx), %rax
movq (%rax,%r14,8), %rdi
movslq 0x10(%rsp), %rsi
callq 0x2210
cmpl $0x0, 0x10(%rsp)
jle 0x7316
movq 0x2b18(%rbx), %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x139ac
incl %ebp
movsbl 0x1c(%rsp), %esi
movq 0x1330(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x20f0
movl 0x10(%rsp), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsp)
cmpl $0x1, %eax
jg 0x72db
incq %r14
movslq (%r15), %rax
cmpq %rax, %r14
jl 0x7280
movq 0x2b18(%rbx), %rdi
leaq 0x240(%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 0x10(%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)
movl 0x2b4(%rbx), %ecx
cmpl 0x2b70(%rbx), %ecx
jle 0x73c6
movl $0x13, 0x12e0(%rbx)
jmp 0x73d8
cmpl %eax, 0x2b74(%rbx)
jge 0x73e2
movl $0x14, 0x12e0(%rbx)
movl $0xfffe7960, %eax       # imm = 0xFFFE7960
jmp 0x7da9
movq 0x2b18(%rbx), %rdi
leaq 0x290(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1a84(%rbx), %r13
movq %r13, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1c(%rsp), %r12
movq %r12, %rsi
movl $0x4, %edx
callq 0x139ac
cmpl $0xbc614e, (%r12)       # imm = 0xBC614E
movq %r13, 0x28(%rsp)
jne 0x7510
addl $0x2c, %ebp
cmpl $0x0, (%r13)
jle 0x75d5
leaq 0x1ac4(%rbx), %r12
xorl %r14d, %r14d
movq 0x2b18(%rbx), %rdi
leaq 0x4(%r12), %rsi
movl $0x8, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1c(%r12), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x24(%r12), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x20(%r12), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x14(%r12), %rsi
movl $0x8, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0xc(%r12), %rsi
movl $0x8, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x28, %ebp
incq %r14
movslq 0x1a84(%rbx), %rax
addq $0x40, %r12
cmpq %rax, %r14
jl 0x7459
jmp 0x75d5
movq 0x2b18(%rbx), %r14
movq (%r14), %rdi
movq 0x20(%r14), %r12
addq $-0x4, %r12
movq %r12, %rsi
xorl %edx, %edx
callq 0x20c0
testl %eax, %eax
je 0x753a
movl $0x1, 0x8(%r14)
jmp 0x753e
movq %r12, 0x20(%r14)
addl $0x28, %ebp
cmpl $0x0, (%r13)
jle 0x75d5
leaq 0x1ac0(%rbx), %r12
xorl %r14d, %r14d
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x40, %edx
callq 0x139ac
addl $0x40, %ebp
movl (%r12), %eax
cmpl $0x40, %eax
je 0x75c5
movl $0x40, %r15d
subl %eax, %r15d
movq 0x2b18(%rbx), %rax
movq (%rax), %rdi
movq %rax, 0x38(%rsp)
movq 0x20(%rax), %r13
movslq %r15d, %rax
subq %rax, %r13
movq %r13, %rsi
xorl %edx, %edx
callq 0x20c0
testl %eax, %eax
je 0x75b4
movq 0x38(%rsp), %rax
movl $0x1, 0x8(%rax)
jmp 0x75bd
movq 0x38(%rsp), %rax
movq %r13, 0x20(%rax)
movq 0x28(%rsp), %r13
subl %r15d, %ebp
incq %r14
movslq (%r13), %rax
addq $0x40, %r12
cmpq %rax, %r14
jl 0x7556
cmpl $0x0, 0x2b4(%rbx)
je 0x762a
leaq 0x1fc0(%rbx), %r12
xorl %r14d, %r14d
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x280(%r12), %rsi
movl $0x8, %edx
callq 0x139ac
addl $0x10, %ebp
incq %r14
movl 0x2b4(%rbx), %eax
addq $0x8, %r12
cmpq %rax, %r14
jb 0x75e8
cmpl $0x0, 0x2b4(%rbx)
je 0x7666
leaq 0x2740(%rbx), %r12
xorl %r14d, %r14d
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x139ac
addl $0x8, %ebp
incq %r14
movl 0x2b4(%rbx), %eax
addq $0x8, %r12
cmpq %rax, %r14
jb 0x763d
movq 0x30(%rsp), %rax
cmpl $0xb, (%rax)
jl 0x76ae
cmpl $0x0, 0x2b4(%rbx)
je 0x76c1
leaq 0x24c0(%rbx), %r12
xorl %r14d, %r14d
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x139ac
addl $0x8, %ebp
incq %r14
movl 0x2b4(%rbx), %eax
addq $0x8, %r12
cmpq %rax, %r14
jb 0x7683
jmp 0x76c1
leaq 0x24c0(%rbx), %rdi
movl $0x280, %edx            # imm = 0x280
xorl %esi, %esi
callq 0x20b0
movl 0x1a84(%rbx), %r14d
cmpl $0x5, %r14d
movl $0x4, %eax
cmovll %eax, %r14d
leaq 0x29c0(%rbx), %r12
leal (,%r14,4), %r15d
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x4, %edx
callq 0x139ac
addq $0x4, %r12
decq %r14
jne 0x76e4
addl %r15d, %ebp
movq 0x2b18(%rbx), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x4, %edx
callq 0x139ac
cmpl $0x3, 0x2b4(%rbx)
jb 0x777c
movl $0x2, %r14d
leaq 0x8(%rsp), %r12
addl $0x8, %ebp
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x4, %edx
callq 0x139ac
incl %r14d
cmpl 0x2b4(%rbx), %r14d
jb 0x7745
movq 0x2b18(%rbx), %rdi
leaq 0x40(%rsp), %r12
movq %r12, %rsi
movl $0x8, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1a90(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
decl 0x1a90(%rbx)
movq 0x2b18(%rbx), %rdi
leaq 0xf(%rsp), %rsi
movl $0x1, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1aa8(%rbx), %rsi
movl $0x8, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x1ab0(%rbx), %rsi
movl $0x8, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x35, %ebp
leaq 0x2ab0(%rbx), %r13
movq 0x2ab8(%rbx), %rdx
leaq 0xdd6f(%rip), %rcx      # 0x155c1
xorl %r14d, %r14d
movq %r13, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x21f0
cmpl $0x0, (%r12)
jle 0x789c
leaq 0x7(%rsp), %r12
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x139ac
movsbl 0x7(%rsp), %esi
movq %r13, %rdi
callq 0x20f0
incl %r14d
cmpl 0x8(%rsp), %r14d
jl 0x786e
addl %r14d, %ebp
movq 0x2b18(%rbx), %rdi
leaq 0x8(%rsp), %r13
movq %r13, %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x4, %ebp
leaq 0x2ad0(%rbx), %r12
movq 0x2ad8(%rbx), %rdx
leaq 0xdcf4(%rip), %rcx      # 0x155c1
xorl %r14d, %r14d
movq %r12, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x21f0
cmpl $0x0, (%r13)
jle 0x7917
leaq 0x7(%rsp), %r13
movq 0x2b18(%rbx), %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x139ac
movsbl 0x7(%rsp), %esi
movq %r12, %rdi
callq 0x20f0
incl %r14d
cmpl 0x8(%rsp), %r14d
jl 0x78e9
addl %r14d, %ebp
movq 0x2b18(%rbx), %rdi
leaq 0x8(%rsp), %r13
movq %r13, %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x4, %ebp
leaq 0x2af0(%rbx), %r12
movq 0x2af8(%rbx), %rdx
leaq 0xdc79(%rip), %rcx      # 0x155c1
xorl %r14d, %r14d
movq %r12, %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x21f0
cmpl $0x0, (%r13)
jle 0x7992
leaq 0x7(%rsp), %r13
movq 0x2b18(%rbx), %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x139ac
movsbl 0x7(%rsp), %esi
movq %r12, %rdi
callq 0x20f0
incl %r14d
cmpl 0x8(%rsp), %r14d
jl 0x7964
addl %r14d, %ebp
movq 0x2b18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x20(%rsp), %rsi
movl $0x8, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x14f8(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x10, %ebp
cmpl $0x0, 0x14f8(%rbx)
movq 0x28(%rsp), %r13
jle 0x7b99
xorl %r12d, %r12d
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rsi
addq $0x4, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rsi
addq $0x8, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rsi
addq $0xc, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rsi
addq $0x10, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rsi
addq $0x14, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rsi
addq $0x18, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rsi
addq $0x20, %rsi
movl $0x8, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rsi
addq $0x28, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rsi
addq $0x2c, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rsi
addq $0x30, %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rax
movq 0x38(%rax), %rsi
movl $0x8000, %edx           # imm = 0x8000
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rax
movq 0x40(%rax), %rsi
movl $0x4000, %edx           # imm = 0x4000
callq 0x139ac
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r12,8), %rsi
addq $0x48, %rsi
movl $0x1, %edx
callq 0x139ac
addl $0xc031, %ebp           # imm = 0xC031
incq %r12
movslq 0x14f8(%rbx), %rax
cmpq %rax, %r12
jl 0x79ee
movq 0x2b18(%rbx), %rdi
leaq 0x1a94(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x4, %ebp
cmpl $0x0, 0x1a94(%rbx)
jle 0x7be8
xorl %r14d, %r14d
leaq 0xf(%rsp), %r12
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x139ac
incl %r14d
cmpl 0x1a94(%rbx), %r14d
jl 0x7bc5
addl %r14d, %ebp
movq 0x2b18(%rbx), %rdi
leaq 0x1a98(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movl 0x1a98(%rbx), %r12d
cmpl $0x3, %r12d
jne 0x7c21
cmpl $0xb, 0x12a4(%rbx)
jne 0x7c21
movq 0x30(%rsp), %rax
movl $0xc, (%rax)
testl %r12d, %r12d
jle 0x7c46
movq 0x2b18(%rbx), %rdi
leaq 0x1a88(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
decl %r12d
addl $0x8, %ebp
jmp 0x7c49
addl $0x4, %ebp
testl %r12d, %r12d
jle 0x7c6c
movq 0x2b18(%rbx), %rdi
leaq 0x151c(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
decl %r12d
addl $0x4, %ebp
testl %r12d, %r12d
jle 0x7ca1
leal (,%r12,4), %r15d
incl %r12d
leaq 0x8(%rsp), %r14
movq 0x2b18(%rbx), %rdi
movq %r14, %rsi
movl $0x4, %edx
callq 0x139ac
decl %r12d
cmpl $0x1, %r12d
jg 0x7c81
addl %r15d, %ebp
movq 0x2b18(%rbx), %rdi
leaq 0x1aa0(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movl 0x1aa0(%rbx), %r12d
cmpl $0xb, 0x12a4(%rbx)
jl 0x7d0c
addl $0x4, %ebp
cmpl $0x0, (%r13)
jle 0x7d4d
leaq 0x2a10(%rbx), %r14
xorl %r15d, %r15d
movq 0x2b18(%rbx), %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x139ac
addl $0x8, %ebp
incq %r15
movslq 0x1a84(%rbx), %rax
addq $0x8, %r14
cmpq %rax, %r15
jl 0x7cdd
subl %r15d, %r12d
jmp 0x7d4d
movq 0x2b18(%rbx), %rdi
leaq 0x20(%rsp), %rsi
movl $0x8, %edx
callq 0x139ac
addl $0xc, %ebp
decl %r12d
movslq 0x1a84(%rbx), %rax
testq %rax, %rax
jle 0x7d4d
movsd 0x20(%rsp), %xmm0
xorl %ecx, %ecx
movsd %xmm0, 0x2a10(%rbx,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x7d3c
testl %r12d, %r12d
jle 0x7d82
leal (,%r12,8), %r15d
incl %r12d
leaq 0x20(%rsp), %r14
movq 0x2b18(%rbx), %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x139ac
decl %r12d
cmpl $0x1, %r12d
jg 0x7d62
addl %r15d, %ebp
movq 0x2b18(%rbx), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
movl $0x4, %edx
callq 0x139ac
addl $0x4, %ebp
xorl %eax, %eax
cmpl $0x12d687, (%rbx)       # imm = 0x12D687
cmovel %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq