// File: /workspace/github_cpp_makefile_star2_O3/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 0x318ed(%rip), %rsi     # 0x4170b
callq 0x74b0
movq %rax, %r15
movq %rax, %rdi
callq 0x10041
movq %rax, %r12
movq %rax, %rdi
callq 0x1008b
xorl %r13d, %r13d
testl %eax, %eax
js 0xfe55
movq 0x30(%r12), %rax
addq %rax, %r13
incq %r13
movq %r12, %rdi
callq 0x1008b
jmp 0xfe3c
movq %r15, %rdi
callq 0x75b0
leaq 0x50(%rbx), %rdi
movq %rdi, (%rsp)
movq %r13, %rsi
callq 0x7530
movq (%r14), %rdi
leaq 0x31894(%rip), %rsi     # 0x4170b
callq 0x74b0
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0x10041
movq %rax, %r15
movq %rax, %rdi
callq 0x1008b
testl %eax, %eax
js 0xffb5
leaq 0x18(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x28(%rsp), %r12
movq %rbx, 0x18(%rsp)
movq %r12, %rbx
movq 0x10(%r15), %rbp
leaq 0x343e1(%rip), %rdi     # 0x4429e
movq %rbp, %rsi
xorl %eax, %eax
callq 0x7060
cmpq $0x0, 0x18(%r15)
je 0xfee0
movq 0x28(%r15), %rsi
leaq 0x343cf(%rip), %rdi     # 0x442a8
xorl %eax, %eax
callq 0x7060
movq 0x30(%r15), %r13
testq %r13, %r13
je 0xff06
movq 0x40(%r15), %r14
xorl %r12d, %r12d
movsbl (%r14,%r12), %edi
callq 0x7480
movb %al, (%r14,%r12)
incq %r12
cmpq %r12, %r13
jne 0xfef0
movq (%r15), %rdx
addq %rbp, %rdx
leaq 0x38(%rsp), %r14
movq %r14, 0x28(%rsp)
movq %rbx, %r12
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xc2d0
movq 0x18(%rsp), %rbx
cmpq $0x0, 0x58(%rbx)
je 0xff44
movq (%rsp), %rdi
movl $0x60, %esi
callq 0x7270
movq 0x58(%rbx), %rax
jmp 0xff46
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movq 0x20(%rbx), %rsi
cmpq 0x28(%rbx), %rsi
je 0xff62
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x20(%rbx)
jmp 0xff71
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x17184
movq 0x40(%r15), %rsi
movq (%rsp), %rdi
movq %r13, %rdx
callq 0x7090
movq %rbx, %rdi
movq %r12, %rsi
callq 0x15962
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0xffa3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72f0
movq %r15, %rdi
callq 0x1008b
testl %eax, %eax
jns 0xfeaf
jmp 0xffba
testq %r15, %r15
je 0xffff
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 0xfff7
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 0x1001a
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x10039
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72f0
movq %rbx, %rdi
callq 0x7600