// File: /workspace/github_cpp_makefile_star2_O1/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 0x5864
movl 0x5e08(%r14), %edx
leaq 0x28(%rsp), %rdi
movl %edx, %esi
xorl %ecx, %ecx
callq 0x5864
movl 0x5e10(%r12), %esi
leaq 0x48(%rsp), %rdx
movq %r12, %rdi
callq 0x4c57
movl 0x5e10(%r14), %esi
leaq 0x28(%rsp), %rdx
movq %r14, %rdi
callq 0x4c57
movq (%rbx), %r15
movq 0x8(%rbx), %rbx
subq %r15, %rbx
sete %bpl
je 0x505a
movq %r12, 0x10(%rsp)
movq %r14, 0x8(%rsp)
sarq $0x3, %rbx
cmpq $0x1, %rbx
movq %rbx, %rax
adcq $0x0, %rax
movq %rax, 0x18(%rsp)
movl $0x1, %r14d
xorl %eax, %eax
movb %bpl, 0x7(%rsp)
leaq 0x1(%rax), %rcx
movq %rcx, 0x20(%rsp)
cmpq %rcx, %rbx
jbe 0x4e3c
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 0x4ca4
testb %al, %al
je 0x4e57
incq %rbp
cmpq %rbp, %rbx
ja 0x4e17
movq 0x20(%rsp), %rax
cmpq %rax, %rbx
setbe %bpl
incq %r14
cmpq 0x18(%rsp), %rax
jne 0x4dfd
jmp 0x505a
movq 0xb192(%rip), %rdi      # 0xfff0
leaq 0x61ab(%rip), %rsi      # 0xb010
movl $0x8, %edx
callq 0x3270
movb 0x7(%rsp), %bpl
movq 0xb175(%rip), %rdi      # 0xfff0
leaq 0x6197(%rip), %rsi      # 0xb019
movl $0x3, %edx
callq 0x3270
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rax
movslq %r13d, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0xb144(%rip), %rdi      # 0xfff0
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 0xb10e(%rip), %rdi      # 0xfff0
leaq 0x6134(%rip), %rsi      # 0xb01d
movl $0x8, %edx
callq 0x3270
movq 0xb0f6(%rip), %rdi      # 0xfff0
leaq 0x6118(%rip), %rsi      # 0xb019
movl $0x3, %edx
callq 0x3270
sarq $0x20, %r13
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
shlq $0x5, %r13
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
movq 0xb0c4(%rip), %rdi      # 0xfff0
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 0xb08e(%rip), %rdi      # 0xfff0
leaq 0x60bd(%rip), %rsi      # 0xb026
movl $0x8, %edx
callq 0x3270
movq 0xb076(%rip), %rdi      # 0xfff0
leaq 0x6098(%rip), %rsi      # 0xb019
movl $0x3, %edx
callq 0x3270
movq 0x10(%rsp), %rax
movq 0x30(%rax), %rax
movslq %r12d, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
movq 0xb045(%rip), %rdi      # 0xfff0
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 0xb00f(%rip), %rdi      # 0xfff0
leaq 0x6047(%rip), %rsi      # 0xb02f
movl $0x8, %edx
callq 0x3270
movq 0xaff7(%rip), %rdi      # 0xfff0
leaq 0x6019(%rip), %rsi      # 0xb019
movl $0x3, %edx
callq 0x3270
sarq $0x20, %r12
movq 0x8(%rsp), %rax
movq 0x30(%rax), %rax
shlq $0x5, %r12
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
movq 0xafc5(%rip), %rdi      # 0xfff0
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 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x5071
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3230
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x5088
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 0x50bc
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x50bc
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3230
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x50d3
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x3230
movq %rbx, %rdi
callq 0x33e0