// File: /workspace/github_c_makefile_star2_O2/annoroad[P]fqtools_plus/fqtools.c
// Function: main
int main(int argc, char** argv){

	if (argc < 2){
		puts(HELP);
		exit(-1);
	}
	int function=0;
	char* HELP_output=NULL;
	if (strcmp(argv[1],"filter")==0){
		function = 1;
		HELP_output = (char*)HELP1;
	}else if(strcmp(argv[1],"cutadapt")==0){
		function = 2;
		HELP_output = (char*)HELP2;
	}else{
		fprintf(stderr, "%s\n",HELP);
		exit(0);
	}

	setvbuf(stdout,NULL,_IONBF,0);
	setvbuf(stderr,NULL,_IONBF,0);
	time_t start,end;
	time(&start);
	//fprintf(stdout,"%s\n", ctime(&start));
	//-------------------------------------------------
	g.single_or_pair=0;
	g.CUT=0;
	g.start=0;
	g.QUOTA=0;
	g.LOWQ = 19;
	g.HIGHQ = 30;
	g.LOW_QUALITY=0.5;
	g.highN=0.05;
	g.highAT=0.8;
	g.highGC=0.8;
	g.ployAT=0;
	g.ASCII = 33;
	g.Nthread = 1;

	g.read1Count=0;
	g.read2Count=0;

	g.sequence1 = (char*)malloc(512);
	g.sequence2 = (char*)malloc(512);

	g.min_overlap = 5;
	g.table1=init_hash();
	g.table2=init_hash();
	g.fq1 = (char*)malloc(1024);
	g.fq2 = (char*)malloc(1024);
	g.rawcutfq1 = (char*)malloc(1024);
	g.rawcutfq2 = (char*)malloc(1024);
	g.adapter1 = (char*)malloc(1024);
	g.adapter2 = (char*)malloc(1024);
	g.outfq1 = (char*)malloc(1024);
	g.outfq2 = (char*)malloc(1024);
	g.speedy_gzip = (char*)malloc(1024);
	char* files1[3]={g.fq1, g.adapter1, g.outfq1};
	char* files2[6]={g.fq1, g.fq2, g.adapter1, g.adapter2, g.outfq1, g.outfq2};
	char* files3[2]={g.fq1, g.outfq1};
	char* files4[4]={g.fq1, g.fq2, g.outfq1, g.outfq2};
	char** selectfiles=NULL;
	int n=0;
	int i;
	char x=1;
	for (i=2; i < argc; i++){
		if (argv[i][0] == '-'){
			if (strcmp(argv[i],"--c")==0 || strcmp(argv[i],"-c")==0){
				if(parameter(argv[i+1],&g.CUT,"int")==0){
					puts("--c INT\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if (strcmp(argv[i],"--start")==0 || strcmp(argv[i],"-start")==0){
				if(parameter(argv[i+1],&g.start,"int")==0){
					puts("--start INT\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if(strcmp(argv[i],"--q")==0 || strcmp(argv[i],"-q")==0){
				if(parameter(argv[i+1],&g.QUOTA,"long")==0){
					puts("--q INT\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if (strcmp(argv[i],"--ql")==0 || strcmp(argv[i],"-ql")==0){
				if(parameter(argv[i+1],&g.LOWQ,"int")==0){
					puts("--ql INT\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if (strcmp(argv[i],"--qh")==0 || strcmp(argv[i],"-qh")==0){
				if(parameter(argv[i+1],&g.HIGHQ,"int")==0){
					puts("--qh INT\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if (strcmp(argv[i],"--Q")==0 || strcmp(argv[i],"-Q")==0){
				if(parameter(argv[i+1],&g.LOW_QUALITY,"float")==0){
					puts("--Q FLOAT\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if (strcmp(argv[i],"--n")==0 || strcmp(argv[i],"-n")==0){
				if(parameter(argv[i+1],&g.highN,"float")==0){
					puts("--n FLOAT\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if (strcmp(argv[i],"--AT")==0 || strcmp(argv[i],"-AT")==0){
				if(parameter(argv[i+1],&g.highAT,"float")==0){
					puts("--highAT FLOAT\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if (strcmp(argv[i],"--GC")==0 || strcmp(argv[i],"-GC")==0){
				if(parameter(argv[i+1],&g.highGC,"float")==0){
					puts("--highGC FLOAT\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if (strcmp(argv[i],"--ployAT")==0 || strcmp(argv[i],"-ployAT")==0){
				if(parameter(argv[i+1],&g.ployAT,"int")==0){
					puts("--ployAT INT\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if (strcmp(argv[i],"--i")==0 || strcmp(argv[i],"-i")==0){
				if(parameter(argv[i+1],&g.ASCII,"int")==0){
					puts("--i INT\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if (strcmp(argv[i],"--adapt1")==0 || strcmp(argv[i],"-adapt")==0){
				if(parameter(argv[i+1],&g.sequence1,"str")==0){
					puts("--adapt1 string\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if (strcmp(argv[i],"--adapt2")==0 || strcmp(argv[i],"-adapt")==0){
				if(parameter(argv[i+1],&g.sequence2,"str")==0){
					puts("--adapt2 string\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if (strcmp(argv[i],"-min_overlap")==0 || strcmp(argv[i],"--min_overlap")==0){
				if(parameter(argv[i+1],&g.min_overlap,"int")==0){
					puts("-min_overlap int\n");
					puts(HELP_output);
					exit(-1);
				}
				i++;
				continue;
			}else if (strcmp(argv[i],"--m")==0 || strcmp(argv[i],"-m")==0){
				if(parameter(argv[i+1],&g.Nthread,"int")==0){
					puts("--m int\n");
					puts(HELP);
					exit(-1);
				}
				i++;
				continue;
			}else{
				fprintf(stderr,"invalid option %s\n",argv[i]);
				exit(0);
			}
		}else {
			if (function == 2){
				strcpy(g.fq1,argv[i]);
				break;	
			}
			if (x){
				if (argc - i == 2){
					g.single_or_pair = 0;
					if (*g.sequence1) selectfiles = files3;
					else selectfiles = files1;
				}else if(argc - i == 3){
					g.single_or_pair = 0;
					if (*g.sequence1) selectfiles = files3;
					else selectfiles = files1;
				}else if(argc - i == 4){
					g.single_or_pair = 1;
					if (*g.sequence1) selectfiles = files4;
					else selectfiles = files2;
				}else if(argc - i == 6){
					g.single_or_pair = 1;
					if (*g.sequence1) selectfiles = files4;
					else selectfiles = files2;
				}else{
					fprintf(stderr, "wrong !\n%s\n",HELP_output);
				}
			}
			x=0;
			strcpy(selectfiles[n],argv[i]);
			n++;
		}
	}

	if (*g.fq1 == '\0') {printf("%s\n",HELP_output);exit(0);}
	if (g.single_or_pair && *g.fq2 == '\0') {printf("%s\n",HELP_output);exit(0);}
	if (*g.outfq1 == '\0' && function == 1) {printf("%s\n",HELP_output);exit(0);}
	if (g.single_or_pair && *g.outfq2 == '\0') {printf("%s\n",HELP_output);exit(0);}

	int out1len = strlen(g.outfq1);
	int out2len = strlen(g.outfq2);
	if (strcmp(g.outfq1+out1len-3,".gz")==0) *(g.outfq1+out1len-3) = '\0';
	if (g.single_or_pair && strcmp(g.outfq2+out2len-3,".gz")==0) *(g.outfq2+out2len-3) = '\0';

	if (*g.sequence1 == '\0'){
		if (function==1) {
			if (*g.adapter1 == '\0') {printf("%s\n",HELP_output);exit(0);}
			if (g.single_or_pair && *g.adapter2 == '\0') {printf("%s\n",HELP_output);exit(0);}
		}else if (function==2){
			printf("%s\n",HELP_output);exit(0);
		}
	}else{
		if (g.single_or_pair){
			if (*g.sequence2 == '\0'){fprintf(stderr, "%s\n",HELP_output);exit(0);}
		}
	}

	if (g.QUOTA < 0){
		puts("-q num > 0");
		exit(-1);
	}else if(g.QUOTA > 0){
		sprintf(g.rawcutfq1,"%s.cut.raw",g.outfq1);
		if (g.single_or_pair) sprintf(g.rawcutfq2,"%s.cut.raw",g.outfq2);
	}
	
	if (g.CUT < 0){
		puts("--c num >= 0");
		exit(-1);
	}

	if (g.Nthread < 3){
		g.Nthread = 1;
	}else{
		if (g.QUOTA != 0){
			if (g.Nthread < 4){
				fprintf(stderr, "--m 不正确\n%s\n",HELP1);
				exit(0);
			}
		}
	}

	//-----------------------------------------
	if (function ==1){
		char statfile[strlen(g.outfq1)+20];
		sprintf(statfile,"%s.gz.stat",g.outfq1);
		char reportfile1[strlen(g.outfq1)+20];
		char reportfile2[strlen(g.outfq2)+20];
		sprintf(reportfile1,"%s.gz.report",g.outfq1);
		sprintf(reportfile2,"%s.gz.report",g.outfq2);
		if (*g.sequence1 == '\0'){
			readadapter();
		}
		if (g.Nthread >= 3){
			sprintf(g.speedy_gzip,"%s -f -p 3 ",speedy_gzip_software);
		}else{
			sprintf(g.speedy_gzip,"%s -f -p 1 ",speedy_gzip_software);	
		}
		//-----------------main func---------------
		process();
		//---------------outstat-------------------
		outstat(statfile);
		outreport(allstat.base1, allstat.quality1, reportfile1);
		if (g.single_or_pair) outreport(allstat.base2, allstat.quality2, reportfile2);
		//-----------------------------------------
	}else if (function == 2){
		cutadapt_main(g.fq1,g.sequence1,g.min_overlap);
	}
		
	time(&end);
	//fprintf(stdout,"%s\n", ctime(&end));
	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4c8, %rsp            # imm = 0x4C8
movl %edi, -0x50(%rbp)
cmpl $0x1, %edi
jle 0x518a
movq %rsi, -0x38(%rbp)
movq 0x8(%rsi), %rbx
leaq 0x2fa6(%rip), %rsi      # 0x706a
movq %rbx, %rdi
callq 0x2150
movl %eax, -0x48(%rbp)
testl %eax, %eax
je 0x40f3
leaq 0x2f97(%rip), %rsi      # 0x7071
movq %rbx, %rdi
callq 0x2150
testl %eax, %eax
jne 0x50e5
leaq 0x3955(%rip), %rax      # 0x7a46
jmp 0x40fa
leaq 0x31c6(%rip), %rax      # 0x72c0
movq %rax, -0x30(%rbp)
movq 0x5ed3(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
pushq $0x2
popq %r13
xorl %esi, %esi
movl %r13d, %edx
xorl %ecx, %ecx
callq 0x21e0
movq 0x5ed9(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
xorl %esi, %esi
movl %r13d, %edx
xorl %ecx, %ecx
callq 0x21e0
leaq -0x98(%rbp), %rdi
callq 0x2180
movb $0x0, 0x6087(%rip)      # 0xa1c8
andq $0x0, 0x6083(%rip)      # 0xa1cc
andq $0x0, 0x6087(%rip)      # 0xa1d8
movabsq $0x1e00000013, %rax     # imm = 0x1E00000013
movq %rax, 0x607e(%rip)      # 0xa1e0
movaps 0x2ea7(%rip), %xmm0     # 0x7010
movups %xmm0, 0x6078(%rip)     # 0xa1e8
movabsq $0x2100000000, %rax     # imm = 0x2100000000
movq %rax, 0x6077(%rip)      # 0xa1f8
movl $0x1, 0x6075(%rip)      # 0xa200
movl $0x200, %edi            # imm = 0x200
callq 0x21c0
xorps %xmm0, %xmm0
movups %xmm0, 0x6069(%rip)     # 0xa208
movq %rax, 0x6072(%rip)      # 0xa218
movl $0x200, %edi            # imm = 0x200
callq 0x21c0
movq %rax, 0x6069(%rip)      # 0xa220
movl $0x5, 0x6067(%rip)      # 0xa228
callq 0x61ab
movq %rax, 0x6063(%rip)      # 0xa230
callq 0x61ab
movq %rax, 0x605f(%rip)      # 0xa238
movl $0x400, %edi            # imm = 0x400
callq 0x21c0
movq %rax, %rbx
movq %rax, 0x6053(%rip)      # 0xa240
movl $0x400, %edi            # imm = 0x400
callq 0x21c0
movq %rax, -0x40(%rbp)
movq %rax, 0x6046(%rip)      # 0xa248
movl $0x400, %edi            # imm = 0x400
callq 0x21c0
movq %rax, 0x604d(%rip)      # 0xa260
movl $0x400, %edi            # imm = 0x400
callq 0x21c0
movq %rax, 0x6044(%rip)      # 0xa268
movl $0x400, %edi            # imm = 0x400
callq 0x21c0
movq %rax, %r12
movq %rax, 0x6038(%rip)      # 0xa270
movl $0x400, %edi            # imm = 0x400
callq 0x21c0
movq %rax, -0x58(%rbp)
movq %rax, 0x602b(%rip)      # 0xa278
movl $0x400, %edi            # imm = 0x400
callq 0x21c0
movq %rax, %r15
movq %rax, 0x5fef(%rip)      # 0xa250
movl $0x400, %edi            # imm = 0x400
callq 0x21c0
movq %rax, %r14
movq %rax, 0x5fe3(%rip)      # 0xa258
movl $0x400, %edi            # imm = 0x400
callq 0x21c0
movq %rax, 0x602a(%rip)      # 0xa2b0
leaq -0x90(%rbp), %rax
movq %rbx, (%rax)
movq %r12, 0x8(%rax)
movq %r15, 0x10(%rax)
leaq -0xf0(%rbp), %rax
movq %rbx, (%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq %r12, 0x10(%rax)
movq -0x58(%rbp), %rdx
movq %rdx, 0x18(%rax)
movq %r15, 0x20(%rax)
movq %r14, 0x28(%rax)
leaq -0x70(%rbp), %rax
movq %rbx, (%rax)
movq %r15, 0x8(%rax)
leaq -0xc0(%rbp), %rax
movq %rbx, (%rax)
movq %rcx, 0x8(%rax)
movq %r15, 0x10(%rax)
movq %r14, 0x18(%rax)
movb $0x1, %r14b
xorl %r15d, %r15d
movq $0x0, -0x40(%rbp)
movq -0x38(%rbp), %rbx
movl -0x50(%rbp), %eax
subl %r13d, %eax
jle 0x48b7
movslq %r13d, %r12
movq (%rbx,%r12,8), %rbx
cmpb $0x2d, (%rbx)
jne 0x45a7
movq %rbx, %rdi
leaq 0x2d63(%rip), %rsi      # 0x707a
callq 0x2150
testl %eax, %eax
je 0x45fd
cmpb $0x63, 0x1(%rbx)
jne 0x4334
cmpb $0x0, 0x2(%rbx)
je 0x45fd
movq %rbx, %rdi
leaq 0x2d4d(%rip), %rsi      # 0x708b
callq 0x2150
testl %eax, %eax
je 0x4626
movq %rbx, %rdi
leaq 0x2d37(%rip), %rsi      # 0x708c
callq 0x2150
testl %eax, %eax
je 0x4626
movq %rbx, %rdi
leaq 0x2d34(%rip), %rsi      # 0x70a0
callq 0x2150
testl %eax, %eax
je 0x4679
cmpb $0x71, 0x1(%rbx)
jne 0x4389
cmpb $0x0, 0x2(%rbx)
je 0x4679
movq %rbx, %rdi
leaq 0x2d1f(%rip), %rsi      # 0x70b2
callq 0x2150
testl %eax, %eax
je 0x46a2
movq %rbx, %rdi
leaq 0x2d09(%rip), %rsi      # 0x70b3
callq 0x2150
testl %eax, %eax
je 0x46a2
movq %rbx, %rdi
leaq 0x2d00(%rip), %rsi      # 0x70c1
callq 0x2150
testl %eax, %eax
je 0x46cb
movq %rbx, %rdi
leaq 0x2cea(%rip), %rsi      # 0x70c2
callq 0x2150
testl %eax, %eax
je 0x46cb
movq %rbx, %rdi
leaq 0x2ce1(%rip), %rsi      # 0x70d0
callq 0x2150
testl %eax, %eax
je 0x473e
cmpb $0x51, 0x1(%rbx)
jne 0x440c
cmpb $0x0, 0x2(%rbx)
je 0x473e
movq %rbx, %rdi
leaq 0x2ccf(%rip), %rsi      # 0x70e5
callq 0x2150
testl %eax, %eax
je 0x4767
cmpb $0x6e, 0x1(%rbx)
jne 0x4433
cmpb $0x0, 0x2(%rbx)
je 0x4767
movq %rbx, %rdi
leaq 0x2cb7(%rip), %rsi      # 0x70f4
callq 0x2150
testl %eax, %eax
je 0x4790
movq %rbx, %rdi
leaq 0x2ca1(%rip), %rsi      # 0x70f5
callq 0x2150
testl %eax, %eax
je 0x4790
movq %rbx, %rdi
leaq 0x2c9e(%rip), %rsi      # 0x7109
callq 0x2150
testl %eax, %eax
je 0x47b9
movq %rbx, %rdi
leaq 0x2c88(%rip), %rsi      # 0x710a
callq 0x2150
testl %eax, %eax
je 0x47b9
movq %rbx, %rdi
leaq 0x2c85(%rip), %rsi      # 0x711e
callq 0x2150
testl %eax, %eax
je 0x47de
movq %rbx, %rdi
leaq 0x2c6f(%rip), %rsi      # 0x711f
callq 0x2150
testl %eax, %eax
je 0x47de
movq %rbx, %rdi
leaq 0x2c6e(%rip), %rsi      # 0x7135
callq 0x2150
testl %eax, %eax
je 0x4803
cmpb $0x69, 0x1(%rbx)
jne 0x44e4
cmpb $0x0, 0x2(%rbx)
je 0x4803
movq %rbx, %rdi
leaq 0x2c54(%rip), %rsi      # 0x7142
callq 0x2150
testl %eax, %eax
je 0x4828
movq %rbx, %rdi
leaq 0x2c46(%rip), %rsi      # 0x714b
callq 0x2150
testl %eax, %eax
je 0x4828
movq %rbx, %rdi
leaq 0x2c4b(%rip), %rsi      # 0x7167
callq 0x2150
testl %eax, %eax
je 0x487c
movq %rbx, %rdi
leaq 0x2c4f(%rip), %rsi      # 0x7182
callq 0x2150
testl %eax, %eax
je 0x4857
movq %rbx, %rdi
leaq 0x2c37(%rip), %rsi      # 0x7181
callq 0x2150
testl %eax, %eax
je 0x4857
movq %rbx, %rdi
leaq 0x2c40(%rip), %rsi      # 0x71a1
callq 0x2150
testl %eax, %eax
je 0x457e
cmpb $0x6d, 0x1(%rbx)
jne 0x5193
cmpb $0x0, 0x2(%rbx)
jne 0x5193
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x5c72(%rip), %rsi      # 0xa200
leaq 0x2ae9(%rip), %rdx      # 0x707e
callq 0x51d2
testl %eax, %eax
jne 0x484c
jmp 0x517e
cmpl $0x0, -0x48(%rbp)
jne 0x48a8
testb %r14b, %r14b
je 0x4718
addl $-0x2, %eax
cmpl $0x4, %eax
ja 0x46f4
leaq 0x2a6b(%rip), %rcx      # 0x7038
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x0, 0x5beb(%rip)      # 0xa1c8
movq 0x5c34(%rip), %rax      # 0xa218
cmpb $0x0, (%rax)
leaq -0x90(%rbp), %rax
je 0x471c
leaq -0x70(%rbp), %rax
jmp 0x471c
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x5bbf(%rip), %rsi      # 0xa1cc
leaq 0x2a6a(%rip), %rdx      # 0x707e
callq 0x51d2
testl %eax, %eax
jne 0x484c
jmp 0x5092
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x5b9a(%rip), %rsi      # 0xa1d0
leaq 0x2a41(%rip), %rdx      # 0x707e
callq 0x51d2
testl %eax, %eax
jne 0x484c
jmp 0x50a9
movb $0x1, 0x5b72(%rip)      # 0xa1c8
movq 0x5bbb(%rip), %rax      # 0xa218
cmpb $0x0, (%rax)
leaq -0xf0(%rbp), %rax
je 0x471c
leaq -0xc0(%rbp), %rax
jmp 0x471c
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x5b4f(%rip), %rsi      # 0xa1d8
leaq 0x2a14(%rip), %rdx      # 0x70a4
callq 0x51d2
testl %eax, %eax
jne 0x484c
jmp 0x50b5
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x5b2e(%rip), %rsi      # 0xa1e0
leaq 0x29c5(%rip), %rdx      # 0x707e
callq 0x51d2
testl %eax, %eax
jne 0x484c
jmp 0x50d9
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x5b09(%rip), %rsi      # 0xa1e4
leaq 0x299c(%rip), %rdx      # 0x707e
callq 0x51d2
testl %eax, %eax
jne 0x484c
jmp 0x5125
movq 0x58fd(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x2abc(%rip), %rsi      # 0x71c1
movq -0x30(%rbp), %rdx
xorl %eax, %eax
callq 0x2160
movq -0x38(%rbp), %rax
movq (%rax,%r12,8), %rbx
movq -0x40(%rbp), %rax
movslq %r15d, %r15
movq %rax, -0x40(%rbp)
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
callq 0x2050
incl %r15d
xorl %r14d, %r14d
movq -0x38(%rbp), %rbx
jmp 0x484f
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x5a9a(%rip), %rsi      # 0xa1e8
leaq 0x297f(%rip), %rdx      # 0x70d4
callq 0x51d2
testl %eax, %eax
jne 0x484c
jmp 0x5148
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x5a75(%rip), %rsi      # 0xa1ec
leaq 0x2956(%rip), %rdx      # 0x70d4
callq 0x51d2
testl %eax, %eax
jne 0x484c
jmp 0x5151
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x5a50(%rip), %rsi      # 0xa1f0
leaq 0x292d(%rip), %rdx      # 0x70d4
callq 0x51d2
testl %eax, %eax
jne 0x484c
jmp 0x515a
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x5a2b(%rip), %rsi      # 0xa1f4
leaq 0x2904(%rip), %rdx      # 0x70d4
callq 0x51d2
testl %eax, %eax
jne 0x484c
jmp 0x5163
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x5a0a(%rip), %rsi      # 0xa1f8
leaq 0x2889(%rip), %rdx      # 0x707e
callq 0x51d2
testl %eax, %eax
jne 0x484c
jmp 0x516c
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x59e9(%rip), %rsi      # 0xa1fc
leaq 0x2864(%rip), %rdx      # 0x707e
callq 0x51d2
testl %eax, %eax
jne 0x484c
jmp 0x5175
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x59e0(%rip), %rsi      # 0xa218
leaq 0x2913(%rip), %rdx      # 0x7152
callq 0x51d2
testl %eax, %eax
je 0x51ac
incl %r13d
incl %r13d
jmp 0x42f1
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x59c1(%rip), %rsi      # 0xa228
leaq 0x2810(%rip), %rdx      # 0x707e
callq 0x51d2
testl %eax, %eax
jne 0x484c
jmp 0x51b5
movq -0x38(%rbp), %rbx
movq 0x8(%rbx,%r12,8), %rdi
leaq 0x5994(%rip), %rsi      # 0xa220
leaq 0x28bf(%rip), %rdx      # 0x7152
callq 0x51d2
testl %eax, %eax
jne 0x484c
leaq 0x28cd(%rip), %rdi      # 0x7170
jmp 0x51bc
movq 0x5991(%rip), %rdi      # 0xa240
movq %rbx, %rsi
callq 0x2050
movq 0x5982(%rip), %rax      # 0xa240
cmpb $0x0, (%rax)
je 0x509e
movb 0x58fa(%rip), %r12b     # 0xa1c8
testb %r12b, %r12b
je 0x48e3
movq 0x596e(%rip), %rax      # 0xa248
cmpb $0x0, (%rax)
je 0x509e
movq 0x5966(%rip), %rbx      # 0xa250
cmpl $0x0, -0x48(%rbp)
jne 0x48f9
cmpb $0x0, (%rbx)
je 0x509e
movq 0x5958(%rip), %r14      # 0xa258
testb %r12b, %r12b
je 0x490f
cmpb $0x0, (%r14)
je 0x509e
movq %rbx, %rdi
callq 0x20c0
movq %rax, %r15
movq %r14, %rdi
callq 0x20c0
movq %rax, %r14
movslq %r15d, %rax
addq %rax, %rbx
addq $-0x3, %rbx
leaq 0x2897(%rip), %rsi      # 0x71cd
movq %rbx, %rdi
callq 0x2150
testl %eax, %eax
jne 0x494c
movb $0x0, (%rbx)
movb 0x587c(%rip), %r12b     # 0xa1c8
testb %r12b, %r12b
je 0x4979
movq 0x5900(%rip), %rax      # 0xa258
movslq %r14d, %rcx
leaq (%rax,%rcx), %rbx
addq $-0x3, %rbx
leaq 0x2863(%rip), %rsi      # 0x71cd
movq %rbx, %rdi
callq 0x2150
testl %eax, %eax
jne 0x4979
movb $0x0, (%rbx)
movq 0x5898(%rip), %rax      # 0xa218
cmpb $0x0, (%rax)
je 0x49b4
cmpb $0x0, 0x583c(%rip)      # 0xa1c8
je 0x49e7
movq 0x588b(%rip), %rax      # 0xa220
cmpb $0x0, (%rax)
jne 0x49e7
movq 0x5657(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x35ac(%rip), %rsi      # 0x7f57
movq -0x30(%rbp), %rdx
jmp 0x5117
cmpl $0x0, -0x48(%rbp)
jne 0x509e
movq 0x58ab(%rip), %rax      # 0xa270
cmpb $0x0, (%rax)
je 0x509e
cmpb $0x0, 0x57f3(%rip)      # 0xa1c8
je 0x49e7
movq 0x589a(%rip), %rax      # 0xa278
cmpb $0x0, (%rax)
je 0x509e
cmpq $0x0, 0x57e9(%rip)      # 0xa1d8
js 0x50c1
je 0x4a38
movq 0x5862(%rip), %rdi      # 0xa260
movq 0x584b(%rip), %rdx      # 0xa250
leaq 0x27d0(%rip), %rsi      # 0x71dc
xorl %eax, %eax
callq 0x22a0
cmpb $0x0, 0x57ae(%rip)      # 0xa1c8
je 0x4a38
movq 0x5845(%rip), %rdi      # 0xa268
movq 0x582e(%rip), %rdx      # 0xa258
leaq 0x27ab(%rip), %rsi      # 0x71dc
xorl %eax, %eax
callq 0x22a0
cmpl $0x0, 0x578d(%rip)      # 0xa1cc
js 0x50cd
movl 0x57b5(%rip), %eax      # 0xa200
cmpl $0x2, %eax
jg 0x4a5c
movl $0x1, 0x57a6(%rip)      # 0xa200
jmp 0x4a6f
cmpl $0x3, %eax
jne 0x4a6f
cmpq $0x0, 0x576f(%rip)      # 0xa1d8
jne 0x50ff
cmpl $0x0, -0x48(%rbp)
je 0x4a93
movq 0x57c4(%rip), %rdi      # 0xa240
movq 0x5795(%rip), %rsi      # 0xa218
movl 0x579f(%rip), %edx      # 0xa228
callq 0x6639
jmp 0x5075
movq 0x57b6(%rip), %rdi      # 0xa250
callq 0x20c0
movq %rsp, -0x38(%rbp)
movq %rsp, %r13
addq $0x23, %rax
andq $-0x10, %rax
subq %rax, %r13
movq %r13, %rsp
movq 0x5795(%rip), %rdx      # 0xa250
leaq 0x2744(%rip), %rsi      # 0x7206
movq %r13, %rdi
xorl %eax, %eax
callq 0x22a0
movq 0x577d(%rip), %rbx      # 0xa250
movq %rbx, %rdi
callq 0x20c0
movq %rsp, %r14
addq $0x23, %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
movq 0x5765(%rip), %rdi      # 0xa258
callq 0x20c0
movq %rsp, %r15
addq $0x23, %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
leaq 0x2701(%rip), %r12      # 0x7211
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq -0x38(%rbp), %rbx
xorl %eax, %eax
callq 0x22a0
movq 0x572d(%rip), %rdx      # 0xa258
movq %r15, -0x50(%rbp)
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x22a0
movq 0x56d5(%rip), %rax      # 0xa218
cmpb $0x0, (%rax)
jne 0x4c93
movq %r13, -0x48(%rbp)
movq %r14, -0x40(%rbp)
movq 0x5715(%rip), %rdi      # 0xa270
leaq 0x250d(%rip), %rsi      # 0x706f
callq 0x2210
testq %rax, %rax
je 0x5131
movq %rax, %r12
leaq -0x4f0(%rbp), %r13
pushq $0x9
popq %r14
leaq 0x56ab(%rip), %rbx      # 0xa230
pushq $0x1
popq %r15
movq %r12, %rdi
movq %r13, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x2080
testq %rax, %rax
je 0x4be0
movq %r13, %rdi
callq 0x20c0
cmpq $0x1, %rax
jne 0x4bb6
cmpw $0xa, -0x4f0(%rbp)
je 0x4b89
movl $0x400, %edx            # imm = 0x400
movq %r13, %rdi
movl %r14d, %esi
callq 0x2120
testq %rax, %rax
je 0x4b89
movw $0xa, (%rax)
movq %rbx, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x61f3
jmp 0x4b89
movq %r12, %rdi
callq 0x2030
cmpb $0x0, 0x55d9(%rip)      # 0xa1c8
je 0x4c87
movq 0x567c(%rip), %rdi      # 0xa278
leaq 0x246c(%rip), %rsi      # 0x706f
callq 0x2210
testq %rax, %rax
je 0x513a
movq %rax, %r12
leaq -0x4f0(%rbp), %r13
pushq $0x9
popq %r14
leaq 0x5612(%rip), %r15      # 0xa238
pushq $0x1
popq %rbx
movq %r12, %rdi
movq %r13, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x2080
testq %rax, %rax
je 0x4c7f
movq %r13, %rdi
callq 0x20c0
cmpq $0x1, %rax
jne 0x4c56
cmpw $0xa, -0x4f0(%rbp)
je 0x4c29
movl $0x400, %edx            # imm = 0x400
movq %r13, %rdi
movl %r14d, %esi
callq 0x2120
testq %rax, %rax
je 0x4c29
movw $0xa, (%rax)
movq %r15, %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x61f3
jmp 0x4c29
movq %r12, %rdi
callq 0x2030
movq -0x38(%rbp), %rbx
movq -0x40(%rbp), %r14
movq -0x48(%rbp), %r13
cmpl $0x3, 0x5566(%rip)      # 0xa200
movq 0x560f(%rip), %rdi      # 0xa2b0
leaq 0x2576(%rip), %rax      # 0x721e
leaq 0x25c6(%rip), %rsi      # 0x7275
cmovgeq %rax, %rsi
leaq 0x2570(%rip), %rdx      # 0x722a
xorl %eax, %eax
callq 0x22a0
callq 0x532f
leaq 0x2518(%rip), %rsi      # 0x71e5
movq %r13, %rdi
callq 0x2260
cmpb $0x0, 0x54ec(%rip)      # 0xa1c8
setne %r15b
movl 0x5632(%rip), %edi      # 0xa318
movslq 0x54df(%rip), %rdx      # 0xa1cc
movq %rdx, %rsi
imulq %rdi, %rsi
movl %r15d, %ecx
shlq %cl, %rsi
movq %rsi, 0x561f(%rip)      # 0xa320
cvtsi2sd %rdi, %xmm2
movsd 0x2322(%rip), %xmm0     # 0x7030
mulsd %xmm0, %xmm2
movl 0x55f0(%rip), %ecx      # 0xa308
cvtsi2sd %rcx, %xmm1
divsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
movss %xmm2, 0x55fb(%rip)     # 0xa328
movl 0x55f9(%rip), %ecx      # 0xa32c
cvtsi2sd %rcx, %xmm2
mulsd %xmm0, %xmm2
divsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
movss %xmm2, 0x55e4(%rip)     # 0xa330
movl 0x55e2(%rip), %ecx      # 0xa334
cvtsi2sd %rcx, %xmm2
mulsd %xmm0, %xmm2
divsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
movss %xmm2, 0x55cd(%rip)     # 0xa338
movl 0x55cb(%rip), %ecx      # 0xa33c
cvtsi2sd %rcx, %xmm2
mulsd %xmm0, %xmm2
divsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
movss %xmm2, 0x55b6(%rip)     # 0xa340
cvtsi2sdq 0x55b5(%rip), %xmm2 # 0xa348
cvtsi2sdq 0x5574(%rip), %xmm3 # 0xa310
mulsd %xmm0, %xmm2
divsd %xmm3, %xmm2
cvtsd2ss %xmm2, %xmm2
movss %xmm2, 0x55a0(%rip)     # 0xa350
cvtsi2sdq 0x559f(%rip), %xmm2 # 0xa358
movq %rax, %r12
mulsd %xmm0, %xmm2
cvtsi2sd %rsi, %xmm3
divsd %xmm3, %xmm2
cvtsd2ss %xmm2, %xmm2
movss %xmm2, 0x558b(%rip)     # 0xa360
movl 0x5599(%rip), %eax      # 0xa374
cvtsi2sd %rax, %xmm2
mulsd %xmm0, %xmm2
divsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
movss %xmm2, 0x5584(%rip)     # 0xa378
movl 0x556a(%rip), %eax      # 0xa364
cvtsi2sd %rax, %xmm2
mulsd %xmm0, %xmm2
divsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
movss %xmm2, 0x5555(%rip)     # 0xa368
movl 0x5553(%rip), %eax      # 0xa36c
cvtsi2sd %rax, %xmm2
mulsd %xmm0, %xmm2
divsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm0
movss %xmm0, 0x553e(%rip)     # 0xa370
leaq 0x2dff(%rip), %rsi      # 0x7c38
movq %r12, %rdi
xorl %eax, %eax
callq 0x2160
movl 0x54bf(%rip), %edx      # 0xa308
movl %r15d, %ecx
shll %cl, %edx
leaq 0x2df7(%rip), %rsi      # 0x7c4c
movq %r12, %rdi
xorl %eax, %eax
callq 0x2160
movq 0x54aa(%rip), %rdx      # 0xa310
leaq 0x2df9(%rip), %rsi      # 0x7c66
movq %r12, %rdi
xorl %eax, %eax
callq 0x2160
movl 0x549b(%rip), %edx      # 0xa318
movl %r15d, %ecx
shll %cl, %edx
leaq 0x2df9(%rip), %rsi      # 0x7c82
movq %r12, %rdi
xorl %eax, %eax
callq 0x2160
movq 0x5486(%rip), %rdx      # 0xa320
leaq 0x2df8(%rip), %rsi      # 0x7c99
movq %r12, %rdi
xorl %eax, %eax
callq 0x2160
cvtss2sd 0x5475(%rip), %xmm0     # 0xa328
leaq 0x2df8(%rip), %rsi      # 0x7cb2
movq %r12, %rdi
movb $0x1, %al
callq 0x2160
movl 0x5462(%rip), %edx      # 0xa32c
movl %r15d, %ecx
shll %cl, %edx
leaq 0x2df7(%rip), %rsi      # 0x7ccd
movq %r12, %rdi
xorl %eax, %eax
callq 0x2160
cvtss2sd 0x5448(%rip), %xmm0     # 0xa330
leaq 0x2dfb(%rip), %rsi      # 0x7cea
movq %r12, %rdi
movb $0x1, %al
callq 0x2160
movl 0x5435(%rip), %edx      # 0xa334
movl %r15d, %ecx
shll %cl, %edx
leaq 0x2e00(%rip), %rsi      # 0x7d0b
movq %r12, %rdi
xorl %eax, %eax
callq 0x2160
cvtss2sd 0x541b(%rip), %xmm0     # 0xa338
leaq 0x2dfb(%rip), %rsi      # 0x7d1f
movq %r12, %rdi
movb $0x1, %al
callq 0x2160
movl 0x5408(%rip), %edx      # 0xa33c
movl %r15d, %ecx
shll %cl, %edx
leaq 0x2df7(%rip), %rsi      # 0x7d37
movq %r12, %rdi
xorl %eax, %eax
callq 0x2160
cvtss2sd 0x53ee(%rip), %xmm0     # 0xa340
leaq 0x2e00(%rip), %rsi      # 0x7d59
movq %r12, %rdi
movb $0x1, %al
callq 0x2160
movl 0x53fb(%rip), %edx      # 0xa364
movl %r15d, %ecx
shll %cl, %edx
leaq 0x2e0a(%rip), %rsi      # 0x7d7f
movq %r12, %rdi
xorl %eax, %eax
callq 0x2160
cvtss2sd 0x53e1(%rip), %xmm0     # 0xa368
leaq 0x2e0a(%rip), %rsi      # 0x7d98
movq %r12, %rdi
movb $0x1, %al
callq 0x2160
movl 0x53ce(%rip), %edx      # 0xa36c
movl %r15d, %ecx
shll %cl, %edx
leaq 0x2e12(%rip), %rsi      # 0x7dbc
movq %r12, %rdi
xorl %eax, %eax
callq 0x2160
cvtss2sd 0x53b4(%rip), %xmm0     # 0xa370
leaq 0x2e0a(%rip), %rsi      # 0x7dcd
movq %r12, %rdi
movb $0x1, %al
callq 0x2160
movl 0x53a1(%rip), %edx      # 0xa374
movl %r15d, %ecx
shll %cl, %edx
leaq 0x2e0a(%rip), %rsi      # 0x7de9
movq %r12, %rdi
xorl %eax, %eax
callq 0x2160
cvtss2sd 0x5387(%rip), %xmm0     # 0xa378
leaq 0x2e02(%rip), %rsi      # 0x7dfa
movq %r12, %rdi
movb $0x1, %al
callq 0x2160
cvtss2sd 0x5346(%rip), %xmm0     # 0xa350
leaq 0x2e05(%rip), %rsi      # 0x7e16
movq %r12, %rdi
movb $0x1, %al
callq 0x2160
cvtss2sd 0x533d(%rip), %xmm0     # 0xa360
leaq 0x2e0e(%rip), %rsi      # 0x7e38
movq %r12, %rdi
movb $0x1, %al
callq 0x2160
movq %r12, %rdi
callq 0x20b0
leaq 0x5339(%rip), %rdi      # 0xa37c
leaq 0xf332(%rip), %rsi      # 0x1437c
movq %r14, %rdx
callq 0x58af
cmpb $0x0, 0x516f(%rip)      # 0xa1c8
je 0x5072
leaq 0xa31a(%rip), %rdi      # 0xf37c
leaq 0x41313(%rip), %rsi     # 0x4637c
movq -0x50(%rbp), %rdx
callq 0x58af
movq %rbx, %rsp
leaq -0x4f0(%rbp), %rdi
callq 0x2180
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1fe9(%rip), %rdi      # 0x7082
jmp 0x51bc
movq -0x30(%rbp), %rdi
callq 0x2070
jmp 0x511e
leaq 0x1fe3(%rip), %rdi      # 0x7093
jmp 0x51bc
leaq 0x1fed(%rip), %rdi      # 0x70a9
jmp 0x51bc
leaq 0x2109(%rip), %rdi      # 0x71d1
jmp 0x51c5
leaq 0x2113(%rip), %rdi      # 0x71e7
jmp 0x51c5
leaq 0x1fd7(%rip), %rdi      # 0x70b7
jmp 0x51bc
movq 0x4f0c(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x2e61(%rip), %rsi      # 0x7f57
leaq 0x2184(%rip), %rdx      # 0x7281
jmp 0x5117
movq 0x4ef2(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x20e4(%rip), %rsi      # 0x71f4
leaq 0x21a9(%rip), %rdx      # 0x72c0
xorl %eax, %eax
callq 0x2160
xorl %edi, %edi
callq 0x22b0
leaq 0x1f9a(%rip), %rdi      # 0x70c6
jmp 0x51bc
leaq 0x2a6a(%rip), %rdi      # 0x7ba2
jmp 0x5141
leaq 0x2a6b(%rip), %rdi      # 0x7bac
callq 0x2270
jmp 0x511e
leaq 0x1f8b(%rip), %rdi      # 0x70da
jmp 0x51bc
leaq 0x1f91(%rip), %rdi      # 0x70e9
jmp 0x51bc
leaq 0x1f98(%rip), %rdi      # 0x70f9
jmp 0x51bc
leaq 0x1fa4(%rip), %rdi      # 0x710e
jmp 0x51bc
leaq 0x1fb4(%rip), %rdi      # 0x7127
jmp 0x51bc
leaq 0x1fbd(%rip), %rdi      # 0x7139
jmp 0x51bc
leaq 0x2020(%rip), %rdi      # 0x71a5
callq 0x2070
leaq 0x20f0(%rip), %rdi      # 0x7281
jmp 0x51c5
movq 0x4e5e(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x200a(%rip), %rsi      # 0x71ae
movq %rbx, %rdx
jmp 0x5117
leaq 0x1fa3(%rip), %rdi      # 0x7156
jmp 0x51bc
leaq 0x1fd3(%rip), %rdi      # 0x718f
callq 0x2070
movq -0x30(%rbp), %rdi
callq 0x2070
pushq $-0x1
popq %rdi
callq 0x22b0