// File: /workspace/github_cpp_makefile_star2_O2/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 $0x78, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movl 0x5e08(%rdi), %edx
leaq 0x58(%rsp), %rdi
movl %edx, %esi
xorl %ecx, %ecx
callq 0x517e
movl 0x5e08(%rbx), %edx
leaq 0x38(%rsp), %rdi
movl %edx, %esi
xorl %ecx, %ecx
callq 0x517e
movl 0x5e10(%r14), %esi
leaq 0x58(%rsp), %r13
movq %r14, 0x18(%rsp)
movq %r14, %rdi
movq %r13, %rdx
callq 0x48cb
movl 0x5e10(%rbx), %esi
leaq 0x38(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x48cb
movq (%r15), %r14
movq 0x8(%r15), %rax
subq %r14, %rax
sarq $0x3, %rax
pushq $0x1
popq %rsi
xorl %ecx, %ecx
movq %rbx, 0x20(%rsp)
movq %rax, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
cmpq %rax, %rcx
je 0x4bc9
movq 0x10(%rsp), %rax
incq %rax
movq %rax, 0x28(%rsp)
movq %rsi, 0x30(%rsp)
movq %rsi, %rbx
cmpq %rbx, 0x8(%rsp)
jbe 0x4aaa
movq 0x10(%rsp), %rax
movq (%r14,%rax,8), %r12
movq (%r14,%rbx,8), %r15
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x4918
incq %rbx
testb %al, %al
jne 0x4a7c
jmp 0x4abe
movq 0x30(%rsp), %rsi
incq %rsi
movq 0x28(%rsp), %rcx
movq 0x8(%rsp), %rax
jmp 0x4a59
movq 0xb52b(%rip), %rdi      # 0xfff0
leaq 0x5544(%rip), %rsi      # 0xa010
callq 0x3210
movq 0x20(%rsp), %rbx
leaq 0x553c(%rip), %rsi      # 0xa019
movq %rax, %rdi
callq 0x3210
movslq %r12d, %rsi
shlq $0x5, %rsi
movq 0x18(%rsp), %rcx
addq 0x30(%rcx), %rsi
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3120
movq 0xb4e4(%rip), %rdi      # 0xfff0
leaq 0x550a(%rip), %rsi      # 0xa01d
callq 0x3210
leaq 0x54fa(%rip), %rsi      # 0xa019
movq %rax, %rdi
callq 0x3210
sarq $0x20, %r12
shlq $0x5, %r12
addq 0x30(%rbx), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x3200
movq %rax, %rdi
callq 0x3120
movq 0xb4a3(%rip), %rdi      # 0xfff0
leaq 0x54d2(%rip), %rsi      # 0xa026
callq 0x3210
leaq 0x54b9(%rip), %rsi      # 0xa019
movq %rax, %rdi
callq 0x3210
movslq %r15d, %rsi
shlq $0x5, %rsi
movq 0x18(%rsp), %rcx
addq 0x30(%rcx), %rsi
movq %rax, %rdi
callq 0x3200
movq %rax, %rdi
callq 0x3120
movq 0xb461(%rip), %rdi      # 0xfff0
leaq 0x5499(%rip), %rsi      # 0xa02f
callq 0x3210
leaq 0x5477(%rip), %rsi      # 0xa019
movq %rax, %rdi
callq 0x3210
sarq $0x20, %r15
shlq $0x5, %r15
addq 0x30(%rbx), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x3200
movq %rax, %rdi
callq 0x3120
movq 0x10(%rsp), %rax
cmpq %rax, 0x8(%rsp)
setbe %bl
leaq 0x40(%rsp), %rdi
callq 0x65ec
leaq 0x60(%rsp), %rdi
callq 0x65ec
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4c0d
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x65ec
leaq 0x60(%rsp), %rdi
callq 0x65ec
movq %rbx, %rdi
callq 0x33e0