// File: /workspace/github_cpp_makefile_star2_O2/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 $0x38, %rsp
andl $0x0, 0x4(%rsp)
movq %rdi, %rbx
andq $0x0, 0x30(%rsp)
andq $0x0, 0x18(%rsp)
xorl %r12d, %r12d
movb %r12b, 0x3(%rsp)
movb %r12b, 0x2(%rsp)
movq 0x2b18(%rdi), %rdi
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 %r12b, (%r15,%rax)
leaq 0xa0(%rbx), %rdi
movq %r15, %rsi
callq 0x2230
movq %r15, %rdi
callq 0x21a0
movl 0x129c(%rbx), %r14d
movq 0x2b18(%rbx), %rdi
leaq 0x12a4(%rbx), %rsi
movq %rsi, 0x28(%rsp)
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x1328(%rbx), %r15
movq %r15, %rsi
callq 0x10fca
addl $0x1c, %r14d
movslq 0x1328(%rbx), %r13
leaq (,%r13,8), %rbp
testq %r13, %r13
pushq $-0x1
popq %rdi
cmovnsq %rbp, %rdi
callq 0x2030
movq %rax, 0x1330(%rbx)
movq %rax, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x20b0
leaq 0x14(%rsp), %rbp
movslq %r13d, %rax
cmpq %rax, %r12
jge 0x631b
movq 0x2b18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10fca
addl $0x4, %r14d
pushq $0x20
popq %rdi
callq 0x2130
leaq 0x10(%rax), %rcx
movq %rcx, (%rax)
andq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1330(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
movq 0x1330(%rbx), %rax
movq (%rax,%r12,8), %rdi
movslq 0x8(%rsp), %rsi
callq 0x2200
movl 0x8(%rsp), %eax
testl %eax, %eax
jle 0x6310
movq 0x2b18(%rbx), %rdi
movq %rbp, %rsi
callq 0x11060
incl %r14d
movsbl 0x14(%rsp), %esi
movq 0x1330(%rbx), %rax
movq (%rax,%r12,8), %rdi
callq 0x20f0
movl 0x8(%rsp), %eax
decl %eax
movl %eax, 0x8(%rsp)
jmp 0x62d9
incq %r12
movl (%r15), %r13d
jmp 0x627c
movq 0x2b18(%rbx), %rdi
leaq 0x240(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x12b8(%rbx), %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
leaq 0x12ac(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x10d78
movl (%r15), %eax
movl %eax, 0x2b4(%rbx)
movq 0x2b18(%rbx), %rdi
movq %r15, %rsi
callq 0x10d78
movl (%r15), %eax
movl %eax, 0x2bc(%rbx)
movl 0x2b4(%rbx), %ecx
cmpl 0x2b70(%rbx), %ecx
jle 0x63a3
movl $0x13, 0x12e0(%rbx)
jmp 0x63b5
cmpl %eax, 0x2b74(%rbx)
jge 0x63bf
movl $0x14, 0x12e0(%rbx)
movl $0xfffe7960, %eax       # imm = 0xFFFE7960
jmp 0x6b4c
movq 0x2b18(%rbx), %rdi
leaq 0x290(%rbx), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x1a84(%rbx), %r13
movq %r13, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x14(%rsp), %r12
movq %r12, %rsi
callq 0x10fca
cmpl $0xbc614e, (%r12)       # imm = 0xBC614E
movq %r13, 0x20(%rsp)
jne 0x64af
addl $0x2c, %r14d
leaq 0x1ac4(%rbx), %r12
xorl %r15d, %r15d
movslq (%r13), %rax
cmpq %rax, %r15
jge 0x6526
movq 0x2b18(%rbx), %rdi
leaq 0x4(%r12), %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
leaq 0x1c(%r12), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x24(%r12), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x20(%r12), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x14(%r12), %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
leaq 0xc(%r12), %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
callq 0x10fca
addl $0x28, %r14d
incq %r15
addq $0x40, %r12
jmp 0x641d
movq 0x2b18(%rbx), %rdi
movq 0x20(%rdi), %rsi
addq $-0x4, %rsi
callq 0x235c
addl $0x28, %r14d
leaq 0x1ac0(%rbx), %r12
xorl %r15d, %r15d
pushq $0x40
popq %rbp
movslq (%r13), %rax
cmpq %rax, %r15
jge 0x6526
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x10d8a
addl $0x40, %r14d
movl (%r12), %eax
cmpl $0x40, %eax
je 0x651d
movl %ebp, %ecx
subl %eax, %ecx
movq 0x2b18(%rbx), %rdi
movq 0x20(%rdi), %rsi
movslq %ecx, %r13
subq %r13, %rsi
callq 0x235c
subl %r13d, %r14d
movq 0x20(%rsp), %r13
incq %r15
addq $0x40, %r12
jmp 0x64d4
leaq 0x1fc0(%rbx), %r12
xorl %r15d, %r15d
movl 0x2b4(%rbx), %eax
cmpq %rax, %r15
jae 0x656b
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
leaq 0x280(%r12), %rsi
callq 0x110e4
addl $0x10, %r14d
incq %r15
addq $0x8, %r12
jmp 0x6530
leaq 0x2740(%rbx), %r12
xorl %r15d, %r15d
movl %eax, %ecx
cmpq %rcx, %r15
jae 0x659e
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
callq 0x110e4
addl $0x8, %r14d
incq %r15
movl 0x2b4(%rbx), %eax
addq $0x8, %r12
jmp 0x6575
leaq 0x24c0(%rbx), %r12
cmpl $0xb, 0x12a4(%rbx)
jl 0x65da
xorl %r15d, %r15d
movl %eax, %eax
cmpq %rax, %r15
jae 0x65e9
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
callq 0x110e4
addl $0x8, %r14d
incq %r15
movl 0x2b4(%rbx), %eax
addq $0x8, %r12
jmp 0x65b1
movl $0x280, %edx            # imm = 0x280
movq %r12, %rdi
xorl %esi, %esi
callq 0x20b0
movl 0x1a84(%rbx), %eax
cmpl $0x5, %eax
pushq $0x4
popq %r13
cmovgel %eax, %r13d
leaq 0x29c0(%rbx), %r12
leal (,%r13,4), %r15d
subq $0x1, %r13
jb 0x6624
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
callq 0x10fca
addq $0x4, %r12
jmp 0x6609
movq 0x2b18(%rbx), %rdi
leaq 0x4(%rsp), %r12
movq %r12, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
callq 0x10fca
addl %r14d, %r15d
addl $0x5d, %r15d
pushq $0x2
popq %rbp
cmpl 0x2b4(%rbx), %ebp
jae 0x667f
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
callq 0x10fca
incl %ebp
addl $0x8, %r15d
jmp 0x6651
movq 0x2b18(%rbx), %rdi
leaq 0x30(%rsp), %r12
movq %r12, %rsi
callq 0x10d78
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
callq 0x10d78
movq 0x2b18(%rbx), %rdi
leaq 0x4(%rsp), %r12
movq %r12, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x1a90(%rbx), %rsi
callq 0x10fca
decl 0x1a90(%rbx)
movq 0x2b18(%rbx), %rdi
leaq 0x3(%rsp), %rsi
callq 0x1114e
movq 0x2b18(%rbx), %rdi
leaq 0x1aa8(%rbx), %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
leaq 0x1ab0(%rbx), %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
movq %r12, %rsi
callq 0x10fca
leaq 0x2ab0(%rbx), %r12
leaq 0xbec3(%rip), %rsi      # 0x125e6
movq %r12, %rdi
callq 0x2230
xorl %r14d, %r14d
leaq 0x2(%rsp), %r13
pushq $0x1
popq %rbp
movq 0x2b18(%rbx), %rdi
cmpl 0x4(%rsp), %r14d
jge 0x6763
movq %r13, %rsi
movl %ebp, %edx
callq 0x10d8a
movsbl 0x2(%rsp), %esi
movq %r12, %rdi
callq 0x20f0
incl %r14d
incl %r15d
jmp 0x6736
leaq 0x4(%rsp), %rsi
callq 0x10fca
leaq 0x2ad0(%rbx), %r12
leaq 0xbe6b(%rip), %rsi      # 0x125e6
movq %r12, %rdi
callq 0x2230
xorl %r14d, %r14d
leaq 0x2(%rsp), %r13
pushq $0x1
popq %rbp
movq 0x2b18(%rbx), %rdi
cmpl 0x4(%rsp), %r14d
jge 0x67b8
movq %r13, %rsi
movl %ebp, %edx
callq 0x10d8a
movsbl 0x2(%rsp), %esi
movq %r12, %rdi
callq 0x20f0
incl %r14d
jmp 0x678e
leaq 0x4(%rsp), %rsi
callq 0x10fca
leaq 0x2af0(%rbx), %r12
leaq 0xbe16(%rip), %rsi      # 0x125e6
movq %r12, %rdi
callq 0x2230
xorl %r13d, %r13d
pushq $0x1
popq %rbp
movq 0x2b18(%rbx), %rdi
cmpl 0x4(%rsp), %r13d
jge 0x680a
leaq 0x2(%rsp), %rsi
movl %ebp, %edx
callq 0x10d8a
movsbl 0x2(%rsp), %esi
movq %r12, %rdi
callq 0x20f0
incl %r13d
jmp 0x67de
leaq 0x4(%rsp), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
leaq 0x18(%rsp), %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
leaq 0x14f8(%rbx), %rsi
callq 0x10fca
addl %r14d, %r15d
addl %r13d, %r15d
xorl %r14d, %r14d
movslq 0x14f8(%rbx), %rax
movq 0x2b18(%rbx), %rdi
cmpq %rax, %r14
jge 0x69b6
movq 0x1500(%rbx,%r14,8), %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r14,8), %rsi
addq $0x4, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r14,8), %rsi
addq $0x8, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r14,8), %rsi
addq $0xc, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r14,8), %rsi
addq $0x10, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r14,8), %rsi
addq $0x14, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r14,8), %rsi
addq $0x18, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r14,8), %rsi
addq $0x20, %rsi
callq 0x110e4
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r14,8), %rsi
addq $0x28, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r14,8), %rsi
addq $0x2c, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r14,8), %rsi
addq $0x30, %rsi
callq 0x10fca
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r14,8), %rax
movq 0x38(%rax), %rsi
movl $0x8000, %edx           # imm = 0x8000
callq 0x10d8a
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r14,8), %rax
movq 0x40(%rax), %rsi
movl $0x4000, %edx           # imm = 0x4000
callq 0x10d8a
movq 0x2b18(%rbx), %rdi
movq 0x1500(%rbx,%r14,8), %rsi
addq $0x48, %rsi
callq 0x1114e
incq %r14
addl $0xc031, %r15d          # imm = 0xC031
jmp 0x6841
leaq 0x1a94(%rbx), %rsi
callq 0x10fca
xorl %ebp, %ebp
leaq 0x3(%rsp), %r12
movq 0x2b18(%rbx), %rdi
cmpl 0x1a94(%rbx), %ebp
jge 0x69e7
movq %r12, %rsi
callq 0x1114e
incl %ebp
incl %r15d
jmp 0x69c9
leaq 0x1a98(%rbx), %rsi
callq 0x10fca
movl 0x1a98(%rbx), %ebp
cmpl $0x3, %ebp
jne 0x6a14
cmpl $0xb, 0x12a4(%rbx)
jne 0x6a14
movq 0x28(%rsp), %rax
movl $0xc, (%rax)
jmp 0x6a18
testl %ebp, %ebp
jle 0x6a50
movq 0x2b18(%rbx), %rdi
leaq 0x1a88(%rbx), %rsi
callq 0x10fca
cmpl $0x1, %ebp
jne 0x6a38
addl $-0x4, %r15d
xorl %ebp, %ebp
jmp 0x6a54
movq 0x2b18(%rbx), %rdi
leaq 0x151c(%rbx), %rsi
callq 0x10d66
addl $-0x2, %ebp
jmp 0x6a54
addl $-0x8, %r15d
leaq 0x4(%rsp), %r14
movq 0x2b18(%rbx), %rdi
testl %ebp, %ebp
jle 0x6a74
movq %r14, %rsi
callq 0x10fca
addl $0x4, %r15d
decl %ebp
jmp 0x6a59
leaq 0x1aa0(%rbx), %rsi
callq 0x10fca
movl 0x1aa0(%rbx), %r12d
cmpl $0xb, 0x12a4(%rbx)
jl 0x6ac5
leaq 0x2a10(%rbx), %r14
pushq $-0x4
popq %rbp
xorl %r13d, %r13d
movq 0x20(%rsp), %rax
movslq (%rax), %rax
cmpq %rax, %r13
jge 0x6b02
movq 0x2b18(%rbx), %rdi
movq %r14, %rsi
callq 0x110e4
incq %r13
addq $0x8, %r14
addl $-0x8, %ebp
jmp 0x6a9d
movq 0x2b18(%rbx), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x110e4
addl $0xc, %r15d
movl 0x1a84(%rbx), %eax
movsd (%r14), %xmm0
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
cmpq %rcx, %rax
je 0x6b0a
movsd %xmm0, 0x2a10(%rbx,%rcx,8)
incq %rcx
jmp 0x6aef
subl %ebp, %r15d
subl %r13d, %r12d
jmp 0x6b0d
decl %r12d
addl $0x4, %r15d
leaq 0x18(%rsp), %r14
movq 0x2b18(%rbx), %rdi
testl %r12d, %r12d
jle 0x6b33
movq %r14, %rsi
callq 0x110e4
decl %r12d
addl $0x8, %r15d
jmp 0x6b16
leaq 0x4(%rsp), %rbx
movq %rbx, %rsi
callq 0x10fca
xorl %eax, %eax
cmpl $0x12d687, (%rbx)       # imm = 0x12D687
cmovel %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop