// File: grmauri[P]pmm/pmm.cpp
// Function: heuBLPM(tSolucao&)
void heuBLPM(Solucao &s)
{
    int vetObjAux[MAX_OBJ]; // usado para evitar determinismo na ordem de teste dos objetos
    int mocOri, foOri, indice, aux;
    int melFO = s.funObj;
    for(int j = 0; j < numObj; j++)
        vetObjAux[j] = j;
    INICIO : ;
    foOri = s.funObj;
    for(int j = 0; j < numObj; j++)
    {
        indice = j + rand()%(numObj - j);
        mocOri = s.vetIdMocObj[vetObjAux[indice]];
        for(int i = -1; i < numMoc; i++)
        {
            if(i != mocOri)
            {
                s.vetIdMocObj[vetObjAux[indice]] = i;
                calcFO(s);
                if(s.funObj > melFO)
                {
                    melFO = s.funObj;
                    goto INICIO;
                }
                else
                {
                    s.vetIdMocObj[vetObjAux[indice]] = mocOri;
                    s.funObj = foOri;
                }
            }
        }
        aux = vetObjAux[j];
        vetObjAux[j] = vetObjAux[indice];
        vetObjAux[indice] = aux;
    }
    calcFO(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x810, %rsp            # imm = 0x810
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x898(%rax), %eax
movl %eax, -0x7f4(%rbp)
movl $0x0, -0x7f8(%rbp)
movl -0x7f8(%rbp), %eax
cmpl 0x553f(%rip), %eax      # 0xa1a4
jge 0x4c8c
movl -0x7f8(%rbp), %ecx
movslq -0x7f8(%rbp), %rax
movl %ecx, -0x7e0(%rbp,%rax,4)
movl -0x7f8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7f8(%rbp)
jmp 0x4c59
jmp 0x4c8e
movq -0x8(%rbp), %rax
movl 0x898(%rax), %eax
movl %eax, -0x7e8(%rbp)
movl $0x0, -0x7fc(%rbp)
movl -0x7fc(%rbp), %eax
cmpl 0x54f0(%rip), %eax      # 0xa1a4
jge 0x4e26
movl -0x7fc(%rbp), %eax
movl %eax, -0x804(%rbp)
callq 0x2070
movl 0x54d3(%rip), %ecx      # 0xa1a4
subl -0x7fc(%rbp), %ecx
cltd
idivl %ecx
movl -0x804(%rbp), %eax
addl %edx, %eax
movl %eax, -0x7ec(%rbp)
movq -0x8(%rbp), %rax
movslq -0x7ec(%rbp), %rcx
movslq -0x7e0(%rbp,%rcx,4), %rcx
movl 0xc8(%rax,%rcx,4), %eax
movl %eax, -0x7e4(%rbp)
movl $0xffffffff, -0x800(%rbp) # imm = 0xFFFFFFFF
movl -0x800(%rbp), %eax
cmpl 0x548a(%rip), %eax      # 0xa1a8
jge 0x4dce
movl -0x800(%rbp), %eax
cmpl -0x7e4(%rbp), %eax
je 0x4db8
movl -0x800(%rbp), %edx
movq -0x8(%rbp), %rax
movslq -0x7ec(%rbp), %rcx
movslq -0x7e0(%rbp,%rcx,4), %rcx
movl %edx, 0xc8(%rax,%rcx,4)
movq -0x8(%rbp), %rdi
callq 0x46f0
movq -0x8(%rbp), %rax
movl 0x898(%rax), %eax
cmpl -0x7f4(%rbp), %eax
jle 0x4d86
movq -0x8(%rbp), %rax
movl 0x898(%rax), %eax
movl %eax, -0x7f4(%rbp)
jmp 0x4c8e
movl -0x7e4(%rbp), %edx
movq -0x8(%rbp), %rax
movslq -0x7ec(%rbp), %rcx
movslq -0x7e0(%rbp,%rcx,4), %rcx
movl %edx, 0xc8(%rax,%rcx,4)
movl -0x7e8(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x898(%rax)
jmp 0x4db8
jmp 0x4dba
movl -0x800(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x800(%rbp)
jmp 0x4d12
movslq -0x7fc(%rbp), %rax
movl -0x7e0(%rbp,%rax,4), %eax
movl %eax, -0x7f0(%rbp)
movslq -0x7ec(%rbp), %rax
movl -0x7e0(%rbp,%rax,4), %ecx
movslq -0x7fc(%rbp), %rax
movl %ecx, -0x7e0(%rbp,%rax,4)
movl -0x7f0(%rbp), %ecx
movslq -0x7ec(%rbp), %rax
movl %ecx, -0x7e0(%rbp,%rax,4)
movl -0x7fc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7fc(%rbp)
jmp 0x4ca8
movq -0x8(%rbp), %rdi
callq 0x46f0
addq $0x810, %rsp            # imm = 0x810
popq %rbp
retq
nopl (%rax,%rax)