// File: /workspace/github_cpp_makefile_star2_O2/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, -0x50(%rbp)
callq 0x485e
movq 0x8(%rbx), %rax
movl 0xc(%rax), %ecx
movl %ecx, -0x40(%rbp)
movl 0x10(%rax), %r15d
leal -0x1(%r15), %r12d
pushq $0x1
popq %rax
movq %r15, -0x60(%rbp)
movl %r12d, -0x54(%rbp)
cmpl -0x40(%rbp), %eax
jge 0x6b7c
leal 0x1(%rax), %ecx
movl %ecx, -0x3c(%rbp)
leal -0x1(%rax), %ecx
movl %ecx, -0x44(%rbp)
pushq $0x1
popq %r13
movq %rax, %r15
movq %rax, -0x38(%rbp)
cmpl %r12d, %r13d
jge 0x6b70
movl %r13d, %r14d
movq 0x8(%rbx), %rdi
movl %r15d, %esi
movl %r13d, %edx
callq 0x3baa
testl %eax, %eax
je 0x6a77
incl %r14d
movl %r14d, %r13d
jmp 0x6a50
movq 0x8(%rbx), %rdi
leal -0x1(%r14), %edx
movl %r15d, %esi
callq 0x3baa
movl %eax, %r15d
movq 0x8(%rbx), %rdi
leal 0x1(%r14), %edx
movl %edx, -0x2c(%rbp)
movq -0x38(%rbp), %rsi
callq 0x3baa
xorl %r12d, %r12d
cmpl %eax, %r15d
setne %r12b
movq 0x8(%rbx), %rdi
movl -0x3c(%rbp), %esi
movl %r14d, %edx
callq 0x3baa
xorl %r15d, %r15d
cmpl %r12d, %eax
setne %r15b
movq 0x8(%rbx), %rdi
movq %rbx, %r13
movl -0x44(%rbp), %ebx
movl %ebx, %esi
movl %r14d, %edx
callq 0x3baa
xorl %r12d, %r12d
cmpl %r15d, %eax
setne %r12b
movq 0x8(%r13), %rdi
movl %ebx, %esi
movl -0x2c(%rbp), %edx
callq 0x3bee
xorl %r15d, %r15d
cmpl %r12d, %eax
setne %r15b
movq 0x8(%r13), %rdi
movl %ebx, %esi
movq %r13, %rbx
movl -0x2c(%rbp), %r13d
movl %r14d, %edx
callq 0x3bee
xorl %r12d, %r12d
cmpl %r15d, %eax
setne %r12b
movq 0x8(%rbx), %rdi
movq -0x38(%rbp), %rsi
movl %r14d, %edx
callq 0x3bee
xorl %r15d, %r15d
cmpl %r12d, %eax
movl -0x54(%rbp), %r12d
setne %r15b
movq 0x8(%rbx), %rdi
movq -0x38(%rbp), %rsi
movl %r13d, %edx
callq 0x3bee
cmpl %r15d, %eax
movq -0x38(%rbp), %r15
je 0x6a50
movq -0x50(%rbp), %rdi
movsd 0x38a3(%rip), %xmm0     # 0xa400
movl %r15d, %esi
movl %r14d, %edx
pushq $0x1
popq %rcx
callq 0x48cc
jmp 0x6a50
movl -0x3c(%rbp), %eax
movq -0x60(%rbp), %r15
jmp 0x6a30
decl -0x40(%rbp)
pushq $0x1
popq %rax
movl %eax, %r13d
cmpl -0x40(%rbp), %eax
jge 0x6cc8
leal -0x1(%r13), %eax
movl %eax, -0x44(%rbp)
leal 0x1(%r13), %eax
movl %eax, -0x2c(%rbp)
pushq $0x1
popq %r12
movq %r13, -0x38(%rbp)
cmpl %r15d, %r12d
jge 0x6cc0
movl %r12d, %r14d
movq 0x8(%rbx), %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x3bee
testl %eax, %eax
je 0x6bcb
incl %r14d
movl %r14d, %r12d
jmp 0x6ba4
movq 0x8(%rbx), %rdi
movl -0x44(%rbp), %esi
movl %r14d, %edx
callq 0x3bee
movl %eax, %r12d
movq 0x8(%rbx), %rdi
movl -0x2c(%rbp), %esi
movl %r14d, %edx
callq 0x3bee
xorl %r15d, %r15d
cmpl %eax, %r12d
setne %r15b
movq 0x8(%rbx), %rdi
leal -0x1(%r14), %r12d
movl %r13d, %esi
movl %r12d, %edx
callq 0x3bee
xorl %r13d, %r13d
cmpl %r15d, %eax
setne %r13b
movq 0x8(%rbx), %rdi
leal 0x1(%r14), %edx
movl %edx, -0x3c(%rbp)
movq -0x38(%rbp), %rsi
callq 0x3bee
xorl %r15d, %r15d
cmpl %r13d, %eax
setne %r15b
movq 0x8(%rbx), %rdi
movq -0x38(%rbp), %rsi
movl %r12d, %edx
callq 0x3baa
xorl %r13d, %r13d
cmpl %r15d, %eax
setne %r13b
movq 0x8(%rbx), %rdi
movl -0x2c(%rbp), %esi
movl %r12d, %edx
movl -0x3c(%rbp), %r12d
callq 0x3baa
xorl %r15d, %r15d
cmpl %r13d, %eax
setne %r15b
movq 0x8(%rbx), %rdi
movq -0x38(%rbp), %rsi
movl %r14d, %edx
callq 0x3baa
xorl %r13d, %r13d
cmpl %r15d, %eax
setne %r13b
movq 0x8(%rbx), %rdi
movl -0x2c(%rbp), %esi
movl %r14d, %edx
callq 0x3baa
cmpl %r13d, %eax
movq -0x38(%rbp), %r13
movq -0x60(%rbp), %r15
je 0x6ba4
movq -0x50(%rbp), %rdi
movsd 0x3752(%rip), %xmm0     # 0xa400
movl %r13d, %esi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x48cc
jmp 0x6ba4
movl -0x2c(%rbp), %eax
jmp 0x6b82
movq -0x50(%rbp), %rdi
callq 0x4870
movl %eax, 0x60(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop