// File: dcarrey[P]hgt-detection/./fonctions.cpp
// Function: allocMemmory(InputTree*, int)
void allocMemmory(struct InputTree *aTree, int n){
	
	int i;

	if(aTree->ARETE == NULL){
		aTree->degre = (int*)malloc(2*n*sizeof(int));
		aTree->ADD = (double**)malloc(2*n*sizeof(double*));
		aTree->Adjacence = (double**)malloc(2*n*sizeof(double*));
		aTree->Input = (double**)malloc(2*n*sizeof(double*));
		aTree->W = (double**)malloc((n+1)*sizeof(double*));
		
		for(i=0;i<2*n;i++){
			aTree->ADD[i] = (double*)malloc(2*n*sizeof(double));
			aTree->Adjacence[i] = (double*)malloc(2*n*sizeof(double));
			aTree->Input[i] = (double*)malloc(2*n*sizeof(double));
			if(i<=n)
				aTree->W[i] = (double*)malloc(2*n*sizeof(double));
		}

		aTree->ARETE    =(long int*)malloc(4*(2*(n))*sizeof(long int));
		aTree->LONGUEUR	=(double*)malloc((4*(n))*sizeof(double));
		aTree->SpeciesName = (char**)malloc(2*n*sizeof(char*));
		
		for(i=0;i<=n;i++)
			aTree->SpeciesName[i] = (char*)malloc(50);
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0xd4eb
movl -0xc(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1110
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x50(%rax)
movl -0xc(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0xc(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movl -0xc(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0xd45a
movl -0xc(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0xc(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0xc(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jg 0xd44a
movl -0xc(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0xd44c
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xd3a2
movl -0xc(%rbp), %eax
shll %eax
shll $0x2, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movl -0xc(%rbp), %eax
shll $0x2, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
movl -0xc(%rbp), %eax
shll %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x1110
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jg 0xd4e9
movl $0x32, %edi
callq 0x1110
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xd4b9
jmp 0xd4eb
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)