// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x398, %rsp            # imm = 0x398
movb %sil, %al
movq %rdi, 0x390(%rsp)
movb %al, 0x38f(%rsp)
movq 0x390(%rsp), %rdi
movq %rdi, 0x70(%rsp)
addq $0x28, %rdi
movq %rdi, 0x68(%rsp)
leaq 0x38f(%rsp), %rsi
callq 0x5ac0
movq 0x68(%rsp), %rdi
callq 0x5b00
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq %rcx, %xmm0
movaps 0x5a66(%rip), %xmm1     # 0xa0c0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x5a6a(%rip), %xmm1     # 0xa0d0
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movss 0x8(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x59fa(%rip), %xmm2     # 0xa080
divsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5a2d
movq 0x70(%rsp), %rdi
movb $0x0, 0x38e(%rsp)
addq $0x28, %rdi
callq 0x5b30
movq %rax, 0x380(%rsp)
movq 0x70(%rsp), %rdi
addq $0x28, %rdi
callq 0x5b80
movq %rax, 0x378(%rsp)
leaq 0x380(%rsp), %rdi
leaq 0x378(%rsp), %rsi
callq 0x5b60
testb $0x1, %al
jne 0x46e3
jmp 0x4741
leaq 0x380(%rsp), %rdi
callq 0x5bb0
movsbl (%rax), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movb %al, 0x377(%rsp)
movsbl 0x377(%rsp), %eax
movsbl 0x38e(%rsp), %ecx
cmpl %ecx, %eax
jle 0x4723
movb 0x377(%rsp), %al
movb %al, 0x38e(%rsp)
jmp 0x4725
leaq 0x380(%rsp), %rdi
xorl %esi, %esi
callq 0x5bd0
movq %rax, 0x368(%rsp)
jmp 0x46b2
movq 0x70(%rsp), %rdi
addq $0x40, %rdi
leaq 0x38e(%rsp), %rsi
callq 0x5ac0
movq 0x70(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movsbl 0x38e(%rsp), %eax
cmpl $0x40, %eax
jle 0x477a
movb $0x1, 0x38e(%rsp)
jmp 0x4782
movb $0x0, 0x38e(%rsp)
movq 0x70(%rsp), %rdi
addq $0x58, %rdi
movq %rdi, 0x60(%rsp)
leaq 0x38e(%rsp), %rsi
callq 0x5ac0
movq 0x60(%rsp), %rdi
movb $0x0, 0x367(%rsp)
movb $0x0, 0x366(%rsp)
callq 0x5b00
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq %rcx, %xmm0
movaps 0x58f5(%rip), %xmm1     # 0xa0c0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x58f9(%rip), %xmm1     # 0xa0d0
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movss 0x8(%rax), %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0x58a1(%rip), %xmm1     # 0xa098
mulsd %xmm2, %xmm1
movsd 0x588d(%rip), %xmm2     # 0xa090
divsd %xmm2, %xmm1
movsd 0x5879(%rip), %xmm2     # 0xa088
addsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4b70
movq 0x70(%rsp), %rdi
addq $0x58, %rdi
callq 0x5b30
movq %rax, 0x358(%rsp)
leaq 0x358(%rsp), %rdi
callq 0x5bb0
movq 0x70(%rsp), %rdi
movsbl (%rax), %eax
movl %eax, 0x360(%rsp)
movl $0x0, 0x354(%rsp)
movl $0x0, 0x350(%rsp)
movl $0x0, 0x34c(%rsp)
movl $0x0, 0x348(%rsp)
movl $0x0, 0x344(%rsp)
movl $0x0, 0x340(%rsp)
movb $0x0, 0x33f(%rsp)
addq $0x58, %rdi
callq 0x5b30
movq %rax, 0x330(%rsp)
movq 0x70(%rsp), %rdi
addq $0x58, %rdi
callq 0x5b80
movq %rax, 0x328(%rsp)
leaq 0x330(%rsp), %rdi
leaq 0x328(%rsp), %rsi
callq 0x5b60
testb $0x1, %al
jne 0x48de
jmp 0x4b62
leaq 0x330(%rsp), %rdi
callq 0x5bb0
movsbl (%rax), %eax
cmpl 0x360(%rsp), %eax
je 0x495b
cmpl $0x0, 0x360(%rsp)
jne 0x491c
movl 0x344(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x344(%rsp)
movb $0x1, 0x33f(%rsp)
jmp 0x4939
testb $0x1, 0x33f(%rsp)
je 0x4937
movl 0x34c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34c(%rsp)
jmp 0x4939
leaq 0x330(%rsp), %rdi
callq 0x5bb0
movsbl (%rax), %eax
movl %eax, 0x360(%rsp)
movl $0x0, 0x348(%rsp)
testb $0x1, 0x33f(%rsp)
je 0x49a0
leaq 0x330(%rsp), %rdi
callq 0x5bb0
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x498d
movl 0x350(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x350(%rsp)
jmp 0x499e
movl 0x354(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x354(%rsp)
jmp 0x49a0
testb $0x1, 0x33f(%rsp)
je 0x49ca
cmpl $0xe, 0x348(%rsp)
jle 0x49b9
jmp 0x4b62
movl 0x348(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x348(%rsp)
cmpl $0x7, 0x34c(%rsp)
jne 0x4b29
movq 0x70(%rsp), %rax
cvtsi2ssl 0x354(%rsp), %xmm0
cvtsi2ssl 0x350(%rsp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, 0x324(%rsp)
cvtsi2sdl 0x340(%rsp), %xmm0
movss 0x8(%rax), %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0x5682(%rip), %xmm1     # 0xa098
mulsd %xmm2, %xmm1
movsd 0x567e(%rip), %xmm2     # 0xa0a0
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
callq 0x5c00
movq 0x70(%rsp), %rax
movaps %xmm0, %xmm1
movss 0x56b1(%rip), %xmm0     # 0xa0f0
addss 0xc(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x4a8f
movq 0x70(%rsp), %rax
movss 0x324(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0xc(%rax), %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0x563f(%rip), %xmm1     # 0xa0b0
divsd %xmm1, %xmm2
movsd 0x562b(%rip), %xmm1     # 0xa0a8
subsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4a8f
movb $0x1, 0x367(%rsp)
movq 0x70(%rsp), %rax
cvtsi2sdl 0x340(%rsp), %xmm0
movss 0x8(%rax), %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0x55ea(%rip), %xmm1     # 0xa098
mulsd %xmm2, %xmm1
movsd 0x55d6(%rip), %xmm2     # 0xa090
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
callq 0x5c00
movq 0x70(%rsp), %rax
movaps %xmm0, %xmm1
movss 0x5619(%rip), %xmm0     # 0xa0f0
addss 0xc(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x4b27
movq 0x70(%rsp), %rax
movss 0x324(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0xc(%rax), %xmm1
cvtss2sd %xmm1, %xmm2
movsd 0x55a7(%rip), %xmm1     # 0xa0b0
divsd %xmm1, %xmm2
movsd 0x5593(%rip), %xmm1     # 0xa0a8
subsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4b27
movb $0x1, 0x366(%rsp)
jmp 0x4b62
testb $0x1, 0x33f(%rsp)
je 0x4b44
movl 0x340(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x340(%rsp)
jmp 0x4b46
leaq 0x330(%rsp), %rdi
xorl %esi, %esi
callq 0x5bd0
movq %rax, 0x318(%rsp)
jmp 0x48aa
movq 0x70(%rsp), %rdi
addq $0x58, %rdi
callq 0x5c20
xorl %eax, %eax
testb $0x1, 0x367(%rsp)
movb %al, 0x5f(%rsp)
je 0x4bdf
movq 0x70(%rsp), %rdi
addq $0x70, %rdi
callq 0x5c50
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, 0x5e(%rsp)
jne 0x4bd7
movq 0x70(%rsp), %rsi
movl (%rsi), %eax
movl %eax, 0x58(%rsp)
addq $0x70, %rsi
leaq 0x310(%rsp), %rdi
callq 0x5c70
leaq 0x310(%rsp), %rdi
callq 0x5cc0
movq %rax, %rcx
movl 0x58(%rsp), %eax
subl (%rcx), %eax
cmpl $0x6e, %eax
setg %al
movb %al, 0x5e(%rsp)
movb 0x5e(%rsp), %al
movb %al, 0x5f(%rsp)
movb 0x5f(%rsp), %al
testb $0x1, %al
jne 0x4be9
jmp 0x4bfa
movq 0x70(%rsp), %rsi
movq %rsi, %rdi
addq $0x70, %rdi
callq 0x5cf0
xorl %eax, %eax
testb $0x1, 0x366(%rsp)
movb %al, 0x57(%rsp)
je 0x4c6f
movq 0x70(%rsp), %rdi
addq $0x88, %rdi
callq 0x5c50
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, 0x56(%rsp)
jne 0x4c67
movq 0x70(%rsp), %rsi
movl (%rsi), %eax
movl %eax, 0x50(%rsp)
addq $0x88, %rsi
leaq 0x308(%rsp), %rdi
callq 0x5c70
leaq 0x308(%rsp), %rdi
callq 0x5cc0
movq %rax, %rcx
movl 0x50(%rsp), %eax
subl (%rcx), %eax
cmpl $0x6e, %eax
setg %al
movb %al, 0x56(%rsp)
movb 0x56(%rsp), %al
movb %al, 0x57(%rsp)
movb 0x57(%rsp), %al
testb $0x1, %al
jne 0x4c79
jmp 0x4c8d
movq 0x70(%rsp), %rsi
movq %rsi, %rdi
addq $0x88, %rdi
callq 0x5cf0
movq 0x70(%rsp), %rdi
addq $0x70, %rdi
callq 0x5d30
cmpq $0xa, %rax
jb 0x4f4f
movq 0x70(%rsp), %rdi
movl $0x0, 0x2ac(%rsp)
addq $0x70, %rdi
callq 0x5d60
movq %rax, 0x2a0(%rsp)
movq 0x70(%rsp), %rdi
addq $0x70, %rdi
callq 0x5db0
movq %rax, 0x298(%rsp)
leaq 0x2a0(%rsp), %rdi
leaq 0x298(%rsp), %rsi
callq 0x5d90
testb $0x1, %al
jne 0x4cf7
jmp 0x4d3f
leaq 0x2a0(%rsp), %rdi
callq 0x5de0
movl (%rax), %ecx
movslq 0x2ac(%rsp), %rax
movl %ecx, 0x2b0(%rsp,%rax,8)
leaq 0x2a0(%rsp), %rdi
xorl %esi, %esi
callq 0x5e00
movq %rax, 0x290(%rsp)
movl 0x2ac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2ac(%rsp)
jmp 0x4cc6
movl $0x0, 0x28c(%rsp)
cmpl $0xa, 0x28c(%rsp)
jge 0x4d7a
movslq 0x28c(%rsp), %rax
movl $0x0, 0x2b4(%rsp,%rax,8)
movl 0x28c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28c(%rsp)
jmp 0x4d4a
movl $0x0, 0x288(%rsp)
cmpl $0xa, 0x288(%rsp)
jge 0x4e2b
movl $0x0, 0x284(%rsp)
cmpl $0xa, 0x284(%rsp)
jge 0x4e13
movq 0x70(%rsp), %rcx
movslq 0x288(%rsp), %rax
movl 0x2b0(%rsp,%rax,8), %eax
movslq 0x284(%rsp), %rdx
subl 0x2b0(%rsp,%rdx,8), %eax
movl %eax, %edx
negl %edx
cmovnsl %edx, %eax
movss 0x8(%rcx), %xmm0
movss 0x5315(%rip), %xmm1     # 0xa0f4
divss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
cltd
idivl %ecx
movslq 0x288(%rsp), %rax
addl 0x2b4(%rsp,%rax,8), %edx
movl %edx, 0x2b4(%rsp,%rax,8)
movl 0x284(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x284(%rsp)
jmp 0x4d9e
jmp 0x4e15
movl 0x288(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x288(%rsp)
jmp 0x4d85
movq 0x70(%rsp), %rdi
addq $0x70, %rdi
callq 0x5d60
movq %rax, 0x278(%rsp)
movl $0x0, 0x274(%rsp)
cmpl $0xa, 0x274(%rsp)
jge 0x4f04
movq 0x70(%rsp), %rax
movslq 0x274(%rsp), %rcx
cvtsi2ssl 0x2b4(%rsp,%rcx,8), %xmm0
movss 0x8(%rax), %xmm1
movss 0x527f(%rip), %xmm2     # 0xa0fc
divss %xmm2, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x4ed5
movq 0x70(%rsp), %rax
addq $0x70, %rax
movq %rax, 0x48(%rsp)
leaq 0x260(%rsp), %rdi
leaq 0x278(%rsp), %rsi
callq 0x5e80
movq 0x48(%rsp), %rdi
movq 0x260(%rsp), %rsi
callq 0x5e30
movq %rax, 0x268(%rsp)
movq 0x268(%rsp), %rax
movq %rax, 0x278(%rsp)
jmp 0x4eec
leaq 0x278(%rsp), %rdi
xorl %esi, %esi
callq 0x5e00
movq %rax, 0x258(%rsp)
jmp 0x4eee
movl 0x274(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x274(%rsp)
jmp 0x4e4c
movq 0x70(%rsp), %rdi
addq $0x70, %rdi
callq 0x5c50
testb $0x1, %al
jne 0x4f4d
movq 0x70(%rsp), %rdi
movq %rdi, %rax
addq $0xa0, %rax
movq %rax, 0x40(%rsp)
addq $0x70, %rdi
callq 0x5ea0
movq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0x5cf0
movq 0x70(%rsp), %rdi
addq $0x70, %rdi
callq 0x5ed0
jmp 0x4f4f
movq 0x70(%rsp), %rdi
addq $0x88, %rdi
callq 0x5d30
cmpq $0xa, %rax
jb 0x5228
movq 0x70(%rsp), %rdi
movl $0x0, 0x1fc(%rsp)
addq $0x88, %rdi
callq 0x5d60
movq %rax, 0x1f0(%rsp)
movq 0x70(%rsp), %rdi
addq $0x88, %rdi
callq 0x5db0
movq %rax, 0x1e8(%rsp)
leaq 0x1f0(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x5d90
testb $0x1, %al
jne 0x4fc2
jmp 0x500a
leaq 0x1f0(%rsp), %rdi
callq 0x5de0
movl (%rax), %ecx
movslq 0x1fc(%rsp), %rax
movl %ecx, 0x200(%rsp,%rax,8)
leaq 0x1f0(%rsp), %rdi
xorl %esi, %esi
callq 0x5e00
movq %rax, 0x1e0(%rsp)
movl 0x1fc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1fc(%rsp)
jmp 0x4f8e
movl $0x0, 0x1dc(%rsp)
cmpl $0xa, 0x1dc(%rsp)
jge 0x5045
movslq 0x1dc(%rsp), %rax
movl $0x0, 0x204(%rsp,%rax,8)
movl 0x1dc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1dc(%rsp)
jmp 0x5015
movl $0x0, 0x1d8(%rsp)
cmpl $0xa, 0x1d8(%rsp)
jge 0x50f6
movl $0x0, 0x1d4(%rsp)
cmpl $0xa, 0x1d4(%rsp)
jge 0x50de
movq 0x70(%rsp), %rcx
movslq 0x1d8(%rsp), %rax
movl 0x200(%rsp,%rax,8), %eax
movslq 0x1d4(%rsp), %rdx
subl 0x200(%rsp,%rdx,8), %eax
movl %eax, %edx
negl %edx
cmovnsl %edx, %eax
movss 0x8(%rcx), %xmm0
movss 0x504a(%rip), %xmm1     # 0xa0f4
divss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
cltd
idivl %ecx
movslq 0x1d8(%rsp), %rax
addl 0x204(%rsp,%rax,8), %edx
movl %edx, 0x204(%rsp,%rax,8)
movl 0x1d4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1d4(%rsp)
jmp 0x5069
jmp 0x50e0
movl 0x1d8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1d8(%rsp)
jmp 0x5050
movq 0x70(%rsp), %rdi
addq $0x88, %rdi
callq 0x5d60
movq %rax, 0x1c8(%rsp)
movl $0x0, 0x1c4(%rsp)
cmpl $0xa, 0x1c4(%rsp)
jge 0x51d4
movq 0x70(%rsp), %rax
movslq 0x1c4(%rsp), %rcx
cvtsi2ssl 0x204(%rsp,%rcx,8), %xmm0
movss 0x8(%rax), %xmm1
movss 0x4fb1(%rip), %xmm2     # 0xa0fc
divss %xmm2, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x51a5
movq 0x70(%rsp), %rax
addq $0x88, %rax
movq %rax, 0x38(%rsp)
leaq 0x1b0(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
callq 0x5e80
movq 0x38(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
callq 0x5e30
movq %rax, 0x1b8(%rsp)
movq 0x1b8(%rsp), %rax
movq %rax, 0x1c8(%rsp)
jmp 0x51bc
leaq 0x1c8(%rsp), %rdi
xorl %esi, %esi
callq 0x5e00
movq %rax, 0x1a8(%rsp)
jmp 0x51be
movl 0x1c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c4(%rsp)
jmp 0x511a
movq 0x70(%rsp), %rdi
addq $0x88, %rdi
callq 0x5c50
testb $0x1, %al
jne 0x5226
movq 0x70(%rsp), %rdi
movq %rdi, %rax
addq $0xb8, %rax
movq %rax, 0x30(%rsp)
addq $0x88, %rdi
callq 0x5ea0
movq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x5cf0
movq 0x70(%rsp), %rdi
addq $0x88, %rdi
callq 0x5ed0
jmp 0x5228
movq 0x70(%rsp), %rdi
addq $0xb8, %rdi
callq 0x5d30
cmpq $0x2, %rax
jb 0x5a1f
movq 0x70(%rsp), %rdi
addq $0xb8, %rdi
callq 0x5ea0
movq 0x70(%rsp), %rcx
movl (%rax), %eax
movss 0x8(%rcx), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x4e2c(%rip), %xmm0     # 0xa098
mulsd %xmm1, %xmm0
movsd 0x4e18(%rip), %xmm1     # 0xa090
divsd %xmm1, %xmm0
movsd 0x4e04(%rip), %xmm1     # 0xa088
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
subl %ecx, %eax
movl %eax, 0x1a4(%rsp)
movq 0x9d2c(%rip), %rdi      # 0xefc8
leaq 0x4e5d(%rip), %rsi      # 0xa100
callq 0x3220
movq %rax, %rdi
movl 0x1a4(%rsp), %esi
callq 0x3420
movq %rax, %rdi
movq 0x9cf7(%rip), %rsi      # 0xefb8
callq 0x3260
movq 0x70(%rsp), %rcx
movl 0x1a4(%rsp), %eax
cmpl 0x4(%rcx), %eax
jle 0x56db
movq 0x70(%rsp), %rcx
movl 0x1a4(%rsp), %eax
subl 0x4(%rcx), %eax
movss 0x8(%rcx), %xmm0
movss 0x4dfd(%rip), %xmm1     # 0xa0f4
divss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
cltd
idivl %ecx
movl %edx, 0x1a0(%rsp)
movq 0x9cb8(%rip), %rdi      # 0xefc8
leaq 0x4def(%rip), %rsi      # 0xa106
callq 0x3220
movq %rax, %rdi
movq 0x70(%rsp), %rax
movl 0x4(%rax), %esi
callq 0x3420
movq %rax, %rdi
movq 0x9c82(%rip), %rsi      # 0xefb8
callq 0x3260
movq 0x9c86(%rip), %rdi      # 0xefc8
leaq 0x4dc3(%rip), %rsi      # 0xa10c
callq 0x3220
movq %rax, %rdi
movl 0x1a0(%rsp), %esi
callq 0x3420
movq %rax, %rdi
movq 0x9c51(%rip), %rsi      # 0xefb8
callq 0x3260
cmpl $0x0, 0x1a0(%rsp)
je 0x5427
movq 0x70(%rsp), %rdi
addq $0x40, %rdi
callq 0x5b30
movq %rax, 0x198(%rsp)
movl 0x1a0(%rsp), %esi
leaq 0x198(%rsp), %rdi
callq 0x5f00
movq 0x70(%rsp), %rdi
movq %rdi, %rax
addq $0x40, %rax
movq %rax, 0x28(%rsp)
addq $0x40, %rdi
callq 0x5b30
movq %rax, 0x188(%rsp)
leaq 0x190(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x5fe0
leaq 0x180(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0x5fe0
movq 0x28(%rsp), %rdi
movq 0x190(%rsp), %rsi
movq 0x180(%rsp), %rdx
callq 0x5f50
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0x178(%rsp)
movl 0x1a0(%rsp), %ecx
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
leaq 0x160(%rsp), %rdi
callq 0x6000
movq 0x70(%rsp), %rdi
addq $0x40, %rdi
callq 0x5b30
movq 0x70(%rsp), %rcx
movq %rax, 0x158(%rsp)
movl 0x1a4(%rsp), %eax
subl 0x4(%rcx), %eax
movss 0x8(%rcx), %xmm0
movss 0x4c8e(%rip), %xmm1     # 0xa0f4
divss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
cmpl %ecx, %eax
jl 0x55bd
movl $0x0, 0x154(%rsp)
movq 0x70(%rsp), %rcx
movl 0x154(%rsp), %eax
movss 0x8(%rcx), %xmm0
movss 0x4c5a(%rip), %xmm1     # 0xa0f4
divss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
cmpl %ecx, %eax
jge 0x5515
leaq 0x158(%rsp), %rdi
callq 0x5bb0
movq %rax, %rsi
leaq 0x160(%rsp), %rdi
callq 0x6010
jmp 0x54c5
leaq 0x158(%rsp), %rdi
xorl %esi, %esi
callq 0x5bd0
movq %rax, 0x138(%rsp)
movl 0x154(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x154(%rsp)
jmp 0x5481
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x148(%rsp)
movl %eax, 0x144(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x60c0
jmp 0x5a2f
movq 0x70(%rsp), %rdi
movss 0x8(%rdi), %xmm0
movss 0x4bd1(%rip), %xmm1     # 0xa0f8
mulss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
movl 0x4(%rdi), %eax
addl %ecx, %eax
movl %eax, 0x4(%rdi)
addq $0x10, %rdi
leaq 0x160(%rsp), %rsi
callq 0x6080
jmp 0x554a
movq 0x70(%rsp), %rdi
movq %rdi, %rax
addq $0x40, %rax
movq %rax, 0x20(%rsp)
addq $0x40, %rdi
callq 0x5b30
movq %rax, 0x128(%rsp)
leaq 0x130(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0x5fe0
leaq 0x120(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x5fe0
movq 0x20(%rsp), %rdi
movq 0x130(%rsp), %rsi
movq 0x120(%rsp), %rdx
callq 0x5f50
movq %rax, 0x118(%rsp)
jmp 0x56c9
movq 0x70(%rsp), %rcx
movl 0x1a4(%rsp), %eax
movl 0x4(%rcx), %ecx
subl %ecx, %eax
movl %eax, 0x114(%rsp)
movq 0x99ec(%rip), %rdi      # 0xefc8
leaq 0x4b2f(%rip), %rsi      # 0xa112
callq 0x3220
movq %rax, 0x18(%rsp)
jmp 0x55ef
movq 0x18(%rsp), %rdi
movl 0x114(%rsp), %esi
callq 0x3420
movq %rax, 0x10(%rsp)
jmp 0x5607
movq 0x10(%rsp), %rdi
movq 0x99a5(%rip), %rsi      # 0xefb8
callq 0x3260
jmp 0x561a
movq 0x70(%rsp), %rdi
addq $0x40, %rdi
callq 0x5b30
movq %rax, 0x108(%rsp)
movl 0x114(%rsp), %esi
leaq 0x108(%rsp), %rdi
callq 0x5f00
jmp 0x5646
movq 0x70(%rsp), %rdi
movq %rdi, %rax
addq $0x40, %rax
movq %rax, 0x8(%rsp)
addq $0x40, %rdi
callq 0x5b30
movq %rax, 0xf8(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x5fe0
leaq 0xf0(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x5fe0
movq 0x8(%rsp), %rdi
movq 0x100(%rsp), %rsi
movq 0xf0(%rsp), %rdx
callq 0x5f50
movq %rax, %rcx
movq 0x70(%rsp), %rax
movq %rcx, 0xe8(%rsp)
movl 0x114(%rsp), %ecx
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
leaq 0x160(%rsp), %rdi
callq 0x60c0
jmp 0x52c6
movq 0x70(%rsp), %rdi
addq $0xb8, %rdi
callq 0x5ed0
movq 0x70(%rsp), %rdi
addq $0xb8, %rdi
callq 0x5ea0
movq 0x70(%rsp), %rcx
movl (%rax), %eax
movss 0x8(%rcx), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x4983(%rip), %xmm0     # 0xa098
mulsd %xmm1, %xmm0
movsd 0x496f(%rip), %xmm1     # 0xa090
divsd %xmm1, %xmm0
movsd 0x495b(%rip), %xmm1     # 0xa088
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
subl %ecx, %eax
movl %eax, 0xe4(%rsp)
movl 0xe4(%rsp), %eax
subl 0x1a4(%rsp), %eax
movl %eax, 0xe0(%rsp)
movq 0x986e(%rip), %rdi      # 0xefc8
leaq 0x49b7(%rip), %rsi      # 0xa118
callq 0x3220
movq %rax, %rdi
movl 0xe0(%rsp), %esi
callq 0x3420
movq %rax, %rdi
movq 0x9839(%rip), %rsi      # 0xefb8
callq 0x3260
movq 0x70(%rsp), %rax
cvtsi2ssl 0xe0(%rsp), %xmm0
movss 0x8(%rax), %xmm1
movss 0x4955(%rip), %xmm2     # 0xa0f4
divss %xmm2, %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x4905(%rip), %xmm1     # 0xa0b8
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0xdc(%rsp)
movq 0x97ff(%rip), %rdi      # 0xefc8
leaq 0x4951(%rip), %rsi      # 0xa121
callq 0x3220
movq %rax, %rdi
movl 0xdc(%rsp), %esi
callq 0x3420
movq %rax, %rdi
movq 0x97ca(%rip), %rsi      # 0xefb8
callq 0x3260
movq 0x97ce(%rip), %rdi      # 0xefc8
leaq 0x4929(%rip), %rsi      # 0xa12a
callq 0x3220
movq %rax, %rdi
movq 0x70(%rsp), %rax
movl 0x4(%rax), %esi
callq 0x3420
movq %rax, %rdi
movq 0x9798(%rip), %rsi      # 0xefb8
callq 0x3260
movl $0x0, 0xd8(%rsp)
movl $0x0, 0xd4(%rsp)
movl 0xd4(%rsp), %eax
cmpl 0xdc(%rsp), %eax
jge 0x5a1d
movq 0x70(%rsp), %rdi
addq $0x40, %rdi
callq 0x5b30
movq %rax, 0xc8(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x6000
movl $0x0, 0xac(%rsp)
movq 0x70(%rsp), %rcx
movl 0xac(%rsp), %eax
movss 0x8(%rcx), %xmm0
movss 0x485e(%rip), %xmm1     # 0xa0f4
divss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
cmpl %ecx, %eax
jge 0x595c
movl 0xd8(%rsp), %eax
cmpl 0xe0(%rsp), %eax
jge 0x5914
leaq 0xc8(%rsp), %rdi
callq 0x5bb0
movq %rax, %rsi
leaq 0xb0(%rsp), %rdi
callq 0x6010
jmp 0x58d5
leaq 0xc8(%rsp), %rdi
xorl %esi, %esi
callq 0x5bd0
movq %rax, 0xa0(%rsp)
jmp 0x5935
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x148(%rsp)
movl %eax, 0x144(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x60c0
jmp 0x5a2f
movb $0x0, 0x9f(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0x9f(%rsp), %rsi
callq 0x6120
jmp 0x5933
jmp 0x5935
movl 0xd8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd8(%rsp)
movl 0xac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xac(%rsp)
jmp 0x587d
movq 0x70(%rsp), %rdi
movss 0x8(%rdi), %xmm0
movss 0x478a(%rip), %xmm1     # 0xa0f8
mulss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
movl 0x4(%rdi), %eax
addl %ecx, %eax
movl %eax, 0x4(%rdi)
addq $0x10, %rdi
leaq 0xb0(%rsp), %rsi
callq 0x6080
jmp 0x5991
movq 0x70(%rsp), %rdi
movq %rdi, %rax
addq $0x40, %rax
movq %rax, (%rsp)
addq $0x40, %rdi
callq 0x5b30
movq %rax, 0x88(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x5fe0
leaq 0x80(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x5fe0
movq (%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0x80(%rsp), %rdx
callq 0x5f50
movq %rax, 0x78(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x60c0
movl 0xd4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd4(%rsp)
jmp 0x583b
jmp 0x5a1f
movq 0x70(%rsp), %rdi
addq $0x28, %rdi
callq 0x5c20
ud2
movq 0x148(%rsp), %rdi
callq 0x3440
nopl (%rax)