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
Solver::applyRule(int, int, Rule&, Orientation)
void Solver::applyRule(int i, int j, Rule & rule, Orientation orient) { int m = rule.getHeight(); int n = rule.getWidth(); std::vector<EdgePosition> const * hLineDiff = rule.getHLineDiff(); for (int k = 0; k < hLineDiff->size(); k++) { EdgePosition pattern = (*hLineDiff)[k]; Coordinates...
pushq %rbp movq %rsp, %rbp subq $0xb0, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movl %edx, -0x10(%rbp) movq %rcx, -0x18(%rbp) movl %r8d, -0x1c(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x70(%rbp) movq -0x18(%rbp), %rdi callq 0xfda0 movl %eax, -0x20(%rbp) movq -0x18(%rbp), %rdi callq 0xfdb0 movl %eax, -0x24(%rbp) ...
davidjosepha[P]slitherlink/src/solver/solver.cpp
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(); }
pushq %rbp movq %rsp, %rbp subq $0x50, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movl %edx, -0x10(%rbp) movl %ecx, -0x14(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x38(%rbp) addq $0x48, %rdi movq %rdi, -0x40(%rbp) callq 0xfc90 movq -0x38(%rbp), %rdi addq $0xa0, %rdi movq %rdi, -0x30(%rbp) callq 0xfc90 jmp 0x105f0 ...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::setDifficulty(Difficulty)
void Generator::setDifficulty(Difficulty difficulty) { setRules(difficulty); if (difficulty == EASY) { factor_ = .52; guessDepth_ = 1; } else if (difficulty == HARD) { factor_ = .42; guessDepth_ = 1; } }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x18(%rbp) movl -0xc(%rbp), %esi callq 0x10910 cmpl $0x0, -0xc(%rbp) jne 0x1070f movq -0x18(%rbp), %rax movsd 0x4f07(%rip), %xmm0 # 0x15608 movsd %xmm0, 0x10(%rax) movl $0x1, 0x8(%rax) jmp 0x107...
davidjosepha[P]slitherlink/src/generator/generator.cpp
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(); }
pushq %rbp movq %rsp, %rbp subq $0x40, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x38(%rbp) movl 0x18(%rax), %ecx movl %ecx, 0x1c(%rax) movl $0x0, 0x24(%rax) movq %rax, %rsi addq $0x48, %rsi movl (%rax), %edx movl 0x4(%rax), %ecx leaq -0x18(%rbp), %rdi callq 0x5160 movq -0x38(%rbp), %rcx movl (%rcx),...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::displayFinalPuzzle()
void Generator::displayFinalPuzzle() { checkIfSolved(); displayPuzzle(); std::cout << std::endl; grid_.resetGrid(); displayPuzzle(); }
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x10(%rbp) callq 0x10d90 movq -0x10(%rbp), %rdi callq 0x11180 movq 0xb7df(%rip), %rdi # 0x1bfd8 movq 0xb7c8(%rip), %rsi # 0x1bfc8 callq 0x21e0 movq -0x10(%rbp), %rdi addq $0x48, %rdi callq 0x2c70 movq -0x10(%rb...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::destroyArrays()
void Generator::destroyArrays() { for (int i = 0; i < m_; i++) { delete [] canEliminate_[i]; delete [] oldNumbers_[i]; } delete [] canEliminate_; delete [] oldNumbers_; delete [] selectedRules_; }
pushq %rbp movq %rsp, %rbp subq $0x40, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x18(%rbp) movl $0x0, -0xc(%rbp) movq -0x18(%rbp), %rcx movl -0xc(%rbp), %eax cmpl (%rcx), %eax jge 0x108af movq -0x18(%rbp), %rax movq 0x138(%rax), %rax movslq -0xc(%rbp), %rcx movq (%rax,%rcx,8), %rax movq %rax, -0x20(...
davidjosepha[P]slitherlink/src/generator/generator.cpp
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]; } } ...
pushq %rbp movq %rsp, %rbp subq $0xa0, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movq -0x8(%rbp), %rax movq %rax, -0xa0(%rbp) cmpl $0x0, -0xc(%rbp) jne 0x109cd movq -0xa0(%rbp), %rax movl $0xc, 0x40(%rax) movslq 0x40(%rax), %rax movl $0x4, %ecx mulq %rcx movq %rax, %rdi seto %cl movq $-0x1, %rax testb $0x1, %cl ...
davidjosepha[P]slitherlink/src/generator/generator.cpp
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...
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x18(%rbp) movslq (%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, %rcx movq -0x18(%rbp), %rax movq %rcx, 0x138(%rax) movslq (%ra...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::setCounts()
void Generator::setCounts() { zeroCount_ = 0; oneCount_ = 0; twoCount_ = 0; threeCount_ = 0; for (int i = 1; i <= m_; i++) { for (int j = 1; j <= n_; j++) { Number oldNum = grid_.getNumber(i, j); plusCounts(oldNum); } } }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x20(%rbp) movl $0x0, 0x28(%rax) movl $0x0, 0x2c(%rax) movl $0x0, 0x30(%rax) movl $0x0, 0x34(%rax) movl $0x1, -0xc(%rbp) movq -0x20(%rbp), %rcx movl -0xc(%rbp), %eax cmpl (%rcx), %eax jg 0x10c7f movl $0x1, -0x10(%rbp) mo...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::reduceNumbers()
void Generator::reduceNumbers() { // Remove numbers until this count has been reached while (numberCount_ > ((m_*n_)*factor_ + 3)) { /* Reset the smallest count and buffer incase the required amount of numbers cannot be removed. */ if (smallestCount_ > numberCount_) { small...
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x10(%rbp) movq -0x10(%rbp), %rax cvtsi2sdl 0x18(%rax), %xmm0 movl (%rax), %ecx imull 0x4(%rax), %ecx cvtsi2sd %ecx, %xmm1 movsd 0x10(%rax), %xmm2 mulsd %xmm2, %xmm1 movsd 0x4948(%rip), %xmm2 # 0x15610 addsd %xmm2, %...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::checkIfSolved()
bool Generator::checkIfSolved() { Rule rules_[NUM_RULES]; initRules(rules_); Contradiction contradictions_[NUM_CONTRADICTIONS]; initContradictions(contradictions_); grid_.resetGrid(); Solver solver = Solver(grid_, rules_, contradictions_, selectedRules_, numberOfRules_, guessDepth_); if (gr...
pushq %rbp movq %rsp, %rbp subq $0x1560, %rsp # imm = 0x1560 movq %rdi, -0x10(%rbp) movq -0x10(%rbp), %rax movq %rax, -0x14a0(%rbp) leaq -0x1090(%rbp), %rax movq %rax, -0x1498(%rbp) movq %rax, %rcx addq $0x1080, %rcx # imm = 0x1080 movq %rcx, -0x1490(%rbp) movq %rax, -0x1488(%rbp) movq -0x1488(%rbp)...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::plusCounts(Number)
void Generator::plusCounts(Number num) { if (num == ZERO) { zeroCount_ ++; }else if (num == ONE) { oneCount_ ++; } else if (num == TWO) { twoCount_ ++; } else if (num == THREE) { threeCount_ ++; } }
pushq %rbp movq %rsp, %rbp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x18(%rbp) cmpl $0x1, -0xc(%rbp) jne 0x111d8 movq -0x18(%rbp), %rax movl 0x28(%rax), %ecx addl $0x1, %ecx movl %ecx, 0x28(%rax) jmp 0x1121b cmpl $0x2, -0xc(%rbp) jne 0x111ed movq -0x18(%rbp), %rax movl 0x2c(%rax), %...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::findNumberToRemove()
void Generator::findNumberToRemove() { fillEligibleVector(); bool coordsFound = false; while (!eligibleCoordinates_.empty() && !coordsFound) { int random = rand() % eligibleCoordinates_.size(); Coordinates attempt = eligibleCoordinates_.at(random); eligibleCoordinates_.erase(eligibl...
pushq %rbp movq %rsp, %rbp subq $0x60, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x40(%rbp) callq 0x11450 movb $0x0, -0x9(%rbp) movq -0x40(%rbp), %rdi addq $0xf8, %rdi callq 0x11e20 movb %al, %cl xorl %eax, %eax testb $0x1, %cl movb %al, -0x41(%rbp) jne 0x112d1 movb -0x9(%rbp), %al xorb $-0x1, %al mo...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::fillEligibleVector()
void Generator::fillEligibleVector() { for (int i = 1; i < m_+1; i++) { for (int j = 1; j < n_+1; j++) { if (eligible(i, j)) { Coordinates coords = { i, j }; eligibleCoordinates_.push_back(coords); } } } }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x20(%rbp) movl $0x1, -0xc(%rbp) movq -0x20(%rbp), %rcx movl -0xc(%rbp), %eax movl (%rcx), %ecx addl $0x1, %ecx cmpl %ecx, %eax jge 0x114e2 movl $0x1, -0x10(%rbp) movq -0x20(%rbp), %rcx movl -0x10(%rbp), %eax movl 0x4(%r...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::isBalanced(int, int) const
bool Generator::isBalanced(int i, int j) const { float moa = 1.1; Number num = grid_.getNumber(i, j); if (num == THREE) { return (threeCount_*2*moa >= 3*oneCount_ & threeCount_*5*moa >= 3*twoCount_); } else if (num == TWO) { return (twoCount_*2.1+1 >= 5*oneCount_ & twoCount_*3*moa >= 5*t...
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x10(%rbp) movl %esi, -0x14(%rbp) movl %edx, -0x18(%rbp) movq -0x10(%rbp), %rdi movq %rdi, -0x28(%rbp) movss 0x4126(%rip), %xmm0 # 0x15638 movss %xmm0, -0x1c(%rbp) addq $0x48, %rdi movl -0x14(%rbp), %esi movl -0x18(%rbp), %edx callq 0x5b50 movl %eax, -0x20(%rb...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::removeNumber(int, int)
void Generator::removeNumber(int i, int j) { grid_.setNumber(i, j, NONE); grid_.resetGrid(); Coordinates removed{ i, j }; ineligibleCoordinates_.push_back(removed); }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movl %edx, -0x10(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x20(%rbp) addq $0x48, %rdi movl -0xc(%rbp), %esi movl -0x10(%rbp), %edx xorl %ecx, %ecx callq 0x5d90 movq -0x20(%rbp), %rdi addq $0x48, %rdi callq 0x2c70 movq -0x20(%rbp), %r...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::getNecessaryCoordinate()
void Generator::getNecessaryCoordinate() { bool found = false; while (!found) { Coordinates popped = ineligibleCoordinates_.back(); if (grid_.getNumber(popped.i, popped.j) == NONE) { markNecessary(popped.i, popped.j); setOldNumber(popped.i, popped.j); ineligi...
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x20(%rbp) movb $0x0, -0x9(%rbp) movb -0x9(%rbp), %al xorb $-0x1, %al testb $0x1, %al jne 0x11776 jmp 0x1181f movq -0x20(%rbp), %rdi addq $0x110, %rdi # imm = 0x110 callq 0x120f0 movq -0x20(%rbp), %rdi movq (%...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::eligible(int, int) const
bool Generator::eligible(int i, int j) const { if (canEliminate_[i-1][j-1] && (grid_.getNumber(i, j) != NONE)) { return true; } else { return false; } }
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, -0x20(%rbp) movq 0x138(%rax), %rax movl -0x14(%rbp), %ecx subl $0x1, %ecx movslq %ecx, %rcx movq (%rax,%rcx,8), %rax movl -0x18(%rbp), %ecx subl $0x1, %ecx movslq %ecx, %rcx...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::deleteNumbers()
void Generator::deleteNumbers() { setCounts(); int count = 0; int i = rand() % (m_) + 1; int j = rand() % (n_) + 1; Number oldNum = grid_.getNumber(i, j); while (count < ((m_)*(n_)*2/3 + 10)) { count++; int count2 = 0; while (true) { i = rand() % (m_) + 1; ...
pushq %rbp movq %rsp, %rbp subq $0xc0, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0xa0(%rbp) callq 0x10bf0 movl $0x0, -0xc(%rbp) callq 0x2070 movq -0xa0(%rbp), %rcx cltd idivl (%rcx) addl $0x1, %edx movl %edx, -0x10(%rbp) callq 0x2070 movq -0xa0(%rbp), %rdi cltd idivl 0x4(%rdi) addl $0x1, %edx movl %e...
davidjosepha[P]slitherlink/src/generator/generator.cpp
Generator::isBalanced(int, int, Number) const
bool Generator::isBalanced(int i, int j, Number num) const { if (eligible(i, j)) { if (num == ZERO) { return true; } if (num == THREE) { return (threeCount_*2.1+1 > 3*oneCount_ & threeCount_*5.2+1 > 3*twoCount_); } if (num == ONE) { return (oneCount_*3.2+1...
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x10(%rbp) movl %esi, -0x14(%rbp) movl %edx, -0x18(%rbp) movl %ecx, -0x1c(%rbp) movq -0x10(%rbp), %rdi movq %rdi, -0x28(%rbp) movl -0x14(%rbp), %esi movl -0x18(%rbp), %edx callq 0x11830 testb $0x1, %al jne 0x11be1 jmp 0x11d6e cmpl $0x1, -0x1c(%rbp) jne 0x11bf0 mov...
davidjosepha[P]slitherlink/src/generator/generator.cpp
LoopGen::LoopGen(int, int, Grid&)
LoopGen::LoopGen(int m, int n, Grid & grid) { m_ = m; n_ = n; grid_ = &grid; srand(time(NULL)); initArray(); genLoop(); fillGrid(); destroyArray(); }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movl %edx, -0x10(%rbp) movq %rcx, -0x18(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x20(%rbp) movl -0xc(%rbp), %ecx movl %ecx, 0x10(%rax) movl -0x10(%rbp), %ecx movl %ecx, 0x14(%rax) movq -0x18(%rbp), %rcx movq %rcx, 0x8(%rax) xorl %ea...
davidjosepha[P]slitherlink/src/generator/loopgen.cpp
LoopGen::initArray()
void LoopGen::initArray() { loop_ = new LoopCell*[m_]; for (int i = 0; i < m_; i++) { loop_[i] = new LoopCell[n_]; for (int j = 0; j < n_; j++) { loop_[i][j] = UNKNOWN; } } }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x18(%rbp) movslq 0x10(%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, %rcx movq -0x18(%rbp), %rax movq %rcx, (%rax) movl $0x0, -...
davidjosepha[P]slitherlink/src/generator/loopgen.cpp
LoopGen::genLoop()
void LoopGen::genLoop() { Coordinates cur = { m_ / 2, n_ / 2 }; Coordinates next; std::vector<Coordinates> avail; avail.push_back(cur); while (avail.size() > 0) { cur = pickCell(avail); if (cur.i == -1 || cur.j == -1) { return; } next = addCell(cur); ...
pushq %rbp movq %rsp, %rbp subq $0x90, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x78(%rbp) movl 0x10(%rax), %ecx movl %ecx, %edx shrl $0x1f, %edx addl %edx, %ecx sarl %ecx movl %ecx, -0x10(%rbp) movl 0x14(%rax), %eax movl %eax, %ecx shrl $0x1f, %ecx addl %ecx, %eax sarl %eax movl %eax, -0xc(%rbp) le...
davidjosepha[P]slitherlink/src/generator/loopgen.cpp
LoopGen::fillGrid()
void LoopGen::fillGrid() { int lines; for (int i = 1; i < m_ + 1; i++) { for (int j = 1; j < n_ + 1; j++) { lines = countLines(i - 1, j - 1); switch (lines) { case 0: grid_->setNumber(i, j, ZERO); break; cas...
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x20(%rbp) movl $0x1, -0x10(%rbp) movq -0x20(%rbp), %rcx movl -0x10(%rbp), %eax movl 0x10(%rcx), %ecx addl $0x1, %ecx cmpl %ecx, %eax jge 0x13449 movl $0x1, -0x14(%rbp) movq -0x20(%rbp), %rcx movl -0x14(%rbp), %eax movl ...
davidjosepha[P]slitherlink/src/generator/loopgen.cpp
LoopGen::countLines(int, int) const
int LoopGen::countLines(int i, int j) const { bool inside = inLoop(i, j); int lines = ((!inBounds({ i + 1, j}) && inside) || (inBounds({ i + 1, j }) && inLoop(i + 1, j) != inside)) + ((!inBounds({ i - 1, j}) && inside) || (inBounds({ i - 1, j }) && inLoop(i - 1, j) != inside)) +...
pushq %rbp movq %rsp, %rbp subq $0x80, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movl %edx, -0x10(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x60(%rbp) movl -0xc(%rbp), %esi movl -0x10(%rbp), %edx callq 0x13760 movq -0x60(%rbp), %rdi andb $0x1, %al movb %al, -0x11(%rbp) movl -0xc(%rbp), %eax addl $0x1, %eax movl %e...
davidjosepha[P]slitherlink/src/generator/loopgen.cpp
LoopGen::pickCell(std::vector<Coordinates, std::allocator<Coordinates>>&) const
Coordinates LoopGen::pickCell(std::vector<Coordinates> & avail) const { Coordinates guess; if (avail.size() > 0) { guess = avail.back(); int guessindex = rand() % avail.size(); guess = avail[guessindex]; avail.erase(avail.begin() + guessindex); return guess; } else ...
pushq %rbp movq %rsp, %rbp subq $0x60, %rsp movq %rdi, -0x10(%rbp) movq %rsi, -0x18(%rbp) movq -0x18(%rbp), %rdi callq 0x11e60 cmpq $0x0, %rax jbe 0x138da movq -0x18(%rbp), %rdi callq 0x120f0 movq (%rax), %rax movq %rax, -0x20(%rbp) callq 0x2070 cltq movq %rax, -0x58(%rbp) movq -0x18(%rbp), %rdi callq 0x11e60 movq %rax...
davidjosepha[P]slitherlink/src/generator/loopgen.cpp
LoopGen::addCell(Coordinates)
Coordinates LoopGen::addCell(Coordinates cur) { assert(cur.i >= 0 && cur.i < m_ && cur.j >= 0 && cur.j < n_); /* check whether it's possible to expand in any direction */ if (!isExpandable(cur)) { return cur; } /* pick some direction up/down/left/right from cur */ Coordinates newpos = ...
pushq %rbp movq %rsp, %rbp subq $0x60, %rsp movq %rsi, -0x10(%rbp) movq %rdi, -0x18(%rbp) movq -0x18(%rbp), %rax movq %rax, -0x60(%rbp) xorl %eax, %eax cmpl $0x0, -0x10(%rbp) movb %al, -0x55(%rbp) jl 0x1394f movq -0x60(%rbp), %rdx movl -0x10(%rbp), %ecx xorl %eax, %eax cmpl 0x10(%rdx), %ecx movb %al, -0x55(%rbp) jge 0x...
davidjosepha[P]slitherlink/src/generator/loopgen.cpp
LoopGen::addAvailable(Coordinates, std::vector<Coordinates, std::allocator<Coordinates>>&) const
void LoopGen::addAvailable(Coordinates coords, std::vector<Coordinates> & avail) const { for (int i = 0; i < avail.size(); i++) { if (avail[i].i == coords.i && avail[i].j == coords.j) { return; } } avail.push_back(coords); }
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rsi, -0x8(%rbp) movq %rdi, -0x10(%rbp) movq %rdx, -0x18(%rbp) movl $0x0, -0x1c(%rbp) movslq -0x1c(%rbp), %rax movq %rax, -0x28(%rbp) movq -0x18(%rbp), %rdi callq 0x11e60 movq %rax, %rcx movq -0x28(%rbp), %rax cmpq %rcx, %rax jae 0x13b20 movq -0x18(%rbp), %rdi movslq -0x...
davidjosepha[P]slitherlink/src/generator/loopgen.cpp
LoopGen::isExpandable(Coordinates) const
bool LoopGen::isExpandable(Coordinates cur) const { assert(cur.i >= 0 && cur.i < m_ && cur.j >= 0 && cur.j < n_); AdjacencyList adjacencyList = getAdjacent(cur); if (!adjacencyList.u && !adjacencyList.d && !adjacencyList.l && !adjacencyList.r) { loop_[cur.i][cur.j] = NOEXP; return false; ...
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rsi, -0xc(%rbp) movq %rdi, -0x18(%rbp) movq -0x18(%rbp), %rax movq %rax, -0x30(%rbp) xorl %eax, %eax cmpl $0x0, -0xc(%rbp) movb %al, -0x25(%rbp) jl 0x13b8f movq -0x30(%rbp), %rdx movl -0xc(%rbp), %ecx xorl %eax, %eax cmpl 0x10(%rdx), %ecx movb %al, -0x25(%rbp) jge 0x13b...
davidjosepha[P]slitherlink/src/generator/loopgen.cpp
LoopGen::pickDirection(Coordinates) const
Coordinates LoopGen::pickDirection(Coordinates cur) const { int vert = (rand() % 3) - 1; int hor = 0; if (vert == 0) { hor = (rand() % 2)*2 - 1; } return { cur.i + vert, cur.j + hor }; }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rsi, -0x10(%rbp) movq %rdi, -0x18(%rbp) callq 0x2070 movl $0x3, %ecx cltd idivl %ecx subl $0x1, %edx movl %edx, -0x1c(%rbp) movl $0x0, -0x20(%rbp) cmpl $0x0, -0x1c(%rbp) jne 0x13c67 callq 0x2070 movl $0x2, %ecx cltd idivl %ecx movl %edx, %eax shll %eax subl $0x1, %eax m...
davidjosepha[P]slitherlink/src/generator/loopgen.cpp
LoopGen::getAdjacent(Coordinates) const
AdjacencyList LoopGen::getAdjacent(Coordinates cur) const { AdjacencyList adjacencyList = { .u = validCell({ cur.i - 1, cur.j }, cur), .d = validCell({ cur.i + 1, cur.j }, cur), .l = validCell({ cur.i, cur.j - 1 }, cur), ...
pushq %rbp movq %rsp, %rbp subq $0x60, %rsp movq %rsi, -0xc(%rbp) movq %rdi, -0x18(%rbp) movq -0x18(%rbp), %rdi movq %rdi, -0x60(%rbp) movl -0xc(%rbp), %eax subl $0x1, %eax movl %eax, -0x20(%rbp) movl -0x8(%rbp), %eax movl %eax, -0x1c(%rbp) movq -0xc(%rbp), %rax movq %rax, -0x28(%rbp) movq -0x20(%rbp), %rsi movq -0x28(...
davidjosepha[P]slitherlink/src/generator/loopgen.cpp
LoopGen::validCell(Coordinates, Coordinates) const
bool LoopGen::validCell(Coordinates coords, Coordinates cur) const { bool valid = true; /* check to make sure the cell is within the grid */ if (!inBounds(coords)) { return false; } valid = valid && loop_[coords.i][coords.j] != NOEXP; valid = valid && loop_[coords.i][coords.j] != OUT; ...
pushq %rbp movq %rsp, %rbp subq $0x50, %rsp movq %rsi, -0xc(%rbp) movq %rdx, -0x14(%rbp) movq %rdi, -0x20(%rbp) movq -0x20(%rbp), %rdi movq %rdi, -0x40(%rbp) movb $0x1, -0x21(%rbp) movq -0xc(%rbp), %rax movq %rax, -0x2c(%rbp) movq -0x2c(%rbp), %rsi callq 0x137c0 testb $0x1, %al jne 0x13dae movb $0x0, -0x1(%rbp) jmp 0x1...
davidjosepha[P]slitherlink/src/generator/loopgen.cpp
main
int main(int argc, char * argv[]) { clock_t startTime, endTime; if (argc == 4) { std::istringstream mn(argv[1]); std::istringstream nn(argv[2]); std::istringstream difficn(argv[3]); int m, n; std::string difficstr; assert(mn >> m && mn.eof()); assert(nn >...
pushq %rbp movq %rsp, %rbp subq $0x720, %rsp # imm = 0x720 movl $0x0, -0x4(%rbp) movl %edi, -0x8(%rbp) movq %rsi, -0x10(%rbp) cmpl $0x4, -0x8(%rbp) jne 0x14734 movq -0x10(%rbp), %rax movq 0x8(%rax), %rax movq %rax, -0x6b8(%rbp) leaq -0x1c1(%rbp), %rdi movq %rdi, -0x6b0(%rbp) callq 0x22d0 movq -0x6b8(%rbp), %...
davidjosepha[P]slitherlink/src/generator/main.cpp
unit_test_framework::TestSuite::run_tests(int, char**)
int run_tests(int argc, char** argv) { SetComplete completer(TestSuite::incomplete); std::vector<std::string> test_names_to_run; try { test_names_to_run = get_test_names_to_run(argc, argv); } catch (ExitSuite& e) { return e.status; } for (auto test_name : test_...
pushq %rbp movq %rsp, %rbp subq $0x240, %rsp # imm = 0x240 movq %rdi, -0x10(%rbp) movl %esi, -0x14(%rbp) movq %rdx, -0x20(%rbp) movq -0x10(%rbp), %rax movq %rax, -0x1c0(%rbp) leaq 0xa835(%rip), %rsi # 0xe26d leaq -0x28(%rbp), %rdi callq 0x5220 leaq -0x40(%rbp), %rdi callq 0x5240 movq -0x1c0(%rbp), %rsi ...
eecs280staff[P]unit_test_framework/./unit_test_framework.hpp
void unit_test_framework::Assertions::assert_equal<int, int>(int&&, int&&, int, char const*)
static void assert_equal(First&& first, Second&& second, int line_number, const char* assertion_text) { if (safe_equals<First, Second>::equals(first, second)) { return; } std::ostringstream reason; Diagnostic::print(reason, first)...
pushq %rbp movq %rsp, %rbp subq $0x1e0, %rsp # imm = 0x1E0 movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movl %edx, -0x14(%rbp) movq %rcx, -0x20(%rbp) movq -0x8(%rbp), %rdi movq -0x10(%rbp), %rsi callq 0x4f10 testb $0x1, %al jne 0x4dcd jmp 0x4dd6 addq $0x1e0, %rsp # imm = 0x1E0 popq %rbp retq leaq ...
eecs280staff[P]unit_test_framework/./unit_test_framework.hpp
unit_test_framework::TestSuite::TestSuite()
TestSuite() { auto func = []() { if (TestSuite::incomplete) { std::cout << "ERROR: premature call to exit()" << std::endl; std::abort(); } }; std::atexit(func); #ifdef _GLIBCXX_HAVE_AT_QUICK_EXIT std::at_quick_exit(func); #endif }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x18(%rbp) callq 0x5070 movq -0x18(%rbp), %rax movb $0x0, 0x30(%rax) leaq -0x9(%rbp), %rdi callq 0x5090 movq %rax, %rdi callq 0x8690 leaq -0x9(%rbp), %rdi callq 0x5090 movq %rax, %rdi callq 0x86b0 addq $0x20, %rsp popq %...
eecs280staff[P]unit_test_framework/./unit_test_framework.hpp
unit_test_framework::TestSuite::get_test_names_to_run[abi:cxx11](int, char**)
std::vector<std::string> get_test_names_to_run(int argc, char** argv) { std::vector<std::string> test_names_to_run; #if UNIT_TEST_ENABLE_REGEXP bool regexp_matching = false; #endif for (auto i = 1; i < argc; ++i) { if (argv[i] == std::string("--show_test_names") or argv[i] == std::...
pushq %rbp movq %rsp, %rbp subq $0x2b0, %rsp # imm = 0x2B0 movq %rdi, -0x190(%rbp) movq %rdi, %rax movq %rax, -0x188(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movl %edx, -0x14(%rbp) movq %rcx, -0x20(%rbp) movq -0x10(%rbp), %rax movq %rax, -0x180(%rbp) movb $0x0, -0x21(%rbp) callq 0x5240 movl $0x1, -...
eecs280staff[P]unit_test_framework/./unit_test_framework.hpp
unit_test_framework::TestCase::run(bool)
void run(bool quiet_mode) { try { if (not quiet_mode) { std::cout << "Running test: " << name << std::endl; } test_func(); if (not quiet_mode) { std::cout << "PASS" << std::endl; } } catch (TestFailure& failure) { failure_msg = fail...
pushq %rbp movq %rsp, %rbp subq $0x270, %rsp # imm = 0x270 movb %sil, %al movq %rdi, -0x8(%rbp) andb $0x1, %al movb %al, -0x9(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x210(%rbp) testb $0x1, -0x9(%rbp) jne 0x6278 movq 0x7fd5(%rip), %rdi # 0xdfc8 leaq 0x32a6(%rip), %rsi # 0x92a0 callq 0x3220 movq %ra...
eecs280staff[P]unit_test_framework/./unit_test_framework.hpp
unit_test_framework::TestCase::print(bool)
void print(bool quiet_mode) { if (quiet_mode) { std::cout << name << ": "; } else { std::cout << "** Test case \"" << name << "\": "; } if (not failure_msg.empty()) { std::cout << "FAIL" << std::endl; if (not quiet_mode) { std::cout << failure_msg...
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movb %sil, %al movq %rdi, -0x8(%rbp) andb $0x1, %al movb %al, -0x9(%rbp) movq -0x8(%rbp), %rax movq %rax, -0x18(%rbp) testb $0x1, -0x9(%rbp) je 0x63a3 movq -0x18(%rbp), %rsi movq 0x7c3b(%rip), %rdi # 0xdfc8 callq 0x3210 movq %rax, %rdi leaq 0x2f59(%rip), %rsi # 0x92...
eecs280staff[P]unit_test_framework/./unit_test_framework.hpp
unit_test_framework::Diagnostic::demangle[abi:cxx11](char const*)
static std::string demangle(const char* typeinfo_name) { #if defined(__clang__) || defined(__GLIBCXX__) || defined(__GLIBCPP__) int status = 0; char* demangled = abi::__cxa_demangle(typeinfo_name, nullptr, nullptr, &status); if (status == 0) { std::string result = demangled; st...
pushq %rbp movq %rsp, %rbp subq $0x70, %rsp movq %rdi, -0x48(%rbp) movq %rdi, %rax movq %rax, -0x40(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movl $0x0, -0x14(%rbp) movq -0x10(%rbp), %rdi xorl %eax, %eax movl %eax, %edx leaq -0x14(%rbp), %rcx movq %rdx, %rsi callq 0x31f0 movq %rax, -0x20(%rbp) cmpl $0x0, -0x14...
eecs280staff[P]unit_test_framework/./unit_test_framework.hpp
(anonymous namespace)::async(std::function<void ()> const&)
void async(const function<void()>& f) { const auto p = new function<void()>(f); pthread_t thread; const int r = pthread_create(&thread,0,[](void* arg) { const auto p = (function<void()>*)arg; (*p)(); delete p; return (void*)0; },p); if (r) die(string("Thread creation failed: ")+strerror(r)...
pushq %rbp movq %rsp, %rbp subq $0x90, %rsp movq %rdi, -0x8(%rbp) movl $0x20, %edi callq 0x7610 movq %rax, %rdi movq %rdi, %rax movq %rax, -0x80(%rbp) movq -0x8(%rbp), %rsi callq 0x192a0 jmp 0x9c4e movq -0x80(%rbp), %rax movq %rax, -0x10(%rbp) leaq -0x2d(%rbp), %rdi callq 0xc840 movq %rax, %rdx movq -0x10(%rbp), %rcx l...
ThePhage[P]horse_tornado/fast.cpp
(anonymous namespace)::good_sleep(double)
void good_sleep(const double t) { if (t <= 0) return; const uint64_t b = 1000000000; const uint64_t n(b*t); timespec ts; ts.tv_sec = n/b; ts.tv_nsec = n%b; nanosleep(&ts,0); }
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movsd %xmm0, -0x8(%rbp) xorps %xmm0, %xmm0 ucomisd -0x8(%rbp), %xmm0 jb 0xa089 jmp 0xa0fd movq $0x3b9aca00, -0x10(%rbp) # imm = 0x3B9ACA00 movsd -0x8(%rbp), %xmm0 movsd 0x1df7a(%rip), %xmm1 # 0x28018 mulsd %xmm1, %xmm0 movaps %xmm0, %xmm1 cvttsd2si %xmm1, %rax movq %rax, %...
ThePhage[P]horse_tornado/fast.cpp
(anonymous namespace)::command_output(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
string command_output(const vector<string>& cmd) { int fd[2]; if (pipe(fd) < 0) die("Pipe failed"); const pid_t pid = fork(); if (pid) { // Parent close(fd[1]); string results; char buffer[1024+1]; for (;;) { ssize_t n = read(fd[0],buffer,sizeof(buffer)-1); if (n == 0) br...
pushq %rbp movq %rsp, %rbp subq $0x510, %rsp # imm = 0x510 movq %rdi, -0x4e8(%rbp) movq %rdi, %rax movq %rax, -0x4e0(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) leaq -0x18(%rbp), %rdi callq 0x7800 cmpl $0x0, %eax jge 0xf717 leaq -0x39(%rbp), %rdi movq %rdi, -0x4f0(%rbp) callq 0x79e0 movq -0x4f0(%rbp),...
ThePhage[P]horse_tornado/fast.cpp
(anonymous namespace)::exec(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
__attribute__((noreturn)) void exec(const vector<string>& cmd) { if (cmd.empty()) die("Empty command"); vector<const char*> ps; for (const auto& s : cmd) ps.push_back(s.c_str()); ps.push_back(0); execvp(ps[0],(char**)&ps[0]); die("Command failed: "+join(" ",cmd)+", "+strerror(errno)); }
pushq %rbp movq %rsp, %rbp subq $0x160, %rsp # imm = 0x160 movq %rdi, -0x8(%rbp) movq -0x8(%rbp), %rdi callq 0x258b0 testb $0x1, %al jne 0xf9ae jmp 0xfa13 leaq -0x29(%rbp), %rdi movq %rdi, -0x138(%rbp) callq 0x79e0 movq -0x138(%rbp), %rdx leaq 0x19a43(%rip), %rsi # 0x2940f leaq -0x28(%rbp), %rdi callq 0x...
ThePhage[P]horse_tornado/fast.cpp
(anonymous namespace)::join(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
string join(const string& sep, const vector<string>& args) { string result; for (size_t i=0;i<args.size();i++) { if (i) result += sep; result += args[i]; } return result; }
pushq %rbp movq %rsp, %rbp subq $0x50, %rsp movq %rdi, -0x48(%rbp) movq %rdi, %rax movq %rax, -0x40(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq %rdx, -0x18(%rbp) movb $0x0, -0x19(%rbp) callq 0x7820 movq $0x0, -0x28(%rbp) movq -0x28(%rbp), %rax movq %rax, -0x50(%rbp) movq -0x18(%rbp), %rdi callq 0x26380 movq...
ThePhage[P]horse_tornado/fast.cpp
(anonymous namespace)::run(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
void run(const vector<string>& cmd) { const pid_t pid = fork(); if (pid) { // Parent int status; waitpid(pid,&status,0); if (!WIFEXITED(status) || WEXITSTATUS(status)) exit(1); } else // Child exec(cmd); }
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp movq %rdi, -0x8(%rbp) callq 0x7180 movl %eax, -0xc(%rbp) cmpl $0x0, -0xc(%rbp) je 0xfd7f movl -0xc(%rbp), %edi leaq -0x10(%rbp), %rsi xorl %edx, %edx callq 0x74f0 movl -0x10(%rbp), %eax andl $0x7f, %eax cmpl $0x0, %eax jne 0xfd73 movl -0x10(%rbp), %eax andl $0xff00, %eax ...
ThePhage[P]horse_tornado/fast.cpp
(anonymous namespace)::read_png(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Image read_png(const string& path) { FILE* file = fopen(path.c_str(),"rb"); if (!file) die("Failed to open "+path+" for reading"); png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0); if (!png) die("Error reading png file "+path); png_infop info = png_create_info_struct(png); if (!...
pushq %rbp movq %rsp, %rbp subq $0x180, %rsp # imm = 0x180 movq %rdi, -0x120(%rbp) movq %rdi, %rax movq %rax, -0x118(%rbp) movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movq -0x10(%rbp), %rdi callq 0x7240 movq %rax, %rdi leaq 0x1970e(%rip), %rsi # 0x294d5 callq 0x7730 movq %rax, -0x18(%rbp) cmpq $0x0, -0x...
ThePhage[P]horse_tornado/fast.cpp
label_of_function[abi:cxx11](Obj*)
string *label_of_function(Obj *f) { string *label = new string(); label->append(f->name->c_str()); label->append("_"); Obj *last = f->locals; while (last != NULL) { label->append("@"); Struct *last_type = last->type; while (last_type->kind == Struct::Pointer || last_t...
pushq %rbp movq %rsp, %rbp subq $0x120, %rsp # imm = 0x120 movq %rdi, -0x8(%rbp) movl $0x20, %edi callq 0x62e0 movq %rax, %rdi movq %rdi, -0xc8(%rbp) callq 0x6430 movq -0xc8(%rbp), %rax movq %rax, -0x10(%rbp) movq -0x10(%rbp), %rax movq %rax, -0xc0(%rbp) movq -0x8(%rbp), %rax movq 0x8(%rax), %rdi callq 0x612...
Davidc2525[P]Leaf/main.cpp
prepare_default_conf()
void prepare_default_conf() { LEAF::CONF::Conf &conf = LEAF::CONF::ConfManager::get(); //generator conf.set<char *>("leaf.compiler.generator.outfile", "test/leaf.asm"); //sections; grupo: leaf.compiler.asm.section. conf.set<bool>("leaf.compiler.asm.section.show_title", true); //general conf.se...
pushq %rbp movq %rsp, %rbp subq $0x10, %rsp callq 0xe860 movq %rax, -0x8(%rbp) movq -0x8(%rbp), %rdi leaq 0x2979a(%rip), %rsi # 0x34036 leaq 0x297b3(%rip), %rdx # 0x34056 callq 0xaf70 movq -0x8(%rbp), %rdi leaq 0x297b1(%rip), %rsi # 0x34064 movl $0x1, %edx callq 0xafa0 movq -0x8(%rbp), %rdi leaq 0x297c1(%ri...
Davidc2525[P]Leaf/main.cpp
main
int main(int argc, char **argv) { //prepare default global configuration prepare_default_conf(); /*if(argc<2){ log("falta el archivo de programa",1) } string filename(args[1]); Scanner * s = new Scanner((const unsigned char *)filename.c_str(),filename.length()); Parser * p = new P...
pushq %rbp movq %rsp, %rbp subq $0xe0, %rsp movl $0x0, -0x4(%rbp) movl %edi, -0x8(%rbp) movq %rsi, -0x10(%rbp) callq 0xa880 callq 0x21500 movq %rax, -0x78(%rbp) movl $0x38, %edi callq 0x62e0 movq %rax, %rdi movq %rdi, %rax movq %rax, -0x70(%rbp) callq 0x248c0 jmp 0xa972 movq -0x70(%rbp), %rsi movq -0x78(%rbp), %rdi cal...
Davidc2525[P]Leaf/main.cpp
LEAF::AST::BinOp::BinOp(LEAF::AST::NODEU*, LEAF::AST::op_types, LEAF::AST::NODEU*)
BinOp::BinOp(ASTU l, op_types op, ASTU r) { this->l = l; this->r = r; this->op = op; //obj->type=left->obj->type; this->obj->type = l->obj->type; //TODO: codigo para la coercion de tipos aritmeticos }
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movl %edx, -0x14(%rbp) movq %rcx, -0x20(%rbp) movq -0x8(%rbp), %rdi movq %rdi, -0x28(%rbp) callq 0xc020 movq -0x28(%rbp), %rax leaq 0x3c939(%rip), %rcx # 0x489c8 addq $0x10, %rcx movq %rcx, (%rax) movq -0x10(%rbp), %rcx movq %r...
Davidc2525[P]Leaf/ast/expressions.cpp
LEAF::AST::rand_label::newLabel[abi:cxx11](int)
static string *newLabel(int size) { char *r = (char *)malloc(sizeof(char) * size + 2); r[0] = '_'; string tokens("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_"); for (int x = 1; x < size-1; x++) { r[x] = tokens[rand() % 63]; } ...
pushq %rbp movq %rsp, %rbp subq $0x80, %rsp movl %edi, -0x4(%rbp) movslq -0x4(%rbp), %rdi addq $0x2, %rdi callq 0x6420 movq %rax, -0x10(%rbp) movq -0x10(%rbp), %rax movb $0x5f, (%rax) leaq -0x31(%rbp), %rdi movq %rdi, -0x58(%rbp) callq 0x6500 movq -0x58(%rbp), %rdx leaq 0x2795b(%rip), %rsi # 0x34279 leaq -0x30(%rbp...
Davidc2525[P]Leaf/ast/statement.hpp
coco_string_create(wchar_t const*, int)
wchar_t* coco_string_create(const wchar_t *value, int startIndex) { int valueLen = 0; int len = 0; if (value) { valueLen = wcslen(value); len = valueLen - startIndex; } return coco_string_create(value, startIndex, len); }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movl $0x0, -0x10(%rbp) movl $0x0, -0x14(%rbp) cmpq $0x0, -0x8(%rbp) je 0xeb89 movq -0x8(%rbp), %rdi callq 0x6250 movl %eax, -0x10(%rbp) movl -0x10(%rbp), %eax subl -0xc(%rbp), %eax movl %eax, -0x14(%rbp) movq -0x8(%rbp), %rdi movl -...
Davidc2525[P]Leaf/parser/Scanner.cpp
coco_string_create(wchar_t const*, int, int)
wchar_t* coco_string_create(const wchar_t *value, int startIndex, int length) { int len = 0; wchar_t* data; if (value) { len = length; } data = new wchar_t[len + 1]; wcsncpy(data, &(value[startIndex]), len); data[len] = 0; return data; }
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movl %esi, -0xc(%rbp) movl %edx, -0x10(%rbp) movl $0x0, -0x14(%rbp) cmpq $0x0, -0x8(%rbp) je 0xebc6 movl -0x10(%rbp), %eax movl %eax, -0x14(%rbp) movl -0x14(%rbp), %eax addl $0x1, %eax cltq movl $0x4, %ecx mulq %rcx movq %rax, %rdi seto %cl movq $-0x1, %...
Davidc2525[P]Leaf/parser/Scanner.cpp
coco_string_create_upper(wchar_t const*)
wchar_t* coco_string_create_upper(const wchar_t* data) { if (!data) { return NULL; } int dataLen = 0; if (data) { dataLen = wcslen(data); } wchar_t *newData = new wchar_t[dataLen + 1]; for (int i = 0; i <= dataLen; i++) { if ((L'a' <= data[i]) && (data[i] <= L'z')) { newData[i] = data[i] + (L'A' - L'a'); ...
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x10(%rbp) cmpq $0x0, -0x10(%rbp) jne 0xec50 movq $0x0, -0x8(%rbp) jmp 0xed1b movl $0x0, -0x14(%rbp) cmpq $0x0, -0x10(%rbp) je 0xec6a movq -0x10(%rbp), %rdi callq 0x6250 movl %eax, -0x14(%rbp) movl -0x14(%rbp), %eax addl $0x1, %eax cltq movl $0x4, %ecx mulq %rcx m...
Davidc2525[P]Leaf/parser/Scanner.cpp
coco_string_create_lower(wchar_t const*, int, int)
wchar_t* coco_string_create_lower(const wchar_t* data, int startIndex, int dataLen) { if (!data) { return NULL; } wchar_t* newData = new wchar_t[dataLen + 1]; for (int i = 0; i <= dataLen; i++) { wchar_t ch = data[startIndex + i]; if ((L'A' <= ch) && (ch <= L'Z')) { newData[i] = ch - (L'A' - L'a'); } el...
pushq %rbp movq %rsp, %rbp subq $0x30, %rsp movq %rdi, -0x10(%rbp) movl %esi, -0x14(%rbp) movl %edx, -0x18(%rbp) cmpq $0x0, -0x10(%rbp) jne 0xeda6 movq $0x0, -0x8(%rbp) jmp 0xee4a movl -0x18(%rbp), %eax addl $0x1, %eax cltq movl $0x4, %ecx mulq %rcx movq %rax, %rdi seto %cl movq $-0x1, %rax testb $0x1, %cl cmovneq %rax...
Davidc2525[P]Leaf/parser/Scanner.cpp
coco_string_create_append(wchar_t const*, wchar_t const*)
wchar_t* coco_string_create_append(const wchar_t* data1, const wchar_t* data2) { wchar_t* data; int data1Len = 0; int data2Len = 0; if (data1) { data1Len = wcslen(data1); } if (data2) {data2Len = wcslen(data2); } data = new wchar_t[data1Len + data2Len + 1]; if (data1) { wcscpy(data, data1); } if (data2) { wc...
pushq %rbp movq %rsp, %rbp subq $0x20, %rsp movq %rdi, -0x8(%rbp) movq %rsi, -0x10(%rbp) movl $0x0, -0x1c(%rbp) movl $0x0, -0x20(%rbp) cmpq $0x0, -0x8(%rbp) je 0xee91 movq -0x8(%rbp), %rdi callq 0x6250 movl %eax, -0x1c(%rbp) cmpq $0x0, -0x10(%rbp) je 0xeea4 movq -0x10(%rbp), %rdi callq 0x6250 movl %eax, -0x20(%rbp) mov...
Davidc2525[P]Leaf/parser/Scanner.cpp