// File: davidjosepha[P]slitherlink/src/shared/grid.cpp
// Function: 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.changeVLine(i, j, getVLine(i,j));
        }
    }

    for (int i = 0; i < getHeight(); i++) {
        for (int j = 0; j < getWidth(); j++) {
            newGrid.setNumber(i, j, getNumber(i,j));
            newGrid.setUpdateMatrix(i, j, updateMatrix_[i][j]);
            newGrid.setContraMatrix(i, j, contraMatrix_[i][j]);
        }
    }

    for (int i = 0; i < getHeight()+1; i++) {
        for (int j = 0; j < getWidth()+1; j++) {
            newGrid.setContourMatrix(i, j, contourMatrix_[i][j]);
        }
    }

}

// Assembly:
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
movl $0x0, -0x18(%rbp)
movq -0x40(%rbp), %rdi
movl -0x18(%rbp), %eax
movl %eax, -0x48(%rbp)
callq 0x2af0
movl %eax, %ecx
movl -0x48(%rbp), %eax
cmpl %ecx, %eax
jge 0x361c
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq 0x5bf0
movq -0x58(%rbp), %rdi
movl -0x50(%rbp), %esi
movl -0x4c(%rbp), %edx
movl %eax, %ecx
movq (%rdi), %rax
callq *0x10(%rax)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x35c4
jmp 0x361e
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x35a2
movl $0x0, -0x1c(%rbp)
movq -0x40(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, -0x5c(%rbp)
callq 0x2ad0
movl %eax, %ecx
movl -0x5c(%rbp), %eax
cmpl %ecx, %eax
jge 0x36bd
movl $0x0, -0x20(%rbp)
movq -0x40(%rbp), %rdi
movl -0x20(%rbp), %eax
movl %eax, -0x60(%rbp)
callq 0x2af0
movl %eax, %ecx
movl -0x60(%rbp), %eax
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x36ad
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x5c90
movq -0x70(%rbp), %rdi
movl -0x68(%rbp), %esi
movl -0x64(%rbp), %edx
movl %eax, %ecx
movq (%rdi), %rax
callq *0x18(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3652
jmp 0x36af
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x3633
movl $0x0, -0x24(%rbp)
movq -0x40(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, -0x74(%rbp)
callq 0x2ad0
movl %eax, %ecx
movl -0x74(%rbp), %eax
cmpl %ecx, %eax
jge 0x37b1
movl $0x0, -0x28(%rbp)
movq -0x40(%rbp), %rdi
movl -0x28(%rbp), %eax
movl %eax, -0x78(%rbp)
callq 0x2af0
movl %eax, %ecx
movl -0x78(%rbp), %eax
cmpl %ecx, %eax
jge 0x37a1
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x5b50
movq -0x88(%rbp), %rdi
movl -0x80(%rbp), %esi
movl -0x7c(%rbp), %edx
movl %eax, %ecx
callq 0x5d90
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
movq 0x30(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movb (%rax,%rcx), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x48f0
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
movq 0x38(%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movb (%rax,%rcx), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x4930
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x36e7
jmp 0x37a3
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x36c4
movl $0x0, -0x2c(%rbp)
movq -0x40(%rbp), %rdi
movl -0x2c(%rbp), %eax
movl %eax, -0x8c(%rbp)
callq 0x2ad0
movl %eax, %ecx
movl -0x8c(%rbp), %eax
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x384b
movl $0x0, -0x30(%rbp)
movq -0x40(%rbp), %rdi
movl -0x30(%rbp), %eax
movl %eax, -0x90(%rbp)
callq 0x2af0
movl %eax, %ecx
movl -0x90(%rbp), %eax
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x383b
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
movq 0x40(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
callq 0x4970
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x37e0
jmp 0x383d
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x37b8
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)