// File: grmauri[P]pmm/pmm.cpp
// Function: testar_heuConstrutivas()
void testar_heuConstrutivas()
{
    Solucao sol;
    clock_t h;
    double tempo;
    const int repeticoes = 10000;

    lerDados("pmm3.txt");
    ordenarObjetos();

    printf("\n\n>>> TESTE - HEURISTICAS CONSTRUTIVAS - PMM3 - %d REPETICOES\n", repeticoes);

    //---
    h = clock();
    for(int r = 0; r < repeticoes; r++)
        heuConAle(sol);
    calcFO(sol);
    h = clock() - h;
    tempo = (double)h/CLOCKS_PER_SEC;
    escreverSolucao(sol, 0);
    printf("Construtiva Aleatoria...: %.5f seg.\n",tempo);

    //---
    h = clock();
    for(int r = 0; r < repeticoes; r++)
        heuConGul(sol);
    calcFO(sol);
    h = clock() - h;
    tempo = (double)h/CLOCKS_PER_SEC;
    escreverSolucao(sol, 0);
    printf("Construtiva Gulosa...: %.5f seg.\n",tempo);

    //---
    h = clock();
    for(int r = 0; r < repeticoes; r++)
        heuConAleGul(sol, 10); // 10% de aleatoriedade
    calcFO(sol);
    h = clock() - h;
    tempo = (double)h/CLOCKS_PER_SEC;
    escreverSolucao(sol, 0);
    printf("Construtiva Aleatoria Gulosa...: %.5f seg.\n",tempo);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x900, %rsp            # imm = 0x900
movl $0x2710, -0x8b4(%rbp)   # imm = 0x2710
leaq -0x8d9(%rbp), %rdi
movq %rdi, -0x900(%rbp)
callq 0x22a0
movq -0x900(%rbp), %rdx
leaq 0x1795(%rip), %rsi      # 0x71cb
leaq -0x8d8(%rbp), %rdi
callq 0x6770
jmp 0x5a44
leaq -0x8d8(%rbp), %rdi
callq 0x32b0
jmp 0x5a52
leaq -0x8d8(%rbp), %rdi
callq 0x20f0
leaq -0x8d9(%rbp), %rdi
callq 0x21a0
callq 0x33d0
leaq 0x17d1(%rip), %rdi      # 0x7247
movl $0x2710, %esi           # imm = 0x2710
movb $0x0, %al
callq 0x2050
callq 0x2100
movq %rax, -0x8a8(%rbp)
movl $0x0, -0x8f0(%rbp)
cmpl $0x2710, -0x8f0(%rbp)   # imm = 0x2710
jge 0x5b04
leaq -0x89c(%rbp), %rdi
callq 0x4690
movl -0x8f0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8f0(%rbp)
jmp 0x5a98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8e8(%rbp)
movl %eax, -0x8ec(%rbp)
jmp 0x5af3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x8e8(%rbp)
movl %eax, -0x8ec(%rbp)
leaq -0x8d8(%rbp), %rdi
callq 0x20f0
leaq -0x8d9(%rbp), %rdi
callq 0x21a0
jmp 0x5cb0
leaq -0x89c(%rbp), %rdi
callq 0x46f0
callq 0x2100
subq -0x8a8(%rbp), %rax
movq %rax, -0x8a8(%rbp)
cvtsi2sdq -0x8a8(%rbp), %xmm0
movsd 0x14fc(%rip), %xmm1     # 0x7030
divsd %xmm1, %xmm0
movsd %xmm0, -0x8b0(%rbp)
leaq -0x89c(%rbp), %rdi
xorl %esi, %esi
callq 0x5550
movsd -0x8b0(%rbp), %xmm0
leaq 0x1729(%rip), %rdi      # 0x7286
movb $0x1, %al
callq 0x2050
callq 0x2100
movq %rax, -0x8a8(%rbp)
movl $0x0, -0x8f4(%rbp)
cmpl $0x2710, -0x8f4(%rbp)   # imm = 0x2710
jge 0x5ba3
leaq -0x89c(%rbp), %rdi
callq 0x5440
movl -0x8f4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8f4(%rbp)
jmp 0x5b7a
leaq -0x89c(%rbp), %rdi
callq 0x46f0
callq 0x2100
subq -0x8a8(%rbp), %rax
movq %rax, -0x8a8(%rbp)
cvtsi2sdq -0x8a8(%rbp), %xmm0
movsd 0x145d(%rip), %xmm1     # 0x7030
divsd %xmm1, %xmm0
movsd %xmm0, -0x8b0(%rbp)
leaq -0x89c(%rbp), %rdi
xorl %esi, %esi
callq 0x5550
movsd -0x8b0(%rbp), %xmm0
leaq 0x16af(%rip), %rdi      # 0x72ab
movb $0x1, %al
callq 0x2050
callq 0x2100
movq %rax, -0x8a8(%rbp)
movl $0x0, -0x8f8(%rbp)
cmpl $0x2710, -0x8f8(%rbp)   # imm = 0x2710
jge 0x5c47
leaq -0x89c(%rbp), %rdi
movl $0xa, %esi
callq 0x49e0
movl -0x8f8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8f8(%rbp)
jmp 0x5c19
leaq -0x89c(%rbp), %rdi
callq 0x46f0
callq 0x2100
subq -0x8a8(%rbp), %rax
movq %rax, -0x8a8(%rbp)
cvtsi2sdq -0x8a8(%rbp), %xmm0
movsd 0x13b9(%rip), %xmm1     # 0x7030
divsd %xmm1, %xmm0
movsd %xmm0, -0x8b0(%rbp)
leaq -0x89c(%rbp), %rdi
xorl %esi, %esi
callq 0x5550
movsd -0x8b0(%rbp), %xmm0
leaq 0x162d(%rip), %rdi      # 0x72cd
movb $0x1, %al
callq 0x2050
addq $0x900, %rsp            # imm = 0x900
popq %rbp
retq
movq -0x8e8(%rbp), %rdi
callq 0x2290
nopl (%rax)