// File: /workspace/github_cpp_makefile_star2_O1/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 0x5966
movq %rbx, -0x48(%rbp)
movq 0x8(%rbx), %rax
movl 0xc(%rax), %ecx
movl 0x10(%rax), %r15d
movl %ecx, -0x38(%rbp)
cmpl $0x2, %ecx
movl %r15d, -0x4c(%rbp)
jl 0xb48e
movl $0x1, %r13d
cmpl $0x3, %r15d
jl 0xb481
leal 0x1(%r13), %eax
movl %eax, -0x40(%rbp)
leal -0x1(%r13), %eax
movl %eax, -0x3c(%rbp)
movl $0x2, %r14d
movq %r13, -0x30(%rbp)
leal -0x1(%r14), %r12d
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x431a
testl %eax, %eax
jne 0xb475
movq -0x48(%rbp), %rbx
movq 0x8(%rbx), %rdi
leal -0x2(%r14), %edx
movl %r13d, %esi
callq 0x431a
movl %eax, %r13d
movq 0x8(%rbx), %rdi
movq -0x30(%rbp), %rsi
movl %r14d, %edx
callq 0x431a
xorl %r15d, %r15d
cmpl %eax, %r13d
setne %r15b
movq 0x8(%rbx), %rdi
movl -0x40(%rbp), %esi
movl %r12d, %edx
callq 0x431a
xorl %r13d, %r13d
cmpl %r15d, %eax
setne %r13b
movq 0x8(%rbx), %rdi
movl %r12d, -0x34(%rbp)
movq %rbx, %r12
movl -0x3c(%rbp), %ebx
movl %ebx, %esi
movl -0x34(%rbp), %edx
callq 0x431a
xorl %r15d, %r15d
cmpl %r13d, %eax
setne %r15b
movq 0x8(%r12), %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0x4360
xorl %r13d, %r13d
cmpl %r15d, %eax
setne %r13b
movq 0x8(%r12), %rdi
movl %ebx, %esi
movq %r12, %rbx
movl -0x34(%rbp), %r12d
movl %r12d, %edx
callq 0x4360
xorl %r15d, %r15d
cmpl %r13d, %eax
setne %r15b
movq 0x8(%rbx), %rdi
movq -0x30(%rbp), %rsi
movl %r12d, %edx
callq 0x4360
xorl %r13d, %r13d
cmpl %r15d, %eax
movl -0x4c(%rbp), %r15d
setne %r13b
movq 0x8(%rbx), %rdi
movq -0x30(%rbp), %rsi
movl %r14d, %edx
callq 0x4360
cmpl %r13d, %eax
movq -0x30(%rbp), %r13
je 0xb475
movq -0x58(%rbp), %rdi
movsd 0x3fc3(%rip), %xmm0     # 0xf428
movl %r13d, %esi
movl %r12d, %edx
movl $0x1, %ecx
callq 0x59ce
incl %r14d
cmpl %r14d, %r15d
jne 0xb35e
incl %r13d
cmpl -0x38(%rbp), %r13d
jne 0xb33c
cmpl $0x3, -0x38(%rbp)
jl 0xb5ec
addl $-0x2, -0x38(%rbp)
movl $0x1, %eax
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rbx
cmpl $0x2, %r15d
jl 0xb5d8
movq -0x30(%rbp), %rcx
leal -0x1(%rcx), %eax
movl %eax, -0x3c(%rbp)
leal 0x1(%rcx), %eax
movl %eax, -0x34(%rbp)
movl $0x1, %r14d
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rsi
movl %r14d, %edx
callq 0x4360
testl %eax, %eax
jne 0xb5cc
movq 0x8(%rbx), %rdi
movl -0x3c(%rbp), %esi
movl %r14d, %edx
callq 0x4360
movl %eax, %r15d
movq 0x8(%rbx), %rdi
movl -0x34(%rbp), %esi
movl %r14d, %edx
callq 0x4360
xorl %r13d, %r13d
cmpl %eax, %r15d
setne %r13b
movq 0x8(%rbx), %rdi
leal -0x1(%r14), %edx
movl %edx, -0x40(%rbp)
movq -0x30(%rbp), %rsi
callq 0x4360
xorl %r15d, %r15d
cmpl %r13d, %eax
setne %r15b
movq 0x8(%rbx), %rdi
leal 0x1(%r14), %edx
movq -0x30(%rbp), %rsi
callq 0x4360
xorl %r13d, %r13d
cmpl %r15d, %eax
setne %r13b
movq 0x8(%rbx), %rdi
movq -0x30(%rbp), %rsi
movl -0x40(%rbp), %r12d
movl %r12d, %edx
callq 0x431a
xorl %r15d, %r15d
cmpl %r13d, %eax
setne %r15b
movq 0x8(%rbx), %rdi
movl -0x34(%rbp), %esi
movl %r12d, %edx
callq 0x431a
xorl %r12d, %r12d
cmpl %r15d, %eax
setne %r12b
movq 0x8(%rbx), %rdi
movq -0x30(%rbp), %rsi
movl %r14d, %edx
callq 0x431a
xorl %r15d, %r15d
cmpl %r12d, %eax
setne %r15b
movq 0x8(%rbx), %rdi
movl -0x34(%rbp), %esi
movl %r14d, %edx
callq 0x431a
cmpl %r15d, %eax
movl -0x4c(%rbp), %r15d
je 0xb5cc
movq -0x58(%rbp), %rdi
movsd 0x3e6a(%rip), %xmm0     # 0xf428
movq -0x30(%rbp), %rsi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x59ce
incl %r14d
cmpl %r14d, %r15d
jne 0xb4c9
movq -0x30(%rbp), %rcx
leal 0x1(%rcx), %eax
cmpl -0x38(%rbp), %ecx
movq %rax, -0x30(%rbp)
jne 0xb4a9
movq -0x58(%rbp), %rdi
callq 0x5978
movq -0x48(%rbp), %rcx
movl %eax, 0x60(%rcx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop