// File: 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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq 0x28(%rbp), %rax
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movq %r8, -0x50(%rbp)
movq %r9, -0x58(%rbp)
movl 0x18(%rbp), %eax
incl %eax
cltq
movq %rax, -0x100(%rbp)
movq %rax, -0xf8(%rbp)
movl 0x20(%rbp), %eax
incl %eax
cltq
movq %rax, -0xf0(%rbp)
movl $0xffffffff, -0xbc(%rbp) # imm = 0xFFFFFFFF
leaq -0xbd(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x14c70
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rcx
leaq -0xb8(%rbp), %rdi
leaq -0xbc(%rbp), %rdx
callq 0xaef30
jmp 0xfbeed
leaq -0xcd(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x9a850
movq -0xf0(%rbp), %rsi
movq -0x108(%rbp), %rcx
leaq -0xa0(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0xfe6d0
jmp 0xfbf23
leaq -0xce(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0xfe750
movq -0x100(%rbp), %rsi
movq -0x110(%rbp), %rcx
leaq -0x88(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
callq 0xfe770
jmp 0xfbf59
leaq -0xcf(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0xfe7f0
movq -0xf8(%rbp), %rsi
movq -0x118(%rbp), %rcx
leaq -0x70(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0xfe810
jmp 0xfbf8c
leaq -0xcf(%rbp), %rdi
callq 0xfe890
leaq -0x88(%rbp), %rdi
callq 0xfe8b0
leaq -0xce(%rbp), %rdi
callq 0xfe910
leaq -0xa0(%rbp), %rdi
callq 0x99530
leaq -0xcd(%rbp), %rdi
callq 0x9ae50
leaq -0xb8(%rbp), %rdi
callq 0x14b50
leaq -0xbd(%rbp), %rdi
callq 0x14d00
movl 0x18(%rbp), %eax
movl %eax, -0xd4(%rbp)
cmpl $0x0, -0xd4(%rbp)
jl 0xfc25c
movl 0x18(%rbp), %eax
movl %eax, -0xd8(%rbp)
cmpl $0x0, -0xd8(%rbp)
jl 0xfc246
movl 0x20(%rbp), %eax
movl %eax, -0xdc(%rbp)
cmpl $0x0, -0xdc(%rbp)
jl 0xfc230
movl 0x20(%rbp), %eax
movl %eax, -0xe0(%rbp)
cmpl $0x0, -0xe0(%rbp)
jl 0xfc21a
movl -0xd4(%rbp), %eax
addl -0xd8(%rbp), %eax
cmpl 0x18(%rbp), %eax
jg 0xfc204
movl -0xdc(%rbp), %eax
addl -0xe0(%rbp), %eax
cmpl 0x20(%rbp), %eax
jg 0xfc204
movq -0x30(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x38(%rbp), %r8
movq -0x40(%rbp), %r9
movq -0x58(%rbp), %rdi
movq 0x10(%rbp), %r10
movl 0x18(%rbp), %r11d
movl 0x20(%rbp), %ebx
movl -0xd4(%rbp), %r14d
movl -0xd8(%rbp), %r15d
movl -0xdc(%rbp), %r12d
movl -0xe0(%rbp), %r13d
movq 0x28(%rbp), %rcx
movq %rsp, %rax
movq %rax, -0x130(%rbp)
movq %rcx, 0x40(%rax)
movq -0x128(%rbp), %rcx
movl %r13d, 0x38(%rax)
movl %r12d, 0x30(%rax)
movl %r15d, 0x28(%rax)
movl %r14d, 0x20(%rax)
movl %ebx, 0x18(%rax)
movl %r11d, 0x10(%rax)
movq %r10, 0x8(%rax)
movq %rdi, (%rax)
leaq -0x70(%rbp), %rdi
callq 0xfb480
movl %eax, -0x11c(%rbp)
jmp 0xfc0f0
movslq -0xd4(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0xfe540
movq %rax, %rdi
movslq -0xd8(%rbp), %rsi
callq 0xfe560
movq %rax, %rdi
movslq -0xdc(%rbp), %rsi
callq 0x993b0
movq %rax, %rdi
movslq -0xe0(%rbp), %rsi
callq 0x145d0
movl -0x11c(%rbp), %ecx
movl %ecx, (%rax)
jmp 0xfc204
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0xfc1d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0xfc1bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0xfc1a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0xcf(%rbp), %rdi
callq 0xfe890
leaq -0x88(%rbp), %rdi
callq 0xfe8b0
leaq -0xce(%rbp), %rdi
callq 0xfe910
leaq -0xa0(%rbp), %rdi
callq 0x99530
leaq -0xcd(%rbp), %rdi
callq 0x9ae50
leaq -0xb8(%rbp), %rdi
callq 0x14b50
leaq -0xbd(%rbp), %rdi
callq 0x14d00
jmp 0xfc2b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xfe930
jmp 0xfc2b6
jmp 0xfc206
movl -0xe0(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xe0(%rbp)
jmp 0xfc02b
jmp 0xfc21c
movl -0xdc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xdc(%rbp)
jmp 0xfc015
jmp 0xfc232
movl -0xd8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xd8(%rbp)
jmp 0xfbfff
jmp 0xfc248
movl -0xd4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0xfbfe9
leaq -0x70(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xfe540
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xfe560
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x993b0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x145d0
movl (%rax), %eax
movl %eax, -0x134(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xfe930
movl -0x134(%rbp), %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0xc8(%rbp), %rdi
callq 0xa7c0
nopw %cs:(%rax,%rax)