// File: /workspace/github_cpp_makefile_star2_O2/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 $0x18, %rsp
movl %edx, -0x2c(%rbp)
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x10(%rbp), %r14
movl (%r14), %r13d
movslq %r13d, %r15
cmpq $0x0, 0x8(%rdi)
jne 0x97a2
movq %rbx, %rdi
movl %r13d, %esi
callq 0x717c
addq %r15, %r15
movq 0x50(%r14), %rax
pushq $0x1
popq %rcx
cmpq %r15, %rcx
jge 0x97c0
movl (%rax,%rcx,4), %edx
movq 0x50(%rbx), %rsi
movl %edx, (%rsi,%rcx,4)
incq %rcx
jmp 0x97ac
movq %r13, -0x38(%rbp)
leal -0x2(%r15), %edx
movq 0x28(%r14), %rsi
movq 0x8(%r14), %rdi
movq 0x10(%r14), %rax
movslq %edx, %rcx
pushq $0x1
popq %r8
cmpq %rcx, %r8
jg 0x9846
xorl %r9d, %r9d
cmpq %r9, %rdx
je 0x9841
movq (%rsi,%r8,8), %r10
movsd 0x8(%r10,%r9,8), %xmm0
movq 0x28(%rbx), %r10
movq (%r10,%r8,8), %r10
movsd %xmm0, 0x8(%r10,%r9,8)
movq (%rdi,%r8,8), %r10
movsd 0x8(%r10,%r9,8), %xmm0
movq 0x8(%rbx), %r10
movq (%r10,%r8,8), %r10
movsd %xmm0, 0x8(%r10,%r9,8)
cmpl $0x1, %r12d
jne 0x983c
movq (%rax,%r8,8), %r10
movsd 0x8(%r10,%r9,8), %xmm0
movq 0x10(%rbx), %r10
movq (%r10,%r8,8), %r10
movsd %xmm0, 0x8(%r10,%r9,8)
incq %r9
jmp 0x97e3
incq %r8
jmp 0x97db
cmpl $0x1, %r12d
jne 0x98b9
movl %edx, %edx
pushq $0x1
popq %rsi
leaq 0x10(%rbp), %r9
cmpq %rcx, %rsi
jg 0x9885
xorl %edi, %edi
cmpq %rdi, %rdx
je 0x9880
movq (%rax,%rsi,8), %r8
movsd 0x8(%r8,%rdi,8), %xmm0
movq 0x10(%rbx), %r8
movq (%r8,%rsi,8), %r8
movsd %xmm0, 0x8(%r8,%rdi,8)
incq %rdi
jmp 0x985c
incq %rsi
jmp 0x9855
movq 0x18(%r9), %r12
xorl %r13d, %r13d
movq -0x38(%rbp), %rax
testl %eax, %eax
movl $0x0, %r14d
cmovgl %eax, %r14d
cmpq %r13, %r14
je 0x98b9
movq 0x18(%rbx), %rax
movq 0x8(%rax,%r13,8), %rdi
movq 0x8(%r12,%r13,8), %rsi
callq 0x1070
incq %r13
jmp 0x989c
cmpl $0x1, -0x2c(%rbp)
leaq 0x10(%rbp), %r10
movq -0x38(%rbp), %r11
jne 0x990f
movq 0x40(%r10), %rax
xorl %ecx, %ecx
testl %r11d, %r11d
cmovgl %r11d, %ecx
leal 0x1(%r11), %edx
incl %ecx
pushq $0x1
popq %rsi
movq %rsi, %rdi
cmpq %rcx, %rdi
je 0x990f
movq %rsi, %r8
cmpq %r8, %rdx
je 0x990a
movq (%rax,%rdi,8), %r9
movsd (%r9,%r8,8), %xmm0
movq 0x40(%rbx), %r9
movq (%r9,%rdi,8), %r9
movsd %xmm0, (%r9,%r8,8)
incq %r8
jmp 0x98e8
incq %rdi
jmp 0x98e0
movq 0x30(%r10), %rax
cmpl $0x4, %r15d
pushq $0x3
popq %rdx
cmovgel %r15d, %edx
movq 0x38(%r10), %rcx
addl $-0x2, %edx
leaq -0x8(,%rdx,8), %rdx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x995e
movq 0x8(%rax,%rsi,2), %rdi
movq 0x30(%rbx), %r8
movq %rdi, 0x8(%r8,%rsi,2)
movq (%rax,%rsi,2), %rdi
movq %rdi, (%r8,%rsi,2)
movsd (%rcx,%rsi), %xmm0
movq 0x38(%rbx), %rdi
movsd %xmm0, (%rdi,%rsi)
addq $0x8, %rsi
jmp 0x992f
movl 0x20(%r10), %eax
movl %eax, 0x20(%rbx)
movl %r11d, (%rbx)
movl 0x48(%r10), %eax
movl %eax, 0x48(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq