// File: /workspace/github_cpp_makefile_star2_O1/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 $0x28, %rsp
movl %edx, -0x30(%rbp)
movl %esi, %r12d
movq %rdi, %rbx
movl 0x10(%rbp), %r14d
cmpq $0x0, 0x8(%rdi)
jne 0xa651
movq %rbx, %rdi
movl %r14d, %esi
callq 0x7e1c
leaq 0x10(%rbp), %rax
leal (%r14,%r14), %r8d
testl %r14d, %r14d
jle 0xa686
movq 0x50(%rax), %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 0xa678
movq %r8, -0x38(%rbp)
leal -0x2(%r8), %eax
movl %eax, -0x2c(%rbp)
movq %r14, -0x40(%rbp)
cmpl $0x2, %r14d
jl 0xa73a
leaq 0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movq %rcx, -0x50(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x10(%rax), %rsi
movl -0x2c(%rbp), %eax
cmpl $0x2, %eax
movl $0x1, %edi
cmovgel %eax, %edi
leal 0x1(%rdi), %r8d
movq 0x8(%rbx), %r9
movq 0x28(%rbx), %r10
movl $0x1, %r11d
movq -0x50(%rbp), %rax
movq (%rax,%r11,8), %r13
movq (%r10,%r11,8), %r15
movq -0x48(%rbp), %rax
movq (%rax,%r11,8), %rax
movq (%r9,%r11,8), %r14
xorl %ecx, %ecx
movsd 0x8(%r13,%rcx,8), %xmm0
movsd %xmm0, 0x8(%r15,%rcx,8)
movsd 0x8(%rax,%rcx,8), %xmm0
movsd %xmm0, 0x8(%r14,%rcx,8)
cmpl $0x1, %r12d
jne 0xa72a
movq (%rsi,%r11,8), %rdx
movsd 0x8(%rdx,%rcx,8), %xmm0
movq 0x10(%rbx), %rdx
movq (%rdx,%r11,8), %rdx
movsd %xmm0, 0x8(%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %rdi
jne 0xa6f1
incq %r11
cmpq %r8, %r11
jne 0xa6d7
cmpl $0x1, %r12d
movq -0x40(%rbp), %r13
jne 0xa7c9
cmpl $0x2, %r13d
leaq 0x10(%rbp), %rax
jl 0xa799
movl -0x2c(%rbp), %edx
cmpl $0x2, %edx
movl $0x1, %ecx
cmovgel %edx, %ecx
movq 0x10(%rax), %rax
leal 0x1(%rcx), %edx
movq 0x10(%rbx), %rsi
movl $0x1, %edi
movq (%rax,%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, %rcx
jne 0xa77b
incq %rdi
cmpq %rdx, %rdi
jne 0xa770
testl %r13d, %r13d
jle 0xa7c9
leaq 0x10(%rbp), %rax
movq 0x18(%rax), %r14
leaq 0x1(%r13), %r15
movl $0x1, %r12d
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %rdi
movq (%r14,%r12,8), %rsi
callq 0x1090
incq %r12
cmpq %r12, %r15
jne 0xa7b0
cmpl $0x1, -0x30(%rbp)
setne %al
testl %r13d, %r13d
setle %cl
orb %al, %cl
leaq 0x10(%rbp), %r11
jne 0xa81b
movq 0x40(%r11), %rax
leaq 0x1(%r13), %rcx
movq 0x40(%rbx), %rdx
movl %ecx, %esi
movl $0x1, %edi
movq (%rax,%rdi,8), %r8
movq (%rdx,%rdi,8), %r9
movl $0x1, %r10d
movsd (%r8,%r10,8), %xmm0
movsd %xmm0, (%r9,%r10,8)
incq %r10
cmpq %r10, %rsi
jne 0xa7ff
incq %rdi
cmpq %rcx, %rdi
jne 0xa7f1
cmpl $0x2, %r13d
jl 0xa874
movq -0x38(%rbp), %r8
addl $-0x3, %r8d
movq 0x30(%r11), %rax
movq 0x38(%r11), %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 0xa84d
movl 0x20(%r11), %eax
movl %eax, 0x20(%rbx)
movl %r13d, (%rbx)
movl 0x48(%r11), %eax
movl %eax, 0x48(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq