// File: dcarrey[P]hgt-detection/./fonctions.cpp
// Function: copyInputTree(InputTree*, InputTree, int, int)
void copyInputTree(struct InputTree *tmpTree, struct InputTree aTree,int all,int allW){
	
	int n= aTree.size;
	int i,j;

	if(tmpTree->ADD == NULL){
		allocMemmory(tmpTree,n);
	}

	for(i=1;i<=2*n-1;i++)
		tmpTree->degre[i] = aTree.degre[i];

	for(i=1;i<=2*n-2;i++){
		for(j=1;j<=2*n-2;j++){
			tmpTree->Adjacence[i][j] = aTree.Adjacence[i][j];
			tmpTree->ADD[i][j] = aTree.ADD[i][j];
			if(all==1)
				tmpTree->Input[i][j] = aTree.Input[i][j];
		}
	}
  if(all==1){
  	 for(i=1;i<=2*n-2;i++){
		  for(j=1;j<=2*n-2;j++){
				tmpTree->Input[i][j] = aTree.Input[i][j];
		  }
	   }
	   
    for(i=1;i<=n;i++){	
			strcpy(tmpTree->SpeciesName[i],(const char*)aTree.SpeciesName[i]);
		}
	}
	
	if(allW==1){
    for(i=1;i<=n;i++){
		  for(j=1;j<=n;j++){
			 tmpTree->W[i][j] = aTree.W[i][j];
		  }
	 }
  }
	for(i=1;i<=2*n-3;i++){
		tmpTree->ARETE[2*i-1]  = aTree.ARETE[2*i-1];
		tmpTree->ARETE[2*i-2]  = aTree.ARETE[2*i-2];
		tmpTree->LONGUEUR[i-1] = aTree.LONGUEUR[i-1];
	}
	
	tmpTree->Root = aTree.Root;
	tmpTree->size = aTree.size;
	tmpTree->kt = aTree.kt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x12566
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xd2f0
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x14(%rbp), %ecx
shll %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jg 0x125a5
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x18(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1256d
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x14(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jg 0x12691
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl -0x14(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jg 0x12681
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rcx
movslq -0x18(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x1c(%rbp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movslq -0x18(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x1c(%rbp), %rdx
movsd %xmm0, (%rcx,%rdx,8)
movq 0x8(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpl $0x1, -0xc(%rbp)
jne 0x12671
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x12673
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x125c6
jmp 0x12683
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x125ac
cmpl $0x1, -0xc(%rbp)
jne 0x12752
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x14(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jg 0x12711
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl -0x14(%rbp), %ecx
shll %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jg 0x12704
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x126b8
jmp 0x12706
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x126a2
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0x12750
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movslq -0x18(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movq 0x18(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x1080
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x12718
jmp 0x12752
cmpl $0x1, -0x10(%rbp)
jne 0x127c2
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0x127c0
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0x127b3
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1276e
jmp 0x127b5
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1275f
jmp 0x127c2
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x14(%rbp), %ecx
shll %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jg 0x1286a
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rcx
movl -0x18(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rsi
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rcx
movl -0x18(%rbp), %edx
shll %edx
subl $0x1, %edx
movslq %edx, %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x30(%rax), %rcx
movl -0x18(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rsi
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rcx
movl -0x18(%rbp), %edx
shll %edx
subl $0x2, %edx
movslq %edx, %rdx
movq %rsi, (%rcx,%rdx,8)
movq 0x38(%rax), %rax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x127c9
movq -0x28(%rbp), %rax
movl 0x20(%rax), %edx
movq -0x8(%rbp), %rcx
movl %edx, 0x20(%rcx)
movl (%rax), %edx
movq -0x8(%rbp), %rcx
movl %edx, (%rcx)
movl 0x48(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x48(%rax)
addq $0x30, %rsp
popq %rbp
retq