// File: NichtJens[P]lmf2txt/LMF_IO.cpp
// Function: LMF_IO::GetTDCDataArray(unsigned short*)
void LMF_IO::GetTDCDataArray(unsigned __int16 *tdc)
/////////////////////////////////////////////////////////////////
{
	__int32 i,j;

	if (must_read_first) {
		if (!ReadNextEvent()) return;
	}

	//__int32 max_channel = (number_of_channels+number_of_channels2 < num_channels) ? (number_of_channels+number_of_channels2) : num_channels;
	//__int32 max_hits = (max_number_of_hits < num_ions) ? max_number_of_hits : num_ions;
	__int32 max_channel = num_channels;
	__int32 max_hits = num_ions;

	if (data_format_in_userheader == LM_USERDEF) {
		if (DAQ_ID == DAQ_ID_TDC8HP || DAQ_ID == DAQ_ID_TDC8HPRAW) {
			for (i=0;i<max_channel;++i) {
				for (j=0;j<max_hits;++j) tdc[i*num_ions+j] = (unsigned __int16)(i32TDC[i*num_ions+j]);
			}
		}
		if (DAQ_ID == DAQ_ID_TDC8 || DAQ_ID == DAQ_ID_2TDC8 || DAQ_ID == DAQ_ID_HM1) {
			for (i=0;i<max_channel;++i) {
				for (j=0;j<max_hits;++j) tdc[i*num_ions+j] = (unsigned __int16)(us16TDC[i*num_ions+j]);
			}
		}
	}
	if (data_format_in_userheader == 10) {
		for (i=0;i<max_channel;++i) {
			for (j=0;j<max_hits;++j) tdc[i*num_ions+j] = (unsigned __int16)(i32TDC[i*num_ions+j]);
		}
	}
	if (data_format_in_userheader == 2) {
		for (i=0;i<max_channel;++i) {
			for (j=0;j<max_hits;++j) tdc[i*num_ions+j] = us16TDC[i*num_ions+j];
		}
	}
	if (data_format_in_userheader == 5) {
		for (i=0;i<max_channel;++i) {
			for (j=0;j<max_hits;++j) tdc[i*num_ions+j] = (unsigned __int16)(dTDC[i*num_ions+j]+1e-7);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
testb $0x1, 0x2b4c(%rax)
je 0x197e5
movq -0x28(%rbp), %rdi
callq 0x17050
testb $0x1, %al
jne 0x197e3
jmp 0x19abd
jmp 0x197e5
movq -0x28(%rbp), %rax
movl 0x2b70(%rax), %ecx
movl %ecx, -0x1c(%rbp)
movl 0x2b74(%rax), %ecx
movl %ecx, -0x20(%rbp)
cmpl $-0x1, 0x290(%rax)
jne 0x1992b
movq -0x28(%rbp), %rax
cmpl $0x8, 0x288(%rax)
je 0x19822
movq -0x28(%rbp), %rax
cmpl $0x10, 0x288(%rax)
jne 0x19893
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x19891
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x19884
movq -0x28(%rbp), %rsi
movq 0x2b58(%rsi), %rax
movl -0x14(%rbp), %ecx
imull 0x2b74(%rsi), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movw %ax, %dx
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
imull 0x2b74(%rsi), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x19838
jmp 0x19886
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x19829
jmp 0x19893
movq -0x28(%rbp), %rax
cmpl $0x2, 0x288(%rax)
je 0x198ba
movq -0x28(%rbp), %rax
cmpl $0x5, 0x288(%rax)
je 0x198ba
movq -0x28(%rbp), %rax
cmpl $0x1, 0x288(%rax)
jne 0x19929
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x19927
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x1991a
movq -0x28(%rbp), %rsi
movq 0x2b60(%rsi), %rax
movl -0x14(%rbp), %ecx
imull 0x2b74(%rsi), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movw (%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
imull 0x2b74(%rsi), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x198d0
jmp 0x1991c
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x198c1
jmp 0x19929
jmp 0x1992b
movq -0x28(%rbp), %rax
cmpl $0xa, 0x290(%rax)
jne 0x199a9
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x199a7
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x1999a
movq -0x28(%rbp), %rsi
movq 0x2b58(%rsi), %rax
movl -0x14(%rbp), %ecx
imull 0x2b74(%rsi), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movw %ax, %dx
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
imull 0x2b74(%rsi), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1994e
jmp 0x1999c
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1993f
jmp 0x199a9
movq -0x28(%rbp), %rax
cmpl $0x2, 0x290(%rax)
jne 0x19a25
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x19a23
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x19a16
movq -0x28(%rbp), %rsi
movq 0x2b60(%rsi), %rax
movl -0x14(%rbp), %ecx
imull 0x2b74(%rsi), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movw (%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
imull 0x2b74(%rsi), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x199cc
jmp 0x19a18
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x199bd
jmp 0x19a25
movq -0x28(%rbp), %rax
cmpl $0x5, 0x290(%rax)
jne 0x19abd
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x19abb
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x19aae
movq -0x28(%rbp), %rsi
movq 0x2b68(%rsi), %rax
movl -0x14(%rbp), %ecx
movl 0x2b74(%rsi), %edx
imull %edx, %ecx
movl -0x18(%rbp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x55e0(%rip), %xmm1     # 0x1f060
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movw %ax, %dx
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
imull 0x2b74(%rsi), %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x19a4c
jmp 0x19ab0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x19a3d
jmp 0x19abd
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)