// File: /workspace/github_cpp_makefile_star2_O3/readmapping[P]alfalfa/src/sparseSA.cpp
// Function: sparseSA::computeChild()
void sparseSA::computeChild() {
    for(long i = 0; i < N/K; i++){
        CHILD[i] = -1;
    }
    //Compute up and down values
    long lastIndex  = -1;
    stack<long,vector<long> > stapelUD;
    stapelUD.push(0);
    for(long i = 1; i < N/K; i++){
        while(LCP[i] < LCP[stapelUD.top()]){
            lastIndex = stapelUD.top();
            stapelUD.pop();
            if(LCP[i] <= LCP[stapelUD.top()] && LCP[stapelUD.top()] != LCP[lastIndex]){
                CHILD[stapelUD.top()] = lastIndex;
            }
        }
        //now LCP[i] >= LCP[top] holds
        if(lastIndex != -1){
            CHILD[i-1] = lastIndex;
            lastIndex = -1;
        }
        stapelUD.push(i);
    }
    while(0 < LCP[stapelUD.top()]){//last row (fix for last character of sequence not being unique
        lastIndex = stapelUD.top();
        stapelUD.pop();
        if(0 <= LCP[stapelUD.top()] && LCP[stapelUD.top()] != LCP[lastIndex]){
            CHILD[stapelUD.top()] = lastIndex;
        }
    }
    //Compute Next L-index values
    stack<long,vector<long> > stapelNL;
    stapelNL.push(0);
    for(long i = 1; i < N/K; i++){
        while(LCP[i] < LCP[stapelNL.top()])
            stapelNL.pop();
        lastIndex = stapelNL.top();
        if(LCP[i] == LCP[lastIndex]){
            stapelNL.pop();
            CHILD[lastIndex] = i;
        }
        stapelNL.push(i);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x38(%rdi), %rax
cqto
idivq 0xe8(%rdi)
testq %rax, %rax
jle 0x104d7
movq 0xd0(%rbx), %rdi
shlq $0x2, %rax
movl $0xff, %esi
movq %rax, %rdx
callq 0x7180
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, (%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
xorl %esi, %esi
callq 0x17184
movq 0x38(%rbx), %rax
cqto
idivq 0xe8(%rbx)
movq $0x1, 0x10(%rsp)
cmpq $0x2, %rax
jl 0x10637
leaq 0xa0(%rbx), %r14
movq $-0x1, %r13
movl $0x1, %esi
leaq 0x30(%rsp), %r15
leaq 0x10(%rsp), %r12
movq %r14, %rdi
callq 0x15a0e
movl %eax, %ebp
movq 0x38(%rsp), %rax
movq -0x8(%rax), %rsi
movq %r14, %rdi
callq 0x15a0e
cmpl %eax, %ebp
jge 0x105c9
movq 0x38(%rsp), %rax
movq -0x8(%rax), %r13
addq $-0x8, %rax
movq %rax, 0x38(%rsp)
movq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x15a0e
movl %eax, %ebp
movq 0x38(%rsp), %rax
movq -0x8(%rax), %rsi
movq %r14, %rdi
callq 0x15a0e
cmpl %eax, %ebp
jg 0x105bf
movq 0x38(%rsp), %rax
movq -0x8(%rax), %rsi
movq %r14, %rdi
callq 0x15a0e
movl %eax, %ebp
movq %r14, %rdi
movq %r13, %rsi
callq 0x15a0e
cmpl %eax, %ebp
je 0x105bf
movq 0x38(%rsp), %rax
movq -0x8(%rax), %rax
movq 0xd0(%rbx), %rcx
movl %r13d, (%rcx,%rax,4)
movq 0x10(%rsp), %rsi
jmp 0x10534
cmpq $-0x1, %r13
je 0x105e0
movq 0x10(%rsp), %rax
movq 0xd0(%rbx), %rcx
movl %r13d, -0x4(%rcx,%rax,4)
movq 0x38(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0x105ff
movq 0x10(%rsp), %rsi
movq %rsi, (%rax)
addq $0x8, %rax
movq %rax, 0x38(%rsp)
jmp 0x10612
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x174cc
movq 0x10(%rsp), %rsi
incq %rsi
movq %rsi, 0x10(%rsp)
movq 0x38(%rbx), %rax
cqto
idivq 0xe8(%rbx)
movq $-0x1, %r13
cmpq %rax, %rsi
jl 0x10534
leaq 0xa0(%rbx), %r14
movq 0x38(%rsp), %rax
movq -0x8(%rax), %rsi
movq %r14, %rdi
callq 0x15a0e
testl %eax, %eax
jle 0x106ad
movq 0x38(%rsp), %rax
leaq -0x8(%rax), %rcx
movq -0x8(%rax), %r15
movq %rcx, 0x38(%rsp)
movq -0x10(%rax), %rsi
movq %r14, %rdi
callq 0x15a0e
testl %eax, %eax
js 0x1063e
movq 0x38(%rsp), %rax
movq -0x8(%rax), %rsi
movq %r14, %rdi
callq 0x15a0e
movl %eax, %ebp
movq %r14, %rdi
movq %r15, %rsi
callq 0x15a0e
cmpl %eax, %ebp
je 0x1063e
movq 0x38(%rsp), %rax
movq -0x8(%rax), %rax
movq 0xd0(%rbx), %rcx
movl %r15d, (%rcx,%rax,4)
jmp 0x1063e
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
xorl %esi, %esi
callq 0x17184
movq $0x1, 0x8(%rsp)
movq 0x38(%rbx), %rax
cqto
idivq 0xe8(%rbx)
cmpq $0x2, %rax
jl 0x107b6
movl $0x1, %esi
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
movq %r14, %rdi
callq 0x15a0e
movl %eax, %ebp
movq 0x18(%rsp), %rax
movq -0x8(%rax), %rsi
movq %r14, %rdi
callq 0x15a0e
movq 0x18(%rsp), %rcx
addq $-0x8, %rcx
cmpl %eax, %ebp
jge 0x10730
movq %rcx, 0x18(%rsp)
movq 0x8(%rsp), %rsi
jmp 0x106fc
movq (%rcx), %r13
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x15a0e
movl %eax, %ebp
movq %r14, %rdi
movq %r13, %rsi
callq 0x15a0e
cmpl %eax, %ebp
jne 0x10766
addq $-0x8, 0x18(%rsp)
movl 0x8(%rsp), %eax
movq 0xd0(%rbx), %rcx
movl %eax, (%rcx,%r13,4)
movq 0x18(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0x10785
movq 0x8(%rsp), %rsi
movq %rsi, (%rax)
addq $0x8, %rax
movq %rax, 0x18(%rsp)
jmp 0x10798
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x174cc
movq 0x8(%rsp), %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq 0x38(%rbx), %rax
cqto
idivq 0xe8(%rbx)
cmpq %rax, %rsi
jl 0x106fc
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x107cd
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x72f0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x107e4
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x72f0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x107fb
jmp 0x10819
jmp 0x10819
jmp 0x107fb
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1081c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x72f0
jmp 0x1081c
jmp 0x10819
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x10833
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x72f0
movq %rbx, %rdi
callq 0x7600
nop