// File: shangjingbo1226[P]MACFP/src/methods/MACFP.cpp
// Function: getOccurrence(int, int)
vector<int> getOccurrence(int i, int j)
{
    vector<int> ret(1, i);
    int ptr = s->sa->rank[i];
    myAssert(s->sa->sa[ptr] == i, "Wrong SA rank");
    int length = j - i + 1;
    while (ptr > 0 && s->sa->height[ptr] >= length) {
        -- ptr;
        ret.push_back(s->sa->sa[ptr]);
    }
    ptr = s->sa->rank[i];
    while (ptr + 1 < s->size() && s->sa->height[ptr + 1] >= length) {
        ++ ptr;
        ret.push_back(s->sa->sa[ptr]);
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x60(%rbp)
movq %rdi, %rax
movq %rax, -0x68(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
leaq -0x12(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x84b0
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rcx
movl $0x1, %esi
leaq -0xc(%rbp), %rdx
callq 0x84d0
jmp 0x4519
leaq -0x12(%rbp), %rdi
callq 0x8550
movq 0x5f82edf(%rip), %rax   # 0x5f87408
movq 0x20(%rax), %rdi
addq $0xa0, %rdi
movslq -0xc(%rbp), %rsi
callq 0x8570
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movq 0x5f82ebf(%rip), %rax   # 0x5f87408
movq 0x20(%rax), %rdi
addq $0x28, %rdi
movslq -0x28(%rbp), %rsi
callq 0x8590
movl (%rax), %eax
movl -0xc(%rbp), %ecx
subl %ecx, %eax
sete %al
movb %al, -0x71(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x3430
movq -0x70(%rbp), %rdx
leaq 0x17b43(%rip), %rsi     # 0x1c0c2
leaq -0x48(%rbp), %rdi
callq 0x8300
jmp 0x458a
movb -0x71(%rbp), %al
movzbl %al, %edi
andl $0x1, %edi
leaq -0x48(%rbp), %rsi
callq 0x3a80
jmp 0x459e
leaq -0x48(%rbp), %rdi
callq 0x34a8
leaq -0x49(%rbp), %rdi
callq 0x32c0
movl -0x10(%rbp), %eax
subl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x28(%rbp)
movb %al, -0x72(%rbp)
jle 0x45f2
movq 0x5f82e3a(%rip), %rax   # 0x5f87408
movq 0x20(%rax), %rdi
addq $0xb8, %rdi
movslq -0x28(%rbp), %rsi
callq 0x8570
movq (%rax), %rax
movslq -0x50(%rbp), %rcx
cmpq %rcx, %rax
setge %al
movb %al, -0x72(%rbp)
movb -0x72(%rbp), %al
testb $0x1, %al
jne 0x45fe
jmp 0x468a
movl -0x28(%rbp), %eax
decl %eax
movl %eax, -0x28(%rbp)
movq 0x5f82dfb(%rip), %rax   # 0x5f87408
movq 0x20(%rax), %rdi
addq $0x28, %rdi
movslq -0x28(%rbp), %rsi
callq 0x8590
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x85b0
jmp 0x462c
jmp 0x45bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x12(%rbp), %rdi
callq 0x8550
jmp 0x477e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x466b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x34a8
leaq -0x49(%rbp), %rdi
callq 0x32c0
jmp 0x4775
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x4775
movq 0x5f82d77(%rip), %rax   # 0x5f87408
movq 0x20(%rax), %rdi
addq $0xa0, %rdi
movslq -0xc(%rbp), %rsi
callq 0x8570
movq (%rax), %rax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
incl %eax
cltq
movq %rax, -0x88(%rbp)
movq 0x5f82d48(%rip), %rdi   # 0x5f87408
callq 0x8620
movq %rax, -0x80(%rbp)
jmp 0x46cb
movq -0x88(%rbp), %rcx
movq -0x80(%rbp), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x89(%rbp)
jae 0x4716
movq 0x5f82d1e(%rip), %rax   # 0x5f87408
movq 0x20(%rax), %rdi
addq $0xb8, %rdi
movl -0x28(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x8570
movq (%rax), %rax
movslq -0x50(%rbp), %rcx
cmpq %rcx, %rax
setge %al
movb %al, -0x89(%rbp)
movb -0x89(%rbp), %al
testb $0x1, %al
jne 0x4722
jmp 0x4755
movl -0x28(%rbp), %eax
incl %eax
movl %eax, -0x28(%rbp)
movq 0x5f82cd7(%rip), %rax   # 0x5f87408
movq 0x20(%rax), %rdi
addq $0x28, %rdi
movslq -0x28(%rbp), %rsi
callq 0x8590
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x85b0
jmp 0x4750
jmp 0x46ab
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x4768
movq -0x60(%rbp), %rdi
callq 0x8640
movq -0x68(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x8640
movq -0x20(%rbp), %rdi
callq 0x3420
nopw (%rax,%rax)