// File: /workspace/github_cpp_makefile_star2_O2/cauimsouza[P]rikudo-solver/src/rikudo_solver/main.cpp
// Function: count_path_between_corners(int)
void count_path_between_corners(int n){
    if(n <= 2){
        std::cout << n << std::endl;
        return;
    }

    std::vector<std::vector<int>> adj_list(n*n, std::vector<int>());

    int di[] = {1,0,-1,0};
    int dj[] = {0,1,0,-1};
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            for(int k = 0; k < 4; k++) {
                int ii = i + di[k];
                int jj = j + dj[k];
                if (ii >= 0 && ii < n && jj >= 0 && jj < n)
                    adj_list[ i*n+j ].push_back( ii*n+jj );
            }

    Graph graph(adj_list);
    auto paths = graph.ham_path(0, n*n-1);
    printf("Number of paths: %d\n", (int) paths.size());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movl %edi, %eax
cmpl $0x2, %edi
jg 0x255e
movq 0x9a92(%rip), %rdi      # 0xbfd0
movl %eax, %esi
callq 0x2350
movq %rax, %rdi
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2110
movl %eax, %esi
imull %esi, %esi
xorps %xmm0, %xmm0
leaq -0x160(%rbp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
leaq -0x68(%rbp), %rdi
leaq -0xb8(%rbp), %rcx
movq %rsi, -0x30(%rbp)
movl %eax, %ebx
callq 0x2c7c
leaq -0x160(%rbp), %rdi
callq 0x2e04
movl %ebx, %ecx
xorl %r10d, %r10d
leaq 0x5a6d(%rip), %r12      # 0x8010
leaq 0x5a76(%rip), %rdi      # 0x8020
movl %ebx, %r11d
movq %rcx, -0x38(%rbp)
cmpq %rcx, %r10
je 0x2657
movq %r10, %rax
imulq %rcx, %rax
imulq $0x18, %rax, %rax
movq %rax, -0x48(%rbp)
xorl %r13d, %r13d
movq %r10, -0x40(%rbp)
cmpq %rcx, %r13
je 0x264f
imulq $0x18, %r13, %rax
movq %rax, -0x50(%rbp)
xorl %r15d, %r15d
cmpq $0x10, %r15
je 0x2646
movl (%r15,%r12), %eax
addl %r10d, %eax
js 0x2640
movl (%r15,%rdi), %ecx
addl %r13d, %ecx
cmpl %r11d, %eax
setl %dl
cmpl %r11d, %ecx
setb %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x2640
movq %rdi, %rbx
movq -0x68(%rbp), %rdi
addq -0x50(%rbp), %rdi
addq -0x48(%rbp), %rdi
movl %r11d, %r14d
imull %r11d, %eax
addl %ecx, %eax
movl %eax, -0x160(%rbp)
leaq -0x160(%rbp), %rsi
callq 0x3044
movq %rbx, %rdi
movq -0x40(%rbp), %r10
movl %r14d, %r11d
addq $0x4, %r15
jmp 0x25e0
incq %r13
movq -0x38(%rbp), %rcx
jmp 0x25d0
incq %r10
jmp 0x25b1
leaq -0x160(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x354c
movq -0x30(%rbp), %rdx
decl %edx
xorps %xmm0, %xmm0
leaq -0xa0(%rbp), %r9
movaps %xmm0, (%r9)
andq $0x0, 0x10(%r9)
leaq -0x80(%rbp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %rax, (%rsp)
leaq -0x160(%rbp), %rdi
pushq $0x1
popq %rcx
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x5570
leaq -0xb8(%rbp), %rdi
movq %rax, %rsi
callq 0x2cdc
leaq -0x80(%rbp), %rdi
callq 0x3172
leaq -0xa0(%rbp), %rdi
callq 0x3172
leaq -0xb8(%rbp), %rbx
movq 0x8(%rbx), %rax
subq (%rbx), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
leaq 0x594b(%rip), %rdi      # 0x8030
movl %eax, %esi
xorl %eax, %eax
callq 0x2030
movq %rbx, %rdi
callq 0x2d36
leaq -0x160(%rbp), %rdi
callq 0x2d62
leaq -0x68(%rbp), %rdi
callq 0x2d36
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2756
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x2e04
jmp 0x2762
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x3172
leaq -0xa0(%rbp), %rdi
callq 0x3172
leaq -0x160(%rbp), %rdi
callq 0x2d62
jmp 0x2759
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x2d36
movq %rbx, %rdi
callq 0x2360