// File: dcarrey[P]hgt-detection/./fonctions.cpp
// Function: TestSubTreeLeafs(InputTree, int, int, DescTree*, DescTree*)
int TestSubTreeLeafs(struct InputTree aTree,int source, int dest,struct DescTree *DTSpecies, struct DescTree *DTGene){

	int basSource,hautSource,basDest,noeudRacine;
	int etape1=0,etape2=0;
	int LGTpossible = 0;
	int pv,i,y,z,tk,tl;
	int n = aTree.size;
	int mk1,mk2,nbSom;
	struct DescTree DTemp;
	double ** DISTemp =(double **)malloc((2*n+1)*sizeof(double*));

	int * PLACEk1=(int *) malloc((2*n-2)*sizeof(int));
	int * PLACEk2=(int *) malloc((2*n-2)*sizeof(int));
	
	int ** Bk1=(int **) malloc((2*n-2)*sizeof(int*));
	int ** Bk2=(int **) malloc((2*n-2)*sizeof(int*));

	for (i=0;i<2*n-2;i++)
	{
		Bk1[i]=(int *) malloc((n)*sizeof(int));
		Bk2[i]=(int *) malloc((n)*sizeof(int));     
		DISTemp[i]=(double *)malloc((2*n+1)*sizeof(double));  
	}
	
	for (i=1;i<2*n-3-aTree.kt;i++){
		if(aTree.ARETE[2*i-1] == aTree.Root)
			noeudRacine = aTree.ARETE[2*i-2];
		if(aTree.ARETE[2*i-2] == aTree.Root)
			noeudRacine = aTree.ARETE[2*i-1];
	}
			
	//== find the node inf for the source branch
	if(aTree.ADD[aTree.ARETE[2*source-1]][aTree.Root] <  aTree.ADD[aTree.ARETE[2*source-2]][aTree.Root]){
		basSource = aTree.ARETE[2*source-2];
		hautSource = aTree.ARETE[2*source-1];
	}
	else{
		basSource = aTree.ARETE[2*source-1];
		hautSource = aTree.ARETE[2*source-2];
	}
	//== find the node inf for the dest branch
	if(aTree.ADD[aTree.ARETE[2*dest-1]][aTree.Root] <  aTree.ADD[aTree.ARETE[2*dest-2]][aTree.Root])
		basDest = aTree.ARETE[2*dest-2];
	else
		basDest = aTree.ARETE[2*dest-1];
		
		
	//printf("\n===========> DANS SUBTREELEAF");
	if(basSource<n)
		etape1=1;
	else{
		for(pv=n+1;pv<2*n-2;pv++){
			if(vecteursEgaux(DTSpecies[basSource],DTGene[pv]) == 1){	
				/*if(DTSpecies[basSource].nbSommet == 3)
					etape1= 0;
				else*/{
					mk1=Bipartition_Table(DTGene[pv].Matrice,Bk1,PLACEk1,DTGene[pv].nbSommet+1);
					mk2=Bipartition_Table(DTSpecies[basSource].Matrice,Bk2,PLACEk2,DTSpecies[basSource].nbSommet+1);
					if(Table_Comparaison(Bk1,Bk2,PLACEk1,PLACEk2,mk1,mk2,DTSpecies[basSource].nbSommet+1) == 0)
						etape1 = 1;
				}
				pv = (int)INFINI;
			}
		}
	}

	if(etape1){/*/== comparer les sous arbres au niveau destination*/
		if(basDest<n)
			etape2 = 1;
		else{
			for(pv=n+1;pv<2*n-2;pv++){
				//printf("[pv = %d] ",pv);
				if(vecteursEgaux(DTSpecies[basDest],DTGene[pv]) == 1){
					/*if(DTSpecies[basDest].nbSommet == 3)
						etape2 = 0;
					else*/{
						mk1=Bipartition_Table(DTGene[pv].Matrice,Bk1,PLACEk1,DTGene[pv].nbSommet+1);
						mk2=Bipartition_Table(DTSpecies[basDest].Matrice,Bk2,PLACEk2,DTSpecies[basDest].nbSommet+1);
						if(Table_Comparaison(Bk1,Bk2,PLACEk1,PLACEk2,mk1,mk2,DTGene[pv].nbSommet+1) == 0)
							etape2 = 1;
					}
					pv = (int)INFINI;
				}				
			}	
		}
	}

	if(etape1==1 && etape2==1){
		
		nbSom = DTemp.nbSommet = DTSpecies[basDest].nbSommet + DTSpecies[hautSource].nbSommet;
		
		//printf("\n===========> nbSom = %d , basSource = %d , basDest = %d",nbSom,DTSpecies[basSource].nbSommet,DTSpecies[basDest].nbSommet);
		
		DTemp.Tableau = (int*)malloc((DTemp.nbSommet+1)*sizeof(int));
		
		//printf("\n");
		for(y=1;y<=DTSpecies[basDest].nbSommet;y++){
			DTemp.Tableau[y] = DTSpecies[basDest].Tableau[y];
			//printf("%d ",DTSpecies[basDest].Tableau[y]);
		}
		
		y--;
		
		//printf("\n");
		for(z=1;z<=DTSpecies[hautSource].nbSommet;z++){
			DTemp.Tableau[z+y] = DTSpecies[hautSource].Tableau[z];
			//printf("%d ",DTSpecies[hautSource].Tableau[z]);
		}
	
		
		TrierTableau(DTemp.Tableau,DTemp.nbSommet);

		for(pv=n+1;pv<=2*n-2;pv++){
			if(vecteursEgaux(DTemp,DTGene[pv])){
				LGTpossible = 1;
			}
		}
		
		for(pv=n+1;pv<=2*n-2;pv++){
			if(vecteursEgaux(DTSpecies[hautSource],DTGene[pv])){
				LGTpossible = 1;
			}
		}
		
		
		free(DTemp.Tableau);	
	}

	free(PLACEk1);
	free(PLACEk2);

	for (i=0;i<2*n-2;i++)
	{
		free(Bk1[i]);
		free(Bk2[i]);
		free(DISTemp[i]);
	}
	free(DISTemp);	
	free(Bk1);
	free(Bk2);

	//printf("\n===========> LGTpossible = %d",LGTpossible);
	
	if(hautSource == noeudRacine)
		LGTpossible = 1;
	
	return LGTpossible;
		
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
leaq 0x10(%rbp), %rax
movq %rax, -0x168(%rbp)
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl (%rax), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
shll %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, -0x80(%rbp)
movl -0x50(%rbp), %eax
shll %eax
subl $0x2, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0x88(%rbp)
movl -0x50(%rbp), %eax
shll %eax
subl $0x2, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0x90(%rbp)
movl -0x50(%rbp), %eax
shll %eax
subl $0x2, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, -0x98(%rbp)
movl -0x50(%rbp), %eax
shll %eax
subl $0x2, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, -0xa0(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl -0x50(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0xe0c4
movslq -0x50(%rbp), %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, %rdx
movq -0x98(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movslq -0x50(%rbp), %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, %rdx
movq -0xa0(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x50(%rbp), %eax
shll %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, %rdx
movq -0x80(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xe049
movl $0x1, -0x3c(%rbp)
movq -0x168(%rbp), %rdx
movl -0x3c(%rbp), %eax
movl -0x50(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
subl 0x48(%rdx), %ecx
cmpl %ecx, %eax
jge 0xe178
movq -0x168(%rbp), %rcx
movq 0x30(%rcx), %rax
movl -0x3c(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rax,%rdx,8), %rax
movslq 0x20(%rcx), %rcx
cmpq %rcx, %rax
jne 0xe128
movq -0x168(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x3c(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x28(%rbp)
movq -0x168(%rbp), %rcx
movq 0x30(%rcx), %rax
movl -0x3c(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rax,%rdx,8), %rax
movslq 0x20(%rcx), %rcx
cmpq %rcx, %rax
jne 0xe168
movq -0x168(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x3c(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x28(%rbp)
jmp 0xe16a
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xe0cb
movq -0x168(%rbp), %rcx
movq 0x8(%rcx), %rax
movq 0x30(%rcx), %rdx
movl -0x4(%rbp), %esi
shll %esi
subl $0x1, %esi
movslq %esi, %rsi
movq (%rdx,%rsi,8), %rdx
movq (%rax,%rdx,8), %rax
movslq 0x20(%rcx), %rdx
movsd (%rax,%rdx,8), %xmm1
movq 0x8(%rcx), %rax
movq 0x30(%rcx), %rdx
movl -0x4(%rbp), %esi
shll %esi
subl $0x2, %esi
movslq %esi, %rsi
movq (%rdx,%rsi,8), %rdx
movq (%rax,%rdx,8), %rax
movslq 0x20(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xe202
movq -0x168(%rbp), %rax
movq 0x30(%rax), %rcx
movl -0x4(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, -0x1c(%rbp)
movq 0x30(%rax), %rax
movl -0x4(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x20(%rbp)
jmp 0xe235
movq -0x168(%rbp), %rax
movq 0x30(%rax), %rcx
movl -0x4(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, -0x1c(%rbp)
movq 0x30(%rax), %rax
movl -0x4(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x20(%rbp)
movq -0x168(%rbp), %rcx
movq 0x8(%rcx), %rax
movq 0x30(%rcx), %rdx
movl -0x8(%rbp), %esi
shll %esi
subl $0x1, %esi
movslq %esi, %rsi
movq (%rdx,%rsi,8), %rdx
movq (%rax,%rdx,8), %rax
movslq 0x20(%rcx), %rdx
movsd (%rax,%rdx,8), %xmm1
movq 0x8(%rcx), %rax
movq 0x30(%rcx), %rdx
movl -0x8(%rbp), %esi
shll %esi
subl $0x2, %esi
movslq %esi, %rsi
movq (%rdx,%rsi,8), %rdx
movq (%rax,%rdx,8), %rax
movslq 0x20(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xe2a9
movq -0x168(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x8(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x24(%rbp)
jmp 0xe2c6
movq -0x168(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x8(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jge 0xe2da
movl $0x1, -0x2c(%rbp)
jmp 0xe482
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl -0x50(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0xe480
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xb8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xb0(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rcx
leaq -0xd0(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rsp)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
callq 0x27d0
cmpl $0x1, %eax
jne 0xe470
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0x98(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
addl $0x1, %ecx
callq 0x40a0
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0xa0(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
addl $0x1, %ecx
callq 0x40a0
movl %eax, -0x58(%rbp)
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq -0x90(%rbp), %rcx
movl -0x54(%rbp), %r8d
movl -0x58(%rbp), %r9d
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %r10
imulq $0x18, %r10, %r10
addq %r10, %rax
movl (%rax), %eax
addl $0x1, %eax
movl %eax, (%rsp)
callq 0x49c0
cmpl $0x0, %eax
jne 0xe469
movl $0x1, -0x2c(%rbp)
movl $0xf423f, -0x38(%rbp)   # imm = 0xF423F
jmp 0xe472
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xe2e3
jmp 0xe482
cmpl $0x0, -0x2c(%rbp)
je 0xe64a
movl -0x24(%rbp), %eax
cmpl -0x50(%rbp), %eax
jge 0xe4a0
movl $0x1, -0x30(%rbp)
jmp 0xe648
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl -0x50(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0xe646
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xe8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xe0(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x100(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xf8(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0xf0(%rbp)
leaq -0xe8(%rbp), %rcx
leaq -0x100(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rsp)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
callq 0x27d0
cmpl $0x1, %eax
jne 0xe636
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0x98(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
addl $0x1, %ecx
callq 0x40a0
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0xa0(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
addl $0x1, %ecx
callq 0x40a0
movl %eax, -0x58(%rbp)
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq -0x90(%rbp), %rcx
movl -0x54(%rbp), %r8d
movl -0x58(%rbp), %r9d
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %r10
imulq $0x18, %r10, %r10
addq %r10, %rax
movl (%rax), %eax
addl $0x1, %eax
movl %eax, (%rsp)
callq 0x49c0
cmpl $0x0, %eax
jne 0xe62f
movl $0x1, -0x30(%rbp)
movl $0xf423f, -0x38(%rbp)   # imm = 0xF423F
jmp 0xe638
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xe4a9
jmp 0xe648
jmp 0xe64a
cmpl $0x1, -0x2c(%rbp)
jne 0xe903
cmpl $0x1, -0x30(%rbp)
jne 0xe903
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
movslq -0x20(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
addl (%rcx), %eax
movl %eax, -0x78(%rbp)
movl %eax, -0x5c(%rbp)
movl -0x78(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0x68(%rbp)
movl $0x1, -0x40(%rbp)
movl -0x40(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x24(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jg 0xe6e9
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq -0x40(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x68(%rbp), %rax
movslq -0x40(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xe6a3
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
movl $0x1, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x20(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jg 0xe744
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x68(%rbp), %rax
movl -0x44(%rbp), %ecx
addl -0x40(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xe6f9
movq -0x68(%rbp), %rdi
movl -0x78(%rbp), %esi
callq 0x2730
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl -0x50(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jg 0xe81e
movq -0x78(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x130(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x128(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x120(%rbp)
leaq -0x118(%rbp), %rcx
leaq -0x130(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rsp)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
callq 0x27d0
cmpl $0x0, %eax
je 0xe80e
movl $0x1, -0x34(%rbp)
jmp 0xe810
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xe759
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl -0x50(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jg 0xe8fa
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x148(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x140(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x138(%rbp)
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x160(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x158(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x150(%rbp)
leaq -0x148(%rbp), %rcx
leaq -0x160(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rsp)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
callq 0x27d0
cmpl $0x0, %eax
je 0xe8ea
movl $0x1, -0x34(%rbp)
jmp 0xe8ec
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xe827
movq -0x68(%rbp), %rdi
callq 0x10e0
movq -0x88(%rbp), %rdi
callq 0x10e0
movq -0x90(%rbp), %rdi
callq 0x10e0
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl -0x50(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0xe975
movq -0x98(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10e0
movq -0xa0(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10e0
movq -0x80(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10e0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xe922
movq -0x80(%rbp), %rdi
callq 0x10e0
movq -0x98(%rbp), %rdi
callq 0x10e0
movq -0xa0(%rbp), %rdi
callq 0x10e0
movl -0x20(%rbp), %eax
cmpl -0x28(%rbp), %eax
jne 0xe9a5
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)