// File: 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:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq $0x0, 0x80(%rsp)
movq 0x98(%rsp), %rdi
callq 0x8170
movq %rax, %rdi
leaq 0x63e24(%rip), %rsi     # 0x7a74b
callq 0x8600
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
callq 0x16bf0
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rdi
callq 0x16c30
movl %eax, 0x7c(%rsp)
cmpl $0x0, %eax
jl 0x16981
movq 0x88(%rsp), %rax
movq 0x30(%rax), %rax
addq $0x1, %rax
addq 0x80(%rsp), %rax
movq %rax, 0x80(%rsp)
jmp 0x16949
movq 0x90(%rsp), %rdi
callq 0x86f0
movq 0x28(%rsp), %rdi
addq $0x50, %rdi
movq 0x80(%rsp), %rsi
callq 0x8680
movq 0x98(%rsp), %rdi
callq 0x8170
movq %rax, %rdi
leaq 0x63d90(%rip), %rsi     # 0x7a74b
callq 0x8600
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
callq 0x16bf0
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rdi
callq 0x16c30
movl %eax, 0x7c(%rsp)
cmpl $0x0, %eax
jl 0x16bb8
movq 0x88(%rsp), %rax
movq 0x10(%rax), %rsi
leaq 0x668a4(%rip), %rdi     # 0x7d2ae
movb $0x0, %al
callq 0x8070
movq 0x88(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x16a3a
movq 0x88(%rsp), %rax
movq 0x28(%rax), %rsi
leaq 0x66885(%rip), %rdi     # 0x7d2b8
movb $0x0, %al
callq 0x8070
movq $0x0, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq 0x88(%rsp), %rcx
cmpq 0x30(%rcx), %rax
jae 0x16a96
movq 0x88(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x70(%rsp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x85d0
movb %al, %dl
movq 0x88(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x70(%rsp), %rcx
movb %dl, (%rax,%rcx)
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
jmp 0x16a43
movq 0x88(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
leaq 0x4f(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x8750
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
leaq 0x50(%rsp), %rdi
callq 0x8430
jmp 0x16ad9
leaq 0x4f(%rsp), %rdi
callq 0x83e0
movq 0x28(%rsp), %rdi
addq $0x50, %rdi
callq 0x8630
cmpq $0x0, %rax
jbe 0x16b48
movq 0x28(%rsp), %rdi
addq $0x50, %rdi
movl $0x60, %esi
callq 0x8210
jmp 0x16b0c
jmp 0x16b48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
leaq 0x4f(%rsp), %rdi
callq 0x83e0
jmp 0x16bda
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x8858
jmp 0x16bda
movq 0x28(%rsp), %rdi
movq %rdi, %rax
addq $0x18, %rax
movq %rax, 0x8(%rsp)
addq $0x50, %rdi
callq 0x8630
movq 0x8(%rsp), %rdi
movq %rax, 0x30(%rsp)
leaq 0x30(%rsp), %rsi
callq 0x1eaf0
jmp 0x16b78
movq 0x28(%rsp), %rdi
addq $0x50, %rdi
movq 0x88(%rsp), %rax
movq 0x30(%rax), %rdx
movq 0x40(%rax), %rsi
callq 0x80a0
jmp 0x16b98
movq 0x28(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x1eb20
jmp 0x16ba9
leaq 0x50(%rsp), %rdi
callq 0x8858
jmp 0x169dd
movq 0x88(%rsp), %rdi
callq 0x17070
movq 0x90(%rsp), %rdi
callq 0x86f0
addq $0xa8, %rsp
retq
movq 0x40(%rsp), %rdi
callq 0x8730
nopw %cs:(%rax,%rax)