LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x102f7(%rip), %rax     # 0x12d48
movq %rax, (%rdi)
cmpb $0x1, 0x49(%rdi)
jne 0x2b02
cmpl $0x0, 0xc(%rbx)
jle 0x2a85
xorl %r14d, %r14d
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x2a79
callq 0x21e0
incq %r14
movslq 0xc(%rbx), %rax
cmpq %rax, %r14
jl 0x2a67
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x2a93
callq 0x21e0
cmpl $0x0, 0xc(%rbx)
jle 0x2aba
xorl %r14d, %r14d
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x2aae
callq 0x21e0
incq %r14
movslq 0xc(%rbx), %rax
cmpq %rax, %r14
jl 0x2a9c
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x2ac8
callq 0x21e0
cmpl $0x0, 0xc(%rbx)
js 0x2af4
movq $-0x1, %r14
movq 0x40(%rbx), %rax
movq 0x8(%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x2ae8
callq 0x21e0
movslq 0xc(%rbx), %rax
incq %r14
cmpq %rax, %r14
jl 0x2ad5
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x2b02
callq 0x21e0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4078
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, -0x30(%rbp)
movslq 0xc(%rdi), %r15
cmpq $0x2, %r15
jl 0x2b65
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ebx
movq 0x20(%rax), %r12
leal -0x2(%rbx), %r14d
shlq $0x2, %r14
movl $0x1, %r13d
cmpl $0x3, %ebx
jl 0x2b5d
movq (%r12,%r13,8), %rdi
addq $0x4, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x20e0
incq %r13
cmpq %r13, %r15
jne 0x2b46
cmpl $0x3, %r15d
jl 0x2bb0
leal -0x1(%r15), %r12d
movq -0x30(%rbp), %rax
movl 0x10(%rax), %r13d
movq 0x28(%rax), %rax
movq %rax, -0x38(%rbp)
leal -0x1(%r13), %r14d
shlq $0x2, %r14
movl $0x1, %ebx
cmpl $0x2, %r13d
jl 0x2ba8
movq -0x38(%rbp), %rax
movq (%rax,%rbx,8), %rdi
addq $0x4, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x20e0
incq %rbx
cmpq %rbx, %r12
jne 0x2b8c
testl %r15d, %r15d
jle 0x2bf0
movq -0x30(%rbp), %rdx
movl 0x10(%rdx), %eax
movq 0x30(%rdx), %rcx
movq 0x38(%rdx), %rdx
xorl %esi, %esi
movb $0x1, %dil
testl %eax, %eax
jle 0x2be8
movq (%rcx,%rsi,8), %r8
movq (%rdx,%rsi,8), %r9
xorl %r10d, %r10d
movb %dil, (%r8,%r10)
movb %dil, (%r9,%r10)
incq %r10
cmpq %r10, %rax
jne 0x2bd8
incq %rsi
cmpq %r15, %rsi
jne 0x2bc9
testl %r15d, %r15d
js 0x2c30
movq -0x30(%rbp), %rax
movl 0x10(%rax), %r12d
movq 0x40(%rax), %r13
leal 0x1(%r12), %r14d
shlq $0x3, %r14
leal 0x1(%r15), %ebx
xorl %r15d, %r15d
testl %r12d, %r12d
js 0x2c28
movq (%r13,%r15,8), %rdi
movl $0xff, %esi
movq %r14, %rdx
callq 0x20e0
incq %r15
cmpq %r15, %rbx
jne 0x2c11
movq -0x30(%rbp), %rax
movq $0x0, 0x4c(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
cmpl $0x0, 0xc(%rdi)
js 0x2ff8
xorl %r15d, %r15d
cmpl $0x0, 0x10(%r14)
jle 0x2feb
xorl %r12d, %r12d
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x431a
movq (%rbx), %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq *0x10(%r8)
incl %r12d
cmpl 0x10(%r14), %r12d
jl 0x2fc2
leal 0x1(%r15), %eax
cmpl 0xc(%r14), %r15d
movl %eax, %r15d
jl 0x2fb8
cmpl $0x0, 0xc(%r14)
jle 0x3041
xorl %r15d, %r15d
cmpl $0x0, 0x10(%r14)
js 0x3038
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
incl %r12d
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x4360
movq (%rbx), %r8
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq *0x18(%r8)
cmpl 0x10(%r14), %r12d
jl 0x300f
incl %r15d
cmpl 0xc(%r14), %r15d
jl 0x3002
movl 0xc(%r14), %eax
testl %eax, %eax
jle 0x30bc
xorl %r15d, %r15d
cmpl $0x0, 0x10(%r14)
jle 0x30b0
xorl %r12d, %r12d
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x42d4
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq 0x43d6
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
movslq 0x10(%r14), %rax
cmpq %rax, %r12
jl 0x3056
incq %r15
movslq 0xc(%r14), %rax
cmpq %rax, %r15
jl 0x304c
testl %eax, %eax
js 0x30fb
movl 0x10(%r14), %ecx
movq 0x40(%r14), %rdx
movq 0x40(%rbx), %rsi
leal 0x1(%rcx), %edi
incl %eax
xorl %r8d, %r8d
testl %ecx, %ecx
js 0x30f3
movq (%rdx,%r8,8), %r9
movq (%rsi,%r8,8), %r10
xorl %r11d, %r11d
movq (%r9,%r11,8), %rbx
movq %rbx, (%r10,%r11,8)
incq %r11
cmpq %r11, %rdi
jne 0x30e3
incq %r8
cmpq %rax, %r8
jne 0x30d4
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3747
testl %edx, %edx
js 0x3747
cmpl %esi, 0xc(%rdi)
jle 0x3747
cmpl %edx, 0x10(%rdi)
jle 0x3747
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 0xb8de(%rip), %rdx      # 0xf004
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movb $0x1, %al
retq
cmpl $0x3, %ecx
jmp 0x3743
cmpl $0x1, %ecx
jmp 0x3743
cmpl $0x2, %ecx
jmp 0x3743
testl %ecx, %ecx
sete %al
retq
pushq %rbp
movq %rsp, %rbp
leaq 0xb9e4(%rip), %rdi      # 0xf136
leaq 0xb8ec(%rip), %rsi      # 0xf045
leaq 0xb9fb(%rip), %rcx      # 0xf15b
movl $0xeb, %edx
callq 0x2100
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpl $0x0, 0x4c(%rdi)
jne 0x37e8
movq %rdi, %r14
cmpl $0x1, 0x50(%rdi)
jne 0x37e8
cmpl $0x0, 0xc(%r14)
setle %bl
jle 0x37e8
xorl %r15d, %r15d
cmpl $0x0, 0x10(%r14)
setg %r13b
jle 0x37dc
movq %r14, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x36aa
testb %al, %al
je 0x37d7
movl $0x1, %r12d
cmpl 0x10(%r14), %r12d
setl %r13b
jge 0x37dc
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x36aa
incl %r12d
testb %al, %al
jne 0x37b8
testb %r13b, %r13b
jne 0x37e8
incl %r15d
cmpl 0xc(%r14), %r15d
setge %bl
jl 0x3796
andb $0x1, %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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, %r12d
movl %esi, %ebx
movq %rdi, %r15
movq (%rdi), %rdi
leal 0x2(%rbx), %esi
leal 0x2(%r12), %r13d
movl %esi, -0x2c(%rbp)
movl %r13d, %edx
callq 0x412e
movq (%r15), %rdi
callq 0x2dd8
movq %rbx, -0x38(%rbp)
testl %ebx, %ebx
js 0x3d7d
movq -0x38(%rbp), %r14
negl %r14d
movl $0x1, %ebx
movq (%r15), %rdi
movq (%rdi), %rax
movl %ebx, %esi
xorl %edx, %edx
movl $0x2, %ecx
callq *(%rax)
leal (%r14,%rbx), %eax
incl %eax
movl %ebx, %ecx
incl %ecx
movl %ecx, %ebx
cmpl $0x2, %eax
jne 0x3d5b
cmpl $-0x1, -0x38(%rbp)
movl -0x2c(%rbp), %r14d
jl 0x3db5
xorl %ebx, %ebx
movq (%r15), %rdi
movq (%rdi), %rax
movl %ebx, %esi
xorl %edx, %edx
movl $0x2, %ecx
callq *0x8(%rax)
movq (%r15), %rdi
movq (%rdi), %rax
movl %ebx, %esi
movl %r13d, %edx
movl $0x2, %ecx
callq *0x8(%rax)
incl %ebx
cmpl %ebx, %r14d
jne 0x3d89
movq %r12, -0x40(%rbp)
cmpl $-0x2, %r12d
jl 0x3e07
movq -0x38(%rbp), %rax
leal 0x1(%rax), %ebx
xorl %r14d, %r14d
testl %r13d, %r13d
movl $0x0, %r12d
cmovgl %r13d, %r12d
incl %r12d
movq (%r15), %rdi
movq (%rdi), %rax
xorl %esi, %esi
movl %r14d, %edx
movl $0x2, %ecx
callq *0x8(%rax)
movq (%r15), %rdi
movq (%rdi), %rax
movl %ebx, %esi
movl %r14d, %edx
movl $0x2, %ecx
callq *0x8(%rax)
incl %r14d
cmpl %r14d, %r12d
jne 0x3dd9
movq -0x40(%rbp), %r14
cmpl $-0x1, %r14d
movl -0x2c(%rbp), %r12d
jl 0x3e41
xorl %ebx, %ebx
movq (%r15), %rdi
movq (%rdi), %rax
xorl %esi, %esi
movl %ebx, %edx
movl $0x2, %ecx
callq *(%rax)
movq (%r15), %rdi
movq (%rdi), %rax
movl %r12d, %esi
movl %ebx, %edx
movl $0x2, %ecx
callq *(%rax)
incl %ebx
cmpl %ebx, %r13d
jne 0x3e17
movq -0x38(%rbp), %r12
cmpl $-0x2, %r12d
jl 0x3e7e
incl %r14d
addl $0x3, %r12d
xorl %ebx, %ebx
movq (%r15), %rdi
movq (%rdi), %rax
movl %ebx, %esi
xorl %edx, %edx
movl $0x2, %ecx
callq *(%rax)
movq (%r15), %rdi
movq (%rdi), %rax
movl %ebx, %esi
movl %r14d, %edx
movl $0x2, %ecx
callq *(%rax)
incl %ebx
cmpl %ebx, %r12d
jne 0x3e54
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpq $0x0, 0x8(%rdx)
je 0x3eec
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
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 0x43d6
cmpq 0x8(%rbx), %r12
jb 0x3eb2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rdi
movq (%rdi), %rax
xorl %edx, %edx
movl $0x2, %ecx
callq *(%rax)
movq 0x8(%r15), %rdx
testq %rdx, %rdx
je 0x3f55
xorl %r12d, %r12d
movl $0x1, %r13d
movq (%r15), %rax
movb (%rax,%r12), %al
movq (%r14), %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)
movq 0x8(%r15), %rdx
cmpq %rdx, %r12
jb 0x3f25
movq (%r14), %rdi
incl %edx
movq (%rdi), %rax
movq (%rax), %rax
movl %ebx, %esi
movl $0x2, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
nop
// File: /workspace/github_cpp_makefile_star2_O1/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:
cmpq $0x0, 0x8(%rdx)
je 0x3fdc
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
movl $0x1, %r13d
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)
cmpq 0x8(%rbx), %r12
jb 0x3f9f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x412d
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0xc(%rdi), %eax
testl %eax, %eax
jle 0x40ec
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x40bc
callq 0x21e0
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x40ce
callq 0x21e0
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x40e0
callq 0x21e0
incq %r14
movslq 0xc(%rbx), %rax
cmpq %rax, %r14
jl 0x40aa
movq 0x20(%rbx), %rcx
cltq
movq (%rcx,%rax,8), %rdi
testq %rdi, %rdi
je 0x4100
callq 0x21e0
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x410e
callq 0x21e0
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x411c
callq 0x21e0
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
popq %rbx
popq %r14
popq %rbp
jne 0x21e0
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4217
movl %edx, %r14d
testl %edx, %edx
jle 0x4217
movl %esi, %r15d
movq %rdi, %rbx
callq 0x408c
movl %r15d, 0xc(%rbx)
movl %r14d, 0x10(%rbx)
movl %r15d, %r13d
leaq (,%r13,8), %r15
movq %r15, %rdi
callq 0x2030
movq %rax, 0x18(%rbx)
leaq 0x8(,%r13,8), %rdi
callq 0x2030
movq %rax, 0x20(%rbx)
movq %r15, %rdi
callq 0x2030
movq %rax, 0x28(%rbx)
movl %r14d, %eax
leaq 0x4(,%rax,4), %r15
movq %rax, -0x30(%rbp)
leaq (,%rax,4), %r12
xorl %r14d, %r14d
movq %r12, %rdi
callq 0x2030
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
movq %r12, %rdi
callq 0x2030
movq 0x20(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
movq %r15, %rdi
callq 0x2030
movq 0x28(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
cmpq %r14, %r13
jne 0x41b0
movq -0x30(%rbp), %rdi
shlq $0x2, %rdi
callq 0x2030
movq 0x20(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movb $0x1, 0x8(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4236
leaq 0xafa7(%rip), %rdi      # 0xf1c5
leaq 0xafaf(%rip), %rsi      # 0xf1d4
leaq 0xafbf(%rip), %rcx      # 0xf1eb
movl $0x17, %edx
callq 0x2100
// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpb $0x1, 0x8(%rdi)
jne 0x42cb
movslq 0xc(%rdi), %rax
testq %rax, %rax
jle 0x42a7
movl 0x10(%rdi), %ecx
movq 0x18(%rdi), %rdx
movq 0x20(%rdi), %rsi
movq 0x28(%rdi), %r8
movslq %ecx, %r9
xorl %r10d, %r10d
xorl %r11d, %r11d
testl %ecx, %ecx
jle 0x4293
movq (%rdx,%r11,8), %rbx
movq (%rsi,%r11,8), %r14
movq (%r8,%r11,8), %r15
xorl %r12d, %r12d
movl %r10d, (%rbx,%r12,4)
movl %r10d, (%r14,%r12,4)
movl %r10d, (%r15,%r12,4)
incq %r12
cmpq %r12, %rcx
jne 0x427f
movq (%r8,%r11,8), %rbx
movl $0x0, (%rbx,%r9,4)
incq %r11
cmpq %rax, %r11
jne 0x426c
movslq 0x10(%rdi), %rdx
testq %rdx, %rdx
jle 0x42cb
movq 0x20(%rdi), %rcx
movq (%rcx,%rax,8), %rdi
shlq $0x2, %rdx
xorl %esi, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x20e0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 $0x48, %rsp
movq %rsi, -0x50(%rbp)
testl %esi, %esi
jle 0x58e6
testl %edx, %edx
jle 0x58e6
movq %rdi, %r14
movq -0x50(%rbp), %rax
movl %eax, (%rdi)
movl %edx, 0x4(%rdi)
leal -0x1(%rax), %ecx
movl %ecx, -0x44(%rbp)
cmpl $0x3, %eax
jl 0x5850
leal -0x1(%rdx), %eax
movl %eax, -0x54(%rbp)
leaq 0x8(%r14), %r12
leal -0x2(%rdx), %eax
movl %eax, -0x58(%rbp)
movl $0x2, %eax
subl %edx, %eax
movq %rax, -0x68(%rbp)
movl $0x1, %ebx
leaq -0x40(%rbp), %r13
movq %rdx, -0x60(%rbp)
cmpl $0x3, %edx
jl 0x580b
movl $0x1, %r15d
cmpl (%r14), %ebx
jg 0x58c7
cmpl 0x4(%r14), %r15d
jge 0x58c7
movl %ebx, -0x40(%rbp)
movl %r15d, -0x3c(%rbp)
movq $0x0, -0x38(%rbp)
movb $0x1, -0x30(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x5bae
cmpl (%r14), %ebx
jge 0x58c7
cmpl 0x4(%r14), %r15d
jg 0x58c7
movl %ebx, -0x40(%rbp)
movl %r15d, -0x3c(%rbp)
movq $0x0, -0x38(%rbp)
movb $0x0, -0x30(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x5bae
movq -0x68(%rbp), %rax
addl %r15d, %eax
incl %eax
movl %r15d, %ecx
incl %ecx
movl %ecx, %r15d
cmpl $0x1, %eax
jne 0x5793
cmpl (%r14), %ebx
jge 0x58c7
movl -0x58(%rbp), %eax
cmpl 0x4(%r14), %eax
jge 0x58c7
movl %ebx, -0x40(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq $0x0, -0x38(%rbp)
movb $0x0, -0x30(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x5bae
incl %ebx
cmpl -0x44(%rbp), %ebx
movq -0x60(%rbp), %rdx
jne 0x5788
cmpl $0x3, %edx
jl 0x58b8
leaq 0x8(%r14), %r12
movq -0x50(%rbp), %rax
addl $-0x2, %eax
movq %rax, -0x50(%rbp)
movl $0x2, %ebx
subl %edx, %ebx
movl $0x1, %r13d
leaq -0x40(%rbp), %r15
movq -0x50(%rbp), %rax
cmpl (%r14), %eax
jge 0x58c7
cmpl 0x4(%r14), %r13d
jge 0x58c7
movl -0x44(%rbp), %eax
movl %eax, -0x40(%rbp)
movl %r13d, -0x3c(%rbp)
movq $0x0, -0x38(%rbp)
movb $0x1, -0x30(%rbp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x5bae
leal (%rbx,%r13), %eax
incl %eax
movl %r13d, %ecx
incl %ecx
movl %ecx, %r13d
cmpl $0x1, %eax
jne 0x5875
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9a92(%rip), %rdi      # 0xf360
leaq 0x9a5c(%rip), %rsi      # 0xf331
leaq 0x9abe(%rip), %rcx      # 0xf39a
movl $0x1a, %edx
callq 0x2100
leaq 0x98d8(%rip), %rdi      # 0xf1c5
leaq 0x9a3d(%rip), %rsi      # 0xf331
leaq 0x9a49(%rip), %rcx      # 0xf344
movl $0x7, %edx
callq 0x2100
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 $0x10, %rsp
movq %rsi, %r14
movq 0x10(%rsi), %rax
subq 0x8(%rsi), %rax
movq %rdi, %rbx
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
leaq -0x11(%rbp), %rdx
callq 0x5dba
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
subq %rsi, %rdx
je 0x5a51
movq (%rbx), %rdi
callq 0x2240
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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), %r15d
movl 0x4(%rax), %r12d
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x5a08
movq (%r14), %rsi
cmpq %rsi, 0x8(%r14)
je 0x5b79
addq $0x8, %rbx
movq %rbx, -0x30(%rbp)
xorl %r14d, %r14d
movabsq $-0x5555555555555555, %r13 # imm = 0xAAAAAAAAAAAAAAAB
xorl %ebx, %ebx
cmpl %r15d, (%rsi,%r14)
jge 0x5b5a
cmpl %r12d, 0x4(%rsi,%r14)
jge 0x5b5a
addq %r14, %rsi
movq -0x30(%rbp), %rdi
callq 0x5c76
incq %rbx
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rax
subq %rsi, %rax
sarq $0x3, %rax
imulq %r13, %rax
addq $0x18, %r14
cmpq %rbx, %rax
ja 0x5b41
testq %rsi, %rsi
je 0x5b86
movq %rsi, %rdi
callq 0x2180
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x5ba6
callq 0x2180
movq %rbx, %rdi
callq 0x2260
// File: /workspace/github_cpp_makefile_star2_O1/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 0x91fe(%rip), %r8       # 0xf400
movslq (%r8,%rax,4), %rax
addq %r8, %rax
jmpq *%rax
notl %edi
addl %edx, %edi
jmp 0x6239
notl %edi
addl %edx, %edi
notl %edi
movl %edi, %eax
addl %edx, %eax
jmp 0x6235
notl %edi
addl %edx, %edi
notl %edi
addl %edx, %edi
notl %esi
addl %ecx, %esi
jmp 0x6239
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_O1/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, %ebx
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %r14
movl 0x10(%rbp), %eax
leaq 0x38(%rdi), %rdi
leaq 0x40(%r14), %rcx
movq %rcx, -0x30(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%r14)
movq $0x0, 0x50(%r14)
movq %rsi, 0x8(%r14)
movl %eax, 0x10(%r14)
movb $0x0, 0x64(%r14)
movl 0xc(%rsi), %eax
movl 0x10(%rsi), %edx
movl %eax, %esi
callq 0x5720
movq %r13, 0x18(%r14)
movq %r12, 0x30(%r14)
movq %r15, 0x20(%r14)
movl $0x0, (%r14)
leal 0x3(%rbx), %r13d
movq %rsp, %r12
leaq 0xf(,%r13,4), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
testl %ebx, %ebx
jle 0xab13
movl %ebx, %edx
shlq $0x2, %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x2150
movslq %r13d, %rax
leaq (%r12,%rax,4), %rax
addq $-0x4, %rax
xorl %ecx, %ecx
leal 0x20(%rcx), %edx
movl %edx, (%rax,%rcx,4)
decq %rcx
cmpq $-0x3, %rcx
jne 0xab20
movl %r13d, 0x28(%r14)
movq %r14, %rdi
movq %r12, %rsi
callq 0xab76
movl %ebx, 0x28(%r14)
movq %r14, %rdi
callq 0xacc4
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x30(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xab6d
callq 0x2180
movq %rbx, %rdi
callq 0x2260
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x8(%rdi), %rax
cmpb $0x1, 0x9(%rax)
jne 0xacb5
addq $0x9, %rax
movb $0x0, (%rax)
movq 0x8(%rdi), %rax
cmpl $0x0, 0xc(%rax)
jle 0xaca3
xorl %esi, %esi
movq 0x8(%rdi), %rax
cmpl $0x0, 0x10(%rax)
jle 0xac8f
xorl %edx, %edx
movq 0x30(%rax), %rax
movq (%rax,%rsi,8), %rax
cmpb $0x1, (%rax,%rdx)
jne 0xac6b
cmpl $0x0, 0x28(%rdi)
jle 0xac6b
movq $0x0, -0x30(%rbp)
xorl %r15d, %r15d
leaq 0x49de(%rip), %rax      # 0xf5cc
movl (%r15,%rax), %r13d
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq (%rax,%rcx,4), %rcx
shlq $0x7, %rcx
addq 0x18(%rdi), %rcx
movq %rdi, %rbx
movq %rsi, %r12
movq %rdx, %r14
movl %r13d, %r8d
callq 0xc4f0
testb %al, %al
je 0xac40
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq (%rax,%rcx,4), %rcx
shlq $0x7, %rcx
movq %rbx, %rdi
addq 0x18(%rbx), %rcx
movl %r12d, %esi
movl %r14d, %edx
movl %r13d, %r8d
callq 0xc754
addq $0x4, %r15
cmpq $0x20, %r15
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rdi
jne 0xabe7
movq -0x30(%rbp), %r8
incq %r8
movslq 0x28(%rdi), %rax
movq %r8, -0x30(%rbp)
cmpq %rax, %r8
jl 0xabe4
movq 0x8(%rdi), %rax
movq 0x30(%rax), %rax
movq (%rax,%rsi,8), %rax
movb $0x0, (%rax,%rdx)
incq %rdx
movq 0x8(%rdi), %rax
movslq 0x10(%rax), %rcx
cmpq %rcx, %rdx
jl 0xabc0
incq %rsi
movq 0x8(%rdi), %rax
movslq 0xc(%rax), %rax
cmpq %rax, %rsi
jl 0xabb0
movq 0x8(%rdi), %rcx
leaq 0x9(%rcx), %rax
cmpb $0x1, 0x9(%rcx)
je 0xab9d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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)
callq 0x376a
testb %al, %al
jne 0xad3b
movq 0x20(%rbx), %rsi
movq %rbx, %rdi
callq 0xab76
cmpl $0x0, 0x10(%rbx)
jle 0xad31
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
cmpb $0x0, 0x9(%rax)
jne 0xad28
movq %rbx, %rdi
callq 0xae2e
testb %al, %al
jne 0xad28
movq 0x8(%rbx), %rdi
callq 0x376a
testb %al, %al
jne 0xad28
cmpb $0x0, 0x64(%rbx)
jne 0xad28
movq %rbx, %rdi
movl %r14d, %esi
callq 0xb1f0
incl %r14d
cmpl 0x10(%rbx), %r14d
jl 0xacf4
movq 0x8(%rbx), %rdi
cmpb $0x1, 0x9(%rdi)
je 0xacd6
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
movq $0x0, 0x50(%rdi)
movq %rsi, 0x8(%rdi)
movl %ecx, 0x10(%rdi)
movq (%rax), %rcx
leaq -0x48(%rbp), %rdi
movq %rcx, -0x8(%rdi)
addq $0x8, %rax
movq %rax, %rsi
callq 0xc9d6
leaq 0x38(%rbx), %rdi
leaq -0x50(%rbp), %rsi
callq 0x5a5e
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xadaf
callq 0x2180
movb $0x0, 0x64(%rbx)
movq %r13, 0x18(%rbx)
movq %r12, 0x30(%rbx)
movq %r15, 0x20(%rbx)
movl %r14d, 0x28(%rbx)
movl $0x0, (%rbx)
movq %rbx, %rdi
callq 0xacc4
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0xadf6
callq 0x2180
jmp 0xadf6
movq %rax, %r14
addq $0x40, %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xae07
callq 0x2180
movq %r14, %rdi
callq 0x2260
nop
// File: /workspace/github_cpp_makefile_star2_O1/davidjosepha[P]slitherlink/src/solver/solver.cpp
// Function: Solver::testContradictions() const
bool Solver::testContradictions() const {
    if (grid_->containsClosedContours() && !grid_->isSolved()) {
        return true;
    }
    for (int i = 0; i < grid_->getHeight(); i++) {
        for (int j = 0; j < grid_->getWidth(); j++) {
            if (grid_->getContraMatrix(i,j)) {
                for (int x = 0; x < NUM_CONTRADICTIONS; x++) {
                    for (Orientation orient: (Orientation[]){ UP, DOWN, LEFT, RIGHT, UPFLIP, DOWNFLIP, LEFTFLIP, RIGHTFLIP }) {
                        if (contradictionApplies(i, j, contradictions_[x], orient)) {
                            return true;
                        }
                    }
                }
                grid_->setContraMatrix(i, j, false);
            }
        }
    }

    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x37fc
testb %al, %al
je 0xae64
movq 0x8(%rbx), %rdi
callq 0x376a
movb $0x1, -0x29(%rbp)
testb %al, %al
je 0xaf77
movq 0x8(%rbx), %rax
cmpl $0x0, 0xc(%rax)
setg -0x29(%rbp)
jle 0xaf77
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
cmpl $0x0, 0x10(%rax)
setg %cl
jle 0xaf5f
xorl %r12d, %r12d
movq 0x38(%rax), %rax
movq (%rax,%r15,8), %rax
cmpb $0x1, (%rax,%r12)
jne 0xaf40
movb %cl, -0x2a(%rbp)
xorl %ecx, %ecx
xorl %edx, %edx
movq %rdx, -0x38(%rbp)
movq %rcx, -0x40(%rbp)
leaq (%rcx,%rcx,4), %r13
shlq $0x4, %r13
movq 0x30(%rbx), %rcx
addq %r13, %rcx
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
xorl %r8d, %r8d
callq 0xaf8c
testb %al, %al
jne 0xaf29
movl $0x4, %ecx
cmpq $0x20, %rcx
je 0xaf0f
movq %rcx, %r14
leaq 0x46e4(%rip), %rax      # 0xf5cc
movl (%rcx,%rax), %r8d
movq 0x30(%rbx), %rcx
addq %r13, %rcx
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0xaf8c
leaq 0x4(%r14), %rcx
testb %al, %al
je 0xaed8
cmpq $0x20, %r14
jne 0xaf29
movq -0x40(%rbp), %rax
cmpq $0xa, %rax
leaq 0x1(%rax), %rax
setae %dl
movq %rax, %rcx
cmpq $0xb, %rax
jne 0xaea7
jmp 0xaf2f
testb $0x1, -0x38(%rbp)
je 0xaf59
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rax
movq (%rax,%r15,8), %rax
movb $0x0, (%rax,%r12)
incq %r12
movq 0x8(%rbx), %rax
movslq 0x10(%rax), %rcx
cmpq %rcx, %r12
setl %cl
jl 0xae8d
jmp 0xaf5f
testb $0x1, -0x2a(%rbp)
jne 0xaf77
incq %r15
movq 0x8(%rbx), %rax
movslq 0xc(%rax), %rax
cmpq %rax, %r15
setl -0x29(%rbp)
jl 0xae79
movb -0x29(%rbp), %al
andb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/davidjosepha[P]slitherlink/src/solver/solver.cpp
// Function: Solver::solveDepth(int)
void Solver::solveDepth(int depth) {
    bool usingPrioQueue = true;

    if (usingPrioQueue) {
        int initSize = epq_.size();
        int guesses = 0;

        while (!epq_.empty() && guesses++ < initSize && !multipleSolutions_) {

            PrioEdge pe = epq_.top();

            if (pe.h) {
                makeHLineGuess(pe.coords.i, pe.coords.j, depth);
                if (grid_->getHLine(pe.coords.i, pe.coords.j) == EMPTY) {
                    pe.priority = pe.priority - 1;
                    epq_.push(pe);
                }
                if (grid_->getUpdated()) {
                    break;
                }
            } else {
                makeVLineGuess(pe.coords.i, pe.coords.j, depth);
                if (grid_->getVLine(pe.coords.i, pe.coords.j) == EMPTY) {
                    pe.priority = pe.priority - 1;
                    epq_.push(pe);
                }
                if (grid_->getUpdated()) {
                    break;
                }
            }
            epq_.pop();
        }
    } else {
        for (int i = 0; i < grid_->getHeight()+1; i++) {
            for (int j = 0; j < grid_->getWidth(); j++) {
                applyRules(selectedRules_);
                makeHLineGuess(i, j, depth);
            }
        }

        for (int i = 0; i < grid_->getHeight(); i++) {
            for (int j = 0; j < grid_->getWidth()+1; j++) {
                applyRules(selectedRules_);
                makeVLineGuess(i, j, depth);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x38(%rdi), %r15
movq %r15, %rdi
callq 0x5978
movl %eax, %r12d
movq %r15, %rdi
callq 0x5966
testb %al, %al
je 0xb230
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r13d, %r13d
testl %r12d, %r12d
cmovgl %r12d, %r13d
incl %r13d
leaq -0x40(%rbp), %r12
decl %r13d
je 0xb221
cmpb $0x0, 0x64(%r14)
jne 0xb221
movq %r12, %rdi
movq %r15, %rsi
callq 0x5990
movl -0x40(%rbp), %esi
cmpb $0x1, -0x30(%rbp)
jne 0xb27f
movl -0x3c(%rbp), %edx
movq %r14, %rdi
movl %ebx, %ecx
callq 0xb60c
movq 0x8(%r14), %rdi
movl -0x40(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x431a
jmp 0xb29b
movl -0x3c(%rbp), %edx
movq %r14, %rdi
movl %ebx, %ecx
callq 0xbc98
movq 0x8(%r14), %rdi
movl -0x40(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x4360
testl %eax, %eax
jne 0xb2ca
movsd -0x38(%rbp), %xmm0
addsd 0x4174(%rip), %xmm0     # 0xf420
movsd %xmm0, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x40(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0x59ac
movq 0x8(%r14), %rax
cmpb $0x0, 0x9(%rax)
jne 0xb221
movq %r15, %rdi
callq 0x59c0
movq %r15, %rdi
callq 0x5966
testb %al, %al
je 0xb241
jmp 0xb221
nop
// File: /workspace/github_cpp_makefile_star2_O1/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: Generator::Generator(int, int, Difficulty)
Generator::Generator(int m, int n, Difficulty difficulty) {
    m_ = m;
    n_ = n;

    numberCount_ = m_*n_;

    buffer_ = 0;

    srand(time(NULL));
    setDifficulty(difficulty);
    createPuzzle();
    displayFinalPuzzle();
    destroyArrays();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r12d
movq %rdi, %r15
leaq 0x48(%rdi), %rbx
movw $0x100, %ax             # imm = 0x100
movw %ax, 0x50(%rdi)
leaq 0x62a9(%rip), %rcx      # 0x12d38
addq $0x10, %rcx
movq %rcx, 0x48(%rdi)
movw $0x1, %di
movw %di, 0x90(%r15)
leaq 0xa0(%r15), %r14
movw %ax, 0xa8(%r15)
movq %rcx, 0xa0(%r15)
movw %di, 0xe8(%r15)
leaq 0xf8(%r15), %r13
xorps %xmm0, %xmm0
movups %xmm0, 0xf8(%r15)
movups %xmm0, 0x108(%r15)
movups %xmm0, 0x118(%r15)
movl %esi, (%r15)
movl %edx, 0x4(%r15)
imull %esi, %edx
movl %edx, 0x18(%r15)
movl $0x0, 0x20(%r15)
xorl %edi, %edi
callq 0x2170
movl %eax, %edi
callq 0x2190
movq %r15, %rdi
movl %r12d, %esi
callq 0xcd54
testl %r12d, %r12d
je 0xcb27
cmpl $0x1, %r12d
jne 0xcb3d
movsd 0x2ad3(%rip), %xmm0     # 0xf5f8
jmp 0xcb2f
movsd 0x2ac1(%rip), %xmm0     # 0xf5f0
movsd %xmm0, 0x10(%r15)
movl $0x1, 0x8(%r15)
movq %r15, %rdi
callq 0xcbde
movq %r15, %rdi
callq 0xcc50
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xccd4
movq %rax, %r12
movq 0x110(%r15), %rdi
testq %rdi, %rdi
je 0xcb77
callq 0x2180
movq (%r13), %rdi
testq %rdi, %rdi
je 0xcb85
callq 0x2180
movq %r14, %rdi
callq 0x2a40
movq %rbx, %rdi
callq 0x2a40
movq %r12, %rdi
callq 0x2260
nop
// File: /workspace/github_cpp_makefile_star2_O1/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: Generator::createPuzzle()
void Generator::createPuzzle() {
    smallestCount_ = numberCount_;
    bufferReachCount_ = 0;
    Import importer = Import(grid_, m_, n_);
    LoopGen loopgen = LoopGen(m_, n_, grid_);

    initArrays();
    setCounts();
    grid_.copy(smallestCountGrid_);
    reduceNumbers();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movl 0x18(%rdi), %eax
movl %eax, 0x1c(%rdi)
movl $0x0, 0x24(%rdi)
leaq 0x48(%rdi), %r14
movl (%rdi), %edx
movl 0x4(%rdi), %ecx
leaq -0x20(%rbp), %rdi
movq %r14, %rsi
callq 0x3cfe
movl (%rbx), %esi
movl 0x4(%rbx), %edx
leaq -0x38(%rbp), %rdi
movq %r14, %rcx
callq 0xdda0
movq %rbx, %rdi
callq 0xcdc6
movq %rbx, %rdi
callq 0xcede
leaq 0xa0(%rbx), %rsi
movq %r14, %rdi
callq 0x2c4c
movq %rbx, %rdi
callq 0xcf42
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: Generator::displayFinalPuzzle()
void Generator::displayFinalPuzzle() {
    checkIfSolved();
    displayPuzzle();
    std::cout << std::endl;
    grid_.resetGrid();
    displayPuzzle();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
callq 0xd034
addq $0x48, %rbx
leaq -0x18(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2630
movq %r14, %rdi
callq 0x263a
movq 0x6353(%rip), %r14      # 0x12fd8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x2b0e
leaq -0x18(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2630
movq %r14, %rdi
callq 0x263a
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: Generator::destroyArrays()
void Generator::destroyArrays() {
    for (int i = 0; i < m_; i++) {
        delete [] canEliminate_[i];
        delete [] oldNumbers_[i];
    }
    delete [] canEliminate_;
    delete [] oldNumbers_;
    delete [] selectedRules_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, (%rdi)
jle 0xcd1b
xorl %r14d, %r14d
movq 0x138(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0xccfb
callq 0x21e0
movq 0x140(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0xcd10
callq 0x21e0
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0xcce6
movq 0x138(%rbx), %rdi
testq %rdi, %rdi
je 0xcd2c
callq 0x21e0
movq 0x140(%rbx), %rdi
testq %rdi, %rdi
je 0xcd3d
callq 0x21e0
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0xcd4f
popq %rbx
popq %r14
popq %rbp
jmp 0x21e0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: Generator::setRules(Difficulty)
void Generator::setRules(Difficulty difficulty) {
    if (difficulty == EASY) {
        numberOfRules_ = sizeof((int [])EASY_RULES) / sizeof(int);
        selectedRules_ = new int[numberOfRules_];

        for (int i = 0; i < numberOfRules_; i++) {
            selectedRules_[i] = (int [])EASY_RULES[i];
        }
    } else {
        numberOfRules_ = sizeof((int [])HARD_RULES) / sizeof(int);
        selectedRules_ = new int[numberOfRules_];

        for (int i = 0; i < numberOfRules_; i++) {
            selectedRules_[i] = (int [])HARD_RULES[i];
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0xcd89
movl $0x15, 0x40(%rbx)
movl $0x54, %edi
callq 0x2030
movq %rax, 0x38(%rbx)
leaq 0x290b(%rip), %rsi      # 0xf688
movl $0x15, %ecx
movq %rax, %rdi
rep  movsl (%rsi), %es:(%rdi)
jmp 0xcdbe
movl $0xc, 0x40(%rbx)
movl $0x30, %edi
callq 0x2030
movq %rax, 0x38(%rbx)
movups 0x28b3(%rip), %xmm0     # 0xf658
movups %xmm0, (%rax)
movups 0x28b9(%rip), %xmm0     # 0xf668
movups %xmm0, 0x10(%rax)
movups 0x28be(%rip), %xmm0     # 0xf678
movups %xmm0, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: Generator::initArrays()
void Generator::initArrays() {
    canEliminate_ = new bool*[m_];
    oldNumbers_ = new Number*[m_];
    for (int i = 0; i < m_; i++) {
        canEliminate_[i] = new bool[n_];
        oldNumbers_[i] = new Number[n_];

        for (int j = 0; j < n_; j++) {
            canEliminate_[i][j] = true;
            oldNumbers_[i][j] = grid_.getNumber(i+1, j+1);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movslq (%rdi), %rax
leaq (,%rax,8), %r14
testq %rax, %rax
movq $-0x1, %rax
cmovsq %rax, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x138(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x140(%rbx)
cmpl $0x0, (%rbx)
jle 0xcecf
leaq 0x48(%rbx), %rax
movq %rax, -0x38(%rbp)
xorl %r13d, %r13d
movq -0x38(%rbp), %r15
movslq 0x4(%rbx), %r14
testl %r14d, %r14d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovnsl %r14d, %eax
movslq %eax, %rdi
callq 0x2030
leaq (,%r14,4), %rdi
testq %r14, %r14
movq 0x138(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x2030
movq 0x140(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
cmpl $0x0, 0x4(%rbx)
jle 0xcec0
leal 0x1(%r13), %eax
movl %eax, -0x2c(%rbp)
xorl %r12d, %r12d
movq 0x138(%rbx), %rax
movq (%rax,%r13,8), %rax
movb $0x1, (%rax,%r12)
leaq 0x1(%r12), %r14
movq %r15, %rdi
movl -0x2c(%rbp), %esi
movl %r14d, %edx
callq 0x42d4
movq 0x140(%rbx), %rcx
movq (%rcx,%r13,8), %rcx
movl %eax, (%rcx,%r12,4)
movslq 0x4(%rbx), %rax
movq %r14, %r12
cmpq %rax, %r14
jl 0xce82
incq %r13
movslq (%rbx), %rax
cmpq %rax, %r13
jl 0xce29
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq