// File: /workspace/github_cpp_makefile_star2_O1/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 0x3175d(%rip), %rsi     # 0x4170b
callq 0x74b0
movq %rax, %r15
movq %rax, %rdi
callq 0x101cb
movq %rax, %r12
movq %rax, %rdi
callq 0x10215
xorl %r13d, %r13d
testl %eax, %eax
js 0xffe5
movq 0x30(%r12), %rax
addq %rax, %r13
incq %r13
movq %r12, %rdi
callq 0x10215
jmp 0xffcc
movq %r15, %rdi
callq 0x75b0
leaq 0x50(%rbx), %rdi
movq %rdi, (%rsp)
movq %r13, %rsi
callq 0x7530
movq (%r14), %rdi
leaq 0x31704(%rip), %rsi     # 0x4170b
callq 0x74b0
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0x101cb
movq %rax, %r15
movq %rax, %rdi
callq 0x10215
testl %eax, %eax
js 0x1013f
leaq 0x18(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x28(%rsp), %r12
movq %rbx, 0x18(%rsp)
movq %r12, %rbx
movq 0x10(%r15), %rbp
leaq 0x34251(%rip), %rdi     # 0x4429e
movq %rbp, %rsi
xorl %eax, %eax
callq 0x7060
cmpq $0x0, 0x18(%r15)
je 0x10070
movq 0x28(%r15), %rsi
leaq 0x3423f(%rip), %rdi     # 0x442a8
xorl %eax, %eax
callq 0x7060
movq 0x30(%r15), %r13
testq %r13, %r13
je 0x10096
movq 0x40(%r15), %r14
xorl %r12d, %r12d
movsbl (%r14,%r12), %edi
callq 0x7480
movb %al, (%r14,%r12)
incq %r12
cmpq %r12, %r13
jne 0x10080
movq (%r15), %rdx
addq %rbp, %rdx
leaq 0x38(%rsp), %r14
movq %r14, 0x28(%rsp)
movq %rbx, %r12
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xc2e4
movq 0x18(%rsp), %rbx
cmpq $0x0, 0x58(%rbx)
je 0x100ce
movq (%rsp), %rdi
movl $0x60, %esi
callq 0x7270
movq 0x58(%rbx), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rbx), %rsi
cmpq 0x28(%rbx), %rsi
je 0x100ee
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x20(%rbx)
jmp 0x100fd
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x173e4
movq 0x40(%r15), %rsi
movq (%rsp), %rdi
movq %r13, %rdx
callq 0x7090
movq %rbx, %rdi
movq %r12, %rsi
callq 0x15ace
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x1012f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72f0
movq %r15, %rdi
callq 0x10215
testl %eax, %eax
jns 0x1003f
testq %r15, %r15
je 0x10189
movq 0x10(%r15), %rdi
callq 0x7380
movq 0x28(%r15), %rdi
callq 0x7380
movq 0x40(%r15), %rdi
callq 0x7380
movq 0x58(%r15), %rdi
callq 0x7380
movq 0x68(%r15), %rbx
testq %rbx, %rbx
je 0x10181
movq (%rbx), %rdi
callq 0x7380
movq %rbx, %rdi
callq 0x7380
movq %r15, %rdi
callq 0x7380
movq 0x8(%rsp), %rdi
callq 0x75b0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x101a4
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x101c3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72f0
movq %rbx, %rdi
callq 0x7600