// File: /workspace/github_c_makefile_star2_O1/jiqingxiaoxi[P]RPA/single.c
// Function: main
void main(int argc, char **argv) 
{
	double stackEntropies[625],stackEnthalpies[625],stackint2Entropies[625],stackint2Enthalpies[625],dangleEntropies3[125],dangleEnthalpies3[125],dangleEntropies5[125],dangleEnthalpies5[125];
        double hairpinLoopEntropies[30],interiorLoopEntropies[30],bulgeLoopEntropies[30],hairpinLoopEnthalpies[30],interiorLoopEnthalpies[30],bulgeLoopEnthalpies[30],tstackEntropies[625],tstackEnthalpies[625],tstack2Entropies[625],tstack2Enthalpies[625];
        char *triloopEntropies1,*triloopEnthalpies1,*tetraloopEntropies1,*tetraloopEnthalpies1;
        double *triloopEntropies2,*triloopEnthalpies2,*tetraloopEntropies2,*tetraloopEnthalpies2,atpS[25],atpH[25];
	char *store_path,*prefix,*tm_path,*curren_path,*input,*par_path,*seq,*temp;
	FILE *fp,*Primer,*Probe;
	int i,flag[10],length,numTriloops,numTetraloops,Num[3];
	float deltah[16],deltas[16],temp1,temp2;
	struct stat statbuf;
//flag: 0:input; 1: out_prefix; 2: dir; 3: NoExo; 4: No secondary structure; 5: path for secondary structure
        time_t start,end;
	
	start=time(NULL);
//get input

	for(i=0;i<6;i++)
	{
		flag[i]=0;
	}
	flag[8]=1;

	for(i=1;i<argc;)
	{
		if(strcmp(argv[i],"-in")==0)
		{
			flag[0]=1;
			if(i+1==argc)
			{
				printf("Error! The \"-in\" parameter is not completed.\n");
				usage();
				exit(1);
			}
			length=strlen(argv[i+1]);
			input=(char *)malloc(length+1);
			memset(input,'\0',length+1);
			strcpy(input,argv[i+1]);
			i=i+2;
		}
		else if(strcmp(argv[i],"-out")==0)
		{
			flag[1]=1;
			if(i+1==argc)
                        {
                                printf("Error! The \"-out\" parameter is not completed.\n");
                                usage();
                                exit(1);
                        }
			length=strlen(argv[i+1]);
			prefix=(char *)malloc(length+1);
			memset(prefix,'\0',length+1);
			strcpy(prefix,argv[i+1]);
			i=i+2;
		}
                else if(strcmp(argv[i],"-dir")==0)
                {
			flag[2]=1;
			if(i+1==argc)
                        {
                                printf("Error! The \"-dir\" parameter is not completed.\n");
                                usage();
                                exit(1);
                        }
			length=strlen(argv[i+1]);
			if(argv[i+1][length-1]=='/')
			{
				store_path=(char *)malloc(length+1);
				memset(store_path,'\0',length+1);
                        	strcpy(store_path,argv[i+1]);
			}
			else
			{
				store_path=(char *)malloc(length+2);
                                memset(store_path,'\0',length+2);
                                strcpy(store_path,argv[i+1]);
				store_path[length]='/';
			}
			i=i+2;
                }
		else if(strcmp(argv[i],"-h")==0 || strcmp(argv[i],"-help")==0)
                {
                        usage();
                       	exit(1);
                }
		else if(strcmp(argv[i],"-NoExo")==0)
		{
			flag[3]=1;
			i++;
		}
		else if(strcmp(argv[i],"-NoCheck")==0)
		{
			flag[4]=1;
			i++;
		}
		else if(strcmp(argv[i],"-par")==0)
		{
			flag[5]=1;
			if(i+1==argc)
                        {
                                printf("Error! The \"-par\" parameter is not completed.\n");
                                usage();
                                exit(1);
                        }
			length=strlen(argv[i+1]);
			if(argv[i+1][length-1]=='/')
			{
				par_path=(char *)malloc(length+1);
				strcpy(par_path,argv[i+1]);
				par_path[length]='\0';
			}
			else
			{
				par_path=(char *)malloc(length+2);
                                strcpy(par_path,argv[i+1]);
                                par_path[length]='/';
				par_path[length+1]='\0';
			}
                        i=i+2;
                }
		else
		{
			printf("Error: don't have the parameter: %s\n",argv[i]);
			usage();
			exit(1);
		}
	}

//check paramters
	if(flag[0]==0)
	{
		printf("Error! Users must input the reference sequence file with -in!\n");
		usage();
		exit(1);
	}
	if(flag[1]==0)
	{
		printf("Error! Users must supply the prefix name for output file with -out!\n");
		usage();
		exit(1);
	}
	for(i=0;i<strlen(prefix);i++)
	{
		if(prefix[i]=='/')
		{
			printf("Error! the -out parameter couldn't contain any directory!\n");
			usage();
			exit(1);
		}
	}

//prepare 
	temp=(char *)malloc(4096);
	memset(temp,'\0',4096);
	getcwd(temp,4096);
	length=strlen(temp);
	curren_path=(char *)malloc(length+1);
	memset(curren_path,'\0',length+1);
	strcpy(curren_path,temp);
	if(flag[2]==0)
        {
                store_path=(char *)malloc(length+2);
                memset(store_path,'\0',length+2);
                strcpy(store_path,temp);
                store_path[length]='/';
        }
	free(temp);

	length=strlen(store_path)+strlen(prefix)+10;
	temp=(char *)malloc(length);
	memset(temp,'\0',length);
	strcpy(temp,store_path);
	strcat(temp,"Primer/");
	mkdir(temp,0755);
	strcat(temp,prefix);
	Primer=fopen(temp,"w");
	if(Primer==NULL)
	{
		printf("Error! Can't create the %s file!\n",temp);
		exit(1);
	}

	if(flag[3]==0)
	{
		memset(temp,'\0',length);       
        	strcpy(temp,store_path);      
        	strcat(temp,"Probe/");
		mkdir(temp,0755);
        	strcat(temp,prefix);
        	Probe=fopen(temp,"w");
        	if(Probe==NULL)
        	{
        	        printf("Error! Can't create the %s file!\n",temp);
        	        exit(1);       
        	}
	}
	free(temp);

	if(flag[5]==0)  
        {
                length=strlen(curren_path);
                par_path=(char *)malloc(length+10);
                memset(par_path,'\0',length+10);
                strcpy(par_path,curren_path);
                i=length-1;  
                if(par_path[i]!='/')
                {
                        par_path[i+1]='/';
                        par_path[i+2]='\0';
                }            
                strcat(par_path,"Par/");
        }
//tm parameter file
	tm_path=(char *)malloc(length+30);
	memset(tm_path,'\0',length+30);
	strcpy(tm_path,par_path);
	strcat(tm_path,"tm_nn_parameter.txt");

//secondary structure
	if((flag[4]==0)&&(flag[5]==0))
	{
		length=strlen(curren_path);
                par_path=(char *)malloc(length+10);
                memset(par_path,'\0',length+10);
                strcpy(par_path,curren_path);
                i=length-1;
                if(par_path[i]!='/')
                {
			par_path[i+1]='/';
                        par_path[i+2]='\0';
                }
                strcat(par_path,"Par/");
	}

	if(flag[4]==0)//check
	{
		getStack(stackEntropies,stackEnthalpies,par_path);
		getStackint2(stackint2Entropies,stackint2Enthalpies,par_path);
		getDangle(dangleEntropies3,dangleEnthalpies3,dangleEntropies5,dangleEnthalpies5,par_path);
		getLoop(hairpinLoopEntropies,interiorLoopEntropies,bulgeLoopEntropies,hairpinLoopEnthalpies,interiorLoopEnthalpies,bulgeLoopEnthalpies,par_path);
		getTstack(tstackEntropies,tstackEnthalpies,par_path);
		getTstack2(tstack2Entropies,tstack2Enthalpies,par_path);

		numTriloops=get_num_line(par_path,0);
		triloopEntropies1=(char *)malloc(numTriloops*5);
		triloopEnthalpies1=(char *)malloc(numTriloops*5);
		triloopEntropies2=(double *)malloc(numTriloops*sizeof(double));
		triloopEnthalpies2=(double *)malloc(numTriloops*sizeof(double));
		getTriloop(triloopEntropies1,triloopEnthalpies1,triloopEntropies2,triloopEnthalpies2,par_path);
        
		numTetraloops=get_num_line(par_path,1);
		tetraloopEntropies1=(char *)malloc(numTetraloops*6);
		tetraloopEnthalpies1=(char *)malloc(numTetraloops*6);
		tetraloopEntropies2=(double *)malloc(numTetraloops*sizeof(double));
		tetraloopEnthalpies2=(double *)malloc(numTetraloops*sizeof(double));
		getTetraloop(tetraloopEntropies1,tetraloopEnthalpies1,tetraloopEntropies2,tetraloopEnthalpies2,par_path);
		tableStartATS(6.9,atpS);
		tableStartATH(2200.0,atpH);
	}

//input reference sequence
	if(access(input,0)==-1)
	{
		printf("Error! Don't have the %s file.\n",input);
		exit(1);
	}
	stat(input,&statbuf);
	length=statbuf.st_size;
	length=length+100;
	temp=(char *)malloc(length);
	memset(temp,'\0',length);
	seq=(char *)malloc(length*sizeof(char));
	memset(seq,'\0',length*sizeof(char));

	fp=fopen(input,"r");   //open the sequence file
	if(fp==NULL)
	{
		printf("Error! can't open the %s file!\n",input);
		exit(1);
	}
	fread(temp,length*sizeof(char),1,fp);
        fclose(fp); 

        length=0;
        i=0;
        while(temp[i]!='\n')
        {
                i++;
        }
        i++;
        while(temp[i]!='\0')
        {
                if(temp[i]=='\n')
                {
                        i++;
                        continue;
                }
		if(temp[i]=='a'||temp[i]=='A')
	                seq[length]='A';
		else if(temp[i]=='t'||temp[i]=='T')
			seq[length]='T';
		else if(temp[i]=='c'||temp[i]=='C')
                        seq[length]='C';
		else if(temp[i]=='g'||temp[i]=='G')
                        seq[length]='G';
		else
			seq[length]='N';
                i++;
                length++;
        }
        free(temp);
	length=strlen(seq);

//input Tm parameter
	fp=fopen(tm_path,"r");  //read the paramter of deltah and deltas
	if(fp==NULL)
	{
		printf("Error: can't open the %s file!\n",tm_path);
		exit(1);
	}
	while(fscanf(fp,"%d\t%f\t%f",&i,&temp1,&temp2)!=EOF)
	{
		deltah[i]=temp1;
		deltas[i]=temp2;
	}
	fclose(fp);

	end=time(NULL);
	printf("It takes %d seconds to prepare.\n",(int)difftime(end,start));
	start=time(NULL);
	Num[0]=0; //primer
	Num[1]=0; //probe
	candidate_primer(seq,flag,Primer,Probe,Num,deltah,deltas,length,stackEntropies,stackEnthalpies,stackint2Entropies,stackint2Enthalpies,dangleEntropies3,dangleEnthalpies3,dangleEntropies5,dangleEnthalpies5,hairpinLoopEntropies,interiorLoopEntropies,bulgeLoopEntropies,hairpinLoopEnthalpies,interiorLoopEnthalpies,bulgeLoopEnthalpies,tstackEntropies,tstackEnthalpies,tstack2Entropies,tstack2Enthalpies,triloopEntropies1,triloopEnthalpies1,tetraloopEntropies1,tetraloopEnthalpies1,triloopEntropies2,triloopEnthalpies2,tetraloopEntropies2,tetraloopEnthalpies2,numTriloops,numTetraloops,atpS,atpH);
	free(seq);
	printf("There are %d candidate primers.\n",Num[0]);
	fclose(Primer);
	if(flag[3]==0)
	{
		printf("There are %d candidate exo probes.\n",Num[1]);
		fclose(Probe);
	}
	//check
	if(Num[0]<2)
		printf("Warning: there don't have enough primers(>=2).\n");
	if(flag[3]==0 && Num[1]<1)
		printf("Warning: there don't have any probes.\n");

	end=time(NULL);
        printf("It takes %d seconds to identify candidate single primer or probe regions.\n",(int)difftime(end,start));

	free(store_path);
	free(prefix);
	free(tm_path);
	free(curren_path);
	free(input);
	if(flag[4]==0)
	{
		free(triloopEntropies1);
	        free(triloopEnthalpies1);
	        free(tetraloopEntropies1);
	        free(tetraloopEnthalpies1);
	        free(triloopEntropies2);
	        free(triloopEnthalpies2);
	        free(tetraloopEntropies2);
	        free(tetraloopEnthalpies2);
	}
	if((flag[4]==0)||flag[5])
		free(par_path);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb588, %rsp           # imm = 0xB588
movq %rsi, %r14
movl %edi, %r12d
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x1160
movq %rax, -0xb8(%rbp)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x70(%rbp)
movq $0x0, -0x60(%rbp)
movl $0x1, %r13d
movl %r13d, -0x50(%rbp)
movl %r13d, -0x2c(%rbp)
cmpl $0x2, %r12d
jl 0xb290
movl -0x5c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x90(%rbp)
xorl %ebx, %ebx
movq %r14, -0x88(%rbp)
movl %r12d, -0xb0(%rbp)
movq %rbx, -0x38(%rbp)
movslq %r13d, %r15
movq (%r14,%r15,8), %rbx
movq %rbx, %rdi
leaq 0x13c2(%rip), %rsi      # 0xc283
callq 0x1120
testl %eax, %eax
je 0xaff6
movq %rbx, %rdi
leaq 0x13af(%rip), %rsi      # 0xc287
callq 0x1120
testl %eax, %eax
je 0xb070
movq %rbx, %rdi
leaq 0x139d(%rip), %rsi      # 0xc28c
callq 0x1120
testl %eax, %eax
je 0xb0ec
movq %rbx, %rdi
leaq 0x138b(%rip), %rsi      # 0xc291
callq 0x1120
testl %eax, %eax
je 0xbd2d
movq %rbx, %rdi
leaq 0x1377(%rip), %rsi      # 0xc294
callq 0x1120
testl %eax, %eax
je 0xbd2d
movq %rbx, %rdi
leaq 0x1712(%rip), %rsi      # 0xc646
callq 0x1120
testl %eax, %eax
je 0xb16f
movq %rbx, %rdi
leaq 0x1756(%rip), %rsi      # 0xc6a1
callq 0x1120
testl %eax, %eax
je 0xb1eb
movq %rbx, %rdi
leaq 0x1338(%rip), %rsi      # 0xc29a
callq 0x1120
testl %eax, %eax
jne 0xbdf5
leal 0x1(%r13), %eax
cmpl %r12d, %eax
je 0xbe30
cltq
movq %r14, %r12
movq (%r14,%rax,8), %r14
movq %r14, %rdi
callq 0x10c0
movq %rax, %rbx
movslq %ebx, %rcx
movq %rcx, -0x40(%rbp)
shlq $0x20, %rbx
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rbx, %rax
sarq $0x20, %rax
cmpb $0x2f, (%r14,%rax)
jne 0xb1fb
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
sarq $0x20, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %rbx
movq 0x8(%r12,%r15,8), %rsi
movq %rax, %rdi
callq 0x1050
movq %rbx, -0x98(%rbp)
movq -0x40(%rbp), %rax
addq %rbx, %rax
movq %rax, %rbx
jmp 0xb246
leal 0x1(%r13), %eax
cmpl %r12d, %eax
je 0xbd5a
cltq
movq (%r14,%rax,8), %rdi
callq 0x10c0
shlq $0x20, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq (%rax,%rcx), %rbx
sarq $0x20, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x10f0
movq -0x88(%rbp), %rax
movq 0x8(%rax,%r15,8), %rsi
movq %r14, -0xc0(%rbp)
movq %r14, %rdi
movq -0x88(%rbp), %r14
callq 0x1050
addl $0x2, %r13d
movl %r13d, -0x2c(%rbp)
movl $0x1, %ebx
jmp 0xb266
leal 0x1(%r13), %eax
cmpl %r12d, %eax
je 0xbd8e
cltq
movq (%r14,%rax,8), %rdi
callq 0x10c0
shlq $0x20, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq (%rax,%rcx), %rbx
sarq $0x20, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x10f0
movq -0x88(%rbp), %rax
movq 0x8(%rax,%r15,8), %rsi
movq %r14, -0x108(%rbp)
movq %r14, %rdi
movq -0x88(%rbp), %r14
callq 0x1050
addl $0x2, %r13d
movl %r13d, -0x2c(%rbp)
movl $0x1, -0x80(%rbp)
jmp 0xb262
leal 0x1(%r13), %eax
cmpl %r12d, %eax
je 0xbdc3
cltq
movq (%r14,%rax,8), %r14
movq %r14, %rdi
callq 0x10c0
movq %rax, %rbx
shlq $0x20, %rbx
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rbx, %rax
sarq $0x20, %rax
cmpb $0x2f, (%r14,%rax)
jne 0xb182
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
sarq $0x20, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x10f0
movq -0x88(%rbp), %rbx
movq 0x8(%rbx,%r15,8), %rsi
movq %r14, -0xa0(%rbp)
movq %r14, %rdi
callq 0x1050
movq %rbx, %r14
jmp 0xb1d7
incl %r13d
movl %r13d, -0x2c(%rbp)
movl $0x1, -0x48(%rbp)
jmp 0xb262
movabsq $0x200000000, %rax      # imm = 0x200000000
leaq (%rbx,%rax), %r14
sarq $0x20, %r14
movq %r14, %rdi
callq 0x1170
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x10f0
movq -0x88(%rbp), %r14
movq 0x8(%r14,%r15,8), %rsi
movq %r12, %rdi
callq 0x1050
sarq $0x20, %rbx
movq %r12, -0xa0(%rbp)
movb $0x2f, (%r12,%rbx)
movl -0xb0(%rbp), %r12d
addl $0x2, %r13d
movl %r13d, -0x2c(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0xb262
incl %r13d
movl %r13d, -0x2c(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0xb262
movabsq $0x200000000, %rax      # imm = 0x200000000
leaq (%rbx,%rax), %rdi
sarq $0x20, %rdi
callq 0x1170
movq %rax, %r14
movq 0x8(%r12,%r15,8), %rsi
movq %rax, %rdi
callq 0x1050
movq -0x40(%rbp), %rax
movb $0x2f, (%r14,%rax)
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
sarq $0x20, %rbx
movq %r14, -0x98(%rbp)
addq %r14, %rbx
movq %r12, %r14
movb $0x0, (%rbx)
addl $0x2, %r13d
movl %r13d, -0x2c(%rbp)
movl $0x1, -0x40(%rbp)
movl -0xb0(%rbp), %r12d
movq -0x38(%rbp), %rbx
cmpl %r12d, %r13d
jl 0xaeac
movl -0x40(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x90(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl %ebx, -0x70(%rbp)
testl %ebx, %ebx
je 0xbe6e
cmpl $0x0, -0x6c(%rbp)
movq -0x108(%rbp), %r13
je 0xbe77
movl $0x0, -0x2c(%rbp)
cmpb $0x0, (%r13)
je 0xb2db
xorl %ebx, %ebx
cmpb $0x2f, (%r13,%rbx)
je 0xbd21
incq %rbx
movl %ebx, -0x2c(%rbp)
movq %r13, %rdi
callq 0x10c0
cmpq %rbx, %rax
ja 0xb2bc
movl $0x1000, %edi           # imm = 0x1000
callq 0x1170
movq %rax, %rbx
movl $0x1000, %edx           # imm = 0x1000
movq %rax, %rdi
xorl %esi, %esi
callq 0x10f0
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
callq 0x1100
movq %rbx, %rdi
callq 0x10c0
movq %rax, %r15
shlq $0x20, %r15
movabsq $0x100000000, %r12      # imm = 0x100000000
addq %r15, %r12
sarq $0x20, %r12
movq %r12, %rdi
callq 0x1170
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x10f0
movq %r14, -0x38(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1050
cmpl $0x0, -0x68(%rbp)
jne 0xb395
movabsq $0x200000000, %r14      # imm = 0x200000000
addq %r15, %r14
sarq $0x20, %r14
movq %r14, %rdi
callq 0x1170
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x10f0
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1050
sarq $0x20, %r15
movq %r12, -0xa0(%rbp)
movb $0x2f, (%r12,%r15)
movq %rbx, %rdi
callq 0x1030
movq -0xa0(%rbp), %r14
movq %r14, %rdi
callq 0x10c0
movq %rax, %rbx
movq %r13, %rdi
callq 0x10c0
addl %eax, %ebx
addl $0xa, %ebx
movslq %ebx, %r12
movq %r12, %rdi
callq 0x1170
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x10f0
movq %r15, %rdi
movq %r14, %rsi
callq 0x1050
movq %r15, %rdi
callq 0x10c0
movabsq $0x2f72656d697250, %rcx # imm = 0x2F72656D697250
movq %rcx, (%r15,%rax)
movq %r15, %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0x1070
movq %r15, %rdi
movq %r13, %rsi
callq 0x11b0
leaq 0xead(%rip), %rsi       # 0xc2c4
movq %r15, %rdi
callq 0x11a0
movq %rax, -0x90(%rbp)
testq %rax, %rax
je 0xbe62
cmpl $0x0, -0x64(%rbp)
jne 0xb49a
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x10f0
movq %r15, %rdi
movq -0xa0(%rbp), %rsi
callq 0x1050
movq %r15, %rdi
callq 0x10c0
movl $0x626f7250, (%r15,%rax) # imm = 0x626F7250
movl $0x2f6562, 0x3(%r15,%rax) # imm = 0x2F6562
movq %r15, %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0x1070
movq %r15, %rdi
movq %r13, %rsi
callq 0x11b0
leaq 0xe3b(%rip), %rsi       # 0xc2c4
movq %r15, %rdi
callq 0x11a0
testq %rax, %rax
je 0xbe62
movq %rax, -0xb0(%rbp)
movq %r15, %rdi
callq 0x1030
movl -0x5c(%rbp), %r15d
testl %r15d, %r15d
movq -0x98(%rbp), %r13
jne 0xb53e
movq -0x38(%rbp), %rdi
callq 0x10c0
movq %rax, %rbx
movq %rax, %r12
shlq $0x20, %r12
movabsq $0xa00000000, %r14      # imm = 0xA00000000
addq %r12, %r14
sarq $0x20, %r14
movq %r14, %rdi
callq 0x1170
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x10f0
movq %r13, %rdi
movq -0x38(%rbp), %rsi
callq 0x1050
movslq %ebx, %rcx
leaq -0x1(%rcx), %rax
movl %eax, -0x2c(%rbp)
cmpb $0x2f, -0x1(%r13,%rcx)
je 0xb527
sarq $0x20, %r12
movb $0x2f, (%r13,%r12)
movb $0x0, 0x2(%r13,%rax)
movq %r13, %rdi
callq 0x10c0
movl $0x2f726150, (%r13,%rax) # imm = 0x2F726150
movb $0x0, 0x4(%r13,%rax)
addl $0x1e, %ebx
movslq %ebx, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x10f0
movq %r14, %rdi
movq %r13, %rsi
callq 0x1050
movq %r14, %rdi
callq 0x10c0
movupd 0xd78(%rip), %xmm0      # 0xc2ef
movupd %xmm0, (%r14,%rax)
movq %r14, -0x88(%rbp)
movl $0x747874, 0x10(%r14,%rax) # imm = 0x747874
movl -0x60(%rbp), %r12d
orl %r12d, %r15d
jne 0xb625
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x10c0
movq %rax, -0x98(%rbp)
movq %rax, %r15
shlq $0x20, %r15
movabsq $0xa00000000, %r14      # imm = 0xA00000000
addq %r15, %r14
sarq $0x20, %r14
movq %r14, %rdi
callq 0x1170
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x10f0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1050
movslq -0x98(%rbp), %rcx
leaq -0x1(%rcx), %rax
movl %eax, -0x2c(%rbp)
cmpb $0x2f, -0x1(%r13,%rcx)
je 0xb60e
sarq $0x20, %r15
movb $0x2f, (%r13,%r15)
movb $0x0, 0x2(%r13,%rax)
movq %r13, %rdi
callq 0x10c0
movl $0x2f726150, (%r13,%rax) # imm = 0x2F726150
movb $0x0, 0x4(%r13,%rax)
testl %r12d, %r12d
movq %r13, -0x98(%rbp)
je 0xb645
movq %rax, -0x40(%rbp)
movq %rax, -0x48(%rbp)
movq -0xc0(%rbp), %r12
jmp 0xb873
leaq -0xb5b0(%rbp), %rdi
leaq -0xa220(%rbp), %rsi
movq %r13, %rdx
callq 0x14c7
leaq -0x8e90(%rbp), %rdi
leaq -0x7b00(%rbp), %rsi
movq %r13, %rdx
callq 0x18c2
leaq -0x1930(%rbp), %rdi
leaq -0x1540(%rbp), %rsi
leaq -0x1150(%rbp), %rdx
leaq -0xd60(%rbp), %rcx
movq %r13, %r8
callq 0x1cb9
subq $0x8, %rsp
leaq -0x8e0(%rbp), %rdi
leaq -0x7f0(%rbp), %rsi
leaq -0x700(%rbp), %rdx
leaq -0x610(%rbp), %rcx
leaq -0x520(%rbp), %r8
leaq -0x430(%rbp), %r9
pushq %r13
callq 0x2258
addq $0x10, %rsp
leaq -0x6770(%rbp), %rdi
leaq -0x53e0(%rbp), %rsi
movq %r13, %rdx
callq 0x2413
leaq -0x4050(%rbp), %rdi
leaq -0x2cc0(%rbp), %rsi
movq %r13, %rdx
callq 0x2766
xorl %r14d, %r14d
movq %r13, %rdi
xorl %esi, %esi
callq 0x2ab5
movl %eax, %r15d
leal (%r15,%r15,4), %eax
movslq %eax, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %r12
movq %rbx, %rdi
callq 0x1170
movq %rax, %r13
movq %r15, -0x40(%rbp)
movslq %r15d, %rbx
shlq $0x3, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %r15
movq %rbx, %rdi
callq 0x1170
movq %r12, -0xf0(%rbp)
movq %r12, %rdi
movq %r13, -0xe8(%rbp)
movq %r13, %rsi
movq %r15, -0x100(%rbp)
movq %r15, %rdx
movq %rax, -0xf8(%rbp)
movq %rax, %rcx
movq -0x98(%rbp), %r8
callq 0x2bb4
movq -0x98(%rbp), %rdi
movl $0x1, %esi
callq 0x2ab5
movl %eax, %r15d
leal (%r15,%r15), %eax
leal (%rax,%rax,2), %eax
movslq %eax, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %r12
movq %rbx, %rdi
callq 0x1170
movq %rax, %r13
movq %r15, -0x48(%rbp)
movslq %r15d, %rbx
shlq $0x3, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %r15
movq %rbx, %rdi
callq 0x1170
movq %r12, -0xd0(%rbp)
movq %r12, %rdi
movq %r13, -0xc8(%rbp)
movq %r13, %rsi
movq -0x98(%rbp), %r8
movq %r15, -0xe0(%rbp)
movq %r15, %rdx
movq %rax, -0xd8(%rbp)
movq %rax, %rcx
callq 0x2ea7
leaq -0x270(%rbp), %rax
movabsq $0x3da5fd7fe1796495, %rcx # imm = 0x3DA5FD7FE1796495
movq -0xc0(%rbp), %r12
xorl %edx, %edx
movq %rcx, (%rax,%rdx,8)
incq %rdx
cmpq $0x5, %rdx
jne 0xb819
incq %r14
addq $0x28, %rax
cmpq $0x5, %r14
jne 0xb817
movabsq $0x401b99999999999a, %rax # imm = 0x401B99999999999A
movq %rax, -0x1f8(%rbp)
movq %rax, -0x258(%rbp)
leaq -0x340(%rbp), %rbx
movl $0xc8, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10f0
movabsq $0x40a1300000000000, %rax # imm = 0x40A1300000000000
movq %rax, 0x78(%rbx)
movq %rax, 0x18(%rbx)
movq %r12, %rdi
xorl %esi, %esi
callq 0x1190
cmpl $-0x1, %eax
je 0xbe92
leaq -0x970(%rbp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1140
movl 0x30(%rbx), %eax
addl $0x64, %eax
movslq %eax, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x10f0
movq %rbx, %rdi
callq 0x1170
movq %rax, -0x80(%rbp)
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x10f0
leaq 0x9c4(%rip), %rsi       # 0xc29d
movq %r12, %rdi
callq 0x11a0
testq %rax, %rax
je 0xbe9b
movq %rax, %r14
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rcx
callq 0x1090
movq %r14, %rdi
callq 0x10b0
xorl %eax, %eax
cmpb $0xa, (%r15,%rax)
leaq 0x1(%rax), %rax
jne 0xb90a
movl %eax, -0x2c(%rbp)
xorl %ecx, %ecx
movq -0x80(%rbp), %rbx
movslq %eax, %rsi
addq %r15, %rsi
movzbl (%rsi), %edx
cmpl $0xa, %edx
jne 0xb933
incl %eax
incq %rsi
jmp 0xb924
cmpl $0x53, %edx
jle 0xb94e
cmpl $0x62, %edx
jle 0xb96c
cmpl $0x63, %edx
je 0xb97a
cmpl $0x67, %edx
je 0xb968
cmpl $0x74, %edx
je 0xb97e
jmp 0xb982
cmpl $0x42, %edx
jg 0xb95e
testl %edx, %edx
je 0xb98e
cmpl $0x41, %edx
je 0xb976
jmp 0xb982
cmpl $0x43, %edx
je 0xb97a
cmpl $0x47, %edx
jne 0xb982
movb $0x47, %dl
jmp 0xb984
cmpl $0x54, %edx
je 0xb97e
cmpl $0x61, %edx
jne 0xb982
movb $0x41, %dl
jmp 0xb984
movb $0x43, %dl
jmp 0xb984
movb $0x54, %dl
jmp 0xb984
movb $0x4e, %dl
movb %dl, (%rbx,%rcx)
incl %eax
incq %rcx
jmp 0xb91e
movl %eax, -0x2c(%rbp)
movq %r15, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x10c0
movq %rax, %r14
leaq 0x8f2(%rip), %rsi       # 0xc29d
movq -0x88(%rbp), %rdi
callq 0x11a0
testq %rax, %rax
je 0xbea7
movq %rax, %rbx
movq %r14, -0x78(%rbp)
leaq 0x995(%rip), %rsi       # 0xc363
leaq -0x2c(%rbp), %rdx
leaq -0xa8(%rbp), %rcx
leaq -0xa4(%rbp), %r8
movq %rax, %rdi
xorl %eax, %eax
callq 0x1060
cmpl $-0x1, %eax
je 0xba49
leaq 0x96d(%rip), %r15       # 0xc363
leaq -0x2c(%rbp), %r13
leaq -0xa8(%rbp), %r14
leaq -0xa4(%rbp), %r12
movss -0xa8(%rbp), %xmm0
movslq -0x2c(%rbp), %rax
movss %xmm0, -0x1a0(%rbp,%rax,4)
movss -0xa4(%rbp), %xmm0
movss %xmm0, -0x160(%rbp,%rax,4)
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x1060
cmpl $-0x1, %eax
jne 0xba08
movq %rbx, %rdi
callq 0x10b0
xorl %edi, %edi
callq 0x1160
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
callq 0x10e0
cvttsd2si %xmm0, %esi
leaq 0x8fa(%rip), %rdi       # 0xc36c
xorl %eax, %eax
callq 0x10d0
xorl %edi, %edi
callq 0x1160
movq %rax, -0xb8(%rbp)
leaq -0x114(%rbp), %r13
movq $0x0, (%r13)
leaq -0x340(%rbp), %rax
leaq -0x270(%rbp), %r10
leaq -0x4050(%rbp), %r11
leaq -0x70(%rbp), %r15
leaq -0x1a0(%rbp), %r9
movq -0x80(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq -0x90(%rbp), %rbx
movq %rbx, %rdx
movq -0xb0(%rbp), %r14
movq %r14, %rcx
movq %r13, %r8
pushq %rax
pushq %r10
pushq -0x48(%rbp)
pushq -0x40(%rbp)
pushq -0xd8(%rbp)
pushq -0xe0(%rbp)
pushq -0xf8(%rbp)
pushq -0x100(%rbp)
pushq -0xc8(%rbp)
pushq -0xd0(%rbp)
pushq -0xe8(%rbp)
pushq -0xf0(%rbp)
leaq -0x2cc0(%rbp), %rax
pushq %rax
pushq %r11
leaq -0x53e0(%rbp), %rax
pushq %rax
leaq -0x6770(%rbp), %rax
pushq %rax
leaq -0x430(%rbp), %rax
pushq %rax
leaq -0x520(%rbp), %rax
pushq %rax
leaq -0x610(%rbp), %rax
pushq %rax
leaq -0x700(%rbp), %rax
pushq %rax
leaq -0x7f0(%rbp), %rax
pushq %rax
leaq -0x8e0(%rbp), %rax
pushq %rax
leaq -0xd60(%rbp), %rax
pushq %rax
leaq -0x1150(%rbp), %rax
pushq %rax
leaq -0x1540(%rbp), %rax
pushq %rax
leaq -0x1930(%rbp), %rax
pushq %rax
leaq -0x7b00(%rbp), %rax
pushq %rax
leaq -0x8e90(%rbp), %rax
pushq %rax
leaq -0xa220(%rbp), %rax
pushq %rax
leaq -0xb5b0(%rbp), %rax
pushq %rax
pushq -0x78(%rbp)
leaq -0x160(%rbp), %rax
pushq %rax
callq 0x9caa
addq $0x100, %rsp            # imm = 0x100
movq %r12, %rdi
callq 0x1030
movl (%r13), %r12d
leaq 0x7c9(%rip), %rdi       # 0xc38d
movl %r12d, %esi
xorl %eax, %eax
callq 0x10d0
movq %rbx, %rdi
callq 0x10b0
movl 0xc(%r15), %ebx
testl %ebx, %ebx
jne 0xbbfa
movl -0x110(%rbp), %esi
leaq 0x7c3(%rip), %rdi       # 0xc3ae
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
callq 0x10b0
cmpl $0x1, %r12d
movq -0x108(%rbp), %r14
movq -0x98(%rbp), %r15
movq -0x88(%rbp), %r12
jg 0xbc21
leaq 0xb90(%rip), %rdi       # 0xc7ac
callq 0x1080
testl %ebx, %ebx
movq -0xc0(%rbp), %rbx
jne 0xbc41
cmpl $0x0, -0x110(%rbp)
jg 0xbc41
leaq 0xb9f(%rip), %rdi       # 0xc7db
callq 0x1080
xorl %edi, %edi
callq 0x1160
movq %rax, %rdi
movq -0xb8(%rbp), %rsi
callq 0x10e0
cvttsd2si %xmm0, %esi
leaq 0x770(%rip), %rdi       # 0xc3d2
xorl %eax, %eax
callq 0x10d0
movq -0xa0(%rbp), %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movq %r12, %rdi
callq 0x1030
movq -0x38(%rbp), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movl -0x60(%rbp), %ebx
testl %ebx, %ebx
jne 0xbcfd
movq -0xf0(%rbp), %rdi
callq 0x1030
movq -0xe8(%rbp), %rdi
callq 0x1030
movq -0xd0(%rbp), %rdi
callq 0x1030
movq -0xc8(%rbp), %rdi
callq 0x1030
movq -0x100(%rbp), %rdi
callq 0x1030
movq -0xf8(%rbp), %rdi
callq 0x1030
movq -0xe0(%rbp), %rdi
callq 0x1030
movq -0xd8(%rbp), %rdi
callq 0x1030
testl %ebx, %ebx
je 0xbd07
cmpl $0x0, -0x5c(%rbp)
je 0xbd0f
movq %r15, %rdi
callq 0x1030
addq $0xb588, %rsp           # imm = 0xB588
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xad9(%rip), %rdi       # 0xc801
jmp 0xbe7e
movl -0x40(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x90(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x38(%rbp), %rax
movl %eax, -0x70(%rbp)
jmp 0xbe83
movl -0x40(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x90(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl $0x1, -0x70(%rbp)
leaq 0xbbe(%rip), %rdi       # 0xc947
jmp 0xbe7e
movl -0x40(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x90(%rbp), %eax
movl %eax, -0x68(%rbp)
movl $0x1, -0x6c(%rbp)
movq -0x38(%rbp), %rax
movl %eax, -0x70(%rbp)
leaq 0xb5b(%rip), %rdi       # 0xc919
jmp 0xbe7e
movl -0x40(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x64(%rbp)
movl $0x1, -0x68(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x38(%rbp), %rax
movl %eax, -0x70(%rbp)
leaq 0xafb(%rip), %rdi       # 0xc8eb
jmp 0xbe7e
movl -0x40(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x90(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x38(%rbp), %rax
movl %eax, -0x70(%rbp)
leaq 0x47b(%rip), %rdi       # 0xc29f
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10d0
jmp 0xbe83
movl $0x1, -0x5c(%rbp)
movl -0x78(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x90(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x38(%rbp), %rax
movl %eax, -0x70(%rbp)
leaq 0xa5d(%rip), %rdi       # 0xc8bd
jmp 0xbe7e
leaq 0x45d(%rip), %rdi       # 0xc2c6
movq %r15, %rsi
jmp 0xbeb5
leaq 0xa0a(%rip), %rdi       # 0xc87f
jmp 0xbe7e
leaq 0x9bd(%rip), %rdi       # 0xc83b
callq 0x1080
callq 0xad27
movl $0x1, %edi
callq 0x11c0
leaq 0x46a(%rip), %rdi       # 0xc303
jmp 0xbea2
leaq 0x481(%rip), %rdi       # 0xc323
movq %r12, %rsi
jmp 0xbeb5
leaq 0x495(%rip), %rdi       # 0xc343
movq -0x88(%rbp), %rsi
xorl %eax, %eax
callq 0x10d0
jmp 0xbe88