// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0xc(%rsi), %eax
cmpl 0xc(%rdx), %eax
jne 0xc4d0
movq %rsi, %r14
movl 0x10(%rsi), %eax
cmpl 0x10(%rdx), %eax
jne 0xc4d0
movq %rdi, %r15
movq %rdx, -0x30(%rbp)
movq 0x8(%rdi), %rax
cmpl $0x0, 0xc(%rax)
js 0xc40c
xorl %r12d, %r12d
movq 0x8(%r15), %rax
cmpl $0x0, 0x10(%rax)
jle 0xc3f6
xorl %r13d, %r13d
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x431a
movl %eax, %ebx
movq -0x30(%rbp), %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x431a
cmpl %eax, %ebx
jne 0xc3e9
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x431a
movl %eax, %ebx
movq 0x8(%r15), %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x431a
cmpl %eax, %ebx
je 0xc3e9
movq 0x8(%r15), %rbx
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x431a
movq (%rbx), %r8
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
movl %eax, %ecx
callq *(%r8)
movq 0x8(%r15), %rax
movb $0x1, 0x9(%rax)
incl %r13d
movq 0x8(%r15), %rax
cmpl 0x10(%rax), %r13d
jl 0xc378
leal 0x1(%r12), %eax
movq 0x8(%r15), %rcx
cmpl 0xc(%rcx), %r12d
movl %eax, %r12d
jl 0xc367
movq 0x8(%r15), %rax
cmpl $0x0, 0xc(%rax)
jle 0xc4c1
xorl %r12d, %r12d
movq 0x8(%r15), %rax
cmpl $0x0, 0x10(%rax)
js 0xc4b0
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
incl %r13d
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x4360
movl %eax, %ebx
movq -0x30(%rbp), %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x4360
cmpl %eax, %ebx
jne 0xc4a6
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x4360
movl %eax, %ebx
movq 0x8(%r15), %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x4360
cmpl %eax, %ebx
je 0xc4a6
movq 0x8(%r15), %rbx
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x4360
movq (%rbx), %r8
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
movl %eax, %ecx
callq *0x8(%r8)
movq 0x8(%r15), %rax
movb $0x1, 0x9(%rax)
movq 0x8(%r15), %rax
cmpl 0x10(%rax), %r13d
jl 0xc431
incl %r12d
movq 0x8(%r15), %rax
cmpl 0xc(%rax), %r12d
jl 0xc41d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x305c(%rip), %rdi      # 0xf533
leaq 0x2f98(%rip), %rsi      # 0xf476
leaq 0x30af(%rip), %rcx      # 0xf594
movl $0x19e, %edx            # imm = 0x19E
callq 0x2100
nop