// File: /workspace/github_cpp_makefile_star2_O3/canzarlab[P]Trajan/src/match.cpp
// Function: verify(tree const&, tree const&, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>&)
bool verify(const tree& t1, const tree& t2, vector<pair<int, int>>& matching)
{
    // ancestry relationship tables
    array2d D1(t1.n, t1.n, 0), D2(t2.n, t2.n, 0);
    make_trans(t1, t1.r, D1);
    make_trans(t2, t2.r, D2);

    // check for pairwise conflicts
    for (int i = 0; i < matching.size(); ++i)
    {
        for (int j = i + 1; j < matching.size(); ++j)
        {
            if (!valid(matching[i], matching[j], D1, D2))
            {
                auto [a, b] = matching[i];
                auto [x, y] = matching[j];
                dbg(t1.rm[a]);
                dbg(t2.rm[b]);
                dbg(t1.rm[x]);
                dbg(t2.rm[y]);
                return false;
            }
        }
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movl 0x5e08(%rdi), %edx
leaq 0x48(%rsp), %rdi
movl %edx, %esi
xorl %ecx, %ecx
callq 0x5968
movl 0x5e08(%r14), %edx
leaq 0x28(%rsp), %rdi
movl %edx, %esi
xorl %ecx, %ecx
callq 0x5968
movl 0x5e10(%r12), %esi
leaq 0x48(%rsp), %rdx
movq %r12, %rdi
callq 0x4d60
movl 0x5e10(%r14), %esi
leaq 0x28(%rsp), %rdx
movq %r14, %rdi
callq 0x4d60
movq (%rbx), %r15
movq 0x8(%rbx), %rbx
subq %r15, %rbx
je 0x5160
movq %r12, 0x8(%rsp)
movq %r14, (%rsp)
sarq $0x3, %rbx
cmpq $0x1, %rbx
movq %rbx, %rax
adcq $0x0, %rax
movq %rax, 0x10(%rsp)
movl $0x1, %r14d
xorl %eax, %eax
xorl %ebp, %ebp
movq %rbp, 0x18(%rsp)
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rsp)
cmpq %rcx, %rbx
jbe 0x4f42
movq (%r15,%rax,8), %r13
movq %r14, %rbp
movq (%r15,%rbp,8), %r12
movq %r13, %rdi
movq %r12, %rsi
leaq 0x48(%rsp), %rdx
leaq 0x28(%rsp), %rcx
callq 0x4dad
testb %al, %al
je 0x4f5d
incq %rbp
cmpq %rbp, %rbx
ja 0x4f1d
movq 0x20(%rsp), %rax
cmpq %rax, %rbx
setbe %bpl
incq %r14
cmpq 0x10(%rsp), %rax
jne 0x4f03
jmp 0x5163
movq 0xc08c(%rip), %rdi      # 0x10ff0
leaq 0x70ed(%rip), %rsi      # 0xc058
movl $0x8, %edx
callq 0x3270
movq 0x18(%rsp), %rbp
movq 0xc06f(%rip), %rdi      # 0x10ff0
leaq 0x70d9(%rip), %rsi      # 0xc061
movl $0x3, %edx
callq 0x3270
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
movslq %r13d, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0xc03e(%rip), %rdi      # 0x10ff0
callq 0x3270
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
movq 0xc008(%rip), %rdi      # 0x10ff0
leaq 0x7076(%rip), %rsi      # 0xc065
movl $0x8, %edx
callq 0x3270
movq 0xbff0(%rip), %rdi      # 0x10ff0
leaq 0x705a(%rip), %rsi      # 0xc061
movl $0x3, %edx
callq 0x3270
sarq $0x20, %r13
movq (%rsp), %rax
movq 0x30(%rax), %rax
shlq $0x5, %r13
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
movq 0xbfbf(%rip), %rdi      # 0x10ff0
callq 0x3270
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
movq 0xbf89(%rip), %rdi      # 0x10ff0
leaq 0x7000(%rip), %rsi      # 0xc06e
movl $0x8, %edx
callq 0x3270
movq 0xbf71(%rip), %rdi      # 0x10ff0
leaq 0x6fdb(%rip), %rsi      # 0xc061
movl $0x3, %edx
callq 0x3270
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
movslq %r12d, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0xbf40(%rip), %rdi      # 0x10ff0
callq 0x3270
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
movq 0xbf0a(%rip), %rdi      # 0x10ff0
leaq 0x6f8a(%rip), %rsi      # 0xc077
movl $0x8, %edx
callq 0x3270
movq 0xbef2(%rip), %rdi      # 0x10ff0
leaq 0x6f5c(%rip), %rsi      # 0xc061
movl $0x3, %edx
callq 0x3270
sarq $0x20, %r12
movq (%rsp), %rax
movq 0x30(%rax), %rax
shlq $0x5, %r12
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
movq 0xbec1(%rip), %rdi      # 0x10ff0
callq 0x3270
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
jmp 0x5163
movb $0x1, %bpl
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x517a
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3230
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x5191
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x3230
andb $0x1, %bpl
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x51c5
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x51c5
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3230
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x51dc
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x3230
movq %rbx, %rdi
callq 0x33e0