Decompile-Bench
Collection
Train: 2 million binary-source function pairs (condensed from 100 million). Test: HumanEval, MBPP, 60K from GitHub repos released after 2025. • 3 items • Updated • 3
name stringlengths 1 4.98k | code stringlengths 61 2.07M | asm stringlengths 57 12.9M | file stringlengths 18 192 |
|---|---|---|---|
Contour::Contour(int, int, int, int) | Contour::Contour(int starti, int startj, int endi, int endj) {
start_.i = starti;
start_.j = startj;
end_.i = endi;
end_.j = endj;
length_ = 1;
} | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movb $0x0, 0x4(%rax)
movl -0xc(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0xc(%rax)
movl -0x14(%rbp), %ecx
movl %ecx... | davidjosepha[P]slitherlink/src/shared/contour.cpp |
Contour::sharesEndpoint(Contour const&) const | bool Contour::sharesEndpoint(Contour const & contour) const {
return ((start_.i == contour.start_.i && start_.j == contour.start_.j) ||
(start_.i == contour.end_.i && start_.j == contour.end_.j) ||
(end_.i == contour.start_.i && end_.j == contour.start_.j) ||
(end_.i == contour.e... | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x2585
movq -0x18(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x10(%rbp), %rdx
movb $0x1, %al
cmpl 0xc(%rdx), %ecx
movb %al, -0x19(%rbp)
je... | davidjosepha[P]slitherlink/src/shared/contour.cpp |
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;
... | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x2664
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jne 0x2664
movq -0x18(%rbp), %rax
movq ... | davidjosepha[P]slitherlink/src/shared/contour.cpp |
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 << ' ';
st... | pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq (%rax), %rdi
callq 0x2ad0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, -0xc(%rbp)
movq (%rax), %rdi
callq 0x2af0
movl %eax, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0xc(%rbp), ... | davidjosepha[P]slitherlink/src/shared/export.cpp |
Export::formatHLine(int, int) const | char Export::formatHLine(int i, int j) const {
switch (lattice_->getHLine(i, j)) {
case LINE:
return HLINE;
case NLINE:
return EX;
default:
return BLANK;
}
} | pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x5bf0
movl %eax, %ecx
movl %ecx, -0x1c(%rbp)
subl $0x1, %eax
je 0x29da
jmp 0x29d0
movl -0x1c(%rbp), %eax
subl $0x... | davidjosepha[P]slitherlink/src/shared/export.cpp |
Export::formatVLine(int, int) const | char Export::formatVLine(int i, int j) const {
switch (lattice_->getVLine(i, j)) {
case LINE:
return VLINE;
case NLINE:
return EX;
default:
return BLANK;
}
} | pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x5c90
movl %eax, %ecx
movl %ecx, -0x1c(%rbp)
subl $0x1, %eax
je 0x2a3a
jmp 0x2a30
movl -0x1c(%rbp), %eax
subl $0x... | davidjosepha[P]slitherlink/src/shared/export.cpp |
Export::formatNumber(int, int) const | char Export::formatNumber(int i, int j) const {
switch (lattice_->getNumber(i, j)) {
case ZERO:
return '0';
case ONE:
return '1';
case TWO:
return '2';
case THREE:
return '3';
default:
return BLANK;
}
} | pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x5b50
decl %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x3, %eax
ja 0x2abd
movq -0x20(%rbp), %rax
leaq 0x12... | davidjosepha[P]slitherlink/src/shared/export.cpp |
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++) {
... | pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x1920d(%rip), %rcx # 0x1bd38
addq $0x10, %rcx
movq %rcx, (%rax)
testb $0x1, 0x49(%rax)
je 0x2c5d
movl $0x0, -0xc(%rbp)
movq -0x20(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0xc(%rcx), %eax
jge 0x2b7f
mov... | davidjosepha[P]slitherlink/src/shared/grid.cpp |
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;
}
}
f... | pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x1, -0xc(%rbp)
movq -0x40(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, -0x44(%rbp)
callq 0x2ad0
movl %eax, %ecx
movl -0x44(%rbp), %eax
cmpl %ecx, %eax
jge 0x2cf8
movl $0x1, -0x10(%rbp)
movq -0x40(%rbp),... | davidjosepha[P]slitherlink/src/shared/grid.cpp |
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(... | pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
callq 0x2ad0
movq -0x50(%rbp), %rdi
movl %eax, -0x3c(%rbp)
callq 0x2af0
movq -0x48(%rbp), %rdi
movl -0x3c(%rbp), %esi
movl %eax, %edx
callq ... | davidjosepha[P]slitherlink/src/shared/grid.cpp |
Grid::initUpdateMatrix() | void Grid::initUpdateMatrix() {
if (!init_) {
updateMatrix_ = new bool*[m_];
for (int i = 0; i < getHeight(); i++) {
updateMatrix_[i] = new bool[n_];
for (int j = 0; j < getWidth(); j++) {
updateMatrix_[i][j] = true;
}
}
contraMatr... | pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
testb $0x1, 0x49(%rax)
jne 0x355b
movq -0x48(%rbp), %rax
movslq 0xc(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %r... | davidjosepha[P]slitherlink/src/shared/grid.cpp |
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.c... | pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x40(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, -0x44(%rbp)
callq 0x2ad0
movl %eax, %ecx
movl -0x44(%rbp), %eax
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x362c... | davidjosepha[P]slitherlink/src/shared/grid.cpp |
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 (... | pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl -0x14(%rbp), %ecx
movb %al, -0x71(%rbp)
jg 0x38be
movq -0x80(%rbp), %rax
movl -0x14(%rbp), %ecx
movl ... | davidjosepha[P]slitherlink/src/shared/grid.cpp |
Grid::updateContourMatrix(int, int, bool) | void Grid::updateContourMatrix(int i, int j, bool hline) {
int i2 = i;
int j2 = j;
// The second endpoint of the new line is determined by whether the line is
// horizontal or vertical
if (hline) {
j2 = j + 1;
} else {
i2 = i + 1;
}
/* Both ends of the new line are alr... | pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp # imm = 0x1C0
movb %cl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x148(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x1c(%... | davidjosepha[P]slitherlink/src/shared/grid.cpp |
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;
}
/... | pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl -0x14(%rbp), %ecx
movb %al, -0x71(%rbp)
jg 0x42de
movq -0x80(%rbp), %rdx
movl -0x14(%rbp), %ecx
xorl ... | davidjosepha[P]slitherlink/src/shared/grid.cpp |
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)
... | pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl -0x14(%rbp), %ecx
movb %al, -0x21(%rbp)
jg 0x4723
movq -0x30(%rbp), %rdx
movl -0x14(%rbp), %ecx
xorl %eax, %eax
cmpl 0xc(%rd... | davidjosepha[P]slitherlink/src/shared/grid.cpp |
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;
} | pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, 0x4c(%rax)
jne 0x4854
movq -0x20(%rbp), %rax
cmpl $0x1, 0x50(%rax)
je 0x485a
movb $0x0, -0x1(%rbp)
jmp 0x48b7
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0xc(%rcx), %... | davidjosepha[P]slitherlink/src/shared/grid.cpp |
Import::buildLattice(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>) | void Import::buildLattice(std::string filename) {
std::string buffer;
std::ifstream slkfile(filename);
if (slkfile.is_open()) {
/* source info */
std::getline(slkfile, buffer);
/* get dimensions */
int m, n;
slkfile >> m;
slkfile >> n;
lattice_->ini... | pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp # imm = 0x2F0
movq %rsi, -0x2d0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2d8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2250
movq -0x2d0(%rbp), %rsi
leaq -0x238(%rbp), %rdi
movl $0x8, %edx
callq 0x2290
jmp 0x4c78
leaq -0x238... | davidjosepha[P]slitherlink/src/shared/import.cpp |
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, NLI... | pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq (%rax), %rdi
movl -0xc(%rbp), %esi
addl $0x2, %esi
movl -0x10(%rbp), %edx
addl $0x2, %edx
callq 0x5820
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x31e0
mo... | davidjosepha[P]slitherlink/src/shared/import.cpp |
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, ... | pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdx, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
callq 0x2140
movq %rax, %rcx
movq -0x40(%rbp), %r... | davidjosepha[P]slitherlink/src/shared/import.cpp |
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':
... | pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdx, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movq (%rdi), %rax
xorl %edx, %edx
movl $0x2, %ecx
callq *(%rax)
movq $0x0, -0x20(%rbp)
movq -0x38(%rb... | davidjosepha[P]slitherlink/src/shared/import.cpp |
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+... | pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdx, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
callq 0x2140
movq %rax, %rcx
movq -0x40(%rbp), %r... | davidjosepha[P]slitherlink/src/shared/import.cpp |
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... | pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
testb $0x1, 0x8(%rax)
je 0x5810
movl $0x0, -0xc(%rbp)
movq -0x18(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0xc(%rcx), %eax
jge 0x579a
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%ra... | davidjosepha[P]slitherlink/src/shared/lattice.cpp |
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_];
... | pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpl $0x0, -0xc(%rbp)
movb %al, -0x15(%rbp)
jle 0x584f
cmpl $0x0, -0x10(%rbp)
setg %al
movb %al, -0x15(%rbp)
movb -0x15(%rbp), %al
testb $0x1, %al
j... | davidjosepha[P]slitherlink/src/shared/lattice.cpp |
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 (... | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
testb $0x1, 0x8(%rax)
je 0x5b4c
movl $0x0, -0xc(%rbp)
movq -0x20(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0xc(%rcx), %eax
jge 0x5b11
movl $0x0, -0x10(%rbp)
movq -0x20(%rbp), %rcx
movl -0x10(%rbp), %eax
cmpl 0x10(%rcx), %eax
jge ... | davidjosepha[P]slitherlink/src/shared/lattice.cpp |
Contradiction::getNumberHeight(Orientation) const | int Contradiction::getNumberHeight(Orientation orient) const {
switch (orient) {
case UP:
case DOWN:
case UPFLIP:
case DOWNFLIP:
return m_;
case LEFT:
case RIGHT:
case LEFTFLIP:
case RIGHTFLIP:
return n_;
}
} | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
subl $0x2, %eax
jb 0x6047
jmp 0x6020
movl -0x18(%rbp), %eax
addl $-0x2, %eax
subl $0x2, %eax
jb 0x6052
jmp 0x602d
movl -0x18(%rbp), %eax
addl $-0x4, %eax
s... | davidjosepha[P]slitherlink/src/solver/contradiction.cpp |
initContradictions(Contradiction (&) [11]) | void initContradictions(Contradiction (& contradictions)[NUM_CONTRADICTIONS]) {
int i = 0;
/**
* Contradiction #01
* . . .
* x
* . x . x .
* |
* . . .
*/
contradictions[i] = Contradiction(2, 2);
contradictions[i].addHLinePattern(1, 0, NLINE);
cont... | pushq %rbp
movq %rsp, %rbp
subq $0x380, %rsp # imm = 0x380
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
leaq -0x60(%rbp), %rdi
movl $0x2, %edx
movl %edx, %esi
callq 0x5fa0
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rax
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq -0x60(%rbp), %rsi
callq 0x69e0
leaq -0x60(%rbp)... | davidjosepha[P]slitherlink/src/solver/contradictions.cpp |
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, ... | pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
xorl %eax, %eax
cmpl $0x0, -0xc(%rbp)
movb %al, -0x81(%rbp)
jle 0x84bb
cmpl $0x0, -0x10(%rbp)
setg %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
testb $0x1, %al
j... | davidjosepha[P]slitherlink/src/solver/epq.cpp |
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;
} | pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x68(%rbp)
movq %rdi, %rax
movq %rax, -0x60(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x8d10
movq -0x58(%rbp), %rdi
movb $0x0, -0x31(%rbp)
addq $0x8, %rdi
callq 0x8c30
movq %rax, -... | davidjosepha[P]slitherlink/src/solver/epq.cpp |
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... | pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rsi, -0x78(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x87a0
movq -0x78(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x88a0
movl $0x0, -0x44(%rbp)
movslq -0x44(%rbp), %rax
movq %rax, -0x88(%rb... | davidjosepha[P]slitherlink/src/solver/epq.cpp |
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 };... | pushq %rbp
movq %rsp, %rbp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq %rax, -0x28(%rbp)
subq $0x7, %rax
ja 0xaa49
movq -0x28(%rbp), %rax
leaq 0xaa38(%rip), %rcx # 0x153f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jm... | davidjosepha[P]slitherlink/src/solver/rotate.cpp |
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;
contradictio... | pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x68(%rbp)
addq $0x38, %rdi
movq %rdi, -0x78(%rbp)
movq %rdi, %rax
movq %rax, -0x70(... | davidjosepha[P]slitherlink/src/solver/solver.cpp |
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 < ... | pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xfc70
testb $0x1, %al
jne 0xcdae
jmp 0xcf4d
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rdi
xorl %esi, %esi
callq 0xfc50
movl $0x0, -0x14(%... | davidjosepha[P]slitherlink/src/solver/solver.cpp |
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_) {
solveD... | pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0xfc50
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xfc70
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x19(%rbp)
jne 0xcf9d
jmp 0xcfaf
movq -0x18(%... | davidjosepha[P]slitherlink/src/solver/solver.cpp |
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... | pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq 0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x78(%rbp)
addq $0x38, %rdi
movq %rdi, ... | davidjosepha[P]slitherlink/src/solver/solver.cpp |
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 ... | pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq 0x8(%rax), %rdi
callq 0x48d0
testb $0x1, %al
jne 0xd193
jmp 0xd1ad
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4830
testb $0x1, %al
jne 0xd1ad
movb $0x1, -0x1(%rbp)
jmp 0xd30a
movl $0x0, -0x14(%... | davidjosepha[P]slitherlink/src/solver/solver.cpp |
Solver::contradictionApplies(int, int, Contradiction const&, Orientation) const | bool Solver::contradictionApplies(int i, int j, Contradiction const & contradiction, Orientation orient) const {
int m = contradiction.getHeight();
int n = contradiction.getWidth();
if (i > grid_->getHeight() - contradiction.getNumberHeight(orient)
|| j > grid_->getWidth() - contradiction.getNu... | pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x20(%rbp), %rdi
callq 0xfef0
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0xff00
movl %eax, %ecx
movq... | davidjosepha[P]slitherlink/src/solver/solver.cpp |
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) {
mak... | pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movb $0x1, -0xd(%rbp)
testb $0x1, -0xd(%rbp)
je 0xd92f
movq -0x78(%rbp), %rdi
addq $0x38, %rdi
callq 0x8780
movl %eax, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x78(%rbp), %rdi
addq $0x38... | davidjosepha[P]slitherlink/src/solver/solver.cpp |
Solver::updateEPQ() | void Solver::updateEPQ() {
epq_.empty();
int m = grid_->getHeight();
int n = grid_->getWidth();
for (int i = 1; i < m ; i++) {
for (int j = 1; j < n-1; j++) {
if (grid_->getHLine(i,j) != EMPTY) {
continue;
}
float prio = grid_->getHLine(i,j-1)... | pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
addq $0x38, %rdi
callq 0x8750
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2ad0
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, -0xc(%rbp)
movq 0x8(%rax), %rdi
callq 0x2af0
movl %eax, -0x10(%rbp)
movl... | davidjosepha[P]slitherlink/src/solver/solver.cpp |
Solver::makeHLineGuess(int, int, int) | void Solver::makeHLineGuess(int i, int j, int depth) {
assert(0 <= i && i < grid_->getHeight()+1 && 0 <= j && j < grid_->getWidth());
assert(depth >= 0);
if (grid_->getHLine(i, j) == EMPTY) {
/* there is only one case where the grid
* will not be updated, which is handled
* at the... | pushq %rbp
movq %rsp, %rbp
subq $0x450, %rsp # imm = 0x450
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x388(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl -0xc(%rbp), %ecx
movb %al, -0x379(%rbp)
jg 0xdefd
movq -0x388(%rbp), %rax
mov... | davidjosepha[P]slitherlink/src/solver/solver.cpp |
Solver::makeVLineGuess(int, int, int) | void Solver::makeVLineGuess(int i, int j, int depth) {
assert(0 <= i && i < grid_->getHeight() && 0 <= j && j < grid_->getWidth()+1);
assert(depth >= 0);
if (grid_->getVLine(i, j) == EMPTY) {
/* there is only one case where the grid
* will not be updated, which is handled
* at the... | pushq %rbp
movq %rsp, %rbp
subq $0x450, %rsp # imm = 0x450
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x388(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl -0xc(%rbp), %ecx
movb %al, -0x379(%rbp)
jg 0xe86d
movq -0x388(%rbp), %rax
mov... | davidjosepha[P]slitherlink/src/solver/solver.cpp |
Solver::intersectGrids(Grid const&, Grid const&) | void Solver::intersectGrids(Grid const & lineGuess, Grid const & nLineGuess) {
assert(lineGuess.getHeight() == nLineGuess.getHeight() &&
lineGuess.getWidth() == nLineGuess.getWidth());
for (int i = 0; i < grid_->getHeight()+1; i++) {
for (int j = 0; j < grid_->getWidth(); j++) {
... | pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2ad0
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2ad0
movl -0x30(%rbp), %ecx
movl %eax, %edx
xorl %eax, %eax
cmpl %edx, %e... | davidjosepha[P]slitherlink/src/solver/solver.cpp |
Solver::ruleApplies(int, int, Rule const&, Orientation) const | bool Solver::ruleApplies(int i, int j, Rule const & rule, Orientation orient) const {
int m = rule.getHeight();
int n = rule.getWidth();
if (i > grid_->getHeight() - rule.getNumberHeight(orient)
|| j > grid_->getWidth() - rule.getNumberWidth(orient)) {
return false;
}
std::vecto... | pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x20(%rbp), %rdi
callq 0xfda0
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0xfdb0
movl %eax, %ecx
movq... | davidjosepha[P]slitherlink/src/solver/solver.cpp |
20250816: 643K pairs (condensed from 12M pairs) from 2600 permissive C/C++ projects with makefile as build system.
20250808: 283K pairs (condensed from 10M pairs) from 1700 permissive C/C++ projects with makefile as build system.
20250730: 83K pairs (condensed from 5M pairs) from 1700 permissive C/C++ projects with makefile as build system.
On going.