// File: /workspace/github_c_makefile_star2_O3/DrYerzinia[P]C_DigiMode/src/NOAA_ATP/NOAA_ATP.cpp
// Function: NOAA_ATP::proccess_byte(char)
bool NOAA_ATP::proccess_byte(char input_data_point){

	ef_buffer.push_back(input_data_point);

	if(ef_buffer.size() > sample_rate/(NOAA_SUBCARRIER_FREQ)){

		char max = 0;
		for(std::list<char>::iterator it = ef_buffer.begin(); it != ef_buffer.end(); it++){
			char val = std::abs(*it);
			if(val > max) max = val;
		}

		envelope_follower_out.push_back(max);
		sample_count++;

		if(max > 64) max = 1;
		else max = 0;
		sync_pulse_detect_buf.push_back(max);

		bool sync_a_detected = false;
		bool sync_b_detected = false;

		if(sync_pulse_detect_buf.size() > 7.0*sample_rate/SYNC_B_FREQ+10){
			int last_state = (*sync_pulse_detect_buf.begin());
			int count_p_high = 0;
			int count_p_low = 0;
			int count_high = 0;
			int p_count_last = 0;
			int count_low = 0;
			int count_sample = 0;
			bool start_count = false;
			for(std::list<char>::iterator it = sync_pulse_detect_buf.begin(); it != sync_pulse_detect_buf.end(); it++){
				if((*it) != last_state){
					if(last_state == 0){
						count_low++;
						start_count = true;
					} else {
						if(start_count) count_high++;
					}
					last_state = *it;
					p_count_last = 0;
				}
				if(start_count){
					if((*it) == 0){
						count_p_low++;
					} else {
						count_p_high++;
					}
				}
				if(start_count){
					if(p_count_last > 14) break;
					p_count_last++;
				}
				if(count_high == 7){
					float pulse_average = float(count_p_high)/float(count_p_low);
					if((std::abs(count_sample-(7.0*sample_rate/SYNC_A_FREQ)) < detection_threshold+4)
					&& (pulse_average > 2.0-(detection_threshold/4.0))){
						sync_a_detected = true;
					}
					if((std::abs(count_sample-(7.0*sample_rate/SYNC_B_FREQ)) < detection_threshold+4)
					&& (pulse_average > 2.0-(detection_threshold/4.0))){
						sync_b_detected = true;
					}
					//std::cout << "thrsh: " << std::abs(count_sample-(7.0*sample_rate/SYNC_B_FREQ)) << ", PA: " << pulse_average << std::endl;
					//std::cout << envelope_follower_out.size() << ", " << count_sample << std::endl;
					break;
				}
				if(start_count) count_sample++;
			}
			sync_pulse_detect_buf.pop_front();
		}

		if(sync_a_detected && (sync_a_positions.empty() || (sample_count-(*(sync_a_positions.rbegin())) > 110)))
			sync_a_positions.push_back(sample_count);
		if(sync_b_detected && (sync_b_positions.empty() || (sample_count-(*(sync_b_positions.rbegin())) > 110)))
			sync_b_positions.push_back(sample_count);

		if(sync_a_positions.size() >= 10){
			int prob_arr[10][2];
			int count = 0;

			for(std::list<int>::iterator it = sync_a_positions.begin(); it != sync_a_positions.end(); it++, count++)
				prob_arr[count][0] = *it;

			for(int i = 0; i < 10; i++)
				prob_arr[i][1] = 0;

			for(int i = 0; i < 10; i++){
				for(int j = 0; j < 10; j++){
					prob_arr[i][1] += int(std::abs(prob_arr[i][0]-prob_arr[j][0]))%int(sample_rate/2);
				}
			}

			std::list<int>::iterator it_sap = sync_a_positions.begin();
			for(int i = 0; i < 10; i++){
				if(prob_arr[i][1] > sample_rate/8){
					it_sap = sync_a_positions.erase(it_sap);
				} else it_sap++;
			}

			if(!sync_a_positions.empty()){
				sync_a_positions_cnf.push_back(sync_a_positions.front());
				sync_a_positions.pop_front();
			}

		}

		if(sync_b_positions.size() >= 10){
			int prob_arr[10][2];
			int count = 0;

			for(std::list<int>::iterator it = sync_b_positions.begin(); it != sync_b_positions.end(); it++, count++)
				prob_arr[count][0] = *it;

			for(int i = 0; i < 10; i++)
				prob_arr[i][1] = 0;

			for(int i = 0; i < 10; i++){
				for(int j = 0; j < 10; j++){
					prob_arr[i][1] += int(std::abs(prob_arr[i][0]-prob_arr[j][0]))%int(sample_rate/2);
				}
			}

			std::list<int>::iterator it_sap = sync_b_positions.begin();
			for(int i = 0; i < 10; i++){
				if(prob_arr[i][1] > sample_rate/8){
					it_sap = sync_b_positions.erase(it_sap);
				} else it_sap++;
			}

			if(!sync_b_positions.empty()){
				sync_b_positions_cnf.push_back(sync_b_positions.front());
				sync_b_positions.pop_front();
			}

		}

		if(sync_b_positions_cnf.size() >= 2){

			int cnf_sync_pos = sync_b_positions_cnf.front()-int(7.0*sample_rate/SYNC_B_FREQ+10);
			std::cout << "CSP: " << cnf_sync_pos << std::endl;
			while(cnf_sync_pos > input_buffer_start){

				int front_sync_offset = (cnf_sync_pos-input_buffer_start)%int(sample_rate/2);

				std::cout << "IBS: " << input_buffer_start << std::endl;
				std::cout << "FSO: " << front_sync_offset << std::endl;

				if(front_sync_offset != 0){

					std::list<char>::iterator it_efb_ers = envelope_follower_out.begin();
					std::advance(it_efb_ers,front_sync_offset);

					envelope_follower_out.erase(envelope_follower_out.begin(), it_efb_ers);

					input_buffer_start += front_sync_offset;

				}

				std::vector<char> nextLine;
				std::list<char>::iterator it_efb = envelope_follower_out.begin();
				if(cnf_sync_pos - input_buffer_start >= int(sample_rate/2)){

					for(int i = 0; i < int(sample_rate/2); i++){
						nextLine.push_back(*it_efb);
						it_efb++;
					}

					input_buffer_start += int(sample_rate/2);
					line_data.push_back(nextLine);

					envelope_follower_out.erase(envelope_follower_out.begin(), it_efb);

				} else {

					int excess_buffer = cnf_sync_pos - input_buffer_start;

					std::cout << "EB : " << excess_buffer << std::endl;

					std::list<char>::iterator it_efb_ers = envelope_follower_out.begin();
					std::advance(it_efb_ers, excess_buffer);

					envelope_follower_out.erase(envelope_follower_out.begin(), it_efb_ers);	

					input_buffer_start += excess_buffer;

				}

			}

			sync_b_positions_cnf.pop_front();

			int cnf_sync_pos_2 = sync_b_positions_cnf.front()-int(7.0*sample_rate/SYNC_B_FREQ+10);

			int data_in_frames = cnf_sync_pos_2-cnf_sync_pos;

			std::cout << "SNCDIF: " << data_in_frames << std::endl;

			int frames = int(((data_in_frames)/(sample_rate/2))+0.5);

			std::cout << "FRAMES: " << frames << std::endl;

			std::cout << "IBS2: " << input_buffer_start << std::endl;

			int count_total = 0;
			for(int i = 0; i < frames; i++){

				std::list<char>::iterator it_efb = envelope_follower_out.begin();
				std::vector<char> nextLine;
				for(int i = 0; i < int(sample_rate/2); i++){

					if(count_total < data_in_frames){
						nextLine.push_back(*it_efb);
						it_efb++;
					} else {
						nextLine.push_back(0);
					}

					count_total++;

				}

				input_buffer_start += int(sample_rate/2);
				line_data.push_back(nextLine);

				envelope_follower_out.erase(envelope_follower_out.begin(), it_efb);

			}

		}

		ef_buffer.pop_front();

	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x28(%rdi), %r15
movl $0x18, %edi
callq 0x21b0
movb %bl, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x2060
incq 0x38(%r14)
movq 0x28(%r14), %rax
xorl %ebx, %ebx
cmpq %r15, %rax
je 0x302f
movb 0x10(%rax), %cl
movl %ecx, %edx
sarb $0x7, %dl
xorb %dl, %cl
subb %dl, %cl
movzbl %cl, %ecx
movzbl %bl, %ebx
cmpb %bl, %cl
cmovgl %ecx, %ebx
movq (%rax), %rax
jmp 0x300e
movq %r15, 0x78(%rsp)
leaq 0x40(%r14), %r15
movl $0x18, %edi
callq 0x21b0
movb %bl, 0x10(%rax)
movq %rax, %rdi
movq %r15, 0x10(%rsp)
movq %r15, %rsi
callq 0x2060
incq 0x50(%r14)
incl (%r14)
leaq 0x58(%r14), %r15
movl $0x18, %edi
callq 0x21b0
cmpb $0x41, %bl
setge 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x2060
movq 0x68(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x68(%r14)
movq %rcx, %xmm0
punpckldq 0x1ffb(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x2003(%rip), %xmm0     # 0x50a0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
cvtss2sd 0x8(%r14), %xmm1
mulsd 0x205d(%rip), %xmm1     # 0x5110
addsd %xmm0, %xmm2
movapd %xmm1, %xmm0
divsd 0x2055(%rip), %xmm0     # 0x5118
movsd 0x2055(%rip), %xmm3     # 0x5120
addsd %xmm0, %xmm3
ucomisd %xmm3, %xmm2
jbe 0x32e2
movq (%r15), %r12
xorl %ebp, %ebp
movl $0x0, %ebx
cmpq %r15, %r12
je 0x3241
movq %rax, 0x8(%rsp)
movsbl 0x10(%r12), %r10d
movl $0x1, %ecx
xorl %edx, %edx
xorl %ebx, %ebx
xorl %r9d, %r9d
xorl %esi, %esi
xorl %edi, %edi
movq %r12, %r8
movsbl 0x10(%r8), %r11d
cmpl %r11d, %r10d
jne 0x3125
testb $0x1, %dil
je 0x3171
movl %ebx, %r13d
cmpl $0xe, %r9d
jle 0x314e
jmp 0x3182
movzbl %dil, %r9d
andb $0x1, %dil
testl %r10d, %r10d
cmovel %ecx, %r9d
movzbl %dil, %r13d
movl %r9d, %edi
cmovel %r10d, %r13d
addl %ebx, %r13d
xorl %r9d, %r9d
movl %r11d, %r10d
testb $0x1, %dil
je 0x3165
xorl %ebx, %ebx
xorl %eax, %eax
testb %r11b, %r11b
sete %bl
setne %al
addl %eax, %ebp
addl %ebx, %edx
incl %r9d
movl %r10d, %r11d
cmpl $0x7, %r13d
je 0x3190
movl %r13d, %ebx
movl %r11d, %r10d
movl %edi, %eax
andb $0x1, %al
movzbl %al, %eax
addl %eax, %esi
movq (%r8), %r8
cmpq %r15, %r8
jne 0x310a
xorl %ebp, %ebp
xorl %ebx, %ebx
movq 0x8(%rsp), %rax
jmp 0x3241
xorps %xmm3, %xmm3
cvtsi2ss %ebp, %xmm3
cvtsi2ss %edx, %xmm4
xorps %xmm2, %xmm2
cvtsi2sd %esi, %xmm2
divsd 0x1f7e(%rip), %xmm1     # 0x5128
divss %xmm4, %xmm3
addsd %xmm2, %xmm1
andpd 0x1ef6(%rip), %xmm1     # 0x50b0
movss 0xc(%r14), %xmm5
movss 0x1f80(%rip), %xmm4     # 0x5148
addss %xmm5, %xmm4
cvtss2sd %xmm4, %xmm4
ucomisd %xmm1, %xmm4
xorps %xmm1, %xmm1
cvtss2sd %xmm3, %xmm1
xorps %xmm3, %xmm3
cvtss2sd %xmm5, %xmm3
jbe 0x3207
movsd 0x1f44(%rip), %xmm5     # 0x5130
mulsd %xmm3, %xmm5
addsd 0x1f40(%rip), %xmm5     # 0x5138
ucomisd %xmm5, %xmm1
movq 0x8(%rsp), %rax
jbe 0x3210
movb $0x1, %bl
jmp 0x3212
xorl %ebx, %ebx
movq 0x8(%rsp), %rax
jmp 0x3212
xorl %ebx, %ebx
subsd %xmm0, %xmm2
andpd 0x1e92(%rip), %xmm2     # 0x50b0
ucomisd %xmm2, %xmm4
jbe 0x323f
mulsd 0x1f04(%rip), %xmm3     # 0x5130
addsd 0x1f04(%rip), %xmm3     # 0x5138
ucomisd %xmm3, %xmm1
jbe 0x323f
movb $0x1, %bpl
jmp 0x3241
xorl %ebp, %ebp
movq %rax, 0x68(%r14)
movq %r12, %rdi
callq 0x22d0
movl $0x18, %esi
movq %r12, %rdi
callq 0x21c0
testb %bl, %bl
je 0x3299
leaq 0x70(%r14), %rbx
cmpq %rbx, 0x70(%r14)
je 0x3277
movl (%r14), %eax
movq 0x78(%r14), %rcx
subl 0x10(%rcx), %eax
cmpl $0x6f, %eax
jl 0x3299
movl $0x18, %edi
callq 0x21b0
movl (%r14), %ecx
movl %ecx, 0x10(%rax)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2060
incq 0x80(%r14)
testb %bpl, %bpl
je 0x32e2
leaq 0x88(%r14), %rbx
cmpq %rbx, 0x88(%r14)
je 0x32c0
movl (%r14), %eax
movq 0x90(%r14), %rcx
subl 0x10(%rcx), %eax
cmpl $0x6f, %eax
jl 0x32e2
movl $0x18, %edi
callq 0x21b0
movl (%r14), %ecx
movl %ecx, 0x10(%rax)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2060
incq 0x98(%r14)
cmpq $0xa, 0x80(%r14)
jb 0x3484
leaq 0x70(%r14), %rbx
movq (%rbx), %r15
cmpq %rbx, %r15
je 0x3315
leaq 0x20(%rsp), %rax
movq %r15, %rcx
movl 0x10(%rcx), %edx
movl %edx, (%rax)
movq (%rcx), %rcx
addq $0x8, %rax
cmpq %rbx, %rcx
jne 0x3304
movdqa 0x1da3(%rip), %xmm0     # 0x50c0
movl $0xc, %eax
movdqa 0x1da6(%rip), %xmm1     # 0x50d0
movdqa 0x1dae(%rip), %xmm2     # 0x50e0
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
movdqa 0x1db1(%rip), %xmm4     # 0x50f0
movdqa %xmm0, %xmm5
pxor %xmm1, %xmm5
movdqa %xmm2, %xmm6
pcmpgtd %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pcmpeqd %xmm3, %xmm5
pand %xmm6, %xmm5
movd %xmm5, %ecx
testb $0x1, %cl
je 0x336d
movl $0x0, 0x18(%rsp,%rax)
pextrw $0x4, %xmm5, %ecx
testb $0x1, %cl
je 0x337f
movl $0x0, 0x20(%rsp,%rax)
paddq %xmm4, %xmm0
addq $0x10, %rax
cmpq $0x5c, %rax
jne 0x333f
movss 0x8(%r14), %xmm0
mulss 0x1db1(%rip), %xmm0     # 0x514c
cvttss2si %xmm0, %ecx
xorl %esi, %esi
movl 0x20(%rsp,%rsi,8), %r8d
movl 0x24(%rsp,%rsi,8), %edi
xorl %r9d, %r9d
movl %r8d, %edx
subl 0x20(%rsp,%r9,8), %edx
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
cltd
idivl %ecx
addl %edx, %edi
incq %r9
cmpq $0xa, %r9
jne 0x33ad
movl %edi, 0x24(%rsp,%rsi,8)
incq %rsi
cmpq $0xa, %rsi
jne 0x33a1
movl $0x4, %r12d
movss 0x1d6b(%rip), %xmm2     # 0x5150
xorps %xmm0, %xmm0
cvtsi2ssl 0x20(%rsp,%r12), %xmm0
movss 0x8(%r14), %xmm1
mulss %xmm2, %xmm1
ucomiss %xmm1, %xmm0
movq (%r15), %r13
jbe 0x3425
decq 0x80(%r14)
movq %r15, %rdi
callq 0x22d0
movl $0x18, %esi
movq %r15, %rdi
callq 0x21c0
movss 0x1d2b(%rip), %xmm2     # 0x5150
addq $0x8, %r12
movq %r13, %r15
cmpq $0x54, %r12
jne 0x33e5
movq (%rbx), %r15
cmpq %rbx, %r15
je 0x3484
leaq 0xa0(%r14), %rbx
movl $0x18, %edi
callq 0x21b0
movl 0x10(%r15), %ecx
movl %ecx, 0x10(%rax)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2060
incq 0xb0(%r14)
movq 0x70(%r14), %rbx
decq 0x80(%r14)
movq %rbx, %rdi
callq 0x22d0
movl $0x18, %esi
movq %rbx, %rdi
callq 0x21c0
cmpq $0xa, 0x98(%r14)
jb 0x362c
leaq 0x88(%r14), %rbx
movq (%rbx), %r15
cmpq %rbx, %r15
je 0x34ba
leaq 0x20(%rsp), %rax
movq %r15, %rcx
movl 0x10(%rcx), %edx
movl %edx, (%rax)
movq (%rcx), %rcx
addq $0x8, %rax
cmpq %rbx, %rcx
jne 0x34a9
movdqa 0x1bfe(%rip), %xmm0     # 0x50c0
movl $0xc, %eax
movdqa 0x1c01(%rip), %xmm1     # 0x50d0
movdqa 0x1c09(%rip), %xmm2     # 0x50e0
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
movdqa 0x1c0c(%rip), %xmm4     # 0x50f0
movdqa %xmm0, %xmm5
pxor %xmm1, %xmm5
movdqa %xmm2, %xmm6
pcmpgtd %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pcmpeqd %xmm3, %xmm5
pand %xmm6, %xmm5
movd %xmm5, %ecx
testb $0x1, %cl
je 0x3512
movl $0x0, 0x18(%rsp,%rax)
pextrw $0x4, %xmm5, %ecx
testb $0x1, %cl
je 0x3524
movl $0x0, 0x20(%rsp,%rax)
paddq %xmm4, %xmm0
addq $0x10, %rax
cmpq $0x5c, %rax
jne 0x34e4
movss 0x8(%r14), %xmm0
mulss 0x1c0c(%rip), %xmm0     # 0x514c
cvttss2si %xmm0, %ecx
xorl %esi, %esi
movl 0x20(%rsp,%rsi,8), %r8d
movl 0x24(%rsp,%rsi,8), %edi
xorl %r9d, %r9d
movl %r8d, %edx
subl 0x20(%rsp,%r9,8), %edx
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
cltd
idivl %ecx
addl %edx, %edi
incq %r9
cmpq $0xa, %r9
jne 0x3552
movl %edi, 0x24(%rsp,%rsi,8)
incq %rsi
cmpq $0xa, %rsi
jne 0x3546
movl $0x4, %r12d
movss 0x1bc6(%rip), %xmm2     # 0x5150
xorps %xmm0, %xmm0
cvtsi2ssl 0x20(%rsp,%r12), %xmm0
movss 0x8(%r14), %xmm1
mulss %xmm2, %xmm1
ucomiss %xmm1, %xmm0
movq (%r15), %r13
jbe 0x35ca
decq 0x98(%r14)
movq %r15, %rdi
callq 0x22d0
movl $0x18, %esi
movq %r15, %rdi
callq 0x21c0
movss 0x1b86(%rip), %xmm2     # 0x5150
addq $0x8, %r12
movq %r13, %r15
cmpq $0x54, %r12
jne 0x358a
movq (%rbx), %r15
cmpq %rbx, %r15
je 0x362c
leaq 0xb8(%r14), %rbx
movl $0x18, %edi
callq 0x21b0
movl 0x10(%r15), %ecx
movl %ecx, 0x10(%rax)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2060
incq 0xc8(%r14)
movq 0x88(%r14), %rbx
decq 0x98(%r14)
movq %rbx, %rdi
callq 0x22d0
movl $0x18, %esi
movq %rbx, %rdi
callq 0x21c0
cmpq $0x2, 0xc8(%r14)
jb 0x3bc1
movq 0xb8(%r14), %rax
xorps %xmm0, %xmm0
cvtss2sd 0x8(%r14), %xmm0
mulsd 0x1abe(%rip), %xmm0     # 0x5110
divsd 0x1abe(%rip), %xmm0     # 0x5118
addsd 0x1abe(%rip), %xmm0     # 0x5120
movl 0x10(%rax), %ebx
cvttsd2si %xmm0, %eax
subl %eax, %ebx
movq 0x4956(%rip), %r15      # 0x7fc8
leaq 0x1adb(%rip), %rsi      # 0x5154
movl $0x5, %edx
movq %r15, %rdi
callq 0x21f0
movq %r15, %rdi
movl %ebx, %esi
callq 0x2300
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movl 0x4(%r14), %ecx
cmpl %ecx, %ebx
jle 0x394a
leaq 0x10(%r14), %r15
movslq %ebx, %rax
negq %rax
movq %rax, 0x18(%rsp)
movq 0x48ec(%rip), %r13      # 0x7fc8
movq %r15, 0x8(%rsp)
movl %ebx, %eax
subl %ecx, %eax
movss 0x8(%r14), %xmm0
mulss 0x1a59(%rip), %xmm0     # 0x514c
cvttss2si %xmm0, %ecx
cltd
idivl %ecx
movl %edx, %r15d
movl $0x5, %edx
movq %r13, %rdi
leaq 0x1a4e(%rip), %rsi      # 0x515a
callq 0x21f0
movl 0x4(%r14), %esi
movq %r13, %rdi
callq 0x2300
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movl $0x5, %edx
movq %r13, %rdi
leaq 0x1a0a(%rip), %rsi      # 0x5160
callq 0x21f0
movq %r13, %rdi
movl %r15d, %esi
callq 0x2300
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
testl %r15d, %r15d
je 0x37cc
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movslq %r15d, %rax
movq %rsi, %rdx
jle 0x37af
movq (%rdx), %rdx
decq %rax
jne 0x37a5
jmp 0x37b8
movq 0x8(%rdx), %rdx
incq %rax
jne 0x37af
movq 0x10(%rsp), %rdi
callq 0x3c20
addl 0x4(%r14), %r15d
movl %r15d, 0x4(%r14)
jmp 0x37d0
movl 0x4(%r14), %r15d
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl %ebx, %ebp
subl %r15d, %ebp
movss 0x8(%r14), %xmm0
mulss 0x1958(%rip), %xmm0     # 0x514c
cvttss2si %xmm0, %eax
cmpl %eax, %ebp
jge 0x386c
movl $0x5, %edx
movq %r13, %rdi
leaq 0x195b(%rip), %rsi      # 0x5166
callq 0x21f0
movq %r13, %rdi
movl %ebp, %esi
callq 0x2300
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq 0x10(%rsp), %rax
movq (%rax), %rsi
testl %ebp, %ebp
jle 0x38fd
movslq %r15d, %rax
addq 0x18(%rsp), %rax
movq %rsi, %rdx
movq (%rdx), %rdx
incq %rax
jne 0x385f
jmp 0x3919
movq 0x10(%rsp), %rcx
movq (%rcx), %rbp
testl %eax, %eax
jle 0x38c2
xorl %r15d, %r15d
leaq 0x10(%rbp), %rdx
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x3896
movb (%rdx), %al
movb %al, (%rsi)
incq 0x28(%rsp)
jmp 0x38a0
leaq 0x20(%rsp), %rdi
callq 0x3cae
incl %r15d
movq (%rbp), %rbp
movss 0x8(%r14), %xmm0
mulss 0x1897(%rip), %xmm0     # 0x514c
cvttss2si %xmm0, %eax
cmpl %eax, %r15d
jl 0x387b
movl 0x4(%r14), %r15d
addl %eax, %r15d
movl %r15d, 0x4(%r14)
movq 0x8(%rsp), %r15
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
callq 0x3da0
movq %rax, %rdi
movq %r15, %rsi
callq 0x2060
incq 0x20(%r14)
movq 0x40(%r14), %rsi
movq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x3c20
jmp 0x3927
movq %rsi, %rdx
cmpl %r15d, %ebx
je 0x3919
movslq %r15d, %rax
addq 0x18(%rsp), %rax
movq %rsi, %rdx
movq 0x8(%rdx), %rdx
decq %rax
jne 0x3910
movq 0x10(%rsp), %rdi
callq 0x3c20
addl %ebp, 0x4(%r14)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x393e
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movl 0x4(%r14), %ecx
cmpl %ecx, %ebx
jg 0x36e1
movq 0xb8(%r14), %r15
decq 0xc8(%r14)
movq %r15, %rdi
callq 0x22d0
movl $0x18, %esi
movq %r15, %rdi
callq 0x21c0
movq 0xb8(%r14), %rax
movl 0x10(%rax), %r12d
xorps %xmm0, %xmm0
cvtss2sd 0x8(%r14), %xmm0
mulsd 0x1787(%rip), %xmm0     # 0x5110
divsd 0x1787(%rip), %xmm0     # 0x5118
addsd 0x1787(%rip), %xmm0     # 0x5120
cvttsd2si %xmm0, %eax
addl %eax, %ebx
subl %ebx, %r12d
movq 0x461f(%rip), %rbx      # 0x7fc8
leaq 0x17bc(%rip), %rsi      # 0x516c
movl $0x8, %edx
movq %rbx, %rdi
callq 0x21f0
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2300
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
xorps %xmm0, %xmm0
cvtsi2ss %r12d, %xmm0
movss 0x8(%r14), %xmm1
mulss 0x1744(%rip), %xmm1     # 0x514c
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x1728(%rip), %xmm0     # 0x5140
cvttsd2si %xmm0, %ebp
leaq 0x1752(%rip), %rsi      # 0x5175
movl $0x8, %edx
movq %rbx, %rdi
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2300
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq 0x1713(%rip), %rsi      # 0x517e
movl $0x6, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x2300
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movl %ebp, 0x18(%rsp)
testl %ebp, %ebp
jle 0x3bc1
leaq 0x10(%r14), %r15
xorl %ebx, %ebx
leaq 0x20(%rsp), %r13
xorl %ebp, %ebp
movq %r15, 0x80(%rsp)
movl %ebx, 0x8(%rsp)
movq 0x40(%r14), %rbx
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movss 0x8(%r14), %xmm0
mulss 0x1654(%rip), %xmm0     # 0x514c
cvttss2si %xmm0, %eax
testl %eax, %eax
jle 0x3b6b
xorl %r15d, %r15d
leal (%r15,%rbp), %eax
cmpl %r12d, %eax
jge 0x3b27
leaq 0x10(%rbx), %rdx
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x3b3b
movb (%rdx), %al
movb %al, (%rsi)
incq 0x28(%rsp)
jmp 0x3b43
movb $0x0, 0x7(%rsp)
movq %r13, %rdi
leaq 0x7(%rsp), %rsi
callq 0x3e68
jmp 0x3b46
movq %r13, %rdi
callq 0x3cae
movq (%rbx), %rbx
incl %r15d
movss 0x8(%r14), %xmm0
mulss 0x15f5(%rip), %xmm0     # 0x514c
cvttss2si %xmm0, %eax
cmpl %eax, %r15d
jl 0x3b03
addl %r15d, %ebp
movq 0x80(%rsp), %r15
addl %eax, 0x4(%r14)
movq %r15, %rdi
movq %r13, %rsi
callq 0x3da0
movq %rax, %rdi
movq %r15, %rsi
callq 0x2060
incq 0x20(%r14)
movq 0x40(%r14), %rsi
movq 0x10(%rsp), %rdi
movq %rbx, %rdx
callq 0x3c20
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
movl 0x8(%rsp), %ebx
je 0x3bb5
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
incl %ebx
cmpl 0x18(%rsp), %ebx
jne 0x3acf
movq 0x78(%rsp), %rdi
callq 0x3c02
jmp 0x3bd5
jmp 0x3bd5
jmp 0x3bd5
jmp 0x3bd5
jmp 0x3bd5
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3bef
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x2310
nop