LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/solver/solver.cpp
// Function: Solver::testContradictions() const
bool Solver::testContradictions() const {
    if (grid_->containsClosedContours() && !grid_->isSolved()) {
        return true;
    }
    for (int i = 0; i < grid_->getHeight(); i++) {
        for (int j = 0; j < grid_->getWidth(); j++) {
            if (grid_->getContraMatrix(i,j)) {
                for (int x = 0; x < NUM_CONTRADICTIONS; x++) {
                    for (Orientation orient: (Orientation[]){ UP, DOWN, LEFT, RIGHT, UPFLIP, DOWNFLIP, LEFTFLIP, RIGHTFLIP }) {
                        if (contradictionApplies(i, j, contradictions_[x], orient)) {
                            return true;
                        }
                    }
                }
                grid_->setContraMatrix(i, j, false);
            }
        }
    }

    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x32da
testb %al, %al
je 0x65ed
movq 0x8(%rbx), %rdi
callq 0x3280
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
je 0x6688
movq 0x8(%rbx), %rax
xorl %r14d, %r14d
movslq 0xc(%rax), %rcx
cmpq %rcx, %r14
jge 0x6697
xorl %r15d, %r15d
movslq 0x10(%rax), %rcx
cmpq %rcx, %r15
jge 0x667e
movq 0x38(%rax), %rcx
movq (%rcx,%r14,8), %rcx
cmpb $0x1, (%rcx,%r15)
jne 0x6679
xorl %eax, %eax
cmpq $0xb, %rax
je 0x6668
movq %rax, -0x30(%rbp)
imulq $0x50, %rax, %r13
xorl %r12d, %r12d
cmpq $0x20, %r12
je 0x665f
leaq 0x3f68(%rip), %rax      # 0xa5a4
movl (%r12,%rax), %r8d
movq 0x30(%rbx), %rcx
addq %r13, %rcx
movq %rbx, %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x669c
addq $0x4, %r12
testb %al, %al
je 0x662f
jmp 0x6686
movq -0x30(%rbp), %rax
incq %rax
jmp 0x661e
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rcx
movq (%rcx,%r14,8), %rcx
movb $0x0, (%rcx,%r15)
incq %r15
jmp 0x6604
incq %r14
jmp 0x65f4
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x6688
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/solver/solver.cpp
// Function: Solver::solveDepth(int)
void Solver::solveDepth(int depth) {
    bool usingPrioQueue = true;

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

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

            PrioEdge pe = epq_.top();

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x38(%rdi), %r15
movq %r15, %rdi
callq 0x4870
xorl %r13d, %r13d
testl %eax, %eax
cmovgl %eax, %r13d
leaq -0x40(%rbp), %r12
movq %r15, %rdi
callq 0x485e
testb %al, %al
jne 0x69e2
subl $0x1, %r13d
jb 0x69e2
cmpb $0x0, 0x64(%r14)
jne 0x69e2
movq %r12, %rdi
movq %r15, %rsi
callq 0x488e
movl -0x40(%rbp), %esi
movl -0x3c(%rbp), %edx
cmpb $0x1, -0x30(%rbp)
jne 0x6983
movq %r14, %rdi
movl %ebx, %ecx
callq 0x6ce4
movq 0x8(%r14), %rdi
movl -0x40(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x3baa
testl %eax, %eax
jne 0x6977
movsd -0x38(%rbp), %xmm0
addsd 0x3a9f(%rip), %xmm0     # 0xa3f8
movsd %xmm0, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x40(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0x48aa
movq 0x8(%r14), %rax
cmpb $0x0, 0x9(%rax)
je 0x69d5
jmp 0x69e2
movq %r14, %rdi
movl %ebx, %ecx
callq 0x7282
movq 0x8(%r14), %rdi
movl -0x40(%rbp), %esi
movl -0x3c(%rbp), %edx
callq 0x3bee
testl %eax, %eax
jne 0x69cb
movsd -0x38(%rbp), %xmm0
addsd 0x3a4b(%rip), %xmm0     # 0xa3f8
movsd %xmm0, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x40(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0x48aa
movq 0x8(%r14), %rax
cmpb $0x1, 0x9(%rax)
je 0x69e2
movq %r15, %rdi
callq 0x48be
jmp 0x68f3
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: Generator::Generator(int, int, Difficulty)
Generator::Generator(int m, int n, Difficulty difficulty) {
    m_ = m;
    n_ = n;

    numberCount_ = m_*n_;

    buffer_ = 0;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r13d
movq %rdi, %r14
leaq 0x48(%rdi), %rbx
movw $0x100, %ax             # imm = 0x100
movw %ax, 0x50(%rdi)
leaq 0x6d55(%rip), %rcx      # 0xed40
addq $0x10, %rcx
movq %rcx, 0x48(%rdi)
movw $0x1, %di
movw %di, 0x90(%r14)
leaq 0xa0(%r14), %r15
movw %ax, 0xa8(%r14)
movq %rcx, 0xa0(%r14)
movw %di, 0xe8(%r14)
leaq 0xf8(%r14), %r12
xorps %xmm0, %xmm0
movups %xmm0, 0xf8(%r14)
movups %xmm0, 0x108(%r14)
movups %xmm0, 0x118(%r14)
movl %esi, (%r14)
movl %edx, 0x4(%r14)
imull %esi, %edx
movl %edx, 0x18(%r14)
andl $0x0, 0x20(%r14)
xorl %edi, %edi
callq 0x2170
movl %eax, %edi
callq 0x2190
movq %r14, %rdi
movl %r13d, %esi
callq 0x80c4
movq %r14, %rdi
callq 0x8104
movq %r14, %rdi
callq 0x8172
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x81ac
movq %rax, %r13
addq $0x110, %r14            # imm = 0x110
movq %r14, %rdi
callq 0x8ec2
movq %r12, %rdi
callq 0x8ec2
movq %r15, %rdi
callq 0x2750
movq %rbx, %rdi
callq 0x2750
movq %r13, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: Generator::createPuzzle()
void Generator::createPuzzle() {
    smallestCount_ = numberCount_;
    bufferReachCount_ = 0;
    Import importer = Import(grid_, m_, n_);
    LoopGen loopgen = LoopGen(m_, n_, grid_);

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

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

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x84d4
movq %rbx, %rdi
callq 0x8680
movq 0x6e49(%rip), %rdi      # 0xefd8
callq 0x20e0
leaq 0x48(%rbx), %rdi
callq 0x2802
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x8680
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: Generator::destroyArrays()
void Generator::destroyArrays() {
    for (int i = 0; i < m_; i++) {
        delete [] canEliminate_[i];
        delete [] oldNumbers_[i];
    }
    delete [] canEliminate_;
    delete [] oldNumbers_;
    delete [] selectedRules_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movslq (%rbx), %rax
movq 0x138(%rbx), %rdi
cmpq %rax, %r14
jge 0x81f0
movq (%rdi,%r14,8), %rdi
testq %rdi, %rdi
je 0x81d6
callq 0x21e0
movq 0x140(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x81eb
callq 0x21e0
incq %r14
jmp 0x81b9
testq %rdi, %rdi
je 0x81fa
callq 0x21e0
movq 0x140(%rbx), %rdi
testq %rdi, %rdi
je 0x820b
callq 0x21e0
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x821d
popq %rbx
popq %r14
popq %rbp
jmp 0x21e0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: Generator::setRules(Difficulty)
void Generator::setRules(Difficulty difficulty) {
    if (difficulty == EASY) {
        numberOfRules_ = sizeof((int [])EASY_RULES) / sizeof(int);
        selectedRules_ = new int[numberOfRules_];

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x825d
movl $0x15, 0x40(%rbx)
pushq $0x54
popq %rdi
callq 0x2030
movq %rax, 0x38(%rbx)
xorl %ecx, %ecx
leaq 0x2415(%rip), %rdx      # 0xa660
cmpq $0x54, %rcx
je 0x828b
movl (%rcx,%rdx), %esi
movl %esi, (%rax,%rcx)
addq $0x4, %rcx
jmp 0x824b
movl $0xc, 0x40(%rbx)
pushq $0x30
popq %rdi
callq 0x2030
movq %rax, 0x38(%rbx)
xorl %ecx, %ecx
leaq 0x23b7(%rip), %rdx      # 0xa630
cmpq $0x30, %rcx
je 0x828b
movl (%rcx,%rdx), %esi
movl %esi, (%rax,%rcx)
addq $0x4, %rcx
jmp 0x8279
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: Generator::initArrays()
void Generator::initArrays() {
    canEliminate_ = new bool*[m_];
    oldNumbers_ = new Number*[m_];
    for (int i = 0; i < m_; i++) {
        canEliminate_[i] = new bool[n_];
        oldNumbers_[i] = new Number[n_];

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movslq (%rdi), %r12
leaq (,%r12,8), %r14
testq %r12, %r12
pushq $-0x1
popq %rax
cmovsq %rax, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x138(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x140(%rbx)
leaq 0x48(%rbx), %rax
movq %rax, -0x38(%rbp)
xorl %r15d, %r15d
movslq %r12d, %rax
cmpq %rax, %r15
jge 0x838f
movslq 0x4(%rbx), %r14
testl %r14d, %r14d
pushq $-0x1
popq %rax
cmovnsl %r14d, %eax
movslq %eax, %rdi
callq 0x2030
leaq (,%r14,4), %rdi
testq %r14, %r14
movq 0x138(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
pushq $-0x1
popq %rax
cmovsq %rax, %rdi
callq 0x2030
movq 0x140(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
leaq 0x1(%r15), %rax
movq %rax, -0x30(%rbp)
xorl %r12d, %r12d
movslq %r14d, %rax
cmpq %rax, %r12
jge 0x8383
movq 0x138(%rbx), %rax
movq (%rax,%r15,8), %rax
movb $0x1, (%rax,%r12)
leaq 0x1(%r12), %r13
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl %r13d, %edx
callq 0x3b66
movq 0x140(%rbx), %rcx
movq (%rcx,%r15,8), %rcx
movl %eax, (%rcx,%r12,4)
movl 0x4(%rbx), %r14d
movq %r13, %r12
jmp 0x833e
movl (%rbx), %r12d
movq -0x30(%rbp), %r15
jmp 0x82e4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: 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);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x48(%rdi), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
pushq $0x1
popq %r13
movl %r13d, %r15d
cmpl (%rbx), %r15d
jg 0x83f1
movl %r13d, %r12d
cmpl 0x4(%rbx), %r12d
jg 0x83ec
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x3b66
movq %rbx, %rdi
movl %eax, %esi
callq 0x86a6
incl %r12d
jmp 0x83c9
incl %r15d
jmp 0x83c1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: 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_) {
            smallestCount_ = numberCount_;
            grid_.clearAndCopy(smallestCountGrid_);
            buffer_ = (numberCount_ + (m_*n_))/2 - 2;
        }

        if (numberCount_ == buffer_) {
            bufferReachCount_ ++;
        }

        /* If the count has past the buffer three times,
         * return the grid with the smallest count of
         * of numbers that is currently known. */
        if (bufferReachCount_ == 3) {
            smallestCountGrid_.clearAndCopy(grid_);
            break;
        }

        findNumberToRemove();
        eligibleCoordinates_.clear();

        grid_.resetGrid();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
leaq 0x48(%rdi), %rbx
leaq 0xa0(%rdi), %r15
pushq $0x2
popq %r12
movl 0x4(%r14), %eax
movl 0x18(%r14), %ecx
cvtsi2sd %ecx, %xmm0
imull (%r14), %eax
cvtsi2sd %eax, %xmm1
mulsd 0x10(%r14), %xmm1
addsd 0x2199(%rip), %xmm1     # 0xa5d8
ucomisd %xmm1, %xmm0
jbe 0x84b8
cmpl %ecx, 0x1c(%r14)
jle 0x8475
movl %ecx, 0x1c(%r14)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2c02
movl 0x4(%r14), %eax
imull (%r14), %eax
movl 0x18(%r14), %ecx
addl %ecx, %eax
cltd
idivl %r12d
addl $-0x2, %eax
movl %eax, 0x20(%r14)
jmp 0x8479
movl 0x20(%r14), %eax
movl 0x24(%r14), %edx
cmpl %eax, %ecx
jne 0x8487
incl %edx
movl %edx, 0x24(%r14)
cmpl $0x3, %edx
je 0x84c1
movq %r14, %rdi
callq 0x8706
movq 0xf8(%r14), %rax
cmpq %rax, 0x100(%r14)
je 0x84ab
movq %rax, 0x100(%r14)
movq %rbx, %rdi
callq 0x2802
jmp 0x841d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2c02
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: 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 (grid_.isSolved()) {
        return true;
    } else {
        return false;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x1470, %rsp           # imm = 0x1470
movq %rdi, %rbx
pushq $0x8
popq %rax
xorps %xmm0, %xmm0
movups %xmm0, -0x1410(%rbp,%rax)
movups %xmm0, -0x1420(%rbp,%rax)
movups %xmm0, -0x1430(%rbp,%rax)
movups %xmm0, -0x1440(%rbp,%rax)
movups %xmm0, -0x1450(%rbp,%rax)
andq $0x0, -0x1400(%rbp,%rax)
movups %xmm0, -0x1460(%rbp,%rax)
movups %xmm0, -0x1470(%rbp,%rax)
subq $-0x80, %rax
cmpq $0x1088, %rax           # imm = 0x1088
jne 0x84eb
leaq -0x1470(%rbp), %rdi
callq 0x516c
pushq $0x8
popq %rax
xorps %xmm0, %xmm0
movups %xmm0, -0x3c0(%rbp,%rax)
movups %xmm0, -0x3d0(%rbp,%rax)
andq $0x0, -0x3b0(%rbp,%rax)
movups %xmm0, -0x3e0(%rbp,%rax)
movups %xmm0, -0x3f0(%rbp,%rax)
addq $0x50, %rax
cmpq $0x378, %rax            # imm = 0x378
jne 0x854a
leaq -0x3f0(%rbp), %rdi
callq 0x3d84
leaq 0x48(%rbx), %r14
movq %r14, %rdi
callq 0x2802
movq 0x38(%rbx), %r8
movl 0x40(%rbx), %r9d
movl 0x8(%rbx), %eax
movl %eax, (%rsp)
leaq -0x78(%rbp), %rdi
leaq -0x1470(%rbp), %rdx
leaq -0x3f0(%rbp), %rcx
movq %r14, %rsi
callq 0x627c
movq %r14, %rdi
callq 0x3280
movl %eax, %ebx
leaq -0x38(%rbp), %rdi
callq 0x4b4a
movl $0x320, %r14d           # imm = 0x320
leaq (%r14,%rbp), %rdi
addq $-0x3f0, %rdi           # imm = 0xFC10
callq 0x4210
addq $-0x50, %r14
cmpq $-0x50, %r14
jne 0x85d8
movl $0x1000, %r14d          # imm = 0x1000
leaq (%r14,%rbp), %rdi
addq $-0x1470, %rdi          # imm = 0xEB90
callq 0x617e
addq $-0x80, %r14
cmpq $-0x80, %r14
jne 0x85f8
movl %ebx, %eax
addq $0x1470, %rsp           # imm = 0x1470
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x4b4a
jmp 0x8638
jmp 0x8635
movq %rax, %rbx
jmp 0x8658
movq %rax, %rbx
movl $0x320, %r14d           # imm = 0x320
leaq (%r14,%rbp), %rdi
addq $-0x3f0, %rdi           # imm = 0xFC10
callq 0x4210
addq $-0x50, %r14
cmpq $-0x50, %r14
jne 0x863e
movl $0x1000, %r14d          # imm = 0x1000
leaq (%r14,%rbp), %rdi
addq $-0x1470, %rdi          # imm = 0xEB90
callq 0x617e
addq $-0x80, %r14
cmpq $-0x80, %r14
jne 0x865e
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: 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_ ++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
decl %esi
cmpl $0x3, %esi
ja 0x86d3
leaq 0x1f48(%rip), %rax      # 0xa600
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
incl 0x28(%rdi)
jmp 0x86d3
incl 0x30(%rdi)
jmp 0x86d3
incl 0x34(%rdi)
jmp 0x86d3
incl 0x2c(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: 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(eligibleCoordinates_.begin() + random);

        // Checks if the number in question is needed to retain a balance
        if (isBalanced(attempt.i, attempt.j)) {
            removeNumber(attempt.i, attempt.j);

            // If unsolvable, bring number back and look for another
            if (!checkIfSolved()) {
                setOldNumber(attempt.i, attempt.j);
                markNecessary(attempt.i, attempt.j);
            } else {
                ineligibleCoordinates_.push_back(attempt);
                coordsFound = true;
                numberCount_ --;
                minusCounts(oldNumbers_[attempt.i-1][attempt.j-1]);
            }
        }
    }

    // If no more candidates, bring back the previously removed number
    if (!coordsFound && numberCount_ < m_ * n_) {
        getNecessaryCoordinate();
        numberCount_ ++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x8852
leaq 0xf8(%rbx), %r14
leaq 0x110(%rbx), %r15
xorl %r12d, %r12d
movq 0xf8(%rbx), %rax
cmpq 0x100(%rbx), %rax
je 0x8826
testb $0x1, %r12b
jne 0x8826
callq 0x2080
movq 0x100(%rbx), %rcx
subq 0xf8(%rbx), %rcx
cltq
sarq $0x3, %rcx
xorl %r12d, %r12d
xorl %edx, %edx
divq %rcx
movslq %edx, %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x8e42
movq (%rax), %rax
movq %rax, -0x30(%rbp)
shlq $0x3, %r13
addq 0xf8(%rbx), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x8e64
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
movq %rbx, %rdi
callq 0x88c0
testb %al, %al
je 0x872d
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
movq %rbx, %rdi
callq 0x89c4
movq %rbx, %rdi
callq 0x84d4
testb %al, %al
je 0x87fa
movq %r15, %rdi
leaq -0x30(%rbp), %rsi
callq 0x8e9e
decl 0x18(%rbx)
movq 0x140(%rbx), %rax
movslq -0x30(%rbp), %rcx
movq -0x8(%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movl -0x4(%rax,%rcx,4), %esi
movq %rbx, %rdi
callq 0x86d6
movb $0x1, %r12b
jmp 0x872d
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
movq %rbx, %rdi
callq 0x8a18
movslq -0x30(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq 0x138(%rbx), %rdx
movq -0x8(%rdx,%rax,8), %rax
movb $0x0, -0x1(%rax,%rcx)
jmp 0x872a
testb $0x1, %r12b
jne 0x8842
movl 0x4(%rbx), %eax
imull (%rbx), %eax
cmpl %eax, 0x18(%rbx)
jge 0x8842
movq %rbx, %rdi
callq 0x8a5a
incl 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: 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);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xf8(%rdi), %r14
pushq $0x1
popq %r12
leaq -0x30(%rbp), %r15
cmpl (%rbx), %r12d
jg 0x88b0
pushq $0x1
popq %r13
cmpl 0x4(%rbx), %r13d
jg 0x88ab
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x8b1e
testb %al, %al
je 0x88a6
movl %r12d, -0x30(%rbp)
movl %r13d, -0x2c(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x8e9e
incl %r13d
jmp 0x887b
incl %r12d
jmp 0x8872
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: 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*threeCount_);
    } else if (num == ONE) {
        return (oneCount_*3*moa >= 2*threeCount_ & oneCount_*5*moa >= 2*twoCount_);
    } else {
        return false;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x48, %rdi
callq 0x3b66
cmpl $0x2, %eax
je 0x8975
cmpl $0x3, %eax
je 0x892e
cmpl $0x4, %eax
jne 0x89b9
movl 0x34(%rbx), %eax
leal (%rax,%rax), %ecx
cvtsi2ss %ecx, %xmm0
imull $0x3, 0x2c(%rbx), %ecx
cvtsi2ss %ecx, %xmm1
leal (%rax,%rax,4), %eax
cvtsi2ss %eax, %xmm2
movss 0x1daa(%rip), %xmm3     # 0xa6b4
mulss %xmm3, %xmm0
imull $0x3, 0x30(%rbx), %eax
cmpleps %xmm0, %xmm1
cvtsi2ss %eax, %xmm0
mulss %xmm3, %xmm2
cmpleps %xmm2, %xmm0
andps %xmm1, %xmm0
movd %xmm0, %eax
jmp 0x89bb
movl 0x30(%rbx), %eax
cvtsi2sd %eax, %xmm0
mulsd 0x1ca3(%rip), %xmm0     # 0xa5e0
addsd 0x1abb(%rip), %xmm0     # 0xa400
imull $0x5, 0x2c(%rbx), %ecx
cvtsi2sd %ecx, %xmm1
ucomisd %xmm1, %xmm0
setae %cl
leal (%rax,%rax,2), %eax
cvtsi2ss %eax, %xmm0
mulss 0x1d51(%rip), %xmm0     # 0xa6b4
imull $0x5, 0x34(%rbx), %eax
cvtsi2ss %eax, %xmm1
ucomiss %xmm1, %xmm0
setae %al
andb %cl, %al
jmp 0x89bb
movl 0x2c(%rbx), %eax
movl 0x30(%rbx), %ecx
leal (%rax,%rax,2), %edx
cvtsi2ss %edx, %xmm0
movss 0x1d2a(%rip), %xmm1     # 0xa6b4
mulss %xmm1, %xmm0
movl 0x34(%rbx), %edx
addl %edx, %edx
cvtsi2ss %edx, %xmm2
cmpleps %xmm0, %xmm2
leal (%rax,%rax,4), %eax
cvtsi2ss %eax, %xmm0
addl %ecx, %ecx
cvtsi2ss %ecx, %xmm3
mulss %xmm1, %xmm0
cmpleps %xmm0, %xmm3
andps %xmm2, %xmm3
movd %xmm3, %eax
jmp 0x89bb
xorl %eax, %eax
andb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: 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);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
leaq 0x48(%rdi), %r12
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x3c62
movq %r12, %rdi
callq 0x2802
leaq -0x28(%rbp), %rsi
movl %r14d, (%rsi)
movl %ebx, 0x4(%rsi)
addq $0x110, %r15            # imm = 0x110
movq %r15, %rdi
callq 0x8e9e
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: 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);
            ineligibleCoordinates_.push_back(popped);
            plusCounts(grid_.getNumber(popped.i, popped.j));
            found = true;
        } else {
            ineligibleCoordinates_.pop_back();
            markEligible(popped.i, popped.j);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x48(%rdi), %r14
leaq 0x110(%rdi), %r15
leaq -0x30(%rbp), %r12
movq 0x118(%rbx), %rax
movq -0x8(%rax), %rsi
movq %rsi, -0x30(%rbp)
movq %rsi, %rdx
shrq $0x20, %rdx
movq %r14, %rdi
callq 0x3b66
movl %eax, %r13d
testl %eax, %eax
je 0x8ac2
addq $-0x8, 0x118(%rbx)
movslq -0x30(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq 0x138(%rbx), %rdx
movq -0x8(%rdx,%rax,8), %rax
movb $0x1, -0x1(%rax,%rcx)
jmp 0x8b06
movslq -0x30(%rbp), %rsi
movslq -0x2c(%rbp), %rdx
movq 0x138(%rbx), %rax
movq -0x8(%rax,%rsi,8), %rax
movb $0x0, -0x1(%rax,%rdx)
movq %rbx, %rdi
callq 0x8a18
movq %r15, %rdi
movq %r12, %rsi
callq 0x8e9e
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
movq %r14, %rdi
callq 0x3b66
movq %rbx, %rdi
movl %eax, %esi
callq 0x86a6
testl %r13d, %r13d
jne 0x8a7a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: 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;
            j = rand() % (n_) + 1;
            oldNum = grid_.getNumber(i, j);
            if (isBalanced(i, j, oldNum)) {
                break;
            }
            count2 ++;
            if (count2 > n_+m_) {
                if (eligible(i,j) or oldNum == NONE) {
                    count+= (m_+n_)/2;
                    break;
                }
            }
        }
        eliminateNumber(i, j);
        //exporter.print();

        // TODO: maybe modify selected rules

        Solver solver = Solver(grid_, rules_, contradictions_, selectedRules_, NUM_RULES - NUM_CONST_RULES, 1);
        if (!grid_.isSolved()) {
            grid_.setNumber(i, j, oldNum);
        } else {
            minusCounts(oldNum);
        }
        grid_.resetGrid();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
callq 0x839e
callq 0x2080
cltd
idivl (%rbx)
leal 0x1(%rdx), %r15d
callq 0x2080
cltd
idivl 0x4(%rbx)
incl %edx
leaq 0x48(%rbx), %rdi
movq %rdi, -0x38(%rbp)
movl %r15d, %esi
callq 0x3b66
xorl %ecx, %ecx
movl (%rbx), %eax
imull 0x4(%rbx), %eax
addl %eax, %eax
cltd
pushq $0x3
popq %rsi
idivl %esi
addl $0xa, %eax
cmpl %eax, %ecx
jge 0x8d1a
incl %ecx
movl %ecx, -0x2c(%rbp)
xorl %r14d, %r14d
callq 0x2080
cltd
idivl (%rbx)
movl %edx, %r15d
incl %r15d
callq 0x2080
cltd
idivl 0x4(%rbx)
movl %edx, %r12d
incl %r12d
movq -0x38(%rbp), %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x3b66
movl %eax, %r13d
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq 0x8d40
testb %al, %al
jne 0x8c97
movl (%rbx), %eax
addl 0x4(%rbx), %eax
cmpl %eax, %r14d
jl 0x8c84
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x8b1e
testl %r13d, %r13d
je 0x8c89
testb %al, %al
jne 0x8c89
incl %r14d
jmp 0x8c20
movl 0x4(%rbx), %eax
addl (%rbx), %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
addl %eax, -0x2c(%rbp)
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x8b70
movq 0x38(%rbx), %r8
movq 0x128(%rbx), %rdx
movq 0x130(%rbx), %rcx
movl $0x1, (%rsp)
leaq -0xa0(%rbp), %rdi
movq -0x38(%rbp), %r14
movq %r14, %rsi
pushq $0x1e
popq %r9
callq 0x627c
movq %r14, %rdi
callq 0x3280
testb %al, %al
je 0x8cee
movq %rbx, %rdi
movl %r13d, %esi
callq 0x86d6
jmp 0x8d00
movq -0x38(%rbp), %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %r13d, %ecx
callq 0x3c62
movq -0x38(%rbp), %rdi
callq 0x2802
leaq -0x60(%rbp), %rdi
callq 0x4b4a
movl -0x2c(%rbp), %ecx
jmp 0x8bff
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x4b4a
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/generator.cpp
// Function: 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 > 2*threeCount_ & oneCount_*5.2+1 > 2*twoCount_);
        } if (num == TWO) {
            return (twoCount_*2.1+1 > 5*oneCount_ & twoCount_*3.1+1 > 5*threeCount_);
        }
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %ecx, %r14d
movq %rdi, %rbx
callq 0x8b1e
testb %al, %al
je 0x8d76
decl %r14d
cmpl $0x3, %r14d
ja 0x8d76
leaq 0x18ba(%rip), %rax      # 0xa620
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movb $0x1, %al
jmp 0x8e3a
xorl %eax, %eax
jmp 0x8e3a
cvtsi2sdl 0x30(%rbx), %xmm0
movsd 0x1856(%rip), %xmm1     # 0xa5e0
mulsd %xmm0, %xmm1
movsd 0x166a(%rip), %xmm2     # 0xa400
imull $0x5, 0x2c(%rbx), %eax
cvtsi2sd %eax, %xmm3
addsd %xmm2, %xmm1
cmpltpd %xmm1, %xmm3
mulsd 0x1839(%rip), %xmm0     # 0xa5e8
imull $0x5, 0x34(%rbx), %eax
jmp 0x8e25
cvtsi2sdl 0x34(%rbx), %xmm0
movsd 0x181e(%rip), %xmm1     # 0xa5e0
mulsd %xmm0, %xmm1
movsd 0x1632(%rip), %xmm2     # 0xa400
imull $0x3, 0x2c(%rbx), %eax
cvtsi2sd %eax, %xmm3
addsd %xmm2, %xmm1
cmpltpd %xmm1, %xmm3
mulsd 0x1811(%rip), %xmm0     # 0xa5f8
imull $0x3, 0x30(%rbx), %eax
jmp 0x8e25
cvtsi2sdl 0x2c(%rbx), %xmm0
movsd 0x17f6(%rip), %xmm1     # 0xa5f0
mulsd %xmm0, %xmm1
movsd 0x15fa(%rip), %xmm2     # 0xa400
addsd %xmm2, %xmm1
movl 0x30(%rbx), %eax
movl 0x34(%rbx), %ecx
addl %ecx, %ecx
cvtsi2sd %ecx, %xmm3
mulsd 0x17da(%rip), %xmm0     # 0xa5f8
cmpltpd %xmm1, %xmm3
addl %eax, %eax
cvtsi2sd %eax, %xmm1
addsd %xmm2, %xmm0
cmpltpd %xmm0, %xmm1
andpd %xmm3, %xmm1
movd %xmm1, %eax
andb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/loopgen.cpp
// Function: 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();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, 0x10(%rdi)
movl %edx, 0x14(%rdi)
movq %rcx, 0x8(%rdi)
xorl %edi, %edi
callq 0x2170
movl %eax, %edi
callq 0x2190
movq %rbx, %rdi
callq 0x9094
movq %rbx, %rdi
callq 0x913a
movq %rbx, %rdi
callq 0x9228
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9294
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/loopgen.cpp
// Function: 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;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movslq 0x10(%rdi), %rbx
leaq (,%rbx,8), %rdi
testq %rbx, %rbx
pushq $-0x1
popq %r12
cmovsq %r12, %rdi
callq 0x2030
movq %rax, %r14
movq %rax, (%r15)
movq %r15, -0x30(%rbp)
movslq 0x14(%r15), %rax
leaq (,%rax,4), %r15
testq %rax, %rax
cmovsq %r12, %r15
xorl %r12d, %r12d
testl %eax, %eax
movl $0x0, %r13d
cmovgl %eax, %r13d
movq %rbx, %rax
testl %eax, %eax
movl $0x0, %ebx
cmovgl %eax, %ebx
cmpq %rbx, %r12
je 0x912b
movq %r15, %rdi
callq 0x2030
movq %rax, (%r14,%r12,8)
movq -0x30(%rbp), %rax
movq (%rax), %r14
xorl %eax, %eax
cmpq %rax, %r13
je 0x9126
movq (%r14,%r12,8), %rcx
andl $0x0, (%rcx,%rax,4)
incq %rax
jmp 0x9114
incq %r12
jmp 0x90fa
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/loopgen.cpp
// Function: 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);

        if (loop_[cur.i][cur.j] == EXP) {
            addAvailable(cur, avail);
        }
        if (loop_[next.i][next.j] == EXP) {
            addAvailable(next, avail);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl 0x10(%rdi), %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
leaq -0x28(%rbp), %rsi
movl %eax, (%rsi)
movl 0x14(%rdi), %eax
cltd
idivl %ecx
movl %eax, 0x4(%rsi)
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0x8e9e
leaq -0x40(%rbp), %r14
movabsq $-0x100000001, %r12     # imm = 0xFFFFFFFEFFFFFFFF
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
je 0x91f9
movq %r14, %rsi
callq 0x94a4
movq %rax, -0x28(%rbp)
cmpl $-0x1, %eax
je 0x91f9
cmpq %r12, %rax
ja 0x91f9
movq %rbx, %rdi
movq %rax, %rsi
callq 0x94f2
movq %rax, %r15
movq (%rbx), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movslq -0x24(%rbp), %rdx
cmpl $0x1, (%rcx,%rdx,4)
jne 0x91d8
movq -0x28(%rbp), %rsi
movq %r14, %rdx
callq 0x9604
movq (%rbx), %rax
movslq %r15d, %rcx
movq (%rax,%rcx,8), %rax
movq %r15, %rcx
sarq $0x20, %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x9186
movq %r15, %rsi
movq %r14, %rdx
callq 0x9604
jmp 0x9186
leaq -0x40(%rbp), %rdi
callq 0x8ec2
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9213
jmp 0x9213
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x8ec2
movq %rbx, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/loopgen.cpp
// Function: 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;
                case 1:
                    grid_->setNumber(i, j, ONE);
                    break;
                case 2:
                    grid_->setNumber(i, j, TWO);
                    break;
                case 3:
                    grid_->setNumber(i, j, THREE);
                    break;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %r13
movl %r13d, %r14d
cmpl 0x10(%rbx), %r14d
jg 0x9285
leal -0x1(%r14), %r15d
movl %r13d, %r12d
cmpl 0x14(%rbx), %r12d
jg 0x9280
leal -0x1(%r12), %edx
movq %rbx, %rdi
movl %r15d, %esi
callq 0x92d4
cmpl $0x3, %eax
ja 0x927b
incl %eax
movq 0x8(%rbx), %rdi
movl %r14d, %esi
movl %r12d, %edx
movl %eax, %ecx
callq 0x3c62
incl %r12d
jmp 0x924d
incl %r14d
jmp 0x9240
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/loopgen.cpp
// Function: 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))
                + ((!inBounds({ i, j + 1}) && inside) || (inBounds({ i, j + 1 }) && inLoop(i, j + 1) != inside))
                + ((!inBounds({ i, j - 1}) && inside) || (inBounds({ i, j - 1 }) && inLoop(i, j - 1) != inside));

    return lines;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq (%rdi), %r15
movq %rsi, -0x50(%rbp)
movslq %esi, %r14
movq (%r15,%r14,8), %rax
movq %rdx, -0x60(%rbp)
movslq %edx, %rbx
movq %rax, -0x48(%rbp)
movl (%rax,%rbx,4), %r13d
decl %r13d
cmpl $0x2, %r13d
setb -0x29(%rbp)
incl %r14d
movq %rbx, %r12
shlq $0x20, %r12
leaq (%r14,%r12), %rsi
movq %rdi, -0x40(%rbp)
callq 0x947e
xorb $0x1, %al
movq %r15, -0x38(%rbp)
movq %rbx, -0x58(%rbp)
jne 0x9350
cmpl $0x2, %r13d
setb %al
movslq %r14d, %rcx
movq (%r15,%rcx,8), %rcx
movl (%rcx,%rbx,4), %ecx
decl %ecx
cmpl $0x2, %ecx
setb %cl
xorb %al, %cl
movb %cl, -0x29(%rbp)
jmp 0x9353
andb %al, -0x29(%rbp)
cmpl $0x2, %r13d
setb %r15b
movq -0x50(%rbp), %rax
leal -0x1(%rax), %r14d
orq %r14, %r12
movq -0x40(%rbp), %rdi
movq %r12, %rsi
callq 0x947e
xorb $0x1, %al
movq -0x60(%rbp), %rbx
jne 0x93a2
cmpl $0x2, %r13d
setb %al
movslq %r14d, %rcx
movq -0x38(%rbp), %rdx
movq (%rdx,%rcx,8), %rcx
movq -0x58(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
decl %ecx
cmpl $0x2, %ecx
setb %cl
xorb %al, %cl
movb %cl, -0x38(%rbp)
jmp 0x93a9
andb %al, %r15b
movb %r15b, -0x38(%rbp)
cmpl $0x2, %r13d
setb %r12b
leal 0x1(%rbx), %r14d
movq %r14, %rsi
shlq $0x20, %rsi
movl -0x50(%rbp), %r15d
orq %r15, %rsi
movq -0x40(%rbp), %rdi
callq 0x947e
xorb $0x1, %al
jne 0x93ef
cmpl $0x2, %r13d
setb %al
movslq %r14d, %rcx
movq -0x48(%rbp), %rdx
movl (%rdx,%rcx,4), %ecx
decl %ecx
cmpl $0x2, %ecx
setb %r12b
xorb %al, %r12b
jmp 0x93f2
andb %al, %r12b
cmpl $0x2, %r13d
setb %r14b
decl %ebx
movq %rbx, %rsi
shlq $0x20, %rsi
orq %r15, %rsi
movq -0x40(%rbp), %rdi
callq 0x947e
xorb $0x1, %al
jne 0x9432
cmpl $0x2, %r13d
setb %al
movslq %ebx, %rcx
movq -0x48(%rbp), %rdx
movl (%rdx,%rcx,4), %ecx
decl %ecx
cmpl $0x2, %ecx
setb %r14b
xorb %al, %r14b
jmp 0x9435
andb %al, %r14b
movb -0x29(%rbp), %sil
movb -0x38(%rbp), %dl
movzbl %r14b, %eax
movzbl %r12b, %ecx
addl %eax, %ecx
movzbl %dl, %edx
movzbl %sil, %eax
addl %edx, %eax
addl %ecx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/loopgen.cpp
// Function: 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 {
        return { -1, -1 };
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x8(%rsi), %rax
cmpq (%rsi), %rax
je 0x94e5
movq %rsi, %rbx
callq 0x2080
cltq
movq (%rbx), %rcx
movq 0x8(%rbx), %rsi
subq %rcx, %rsi
sarq $0x3, %rsi
xorl %edx, %edx
divq %rsi
movslq %edx, %rax
leaq (%rcx,%rax,8), %rsi
movq (%rsi), %r14
movq %rbx, %rdi
callq 0x8e64
jmp 0x94e9
pushq $-0x1
popq %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/loopgen.cpp
// Function: 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 = pickDirection(cur);

    /* and verify it's a valid choice */
    if (!inBounds(newpos) || loop_[newpos.i][newpos.j] != UNKNOWN) {
        return cur;
    }

    AdjacencyList adjacencyList = getAdjacent(newpos);

    if (!adjacencyList.u && !adjacencyList.d && !adjacencyList.l && !adjacencyList.r) {
        loop_[newpos.i][newpos.j] = OUT;
        return newpos;
    }

    loop_[newpos.i][newpos.j] = (validCell(newpos, cur)) ? EXP : OUT;
    return newpos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
testl %r14d, %r14d
js 0x95e7
testq %r14, %r14
js 0x95e7
movq %rdi, %rbx
cmpl %r14d, 0x10(%rdi)
jle 0x95e7
movq %r14, %r12
shrq $0x20, %r12
cmpl %r12d, 0x14(%rbx)
jle 0x95e7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9652
testb %al, %al
je 0x9574
movq %r14, %rsi
callq 0x96da
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x947e
testb %al, %al
je 0x9574
movq (%rbx), %rax
movslq %r15d, %rcx
movq (%rax,%rcx,8), %rax
movq %r15, %r13
sarq $0x20, %r13
cmpl $0x0, (%rax,%r13,4)
je 0x9590
movq %r14, %r15
shlq $0x20, %r12
movl %r15d, %eax
orq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, -0x30(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9726
movl %eax, %ecx
xorb $0x1, %cl
testl $0x1010100, %eax        # imm = 0x1010100
sete %al
testb %cl, %al
jne 0x95cc
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x97d4
xorb $0x1, %al
movzbl %al, %eax
leal 0x1(,%rax,2), %eax
jmp 0x95cf
pushq $0x3
popq %rax
movq %r15, %r12
shrq $0x20, %r12
movq (%rbx), %rcx
movq -0x30(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl %eax, (%rcx,%r13,4)
jmp 0x9577
leaq 0x1114(%rip), %rdi      # 0xa702
leaq 0x1142(%rip), %rsi      # 0xa737
leaq 0x1155(%rip), %rcx      # 0xa751
pushq $0x71
popq %rdx
callq 0x2120
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/loopgen.cpp
// Function: 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);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rsi, -0x8(%rbp)
movq (%rdx), %rax
movq 0x8(%rdx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movq %rsi, %rdi
shrq $0x20, %rdi
xorl %r8d, %r8d
cmpq %r8, %rcx
je 0x963f
cmpl %esi, (%rax,%r8,8)
jne 0x963a
cmpl %edi, 0x4(%rax,%r8,8)
je 0x964b
incq %r8
jmp 0x9628
leaq -0x8(%rbp), %rsi
movq %rdx, %rdi
callq 0x8e9e
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/loopgen.cpp
// Function: 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;
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
testl %ebx, %ebx
js 0x96ba
testq %rbx, %rbx
js 0x96ba
movq %rdi, %r14
cmpl %ebx, 0x10(%rdi)
jle 0x96ba
movq %rbx, %r15
shrq $0x20, %r15
cmpl %r15d, 0x14(%r14)
jle 0x96ba
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9726
movl %eax, %ecx
testl $0x1010100, %eax        # imm = 0x1010100
setne %al
orb %cl, %al
testb $0x1, %al
jne 0x96ad
movq (%r14), %rcx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
movq (%rcx,%rbx,8), %rcx
movl $0x2, (%rcx,%r15,4)
andb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1041(%rip), %rdi      # 0xa702
leaq 0x106f(%rip), %rsi      # 0xa737
leaq 0x10ac(%rip), %rcx      # 0xa77b
movl $0x97, %edx
callq 0x2120
nop
// File: /workspace/github_cpp_makefile_star2_O2/davidjosepha[P]slitherlink/src/generator/loopgen.cpp
// Function: 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 };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
callq 0x2080
pushq $0x3
popq %rcx
cltd
idivl %ecx
movl %edx, %r14d
xorl %eax, %eax
decl %r14d
jne 0x970b
callq 0x2080
pushq $0x2
popq %rcx
cltd
idivl %ecx
leal -0x1(,%rdx,2), %eax
movq %rbx, %rcx
shrq $0x20, %rcx
addl %ebx, %r14d
addl %eax, %ecx
shlq $0x20, %rcx
orq %rcx, %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/eecs280staff[P]unit_test_framework/./unit_test_framework.hpp
// Function: unit_test_framework::TestSuite::TestSuite()::'lambda'()::operator()() const
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
    }

// Assembly:
cmpb $0x1, 0x432a(%rip)      # 0x71ed
je 0x2ec6
retq
pushq %rax
movq 0x40fa(%rip), %rdi      # 0x6fc8
leaq 0x11a0(%rip), %rsi      # 0x4075
callq 0x21d0
movq %rax, %rdi
callq 0x20e0
callq 0x2110
nop
// File: /workspace/github_cpp_makefile_star2_O2/eecs280staff[P]unit_test_framework/./unit_test_framework.hpp
// Function: 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 << std::endl;
        }
      }
      else if (not exception_msg.empty()) {
        std::cout << "ERROR" << std::endl;
        if (not quiet_mode) {
          std::cout << exception_msg << std::endl;
        }
      }
      else {
        std::cout << "PASS" << std::endl;
      }
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
testl %esi, %esi
je 0x3537
leaq 0xdf1(%rip), %r14       # 0x431f
movq 0x3a93(%rip), %rdi      # 0x6fc8
jmp 0x3554
movq 0x3a8a(%rip), %rdi      # 0x6fc8
leaq 0xdca(%rip), %rsi       # 0x430f
callq 0x21d0
movq %rax, %rdi
leaq 0xdca(%rip), %r14       # 0x431e
movq %rbx, %rsi
callq 0x21b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
cmpq $0x0, 0x30(%rbx)
je 0x3594
movq 0x3a53(%rip), %rdi      # 0x6fc8
leaq 0xd82(%rip), %rsi       # 0x42fe
callq 0x21d0
movq %rax, %rdi
callq 0x20e0
testb %bpl, %bpl
jne 0x35bb
addq $0x28, %rbx
jmp 0x35d9
cmpq $0x0, 0x50(%rbx)
je 0x35c0
movq 0x3a26(%rip), %rdi      # 0x6fc8
leaq 0xd4f(%rip), %rsi       # 0x42f8
callq 0x21d0
movq %rax, %rdi
callq 0x20e0
testb %bpl, %bpl
je 0x35d5
popq %rbx
popq %r14
popq %rbp
retq
movq 0x3a01(%rip), %rdi      # 0x6fc8
leaq 0xd0b(%rip), %rsi       # 0x42d9
callq 0x21d0
jmp 0x35e8
addq $0x48, %rbx
movq 0x39e8(%rip), %rdi      # 0x6fc8
movq %rbx, %rsi
callq 0x21b0
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20e0