// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
movl 0x10(%rbp), %r14d
cmpq $0x0, 0x8(%rdi)
jne 0xa5b7
movq %rbx, %rdi
movl %r14d, %esi
callq 0x7cf7
leaq 0x10(%rbp), %r10
testl %r14d, %r14d
jle 0xa7e5
movl %r15d, -0x3c(%rbp)
leal (%r14,%r14), %r8d
movq 0x50(%r10), %rax
movq 0x50(%rbx), %rcx
cmpl $0x3, %r8d
movl $0x2, %edx
cmovgel %r8d, %edx
movl $0x1, %esi
movl (%rax,%rsi,4), %edi
movl %edi, (%rcx,%rsi,4)
incq %rsi
cmpq %rsi, %rdx
jne 0xa5e6
movq %r8, -0x48(%rbp)
leal -0x2(%r8), %eax
movl %eax, -0x30(%rbp)
movq %r14, -0x38(%rbp)
cmpl $0x1, %r14d
sete -0x29(%rbp)
je 0xa6ad
leaq 0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movq %rcx, -0x58(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x50(%rbp)
movq 0x10(%rax), %rdi
movl -0x30(%rbp), %eax
cmpl $0x2, %eax
movl $0x1, %r8d
cmovgel %eax, %r8d
leal 0x1(%r8), %r9d
movq 0x8(%rbx), %r10
movq 0x28(%rbx), %r11
movl $0x1, %eax
movq -0x58(%rbp), %rcx
movq (%rcx,%rax,8), %r13
movq (%r11,%rax,8), %rcx
movq -0x50(%rbp), %rdx
movq (%rdx,%rax,8), %r15
movq (%r10,%rax,8), %r14
xorl %edx, %edx
movsd 0x8(%r13,%rdx,8), %xmm0
movsd %xmm0, 0x8(%rcx,%rdx,8)
movsd 0x8(%r15,%rdx,8), %xmm0
movsd %xmm0, 0x8(%r14,%rdx,8)
cmpl $0x1, %r12d
jne 0xa69d
movq (%rdi,%rax,8), %rsi
movsd 0x8(%rsi,%rdx,8), %xmm0
movq 0x10(%rbx), %rsi
movq (%rsi,%rax,8), %rsi
movsd %xmm0, 0x8(%rsi,%rdx,8)
incq %rdx
cmpq %rdx, %r8
jne 0xa664
incq %rax
cmpq %r9, %rax
jne 0xa64a
cmpl $0x1, %r12d
jne 0xa740
movb $0x1, %r12b
movq -0x38(%rbp), %r11
cmpl $0x1, %r11d
leaq 0x10(%rbp), %r14
je 0xa713
movl -0x30(%rbp), %ecx
cmpl $0x2, %ecx
movl $0x1, %eax
cmovgel %ecx, %eax
movq 0x10(%r14), %rcx
leal 0x1(%rax), %edx
movq 0x10(%rbx), %rsi
movl $0x1, %edi
movb -0x29(%rbp), %r12b
movq (%rcx,%rdi,8), %r8
movq (%rsi,%rdi,8), %r9
xorl %r10d, %r10d
movsd 0x8(%r8,%r10,8), %xmm0
movsd %xmm0, 0x8(%r9,%r10,8)
incq %r10
cmpq %r10, %rax
jne 0xa6f5
incq %rdi
cmpq %rdx, %rdi
jne 0xa6ea
movq 0x18(%r14), %r14
leaq 0x1(%r11), %r15
movl $0x1, %r13d
movq 0x18(%rbx), %rax
movq (%rax,%r13,8), %rdi
movq (%r14,%r13,8), %rsi
callq 0x1090
incq %r13
cmpq %r13, %r15
jne 0xa721
movq -0x38(%rbp), %r14
jmp 0xa748
movq -0x38(%rbp), %r14
movb -0x29(%rbp), %r12b
cmpl $0x1, -0x3c(%rbp)
leaq 0x10(%rbp), %r10
jne 0xa78d
movq 0x40(%r10), %rax
leaq 0x1(%r14), %rcx
movq 0x40(%rbx), %rdx
movl $0x1, %esi
movq (%rax,%rsi,8), %rdi
movq (%rdx,%rsi,8), %r8
movl $0x1, %r9d
movsd (%rdi,%r9,8), %xmm0
movsd %xmm0, (%r8,%r9,8)
incq %r9
cmpq %r9, %rcx
jne 0xa771
incq %rsi
cmpq %rcx, %rsi
jne 0xa763
testb %r12b, %r12b
jne 0xa7e5
movq -0x48(%rbp), %r8
addl $-0x3, %r8d
movq 0x30(%r10), %rax
movq 0x38(%r10), %rcx
movq 0x30(%rbx), %rdx
movq 0x38(%rbx), %rsi
cmpl $0x2, %r8d
movl $0x1, %edi
cmovgel %r8d, %edi
shlq $0x3, %rdi
xorl %r8d, %r8d
movq 0x8(%rax,%r8,2), %r9
movq %r9, 0x8(%rdx,%r8,2)
movq (%rax,%r8,2), %r9
movq %r9, (%rdx,%r8,2)
movsd (%rcx,%r8), %xmm0
movsd %xmm0, (%rsi,%r8)
addq $0x8, %r8
cmpq %r8, %rdi
jne 0xa7be
movl 0x20(%r10), %eax
movl %eax, 0x20(%rbx)
movl %r14d, (%rbx)
movl 0x48(%r10), %eax
movl %eax, 0x48(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq