// File: /workspace/github_c_makefile_star2_O3/DrYerzinia[P]C_DigiMode/src/filter/filter_test.cpp
// Function: main
int main(int argc, char **argv){

	std::string args;
	for(int i = 0; i < argc; i++) args += std::string(argv[i]) + std::string(" ");
	util::readInArguments(args);

	std::string fn = util::getArgument("-fn");
	std::string filename = "dat/psk/0_5000hz_sweep.raw";
	if(fn.compare("NULL")){
		filename = fn;
	}

	std::string of = util::getArgument("-of");
	std::string output_filename = "dat/data_filtered.raw";
	if(of.compare("NULL")){
		output_filename = of;
	}

	FIR_filter test_filter;

	// filter parameteres ////////////////////////////////////////////////

	std::string ft = util::getArgument("-ft");
	std::string filter_type = "highpass";
	if(filter_type.compare("NULL")){
		filter_type = ft;
	}
	
	int points = 127;
	float low_cutoff_freq = 800;
	float high_cutoff_freq = 900;
	float cutoff_freq = 2500;

	std::string pts = util::getArgument("-pts");
	if(pts.compare("NULL")){
		points = atoi(pts.c_str());
	}
	
	std::string co = util::getArgument("-co");
	if(co.compare("NULL")){
		cutoff_freq = atof(co.c_str());
	}
	
	std::string lco = util::getArgument("-lco");
	if(lco.compare("NULL")){
		low_cutoff_freq = atof(lco.c_str());
	}


	std::string hco = util::getArgument("-hco");
	if(hco.compare("NULL")){
		high_cutoff_freq = atof(hco.c_str());
	}

	test_filter.set_sample_rate(22050);

	// Setup Filter ///////////////////////////////////////////////////////

	if(filter_type.compare("bandpass") == 0){
		test_filter.set_up_bandpass(points, low_cutoff_freq, high_cutoff_freq);
	} else if(filter_type.compare("lowpass") == 0){
		test_filter.set_up_lowpass(points, cutoff_freq);
	} else if(filter_type.compare("highpass") == 0){
		test_filter.set_up_highpass(points, cutoff_freq);
	}  else if(filter_type.compare("bandstop") == 0){
		test_filter.set_up_bandreject(points, low_cutoff_freq, high_cutoff_freq);
	} else if(filter_type.compare("90deg") == 0){
		test_filter.set_up_90deg();
	} else {
		std::cout << "Invalid Filter Type: " << filter_type << std::endl;
		exit(0);
	}

	// Filter Data and Write Data ////////////////////////////////////////

	std::ostream *output_file;
	if(output_filename.compare("stdout") == 0) output_file = &std::cout;
	else output_file = new std::fstream(output_filename.c_str(), std::fstream::out | std::fstream::binary);

	char wbuf[1];
	float max = 0.0001;

	std::istream *data_file;

	if(filename.compare("stdin") == 0){
		data_file = &std::cin;
	} else {
		data_file = new std::fstream(filename.c_str(), std::fstream::in | std::fstream::binary);

		if(!((std::fstream*)data_file)->is_open()){
			std::cout << "Error: couldn't open input file" << std::endl;
			exit(0);
		}
	}

	while(!data_file->eof()){		
		data_file->read(wbuf, 1);
		if(test_filter.proccess_byte(wbuf[0])){
			float dat = test_filter.get_next_datapoint();
			if(max < dat)
				max = dat;
			wbuf[0] = (char) dat*(127/max);
			output_file->write(wbuf, 1);
			output_file->flush();
		}
	}

	if(filename.compare("stdin") != 0) ((std::fstream*)data_file)->close();

	if(output_filename.compare("stdout") != 0){
		((std::fstream*)output_file)->close();
		delete output_file;
	}

	// The End ////////////////////////////////////////////////////////////

	return 0;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rsi, %rbx
leaq 0x80(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq $0x0, -0x8(%rsi)
movb $0x0, (%rsi)
testl %edi, %edi
jle 0x26dc
leaq 0x40(%rsp), %r12
leaq 0xc0(%rsp), %r13
movl %edi, %r15d
xorl %ebp, %ebp
leaq 0x30(%rsp), %r14
movq (%rbx,%rbp,8), %rsi
movq %r14, %rdi
leaq 0x108(%rsp), %rdx
callq 0x331c
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x3b0e(%rip), %rsi      # 0x60ae
leaq 0x3b08(%rip), %rdx      # 0x60af
callq 0x33f0
movq 0x30(%rsp), %rcx
movl $0xf, %edi
cmpq %r12, %rcx
je 0x25c0
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %r8
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0x25f1
movl $0xf, %edi
leaq 0x20(%rsp), %r9
cmpq %r9, %rsi
je 0x25ec
movq 0x20(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x25fb
movq %r14, %rdi
callq 0x20c0
jmp 0x2609
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21f0
movq %r13, 0xb0(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x2632
movq %rdx, 0xb0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc0(%rsp)
jmp 0x263a
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0xb8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
leaq 0x70(%rsp), %rdi
callq 0x20c0
movq 0xb0(%rsp), %rdi
cmpq %r13, %rdi
je 0x2691
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x26ad
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x26c4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21d0
incq %rbp
cmpq %rbp, %r15
jne 0x2576
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
jmp 0x26de
xorl %edx, %edx
leaq 0x298(%rsp), %r14
movq %r14, -0x10(%r14)
addq %rsi, %rdx
leaq 0x288(%rsp), %rdi
callq 0x335a
leaq 0x288(%rsp), %rdi
callq 0x589e
movq 0x288(%rsp), %rdi
cmpq %r14, %rdi
je 0x2724
movq 0x298(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x278(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x38e5(%rip), %rsi      # 0x601c
leaq 0x38e1(%rip), %rdx      # 0x601f
leaq 0x268(%rsp), %rdi
callq 0x33f0
leaq 0x30(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x5844
movq 0x268(%rsp), %rdi
cmpq %r14, %rdi
je 0x277a
movq 0x278(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
movq %rax, (%rdi)
leaq 0x3892(%rip), %rsi      # 0x6020
leaq 0x38a5(%rip), %rdx      # 0x603a
callq 0x33f0
leaq 0x389a(%rip), %rsi      # 0x603b
leaq 0x30(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x27be
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x2130
leaq 0x258(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x386f(%rip), %rsi      # 0x6040
leaq 0x386b(%rip), %rdx      # 0x6043
leaq 0x248(%rsp), %rdi
callq 0x33f0
leaq 0x108(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x5844
movq 0x248(%rsp), %rdi
cmpq %r14, %rdi
je 0x2817
movq 0x258(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0xa0(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x381a(%rip), %rsi      # 0x6044
leaq 0x3828(%rip), %rdx      # 0x6059
leaq 0x90(%rsp), %rdi
callq 0x33f0
leaq 0x37f6(%rip), %rsi      # 0x603b
leaq 0x108(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x286b
leaq 0x90(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x2130
leaq 0xb0(%rsp), %rdi
callq 0x3538
leaq 0x238(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x37cf(%rip), %rsi      # 0x605a
leaq 0x37cb(%rip), %rdx      # 0x605d
leaq 0x228(%rsp), %rdi
callq 0x33f0
leaq 0x2a8(%rsp), %rdi
leaq 0x228(%rsp), %rsi
callq 0x5844
movq 0x228(%rsp), %rdi
cmpq %r14, %rdi
je 0x28d1
movq 0x238(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x60(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x377d(%rip), %rsi      # 0x605e
leaq 0x377e(%rip), %rdx      # 0x6066
leaq 0x50(%rsp), %rdi
callq 0x33f0
leaq 0x3742(%rip), %rsi      # 0x603b
leaq 0x50(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x2919
leaq 0x50(%rsp), %rdi
leaq 0x2a8(%rsp), %rsi
callq 0x2130
leaq 0x1f8(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x373b(%rip), %rsi      # 0x6067
leaq 0x3738(%rip), %rdx      # 0x606b
leaq 0x1e8(%rsp), %rdi
callq 0x33f0
leaq 0x208(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x5844
movq 0x1e8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2972
movq 0x1f8(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x36c2(%rip), %rsi      # 0x603b
leaq 0x208(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x299b
movq 0x208(%rsp), %rdi
callq 0x22a0
movl %eax, %ebx
jmp 0x29a0
movl $0x7f, %ebx
leaq 0x1b8(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x36b9(%rip), %rsi      # 0x606c
leaq 0x36b5(%rip), %rdx      # 0x606f
leaq 0x1a8(%rsp), %rdi
callq 0x33f0
leaq 0x1c8(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x5844
movq 0x1a8(%rsp), %rdi
cmpq %r14, %rdi
je 0x29f9
movq 0x1b8(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x363b(%rip), %rsi      # 0x603b
leaq 0x1c8(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x2a24
movq 0x1c8(%rsp), %rdi
callq 0x2220
cvtsd2ss %xmm0, %xmm0
jmp 0x2a2c
movss 0x35d8(%rip), %xmm0     # 0x6004
movss %xmm0, 0x8(%rsp)
leaq 0x178(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x362b(%rip), %rsi      # 0x6070
leaq 0x3628(%rip), %rdx      # 0x6074
leaq 0x168(%rsp), %rdi
callq 0x33f0
leaq 0x188(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x5844
movq 0x168(%rsp), %rdi
cmpq %r14, %rdi
je 0x2a8b
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x35a9(%rip), %rsi      # 0x603b
leaq 0x188(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x2ab6
movq 0x188(%rsp), %rdi
callq 0x2220
cvtsd2ss %xmm0, %xmm0
jmp 0x2abe
movss 0x354a(%rip), %xmm0     # 0x6008
movss %xmm0, 0x4(%rsp)
leaq 0x138(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x359e(%rip), %rsi      # 0x6075
leaq 0x359b(%rip), %rdx      # 0x6079
leaq 0x128(%rsp), %rdi
callq 0x33f0
leaq 0x148(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0x5844
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
je 0x2b1d
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x3517(%rip), %rsi      # 0x603b
leaq 0x148(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x2b48
movq 0x148(%rsp), %rdi
callq 0x2220
cvtsd2ss %xmm0, %xmm0
jmp 0x2b50
movss 0x34bc(%rip), %xmm0     # 0x600c
movss %xmm0, 0xc(%rsp)
leaq 0xb0(%rsp), %rdi
movss 0x34aa(%rip), %xmm0     # 0x6010
callq 0x3532
leaq 0x3508(%rip), %rsi      # 0x607a
leaq 0x50(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x2be7
leaq 0x34fc(%rip), %rsi      # 0x6083
leaq 0x50(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x2c04
leaq 0x34c2(%rip), %rsi      # 0x605e
leaq 0x50(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x2c1b
leaq 0x34da(%rip), %rsi      # 0x608b
leaq 0x50(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x2c32
leaq 0x34ce(%rip), %rsi      # 0x6094
leaq 0x50(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
jne 0x2f7c
leaq 0xb0(%rsp), %rdi
callq 0x3bb8
jmp 0x2c4d
leaq 0xb0(%rsp), %rdi
movl %ebx, %esi
movss 0x4(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
callq 0x38b8
jmp 0x2c4d
leaq 0xb0(%rsp), %rdi
movl %ebx, %esi
movss 0x8(%rsp), %xmm0
callq 0x368c
jmp 0x2c4d
leaq 0xb0(%rsp), %rdi
movl %ebx, %esi
movss 0x8(%rsp), %xmm0
callq 0x379e
jmp 0x2c4d
leaq 0xb0(%rsp), %rdi
movl %ebx, %esi
movss 0x4(%rsp), %xmm0
movss 0xc(%rsp), %xmm1
callq 0x3a32
leaq 0x345c(%rip), %rsi      # 0x60b0
leaq 0x90(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x2c8d
movl $0x210, %edi            # imm = 0x210
callq 0x21c0
movq %rax, %r14
movq 0x90(%rsp), %rsi
movq %rax, %rdi
movl $0x14, %edx
callq 0x2260
addq $0x10, %r14
jmp 0x2c94
movq 0x6334(%rip), %r14      # 0x8fc8
leaq 0x341c(%rip), %rsi      # 0x60b7
leaq 0x10(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x2d03
movl $0x210, %edi            # imm = 0x210
callq 0x21c0
movq %rax, %r15
movq 0x10(%rsp), %rsi
movq %rax, %rdi
movl $0xc, %edx
callq 0x2260
movq %r15, %rdi
subq $-0x80, %rdi
callq 0x2090
testb %al, %al
jne 0x2d0a
movq 0x62e9(%rip), %rdi      # 0x8fc8
leaq 0x33d7(%rip), %rsi      # 0x60bd
movl $0x1f, %edx
callq 0x2200
movq 0x62d1(%rip), %rdi      # 0x8fc8
callq 0x2110
xorl %edi, %edi
callq 0x2210
movq 0x62d6(%rip), %r15      # 0x8fe0
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%r15,%rax)
jne 0x2dc1
movss 0x32ef(%rip), %xmm0     # 0x6014
movss %xmm0, 0x4(%rsp)
leaq 0x3(%rsp), %rbx
leaq 0xb0(%rsp), %r12
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2230
movsbl 0x3(%rsp), %esi
movq %r12, %rdi
callq 0x356c
testb %al, %al
je 0x2dae
movq %r12, %rdi
callq 0x3652
movaps %xmm0, %xmm2
cvttss2si %xmm0, %eax
movsbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
maxss 0x4(%rsp), %xmm2
movss 0x3298(%rip), %xmm1     # 0x6018
movss %xmm2, 0x4(%rsp)
divss %xmm2, %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movb %al, 0x3(%rsp)
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2240
movq %r14, %rdi
callq 0x2140
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%r15,%rax)
je 0x2d38
leaq 0x32ef(%rip), %rsi      # 0x60b7
leaq 0x10(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x2dde
movq %r15, %rdi
callq 0x2050
leaq 0x32cb(%rip), %rsi      # 0x60b0
leaq 0x90(%rsp), %rdi
callq 0x20b0
testl %eax, %eax
je 0x2e08
leaq -0x10(%r14), %rdi
callq 0x2050
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
leaq 0x158(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e29
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x198(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e4a
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x1d8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e6b
movq 0x1d8(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x218(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e8c
movq 0x218(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x50(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2ea3
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x2b8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ec4
movq 0x2b8(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0xb0(%rsp), %rdi
callq 0x354e
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2eee
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f0f
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2f2b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f46
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x2f68
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x21d0
xorl %eax, %eax
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6045(%rip), %rdi      # 0x8fc8
leaq 0x3110(%rip), %rsi      # 0x609a
movl $0x15, %edx
callq 0x2200
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x6023(%rip), %rdi      # 0x8fc8
callq 0x2200
movq %rax, %rdi
callq 0x2110
jmp 0x2cfc
movq %rax, %rbx
movl $0x210, %esi            # imm = 0x210
movq %r15, %rdi
jmp 0x2fcf
movq %rax, %rbx
movl $0x210, %esi            # imm = 0x210
movq %r14, %rdi
callq 0x21d0
jmp 0x31b3
jmp 0x31b0
jmp 0x3089
jmp 0x30c2
jmp 0x30f3
movq %rax, %rbx
movq 0x128(%rsp), %rdi
cmpq %r14, %rdi
je 0x31d4
movq 0x138(%rsp), %rsi
jmp 0x31cc
movq %rax, %rbx
jmp 0x31d4
movq %rax, %rbx
movq 0x168(%rsp), %rdi
cmpq %r14, %rdi
je 0x31f5
movq 0x178(%rsp), %rsi
jmp 0x31ed
movq %rax, %rbx
jmp 0x31f5
movq %rax, %rbx
movq 0x1a8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3216
movq 0x1b8(%rsp), %rsi
jmp 0x320e
movq %rax, %rbx
jmp 0x3216
movq %rax, %rbx
movq 0x1e8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3237
movq 0x1f8(%rsp), %rsi
jmp 0x322f
movq %rax, %rbx
jmp 0x3237
movq %rax, %rbx
jmp 0x324e
movq %rax, %rbx
movq 0x228(%rsp), %rdi
cmpq %r14, %rdi
je 0x326f
movq 0x238(%rsp), %rsi
jmp 0x3267
movq %rax, %rbx
jmp 0x326f
movq %rax, %rbx
jmp 0x327c
movq %rax, %rbx
jmp 0x3299
movq %rax, %rbx
movq 0x248(%rsp), %rdi
cmpq %r14, %rdi
je 0x32ba
movq 0x258(%rsp), %rsi
jmp 0x32b2
movq %rax, %rbx
jmp 0x32ba
movq %rax, %rbx
jmp 0x32d6
movq %rax, %rbx
movq 0x268(%rsp), %rdi
cmpq %r14, %rdi
je 0x32f1
movq 0x278(%rsp), %rsi
jmp 0x32e9
jmp 0x314d
movq %rax, %rbx
movq 0x288(%rsp), %rdi
cmpq %r14, %rdi
je 0x32f1
movq 0x298(%rsp), %rsi
jmp 0x32e9
jmp 0x314d
jmp 0x31b0
jmp 0x31b0
movq %rax, %rbx
jmp 0x32f1
movq %rax, %rbx
jmp 0x319b
movq %rax, %rbx
jmp 0x317f
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %r13, %rdi
je 0x317f
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x319b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
jne 0x32e4
jmp 0x32f1
jmp 0x31b0
movq %rax, %rbx
leaq 0x158(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x31d4
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x198(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x31f5
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x1d8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3216
movq 0x1d8(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x218(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3237
movq 0x218(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x50(%rsp), %rdi
cmpq %rbp, %rdi
je 0x324e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x2b8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x326f
movq 0x2b8(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0xb0(%rsp), %rdi
callq 0x354e
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x3299
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x32ba
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x32d6
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x32f1
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x80(%rsp), %rax
movq 0x70(%rsp), %rdi
cmpq %rax, %rdi
je 0x3313
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x2320
nop