// File: /workspace/github_cpp_makefile_star2_O1/NichtJens[P]lmf2txt/LMF_IO.cpp
// Function: LMF_IO::ReadCAMACHeader()
__int32	LMF_IO::ReadCAMACHeader()
/////////////////////////////////////////////////////////////////
{
	__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 >> Camac_CIF_Length;	byte_counter += sizeof(__int32);
	__int8_temp = new __int8[Camac_CIF_Length+1];
	input_lmf->read(__int8_temp,Camac_CIF_Length);
	__int8_temp[Camac_CIF_Length] = 0;
	Camac_CIF = __int8_temp;
	delete[] __int8_temp; __int8_temp = 0;
	byte_counter += Camac_CIF_Length;

	*input_lmf >> system_timeout; byte_counter += sizeof(__int32);		// system time-out
	*input_lmf >> time_reference; byte_counter += sizeof(__int32);
	*input_lmf >> data_format_in_userheader;	byte_counter += sizeof(__int32);		// data format (2=short integer)

	return byte_counter;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
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
xorl %ebp, %ebp
movb %bpl, (%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 0x12a0(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movslq 0x12a0(%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 0x12a0(%rbx), %rax
movb %bpl, (%r15,%rax)
leaq 0xc0(%rbx), %r14
movq 0xc8(%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 0x12a0(%rbx), %r14d
movq 0x2b18(%rbx), %rdi
leaq 0x128c(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
leaq 0x240(%rbx), %rsi
movl $0x4, %edx
callq 0x139ac
movq 0x2b18(%rbx), %rdi
addq $0x290, %rbx            # imm = 0x290
movq %rbx, %rsi
movl $0x4, %edx
callq 0x139ac
leal (%r14,%r13), %eax
addl $0x24, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop