// File: /workspace/github_cpp_makefile_star2_O2/readmapping[P]alfalfa/src/sparseSA.cpp
// Function: sparseSA::loadRef(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void sparseSA::loadRef(const string & fileName){
    gzFile fp;
    kseq_t *seq;
    //first iteration for lengths (reserve in string)
    size_t Slength = 0;
    int l;
    fp = gzopen(fileName.c_str(), "r");
    seq = kseq_init(fp);
    while ((l = kseq_read(seq)) >= 0) {
        Slength += seq->seq.l+1;
    }
    gzclose(fp);
    S.reserve(Slength);
    fp = gzopen(fileName.c_str(), "r");
    seq = kseq_init(fp);
    while ((l = kseq_read(seq)) >= 0) {
            printf("name: %s\n", seq->name.s);
            if (seq->comment.l) printf("comment: %s\n", seq->comment.s);
            //to lower case
            for(size_t i = 0; i < seq->seq.l; i++){
                seq->seq.s[i] = std::tolower(seq->seq.s[i]);
            }
            string descrName(seq->name.s, seq->name.l);
            if(S.length() > 0)
                S += '`';
            startpos.push_back(S.length());
            S.append(seq->seq.s,seq->seq.l);
            descr.push_back(descrName);
    }
    kseq_destroy(seq);
    gzclose(fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdi
leaq 0x2648d(%rip), %rsi     # 0x3378b
callq 0x74c0
movq %rax, %r15
movq %rax, %rdi
callq 0xd4cf
movq %rax, %r12
xorl %r13d, %r13d
movq %r12, %rdi
callq 0xd515
testl %eax, %eax
js 0xd32d
movq 0x30(%r12), %rax
addq %rax, %r13
incq %r13
jmp 0xd314
movq %r15, %rdi
callq 0x75b0
leaq 0x50(%rbx), %rdi
movq %rdi, (%rsp)
movq %r13, %rsi
callq 0x7530
movq (%r14), %rdi
leaq 0x2643c(%rip), %rsi     # 0x3378b
callq 0x74c0
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0xd4cf
movq %rax, %r15
leaq 0x18(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x28(%rsp), %r14
movq %rbx, 0x18(%rsp)
movq %r15, %rdi
callq 0xd515
testl %eax, %eax
js 0xd455
movq %r14, %rbx
movq 0x10(%r15), %r13
leaq 0x28f59(%rip), %rdi     # 0x362ee
movq %r13, %rsi
xorl %eax, %eax
callq 0x7050
cmpq $0x0, 0x18(%r15)
je 0xd3b8
movq 0x28(%r15), %rsi
leaq 0x28f47(%rip), %rdi     # 0x362f8
xorl %eax, %eax
callq 0x7050
movq 0x30(%r15), %rbp
xorl %r12d, %r12d
cmpq %r12, %rbp
je 0xd3db
movq 0x40(%r15), %r14
movsbl (%r14,%r12), %edi
callq 0x7490
movb %al, (%r14,%r12)
incq %r12
jmp 0xd3bf
movq (%r15), %rdx
addq %r13, %rdx
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %rbx, %r14
movq %rbx, %rdi
movq %r13, %rsi
callq 0xa408
movq 0x18(%rsp), %rbx
cmpq $0x0, 0x58(%rbx)
je 0xd417
movq (%rsp), %rdi
pushq $0x60
popq %rsi
callq 0x7260
movq 0x58(%rbx), %rax
jmp 0xd419
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x127d0
movq 0x40(%r15), %rsi
movq (%rsp), %rdi
movq %rbp, %rdx
callq 0x7080
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10e56
movq %r14, %rdi
callq 0x76a8
jmp 0xd377
testq %r15, %r15
je 0xd49f
movq 0x10(%r15), %rdi
callq 0x7360
movq 0x28(%r15), %rdi
callq 0x7360
movq 0x40(%r15), %rdi
callq 0x7360
movq 0x58(%r15), %rdi
callq 0x7360
movq 0x68(%r15), %rbx
testq %rbx, %rbx
je 0xd497
movq (%rbx), %rdi
callq 0x7360
movq %rbx, %rdi
callq 0x7360
movq %r15, %rdi
callq 0x7360
movq 0x8(%rsp), %rdi
callq 0x75b0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd4ba
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x76a8
movq %rbx, %rdi
callq 0x75e0