// File: /workspace/github_c_makefile_star2_O1/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 0x3013
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 0x2ff2
movq %r15, 0x78(%rsp)
leaq 0x40(%r14), %r15
movl $0x18, %edi
callq 0x21b0
movb %bl, 0x10(%rax)
movq %rax, %rdi
movq %r15, 0x8(%rsp)
movq %r15, %rsi
callq 0x2060
incq 0x50(%r14)
incl (%r14)
leaq 0x58(%r14), %r12
movl $0x18, %edi
callq 0x21b0
cmpb $0x41, %bl
setge 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x2060
movq 0x68(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x68(%r14)
movq %rcx, %xmm0
punpckldq 0x2017(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x201f(%rip), %xmm0     # 0x50a0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
cvtss2sd 0x8(%r14), %xmm1
mulsd 0x2079(%rip), %xmm1     # 0x5110
addsd %xmm0, %xmm2
movapd %xmm1, %xmm0
divsd 0x2071(%rip), %xmm0     # 0x5118
movsd 0x2071(%rip), %xmm3     # 0x5120
addsd %xmm0, %xmm3
ucomisd %xmm3, %xmm2
jbe 0x3157
movq (%r12), %r15
xorl %ebp, %ebp
movl $0x0, %ebx
cmpq %r12, %r15
je 0x320a
movsbl 0x10(%r15), %r8d
movl $0x1, %ecx
xorl %esi, %esi
xorl %edi, %edi
xorl %r11d, %r11d
xorl %edx, %edx
xorl %r10d, %r10d
movq %r15, %r9
movsbl 0x10(%r9), %ebx
cmpl %ebx, %r8d
je 0x3117
movzbl %r10b, %r13d
andb $0x1, %r10b
testl %r8d, %r8d
movzbl %r10b, %r10d
cmovel %ecx, %r13d
cmovel %r8d, %r10d
addl %r10d, %edi
xorl %r11d, %r11d
movl %r13d, %r10d
movl %ebx, %r8d
testb $0x1, %r10b
je 0x3127
testb %bl, %bl
je 0x3125
incl %ebp
jmp 0x3127
incl %esi
testb $0x1, %r10b
je 0x3136
cmpl $0xe, %r11d
jg 0x314e
incl %r11d
cmpl $0x7, %edi
je 0x3160
movl %r10d, %ebx
andb $0x1, %bl
movzbl %bl, %ebx
addl %ebx, %edx
movq (%r9), %r9
cmpq %r12, %r9
jne 0x30ea
xorl %ebp, %ebp
xorl %ebx, %ebx
jmp 0x320a
xorl %ebp, %ebp
xorl %ebx, %ebx
jmp 0x3223
xorps %xmm2, %xmm2
cvtsi2ss %ebp, %xmm2
cvtsi2ss %esi, %xmm4
xorps %xmm3, %xmm3
cvtsi2sd %edx, %xmm3
divss %xmm4, %xmm2
divsd 0x1faa(%rip), %xmm1     # 0x5128
addsd %xmm3, %xmm1
andpd 0x1f26(%rip), %xmm1     # 0x50b0
movss 0xc(%r14), %xmm4
movss 0x1fb0(%rip), %xmm5     # 0x5148
addss %xmm4, %xmm5
cvtss2sd %xmm5, %xmm5
ucomisd %xmm1, %xmm5
jbe 0x31cb
xorps %xmm1, %xmm1
cvtss2sd %xmm2, %xmm1
cvtss2sd %xmm4, %xmm6
mulsd 0x1f77(%rip), %xmm6     # 0x5130
addsd 0x1f77(%rip), %xmm6     # 0x5138
ucomisd %xmm6, %xmm1
jbe 0x31cb
movb $0x1, %bl
jmp 0x31cd
xorl %ebx, %ebx
subsd %xmm0, %xmm3
andpd 0x1ed7(%rip), %xmm3     # 0x50b0
ucomisd %xmm3, %xmm5
jbe 0x3208
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm4, %xmm1
mulsd 0x1f3b(%rip), %xmm1     # 0x5130
addsd 0x1f3b(%rip), %xmm1     # 0x5138
ucomisd %xmm1, %xmm0
jbe 0x3208
movb $0x1, %bpl
jmp 0x320a
xorl %ebp, %ebp
movq %rax, 0x68(%r14)
movq %r15, %rdi
callq 0x22d0
movl $0x18, %esi
movq %r15, %rdi
callq 0x21c0
testb %bl, %bl
je 0x3262
leaq 0x70(%r14), %rbx
cmpq %rbx, 0x70(%r14)
je 0x3240
movl (%r14), %eax
movq 0x78(%r14), %rcx
subl 0x10(%rcx), %eax
cmpl $0x6f, %eax
jl 0x3262
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 0x32ab
leaq 0x88(%r14), %rbx
cmpq %rbx, 0x88(%r14)
je 0x3289
movl (%r14), %eax
movq 0x90(%r14), %rcx
subl 0x10(%rcx), %eax
cmpl $0x6f, %eax
jl 0x32ab
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 0x344d
leaq 0x70(%r14), %rbx
movq (%rbx), %r15
cmpq %rbx, %r15
je 0x32de
leaq 0x20(%rsp), %rax
movq %r15, %rcx
movl 0x10(%rcx), %edx
movl %edx, (%rax)
movq (%rcx), %rcx
addq $0x8, %rax
cmpq %rbx, %rcx
jne 0x32cd
movdqa 0x1dda(%rip), %xmm0     # 0x50c0
movl $0xc, %eax
movdqa 0x1ddd(%rip), %xmm1     # 0x50d0
movdqa 0x1de5(%rip), %xmm2     # 0x50e0
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
movdqa 0x1de8(%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 0x3336
movl $0x0, 0x18(%rsp,%rax)
pextrw $0x4, %xmm5, %ecx
testb $0x1, %cl
je 0x3348
movl $0x0, 0x20(%rsp,%rax)
paddq %xmm4, %xmm0
addq $0x10, %rax
cmpq $0x5c, %rax
jne 0x3308
movss 0x8(%r14), %xmm0
mulss 0x1de8(%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 0x3376
movl %edi, 0x24(%rsp,%rsi,8)
incq %rsi
cmpq $0xa, %rsi
jne 0x336a
movl $0x4, %r12d
movss 0x1da2(%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 0x33ee
decq 0x80(%r14)
movq %r15, %rdi
callq 0x22d0
movl $0x18, %esi
movq %r15, %rdi
callq 0x21c0
movss 0x1d62(%rip), %xmm2     # 0x5150
addq $0x8, %r12
movq %r13, %r15
cmpq $0x54, %r12
jne 0x33ae
movq (%rbx), %r15
cmpq %rbx, %r15
je 0x344d
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 0x35f5
leaq 0x88(%r14), %rbx
movq (%rbx), %r15
cmpq %rbx, %r15
je 0x3483
leaq 0x20(%rsp), %rax
movq %r15, %rcx
movl 0x10(%rcx), %edx
movl %edx, (%rax)
movq (%rcx), %rcx
addq $0x8, %rax
cmpq %rbx, %rcx
jne 0x3472
movdqa 0x1c35(%rip), %xmm0     # 0x50c0
movl $0xc, %eax
movdqa 0x1c38(%rip), %xmm1     # 0x50d0
movdqa 0x1c40(%rip), %xmm2     # 0x50e0
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
movdqa 0x1c43(%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 0x34db
movl $0x0, 0x18(%rsp,%rax)
pextrw $0x4, %xmm5, %ecx
testb $0x1, %cl
je 0x34ed
movl $0x0, 0x20(%rsp,%rax)
paddq %xmm4, %xmm0
addq $0x10, %rax
cmpq $0x5c, %rax
jne 0x34ad
movss 0x8(%r14), %xmm0
mulss 0x1c43(%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 0x351b
movl %edi, 0x24(%rsp,%rsi,8)
incq %rsi
cmpq $0xa, %rsi
jne 0x350f
movl $0x4, %r12d
movss 0x1bfd(%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 0x3593
decq 0x98(%r14)
movq %r15, %rdi
callq 0x22d0
movl $0x18, %esi
movq %r15, %rdi
callq 0x21c0
movss 0x1bbd(%rip), %xmm2     # 0x5150
addq $0x8, %r12
movq %r13, %r15
cmpq $0x54, %r12
jne 0x3553
movq (%rbx), %r15
cmpq %rbx, %r15
je 0x35f5
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 0x3b8f
movq 0xb8(%r14), %rax
xorps %xmm0, %xmm0
cvtss2sd 0x8(%r14), %xmm0
mulsd 0x1af5(%rip), %xmm0     # 0x5110
divsd 0x1af5(%rip), %xmm0     # 0x5118
addsd 0x1af5(%rip), %xmm0     # 0x5120
movl 0x10(%rax), %ebp
cvttsd2si %xmm0, %eax
subl %eax, %ebp
movq 0x498d(%rip), %rbx      # 0x7fc8
leaq 0x1b12(%rip), %rsi      # 0x5154
movl $0x5, %edx
movq %rbx, %rdi
callq 0x21f0
movq %rbx, %rdi
movl %ebp, %esi
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 0x4(%r14), %ecx
cmpl %ecx, %ebp
jle 0x3918
leaq 0x10(%r14), %r15
movslq %ebp, %rax
negq %rax
movq %rax, 0x10(%rsp)
movl %ebp, %eax
subl %ecx, %eax
movss 0x8(%r14), %xmm0
mulss 0x1a9c(%rip), %xmm0     # 0x514c
cvttss2si %xmm0, %ecx
cltd
idivl %ecx
movl %edx, %r12d
movl $0x5, %edx
movq 0x4902(%rip), %r13      # 0x7fc8
movq %r13, %rdi
leaq 0x1a8a(%rip), %rsi      # 0x515a
callq 0x21f0
movl 0x4(%r14), %esi
movq %r13, %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 $0x5, %edx
movq %r13, %rdi
leaq 0x1a46(%rip), %rsi      # 0x5160
callq 0x21f0
movq %r13, %rdi
movl %r12d, %esi
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
testl %r12d, %r12d
je 0x378a
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movslq %r12d, %rax
movq %rsi, %rdx
jle 0x3773
movq (%rdx), %rdx
decq %rax
jne 0x3769
jmp 0x377c
movq 0x8(%rdx), %rdx
incq %rax
jne 0x3773
movq 0x8(%rsp), %rdi
callq 0x3bee
addl %r12d, 0x4(%r14)
movq %r15, %r13
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movslq 0x4(%r14), %r15
movl %ebp, %r12d
subl %r15d, %r12d
movss 0x8(%r14), %xmm0
movss 0x1996(%rip), %xmm1     # 0x514c
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
cmpl %eax, %r12d
jge 0x383a
movl $0x5, %edx
movq 0x47f9(%rip), %rdi      # 0x7fc8
leaq 0x1990(%rip), %rsi      # 0x5166
callq 0x21f0
movq 0x47e6(%rip), %rdi      # 0x7fc8
movl %r12d, %esi
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
movq 0x8(%rsp), %rax
movq (%rax), %rsi
testl %r12d, %r12d
jle 0x38cb
addq 0x10(%rsp), %r15
movq %rsi, %rdx
movq (%rdx), %rdx
incq %r15
jne 0x382d
jmp 0x38e4
movq 0x40(%r14), %rbx
movss 0x8(%r14), %xmm0
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
testl %eax, %eax
jle 0x3895
xorl %r15d, %r15d
leaq 0x10(%rbx), %rdx
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x386e
movb (%rdx), %al
movb %al, (%rsi)
incq 0x28(%rsp)
jmp 0x3878
leaq 0x20(%rsp), %rdi
callq 0x3c7c
incl %r15d
movq (%rbx), %rbx
movss 0x8(%r14), %xmm0
mulss 0x18c0(%rip), %xmm0     # 0x514c
cvttss2si %xmm0, %eax
cmpl %eax, %r15d
jl 0x3853
addl %eax, 0x4(%r14)
movq %r13, %r15
movq %r13, %rdi
leaq 0x20(%rsp), %rsi
callq 0x3d6e
movq %rax, %rdi
movq %r15, %rsi
callq 0x2060
incq 0x20(%r14)
movq 0x40(%r14), %rsi
movq 0x8(%rsp), %rdi
movq %rbx, %rdx
callq 0x3bee
jmp 0x38f5
movq %rsi, %rdx
cmpl %r15d, %ebp
je 0x38e4
addq 0x10(%rsp), %r15
movq %rsi, %rdx
movq 0x8(%rdx), %rdx
decq %r15
jne 0x38db
movq 0x8(%rsp), %rdi
callq 0x3bee
addl %r12d, 0x4(%r14)
movq %r13, %r15
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x390c
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movl 0x4(%r14), %ecx
cmpl %ecx, %ebp
jg 0x369e
movq 0xb8(%r14), %rbx
decq 0xc8(%r14)
movq %rbx, %rdi
callq 0x22d0
movl $0x18, %esi
movq %rbx, %rdi
callq 0x21c0
movq 0xb8(%r14), %rax
movl 0x10(%rax), %r15d
xorps %xmm0, %xmm0
cvtss2sd 0x8(%r14), %xmm0
mulsd 0x17b9(%rip), %xmm0     # 0x5110
divsd 0x17b9(%rip), %xmm0     # 0x5118
addsd 0x17b9(%rip), %xmm0     # 0x5120
cvttsd2si %xmm0, %eax
addl %eax, %ebp
subl %ebp, %r15d
movq 0x4651(%rip), %rbx      # 0x7fc8
leaq 0x17ee(%rip), %rsi      # 0x516c
movl $0x8, %edx
movq %rbx, %rdi
callq 0x21f0
movq %rbx, %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
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
movss 0x8(%r14), %xmm1
mulss 0x1776(%rip), %xmm1     # 0x514c
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x175a(%rip), %xmm0     # 0x5140
cvttsd2si %xmm0, %ebp
leaq 0x1784(%rip), %rsi      # 0x5175
movl $0x8, %edx
movq %rbx, %rdi
callq 0x21f0
movq %rbx, %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
leaq 0x1745(%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, 0x1c(%rsp)
testl %ebp, %ebp
jle 0x3b8f
leaq 0x10(%r14), %r12
xorl %ebx, %ebx
leaq 0x20(%rsp), %r13
xorl %ebp, %ebp
movq %r12, 0x80(%rsp)
movl %ebx, 0x10(%rsp)
movq 0x40(%r14), %rbx
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movss 0x8(%r14), %xmm0
mulss 0x1686(%rip), %xmm0     # 0x514c
cvttss2si %xmm0, %eax
testl %eax, %eax
jle 0x3b39
xorl %r12d, %r12d
leal (%r12,%rbp), %eax
cmpl %r15d, %eax
jge 0x3af5
leaq 0x10(%rbx), %rdx
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x3b09
movb (%rdx), %al
movb %al, (%rsi)
incq 0x28(%rsp)
jmp 0x3b11
movb $0x0, 0x7(%rsp)
movq %r13, %rdi
leaq 0x7(%rsp), %rsi
callq 0x3e36
jmp 0x3b14
movq %r13, %rdi
callq 0x3c7c
movq (%rbx), %rbx
incl %r12d
movss 0x8(%r14), %xmm0
mulss 0x1627(%rip), %xmm0     # 0x514c
cvttss2si %xmm0, %eax
cmpl %eax, %r12d
jl 0x3ad1
addl %r12d, %ebp
movq 0x80(%rsp), %r12
addl %eax, 0x4(%r14)
movq %r12, %rdi
movq %r13, %rsi
callq 0x3d6e
movq %rax, %rdi
movq %r12, %rsi
callq 0x2060
incq 0x20(%r14)
movq 0x40(%r14), %rsi
movq 0x8(%rsp), %rdi
movq %rbx, %rdx
callq 0x3bee
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
movl 0x10(%rsp), %ebx
je 0x3b83
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
incl %ebx
cmpl 0x1c(%rsp), %ebx
jne 0x3a9d
movq 0x78(%rsp), %rdi
callq 0x3bd0
jmp 0x3ba3
jmp 0x3ba3
jmp 0x3ba3
jmp 0x3ba3
jmp 0x3ba3
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3bbd
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x2310
nop