// File: /workspace/github_cpp_makefile_star2_O2/canzarlab[P]Trajan/src/EditDist.cpp
// Function: OrderedEditDist(std::vector<std::vector<std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>, std::allocator<std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>>>, std::allocator<std::vector<std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>, std::allocator<std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>>>>>&, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, int, int, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&)
int OrderedEditDist(vvvvi& P, vvi& L1, vvi& L2, vvi& T1, vvi& T2, vvi& D1, vvi& D2, int n, int m, vector<vector<int>> & cost_matrix)
{
    vvvvi DP(n + 1, vvvi(n + 1, vvi(m + 1, vi(m + 1, -1))));
    for (int i = n; i >= 0; --i)
        for (int j = n; j >= 0; --j)
            for (int k = m; k >= 0; --k)
                for (int l = m; l >= 0; --l)
                    if (i + j <= n && k + l <= m)
                        DP[i][j][k][l] = Distance(DP, P, T1, T2, L1, L2, D1, D2, n, m, i, j, k, l, cost_matrix);

    return DP[0][0][0][0];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %r9, 0x50(%rsp)
movq %r8, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdi, 0x28(%rsp)
movl 0x110(%rsp), %eax
incl %eax
movslq %eax, %rbx
leaq 0x64(%rsp), %rdx
orl $-0x1, (%rdx)
leaq 0xb0(%rsp), %r14
leaq 0xf(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x332b8
leaq 0x68(%rsp), %rdi
leaq 0xe(%rsp), %rcx
movq %rbx, %rsi
movq %r14, %rdx
callq 0x4d65c
movl 0x108(%rsp), %eax
incl %eax
movslq %eax, %rbx
leaq 0x80(%rsp), %rdi
leaq 0x68(%rsp), %rdx
leaq 0xd(%rsp), %rcx
movq %rbx, %rsi
callq 0x4d6b2
leaq 0x98(%rsp), %rdi
leaq 0x80(%rsp), %rdx
leaq 0xc(%rsp), %rcx
movq %rbx, %rsi
callq 0x4d708
leaq 0x80(%rsp), %rdi
callq 0x4d75e
leaq 0x68(%rsp), %rdi
callq 0x2dd22
leaq 0xb0(%rsp), %rdi
callq 0xd85a
movl 0x110(%rsp), %r10d
leal (%r10,%r10), %eax
movl %eax, 0x10(%rsp)
movl 0x108(%rsp), %r11d
movl %r11d, %ecx
testl %ecx, %ecx
js 0x4c200
movl %ecx, %eax
imulq $0x18, %rax, %rax
movq %rax, 0x58(%rsp)
movl %r11d, %eax
movq %rcx, 0x18(%rsp)
testl %eax, %eax
js 0x4c1f9
leal (%rax,%rcx), %ebp
movq %rax, 0x20(%rsp)
movl %eax, %eax
imulq $0x18, %rax, %rbx
movl 0x10(%rsp), %r15d
movl %r10d, %r13d
testl %r13d, %r13d
js 0x4c1e8
movl %r13d, %eax
imulq $0x18, %rax, %r12
movl %r15d, 0x14(%rsp)
movl %r10d, %r14d
testl %r14d, %r14d
js 0x4c1d8
cmpl %r11d, %ebp
jg 0x4c1cd
cmpl %r10d, %r15d
jg 0x4c1cd
subq $0x8, %rsp
leaq 0xa0(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq 0x50(%rsp), %rcx
movq 0x38(%rsp), %r8
movq 0x40(%rsp), %r9
pushq 0x120(%rsp)
pushq %r14
pushq %r13
pushq 0x40(%rsp)
pushq 0x40(%rsp)
pushq %r10
pushq %r11
pushq 0x140(%rsp)
pushq 0x98(%rsp)
callq 0x4baff
movl 0x158(%rsp), %r11d
movl 0x160(%rsp), %r10d
addq $0x50, %rsp
movq 0x98(%rsp), %rcx
movq 0x58(%rsp), %rdx
movq (%rcx,%rdx), %rcx
movq (%rcx,%rbx), %rcx
movl %r14d, %edx
movq (%rcx,%r12), %rcx
movl %eax, (%rcx,%rdx,4)
decl %r14d
decl %r15d
jmp 0x4c130
decl %r13d
movl 0x14(%rsp), %r15d
decl %r15d
jmp 0x4c118
movq 0x20(%rsp), %rax
decl %eax
movq 0x18(%rsp), %rcx
jmp 0x4c0fa
decl %ecx
jmp 0x4c0df
leaq 0x98(%rsp), %rdi
movq (%rdi), %rax
movq (%rax), %rax
movq (%rax), %rax
movq (%rax), %rax
movl (%rax), %ebx
callq 0x4d780
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x4d75e
jmp 0x4c244
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x2dd22
jmp 0x4c253
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xd85a
movq %rbx, %rdi
callq 0x9640