// File: dcarrey[P]hgt-detection/./fonctions.cpp
// Function: updateBootHGT(int, HGT*, int, HGT*, int*, double*)
void updateBootHGT(int first,struct HGT *bestHGT,int cpt_hgt,struct HGT *bootHGT, int *nbHGT_boot, double *tabBoot){
	
	int i,cpt=0,j;

	if(first==1){
		for(i=1;i<=cpt_hgt;i++){
			if((bestHGT[i].valide == 1) || (bestHGT[i].valide == 6)){
				cpt++;
				tabBoot[cpt] = 1;
				copyHGT(bestHGT[i],&bootHGT[cpt]);
			}
		}
		(*nbHGT_boot) = cpt;
	}
	else{
		for(i=1;i<=(*nbHGT_boot);i++){
			for(j=1;j<=cpt_hgt;j++){
				if((bestHGT[j].valide == 1) || (bestHGT[i].valide == 6))
					if (sameHGT(bootHGT[i],bestHGT[j])==1)
						tabBoot[i]+=1;
			}
		}
	}
	


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3a0, %rsp            # imm = 0x3A0
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl $0x0, -0x38(%rbp)
cmpl $0x1, -0x4(%rbp)
jne 0x13059
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0x1304b
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
cmpl $0x1, (%rax)
je 0x12fc3
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
cmpl $0x6, (%rax)
jne 0x1303b
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd 0x1206c(%rip), %xmm0    # 0x25048
movsd %xmm0, (%rax,%rcx,8)
movq -0x10(%rbp), %rsi
movslq -0x34(%rbp), %rax
imulq $0xa8, %rax, %rax
addq %rax, %rsi
leaq -0xe8(%rbp), %rdi
movl $0xa8, %edx
callq 0x1070
movq -0x20(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x240(%rbp)
movq %rsp, %rdi
movl $0x15, %ecx
leaq -0xe8(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x240(%rbp), %rdi
callq 0x12d90
jmp 0x1303d
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x12f89
movl -0x38(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0x13181
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jg 0x1317f
movl $0x1, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0x1316f
movq -0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
cmpl $0x1, (%rax)
je 0x130b4
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
cmpl $0x6, (%rax)
jne 0x1315f
movq -0x20(%rbp), %rsi
movslq -0x34(%rbp), %rax
imulq $0xa8, %rax, %rax
addq %rax, %rsi
leaq -0x190(%rbp), %rdi
movl $0xa8, %edx
callq 0x1070
movq -0x10(%rbp), %rsi
movslq -0x3c(%rbp), %rax
imulq $0xa8, %rax, %rax
addq %rax, %rsi
leaq -0x238(%rbp), %rdi
movl $0xa8, %edx
callq 0x1070
movq %rsp, %rdi
movq %rdi, -0x250(%rbp)
movl $0x15, %ecx
movq %rcx, -0x248(%rbp)
leaq -0x190(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x250(%rbp), %rdi
movq -0x248(%rbp), %rcx
addq $0xa8, %rdi
leaq -0x238(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x12aa0
cmpl $0x1, %eax
jne 0x1315d
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd 0x11ef5(%rip), %xmm0    # 0x25048
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x1315f
jmp 0x13161
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x13076
jmp 0x13171
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x13060
jmp 0x13181
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbp
retq
nopw (%rax,%rax)