// File: NichtJens[P]lmf2txt/LMF_IO.cpp
// Function: LMF_IO::WriteCAMACHeader()
__int32	LMF_IO::WriteCAMACHeader()
/////////////////////////////////////////////////////////////////
{
	unsigned __int32 byte_counter;
	byte_counter = 0;

	*output_lmf << frequency;	byte_counter += sizeof(double);		// frequency is always 4th value
	*output_lmf << IOaddress;	byte_counter += sizeof(__int32);		// IO address (parameter 1) always 5th value
	*output_lmf << timestamp_format_output;	byte_counter += sizeof(__int32);		// TimeInfo (parameter 2) always 6th value  (0,1,2)*32Bit

	unsigned __int32 dummy = __int32(DAQ_info.length());
	*output_lmf << dummy;
	byte_counter += sizeof(__int32);		// Length of DAQInfo always 7th value
	output_lmf->write(DAQ_info.c_str(), __int32(DAQ_info.length()));	// DAQInfo always 8th value
	byte_counter += __int32(DAQ_info.length());

	dummy = __int32(Camac_CIF.length());
	*output_lmf << dummy;
	byte_counter += sizeof(__int32);
	output_lmf->write(Camac_CIF.c_str(), __int32(Camac_CIF.length()));
	byte_counter += __int32(Camac_CIF.length());

	*output_lmf << system_timeout_output; byte_counter += sizeof(__int32);		// system time-out
	*output_lmf << time_reference_output; byte_counter += sizeof(__int32);
	*output_lmf << data_format_in_userheader_output;	byte_counter += sizeof(__int32);		// data format (2=short integer)

	return byte_counter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
movq 0x2b20(%rax), %rdi
movsd 0x12c8(%rax), %xmm0
callq 0x1d130
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addq $0x8, %rcx
movl %ecx, -0xc(%rbp)
movq 0x2b20(%rax), %rdi
movl 0x2a4(%rax), %esi
callq 0x1d170
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addq $0x4, %rcx
movl %ecx, -0xc(%rbp)
movq 0x2b20(%rax), %rdi
movl 0x2ac(%rax), %esi
callq 0x1caf0
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %eax
addq $0x4, %rax
movl %eax, -0xc(%rbp)
addq $0xa0, %rdi
callq 0x22b0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movl %ecx, -0x10(%rbp)
movq 0x2b20(%rax), %rdi
movl -0x10(%rbp), %esi
callq 0x1caf0
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %eax
addq $0x4, %rax
movl %eax, -0xc(%rbp)
movq 0x2b20(%rdi), %rax
movq %rax, -0x38(%rbp)
addq $0xa0, %rdi
callq 0x20b0
movq -0x18(%rbp), %rdi
movq %rax, -0x30(%rbp)
addq $0xa0, %rdi
callq 0x22b0
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl %eax, %edx
callq 0x1cd10
movq -0x18(%rbp), %rdi
addq $0xa0, %rdi
callq 0x22b0
movq -0x18(%rbp), %rdi
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
addq $0xc0, %rdi
callq 0x22b0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movl %ecx, -0x10(%rbp)
movq 0x2b20(%rax), %rdi
movl -0x10(%rbp), %esi
callq 0x1caf0
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %eax
addq $0x4, %rax
movl %eax, -0xc(%rbp)
movq 0x2b20(%rdi), %rax
movq %rax, -0x28(%rbp)
addq $0xc0, %rdi
callq 0x20b0
movq -0x18(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0xc0, %rdi
callq 0x22b0
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl %eax, %edx
callq 0x1cd10
movq -0x18(%rbp), %rdi
addq $0xc0, %rdi
callq 0x22b0
movq %rax, %rcx
movq -0x18(%rbp), %rax
addl -0xc(%rbp), %ecx
movl %ecx, -0xc(%rbp)
movq 0x2b20(%rax), %rdi
movl 0x1290(%rax), %esi
callq 0x1d170
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addq $0x4, %rcx
movl %ecx, -0xc(%rbp)
movq 0x2b20(%rax), %rdi
movl 0x244(%rax), %esi
callq 0x1d170
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addq $0x4, %rcx
movl %ecx, -0xc(%rbp)
movq 0x2b20(%rax), %rdi
movl 0x294(%rax), %esi
callq 0x1d170
movl -0xc(%rbp), %eax
addq $0x4, %rax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)