// File: NichtJens[P]lmf2txt/LMF_IO.cpp
// Function: LMF_IO::WriteTDCData(unsigned long long, unsigned int*, unsigned short*)
void LMF_IO::WriteTDCData(unsigned __int64 timestamp, unsigned __int32 cnt[], unsigned __int16 * us16TDC)
/////////////////////////////////////////////////////////////////
{
	unsigned __int16 dummy_uint16;
	double dummy_double;
	__int32 dummy_int32;


	if (!output_lmf || !OutputFileIsOpen) {
		errorflag = 10;
		return;
	}
	
	++uint64_number_of_written_events;

	WriteEventHeader(timestamp,cnt);

	__int32 i,j;

	if (DAQ_ID_output == DAQ_ID_HM1_ABM) {
		for (i=0;i<number_of_channels_output;++i) {
			if (data_format_in_userheader_output == 2)  *output_lmf << us16TDC[i*num_ions];
			if (data_format_in_userheader_output == 5)  {dummy_double = double(us16TDC[i*num_ions]); *output_lmf << dummy_double;}
			if (data_format_in_userheader_output == 10) {dummy_int32 = __int32(us16TDC[i*num_ions]); *output_lmf << dummy_int32;}
		}
	}
	if (DAQ_ID_output != DAQ_ID_SIMPLE && DAQ_ID_output != DAQ_ID_HM1_ABM) {
		for (i=0;i<number_of_channels_output;++i) {
			__int32 hits = cnt[i];
			if (hits > max_number_of_hits_output) hits = max_number_of_hits_output;
			if (data_format_in_userheader_output == 2) {
				dummy_uint16 = (unsigned __int16)(hits);
				*output_lmf << dummy_uint16;
				for (j=0;j<hits;++j) *output_lmf << us16TDC[i*num_ions+j];
				dummy_uint16 = 0;
				for (j=hits;j<max_number_of_hits_output;++j) *output_lmf << dummy_uint16;
			}
			if (data_format_in_userheader_output == 5) {
				dummy_double = double(hits);
				*output_lmf << dummy_double;
				for (j=0;j<hits;++j) {dummy_double = double(us16TDC[i*num_ions+j]); *output_lmf << dummy_double;}
				dummy_double = 0.;
				for (j=hits;j<max_number_of_hits_output;++j) *output_lmf << dummy_double;
			}
			if (data_format_in_userheader_output == 10) {
				*output_lmf <<__int32(hits);
				for (j=0;j<hits;++j) {dummy_int32 = __int32(us16TDC[i*num_ions+j]); *output_lmf << dummy_int32;}
				dummy_int32 = 0;
				for (j=hits;j<max_number_of_hits_output;++j) *output_lmf << dummy_int32;
			}
			if (data_format_in_userheader_output == LM_USERDEF) {
				dummy_uint16 = (unsigned __int16)(hits);
				*output_lmf << dummy_uint16;
				for (j=0;j<hits;++j) {
					dummy_int32 = __int32(us16TDC[i*num_ions+j]);
					if (DAQ_ID_output != DAQ_ID_HM1 && DAQ_ID_output != DAQ_ID_TDC8 && DAQ_ID_output != DAQ_ID_2TDC8) *output_lmf << dummy_int32;
						else *output_lmf << (unsigned __int16)(dummy_int32);
				}
			}
		}
				if (DAQ_ID_output == DAQ_ID_TDC8HP && this->LMF_Version_output >= 9) {
					*output_lmf << ui64LevelInfo;
				}
				if (DAQ_ID_output == DAQ_ID_TDC8HP && this->LMF_Version_output >= 10) {
					*output_lmf << number_of_bytes_in_PostEventData;
					for (__int32 i=0;i<number_of_bytes_in_PostEventData;i++) *output_lmf << ui8_PostEventData[i];
		}
	}

	if (DAQ_ID_output == DAQ_ID_2TDC8 && number_of_channels2_output > 0) {
		for (i=number_of_channels_output;i<number_of_channels_output+number_of_channels2_output;++i) {
			__int32 hits = cnt[i];
			if (hits > max_number_of_hits2_output) hits = max_number_of_hits2_output;
			if (data_format_in_userheader_output == 2) {
				dummy_uint16 = (unsigned __int16)(hits);
				*output_lmf << dummy_uint16;
				for (j=0;j<hits;++j) *output_lmf << us16TDC[i*num_ions+j];
				dummy_uint16 = 0;
				for (j=hits;j<max_number_of_hits2_output;++j) *output_lmf << dummy_uint16;
			}
			if (data_format_in_userheader_output == 5) {
				dummy_double = double(hits);
				*output_lmf << dummy_double;
				for (j=0;j<hits;++j) {dummy_double = double(us16TDC[i*num_ions+j]); *output_lmf << dummy_double;}
				dummy_double = 0.;
				for (j=hits;j<max_number_of_hits2_output;++j) *output_lmf << dummy_double;
			}
			if (data_format_in_userheader_output == 10) {
				dummy_int32 = __int32(hits);
				*output_lmf << dummy_int32;
				for (j=0;j<hits;++j) {dummy_int32 = __int32(us16TDC[i*num_ions+j]); *output_lmf << dummy_int32;}
				dummy_int32 = 0;
				for (j=hits;j<max_number_of_hits2_output;++j) *output_lmf << dummy_int32;
			}
		}
	}

	if (DAQ_ID_output == DAQ_ID_SIMPLE) {
		unsigned __int32 channel;
		unsigned __int32 i = 0;

		for (channel=0;channel < (unsigned __int32)number_of_channels_output;++channel) i = i + cnt[channel] + (cnt[channel]>0 ? 1 : 0);
		if (data_format_in_userheader_output == 2)  {dummy_uint16 = (unsigned __int16)i; *output_lmf << dummy_uint16;}
		if (data_format_in_userheader_output == 10) *output_lmf << i;
		if (data_format_in_userheader_output == 2) {
			for (channel=0;channel < (unsigned __int32)number_of_channels_output;++channel) {
				if (cnt[channel]>0) {
					dummy_uint16 = (unsigned __int16)((channel << 8) + cnt[channel]);
					*output_lmf << dummy_uint16;
					for (i=0;i<cnt[channel];++i) *output_lmf << us16TDC[channel*num_ions+i];
				}
			}
		}
		if (data_format_in_userheader_output == 10) {
			for (channel=0;channel < (unsigned __int32)number_of_channels_output;++channel) {
				if (cnt[channel]>0) {
					dummy_int32 = __int32((channel << 24) + cnt[channel]);
					*output_lmf << dummy_int32;
					for (i=0;i<cnt[channel];++i) {dummy_int32 = __int32(us16TDC[channel*num_ions+i]); *output_lmf << dummy_int32;}
				}
			}
		}
	} // end if (DAQ_ID_output == DAQ_ID_SIMPLE)

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, 0x2b20(%rax)
je 0x15e17
movq -0x58(%rbp), %rax
testb $0x1, 0x2b29(%rax)
jne 0x15e2a
movq -0x58(%rbp), %rax
movl $0xa, 0x12e0(%rax)
jmp 0x167e8
movq -0x58(%rbp), %rdi
movq 0x2b10(%rdi), %rax
addq $0x1, %rax
movq %rax, 0x2b10(%rdi)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x145f0
movq -0x58(%rbp), %rax
cmpl $0x6, 0x28c(%rax)
jne 0x15f36
movl $0x0, -0x38(%rbp)
movq -0x58(%rbp), %rcx
movl -0x38(%rbp), %eax
cmpl 0x2c4(%rcx), %eax
jge 0x15f34
movq -0x58(%rbp), %rax
cmpl $0x2, 0x294(%rax)
jne 0x15eaa
movq -0x58(%rbp), %rdx
movq 0x2b20(%rdx), %rdi
movq -0x20(%rbp), %rax
movl -0x38(%rbp), %ecx
imull 0x2b74(%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %esi
callq 0x1cca0
movq -0x58(%rbp), %rax
cmpl $0x5, 0x294(%rax)
jne 0x15eec
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0x38(%rbp), %edx
movl 0x2b74(%rax), %esi
imull %esi, %edx
movslq %edx, %rdx
movzwl (%rcx,%rdx,2), %ecx
cvtsi2sd %ecx, %xmm0
movsd %xmm0, -0x30(%rbp)
movq 0x2b20(%rax), %rdi
movsd -0x30(%rbp), %xmm0
callq 0x1d130
movq -0x58(%rbp), %rax
cmpl $0xa, 0x294(%rax)
jne 0x15f24
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0x38(%rbp), %edx
imull 0x2b74(%rax), %edx
movslq %edx, %rdx
movzwl (%rcx,%rdx,2), %ecx
movl %ecx, -0x34(%rbp)
movq 0x2b20(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x1d170
jmp 0x15f26
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x15e65
jmp 0x15f36
movq -0x58(%rbp), %rax
cmpl $0x65, 0x28c(%rax)
je 0x1631d
movq -0x58(%rbp), %rax
cmpl $0x6, 0x28c(%rax)
je 0x1631d
movl $0x0, -0x38(%rbp)
movq -0x58(%rbp), %rcx
movl -0x38(%rbp), %eax
cmpl 0x2c4(%rcx), %eax
jge 0x1627b
movq -0x58(%rbp), %rcx
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rdx
movl (%rax,%rdx,4), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl 0x2cc(%rcx), %eax
jle 0x15f9c
movq -0x58(%rbp), %rax
movl 0x2cc(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x2, 0x294(%rax)
jne 0x16046
movq -0x58(%rbp), %rax
movl -0x40(%rbp), %ecx
movw %cx, -0x22(%rbp)
movq 0x2b20(%rax), %rdi
movzwl -0x22(%rbp), %esi
callq 0x1cca0
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x1600a
movq -0x58(%rbp), %rdx
movq 0x2b20(%rdx), %rdi
movq -0x20(%rbp), %rax
movl -0x38(%rbp), %ecx
imull 0x2b74(%rdx), %ecx
addl -0x3c(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %esi
callq 0x1cca0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x15fcf
movw $0x0, -0x22(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x58(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0x2cc(%rcx), %eax
jge 0x16044
movq -0x58(%rbp), %rax
movq 0x2b20(%rax), %rdi
movzwl -0x22(%rbp), %esi
callq 0x1cca0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x16016
jmp 0x16046
movq -0x58(%rbp), %rax
cmpl $0x5, 0x294(%rax)
jne 0x16109
movq -0x58(%rbp), %rax
cvtsi2sdl -0x40(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movq 0x2b20(%rax), %rdi
movsd -0x30(%rbp), %xmm0
callq 0x1d130
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x160ca
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0x38(%rbp), %edx
movl 0x2b74(%rax), %esi
imull %esi, %edx
movl -0x3c(%rbp), %esi
addl %esi, %edx
movslq %edx, %rdx
movzwl (%rcx,%rdx,2), %ecx
cvtsi2sd %ecx, %xmm0
movsd %xmm0, -0x30(%rbp)
movq 0x2b20(%rax), %rdi
movsd -0x30(%rbp), %xmm0
callq 0x1d130
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1607d
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x58(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0x2cc(%rcx), %eax
jge 0x16107
movq -0x58(%rbp), %rax
movq 0x2b20(%rax), %rdi
movsd -0x30(%rbp), %xmm0
callq 0x1d130
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x160d8
jmp 0x16109
movq -0x58(%rbp), %rax
cmpl $0xa, 0x294(%rax)
jne 0x161b1
movq -0x58(%rbp), %rax
movq 0x2b20(%rax), %rdi
movl -0x40(%rbp), %esi
callq 0x1d170
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x16175
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0x38(%rbp), %edx
imull 0x2b74(%rax), %edx
addl -0x3c(%rbp), %edx
movslq %edx, %rdx
movzwl (%rcx,%rdx,2), %ecx
movl %ecx, -0x34(%rbp)
movq 0x2b20(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x1d170
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x16134
movl $0x0, -0x34(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x58(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0x2cc(%rcx), %eax
jge 0x161af
movq -0x58(%rbp), %rax
movq 0x2b20(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x1d170
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x16182
jmp 0x161b1
movq -0x58(%rbp), %rax
cmpl $-0x1, 0x294(%rax)
jne 0x1626b
movq -0x58(%rbp), %rax
movl -0x40(%rbp), %ecx
movw %cx, -0x22(%rbp)
movq 0x2b20(%rax), %rdi
movzwl -0x22(%rbp), %esi
callq 0x1cca0
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x16269
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0x38(%rbp), %edx
imull 0x2b74(%rax), %edx
addl -0x3c(%rbp), %edx
movslq %edx, %rdx
movzwl (%rcx,%rdx,2), %ecx
movl %ecx, -0x34(%rbp)
cmpl $0x1, 0x28c(%rax)
je 0x16243
movq -0x58(%rbp), %rax
cmpl $0x2, 0x28c(%rax)
je 0x16243
movq -0x58(%rbp), %rax
cmpl $0x5, 0x28c(%rax)
je 0x16243
movq -0x58(%rbp), %rax
movq 0x2b20(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x1d170
jmp 0x16259
movq -0x58(%rbp), %rax
movq 0x2b20(%rax), %rdi
movl -0x34(%rbp), %eax
movzwl %ax, %esi
callq 0x1cca0
jmp 0x1625b
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x161e4
jmp 0x1626b
jmp 0x1626d
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x15f5f
movq -0x58(%rbp), %rax
cmpl $0x8, 0x28c(%rax)
jne 0x162ac
movq -0x58(%rbp), %rax
cmpl $0x9, 0x12a8(%rax)
jl 0x162ac
movq -0x58(%rbp), %rax
movq 0x2b20(%rax), %rdi
movq 0x2d8(%rax), %rsi
callq 0x1cce0
movq -0x58(%rbp), %rax
cmpl $0x8, 0x28c(%rax)
jne 0x1631b
movq -0x58(%rbp), %rax
cmpl $0xa, 0x12a8(%rax)
jl 0x1631b
movq -0x58(%rbp), %rax
movq 0x2b20(%rax), %rdi
movl 0x1280(%rax), %esi
callq 0x1d170
movl $0x0, -0x44(%rbp)
movq -0x58(%rbp), %rcx
movl -0x44(%rbp), %eax
cmpl 0x1280(%rcx), %eax
jge 0x16319
movq -0x58(%rbp), %rax
movq 0x2b20(%rax), %rdi
movslq -0x44(%rbp), %rcx
movzbl 0x2e0(%rax,%rcx), %esi
callq 0x1cc60
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x162e3
jmp 0x1631b
jmp 0x1631d
movq -0x58(%rbp), %rax
cmpl $0x5, 0x28c(%rax)
jne 0x165be
movq -0x58(%rbp), %rax
cmpl $0x0, 0x2c8(%rax)
jle 0x165be
movq -0x58(%rbp), %rax
movl 0x2c4(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x58(%rbp), %rdx
movl -0x38(%rbp), %eax
movl 0x2c4(%rdx), %ecx
addl 0x2c8(%rdx), %ecx
cmpl %ecx, %eax
jge 0x165bc
movq -0x58(%rbp), %rcx
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rdx
movl (%rax,%rdx,4), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl 0x2d0(%rcx), %eax
jle 0x16391
movq -0x58(%rbp), %rax
movl 0x2d0(%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x2, 0x294(%rax)
jne 0x1643b
movq -0x58(%rbp), %rax
movl -0x48(%rbp), %ecx
movw %cx, -0x22(%rbp)
movq 0x2b20(%rax), %rdi
movzwl -0x22(%rbp), %esi
callq 0x1cca0
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x163ff
movq -0x58(%rbp), %rdx
movq 0x2b20(%rdx), %rdi
movq -0x20(%rbp), %rax
movl -0x38(%rbp), %ecx
imull 0x2b74(%rdx), %ecx
addl -0x3c(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %esi
callq 0x1cca0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x163c4
movw $0x0, -0x22(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x58(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0x2d0(%rcx), %eax
jge 0x16439
movq -0x58(%rbp), %rax
movq 0x2b20(%rax), %rdi
movzwl -0x22(%rbp), %esi
callq 0x1cca0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1640b
jmp 0x1643b
movq -0x58(%rbp), %rax
cmpl $0x5, 0x294(%rax)
jne 0x164fe
movq -0x58(%rbp), %rax
cvtsi2sdl -0x48(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movq 0x2b20(%rax), %rdi
movsd -0x30(%rbp), %xmm0
callq 0x1d130
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x164bf
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0x38(%rbp), %edx
movl 0x2b74(%rax), %esi
imull %esi, %edx
movl -0x3c(%rbp), %esi
addl %esi, %edx
movslq %edx, %rdx
movzwl (%rcx,%rdx,2), %ecx
cvtsi2sd %ecx, %xmm0
movsd %xmm0, -0x30(%rbp)
movq 0x2b20(%rax), %rdi
movsd -0x30(%rbp), %xmm0
callq 0x1d130
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x16472
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x58(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0x2d0(%rcx), %eax
jge 0x164fc
movq -0x58(%rbp), %rax
movq 0x2b20(%rax), %rdi
movsd -0x30(%rbp), %xmm0
callq 0x1d130
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x164cd
jmp 0x164fe
movq -0x58(%rbp), %rax
cmpl $0xa, 0x294(%rax)
jne 0x165ac
movq -0x58(%rbp), %rax
movl -0x48(%rbp), %ecx
movl %ecx, -0x34(%rbp)
movq 0x2b20(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x1d170
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x16570
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0x38(%rbp), %edx
imull 0x2b74(%rax), %edx
addl -0x3c(%rbp), %edx
movslq %edx, %rdx
movzwl (%rcx,%rdx,2), %ecx
movl %ecx, -0x34(%rbp)
movq 0x2b20(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x1d170
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1652f
movl $0x0, -0x34(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x58(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0x2d0(%rcx), %eax
jge 0x165aa
movq -0x58(%rbp), %rax
movq 0x2b20(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x1d170
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1657d
jmp 0x165ac
jmp 0x165ae
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x1634c
jmp 0x165be
movq -0x58(%rbp), %rax
cmpl $0x65, 0x28c(%rax)
jne 0x167e6
movl $0x0, -0x50(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x58(%rbp), %rcx
movl -0x4c(%rbp), %eax
cmpl 0x2c4(%rcx), %eax
jae 0x16620
movl -0x50(%rbp), %eax
movq -0x18(%rbp), %rcx
movl -0x4c(%rbp), %edx
addl (%rcx,%rdx,4), %eax
movq -0x18(%rbp), %rcx
movl -0x4c(%rbp), %edx
movl (%rcx,%rdx,4), %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmoval %edx, %ecx
addl %ecx, %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x165dd
movq -0x58(%rbp), %rax
cmpl $0x2, 0x294(%rax)
jne 0x16648
movq -0x58(%rbp), %rax
movl -0x50(%rbp), %ecx
movw %cx, -0x22(%rbp)
movq 0x2b20(%rax), %rdi
movzwl -0x22(%rbp), %esi
callq 0x1cca0
movq -0x58(%rbp), %rax
cmpl $0xa, 0x294(%rax)
jne 0x16668
movq -0x58(%rbp), %rax
movq 0x2b20(%rax), %rdi
movl -0x50(%rbp), %esi
callq 0x1caf0
movq -0x58(%rbp), %rax
cmpl $0x2, 0x294(%rax)
jne 0x16724
movl $0x0, -0x4c(%rbp)
movq -0x58(%rbp), %rcx
movl -0x4c(%rbp), %eax
cmpl 0x2c4(%rcx), %eax
jae 0x16722
movq -0x18(%rbp), %rax
movl -0x4c(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
jbe 0x16712
movq -0x58(%rbp), %rax
movl -0x4c(%rbp), %ecx
shll $0x8, %ecx
movq -0x18(%rbp), %rdx
movl -0x4c(%rbp), %esi
addl (%rdx,%rsi,4), %ecx
movw %cx, -0x22(%rbp)
movq 0x2b20(%rax), %rdi
movzwl -0x22(%rbp), %esi
callq 0x1cca0
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
movq -0x18(%rbp), %rcx
movl -0x4c(%rbp), %edx
cmpl (%rcx,%rdx,4), %eax
jae 0x16710
movq -0x58(%rbp), %rdx
movq 0x2b20(%rdx), %rdi
movq -0x20(%rbp), %rax
movl -0x4c(%rbp), %ecx
imull 0x2b74(%rdx), %ecx
addl -0x50(%rbp), %ecx
movl %ecx, %ecx
movzwl (%rax,%rcx,2), %esi
callq 0x1cca0
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x166cf
jmp 0x16712
jmp 0x16714
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x16680
jmp 0x16724
movq -0x58(%rbp), %rax
cmpl $0xa, 0x294(%rax)
jne 0x167e4
movl $0x0, -0x4c(%rbp)
movq -0x58(%rbp), %rcx
movl -0x4c(%rbp), %eax
cmpl 0x2c4(%rcx), %eax
jae 0x167e2
movq -0x18(%rbp), %rax
movl -0x4c(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
jbe 0x167d2
movq -0x58(%rbp), %rax
movl -0x4c(%rbp), %ecx
shll $0x18, %ecx
movq -0x18(%rbp), %rdx
movl -0x4c(%rbp), %esi
addl (%rdx,%rsi,4), %ecx
movl %ecx, -0x34(%rbp)
movq 0x2b20(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x1d170
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
movq -0x18(%rbp), %rcx
movl -0x4c(%rbp), %edx
cmpl (%rcx,%rdx,4), %eax
jae 0x167d0
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
movl -0x4c(%rbp), %edx
imull 0x2b74(%rax), %edx
addl -0x50(%rbp), %edx
movl %edx, %edx
movzwl (%rcx,%rdx,2), %ecx
movl %ecx, -0x34(%rbp)
movq 0x2b20(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x1d170
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x16789
jmp 0x167d2
jmp 0x167d4
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1673c
jmp 0x167e4
jmp 0x167e6
jmp 0x167e8
addq $0x60, %rsp
popq %rbp
retq
nop