// File: davidjosepha[P]slitherlink/src/solver/solver.cpp
// Function: 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++) {
            if (lineGuess.getHLine(i, j) == nLineGuess.getHLine(i, j) &&
                  lineGuess.getHLine(i, j) != grid_->getHLine(i, j)) {
                grid_->setHLine(i, j, lineGuess.getHLine(i, j));
                grid_->setUpdated(true);
            }
        }
    }

    for (int i = 0; i < grid_->getHeight(); i++) {
        for (int j = 0; j < grid_->getWidth()+1; j++) {
            if (lineGuess.getVLine(i, j) == nLineGuess.getVLine(i, j) &&
                  lineGuess.getVLine(i, j) != grid_->getVLine(i, j)) {
                grid_->setVLine(i, j, lineGuess.getVLine(i, j));
                grid_->setUpdated(true);
            }
        }
    }
}

// Assembly:
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, %ecx
movb %al, -0x29(%rbp)
jne 0xf1a4
movq -0x10(%rbp), %rdi
callq 0x2af0
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2af0
movl %eax, %ecx
movl -0x3c(%rbp), %eax
cmpl %ecx, %eax
sete %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0xf1ad
jmp 0xf1af
jmp 0xf1ce
leaq 0x63b1(%rip), %rdi      # 0x15567
leaq 0x62ed(%rip), %rsi      # 0x154aa
movl $0x19e, %edx            # imm = 0x19E
leaq 0x63ff(%rip), %rcx      # 0x155c8
callq 0x2120
movl $0x0, -0x1c(%rbp)
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, -0x40(%rbp)
movq 0x8(%rax), %rdi
callq 0x2ad0
movl %eax, %ecx
movl -0x40(%rbp), %eax
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0xf2e3
movl $0x0, -0x20(%rbp)
movq -0x38(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, -0x44(%rbp)
movq 0x8(%rax), %rdi
callq 0x2af0
movl %eax, %ecx
movl -0x44(%rbp), %eax
cmpl %ecx, %eax
jge 0xf2d3
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x5bf0
movl %eax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x5bf0
movl %eax, %ecx
movl -0x48(%rbp), %eax
cmpl %ecx, %eax
jne 0xf2c3
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x5bf0
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, -0x4c(%rbp)
movq 0x8(%rax), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x5bf0
movl %eax, %ecx
movl -0x4c(%rbp), %eax
cmpl %ecx, %eax
je 0xf2c3
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x60(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x5bf0
movq -0x60(%rbp), %rdi
movl -0x54(%rbp), %esi
movl -0x50(%rbp), %edx
movl %eax, %ecx
movq (%rdi), %rax
callq *(%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0xfc50
jmp 0xf2c5
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xf1ff
jmp 0xf2d5
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xf1d5
movl $0x0, -0x24(%rbp)
movq -0x38(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, -0x64(%rbp)
movq 0x8(%rax), %rdi
callq 0x2ad0
movl %eax, %ecx
movl -0x64(%rbp), %eax
cmpl %ecx, %eax
jge 0xf3f9
movl $0x0, -0x28(%rbp)
movq -0x38(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, -0x68(%rbp)
movq 0x8(%rax), %rdi
callq 0x2af0
movl %eax, %ecx
movl -0x68(%rbp), %eax
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0xf3e9
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x5c90
movl %eax, -0x6c(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x5c90
movl %eax, %ecx
movl -0x6c(%rbp), %eax
cmpl %ecx, %eax
jne 0xf3d9
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x5c90
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, -0x70(%rbp)
movq 0x8(%rax), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x5c90
movl %eax, %ecx
movl -0x70(%rbp), %eax
cmpl %ecx, %eax
je 0xf3d9
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x80(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x74(%rbp)
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x5c90
movq -0x80(%rbp), %rdi
movl -0x78(%rbp), %esi
movl -0x74(%rbp), %edx
movl %eax, %ecx
movq (%rdi), %rax
callq *0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0xfc50
jmp 0xf3db
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xf311
jmp 0xf3eb
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xf2ea
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)