// File: /workspace/github_cpp_makefile_star2_O3/NichtJens[P]lmf2txt/LMF_IO.cpp
// Function: LMF_IO::GetTDCDataArray(double*)
void LMF_IO::GetTDCDataArray(double *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] = double(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] = double(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] = double(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] = double(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] = dTDC[i*num_ions+j]+1e-7;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x1, 0x2b4c(%rdi)
jne 0x11c6b
movq %r14, %rdi
callq 0x100fa
testb %al, %al
je 0x11e8f
movl 0x2b70(%r14), %eax
movl 0x2b74(%r14), %ecx
movl 0x290(%r14), %edx
cmpl $0x4, %edx
jg 0x11d71
cmpl $-0x1, %edx
jne 0x11dd9
movl 0x288(%r14), %edx
cmpl $0x10, %edx
ja 0x11e8f
movl $0x26, %esi
btl %edx, %esi
jb 0x11d1e
movl $0x10100, %esi          # imm = 0x10100
btl %edx, %esi
jae 0x11e8f
testl %eax, %eax
jle 0x11d07
movq 0x2b58(%r14), %rsi
leaq (,%rcx,8), %rdi
leaq (,%rcx,4), %r8
xorl %r9d, %r9d
movq %rbx, %r10
testl %ecx, %ecx
jle 0x11cf9
xorl %r11d, %r11d
xorps %xmm0, %xmm0
cvtsi2sdl (%rsi,%r11,4), %xmm0
movsd %xmm0, (%r10,%r11,8)
incq %r11
cmpq %r11, %rcx
jne 0x11ce2
incq %r9
addq %rdi, %r10
addq %r8, %rsi
cmpq %rax, %r9
jne 0x11cdb
cmpl $0x5, %edx
ja 0x11e8f
movl $0x26, %esi
btl %edx, %esi
jae 0x11e8f
testl %eax, %eax
jle 0x11e8f
movq 0x2b60(%r14), %rdx
leaq (,%rcx,8), %rsi
leaq (%rcx,%rcx), %rdi
xorl %r8d, %r8d
testl %ecx, %ecx
jle 0x11d5e
xorl %r9d, %r9d
movzwl (%rdx,%r9,2), %r10d
xorps %xmm0, %xmm0
cvtsi2sd %r10d, %xmm0
movsd %xmm0, (%rbx,%r9,8)
incq %r9
cmpq %r9, %rcx
jne 0x11d43
incq %r8
addq %rsi, %rbx
addq %rdi, %rdx
cmpq %rax, %r8
jne 0x11d3c
jmp 0x11e8f
cmpl $0x5, %edx
je 0x11e45
cmpl $0xa, %edx
jne 0x11e8f
testl %eax, %eax
jle 0x11e8f
movq 0x2b58(%r14), %rsi
leaq (,%rcx,8), %rdi
leaq (,%rcx,4), %r8
xorl %r9d, %r9d
movq %rbx, %r10
testl %ecx, %ecx
jle 0x11dc6
xorl %r11d, %r11d
xorps %xmm0, %xmm0
cvtsi2sdl (%rsi,%r11,4), %xmm0
movsd %xmm0, (%r10,%r11,8)
incq %r11
cmpq %r11, %rcx
jne 0x11daf
incq %r9
addq %rdi, %r10
addq %r8, %rsi
cmpq %rax, %r9
jne 0x11da8
cmpl $0x5, %edx
je 0x11e45
cmpl $0x2, %edx
jne 0x11e8f
testl %eax, %eax
jle 0x11e8f
movq 0x2b60(%r14), %rsi
leaq (,%rcx,8), %rdi
leaq (%rcx,%rcx), %r8
xorl %r9d, %r9d
movq %rbx, %r10
testl %ecx, %ecx
jle 0x11e24
xorl %r11d, %r11d
movzwl (%rsi,%r11,2), %ebp
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd %xmm0, (%r10,%r11,8)
incq %r11
cmpq %r11, %rcx
jne 0x11e0a
incq %r9
addq %rdi, %r10
addq %r8, %rsi
cmpq %rax, %r9
jne 0x11e03
testl %eax, %eax
setg %sil
cmpl $0x5, %edx
sete %dl
testb %sil, %dl
jne 0x11e49
jmp 0x11e8f
testl %eax, %eax
jle 0x11e8f
movq 0x2b68(%r14), %rdx
leaq (,%rcx,8), %rsi
xorl %edi, %edi
movsd 0x2296(%rip), %xmm0     # 0x140f8
testl %ecx, %ecx
jle 0x11e81
xorl %r8d, %r8d
movsd (%rdx,%r8,8), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rbx,%r8,8)
incq %r8
cmpq %r8, %rcx
jne 0x11e69
incq %rdi
addq %rsi, %rbx
addq %rsi, %rdx
cmpq %rax, %rdi
jne 0x11e62
popq %rbx
popq %r14
popq %rbp
retq