// File: shangjingbo1226[P]MACFP/src/methods/MACFP.cpp
// Function: getSup(int, int)
vector<PII> getSup(int l, int r)
{
    int length = r - l + 1;
    myAssert(length >= LEN_THRES, "Length OK!");

    CHUNK_SIZE = (r - l + 1) / (EDIT_DIS_THRES + 1);
    //CHUNK_SIZE = LEN_THRES / (EDIT_DIS_THRES + 1);
    int chunkN = (r - l + 1) / CHUNK_SIZE;

    myAssert(chunkN >= EDIT_DIS_THRES + 1, "Not Enough Chunks!");

    explored.clear();
    vector<PII> ret(1, make_pair(l, r));
    for (int i = 0, start = l; i < chunkN; ++ i) {
        int end = start + CHUNK_SIZE + (i < (r - l + 1) % CHUNK_SIZE) - 1;
        vector<int> positions = getOccurrence(start, end);
        FOR (match, positions) {
            if ((*match) == start) {
                continue;
            }
            dfs(l, r, (*match), (*match) + end - start, start, end, EDIT_DIS_THRES, ret);
        }
        vector<PII> temp = makeMaximal(ret);
        if (temp.size() >= MIN_SUP) {
            return temp;
        }
        start = end + 1;
    }
    return makeMaximal(ret);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0xf8(%rbp)
movq %rdi, %rax
movq %rax, -0xf0(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
subl %ecx, %eax
incl %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl 0x22e50(%rip), %ecx     # 0x2926c
subl %ecx, %eax
setge %al
movb %al, -0xe1(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x3430
movq -0xe0(%rbp), %rdx
leaq 0x15cbb(%rip), %rsi     # 0x1c100
leaq -0x38(%rbp), %rdi
callq 0x8300
jmp 0x6450
movb -0xe1(%rbp), %al
movzbl %al, %edi
andl $0x1, %edi
leaq -0x38(%rbp), %rsi
callq 0x3a80
jmp 0x6467
leaq -0x38(%rbp), %rdi
callq 0x34a8
leaq -0x39(%rbp), %rdi
callq 0x32c0
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
subl %ecx, %eax
incl %eax
movl 0x22ddf(%rip), %ecx     # 0x29268
incl %ecx
cltd
idivl %ecx
movl %eax, 0x5f81010(%rip)   # 0x5f874a4
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
subl %ecx, %eax
incl %eax
movl 0x5f81000(%rip), %ecx   # 0x5f874a4
cltd
idivl %ecx
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl 0x22db5(%rip), %ecx     # 0x29268
incl %ecx
subl %ecx, %eax
setge %al
movb %al, -0x101(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x3430
movq -0x100(%rbp), %rdx
leaq 0x15c2d(%rip), %rsi     # 0x1c10b
leaq -0x70(%rbp), %rdi
callq 0x8300
jmp 0x64e9
movb -0x101(%rbp), %al
movzbl %al, %edi
andl $0x1, %edi
leaq -0x70(%rbp), %rsi
callq 0x3a80
jmp 0x6500
leaq -0x70(%rbp), %rdi
callq 0x34a8
leaq -0x71(%rbp), %rdi
callq 0x32c0
leaq 0x5f80f8f(%rip), %rdi   # 0x5f874a8
callq 0x9010
leaq -0xc(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x8fe0
movq %rax, -0x98(%rbp)
leaq -0x99(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x9030
movq -0x110(%rbp), %rcx
leaq -0x90(%rbp), %rdi
movl $0x1, %esi
leaq -0x98(%rbp), %rdx
callq 0x9050
jmp 0x6566
leaq -0x99(%rbp), %rdi
callq 0x90d0
movl $0x0, -0xa0(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0xa4(%rbp)
movl -0xa0(%rbp), %eax
cmpl -0x50(%rbp), %eax
jge 0x6835
movl -0xa4(%rbp), %eax
movl 0x5f80f04(%rip), %esi   # 0x5f874a4
addl %esi, %eax
movl %eax, -0x114(%rbp)
movl -0xa0(%rbp), %ecx
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %edx
subl %edx, %eax
incl %eax
cltd
idivl %esi
movl -0x114(%rbp), %eax
subl %edx, %ecx
setl %cl
movzbl %cl, %edx
movl %eax, %ecx
movl %edx, %eax
leal -0x1(%rax,%rcx), %eax
movl %eax, -0xa8(%rbp)
movl -0xa4(%rbp), %esi
movl -0xa8(%rbp), %edx
leaq -0xc0(%rbp), %rdi
callq 0x44d0
jmp 0x65f1
leaq -0xc0(%rbp), %rdi
callq 0x90f0
movq %rax, -0xc8(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x9160
movq %rax, -0xd0(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x9120
testb $0x1, %al
jne 0x6633
jmp 0x6792
leaq -0xc8(%rbp), %rdi
callq 0x9190
movl (%rax), %eax
cmpl -0xa4(%rbp), %eax
jne 0x66e2
jmp 0x6764
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6675
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x34a8
leaq -0x39(%rbp), %rdi
callq 0x32c0
jmp 0x687c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x66a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x34a8
leaq -0x71(%rbp), %rdi
callq 0x32c0
jmp 0x687c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x99(%rbp), %rdi
callq 0x90d0
jmp 0x687c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6870
movl -0xc(%rbp), %eax
movl %eax, -0x120(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x11c(%rbp)
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x9190
movq -0x128(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x118(%rbp)
callq 0x9190
movl -0x120(%rbp), %edi
movl -0x11c(%rbp), %esi
movl -0x118(%rbp), %edx
movl (%rax), %ecx
movl -0xa8(%rbp), %r9d
addl %r9d, %ecx
movl -0xa4(%rbp), %r8d
subl %r8d, %ecx
movl 0x22b1e(%rip), %r10d    # 0x29268
movq %rsp, %rax
leaq -0x90(%rbp), %r11
movq %r11, 0x8(%rax)
movl %r10d, (%rax)
callq 0x5fc0
jmp 0x6762
jmp 0x6764
leaq -0xc8(%rbp), %rdi
callq 0x91b0
jmp 0x6604
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x8640
jmp 0x6870
movq -0xf8(%rbp), %rdi
movb $0x0, -0xd1(%rbp)
leaq -0x90(%rbp), %rsi
callq 0x38e0
jmp 0x67ae
movq -0xf8(%rbp), %rdi
callq 0x80c0
movslq 0x22aa3(%rip), %rcx     # 0x29264
cmpq %rcx, %rax
jb 0x67d9
movb $0x1, -0xd1(%rbp)
movl $0x1, -0xd8(%rbp)
jmp 0x67f2
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movl $0x0, -0xd8(%rbp)
testb $0x1, -0xd1(%rbp)
jne 0x6807
movq -0xf8(%rbp), %rdi
callq 0x8170
leaq -0xc0(%rbp), %rdi
callq 0x8640
movl -0xd8(%rbp), %eax
testl %eax, %eax
jne 0x6854
jmp 0x681f
jmp 0x6821
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0x6585
movq -0xf8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x38e0
jmp 0x684a
movl $0x1, -0xd8(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x8170
movq -0xf0(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
leaq -0x90(%rbp), %rdi
callq 0x8170
movq -0x48(%rbp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)