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

	int basSource,basDest;
	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));  
	}
	
	//== 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];
	else
		basSource = aTree.ARETE[2*source-1];

	//== 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];


	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[basSource].nbSommet;

		DTemp.Tableau = (int*)malloc((DTemp.nbSommet+1)*sizeof(int));

		for(y=1;y<=DTSpecies[basDest].nbSommet;y++)
			DTemp.Tableau[y] = DTSpecies[basDest].Tableau[y];
		y--;
		for(z=1;z<=DTSpecies[basSource].nbSommet;z++)
			DTemp.Tableau[z+y] = DTSpecies[basSource].Tableau[z];

		TrierTableau(DTemp.Tableau,DTemp.nbSommet);

		for(pv=n+1;pv<=2*n-2;pv++){
			if(vecteursEgaux(DTemp,DTGene[pv])){

				for(tk=1;tk<=DTGene[pv].nbSommet;tk++){
					for(tl=1;tl<=DTGene[pv].nbSommet;tl++)
						DISTemp[tk][tl] = aTree.ADD[DTemp.Tableau[tk]][DTemp.Tableau[tl]];
				}

				//for(tk=1;tk<=DTGene[pv].nbSommet;tk++)
				//	DISTemp[DTGene[pv].nbSommet+1][tk] =  DISTemp[tk][DTGene[pv].nbSommet+1] = ;

				mk1=Bipartition_Table(DTGene[pv].Matrice,Bk1,PLACEk1,DTGene[pv].nbSommet);
				mk2=Bipartition_Table(DISTemp,Bk2,PLACEk2,DTemp.nbSommet);
				if(Table_Comparaison(Bk1,Bk2,PLACEk1,PLACEk2,mk1,mk2,DTGene[pv].nbSommet) == 0)
					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);

	return LGTpossible;
		
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
leaq 0x10(%rbp), %rax
movq %rax, -0x130(%rbp)
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl (%rax), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
shll %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, -0x78(%rbp)
movl -0x48(%rbp), %eax
shll %eax
subl $0x2, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0x80(%rbp)
movl -0x48(%rbp), %eax
shll %eax
subl $0x2, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0x88(%rbp)
movl -0x48(%rbp), %eax
shll %eax
subl $0x2, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, -0x90(%rbp)
movl -0x48(%rbp), %eax
shll %eax
subl $0x2, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, -0x98(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x48(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0xd731
movslq -0x48(%rbp), %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, %rdx
movq -0x90(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movslq -0x48(%rbp), %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, %rdx
movq -0x98(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x48(%rbp), %eax
shll %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, %rdx
movq -0x78(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xd6b6
movq -0x130(%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 0xd7a5
movq -0x130(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x4(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x1c(%rbp)
jmp 0xd7c2
movq -0x130(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x4(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x1c(%rbp)
movq -0x130(%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 0xd836
movq -0x130(%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, -0x20(%rbp)
jmp 0xd853
movq -0x130(%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, -0x20(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0xd867
movl $0x1, -0x24(%rbp)
jmp 0xda09
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl -0x48(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0xda07
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xb0(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xa8(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xc0(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rcx
leaq -0xc8(%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 0xd9f7
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0x90(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
addl $0x1, %ecx
callq 0x40a0
movl %eax, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0x98(%rbp), %rsi
movq -0x88(%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, -0x50(%rbp)
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x88(%rbp), %rcx
movl -0x4c(%rbp), %r8d
movl -0x50(%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 0xd9f0
movl $0x1, -0x24(%rbp)
movl $0xf423f, -0x30(%rbp)   # imm = 0xF423F
jmp 0xd9f9
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xd870
jmp 0xda09
cmpl $0x0, -0x24(%rbp)
je 0xdbcb
movl -0x20(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0xda27
movl $0x1, -0x28(%rbp)
jmp 0xdbc9
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl -0x48(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0xdbc7
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xe0(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xd8(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xf8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xf0(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0xe8(%rbp)
leaq -0xe0(%rbp), %rcx
leaq -0xf8(%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 0xdbb7
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0x90(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
addl $0x1, %ecx
callq 0x40a0
movl %eax, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0x98(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
addl $0x1, %ecx
callq 0x40a0
movl %eax, -0x50(%rbp)
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x88(%rbp), %rcx
movl -0x4c(%rbp), %r8d
movl -0x50(%rbp), %r9d
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %r10
imulq $0x18, %r10, %r10
addq %r10, %rax
movl (%rax), %eax
addl $0x1, %eax
movl %eax, (%rsp)
callq 0x49c0
cmpl $0x0, %eax
jne 0xdbb0
movl $0x1, -0x28(%rbp)
movl $0xf423f, -0x30(%rbp)   # imm = 0xF423F
jmp 0xdbb9
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xda30
jmp 0xdbc9
jmp 0xdbcb
cmpl $0x1, -0x24(%rbp)
jne 0xded7
cmpl $0x1, -0x28(%rbp)
jne 0xded7
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
addl (%rcx), %eax
movl %eax, -0x70(%rbp)
movl %eax, -0x54(%rbp)
movl -0x70(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, -0x60(%rbp)
movl $0x1, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x20(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jg 0xdc6a
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq -0x38(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x60(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xdc24
movl -0x38(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x38(%rbp)
movl $0x1, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jg 0xdcc5
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x60(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl -0x38(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xdc7a
movq -0x60(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x2730
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl -0x48(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jg 0xdece
movq -0x70(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x128(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x120(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x118(%rbp)
leaq -0x110(%rbp), %rcx
leaq -0x128(%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 0xdebe
movl $0x1, -0x40(%rbp)
movl -0x40(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jg 0xde22
movl $0x1, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x30(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jg 0xde12
movq -0x130(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x60(%rbp), %rcx
movslq -0x40(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movq (%rax,%rcx,8), %rax
movq -0x60(%rbp), %rcx
movslq -0x44(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x78(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x44(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xddb0
jmp 0xde14
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xdd93
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0x90(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
callq 0x40a0
movl %eax, -0x4c(%rbp)
movq -0x78(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x88(%rbp), %rdx
movl -0x70(%rbp), %ecx
callq 0x40a0
movl %eax, -0x50(%rbp)
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x88(%rbp), %rcx
movl -0x4c(%rbp), %r8d
movl -0x50(%rbp), %r9d
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %r10
imulq $0x18, %r10, %r10
addq %r10, %rax
movl (%rax), %eax
movl %eax, (%rsp)
callq 0x49c0
cmpl $0x0, %eax
jne 0xdebc
movl $0x1, -0x2c(%rbp)
jmp 0xdebe
jmp 0xdec0
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xdcda
movq -0x60(%rbp), %rdi
callq 0x10e0
movq -0x80(%rbp), %rdi
callq 0x10e0
movq -0x88(%rbp), %rdi
callq 0x10e0
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0x48(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0xdf46
movq -0x90(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10e0
movq -0x98(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10e0
movq -0x78(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10e0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xdef3
movq -0x78(%rbp), %rdi
callq 0x10e0
movq -0x90(%rbp), %rdi
callq 0x10e0
movq -0x98(%rbp), %rdi
callq 0x10e0
movl -0x2c(%rbp), %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopw %cs:(%rax,%rax)