// File: shangjingbo1226[P]MACFP/src/methods/TDP.cpp
// Function: getSup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, int, int, int)
vector< pair<int, int> > getSup(string &dna, int n, int l, int r)
{
    vector< pair<int, int> > Q(1, make_pair(l, r));
    for (int i = 0; i < n; ++ i) {
        if (l <= i && i <= r) {
            continue;
        }
        vector< vector<int> > f(r - l + 2, vector<int>(EDIT_DIS_THRES * 2 + 1, EDIT_DIS_THRES + 1));
        f[0][0 + EDIT_DIS_THRES] = 0;
        for (int x = 0; x <= r - l + 1; ++ x) {
            for (int delta = -EDIT_DIS_THRES; delta <= EDIT_DIS_THRES; ++ delta) {
                int j = i + x + delta;
                if (j < i || j > n + 1) {
                    continue;
                }
                int dist = f[x][delta + EDIT_DIS_THRES];
                if (dist > EDIT_DIS_THRES) {
                    continue;
                }

                if (x < r - l + 1 && j < n) {
                    update(f[x + 1][EDIT_DIS_THRES + delta], dist + (dna[l + x] != dna[j]));
                }
                if (delta + 1 <= EDIT_DIS_THRES) {
                    update(f[x][EDIT_DIS_THRES + delta + 1], dist + 1);
                }
                if (x < r - l + 1 && delta - 1 >= -EDIT_DIS_THRES) {
                    update(f[x + 1][EDIT_DIS_THRES + delta - 1], dist + 1);
                }
            }
        }
        for (int delta = -EDIT_DIS_THRES; delta <= EDIT_DIS_THRES; ++ delta) {
            int j = i + r - l + 1 + delta;
            if (f[r - l + 1][delta + EDIT_DIS_THRES] <= EDIT_DIS_THRES) {
                if (max(l, i) <= min(j - 1, r)) {
                    continue;
                }
                Q.push_back(make_pair(i, j - 1));
            }
        }
    }
    return makeMaximal(Q);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0xd0(%rbp)
movq %rdi, %rax
movq %rax, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x4680
movq %rax, -0x40(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x46b0
movq -0xc0(%rbp), %rcx
leaq -0x38(%rbp), %rdi
movl $0x1, %esi
leaq -0x40(%rbp), %rdx
callq 0x46d0
jmp 0x33ba
leaq -0x41(%rbp), %rdi
callq 0x4750
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x3906
movl -0x18(%rbp), %eax
cmpl -0x58(%rbp), %eax
jg 0x3405
movl -0x58(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jg 0x3405
jmp 0x38f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x4750
jmp 0x3946
movl -0x1c(%rbp), %eax
movl -0x18(%rbp), %ecx
subl %ecx, %eax
addl $0x2, %eax
cltq
movq %rax, -0xe8(%rbp)
movl 0xbdf9(%rip), %eax      # 0xf218
movl %eax, %ecx
leal 0x1(%rcx,%rcx), %ecx
movslq %ecx, %rcx
movq %rcx, -0xe0(%rbp)
incl %eax
movl %eax, -0x8c(%rbp)
leaq -0x8d(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x4770
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rcx
leaq -0x88(%rbp), %rdi
leaq -0x8c(%rbp), %rdx
callq 0x4790
jmp 0x346d
leaq -0x8e(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x4810
movq -0xe8(%rbp), %rsi
movq -0xf0(%rbp), %rcx
leaq -0x70(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0x4830
jmp 0x34a0
leaq -0x8e(%rbp), %rdi
callq 0x48b0
leaq -0x88(%rbp), %rdi
callq 0x48d0
leaq -0x8d(%rbp), %rdi
callq 0x4930
leaq -0x70(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4950
movq %rax, %rdi
movl 0xbd3e(%rip), %eax      # 0xf218
addl $0x0, %eax
movslq %eax, %rsi
callq 0x4970
movl $0x0, (%rax)
movl $0x0, -0x94(%rbp)
movl -0x94(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl -0x18(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x37bf
xorl %eax, %eax
subl 0xbd04(%rip), %eax      # 0xf218
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
cmpl 0xbcf2(%rip), %eax      # 0xf218
jg 0x37a9
movl -0x58(%rbp), %eax
addl -0x94(%rbp), %eax
addl -0x98(%rbp), %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x58(%rbp), %eax
jl 0x355c
movl -0x9c(%rbp), %eax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jle 0x35a4
jmp 0x3795
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3593
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x8e(%rbp), %rdi
callq 0x48b0
leaq -0x88(%rbp), %rdi
callq 0x48d0
leaq -0x8d(%rbp), %rdi
callq 0x4930
jmp 0x393d
movslq -0x94(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x4950
movq %rax, %rdi
movl -0x98(%rbp), %eax
addl 0xbc55(%rip), %eax      # 0xf218
movslq %eax, %rsi
callq 0x4970
movl (%rax), %eax
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
cmpl 0xbc39(%rip), %eax      # 0xf218
jle 0x35e6
jmp 0x3795
movl -0x94(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl -0x18(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x36df
movl -0x9c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x36df
movl -0x94(%rbp), %eax
incl %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x4950
movq %rax, %rdi
movl 0xbbef(%rip), %eax      # 0xf218
movl -0x98(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x4970
movq %rax, -0x108(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, -0xfc(%rbp)
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %eax
movl -0x94(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x23f0
movq %rax, -0xf8(%rbp)
jmp 0x366c
movq -0xf8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x114(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x9c(%rbp), %rsi
callq 0x23f0
movq %rax, -0x110(%rbp)
jmp 0x3695
movq -0x108(%rbp), %rdi
movl -0xfc(%rbp), %esi
movl -0x114(%rbp), %eax
movq -0x110(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
addl %eax, %esi
callq 0x3320
jmp 0x36df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x4a70
jmp 0x393d
movl -0x98(%rbp), %eax
addl $0x1, %eax
cmpl 0xbb2a(%rip), %eax      # 0xf218
jg 0x372b
movslq -0x94(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x4950
movq %rax, %rdi
movl 0xbb0f(%rip), %eax      # 0xf218
addl -0x98(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x4970
movq %rax, %rdi
movl -0xa0(%rbp), %esi
addl $0x1, %esi
callq 0x3320
movl -0x94(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl -0x18(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x3793
movl -0x98(%rbp), %eax
subl $0x1, %eax
xorl %ecx, %ecx
subl 0xbac9(%rip), %ecx      # 0xf218
cmpl %ecx, %eax
jl 0x3793
movl -0x94(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x4950
movq %rax, %rdi
movl 0xbaa7(%rip), %eax      # 0xf218
addl -0x98(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x4970
movq %rax, %rdi
movl -0xa0(%rbp), %esi
addl $0x1, %esi
callq 0x3320
jmp 0x3795
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x351a
jmp 0x37ab
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x34f5
xorl %eax, %eax
subl 0xba51(%rip), %eax      # 0xf218
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
cmpl 0xba3f(%rip), %eax      # 0xf218
jg 0x38ef
movl -0x58(%rbp), %eax
addl -0x1c(%rbp), %eax
subl -0x18(%rbp), %eax
addl $0x1, %eax
addl -0xa4(%rbp), %eax
movl %eax, -0xa8(%rbp)
movl -0x1c(%rbp), %eax
subl -0x18(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x4950
movq %rax, %rdi
movl -0xa4(%rbp), %eax
addl 0xb9fd(%rip), %eax      # 0xf218
movslq %eax, %rsi
callq 0x4970
movl (%rax), %eax
cmpl 0xb9ed(%rip), %eax      # 0xf218
jg 0x38d9
leaq -0x18(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x4990
movq %rax, -0x120(%rbp)
jmp 0x3847
movq -0x120(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x12c(%rbp)
movl -0xa8(%rbp), %eax
decl %eax
movl %eax, -0xac(%rbp)
leaq -0xac(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x49d0
movq %rax, -0x128(%rbp)
jmp 0x387d
movl -0x12c(%rbp), %eax
movq -0x128(%rbp), %rcx
cmpl (%rcx), %eax
jg 0x3890
jmp 0x38db
movl -0xa8(%rbp), %eax
decl %eax
movl %eax, -0xb8(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x4a40
movq %rax, -0x138(%rbp)
jmp 0x38b7
movq -0x138(%rbp), %rax
movq %rax, -0xb4(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0xb4(%rbp), %rsi
callq 0x4a10
jmp 0x38d7
jmp 0x38d9
jmp 0x38db
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x37cd
leaq -0x70(%rbp), %rdi
callq 0x4a70
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x33ca
movq -0xd0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2730
jmp 0x3918
leaq -0x38(%rbp), %rdi
callq 0x4340
movq -0xc8(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x4340
movq -0x50(%rbp), %rdi
callq 0x2380
nop