// File: /workspace/github_cpp_makefile_star2_O2/dcarrey[P]hgt-detection/./fonctions.cpp
// Function: CreateSubStructures(InputTree*, int, int)
void CreateSubStructures(struct InputTree * aTree,int inc,int binaire){
	
	int n = aTree->size;
	int i,j;
	int kt=0;
	inc = 10;
	
	
	//printf("n=%d",n);
	if(aTree->ARETE == NULL){
		aTree->ARETE    =(long int*)malloc(4*(2*(n+inc))*sizeof(long int));
		aTree->LONGUEUR	=(double*)malloc((4*(n+inc))*sizeof(double));
		aTree->Adjacence=(double**)malloc((2*(n+inc)+1)*sizeof(double*));
		for(i=0;i<2*(n+inc);i++)
			aTree->Adjacence[i]=(double*)malloc((2*(n+inc)+1)*sizeof(double));
	}
//	printf("\nbinaire = %d",binaire);
	kt = aTree->kt = Tree_edges (aTree->ADD,aTree->ARETE,aTree->LONGUEUR,n,binaire);
	
	//printf("\n\n");
	//printEdges(0,aTree->ARETE,aTree->LONGUEUR,aTree->SpeciesName,aTree->size);
	//for(i=1;i<=2*n-3-kt;i++)
	//	printf("\n%d-%d : %lf",aTree->ARETE[2*i-1],aTree->ARETE[2*i-2],aTree->LONGUEUR[i-1]);
	//scanf("%d",&i);
	loadAdjacenceMatrix(aTree->Adjacence,aTree->ARETE, aTree->LONGUEUR,n,aTree->kt);
	Floyd(aTree->Adjacence,aTree->ADD,n,aTree->kt); // 4eme fois
//  global_cpt4++;
	
  //===creation de degre
	aTree->degre = (int*)malloc(2*(n+inc)*sizeof(int));
	for(i=1;i<=2*n-2-kt;i++){
		aTree->degre[i]=0;
		for(j=1;j<=2*n-2-kt;j++)
			if(aTree->Adjacence[i][j] < INFINI) aTree->degre[i]++;
	}
	/*for(i=1;i<=2*n-2-kt;i++)
		printf("%d ",aTree->degre[i]);*/
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r8d
movq %rdi, %rbx
movslq (%rdi), %r14
movq 0x30(%rdi), %rsi
testq %rsi, %rsi
jne 0xc650
movl %r8d, -0x2c(%rbp)
leaq 0xa(%r14), %r15
leal (%r15,%r15), %r13d
movq %r15, %rdi
shlq $0x6, %rdi
callq 0x1130
movq %rax, 0x30(%rbx)
leal (,%r15,4), %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1130
movq %rax, 0x38(%rbx)
leal 0x1(,%r15,2), %eax
movslq %eax, %r12
shlq $0x3, %r12
movq %r12, %rdi
callq 0x1130
movq %rax, 0x28(%rbx)
xorl %r15d, %r15d
testl %r13d, %r13d
cmovlel %r15d, %r13d
cmpq %r15, %r13
je 0xc648
movq %r12, %rdi
callq 0x1130
movq 0x28(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0xc62e
movq 0x30(%rbx), %rsi
movl -0x2c(%rbp), %r8d
movq 0x8(%rbx), %rdi
movq 0x38(%rbx), %rdx
movl %r14d, %ecx
callq 0x226b
movl %eax, %r15d
movl %eax, 0x48(%rbx)
movq 0x28(%rbx), %rdi
movq 0x30(%rbx), %rsi
movq 0x38(%rbx), %rdx
movl %r14d, %ecx
movl %eax, %r8d
callq 0x20bd
movq 0x8(%rbx), %rsi
movq 0x28(%rbx), %rdi
movl 0x48(%rbx), %ecx
movl %r14d, %edx
callq 0x1c23
movl %r14d, %r12d
addl %r14d, %r12d
leal 0x14(,%r14,2), %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1130
movq %rax, 0x50(%rbx)
subl %r15d, %r12d
addl $-0x2, %r12d
notl %r15d
leal (%r15,%r14,2), %ecx
xorl %edx, %edx
testl %r12d, %r12d
cmovgl %r12d, %edx
incl %edx
pushq $0x1
popq %rsi
movsd 0x7976(%rip), %xmm0     # 0x14048
movq %rsi, %rdi
cmpq %rdx, %rdi
je 0xc70a
andl $0x0, (%rax,%rdi,4)
xorl %r8d, %r8d
movq %rsi, %r9
cmpq %r9, %rcx
je 0xc705
movq 0x28(%rbx), %r10
movq (%r10,%rdi,8), %r10
ucomisd (%r10,%r9,8), %xmm0
jbe 0xc700
incl %r8d
movl %r8d, (%rax,%rdi,4)
incq %r9
jmp 0xc6e4
incq %rdi
jmp 0xc6d5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq