// File: /workspace/github_cpp_makefile_star2_O3/canzarlab[P]Trajan/src/match.cpp
// Function: path_path(array2d&, array2d&, array2d const&, tree const&, tree const&, int, int, int, int)
int path_path(array2d& dp, array2d& pdp, const array2d& matrix, const tree& t1, const tree& t2, const int lx, const int ly, int x, int y)
{
    // trivial case: empty path
    if (x == lx || y == ly)
        return 0;

    // memoization
    int& sol = dp(x, y);
    if (sol != NINF)
        return sol;

    // delete t1 node
    int nsol = path_path(dp, pdp, matrix, t1, t2, lx, ly, t1.par[x], y);
    if (nsol > sol)
        sol = nsol, pdp(x, y) = DEL_1;

    // match x and y
    nsol = matrix(x, y) + path_path(dp, pdp, matrix, t1, t2, lx, ly, t1.par[x], t2.par[y]);
    if (nsol > sol)
        sol = nsol, pdp(x, y) = MATCH;

    // delete t2 node
    nsol = path_path(dp, pdp, matrix, t1, t2, lx, ly, x, t2.par[y]);
    if (nsol > sol)
        sol = nsol, pdp(x, y) = DEL_2;

    return sol;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r15
movq %rdx, %r12
movl 0x70(%rsp), %r10d
movl 0x68(%rsp), %ebx
movl 0x60(%rsp), %r11d
cmpl %r9d, %ebx
sete %cl
cmpl %r11d, %r10d
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x39c3
movq %r8, %r14
movq %rdi, %r13
movl 0x4(%rdi), %eax
imull %ebx, %eax
addl %r10d, %eax
movslq %eax, %rdx
movq 0x8(%rdi), %r8
movl (%r8,%rdx,4), %eax
movl %eax, %ecx
negl %ecx
jno 0x39c3
movl %r9d, %ebp
movslq %ebx, %rax
movq %rax, 0x8(%rsp)
movl 0x5f14(%r15,%rax,4), %eax
subq $0x8, %rsp
movq %rdx, 0x20(%rsp)
movq %r13, %rdi
movq %rsi, 0x8(%rsp)
movq 0x8(%rsp), %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r8, 0x18(%rsp)
movq %r14, %r8
pushq %r10
pushq %rax
pushq %r11
callq 0x37ef
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl 0x90(%rsp), %edx
movq 0x20(%rsp), %rcx
addq $0x20, %rsp
cmpl (%rdi,%rsi,4), %eax
jle 0x38c3
movl %eax, (%rdi,%rsi,4)
movl 0x4(%rcx), %eax
imull %ebx, %eax
addl %edx, %eax
cltq
movq 0x8(%rcx), %rcx
movl $0x0, (%rcx,%rax,4)
movl 0x4(%r12), %eax
imull %ebx, %eax
addl %edx, %eax
cltq
movq 0x8(%r12), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0x24(%rsp)
movq 0x8(%rsp), %rax
movl 0x5f14(%r15,%rax,4), %eax
movslq %edx, %rcx
movq %rcx, 0x8(%rsp)
movl 0x5f14(%r14,%rcx,4), %r10d
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
movl %ebp, %r9d
pushq %r10
pushq %rax
movl 0x78(%rsp), %eax
pushq %rax
callq 0x37ef
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x20(%rsp), %rcx
addq $0x20, %rsp
addl 0x24(%rsp), %eax
cmpl (%rsi,%rdx,4), %eax
jle 0x3955
movl %eax, (%rsi,%rdx,4)
movl 0x4(%rcx), %eax
imull %ebx, %eax
movl 0x70(%rsp), %edx
addl %edx, %eax
cltq
movq 0x8(%rcx), %rcx
movl $0x2, (%rcx,%rax,4)
movq 0x8(%rsp), %rax
movl 0x5f14(%r14,%rax,4), %eax
subq $0x8, %rsp
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
movl %ebp, %r9d
pushq %rax
pushq %rbx
movl 0x78(%rsp), %eax
pushq %rax
callq 0x37ef
movq 0x30(%rsp), %r8
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rdx
addq $0x20, %rsp
movl %eax, %ecx
movl (%r8,%rdi,4), %eax
cmpl %eax, %ecx
movl 0x70(%rsp), %esi
jle 0x39c3
movl %ecx, (%r8,%rdi,4)
imull 0x4(%rdx), %ebx
addl %esi, %ebx
movslq %ebx, %rax
movq 0x8(%rdx), %rcx
movl $0x1, (%rcx,%rax,4)
movl (%r8,%rdi,4), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq