// File: dcarrey[P]hgt-detection/./fonctions.cpp
// Function: printHGT(_IO_FILE*, _IO_FILE*, char*, CRITERIA*, char*, int, InputTree, HGT*, int, double*, char*, int)
void printHGT(FILE * res,FILE * res2,char *stepbystep,struct CRITERIA * multicheckTab,char *mode,int RFref,/*FILE *out,*/struct InputTree SpeciesTree,struct HGT *tabHGT, int nbHGT, double *tabBoot,char *subtree,int bootmin){
	int i,j,k;
	int diffHGT=0;
	FILE * res1 = res; //fopen ("result2.txt","w+");
	int nbTrivial=0;
	
	fprintf(res,"mode=%s\n",mode);
	
/*   if(strcmp(mode,"monocheck") == 0 || multicheckTab == NULL){
		for(i=1;i<=nbHGT;i++){
			if(i==1)
				diffHGT = RFref - tabHGT[i].crit.RF;
			else
				diffHGT = tabHGT[i-1].crit.RF - tabHGT[i].crit.RF;
		//	fprintf(out,"\n\n================ \n= HGT #%d %s \n==============",i,(diffHGT==1)?" (Trivial transfer: RF distance decreased by 1)":"");
			fprintf(res,"1");
            fprintf(res,"\nHGT %d %s",i,(diffHGT==1)?" Trivial":"");
			nbTrivial += tabHGT[i].trivial; //(diffHGT==1)?1:0;
	//		if(tabBoot != NULL)
	//			fprintf(out,"\nBootstrap value : %3.1lf%%",(double)tabBoot[i]);
			fprintf(res,"\n");
			for(int m=1;m<=tabHGT[i].listSource[0];m++){
				if(m == tabHGT[i].listSource[0])
					fprintf(res,"%s",SpeciesTree.SpeciesName[tabHGT[i].listSource[m]]);
				else
					fprintf(res,"%s, ",SpeciesTree.SpeciesName[tabHGT[i].listSource[m]]);
			}
			//fprintf(res,"\n%d",tabHGT[i].listDestination[0]);
			fprintf(res,"\n");
			for(int m=1;m<=tabHGT[i].listDestination[0];m++){
				if(m == tabHGT[i].listDestination[0])
					fprintf(res,"%s",SpeciesTree.SpeciesName[tabHGT[i].listDestination[m]]);
				else
					fprintf(res,"%s, ",SpeciesTree.SpeciesName[tabHGT[i].listDestination[m]]);
			}
	//		printTransfer(out,1,SpeciesTree.SpeciesName, SpeciesTree.size,tabHGT[i].source_A,tabHGT[i].source_B,tabHGT[i].dest_A,tabHGT[i].dest_B);
			printTransfer(res,1,SpeciesTree.SpeciesName, SpeciesTree.size,tabHGT[i].source_A,tabHGT[i].source_B,tabHGT[i].dest_A,tabHGT[i].dest_B);
	//		fprintf(out,"\nRF = %d \nLS = %lf \nBD = %lf",tabHGT[i].crit.RF,tabHGT[i].crit.LS,tabHGT[i].crit.BD,tabHGT[i].crit.QD);
			fprintf(res,"\nRF = %d , LS = %1.3lf , BD = %1.1lf\n",tabHGT[i].crit.RF,tabHGT[i].crit.LS,tabHGT[i].crit.BD,tabHGT[i].crit.QD);
		}
		if(nbHGT == 0){
	//		fprintf(out,"\n\nNo more HGT have been detected due to evolutionary constraints");
	//		fprintf(res,"\nNo more HGT have been detected due to evolutionary constraints\n");
		}
		else
			if(tabHGT[nbHGT].crit.RF != 0){
	//			fprintf(out,"\n\nNo more HGT have been detected due to evolutionary constraints ");
	//			fprintf(res,"\nNo more HGT have been detected due to evolutionary constraints\n");
			}
    
	} */
	// else{
		
		i=1;
		int lastRF=0;
		int trivial;
		int k1=1;
		for(j=1;j<=multicheckTab[0].m;j++){
		
			if(multicheckTab[j].nbHgtFound == 0) continue;
			//	fprintf(out,"\n\n=======> %d %s been found for this iteration",multicheckTab[j].nbHgtFound,(multicheckTab[j].nbHgtFound==1)?"hgt has":"hgts have");
				fprintf(res,"%d",multicheckTab[j].nbHgtFound);
				if(((j == multicheckTab[0].m) && (strcmp(stepbystep,"yes") == 0)) || (strcmp(stepbystep,"yes") != 0) ){
					fprintf(res2,"%d",multicheckTab[j].nbHgtFound);
				}
			for(k=1;k<=multicheckTab[j].nbHgtFound;k++){
				if(j==1)
					diffHGT = RFref - tabHGT[i].crit.RF;
				else
					diffHGT = multicheckTab[j-1].RF - tabHGT[i].crit.RF;
				trivial=0;
				if(
				  (tabHGT[i].source_A == tabHGT[i].dest_A ) ||
				  (tabHGT[i].source_A == tabHGT[i].dest_B ) ||
				  (tabHGT[i].source_B == tabHGT[i].dest_A ) ||
				  (tabHGT[i].source_B == tabHGT[i].dest_B ) 
				){
					trivial=1;
				}
			//			fprintf(out,"\n================ \n= HGT #%d/%d %s\n================",k,multicheckTab[j].nbHgtFound,(tabHGT[i].trivial == 1 )?" (Trivial transfer: RF distance decreased by 1)":"");//((trivial==1) && (diffHGT==1) )?" (Trivial transfer: RF distance decreased by 1)":"");
				fprintf(res,"\nHGT %d / %d %s%s%s%s",k,multicheckTab[j].nbHgtFound,(tabHGT[i].trivial == 1 )?" Trivial":"",((tabHGT[i].valide == 2 ) || (tabHGT[i].valide == 6))?" Reverse":"",(tabHGT[i].valide == 3 )?" Canceled":"",(tabHGT[i].valide == 5 )?" Initial":"");
				// fprintf(res,"\nHGT %d / %d %s",k,multicheckTab[j].nbHgtFound,(tabHGT[i].valide == 2 )?" Reverse":"");
				// fprintf(res,"\nHGT %d / %d %s",k,multicheckTab[j].nbHgtFound,(tabHGT[i].valide == 3 )?" Canceled":"");
				// fprintf(res,"\nHGT %d / %d %s",k,multicheckTab[j].nbHgtFound,(tabHGT[i].valide == 5 )?" Initial":"");
				// fprintf(res,"\nHGT %d / %d %s",k,multicheckTab[j].nbHgtFound,(tabHGT[i].trivial == 6 )?" Reverse":"");
				
				if(((j == multicheckTab[0].m) && (strcmp(stepbystep,"yes") == 0)) || (strcmp(stepbystep,"yes") != 0) ){
					fprintf(res2,"\nHGT %d / %d %s%s%s%s",k,multicheckTab[j].nbHgtFound,(tabHGT[i].trivial == 1 )?" Trivial":"",((tabHGT[i].valide == 2 ) || (tabHGT[i].valide == 6))?" Reverse":"",(tabHGT[i].valide == 3 )?" Canceled":"",(tabHGT[i].valide == 5 )?" Initial":"");
					// fprintf(res2,"\nHGT %d / %d %s",k,multicheckTab[j].nbHgtFound,(tabHGT[i].valide == 2 )?" Reverse":"");
					// fprintf(res2,"\nHGT %d / %d %s",k,multicheckTab[j].nbHgtFound,(tabHGT[i].valide == 3 )?" Canceled":"");
					// fprintf(res2,"\nHGT %d / %d %s",k,multicheckTab[j].nbHgtFound,(tabHGT[i].valide == 5 )?" Initial":"");
					// fprintf(res2,"\nHGT %d / %d %s",k,multicheckTab[j].nbHgtFound,(tabHGT[i].trivial == 6 )?" Reverse":"");
					fprintf(res2,"\nHGT %d / %d %s%s%s%s",k1++,nbHGT,(tabHGT[i].trivial == 1 )?" Trivial":"", ((tabHGT[i].valide == 2 ) || (tabHGT[i].valide == 6))?" Reverse":"",(tabHGT[i].valide == 3 )?" Canceled":"",(tabHGT[i].valide == 5 )?" Initial":"");
					
				}
				if(tabHGT[i].trivial == 1)
					nbTrivial ++;
			  //fprintf(out,"\n%s(%d)",(tabHGT[i].trivial == 1)?"TOTO":"TATA",tabHGT[i].trivial);
		//      if(tabBoot != NULL)
			//				fprintf(out,"\nBootstrap value : %3.1lf%%",(double)tabBoot[i]);

				if((tabBoot != NULL && tabBoot[i] >= bootmin) || (tabBoot == NULL)){
					//fprintf(res,"\n%d",tabHGT[i].listSource[0]);
					fprintf(res,"\n");
					for(int m=1;m<=tabHGT[i].listSource[0];m++){
						//fprintf(res,"%s ",SpeciesTree.SpeciesName[tabHGT[i].listSource[m]]);
						if(m == tabHGT[i].listSource[0])
							fprintf(res,"%s",SpeciesTree.SpeciesName[tabHGT[i].listSource[m]]);
						else
							fprintf(res,"%s, ",SpeciesTree.SpeciesName[tabHGT[i].listSource[m]]);
					}
					//fprintf(res,"\n%d",tabHGT[i].listDestination[0]);
					fprintf(res,"\n");
					for(int m=1;m<=tabHGT[i].listDestination[0];m++){
						//	fprintf(res,"%s ",SpeciesTree.SpeciesName[tabHGT[i].listDestination[m]]);
						if(m == tabHGT[i].listDestination[0])
							fprintf(res,"%s",SpeciesTree.SpeciesName[tabHGT[i].listDestination[m]]);	
						else
							fprintf(res,"%s, ",SpeciesTree.SpeciesName[tabHGT[i].listDestination[m]]);
								
					}
			//			printTransfer(out,1,SpeciesTree.SpeciesName, SpeciesTree.size,tabHGT[i].source_A,tabHGT[i].source_B,tabHGT[i].dest_A,tabHGT[i].dest_B);
					printTransfer(res1,1,SpeciesTree.SpeciesName, SpeciesTree.size,tabHGT[i].source_A,tabHGT[i].source_B,tabHGT[i].dest_A,tabHGT[i].dest_B);
					if(((j == multicheckTab[0].m) && (strcmp(stepbystep,"yes") == 0)) || (strcmp(stepbystep,"yes") != 0) ){
						//fprintf(res2,"\n%d--%d %d--%d",tabHGT[i].source_A,tabHGT[i].source_B,tabHGT[i].dest_A,tabHGT[i].dest_B);
						printTransfer(res2,1,SpeciesTree.SpeciesName, SpeciesTree.size,tabHGT[i].source_A,tabHGT[i].source_B,tabHGT[i].dest_A,tabHGT[i].dest_B);
					}
			//		  fprintf(out,"\nRF = %d \nLS = %lf \nBD = %lf",tabHGT[i].crit.RF,tabHGT[i].crit.LS,tabHGT[i].crit.BD,tabHGT[i].crit.QD);
					fprintf(res1,"\nRF = %d , LS = %1.3lf , BD = %1.1lf",tabHGT[i].crit.RF,tabHGT[i].crit.LS,tabHGT[i].crit.BD);
					fprintf(res1,"\nrRF = %d , rLS = %1.3lf , rBD = %1.1lf",tabHGT[i].crit.rRF,tabHGT[i].crit.rLS,tabHGT[i].crit.rBD);
					if(((j == multicheckTab[0].m) && (strcmp(stepbystep,"yes") == 0)) || (strcmp(stepbystep,"yes") != 0) ){
						fprintf(res2,"\nDIRECT : RF = %d , LS = %1.3lf , BD = %1.1lf",tabHGT[i].crit.RF,tabHGT[i].crit.LS,tabHGT[i].crit.BD);
						fprintf(res2,"\nREVERSE: RF = %d , LS = %1.3lf , BD = %1.1lf",tabHGT[i].crit.rRF,tabHGT[i].crit.rLS,tabHGT[i].crit.rBD);
					}
					i++;
				//	}
				}
			}
			//	fprintf(out,"\n\n=======> After this iteration the criteria are :");
		//		fprintf(out,"\nRF = %d \nLS = %lf \nBD = %lf",multicheckTab[j].RF,multicheckTab[j].LS,multicheckTab[j].BD,multicheckTab[j].QD);
			fprintf(res1,"\nRF = %d , LS = %1.3lf , BD = %1.1lf\n",multicheckTab[j].RF,multicheckTab[j].LS,multicheckTab[j].BD);
			if(((j == multicheckTab[0].m) && (strcmp(stepbystep,"yes") == 0)) || (strcmp(stepbystep,"yes") != 0) ){
				fprintf(res2,"\nRF = %d , LS = %1.3lf , BD = %1.1lf\n",multicheckTab[j].RF,multicheckTab[j].LS,multicheckTab[j].BD);
			}
			lastRF = multicheckTab[j].RF;
		}
	//		fprintf(out,"\n\nTotal number of HGTs : %d",nbHGT);
			
		if(lastRF != 0){
			//	fprintf(out,"\n\nNo more HGT have been detected due to evolutionary constraints");
		//		fprintf(res,"\nNo more HGT have been detected due to evolutionary constraints\n");
		}
		
	// }
	fprintf(res1,"Stat= %d %d",nbHGT,nbTrivial);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movl 0x88(%rbp), %eax
movq 0x80(%rbp), %rax
movq 0x78(%rbp), %rax
movl 0x70(%rbp), %eax
movq 0x68(%rbp), %rax
leaq 0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0xcc5a(%rip), %rsi      # 0x26282
movb $0x0, %al
callq 0x1140
movl $0x1, -0x30(%rbp)
movl $0x0, -0x50(%rbp)
movl $0x1, -0x58(%rbp)
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jg 0x1a1fd
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x3c(%rax)
jne 0x19675
jmp 0x1a1ef
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x3c(%rax), %edx
leaq 0xcbed(%rip), %rsi      # 0x2627f
movb $0x0, %al
callq 0x1140
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jne 0x196ba
movq -0x18(%rbp), %rdi
leaq 0xc32b(%rip), %rsi      # 0x259db
callq 0x1130
cmpl $0x0, %eax
je 0x196cf
movq -0x18(%rbp), %rdi
leaq 0xc316(%rip), %rsi      # 0x259db
callq 0x1130
cmpl $0x0, %eax
je 0x196f3
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x3c(%rax), %edx
leaq 0xcb93(%rip), %rsi      # 0x2627f
movb $0x0, %al
callq 0x1140
movl $0x1, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x20(%rbp), %rcx
movslq -0x34(%rbp), %rdx
imulq $0x60, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x3c(%rcx), %eax
jg 0x1a10e
cmpl $0x1, -0x34(%rbp)
jne 0x19738
movl -0x2c(%rbp), %eax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
subl 0x50(%rcx), %eax
movl %eax, -0x3c(%rbp)
jmp 0x19767
movq -0x20(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x30(%rax), %eax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
subl 0x50(%rcx), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x54(%rbp)
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x80(%rax), %eax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x88(%rcx), %eax
je 0x1983a
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x80(%rax), %eax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x8c(%rcx), %eax
je 0x1983a
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x84(%rax), %eax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x88(%rcx), %eax
je 0x1983a
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x84(%rax), %eax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x8c(%rcx), %eax
jne 0x19841
movl $0x1, -0x54(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x80(%rbp)
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x3c(%rax), %eax
movl %eax, -0x7c(%rbp)
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x90(%rax), %edx
leaq 0xc972(%rip), %rax      # 0x261f8
leaq 0xca14(%rip), %rcx      # 0x262a1
cmpl $0x1, %edx
cmoveq %rcx, %rax
movq %rax, -0x78(%rbp)
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rax
imulq $0xa8, %rax, %rax
addq %rax, %rcx
movb $0x1, %al
cmpl $0x2, (%rcx)
movb %al, -0x69(%rbp)
je 0x198cf
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
cmpl $0x6, (%rax)
sete %al
movb %al, -0x69(%rbp)
movq -0x78(%rbp), %r8
movl -0x7c(%rbp), %ecx
movl -0x80(%rbp), %edx
movq -0x88(%rbp), %rdi
movb -0x69(%rbp), %sil
leaq 0xc90d(%rip), %r9       # 0x261f8
leaq 0xc9b8(%rip), %rax      # 0x262aa
testb $0x1, %sil
cmovneq %rax, %r9
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl (%rax), %esi
leaq 0xc8e3(%rip), %r10      # 0x261f8
leaq 0xc997(%rip), %rax      # 0x262b3
cmpl $0x3, %esi
cmoveq %rax, %r10
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl (%rax), %r11d
leaq 0xc8b9(%rip), %rax      # 0x261f8
leaq 0xc977(%rip), %rsi      # 0x262bd
cmpl $0x5, %r11d
cmoveq %rsi, %rax
leaq 0xc936(%rip), %rsi      # 0x2628b
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x1140
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jne 0x19986
movq -0x18(%rbp), %rdi
leaq 0xc05f(%rip), %rsi      # 0x259db
callq 0x1130
cmpl $0x0, %eax
je 0x1999f
movq -0x18(%rbp), %rdi
leaq 0xc04a(%rip), %rsi      # 0x259db
callq 0x1130
cmpl $0x0, %eax
je 0x19c14
movq -0x10(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0xa0(%rbp)
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x3c(%rax), %eax
movl %eax, -0x9c(%rbp)
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x90(%rax), %edx
leaq 0xc80e(%rip), %rax      # 0x261f8
leaq 0xc8b0(%rip), %rcx      # 0x262a1
cmpl $0x1, %edx
cmoveq %rcx, %rax
movq %rax, -0x98(%rbp)
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rax
imulq $0xa8, %rax, %rax
addq %rax, %rcx
movb $0x1, %al
cmpl $0x2, (%rcx)
movb %al, -0x89(%rbp)
je 0x19a3c
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
cmpl $0x6, (%rax)
sete %al
movb %al, -0x89(%rbp)
movq -0x98(%rbp), %r8
movl -0x9c(%rbp), %ecx
movl -0xa0(%rbp), %edx
movq -0xa8(%rbp), %rdi
movb -0x89(%rbp), %sil
leaq 0xc794(%rip), %r9       # 0x261f8
leaq 0xc83f(%rip), %rax      # 0x262aa
testb $0x1, %sil
cmovneq %rax, %r9
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl (%rax), %esi
leaq 0xc76a(%rip), %r10      # 0x261f8
leaq 0xc81e(%rip), %rax      # 0x262b3
cmpl $0x3, %esi
cmoveq %rax, %r10
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl (%rax), %r11d
leaq 0xc740(%rip), %rax      # 0x261f8
leaq 0xc7fe(%rip), %rsi      # 0x262bd
cmpl $0x5, %r11d
cmoveq %rsi, %rax
leaq 0xc7bd(%rip), %rsi      # 0x2628b
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x1140
movq -0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0xc0(%rbp)
addl $0x1, %eax
movl %eax, -0x58(%rbp)
movl 0x70(%rbp), %eax
movl %eax, -0xbc(%rbp)
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x90(%rax), %edx
leaq 0xc6d8(%rip), %rax      # 0x261f8
leaq 0xc77a(%rip), %rcx      # 0x262a1
cmpl $0x1, %edx
cmoveq %rcx, %rax
movq %rax, -0xb8(%rbp)
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rax
imulq $0xa8, %rax, %rax
addq %rax, %rcx
movb $0x1, %al
cmpl $0x2, (%rcx)
movb %al, -0xa9(%rbp)
je 0x19b72
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
cmpl $0x6, (%rax)
sete %al
movb %al, -0xa9(%rbp)
movq -0xb8(%rbp), %r8
movl -0xbc(%rbp), %ecx
movl -0xc0(%rbp), %edx
movq -0xc8(%rbp), %rdi
movb -0xa9(%rbp), %sil
leaq 0xc65e(%rip), %r9       # 0x261f8
leaq 0xc709(%rip), %rax      # 0x262aa
testb $0x1, %sil
cmovneq %rax, %r9
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl (%rax), %esi
leaq 0xc634(%rip), %r10      # 0x261f8
leaq 0xc6e8(%rip), %rax      # 0x262b3
cmpl $0x3, %esi
cmoveq %rax, %r10
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl (%rax), %r11d
leaq 0xc60a(%rip), %rax      # 0x261f8
leaq 0xc6c8(%rip), %rsi      # 0x262bd
cmpl $0x5, %r11d
cmoveq %rsi, %rax
leaq 0xc687(%rip), %rsi      # 0x2628b
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x1140
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
cmpl $0x1, 0x90(%rax)
jne 0x19c38
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
cmpq $0x0, 0x78(%rbp)
je 0x19c5a
movq 0x78(%rbp), %rax
movslq -0x30(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
cvtsi2sdl 0x88(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jae 0x19c65
cmpq $0x0, 0x78(%rbp)
jne 0x1a0fe
movq -0x8(%rbp), %rdi
leaq 0xc587(%rip), %rsi      # 0x261f7
movb $0x0, %al
callq 0x1140
movl $0x1, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
movq 0x10(%rcx), %rcx
cmpl (%rcx), %eax
jg 0x19d46
movl -0x5c(%rbp), %eax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
movq 0x10(%rcx), %rcx
cmpl (%rcx), %eax
jne 0x19cfa
movq -0x68(%rbp), %rax
movq -0x8(%rbp), %rdi
movq 0x18(%rax), %rax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
movq 0x10(%rcx), %rcx
movslq -0x5c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xc7d8(%rip), %rsi      # 0x264c9
movb $0x0, %al
callq 0x1140
jmp 0x19d36
movq -0x68(%rbp), %rax
movq -0x8(%rbp), %rdi
movq 0x18(%rax), %rax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
movq 0x10(%rcx), %rcx
movslq -0x5c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xc597(%rip), %rsi      # 0x262c6
movb $0x0, %al
callq 0x1140
jmp 0x19d38
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x19c7e
movq -0x8(%rbp), %rdi
leaq 0xc4a6(%rip), %rsi      # 0x261f7
movb $0x0, %al
callq 0x1140
movl $0x1, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
movq 0x18(%rcx), %rcx
cmpl (%rcx), %eax
jg 0x19e27
movl -0x60(%rbp), %eax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
movq 0x18(%rcx), %rcx
cmpl (%rcx), %eax
jne 0x19ddb
movq -0x68(%rbp), %rax
movq -0x8(%rbp), %rdi
movq 0x18(%rax), %rax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
movq 0x18(%rcx), %rcx
movslq -0x60(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xc6f7(%rip), %rsi      # 0x264c9
movb $0x0, %al
callq 0x1140
jmp 0x19e17
movq -0x68(%rbp), %rax
movq -0x8(%rbp), %rdi
movq 0x18(%rax), %rax
movq 0x68(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0xa8, %rdx, %rdx
addq %rdx, %rcx
movq 0x18(%rcx), %rcx
movslq -0x60(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0xc4b6(%rip), %rsi      # 0x262c6
movb $0x0, %al
callq 0x1140
jmp 0x19e19
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x19d5f
movq -0x68(%rbp), %rax
movq -0x48(%rbp), %rdi
movq 0x18(%rax), %rdx
movl (%rax), %ecx
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl 0x80(%rax), %r8d
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl 0x84(%rax), %r9d
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl 0x88(%rax), %r10d
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl 0x8c(%rax), %eax
movl $0x1, %esi
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x19290
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jne 0x19ecb
movq -0x18(%rbp), %rdi
leaq 0xbb1a(%rip), %rsi      # 0x259db
callq 0x1130
cmpl $0x0, %eax
je 0x19ee4
movq -0x18(%rbp), %rdi
leaq 0xbb05(%rip), %rsi      # 0x259db
callq 0x1130
cmpl $0x0, %eax
je 0x19f67
movq -0x68(%rbp), %rax
movq -0x10(%rbp), %rdi
movq 0x18(%rax), %rdx
movl (%rax), %ecx
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl 0x80(%rax), %r8d
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl 0x84(%rax), %r9d
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl 0x88(%rax), %r10d
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rsi
imulq $0xa8, %rsi, %rsi
addq %rsi, %rax
movl 0x8c(%rax), %eax
movl $0x1, %esi
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x19290
movq -0x48(%rbp), %rdi
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x50(%rax), %edx
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movsd 0x30(%rax), %xmm1
leaq 0xc316(%rip), %rsi      # 0x262cb
movb $0x2, %al
callq 0x1140
movq -0x48(%rbp), %rdi
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x40(%rax), %edx
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movsd 0x28(%rax), %xmm0
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movsd 0x38(%rax), %xmm1
leaq 0xc2e6(%rip), %rsi      # 0x262f0
movb $0x2, %al
callq 0x1140
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jne 0x1a032
movq -0x18(%rbp), %rdi
leaq 0xb9b3(%rip), %rsi      # 0x259db
callq 0x1130
cmpl $0x0, %eax
je 0x1a04b
movq -0x18(%rbp), %rdi
leaq 0xb99e(%rip), %rsi      # 0x259db
callq 0x1130
cmpl $0x0, %eax
je 0x1a0f5
movq -0x10(%rbp), %rdi
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x50(%rax), %edx
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movsd 0x30(%rax), %xmm1
leaq 0xc27f(%rip), %rsi      # 0x26318
movb $0x2, %al
callq 0x1140
movq -0x10(%rbp), %rdi
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movl 0x40(%rax), %edx
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movsd 0x28(%rax), %xmm0
movq 0x68(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movsd 0x38(%rax), %xmm1
leaq 0xc258(%rip), %rsi      # 0x26346
movb $0x2, %al
callq 0x1140
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1a100
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x196fa
movq -0x48(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x30(%rax), %edx
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm1
leaq 0xc222(%rip), %rsi      # 0x26374
movb $0x2, %al
callq 0x1140
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jne 0x1a17a
movq -0x18(%rbp), %rdi
leaq 0xb86b(%rip), %rsi      # 0x259db
callq 0x1130
cmpl $0x0, %eax
je 0x1a18f
movq -0x18(%rbp), %rdi
leaq 0xb856(%rip), %rsi      # 0x259db
callq 0x1130
cmpl $0x0, %eax
je 0x1a1da
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x30(%rax), %edx
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm1
leaq 0xc1a1(%rip), %rsi      # 0x26374
movb $0x2, %al
callq 0x1140
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl 0x30(%rax), %eax
movl %eax, -0x50(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1964b
cmpl $0x0, -0x50(%rbp)
je 0x1a205
jmp 0x1a205
movq -0x48(%rbp), %rdi
movl 0x70(%rbp), %edx
movl -0x4c(%rbp), %ecx
leaq 0xc184(%rip), %rsi      # 0x2639a
movb $0x0, %al
callq 0x1140
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)