// File: /workspace/github_cpp_makefile_star2_O3/davidjosepha[P]slitherlink/src/solver/solver.cpp
// Function: Solver::updateEPQ()
void Solver::updateEPQ() {
    epq_.empty();

    int m = grid_->getHeight();
    int n = grid_->getWidth();
    for (int i = 1; i < m ; i++) {
        for (int j = 1; j < n-1; j++) {
            if (grid_->getHLine(i,j) != EMPTY) {
                continue;
            }
            float prio = grid_->getHLine(i,j-1) != EMPTY + grid_->getHLine(i,j+1) != EMPTY +
            grid_->getHLine(i+1,j) != EMPTY + grid_->getHLine(i-1,j) != EMPTY + grid_->getVLine(i-1,j+1) != EMPTY +
            grid_->getVLine(i-1,j) != EMPTY + grid_->getVLine(i,j) != EMPTY + grid_->getVLine(i,j+1) != EMPTY;

            if (prio > 0) {
                epq_.emplace(prio, i, j, true);
            }
        }
    }

    for (int i = 1; i < m-1; i++) {
        for (int j = 1; j < n; j++) {
            if (grid_->getVLine(i,j) != EMPTY) {
                continue;
            }
            float prio = grid_->getVLine(i-1,j) != EMPTY + grid_->getVLine(i+1,j) != EMPTY +
            grid_->getVLine(i,j-1) != EMPTY + grid_->getVLine(i,j+1) != EMPTY + grid_->getHLine(i,j-1) != EMPTY +
            grid_->getHLine(i+1,j-1) != EMPTY + grid_->getHLine(i,j) != EMPTY + grid_->getHLine(i+1,j) != EMPTY;

            if (prio > 0) {
                epq_.emplace(prio, i, j, false);
            }
        }
    }
    epqSize_ = epq_.size();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
addq $0x38, %rdi
movq %rdi, -0x58(%rbp)
callq 0x596e
movq 0x8(%rbx), %rax
movl 0xc(%rax), %ecx
movl %ecx, -0x3c(%rbp)
cmpl $0x2, %ecx
jl 0xb5da
movl 0x10(%rax), %r12d
leal -0x1(%r12), %r13d
movl $0x1, %r15d
movq %rbx, -0x38(%rbp)
movq %r12, -0x50(%rbp)
movl %r13d, -0x40(%rbp)
leal 0x1(%r15), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x3, %r12d
jl 0xb44b
leal -0x1(%r15), %eax
movl %eax, -0x48(%rbp)
movl $0x1, %r14d
movq %r15, -0x60(%rbp)
movq 0x8(%rbx), %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x4322
testl %eax, %eax
je 0xb347
incl %r14d
movl %r14d, %r12d
jmp 0xb43f
movq 0x8(%rbx), %rdi
leal -0x1(%r14), %edx
movl %r15d, %esi
callq 0x4322
movl %eax, %r13d
movq 0x8(%rbx), %rdi
leal 0x1(%r14), %r12d
movl %r15d, %esi
movl %r12d, %edx
callq 0x4322
xorl %ebx, %ebx
cmpl %eax, %r13d
setne %bl
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x2c(%rbp), %esi
movl %r14d, %edx
callq 0x4322
xorl %r13d, %r13d
cmpl %ebx, %eax
setne %r13b
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x48(%rbp), %r15d
movl %r15d, %esi
movl %r14d, %edx
callq 0x4322
xorl %ebx, %ebx
cmpl %r13d, %eax
setne %bl
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x4368
xorl %r13d, %r13d
cmpl %ebx, %eax
setne %r13b
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movl %r15d, %esi
movq -0x60(%rbp), %r15
movl %r14d, %edx
callq 0x4368
xorl %ebx, %ebx
cmpl %r13d, %eax
setne %bl
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x4368
xorl %r13d, %r13d
cmpl %ebx, %eax
movq -0x38(%rbp), %rbx
setne %r13b
movq 0x8(%rbx), %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x4368
cmpl %r13d, %eax
je 0xb43b
movq -0x58(%rbp), %rdi
movsd 0x401d(%rip), %xmm0     # 0xf448
movl %r15d, %esi
movl %r14d, %edx
movl $0x1, %ecx
callq 0x59d6
movl -0x40(%rbp), %r13d
movl %r12d, %r14d
cmpl %r13d, %r12d
jne 0xb329
movl -0x2c(%rbp), %eax
movl %eax, %r15d
cmpl -0x3c(%rbp), %eax
movq -0x50(%rbp), %r12
jne 0xb307
cmpl $0x2, -0x3c(%rbp)
je 0xb5da
decl -0x3c(%rbp)
movl $0x1, %r15d
cmpl $0x1, %r12d
jle 0xb5c8
leal -0x1(%r15), %eax
movl %eax, -0x40(%rbp)
leal 0x1(%r15), %eax
movl %eax, -0x2c(%rbp)
movl $0x1, %r14d
movq %r15, -0x48(%rbp)
movq 0x8(%rbx), %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x4368
testl %eax, %eax
je 0xb4b1
incl %r14d
movl %r14d, %r13d
jmp 0xb5b7
movq 0x8(%rbx), %rdi
movl -0x40(%rbp), %esi
movl %r14d, %edx
callq 0x4368
movl %eax, %r12d
movq 0x8(%rbx), %rdi
movl -0x2c(%rbp), %esi
movl %r14d, %edx
callq 0x4368
xorl %ebx, %ebx
cmpl %eax, %r12d
setne %bl
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
leal -0x1(%r14), %edx
movl %edx, -0x60(%rbp)
movl %r15d, %esi
callq 0x4368
movq %r15, %r12
xorl %r15d, %r15d
cmpl %ebx, %eax
setne %r15b
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
leal 0x1(%r14), %r13d
movl %r12d, %esi
movl %r13d, %edx
callq 0x4368
xorl %ebx, %ebx
cmpl %r15d, %eax
setne %bl
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movl %r12d, %esi
movl -0x60(%rbp), %r12d
movl %r12d, %edx
callq 0x4322
xorl %r15d, %r15d
cmpl %ebx, %eax
setne %r15b
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x2c(%rbp), %esi
movl %r12d, %edx
callq 0x4322
xorl %ebx, %ebx
cmpl %r15d, %eax
setne %bl
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x48(%rbp), %rsi
movl %r14d, %edx
callq 0x4322
xorl %r15d, %r15d
cmpl %ebx, %eax
movq -0x38(%rbp), %rbx
setne %r15b
movq 0x8(%rbx), %rdi
movl -0x2c(%rbp), %esi
movl %r14d, %edx
callq 0x4322
cmpl %r15d, %eax
jne 0xb596
movq -0x50(%rbp), %r12
movq -0x48(%rbp), %r15
jmp 0xb5b7
movq -0x58(%rbp), %rdi
movsd 0x3ea6(%rip), %xmm0     # 0xf448
movq -0x48(%rbp), %r15
movl %r15d, %esi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x59d6
movq -0x50(%rbp), %r12
movl %r13d, %r14d
cmpl %r12d, %r13d
jne 0xb493
movl -0x2c(%rbp), %eax
jmp 0xb5ce
incl %r15d
movl %r15d, %eax
movl %eax, %r15d
cmpl -0x3c(%rbp), %eax
jne 0xb471
movq -0x58(%rbp), %rdi
callq 0x5980
movl %eax, 0x60(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop