LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/contour.cpp
// Function: Contour::addContour(Contour&)
void Contour::addContour(Contour & contour) {
    if (start_.i == contour.start_.i && start_.j == contour.start_.j) {
        start_.i = contour.end_.i;
        start_.j = contour.end_.j;
        length_++;
    } else if (start_.i == contour.end_.i && start_.j == contour.end_.j) {
        start_.i = contour.start_.i;
        start_.j = contour.start_.j;
        length_++;
    } else if (end_.i == contour.start_.i && end_.j == contour.start_.j) {
        end_.i = contour.end_.i;
        end_.j = contour.end_.j;
        length_++;
    } else if (end_.i == contour.end_.i && end_.j == contour.end_.j) {
        end_.i = contour.start_.i;
        end_.j = contour.start_.j;
        length_++;
    }

    if (start_.i == end_.i && start_.j == end_.j) {
        closed_ = true;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x8(%rdi), %ecx
movl 0x8(%rsi), %eax
cmpl %eax, %ecx
jne 0x24cc
movl 0xc(%rdi), %edx
cmpl 0xc(%rsi), %edx
jne 0x24cc
leaq 0xc(%rdi), %rdx
movl 0x10(%rsi), %eax
movl %eax, 0x8(%rdi)
movabsq $0x14, %r8
jmp 0x2535
movl 0x10(%rsi), %r8d
cmpl %r8d, %ecx
jne 0x24f0
movl 0xc(%rdi), %edx
cmpl 0x14(%rsi), %edx
jne 0x24f0
leaq 0xc(%rdi), %rdx
movl %eax, 0x8(%rdi)
movabsq $0xc, %r8
jmp 0x2535
movl 0x10(%rdi), %edx
cmpl %eax, %edx
jne 0x2515
movl 0x14(%rdi), %r9d
cmpl 0xc(%rsi), %r9d
jne 0x2515
leaq 0x14(%rdi), %rdx
movl %r8d, 0x10(%rdi)
movabsq $0x14, %r8
jmp 0x2533
cmpl %r8d, %edx
jne 0x253f
movl 0x14(%rdi), %edx
cmpl 0x14(%rsi), %edx
jne 0x253f
leaq 0x14(%rdi), %rdx
movl %eax, 0x10(%rdi)
movabsq $0xc, %r8
movl %ecx, %eax
movl (%rsi,%r8), %ecx
movl %ecx, (%rdx)
incl (%rdi)
movl %eax, %ecx
cmpl 0x10(%rdi), %ecx
jne 0x2550
movl 0xc(%rdi), %eax
cmpl 0x14(%rdi), %eax
jne 0x2550
movb $0x1, 0x4(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/export.cpp
// Function: Export::print() const
void Export::print() const {
    int m = lattice_->getHeight();
    int n = lattice_->getWidth();

    for (int i = 1; i < m-1; i++) {
        /* print points/lines/Xs/nothing above the row of numbers */
        for (int j = 1; j < n-1; j++) {
            std::cout << POINT;
            std::cout << ' ';
            std::cout << formatHLine(i, j);
            std::cout << ' ';
        }
        std::cout << POINT << std::endl;

        /* print row of numbers */
        for (int j = 1; j < n-1; j++) {
            /* print line/x/nothing to the left of number */
            std::cout << formatVLine(i, j);
            std::cout << ' ';
            /* print number */
            std::cout << formatNumber(i, j);
            std::cout << ' ';
        }
        /* print line/x/nothing to the right of last number */
        std::cout << formatVLine(i, n-1) << std::endl;
    }

    /* print lines/Xs/nothing below the last row of numbers */
    for (int j = 1; j < n-1; j++) {
        std::cout << POINT;
        std::cout << ' ';
        std::cout << formatHLine(m-1, j);
        std::cout << ' ';
    }
    std::cout << POINT << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movl 0xc(%rax), %ecx
movl 0x10(%rax), %eax
decl %ecx
movl %ecx, -0x30(%rbp)
decl %eax
movl %eax, -0x2c(%rbp)
pushq $0x1
popq %r13
movq 0xca4b(%rip), %r12      # 0xefd8
pushq $0x20
popq %r14
cmpl -0x30(%rbp), %r13d
jge 0x266c
pushq $0x1
popq %r15
movq %r12, %rdi
pushq $0x2e
popq %rsi
callq 0x21c0
cmpl -0x2c(%rbp), %r15d
jge 0x25e4
movq %r12, %rdi
movl %r14d, %esi
callq 0x21c0
movq %rbx, %rdi
movl %r13d, %esi
movl %r15d, %edx
callq 0x26da
movsbl %al, %esi
movq %r12, %rdi
callq 0x21c0
movq %r12, %rdi
movl %r14d, %esi
callq 0x21c0
incl %r15d
jmp 0x259f
movq %rax, %rdi
callq 0x20e0
pushq $0x1
popq %r15
cmpl -0x2c(%rbp), %r15d
jge 0x2643
movq %rbx, %rdi
movl %r13d, %esi
movl %r15d, %edx
callq 0x26fe
movsbl %al, %esi
movq %r12, %rdi
callq 0x21c0
movq %r12, %rdi
movl %r14d, %esi
callq 0x21c0
movq %rbx, %rdi
movl %r13d, %esi
movl %r15d, %edx
callq 0x2722
movsbl %al, %esi
movq %r12, %rdi
callq 0x21c0
movq %r12, %rdi
movl %r14d, %esi
callq 0x21c0
incl %r15d
jmp 0x25f0
movq %rbx, %rdi
movl %r13d, %esi
movl -0x2c(%rbp), %edx
callq 0x26fe
movsbl %al, %esi
movq %r12, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
incl %r13d
jmp 0x2591
pushq $0x1
popq %r14
movq 0xc961(%rip), %r15      # 0xefd8
pushq $0x2e
popq %r12
pushq $0x20
popq %r13
movq %r15, %rdi
movl %r12d, %esi
callq 0x21c0
cmpl -0x2c(%rbp), %r14d
jge 0x26c4
movq %r15, %rdi
movl %r13d, %esi
callq 0x21c0
movq %rbx, %rdi
movl -0x30(%rbp), %esi
movl %r14d, %edx
callq 0x26da
movsbl %al, %esi
movq %r15, %rdi
callq 0x21c0
movq %r15, %rdi
movl %r13d, %esi
callq 0x21c0
incl %r14d
jmp 0x267f
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20e0
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/grid.cpp
// Function: Grid::~Grid()
Grid::~Grid() {
    if (init_) {
        for (int i = 0; i < m_; i++) {
            delete [] updateMatrix_[i];
        }
        delete [] updateMatrix_;

        for (int i = 0; i < m_; i++) {
            delete [] contraMatrix_[i];
        }
        delete [] contraMatrix_;

        for (int i = 0; i < m_+1; i++) {
            delete [] contourMatrix_[i];
        }
        delete [] contourMatrix_;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xc5ef(%rip), %rax      # 0xed50
movq %rax, (%rdi)
cmpb $0x1, 0x49(%rdi)
jne 0x27f5
xorl %r14d, %r14d
movslq 0xc(%rbx), %rax
movq 0x30(%rbx), %rdi
cmpq %rax, %r14
jge 0x2791
movq (%rdi,%r14,8), %rdi
testq %rdi, %rdi
je 0x278c
callq 0x21e0
incq %r14
jmp 0x2771
testq %rdi, %rdi
je 0x279b
callq 0x21e0
xorl %r14d, %r14d
movslq 0xc(%rbx), %rax
movq 0x38(%rbx), %rdi
cmpq %rax, %r14
jge 0x27be
movq (%rdi,%r14,8), %rdi
testq %rdi, %rdi
je 0x27b9
callq 0x21e0
incq %r14
jmp 0x279e
testq %rdi, %rdi
je 0x27c8
callq 0x21e0
xorl %r14d, %r14d
movslq 0xc(%rbx), %rax
movq 0x40(%rbx), %rdi
cmpq %rax, %r14
jg 0x27eb
movq (%rdi,%r14,8), %rdi
testq %rdi, %rdi
je 0x27e6
callq 0x21e0
incq %r14
jmp 0x27cb
testq %rdi, %rdi
je 0x27f5
callq 0x21e0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x3924
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/grid.cpp
// Function: Grid::resetGrid()
void Grid::resetGrid() {
    for (int i = 1; i < getHeight(); i++) {
        for (int j = 1; j < getWidth()-1; j++) {
            hlines_[i][j] = EMPTY;
        }
    }

    for (int i = 1; i < getHeight()-1; i++) {
        for (int j = 1; j < getWidth(); j++) {
            vlines_[i][j] = EMPTY;
        }
    }

    for (int i = 0; i < getHeight(); i++) {
        for (int j = 0; j < getWidth(); j++) {
            setUpdateMatrix(i, j, true);
            setContraMatrix(i, j, true);
        }
    }

    for (int i = 0; i < getHeight()+1; i++) {
        for (int j = 0; j < getWidth()+1; j++) {
            setContourMatrix(i, j, std::make_pair(-1,-1));
        }
    }

    numClosedLoops_ = 0;
    numOpenLoops_ = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
movslq 0xc(%rdi), %rax
movslq 0x10(%rdi), %rcx
decq %rcx
movabsq $0x1, %rdx
movq %rdx, %rsi
cmpq %rax, %rsi
jge 0x2843
movq 0x20(%rdi), %r8
movq %rdx, %r9
cmpq %rcx, %r9
jge 0x283e
movq (%r8,%rsi,8), %r10
andl $0x0, (%r10,%r9,4)
incq %r9
jmp 0x282b
incq %rsi
jmp 0x281f
leaq -0x1(%rax), %rcx
movslq 0x10(%rdi), %rdx
movabsq $0x1, %rsi
movq %rsi, %r8
cmpq %rcx, %r8
jge 0x287c
movq 0x28(%rdi), %r9
movq %rsi, %r10
cmpq %rdx, %r10
jge 0x2877
movq (%r9,%r8,8), %r11
andl $0x0, (%r11,%r10,4)
incq %r10
jmp 0x2864
incq %r8
jmp 0x2858
movl 0x10(%rdi), %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
testl %eax, %eax
movl $0x0, %esi
cmovgl %eax, %esi
movb $0x1, %r8b
cmpq %rsi, %rdx
je 0x28c2
movq 0x30(%rdi), %r9
movq 0x38(%rdi), %r10
xorl %r11d, %r11d
cmpq %r11, %rcx
je 0x28bd
movq (%r9,%rdx,8), %rbx
movb %r8b, (%rbx,%r11)
movq (%r10,%rdx,8), %rbx
movb %r8b, (%rbx,%r11)
incq %r11
jmp 0x28a3
incq %rdx
jmp 0x2893
movslq 0x10(%rdi), %rcx
xorl %edx, %edx
cmpq %rax, %rdx
jg 0x28ec
movq 0x40(%rdi), %rsi
xorl %r8d, %r8d
cmpq %rcx, %r8
jg 0x28e7
movq (%rsi,%rdx,8), %r9
orq $-0x1, (%r9,%r8,8)
incq %r8
jmp 0x28d4
incq %rdx
jmp 0x28c8
andq $0x0, 0x4c(%rdi)
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/grid.cpp
// Function: Grid::copy(Grid&) const
void Grid::copy(Grid & newGrid) const {
    newGrid.initArrays(getHeight(), getWidth());
    newGrid.initUpdateMatrix();

    for (int i = 0; i < getHeight()+1; i++) {
        for (int j = 0; j < getWidth(); j++) {
            newGrid.changeHLine(i, j, getHLine(i,j));
        }
    }

    for (int i = 0; i < getHeight(); i++) {
        for (int j = 0; j < getWidth()+1; j++) {
            newGrid.changeVLine(i, j, getVLine(i,j));
        }
    }

    for (int i = 0; i < getHeight(); i++) {
        for (int j = 0; j < getWidth(); j++) {
            newGrid.setNumber(i, j, getNumber(i,j));
            newGrid.setUpdateMatrix(i, j, updateMatrix_[i][j]);
            newGrid.setContraMatrix(i, j, contraMatrix_[i][j]);
        }
    }

    for (int i = 0; i < getHeight()+1; i++) {
        for (int j = 0; j < getWidth()+1; j++) {
            newGrid.setContourMatrix(i, j, contourMatrix_[i][j]);
        }
    }

    newGrid.numOpenLoops_ = numOpenLoops_;
    newGrid.numClosedLoops_ = numClosedLoops_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0xc(%rdi), %esi
movl 0x10(%rdi), %edx
movq %rbx, %rdi
callq 0x39d4
movq %rbx, %rdi
callq 0x2a58
xorl %r15d, %r15d
movl 0xc(%r14), %eax
cmpl %eax, %r15d
jg 0x295a
xorl %r12d, %r12d
cmpl 0x10(%r14), %r12d
jge 0x2955
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x3baa
movq (%rbx), %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq *0x10(%r8)
incl %r12d
jmp 0x292a
incl %r15d
jmp 0x291e
xorl %r15d, %r15d
cmpl %eax, %r15d
jge 0x2999
xorl %r12d, %r12d
cmpl 0x10(%r14), %r12d
jg 0x2990
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x3bee
movq (%rbx), %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq *0x18(%r8)
incl %r12d
jmp 0x2965
incl %r15d
movl 0xc(%r14), %eax
jmp 0x295d
xorl %r15d, %r15d
cltq
cmpq %rax, %r15
jge 0x2a0b
xorl %r12d, %r12d
movslq 0x10(%r14), %rax
cmpq %rax, %r12
jge 0x2a02
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x3b66
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq 0x3c62
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rax
movb (%rax,%r12), %al
movq 0x30(%rbx), %rcx
movq (%rcx,%r15,8), %rcx
movb %al, (%rcx,%r12)
movq 0x38(%r14), %rax
movq (%rax,%r15,8), %rax
movb (%rax,%r12), %al
movq 0x38(%rbx), %rcx
movq (%rcx,%r15,8), %rcx
movb %al, (%rcx,%r12)
incq %r12
jmp 0x29a6
incq %r15
movl 0xc(%r14), %eax
jmp 0x299c
movslq 0x10(%r14), %rcx
xorl %edx, %edx
cmpq %rax, %rdx
jg 0x2a40
movq 0x40(%r14), %rsi
movq 0x40(%rbx), %rdi
xorl %r8d, %r8d
cmpq %rcx, %r8
jg 0x2a3b
movq (%rsi,%rdx,8), %r9
movq (%r9,%r8,8), %r9
movq (%rdi,%rdx,8), %r10
movq %r9, (%r10,%r8,8)
incq %r8
jmp 0x2a21
incq %rdx
jmp 0x2a11
movl 0x4c(%r14), %eax
movl %eax, 0x4c(%rbx)
movl 0x50(%r14), %eax
movl %eax, 0x50(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/grid.cpp
// Function: Grid::clearAndCopy(Grid&)
void Grid::clearAndCopy(Grid & newGrid) {
    for (int i = 0; i < getHeight()+1; i++) {
        for (int j = 0; j < getWidth(); j++) {
            newGrid.changeHLine(i, j, getHLine(i,j));
        }
    }

    for (int i = 0; i < getHeight(); i++) {
        for (int j = 0; j < getWidth()+1; j++) {
            newGrid.changeVLine(i, j, getVLine(i,j));
        }
    }

    for (int i = 0; i < getHeight(); i++) {
        for (int j = 0; j < getWidth(); j++) {
            newGrid.setNumber(i, j, getNumber(i,j));
            newGrid.setUpdateMatrix(i, j, updateMatrix_[i][j]);
            newGrid.setContraMatrix(i, j, contraMatrix_[i][j]);
        }
    }

    for (int i = 0; i < getHeight()+1; i++) {
        for (int j = 0; j < getWidth()+1; j++) {
            newGrid.setContourMatrix(i, j, contourMatrix_[i][j]);
        }
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movl 0xc(%r14), %eax
cmpl %eax, %r15d
jg 0x2c52
xorl %r12d, %r12d
cmpl 0x10(%r14), %r12d
jge 0x2c4d
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x3baa
movq (%rbx), %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq *0x10(%r8)
incl %r12d
jmp 0x2c22
incl %r15d
jmp 0x2c16
xorl %r15d, %r15d
cmpl %eax, %r15d
jge 0x2c91
xorl %r12d, %r12d
cmpl 0x10(%r14), %r12d
jg 0x2c88
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x3bee
movq (%rbx), %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq *0x18(%r8)
incl %r12d
jmp 0x2c5d
incl %r15d
movl 0xc(%r14), %eax
jmp 0x2c55
xorl %r15d, %r15d
cltq
cmpq %rax, %r15
jge 0x2d03
xorl %r12d, %r12d
movslq 0x10(%r14), %rax
cmpq %rax, %r12
jge 0x2cfa
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x3b66
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq 0x3c62
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rax
movb (%rax,%r12), %al
movq 0x30(%rbx), %rcx
movq (%rcx,%r15,8), %rcx
movb %al, (%rcx,%r12)
movq 0x38(%r14), %rax
movq (%rax,%r15,8), %rax
movb (%rax,%r12), %al
movq 0x38(%rbx), %rcx
movq (%rcx,%r15,8), %rcx
movb %al, (%rcx,%r12)
incq %r12
jmp 0x2c9e
incq %r15
movl 0xc(%r14), %eax
jmp 0x2c94
movslq 0x10(%r14), %rcx
xorl %edx, %edx
cmpq %rax, %rdx
jg 0x2d38
movq 0x40(%r14), %rsi
movq 0x40(%rbx), %rdi
xorl %r8d, %r8d
cmpq %rcx, %r8
jg 0x2d33
movq (%rsi,%rdx,8), %r9
movq (%r9,%r8,8), %r9
movq (%rdi,%rdx,8), %r10
movq %r9, (%r10,%r8,8)
incq %r8
jmp 0x2d19
incq %rdx
jmp 0x2d09
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/grid.cpp
// Function: Grid::setHLine(int, int, Edge)
bool Grid::setHLine(int i, int j, Edge edge) {
    assert(0 <= i && i < m_+1 && 0 <= j && j < n_);

    if (edge == EMPTY) {
        return true;
    }

    Edge prevEdge = getHLine(i, j);
    if (prevEdge == EMPTY) {
        hlines_[i][j] = edge;
    } else if (prevEdge != edge) {
        return false;
    } else if (prevEdge == edge) {
        return true;
    }

    // Update contour information
    if (edge == LINE) {
        updateContourMatrix(i, j, true);
    }

    // Update which parts of grid have possible rules that could be applied
    for (int x = std::max(0, i-3); x < std::min(i+1, getHeight()); x++) {
        for (int y = std::max(0, j-2); y < std::min(j+1, getWidth()); y++) {
            updateMatrix_[x][y] = true;
        }
    }

    // Update which parts of grid have possible contradictions
    for (int x = std::max(0, i-2); x < std::min(i+1, getHeight()); x++) {
        for (int y = std::max(0, j-1); y < std::min(j+1, getWidth()); y++) {
            contraMatrix_[x][y] = true;
        }
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %esi, %esi
js 0x2e8d
movl %edx, %r15d
testl %edx, %edx
js 0x2e8d
movl %esi, %r12d
movq %rdi, %rbx
cmpl %esi, 0xc(%rdi)
jl 0x2e8d
cmpl %r15d, 0x10(%rbx)
jle 0x2e8d
movl %ecx, %r13d
movb $0x1, %r14b
testl %ecx, %ecx
je 0x2d9f
movq %rbx, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x3baa
testl %eax, %eax
je 0x2db1
cmpl %r13d, %eax
sete %r14b
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rbx), %rax
movl %r12d, %ecx
movq (%rax,%rcx,8), %rax
movl %r15d, %ecx
movl %r13d, (%rax,%rcx,4)
cmpl $0x1, %r13d
jne 0x2dda
pushq $0x1
popq %rcx
movq %rbx, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x2eac
cmpl $0x4, %r12d
pushq $0x3
popq %rsi
cmovael %r12d, %esi
leal 0x1(%r12), %ecx
movl 0xc(%rbx), %eax
movl 0x10(%rbx), %r8d
cmpl %ecx, %eax
cmovll %eax, %ecx
cmpl $0x3, %r15d
pushq $0x2
popq %rax
movl %eax, %edi
cmovael %r15d, %edi
leal 0x1(%r15), %edx
cmpl %edx, %r8d
cmovgel %edx, %r8d
addq $-0x2, %rdi
movslq %r8d, %r8
addq $-0x3, %rsi
movslq %ecx, %rcx
cmpq %rcx, %rsi
jge 0x2e40
movq 0x30(%rbx), %r9
movq %rdi, %r10
cmpq %r8, %r10
jge 0x2e3b
movq (%r9,%rsi,8), %r11
movb $0x1, (%r11,%r10)
incq %r10
jmp 0x2e28
incq %rsi
jmp 0x2e1c
cmpl $0x3, %r12d
cmovgel %r12d, %eax
cmpl $0x2, %r15d
pushq $0x1
popq %rsi
cmovgel %r15d, %esi
movl 0x10(%rbx), %edi
cmpl %edx, %edi
cmovll %edi, %edx
decq %rsi
movslq %edx, %rdx
addq $-0x2, %rax
cmpq %rcx, %rax
jge 0x2d9f
movq 0x38(%rbx), %rdi
movq %rsi, %r8
cmpq %rdx, %r8
jge 0x2e88
movq (%rdi,%rax,8), %r9
movb $0x1, (%r9,%r8)
incq %r8
jmp 0x2e75
incq %rax
jmp 0x2e65
leaq 0x718a(%rip), %rdi      # 0xa01e
leaq 0x71aa(%rip), %rsi      # 0xa045
leaq 0x71b7(%rip), %rcx      # 0xa059
movl $0x81, %edx
callq 0x2120
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/grid.cpp
// Function: Grid::setVLine(int, int, Edge)
bool Grid::setVLine(int i, int j, Edge edge) {
    assert(0 <= i && i < m_ && 0 <= j && j < n_+1);

    Edge prevEdge = getVLine(i, j);
    if (prevEdge == EMPTY) {
        vlines_[i][j] = edge;
    } else if (prevEdge != edge) {
        return false;
    } else if (prevEdge == edge) {
        return true;
    }

    // Update contour information
    if (edge == LINE) {
        updateContourMatrix(i, j, false);
    }

    // Update which parts of grid have possible rules that could be applied
    for (int x = std::max(0, i-2); x < std::min(i+1, getHeight()); x++) {
        for (int y = std::max(0, j-3); y < std::min(j+1, getWidth()); y++) {
            updateMatrix_[x][y] = true;
        }
    }

    // Update which parts of grid have possible contradictions
    for (int x = std::max(0, i-1); x < std::min(i+1, getHeight()); x++) {
        for (int y = std::max(0, j-2); y < std::min(j+1, getWidth()); y++) {
            contraMatrix_[x][y] = true;
        }
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testl %esi, %esi
js 0x3110
movl %edx, %r14d
testl %edx, %edx
js 0x3110
movl %esi, %r15d
movq %rdi, %rbx
cmpl %esi, 0xc(%rdi)
jle 0x3110
cmpl %r14d, 0x10(%rbx)
jl 0x3110
movl %ecx, %r12d
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x3bee
testl %eax, %eax
je 0x302f
cmpl %r12d, %eax
sete %al
jmp 0x3107
movq 0x28(%rbx), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rax
movl %r14d, %ecx
movl %r12d, (%rax,%rcx,4)
cmpl $0x1, %r12d
jne 0x3057
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x2eac
cmpl $0x3, %r15d
pushq $0x2
popq %rax
movl %eax, %esi
cmovael %r15d, %esi
leal 0x1(%r15), %ecx
movl 0xc(%rbx), %edx
movl 0x10(%rbx), %r8d
cmpl %ecx, %edx
cmovll %edx, %ecx
cmpl $0x4, %r14d
pushq $0x3
popq %rdi
cmovael %r14d, %edi
leal 0x1(%r14), %edx
cmpl %edx, %r8d
cmovgel %edx, %r8d
addq $-0x3, %rdi
movslq %r8d, %r8
addq $-0x2, %rsi
movslq %ecx, %rcx
cmpq %rcx, %rsi
jge 0x30bc
movq 0x30(%rbx), %r9
movq %rdi, %r10
cmpq %r8, %r10
jge 0x30b7
movq (%r9,%rsi,8), %r11
movb $0x1, (%r11,%r10)
incq %r10
jmp 0x30a4
incq %rsi
jmp 0x3098
cmpl $0x2, %r15d
pushq $0x1
popq %rsi
cmovgel %r15d, %esi
cmpl $0x3, %r14d
cmovgel %r14d, %eax
movl 0x10(%rbx), %edi
cmpl %edx, %edi
cmovll %edi, %edx
addq $-0x2, %rax
movslq %edx, %rdx
decq %rsi
cmpq %rcx, %rsi
jge 0x3105
movq 0x38(%rbx), %rdi
movq %rax, %r8
cmpq %rdx, %r8
jge 0x3100
movq (%rdi,%rsi,8), %r9
movb $0x1, (%r9,%r8)
incq %r8
jmp 0x30ed
incq %rsi
jmp 0x30e1
movb $0x1, %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6f6e(%rip), %rdi      # 0xa085
leaq 0x6f27(%rip), %rsi      # 0xa045
leaq 0x6f87(%rip), %rcx      # 0xa0ac
movl $0xac, %edx
callq 0x2120
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/grid.cpp
// Function: Grid::numberSatisfied(int, int) const
bool Grid::numberSatisfied(int i, int j) const {
    assert(0 <= i && i < m_ && 0 <= j && j < n_);

    Number number = numbers_[i][j];

    /* determine number of lines around number */
    int numLines = (hlines_[i][j] == LINE)
                 + (hlines_[i+1][j] == LINE)
                 + (vlines_[i][j] == LINE)
                 + (vlines_[i][j+1] == LINE);

    switch (number) {
        case NONE:
            return true;
        case ZERO:
            return numLines == 0;
        case ONE:
            return numLines == 1;
        case TWO:
            return numLines == 2;
        case THREE:
            return numLines == 3;
    }
}

// Assembly:
testl %esi, %esi
js 0x325d
testl %edx, %edx
js 0x325d
cmpl %esi, 0xc(%rdi)
jle 0x325d
cmpl %edx, 0x10(%rdi)
jle 0x325d
movl %esi, %ecx
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rsi
movq (%rax,%rcx,8), %rax
movl %edx, %edx
movl (%rax,%rdx,4), %eax
movq (%rsi,%rcx,8), %r8
movq 0x8(%rsi,%rcx,8), %rsi
xorl %r9d, %r9d
cmpl $0x1, (%r8,%rdx,4)
sete %r9b
xorl %r8d, %r8d
cmpl $0x1, (%rsi,%rdx,4)
sete %r8b
addl %r9d, %r8d
movq 0x28(%rdi), %rsi
movq (%rsi,%rcx,8), %rsi
xorl %edi, %edi
cmpl $0x1, (%rsi,%rdx,4)
sete %dil
xorl %ecx, %ecx
cmpl $0x1, 0x4(%rsi,%rdx,4)
sete %cl
addl %edi, %ecx
addl %r8d, %ecx
leaq 0x6dc8(%rip), %rdx      # 0xa004
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movb $0x1, %al
retq
cmpl $0x3, %ecx
jmp 0x3259
cmpl $0x1, %ecx
jmp 0x3259
cmpl $0x2, %ecx
jmp 0x3259
testl %ecx, %ecx
sete %al
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x6ece(%rip), %rdi      # 0xa136
leaq 0x6dd6(%rip), %rsi      # 0xa045
leaq 0x6ee5(%rip), %rcx      # 0xa15b
movl $0xeb, %edx
callq 0x2120
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/grid.cpp
// Function: Grid::isSolved() const
bool Grid::isSolved() const {
    if (numOpenLoops_ != 0 || numClosedLoops_ != 1) {
        return false;
    }

    for (int i = 0; i < m_; i++) {
        for (int j = 0; j < n_; j++) {
            if (!numberSatisfied(i,j)) {
                return false;
            }
        }
    }

    return true;
}

// Assembly:
xorl %eax, %eax
cmpl $0x0, 0x4c(%rdi)
jne 0x32d5
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x1, 0x50(%rdi)
jne 0x32cb
xorl %r14d, %r14d
cmpl 0xc(%rbx), %r14d
jge 0x32d6
xorl %r15d, %r15d
cmpl 0x10(%rbx), %r15d
jge 0x32c4
movq %rbx, %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x31c0
incl %r15d
testb %al, %al
jne 0x32a7
jmp 0x32c9
incl %r14d
jmp 0x329e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
jmp 0x32cb
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/import.cpp
// Function: Import::buildEmptyLattice(int, int)
void Import::buildEmptyLattice(int m, int n) {

    lattice_->initArrays(m+2, n+2);
    lattice_->initUpdateMatrix();

    for (int i = 0; i < m+1; i++) {
        lattice_->setHLine(i+1, 0, NLINE);
    }

    for (int i = 0; i < m+2; i++) {
        lattice_->setVLine(i, 0, NLINE);
        lattice_->setVLine(i, n+2, NLINE);
    }

    for (int j = 0; j < n+3; j++) {
        lattice_->setVLine(0, j, NLINE);
        lattice_->setVLine(m+1, j, NLINE);
    }

    for (int j = 0; j < n+2; j++) {
        lattice_->setHLine(0, j, NLINE);
        lattice_->setHLine(m+2, j, NLINE);
    }

    for (int j = 0; j < m+3; j++) {
        lattice_->setHLine(j, 0, NLINE);
        lattice_->setHLine(j, n+1, NLINE);
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %r14
movq (%rdi), %rdi
leal 0x2(%r12), %esi
leal 0x2(%r13), %edx
movl %esi, -0x2c(%rbp)
movl %edx, -0x30(%rbp)
callq 0x39d4
movq (%r14), %rdi
callq 0x2a58
xorl %ebx, %ebx
pushq $0x2
popq %r15
cmpl %r12d, %ebx
jg 0x36c3
movq (%r14), %rdi
incl %ebx
movq (%rdi), %rax
movl %ebx, %esi
xorl %edx, %edx
movl %r15d, %ecx
callq *(%rax)
jmp 0x36ab
movq %r12, -0x38(%rbp)
xorl %ebx, %ebx
movl -0x2c(%rbp), %eax
testl %eax, %eax
movl $0x0, %r15d
cmovgl %eax, %r15d
pushq $0x2
popq %r12
cmpl %ebx, %r15d
je 0x3706
movq (%r14), %rdi
movq (%rdi), %rax
movl %ebx, %esi
xorl %edx, %edx
movl %r12d, %ecx
callq *0x8(%rax)
movq (%r14), %rdi
movq (%rdi), %rax
movl %ebx, %esi
movl -0x30(%rbp), %edx
movl %r12d, %ecx
callq *0x8(%rax)
incl %ebx
jmp 0x36dc
cmpl $-0x2, %r13d
pushq $-0x3
popq %rcx
movq %r13, %rax
movl %ecx, %r13d
movq %rax, -0x40(%rbp)
cmovgel %eax, %r13d
movq -0x38(%rbp), %rax
leal 0x1(%rax), %ebx
addl $0x3, %r13d
xorl %r12d, %r12d
pushq $0x2
popq %r15
cmpl %r12d, %r13d
je 0x3759
movq (%r14), %rdi
movq (%rdi), %rax
xorl %esi, %esi
movl %r12d, %edx
movl %r15d, %ecx
callq *0x8(%rax)
movq (%r14), %rdi
movq (%rdi), %rax
movl %ebx, %esi
movl %r12d, %edx
movl %r15d, %ecx
callq *0x8(%rax)
incl %r12d
jmp 0x372d
xorl %ebx, %ebx
movl -0x30(%rbp), %r12d
testl %r12d, %r12d
cmovlel %ebx, %r12d
pushq $0x2
popq %r15
movl -0x2c(%rbp), %r13d
cmpl %ebx, %r12d
je 0x3796
movq (%r14), %rdi
movq (%rdi), %rax
xorl %esi, %esi
movl %ebx, %edx
movl %r15d, %ecx
callq *(%rax)
movq (%r14), %rdi
movq (%rdi), %rax
movl %r13d, %esi
movl %ebx, %edx
movl %r15d, %ecx
callq *(%rax)
incl %ebx
jmp 0x376e
movq -0x40(%rbp), %r13
incl %r13d
movq -0x38(%rbp), %rax
cmpl $-0x2, %eax
pushq $-0x3
popq %r12
cmovgel %eax, %r12d
addl $0x3, %r12d
xorl %ebx, %ebx
pushq $0x2
popq %r15
cmpl %ebx, %r12d
je 0x37de
movq (%r14), %rdi
movq (%rdi), %rax
movl %ebx, %esi
xorl %edx, %edx
movl %r15d, %ecx
callq *(%rax)
movq (%r14), %rdi
movq (%rdi), %rax
movl %ebx, %esi
movl %r13d, %edx
movl %r15d, %ecx
callq *(%rax)
incl %ebx
jmp 0x37b6
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/import.cpp
// Function: Import::importNumberRow(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Import::importNumberRow(int i, std::string row) {
    for (std::string::size_type j = 0; j < row.size(); j++) {
        char c = row[j];
        switch (c) {
            case '0':
                lattice_->setNumber(i, j+1, ZERO);
                break;
            case '1':
                lattice_->setNumber(i, j+1, ONE);
                break;
            case '2':
                lattice_->setNumber(i, j+1, TWO);
                break;
            case '3':
                lattice_->setNumber(i, j+1, THREE);
                break;
            default:
                lattice_->setNumber(i, j+1, NONE);
                break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r15
xorl %r13d, %r13d
xorl %r12d, %r12d
cmpq 0x8(%rbx), %r12
jae 0x3839
movq (%rbx), %rax
movb (%rax,%r12), %al
movq (%r15), %rdi
incq %r12
addb $-0x30, %al
movzbl %al, %eax
leal 0x1(%rax), %ecx
cmpb $0x4, %al
cmovael %r13d, %ecx
movl %r14d, %esi
movl %r12d, %edx
callq 0x3c62
jmp 0x380b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/import.cpp
// Function: Import::importHLineRow(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Import::importHLineRow(int i, std::string row) {
  lattice_->setHLine(i, 0, NLINE);
    for (std::string::size_type j = 0; j < row.size(); j++) {

        char c = row[j];
        switch (c) {
            case '-':
                lattice_->setHLine(i, j+1, LINE);
                break;
            case 'x':
                lattice_->setHLine(i, j+1, NLINE);
                break;
            default:
                lattice_->setHLine(i, j+1, EMPTY);
                break;
        }
    }
    lattice_->setHLine(i, row.size()+1, NLINE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
movq (%rdi), %rdi
movq (%rdi), %rax
xorl %r12d, %r12d
pushq $0x2
popq %rcx
xorl %edx, %edx
callq *(%rax)
pushq $0x1
popq %r13
movq 0x8(%r14), %rdx
cmpq %rdx, %r12
jae 0x38a4
movq (%r14), %rax
movb (%rax,%r12), %al
movq (%r15), %rdi
incq %r12
movq (%rdi), %r8
xorl %ecx, %ecx
cmpb $0x78, %al
sete %cl
addl %ecx, %ecx
cmpb $0x2d, %al
cmovel %r13d, %ecx
movl %ebx, %esi
movl %r12d, %edx
callq *(%r8)
jmp 0x3872
movq (%r15), %rdi
incl %edx
movq (%rdi), %rax
movq (%rax), %rax
pushq $0x2
popq %rcx
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/import.cpp
// Function: Import::importVLineRow(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Import::importVLineRow(int i, std::string row) {

    for (std::string::size_type j = 0; j < row.size(); j++) {
        char c = row[j];
        switch (c) {
            case '-':
                lattice_->setVLine(i, j+1, LINE);
                break;
            case 'x':
                lattice_->setVLine(i, j+1, NLINE);
                break;
            default:
                lattice_->setVLine(i, j+1, EMPTY);
                break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r15
xorl %r12d, %r12d
pushq $0x1
popq %r13
cmpq 0x8(%rbx), %r12
jae 0x3913
movq (%rbx), %rax
movb (%rax,%r12), %al
movq (%r15), %rdi
incq %r12
movq (%rdi), %r8
xorl %ecx, %ecx
cmpb $0x78, %al
sete %cl
addl %ecx, %ecx
cmpb $0x2d, %al
cmovel %r13d, %ecx
movl %r14d, %esi
movl %r12d, %edx
callq *0x8(%r8)
jmp 0x38e2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/lattice.cpp
// Function: Lattice::destroyArrays()
void Lattice::destroyArrays() {
    if (init_) {
        for (int i = 0; i < m_; i++) {
            delete [] numbers_[i];
            delete [] hlines_[i];
            delete [] vlines_[i];
        }
        // hlines_ needs one extra
        delete [] hlines_[m_];
        // and delete the outer arrays
        delete [] numbers_;
        delete [] hlines_;
        delete [] vlines_;
    }
}

// Assembly:
cmpb $0x1, 0x8(%rdi)
jne 0x39d3
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movslq 0xc(%rbx), %rax
cmpq %rax, %r14
jge 0x3993
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x396a
callq 0x21e0
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x397c
callq 0x21e0
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x398e
callq 0x21e0
incq %r14
jmp 0x394f
movq 0x20(%rbx), %rcx
movq (%rcx,%rax,8), %rdi
testq %rdi, %rdi
je 0x39a5
callq 0x21e0
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x39b3
callq 0x21e0
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x39c1
callq 0x21e0
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
popq %rbx
popq %r14
popq %rbp
je 0x39d3
jmp 0x21e0
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/lattice.cpp
// Function: Lattice::initArrays(int, int)
void Lattice::initArrays(int m, int n) {
    assert(m > 0 && n > 0);

    destroyArrays();

    m_ = m;
    n_ = n;

    numbers_ = new Number*[m_];
    hlines_ = new Edge*[m_+1];
    vlines_ = new Edge*[m_];
    for (int i = 0; i < m_; i++) {
        numbers_[i] = new Number[n_];
        hlines_[i] = new Edge[n_];
        vlines_[i] = new Edge[n_+1];
    }
    // hlines_ needs one extra
    hlines_[m_] = new Edge[n_];

    init_ = true;

    cleanArrays();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %esi, %esi
jle 0x3aaa
movl %edx, %r14d
testl %edx, %edx
jle 0x3aaa
movl %esi, %r15d
movq %rdi, %rbx
callq 0x3938
movl %r15d, 0xc(%rbx)
movl %r14d, 0x10(%rbx)
movl %r15d, %r12d
leaq (,%r12,8), %r15
movq %r15, %rdi
callq 0x2030
movq %rax, 0x18(%rbx)
leaq 0x8(,%r12,8), %rdi
callq 0x2030
movq %rax, 0x20(%rbx)
movq %r15, %rdi
callq 0x2030
movq %rax, 0x28(%rbx)
movl %r14d, %r14d
leaq 0x4(,%r14,4), %r15
shlq $0x2, %r14
xorl %r13d, %r13d
movq %r14, %rdi
callq 0x2030
cmpq %r13, %r12
je 0x3a88
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq %r14, %rdi
callq 0x2030
movq 0x20(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq %r15, %rdi
callq 0x2030
movq 0x28(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
jmp 0x3a4e
movq 0x20(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
movb $0x1, 0x8(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3ac8
leaq 0x66ea(%rip), %rdi      # 0xa19b
leaq 0x66f2(%rip), %rsi      # 0xa1aa
leaq 0x6702(%rip), %rcx      # 0xa1c1
pushq $0x17
popq %rdx
callq 0x2120
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/shared/lattice.cpp
// Function: Lattice::cleanArrays()
void Lattice::cleanArrays() {
    if (init_) {
        for (int i = 0; i < m_; i++) {
            for (int j = 0; j < n_; j++) {
                numbers_[i][j] = NONE;
                hlines_[i][j] = EMPTY;
                vlines_[i][j] = EMPTY;
            }
            vlines_[i][n_] = EMPTY;
        }

        for (int j = 0; j < n_; j++) {
            hlines_[m_][j] = EMPTY;
        }
    }
}

// Assembly:
cmpb $0x1, 0x8(%rdi)
jne 0x3b65
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
movslq 0xc(%rdi), %rax
movslq 0x10(%rdi), %rdx
movq 0x28(%rdi), %rsi
xorl %r8d, %r8d
testl %edx, %edx
movl $0x0, %ecx
cmovgl %edx, %ecx
testl %eax, %eax
movl $0x0, %r9d
cmovgl %eax, %r9d
cmpq %r9, %r8
je 0x3b47
movq 0x18(%rdi), %r10
movq 0x20(%rdi), %r11
movq 0x28(%rdi), %rbx
xorl %r14d, %r14d
cmpq %r14, %rcx
je 0x3b39
movq (%r10,%r8,8), %r15
andl $0x0, (%r15,%r14,4)
movq (%r11,%r8,8), %r15
andl $0x0, (%r15,%r14,4)
movq (%rbx,%r8,8), %r15
andl $0x0, (%r15,%r14,4)
incq %r14
jmp 0x3b14
movq (%rsi,%r8,8), %r10
andl $0x0, (%r10,%rdx,4)
incq %r8
jmp 0x3b00
movq 0x20(%rdi), %rdx
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x3b5f
movq (%rdx,%rax,8), %rdi
andl $0x0, (%rdi,%rsi,4)
incq %rsi
jmp 0x3b4d
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/solver/epq.cpp
// Function: EPQ::initEPQ(int, int)
void EPQ::initEPQ(int m, int n)  {
    assert(m > 0 && n > 0);

    m_ = m;
    n_ = n;

    for (int i = 1; i < m-1; i++) {
        for (int j = 1; j < n-1; j++) {
            pq_.push(createPrioEdge(0, i, j, true));
            pq_.push(createPrioEdge(0, i, j, false));
        }
        pq_.push(createPrioEdge(0, i, n-1, false));
    }

    for (int j = 1; j < n-1; j++) {
        pq_.push(createPrioEdge(0, m-1, j, true));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testl %esi, %esi
jle 0x47e2
testl %edx, %edx
jle 0x47e2
movq %rdi, %r15
movl %esi, %eax
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
decl %eax
movl %eax, -0x30(%rbp)
decl %edx
movl %edx, -0x2c(%rbp)
leaq 0x8(%rdi), %r12
pushq $0x1
popq %r13
leaq -0x48(%rbp), %r14
cmpl -0x30(%rbp), %r13d
jge 0x4797
pushq $0x1
popq %rbx
movl -0x2c(%rbp), %ecx
xorps %xmm0, %xmm0
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
cmpl %ecx, %ebx
jge 0x477f
movl %ebx, %ecx
pushq $0x1
popq %r8
callq 0x4800
movq %r12, %rdi
movq %r14, %rsi
callq 0x4a96
xorps %xmm0, %xmm0
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x4800
movq %r12, %rdi
movq %r14, %rsi
callq 0x4a96
movl -0x2c(%rbp), %ecx
incl %ebx
jmp 0x4731
xorl %r8d, %r8d
callq 0x4800
movq %r12, %rdi
movq %r14, %rsi
callq 0x4a96
incl %r13d
jmp 0x4725
pushq $0x1
popq %rbx
leaq -0x48(%rbp), %r14
movl %ebx, %r13d
movl -0x2c(%rbp), %eax
cmpl %eax, %r13d
jge 0x47d3
xorps %xmm0, %xmm0
movq %r14, %rdi
movq %r15, %rsi
movl -0x30(%rbp), %edx
movl %r13d, %ecx
movl %ebx, %r8d
callq 0x4800
movq %r12, %rdi
movq %r14, %rsi
callq 0x4a96
movl -0x2c(%rbp), %eax
incl %r13d
jmp 0x47a4
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x59b2(%rip), %rdi      # 0xa19b
leaq 0x5b17(%rip), %rsi      # 0xa307
leaq 0x5b23(%rip), %rcx      # 0xa31a
pushq $0x7
popq %rdx
callq 0x2120
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/solver/epq.cpp
// Function: EPQ::copyPQToVector() const
std::vector<PrioEdge> EPQ::copyPQToVector() const {
    std::priority_queue<PrioEdge, std::vector<PrioEdge>, ComparePrioEdge> newPQ;
    std::vector<PrioEdge> outputvec(pq_.size());
    std::copy(&(pq_.top()), &(pq_.top()) + pq_.size(), &outputvec[0]);
    return outputvec;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
andq $0x0, -0x30(%rbp)
movq 0x10(%rsi), %rax
subq 0x8(%rsi), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
leaq -0x11(%rbp), %rdx
movq %rax, %rsi
callq 0x4af8
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
subq %rsi, %rdx
je 0x4954
movq (%rbx), %rdi
callq 0x2230
leaq -0x40(%rbp), %rdi
callq 0x4b4a
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x4b4a
movq %rbx, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/solver/epq.cpp
// Function: EPQ::copySubsetPQ(EPQ)
void EPQ::copySubsetPQ(EPQ orig) {
    PrioEdge pe = orig.top();
    std::vector<PrioEdge> prioEdgeVec = orig.copyPQToVector();
    for (int i = 0; i < prioEdgeVec.size(); i++) {
        PrioEdge cur = prioEdgeVec[i];
        if (cur.coords.i < pe.coords.i && cur.coords.j < pe.coords.j)
            pq_.push(prioEdgeVec[i]);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x8(%rsi), %rax
movl (%rax), %r14d
movl 0x4(%rax), %r15d
leaq -0x48(%rbp), %rdi
callq 0x4906
addq $0x8, %rbx
movq %rbx, -0x30(%rbp)
xorl %r12d, %r12d
pushq $0x18
popq %r13
xorl %ebx, %ebx
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rax
subq %rsi, %rax
cqto
idivq %r13
cmpq %rbx, %rax
jbe 0x4a6a
cmpl %r14d, (%rsi,%r12)
jge 0x4a61
cmpl %r15d, 0x4(%rsi,%r12)
jge 0x4a61
addq %r12, %rsi
movq -0x30(%rbp), %rdi
callq 0x4ab6
incq %rbx
addq $0x18, %r12
jmp 0x4a33
leaq -0x48(%rbp), %rdi
callq 0x4b4a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x4b4a
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/solver/rotate.cpp
// Function: rotateNumber(int, int, int, int, Orientation)
Coordinates rotateNumber(int i, int j, int m, int n, Orientation orient) {
    switch (orient) {
        case UPFLIP:
            i = m - i - 1;
        case UP:
            return Coordinates { i, j };
        case DOWNFLIP:
            i = m - i - 1;
        case DOWN:
            return Coordinates { m-i-1, n-j-1 };
        case LEFTFLIP:
            i = m - i - 1;
        case LEFT:
            return Coordinates { n-j-1, i };
        case RIGHTFLIP:
            i = m - i - 1;
        case RIGHT:
            return Coordinates { j, m-i-1 };
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %r8d, %eax
leaq 0x5322(%rip), %r8       # 0xa3d8
movslq (%r8,%rax,4), %rax
addq %r8, %rax
jmpq *%rax
notl %edi
addl %edx, %edi
jmp 0x50ed
notl %edi
addl %edx, %edi
notl %edi
movl %edi, %eax
addl %edx, %eax
jmp 0x50e9
notl %edi
addl %edx, %edi
notl %edi
addl %edx, %edi
notl %esi
addl %ecx, %esi
jmp 0x50ed
notl %edi
addl %edx, %edi
movl %edi, %eax
notl %esi
addl %ecx, %esi
movl %esi, %edi
movl %eax, %esi
shlq $0x20, %rsi
movl %edi, %eax
orq %rsi, %rax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/solver/solver.cpp
// Function: Solver::Solver(Grid&, Rule*, Contradiction*, int*, int, int)
Solver::Solver(Grid & grid, Rule rules[NUM_RULES], Contradiction contradictions[NUM_CONTRADICTIONS], int selectedRules[], int selectLength, int depth) {
    grid_ = &grid;
    depth_ = depth;

    multipleSolutions_ = false;

    epq_.initEPQ(grid_->getHeight(), grid_->getWidth());

    rules_ = rules;
    contradictions_ = contradictions;
    selectedRules_ = selectedRules;
    ruleCounts_ = 0;

    int selectedPlusBasic[selectLength+NUM_CONST_RULES];
    for (int i = 0; i < selectLength; i++) {
        selectedPlusBasic[i] = selectedRules[i];
    }

    for (int i = 1; i <= NUM_CONST_RULES; i++) {
        selectedPlusBasic[selectLength+ NUM_CONST_RULES - i] = (NUM_RULES - i);
    }

    selectLength_ = selectLength + NUM_CONST_RULES;
    applyRules(selectedPlusBasic);
    selectLength_ = selectLength;

    solve();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %r14d
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %rbx
movq %rdi, %r15
movl 0x10(%rbp), %eax
addq $0x38, %rdi
leaq 0x40(%r15), %rcx
movq %rcx, -0x30(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%r15)
andq $0x0, 0x50(%r15)
movq %rsi, 0x8(%r15)
movl %eax, 0x10(%r15)
movb $0x0, 0x64(%r15)
movl 0xc(%rsi), %eax
movl 0x10(%rsi), %edx
movl %eax, %esi
callq 0x46e4
movq %rbx, 0x18(%r15)
movq %r13, 0x30(%r15)
movq %r12, 0x20(%r15)
andl $0x0, (%r15)
leal 0x3(%r14), %eax
movq %rsp, %rsi
leaq 0xf(,%rax,4), %rcx
andq $-0x10, %rcx
subq %rcx, %rsi
movq %rsi, %rsp
xorl %ecx, %ecx
testl %r14d, %r14d
movl $0x0, %edx
cmovgl %r14d, %edx
cmpq %rcx, %rdx
je 0x6317
movl (%r12,%rcx,4), %edi
movl %edi, (%rsi,%rcx,4)
incq %rcx
jmp 0x6306
movslq %eax, %rcx
leaq (%rsi,%rcx,4), %rcx
addq $-0x4, %rcx
xorl %edx, %edx
cmpq $-0x3, %rdx
je 0x6335
leal 0x20(%rdx), %edi
movl %edi, (%rcx,%rdx,4)
decq %rdx
jmp 0x6324
movl %eax, 0x28(%r15)
movq %r15, %rdi
callq 0x6370
movl %r14d, 0x28(%r15)
movq %r15, %rdi
callq 0x6476
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x30(%rbp), %rdi
callq 0x4b4a
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/solver/solver.cpp
// Function: Solver::applyRules(int*)
void Solver::applyRules(int selectedRules[]) {
    while (grid_->getUpdated()) {
        grid_->setUpdated(false);
        for (int i = 0; i < grid_->getHeight(); i++) {
            for (int j = 0; j < grid_->getWidth(); j++) {
                if (grid_->getUpdateMatrix(i, j)) {
                    for (int x = 0; x < selectLength_; x++) {
                        for (Orientation orient : (Orientation[]){ UP, DOWN, LEFT, RIGHT, UPFLIP, DOWNFLIP, LEFTFLIP, RIGHTFLIP }) {
                            if (ruleApplies(i, j, rules_[selectedRules[x]], orient)) {
                                applyRule(i, j, rules_[selectedRules[x]], orient);
                            }
                        }
                    }
                }
                grid_->setUpdateMatrix(i, j, false);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x38(%rbp)
movq %rdi, -0x30(%rbp)
movq 0x8(%rdi), %rax
cmpb $0x1, 0x9(%rax)
jne 0x6467
movb $0x0, 0x9(%rax)
xorl %esi, %esi
movslq 0xc(%rax), %rcx
cmpq %rcx, %rsi
jge 0x638d
xorl %edx, %edx
movslq 0x10(%rax), %rcx
cmpq %rcx, %rdx
jge 0x645f
movq 0x30(%rax), %rcx
movq (%rcx,%rsi,8), %rcx
cmpb $0x1, (%rcx,%rdx)
jne 0x644b
xorl %ebx, %ebx
movq -0x30(%rbp), %rax
movslq 0x28(%rax), %rax
cmpq %rax, %rbx
jge 0x6443
xorl %r15d, %r15d
cmpq $0x20, %r15
je 0x643e
leaq 0x41be(%rip), %rax      # 0xa5a4
movl (%r15,%rax), %r13d
movq -0x38(%rbp), %rax
movslq (%rax,%rbx,4), %rcx
shlq $0x7, %rcx
movq -0x30(%rbp), %rdi
addq 0x18(%rdi), %rcx
movq %rsi, %r12
movq %rdx, %r14
movl %r13d, %r8d
callq 0x79f4
testb %al, %al
je 0x6432
movq -0x38(%rbp), %rax
movslq (%rax,%rbx,4), %rcx
shlq $0x7, %rcx
movq -0x30(%rbp), %rdi
addq 0x18(%rdi), %rcx
movl %r12d, %esi
movl %r14d, %edx
movl %r13d, %r8d
callq 0x7c1c
addq $0x4, %r15
movq %r12, %rsi
movq %r14, %rdx
jmp 0x63d9
incq %rbx
jmp 0x63c9
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %rcx
movq (%rcx,%rsi,8), %rcx
movb $0x0, (%rcx,%rdx)
incq %rdx
jmp 0x63a8
incq %rsi
jmp 0x639d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/solver/solver.cpp
// Function: Solver::solve()
void Solver::solve() {
    grid_->setUpdated(true);
    while (grid_->getUpdated() && !grid_->isSolved()) {
        applyRules(selectedRules_);

        for (int d = 0; d < depth_; d++) {
            if (!grid_->getUpdated() && !testContradictions() && !grid_->isSolved() && !multipleSolutions_) {
                solveDepth(d);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movb $0x1, 0x9(%rdi)
movb $0x1, %al
testb $0x1, %al
je 0x64e6
callq 0x3280
testb %al, %al
jne 0x64e6
movq 0x20(%rbx), %rsi
movq %rbx, %rdi
callq 0x6370
xorl %r14d, %r14d
movq 0x8(%rbx), %rdi
movb 0x9(%rdi), %al
cmpl 0x10(%rbx), %r14d
jge 0x648a
testb $0x1, %al
jne 0x64e1
movq %rbx, %rdi
callq 0x65ba
testb %al, %al
jne 0x64e1
movq 0x8(%rbx), %rdi
callq 0x3280
testb %al, %al
jne 0x64e1
cmpb $0x0, 0x64(%rbx)
jne 0x64e1
movq %rbx, %rdi
movl %r14d, %esi
callq 0x68c4
incl %r14d
jmp 0x64a6
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/solver/solver.cpp
// Function: Solver::Solver(Grid&, Rule*, Contradiction*, int*, int, int, EPQ)
Solver::Solver(Grid & grid, Rule rules[NUM_RULES], Contradiction contradictions[NUM_CONTRADICTIONS], int selectedRules[], int selectLength, int depth, EPQ oldEPQ) {
    grid_ = &grid;
    depth_ = depth;

    epq_.copyPQ(oldEPQ);

    multipleSolutions_ = false;

    rules_ = rules;
    contradictions_ = contradictions;
    selectedRules_ = selectedRules;
    selectLength_ = selectLength;
    ruleCounts_ = 0;

    solve();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %r14d
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %rbx
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %ecx
andq $0x0, 0x50(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
movq %rsi, 0x8(%rdi)
movl %ecx, 0x10(%rdi)
leaq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0x7e6c
leaq 0x38(%rbx), %rdi
leaq -0x50(%rbp), %rsi
callq 0x497e
leaq -0x48(%rbp), %rdi
callq 0x4b4a
movb $0x0, 0x64(%rbx)
movq %r13, 0x18(%rbx)
movq %r12, 0x30(%rbx)
movq %r15, 0x20(%rbx)
movl %r14d, 0x28(%rbx)
andl $0x0, (%rbx)
movq %rbx, %rdi
callq 0x6476
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq -0x48(%rbp), %rdi
callq 0x4b4a
jmp 0x6587
movq %rax, %r14
addq $0x40, %rbx
movq %rbx, %rdi
callq 0x4b4a
movq %r14, %rdi
callq 0x2250
nop