// File: /workspace/github_cpp_makefile_star2_O1/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 $0xd8, %rsp
movq %r9, 0x60(%rsp)
movq %r8, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdi, 0x38(%rsp)
movl 0x120(%rsp), %eax
incl %eax
movslq %eax, %rbx
leaq 0x74(%rsp), %rdx
movl $0xffffffff, (%rdx)     # imm = 0xFFFFFFFF
leaq 0x78(%rsp), %r14
leaq 0xf(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3697a
leaq 0x90(%rsp), %rdi
leaq 0xe(%rsp), %rcx
movq %rbx, %rsi
movq %r14, %rdx
callq 0x57efc
movl 0x118(%rsp), %eax
incl %eax
movslq %eax, %rbx
leaq 0xa8(%rsp), %rdi
leaq 0x90(%rsp), %rdx
leaq 0xd(%rsp), %rcx
movq %rbx, %rsi
callq 0x57f94
leaq 0xc0(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
leaq 0xc(%rsp), %rcx
movq %rbx, %rsi
callq 0x5802c
leaq 0xa8(%rsp), %rdi
callq 0x580c4
leaq 0x90(%rsp), %rdi
callq 0x30172
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x55ef7
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x9340
movl 0x118(%rsp), %r11d
testl %r11d, %r11d
movl 0x120(%rsp), %r10d
js 0x56058
movl %r10d, %eax
movq %rax, 0x28(%rsp)
movl %r11d, %eax
leal (%r10,%r10), %ecx
movl %ecx, 0x20(%rsp)
movq %rax, 0x30(%rsp)
movq %rax, 0x18(%rsp)
leaq (%rax,%rax,2), %rax
movq %rax, 0x68(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
testl %r10d, %r10d
js 0x5602f
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
leal (%rcx,%rax), %ebp
leaq (%rcx,%rcx,2), %rbx
movl 0x20(%rsp), %r12d
movq 0x28(%rsp), %r14
leaq (%r14,%r14,2), %r15
movl %r12d, 0x24(%rsp)
movq 0x28(%rsp), %r13
cmpl %r11d, %ebp
jg 0x56004
cmpl %r10d, %r12d
jg 0x56004
subq $0x8, %rsp
leaq 0xc8(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq 0x48(%rsp), %r8
movq 0x50(%rsp), %r9
pushq 0x130(%rsp)
pushq %r13
pushq %r14
pushq 0x30(%rsp)
pushq 0x40(%rsp)
pushq %r10
pushq %r11
pushq 0x150(%rsp)
pushq 0xa8(%rsp)
callq 0x55799
movl 0x168(%rsp), %r11d
movl 0x170(%rsp), %r10d
addq $0x50, %rsp
movq 0xc0(%rsp), %rcx
movq 0x68(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx,%rbx,8), %rcx
movq (%rcx,%r15,8), %rcx
movl %eax, (%rcx,%r13,4)
leaq -0x1(%r13), %rax
decl %r12d
testq %r13, %r13
movq %rax, %r13
jg 0x55f72
leaq -0x1(%r14), %rax
movl 0x24(%rsp), %r12d
decl %r12d
testq %r14, %r14
movq %rax, %r14
jg 0x55f64
movq 0x10(%rsp), %rcx
leaq -0x1(%rcx), %rax
testq %rcx, %rcx
movq %rax, 0x10(%rsp)
jg 0x55f40
movq 0x18(%rsp), %rcx
leaq -0x1(%rcx), %rax
testq %rcx, %rcx
jg 0x55f28
leaq 0xc0(%rsp), %rdi
movq (%rdi), %rax
movq (%rax), %rax
movq (%rax), %rax
movq (%rax), %rax
movl (%rax), %ebx
callq 0x58106
movl %ebx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x580c4
jmp 0x5609c
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x30172
jmp 0x560ae
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x560c8
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9670