// File: davidjosepha[P]slitherlink/src/shared/import.cpp
// Function: 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, NLINE);
    }

    for (int j = 0; j < n+3; j++) {
        lattice_->setVLine(0, j, NLINE);
        lattice_->setVLine(m+1, j, NLINE);
    }

    for (int j = 0; j < n+2; j++) {
        lattice_->setHLine(0, j, NLINE);
        lattice_->setHLine(m+2, j, NLINE);
    }

    for (int j = 0; j < m+3; j++) {
        lattice_->setHLine(j, 0, NLINE);
        lattice_->setHLine(j, n+1, NLINE);
    }

}

// Assembly:
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
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x5212
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
addl $0x1, %esi
movq (%rdi), %rax
xorl %edx, %edx
movl $0x2, %ecx
callq *(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x51e1
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0xc(%rbp), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x5263
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0x18(%rbp), %esi
movq (%rdi), %rax
xorl %edx, %edx
movl $0x2, %ecx
callq *0x8(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0x18(%rbp), %esi
movl -0x10(%rbp), %edx
addl $0x2, %edx
movq (%rdi), %rax
movl $0x2, %ecx
callq *0x8(%rax)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x5219
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl -0x10(%rbp), %ecx
addl $0x3, %ecx
cmpl %ecx, %eax
jge 0x52b4
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0x1c(%rbp), %edx
movq (%rdi), %rax
xorl %esi, %esi
movl $0x2, %ecx
callq *0x8(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0xc(%rbp), %esi
addl $0x1, %esi
movl -0x1c(%rbp), %edx
movq (%rdi), %rax
movl $0x2, %ecx
callq *0x8(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x526a
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl -0x10(%rbp), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x5303
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0x20(%rbp), %edx
movq (%rdi), %rax
xorl %esi, %esi
movl $0x2, %ecx
callq *(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0xc(%rbp), %esi
addl $0x2, %esi
movl -0x20(%rbp), %edx
movq (%rdi), %rax
movl $0x2, %ecx
callq *(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x52bb
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0xc(%rbp), %ecx
addl $0x3, %ecx
cmpl %ecx, %eax
jge 0x5352
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0x24(%rbp), %esi
movq (%rdi), %rax
xorl %edx, %edx
movl $0x2, %ecx
callq *(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0x24(%rbp), %esi
movl -0x10(%rbp), %edx
addl $0x1, %edx
movq (%rdi), %rax
movl $0x2, %ecx
callq *(%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x530a
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)