// File: /workspace/github_c_makefile_star2_O2/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, %r13
movq %rdi, -0x70(%rbp)
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x1160
movq %rax, -0x88(%rbp)
cmpq $0x6, %rbx
je 0x9c5e
andl $0x0, -0xc0(%rbp,%rbx,4)
incq %rbx
jmp 0x9c4b
movl $0x1, -0xa0(%rbp)
movl -0xc0(%rbp), %ebx
movl -0xbc(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0xb0(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0xb4(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0xb8(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x2c(%rbp), %r15d
movq -0x70(%rbp), %rax
leal -0x1(%rax), %eax
movq %rax, -0x50(%rbp)
pushq $0x1
popq %rax
movl %eax, %r12d
movslq %r12d, %r12
cmpl -0x70(%rbp), %r12d
jge 0x9ff8
movq (%r13,%r12,8), %r14
movq %r14, %rdi
leaq 0x15d7(%rip), %rsi      # 0xb2a3
callq 0x1130
testl %eax, %eax
jne 0x9d2c
cmpl %r12d, -0x50(%rbp)
je 0xa9a5
leaq 0x1(%r12), %rax
cltq
movq (%r13,%rax,8), %rbx
movq %rbx, %rdi
callq 0x10c0
shlq $0x20, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq (%rax,%rcx), %rsi
sarq $0x20, %rsi
pushq $0x1
popq %rdi
callq 0x1120
movq %rax, -0x78(%rbp)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1050
addq $0x2, %r12
movl %r12d, %r15d
pushq $0x1
popq %rbx
jmp 0x9cb3
movl %r15d, -0x2c(%rbp)
movq %r14, %rdi
leaq 0x156d(%rip), %rsi      # 0xb2a7
callq 0x1130
testl %eax, %eax
je 0x9eb4
movq %r14, %rdi
leaq 0x155b(%rip), %rsi      # 0xb2ac
callq 0x1130
testl %eax, %eax
je 0x9f18
cmpb $0x2d, (%r14)
jne 0x9d76
cmpb $0x68, 0x1(%r14)
jne 0x9d76
cmpb $0x0, 0x2(%r14)
je 0xa9b5
movq %r14, %rdi
leaq 0x1531(%rip), %rsi      # 0xb2b1
callq 0x1130
testl %eax, %eax
je 0xa9b5
movq %r14, %rdi
leaq 0x18cc(%rip), %rsi      # 0xb663
callq 0x1130
testl %eax, %eax
je 0x9f82
movq %r14, %rdi
leaq 0x1910(%rip), %rsi      # 0xb6be
callq 0x1130
testl %eax, %eax
je 0x9f97
movq %r14, %rdi
leaq 0x14f2(%rip), %rsi      # 0xb2b7
callq 0x1130
testl %eax, %eax
jne 0xaa09
cmpl %r12d, -0x50(%rbp)
je 0xaa1c
leaq 0x1(%r12), %rax
cltq
movq (%r13,%rax,8), %r14
movq %r14, %rdi
callq 0x10c0
movq %rax, %r15
movslq %r15d, %rcx
movq %rcx, -0x38(%rbp)
shlq $0x20, %r15
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %r15, %rax
sarq $0x20, %rax
movq %r14, -0x48(%rbp)
cmpb $0x2f, (%r14,%rax)
jne 0x9e4c
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r15
sarq $0x20, %r15
movq %r15, %rdi
callq 0x1170
movq %rax, %r15
movq %rax, %rdi
movq -0x48(%rbp), %rsi
callq 0x1050
movq %r15, -0x48(%rbp)
addq %r15, -0x38(%rbp)
jmp 0x9e97
movabsq $0x200000000, %rax      # imm = 0x200000000
leaq (%r15,%rax), %rdi
sarq $0x20, %rdi
callq 0x1170
movq %rax, %r14
movq %rax, %rdi
movq -0x48(%rbp), %rsi
callq 0x1050
movq -0x38(%rbp), %rax
movb $0x2f, (%r14,%rax)
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r15
sarq $0x20, %r15
movq %r14, -0x48(%rbp)
addq %r14, %r15
movq %r15, -0x38(%rbp)
movq -0x38(%rbp), %rax
movb $0x0, (%rax)
addl $0x2, %r12d
movl %r12d, -0x2c(%rbp)
movl %r12d, %r15d
pushq $0x1
popq %rax
movl %eax, -0x38(%rbp)
jmp 0x9cb0
cmpl %r12d, -0x50(%rbp)
je 0xaa25
leaq 0x1(%r12), %rax
cltq
movq (%r13,%rax,8), %r14
movq %r14, %rdi
callq 0x10c0
shlq $0x20, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq (%rax,%rcx), %rsi
sarq $0x20, %rsi
pushq $0x1
popq %rdi
callq 0x1120
movq %rax, -0x90(%rbp)
movq %rax, %rdi
movq %r14, %rsi
callq 0x1050
addl $0x2, %r12d
movl %r12d, -0x2c(%rbp)
movl %r12d, %r15d
pushq $0x1
popq %rax
movl %eax, -0x58(%rbp)
jmp 0x9cb0
cmpl %r12d, -0x50(%rbp)
je 0xaa2e
leaq 0x1(%r12), %rax
cltq
movq (%r13,%rax,8), %r14
movq %r14, %rdi
callq 0x10c0
movq %rax, %r15
shlq $0x20, %r15
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %r15, %rax
sarq $0x20, %rax
cmpb $0x2f, (%r14,%rax)
jne 0x9fac
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r15
sarq $0x20, %r15
pushq $0x1
popq %rdi
movq %r15, %rsi
callq 0x1120
movq %rax, -0x60(%rbp)
movq %rax, %rdi
movq %r14, %rsi
callq 0x1050
jmp 0x9fe2
incl %r12d
movl %r12d, -0x2c(%rbp)
movl %r12d, %r15d
pushq $0x1
popq %rax
movl %eax, -0x3c(%rbp)
jmp 0x9cb0
incl %r12d
movl %r12d, -0x2c(%rbp)
movl %r12d, %r15d
pushq $0x1
popq %rax
movl %eax, -0x68(%rbp)
jmp 0x9cb0
movabsq $0x200000000, %rax      # imm = 0x200000000
leaq (%r15,%rax), %rsi
sarq $0x20, %rsi
pushq $0x1
popq %rdi
callq 0x1120
movq %rax, -0x60(%rbp)
movq %rax, %rdi
movq %r14, %rsi
callq 0x1050
sarq $0x20, %r15
movq -0x60(%rbp), %rax
movb $0x2f, (%rax,%r15)
addl $0x2, %r12d
movl %r12d, -0x2c(%rbp)
movl %r12d, %r15d
pushq $0x1
popq %rax
movl %eax, -0x80(%rbp)
jmp 0x9cb0
movl %r15d, -0x2c(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0xb0(%rbp)
movl -0x3c(%rbp), %r14d
movl %r14d, -0xb4(%rbp)
movl -0x80(%rbp), %r13d
movl %r13d, -0xb8(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0xbc(%rbp)
movl %ebx, -0xc0(%rbp)
testl %ebx, %ebx
je 0xa9ce
testl %eax, %eax
movq -0x90(%rbp), %r12
je 0xa9d7
movq %r12, %rdi
callq 0x10c0
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0xa078
leaq 0x1(%rcx), %rdx
cmpb $0x2f, (%r12,%rcx)
movq %rdx, %rcx
jne 0xa054
decl %edx
movl %edx, -0x2c(%rbp)
leaq 0x17ab(%rip), %rdi      # 0xb81e
jmp 0xa9b0
movl %r14d, -0x3c(%rbp)
movl %ecx, -0x2c(%rbp)
pushq $0x1
popq %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
callq 0x1120
movq %rax, %r14
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
callq 0x1100
movq %r14, %rdi
callq 0x10c0
movq %rax, %r15
shlq $0x20, %r15
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq (%r15,%rax), %rsi
sarq $0x20, %rsi
movq %rbx, %rdi
callq 0x1120
movq %rax, -0x58(%rbp)
movq %rax, %rdi
movq %r14, %rsi
callq 0x1050
testl %r13d, %r13d
jne 0xa110
movabsq $0x200000000, %rsi      # imm = 0x200000000
addq %r15, %rsi
sarq $0x20, %rsi
pushq $0x1
popq %rdi
callq 0x1120
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x1050
sarq $0x20, %r15
movq %rbx, -0x60(%rbp)
movb $0x2f, (%rbx,%r15)
movq %r14, %rdi
callq 0x1030
movq -0x60(%rbp), %r13
movq %r13, %rdi
callq 0x10c0
movq %rax, %rbx
movq %r12, %rdi
callq 0x10c0
leal (%rax,%rbx), %r14d
addl $0xa, %r14d
movq %r12, %rbx
movslq %r14d, %r12
pushq $0x1
popq %rdi
movq %r12, %rsi
callq 0x1120
movq %rax, %r15
movq %rax, %rdi
movq %r13, %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 %rbx, %rsi
callq 0x11b0
leaq 0x1156(%rip), %rsi      # 0xb2e1
movq %r15, %rdi
callq 0x11a0
testq %rax, %rax
je 0xa9c2
movq %rax, -0x80(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0xa20c
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x10f0
movq %r15, %rdi
movq -0x60(%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 -0x90(%rbp), %rsi
callq 0x11b0
leaq 0x10e6(%rip), %rsi      # 0xb2e1
movq %r15, %rdi
callq 0x11a0
testq %rax, %rax
je 0xa9c2
movq %rax, -0x110(%rbp)
movq %r15, %rdi
callq 0x1030
movabsq $0xa00000000, %r15      # imm = 0xA00000000
movl -0x38(%rbp), %ebx
testl %ebx, %ebx
movq -0x78(%rbp), %r12
movq -0x48(%rbp), %r13
movq %r12, -0x78(%rbp)
jne 0xa2ac
movq -0x58(%rbp), %r12
movq %r12, %rdi
callq 0x10c0
movq %rax, %r14
movq %rax, %rbx
shlq $0x20, %rbx
leaq (%rbx,%r15), %rsi
sarq $0x20, %rsi
pushq $0x1
popq %rdi
callq 0x1120
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
callq 0x1050
movslq %r14d, %rcx
leaq -0x1(%rcx), %rax
movl %eax, -0x2c(%rbp)
cmpb $0x2f, -0x1(%r13,%rcx)
je 0xa28e
sarq $0x20, %rbx
movb $0x2f, (%r13,%rbx)
movb $0x0, 0x2(%r13,%rax)
movq %r13, %rdi
callq 0x10c0
movl $0x2f726150, (%r13,%rax) # imm = 0x2F726150
movb $0x0, 0x4(%r13,%rax)
movl -0x38(%rbp), %ebx
movq -0x78(%rbp), %r12
addl $0x1e, %r14d
movslq %r14d, %rsi
pushq $0x1
popq %rdi
callq 0x1120
movq %rax, %r14
movq %rax, %rdi
movq %r13, %rsi
callq 0x1050
movq %r14, %rdi
callq 0x10c0
movupd 0x1033(%rip), %xmm0     # 0xb30c
movupd %xmm0, (%r14,%rax)
movl $0x747874, 0x10(%r14,%rax) # imm = 0x747874
movl -0x68(%rbp), %eax
orl %eax, %ebx
movq %r14, -0x70(%rbp)
je 0xa304
testl %eax, %eax
je 0xa373
movq %rax, -0x38(%rbp)
movq %rax, -0x68(%rbp)
jmp 0xa542
movq -0x58(%rbp), %r12
movq %r12, %rdi
callq 0x10c0
movq %rax, %rbx
movq %rax, %r14
shlq $0x20, %r14
addq %r14, %r15
sarq $0x20, %r15
pushq $0x1
popq %rdi
movq %r15, %rsi
callq 0x1120
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
callq 0x1050
movslq %ebx, %rcx
leaq -0x1(%rcx), %rax
movl %eax, -0x2c(%rbp)
cmpb $0x2f, -0x1(%r13,%rcx)
je 0xa35c
sarq $0x20, %r14
movb $0x2f, (%r13,%r14)
movb $0x0, 0x2(%r13,%rax)
movq %r13, %rdi
callq 0x10c0
movl $0x2f726150, (%r13,%rax) # imm = 0x2F726150
movb $0x0, 0x4(%r13,%rax)
leaq -0xb5b0(%rbp), %rdi
leaq -0xa220(%rbp), %rsi
movq %r13, %rdx
callq 0x14aa
leaq -0x8e90(%rbp), %rdi
leaq -0x7b00(%rbp), %rsi
movq %r13, %rdx
callq 0x1869
leaq -0x1930(%rbp), %rdi
leaq -0x1540(%rbp), %rsi
leaq -0x1150(%rbp), %rdx
leaq -0xd60(%rbp), %rcx
movq %r13, %r8
callq 0x1c24
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 0x21a7
popq %rax
popq %rcx
leaq -0x6770(%rbp), %rdi
leaq -0x53e0(%rbp), %rsi
movq %r13, %rdx
callq 0x2338
leaq -0x4050(%rbp), %rdi
leaq -0x2cc0(%rbp), %rsi
movq %r13, %rdx
callq 0x2661
movq %r13, %rdi
xorl %esi, %esi
callq 0x2985
movl %eax, %r14d
leal (%r14,%r14,4), %eax
movslq %eax, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %r15
movq %rbx, %rdi
callq 0x1170
movq %rax, %r12
movq %r14, -0x38(%rbp)
movslq %r14d, %rbx
shlq $0x3, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %r14
movq %rbx, %rdi
callq 0x1170
movq %r15, -0xf0(%rbp)
movq %r15, %rdi
movq %r12, -0xe8(%rbp)
movq %r12, %rsi
movq %r14, -0x100(%rbp)
movq %r14, %rdx
movq %rax, -0xf8(%rbp)
movq %rax, %rcx
movq %r13, %r8
callq 0x2a6a
pushq $0x1
popq %rsi
movq %r13, %rdi
callq 0x2985
movl %eax, %r14d
imull $0x6, %eax, %eax
movslq %eax, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %r15
movq %rbx, %rdi
callq 0x1170
movq %rax, %r12
movq %r14, -0x68(%rbp)
movslq %r14d, %rbx
shlq $0x3, %rbx
movq %rbx, %rdi
callq 0x1170
movq %rax, %r14
movq %rbx, %rdi
callq 0x1170
movq %r15, -0xd0(%rbp)
movq %r15, %rdi
movq %r12, -0xc8(%rbp)
movq %r12, %rsi
movq %r14, -0xe0(%rbp)
movq %r14, %rdx
movq %rax, -0xd8(%rbp)
movq %rax, %rcx
movq %r13, %r8
callq 0x2cae
movsd 0xbc2(%rip), %xmm0      # 0xb0e0
leaq -0x340(%rbp), %rdi
callq 0x2efa
movsd 0xbb6(%rip), %xmm0      # 0xb0e8
leaq -0x270(%rbp), %rdi
callq 0x2f39
movq -0x78(%rbp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x1190
cmpl $-0x1, %eax
je 0xa9e0
leaq -0x970(%rbp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1150
movl 0x30(%rbx), %eax
addl $0x64, %eax
movslq %eax, %r15
pushq $0x1
popq %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1120
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1120
movq %rax, -0x50(%rbp)
leaq 0xd23(%rip), %rsi       # 0xb2ba
movq %r12, %rdi
callq 0x11a0
testq %rax, %rax
je 0xa9e9
movq %rax, %rbx
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rcx
callq 0x1090
movq %rbx, %rdi
callq 0x10b0
pushq $-0x1
popq %rax
cmpb $0xa, 0x1(%r14,%rax)
leaq 0x1(%rax), %rax
jne 0xa5c7
xorl %ecx, %ecx
movq -0x50(%rbp), %rbx
shlq $0x20, %rax
movabsq $0x100000000, %rdx      # imm = 0x100000000
addq %rdx, %rax
sarq $0x20, %rax
movzbl (%r14,%rax), %edx
cmpl $0xa, %edx
jne 0xa5fd
incq %rax
jmp 0xa5ee
testl %edx, %edx
je 0xa643
cmpl $0x41, %edx
je 0xa62d
cmpl $0x43, %edx
je 0xa631
cmpl $0x47, %edx
je 0xa635
cmpl $0x54, %edx
je 0xa629
cmpl $0x61, %edx
je 0xa62d
cmpl $0x63, %edx
je 0xa631
cmpl $0x67, %edx
je 0xa635
cmpl $0x74, %edx
jne 0xa639
movb $0x54, %dl
jmp 0xa63b
movb $0x41, %dl
jmp 0xa63b
movb $0x43, %dl
jmp 0xa63b
movb $0x47, %dl
jmp 0xa63b
movb $0x4e, %dl
movb %dl, (%rbx,%rcx)
incq %rcx
jmp 0xa5d9
movq %r13, -0x48(%rbp)
movl %eax, -0x2c(%rbp)
movq %r14, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x10c0
movq %rax, -0x108(%rbp)
leaq 0xc52(%rip), %rsi       # 0xb2ba
movq -0x70(%rbp), %rdi
callq 0x11a0
testq %rax, %rax
je 0xa9f5
movq %rax, %r14
leaq 0xcfc(%rip), %r13       # 0xb380
leaq -0x2c(%rbp), %r15
leaq -0x98(%rbp), %r12
leaq -0x94(%rbp), %rbx
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x1060
cmpl $-0x1, %eax
je 0xa6d9
movss -0x98(%rbp), %xmm0
movslq -0x2c(%rbp), %rax
movss %xmm0, -0x1a0(%rbp,%rax,4)
movss -0x94(%rbp), %xmm0
movss %xmm0, -0x160(%rbp,%rax,4)
jmp 0xa696
movq %r14, %rdi
callq 0x10b0
xorl %edi, %edi
callq 0x1160
movq %rax, %rdi
movq -0x88(%rbp), %rsi
callq 0x10e0
cvttsd2si %xmm0, %esi
leaq 0xc87(%rip), %rdi       # 0xb389
xorl %eax, %eax
callq 0x10d0
xorl %edi, %edi
callq 0x1160
movq %rax, -0x88(%rbp)
leaq -0x11c(%rbp), %r13
andq $0x0, (%r13)
leaq -0x270(%rbp), %rax
leaq -0x340(%rbp), %r10
leaq -0x4050(%rbp), %r11
leaq -0x6770(%rbp), %r15
leaq -0xc0(%rbp), %rsi
leaq -0x1a0(%rbp), %r9
movq -0x50(%rbp), %r14
movq %r14, %rdi
movq -0x80(%rbp), %rbx
movq %rbx, %rdx
movq -0x110(%rbp), %r12
movq %r12, %rcx
movq %r13, %r8
pushq %rax
pushq %r10
pushq -0x68(%rbp)
pushq -0x38(%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
pushq %r15
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 -0x108(%rbp)
leaq -0x160(%rbp), %rax
pushq %rax
callq 0x8daf
addq $0x100, %rsp            # imm = 0x100
movq %r14, %rdi
callq 0x1030
movl (%r13), %r15d
leaq 0xb58(%rip), %rdi       # 0xb3aa
movl %r15d, %esi
xorl %eax, %eax
callq 0x10d0
movq %rbx, %rdi
callq 0x10b0
movl -0x3c(%rbp), %r14d
testl %r14d, %r14d
jne 0xa889
movl -0x118(%rbp), %esi
leaq 0xb51(%rip), %rdi       # 0xb3cb
xorl %eax, %eax
callq 0x10d0
movq %r12, %rdi
callq 0x10b0
cmpl $0x1, %r15d
movq -0x78(%rbp), %rbx
movq -0x90(%rbp), %r15
movq -0x48(%rbp), %r12
jg 0xa8aa
leaq 0xf24(%rip), %rdi       # 0xb7c9
callq 0x1080
testl %r14d, %r14d
jne 0xa8c4
cmpl $0x0, -0x118(%rbp)
jg 0xa8c4
leaq 0xf39(%rip), %rdi       # 0xb7f8
callq 0x1080
xorl %edi, %edi
callq 0x1160
movq %rax, %rdi
movq -0x88(%rbp), %rsi
callq 0x10e0
cvttsd2si %xmm0, %esi
leaq 0xb0a(%rip), %rdi       # 0xb3ef
xorl %eax, %eax
callq 0x10d0
movq -0x60(%rbp), %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1030
movq -0x70(%rbp), %rdi
callq 0x1030
movq -0x58(%rbp), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
cmpl $0x0, -0xb0(%rbp)
je 0xa92b
cmpl $0x0, -0xac(%rbp)
jne 0xa98b
jmp 0xa993
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
movq %r12, %rdi
callq 0x1030
addq $0xb588, %rsp           # imm = 0xB588
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r15d, -0x2c(%rbp)
leaq 0xfb4(%rip), %rdi       # 0xb964
callq 0x1080
callq 0x9b1f
pushq $0x1
popq %rdi
callq 0x11c0
leaq 0x91a(%rip), %rdi       # 0xb2e3
movq %r15, %rsi
jmp 0xaa00
leaq 0xec7(%rip), %rdi       # 0xb89c
jmp 0xa9b0
leaq 0xe7a(%rip), %rdi       # 0xb858
jmp 0xa9b0
leaq 0x939(%rip), %rdi       # 0xb320
jmp 0xa9f0
leaq 0x950(%rip), %rdi       # 0xb340
movq %r12, %rsi
jmp 0xaa00
leaq 0x964(%rip), %rdi       # 0xb360
movq -0x70(%rbp), %rsi
xorl %eax, %eax
callq 0x10d0
jmp 0xa9ba
leaq 0x8ac(%rip), %rdi       # 0xb2bc
movq %r14, %rsi
xorl %eax, %eax
callq 0x10d0
jmp 0xa9b5
leaq 0xeb7(%rip), %rdi       # 0xb8da
jmp 0xa9b0
leaq 0xf0a(%rip), %rdi       # 0xb936
jmp 0xa9b0
leaq 0xed3(%rip), %rdi       # 0xb908
jmp 0xa9b0