// File: /workspace/github_cpp_makefile_star2_O3/readmapping[P]alfalfa/src/sparseSA.cpp
// Function: sparseSA::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool sparseSA::load(const string &prefix){
    cerr << "atempting to load index " << prefix  << " ... "<< endl;
    string basic = prefix;
    string aux = basic + ".aux";
    string sa = basic + ".sa";
    string lcp = basic + ".lcp";
    string ref = basic + ".ref";
    ifstream aux_s (aux.c_str());
    if(!aux_s.is_open()){
        cerr << "unable to open " << prefix << endl;
        return false;
    }
    string line;
    getline(aux_s,line); N = atol(line.c_str());
    getline(aux_s,line); K = atol(line.c_str());
    getline(aux_s,line); logN = atol(line.c_str());
    getline(aux_s,line); NKm1 = atol(line.c_str());
    getline(aux_s,line); hasSufLink = atoi(line.c_str()) == 1 ? true : false;
    getline(aux_s,line); hasChild = atoi(line.c_str()) == 1 ? true : false;
    getline(aux_s,line); hasKmer = atoi(line.c_str()) == 1 ? true : false;
    getline(aux_s,line); 
    int chromNumber = atoi(line.c_str());
    for(int i = 0; i < chromNumber; i++){
        getline(aux_s,line); 
        startpos.push_back(atol(line.c_str()));
    }
    for(int i = 0; i < chromNumber; i++){
        getline(aux_s,line); 
        descr.push_back(line);
    }
    //read auxiliary information
    aux_s.close();
    //read ref
    ifstream ref_s (ref.c_str());
    getline(ref_s,S);
    ref_s.close();
    //read sa
    ifstream sa_s (sa.c_str(), ios::binary);
    unsigned int sizeSA;
    sa_s.read((char*)&sizeSA,sizeof(sizeSA));
    SA.resize(sizeSA);
    sa_s.read((char*)&SA[0],sizeSA*sizeof(unsigned int));
    sa_s.close();
    //read LCP
    ifstream lcp_s (lcp.c_str(), ios::binary);
    unsigned int sizeLCP;
    unsigned int sizeM;
    lcp_s.read((char*)&sizeLCP,sizeof(sizeLCP));
    lcp_s.read((char*)&sizeM,sizeof(sizeM));
    LCP.vec.resize(sizeLCP);
    LCP.M.resize(sizeM);
    lcp_s.read((char*)&LCP.vec[0],sizeLCP*sizeof(unsigned char));
    lcp_s.read((char*)&LCP.M[0],sizeM*sizeof(vec_uchar::item_t));
    lcp_s.close();
    //read ISA if nec
    if(hasSufLink){
        string isa = basic + ".isa";
        ifstream isa_s (isa.c_str(), ios::binary);
        unsigned int sizeISA;
        isa_s.read((char*)&sizeISA,sizeof(sizeISA));
        ISA.resize(sizeISA);
        isa_s.read((char*)&ISA[0],sizeISA*sizeof(int));
        isa_s.close();
    }
    //read child if nec
    if(hasChild){
        string child = basic + ".child";
        ifstream child_s (child.c_str(), ios::binary);
        unsigned int sizeCHILD;
        child_s.read((char*)&sizeCHILD,sizeof(sizeCHILD));
        CHILD.resize(sizeCHILD);
        child_s.read((char*)&CHILD[0],sizeCHILD*sizeof(int));
        child_s.close();
    }
    //read kmer table if nec
    if(hasKmer){
        string kmer = basic + ".kmer";
        ifstream kmer_s (kmer.c_str(), ios::binary);
        unsigned int sizeKMR;
        kmer_s.read((char*)&sizeKMR,sizeof(sizeKMR));
        KMR.resize(sizeKMR);
        kmer_s.read((char*)&KMR[0],sizeKMR*sizeof(saTuple_t));
        kmer_s.close();
    }
    cerr << "index loaded succesful" << endl;
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb28, %rsp            # imm = 0xB28
movq %rsi, %r15
movq %rdi, %r14
movq 0x422e2(%rip), %rbx     # 0x53fe8
leaq 0x325dd(%rip), %rsi     # 0x442ea
movl $0x18, %edx
movq %rbx, %rdi
callq 0x7340
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x7340
movq %rax, %rbx
leaq 0x3309a(%rip), %rsi     # 0x44dcd
movl $0x5, %edx
movq %rax, %rdi
callq 0x7340
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
leaq 0x70(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0xc1d8
leaq 0xf0(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0xe0(%rsp), %rdi
callq 0xc1d8
leaq 0x32503(%rip), %rsi     # 0x442b5
leaq 0xe0(%rsp), %rdi
callq 0x7680
leaq 0xd0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc0(%rsp), %rdi
callq 0xc1d8
movq %r14, 0x8(%rsp)
leaq 0x324c9(%rip), %rsi     # 0x442ba
leaq 0xc0(%rsp), %rdi
callq 0x7680
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa0(%rsp), %rdi
callq 0xc1d8
leaq 0x32493(%rip), %rsi     # 0x442be
leaq 0xa0(%rsp), %rdi
callq 0x7680
leaq 0x90(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
leaq 0x80(%rsp), %rdi
callq 0xc1d8
leaq 0x3245e(%rip), %rsi     # 0x442c3
leaq 0x80(%rsp), %rdi
callq 0x7680
movq 0xe0(%rsp), %rsi
leaq 0x100(%rsp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x7640
leaq 0x178(%rsp), %rdi
callq 0x70c0
movb %al, 0x7(%rsp)
testb %al, %al
je 0x1262f
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x100(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movq 0x8(%rsp), %r14
movsbl %al, %edx
leaq 0x100(%rsp), %rbx
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x7650
movq 0x30(%rsp), %rdi
callq 0x7390
movq %rax, 0x38(%r14)
movq 0x100(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %edx
leaq 0x100(%rsp), %rbx
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x7650
movq 0x30(%rsp), %rdi
callq 0x7390
movq %rax, 0xe8(%r14)
movq 0x100(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %edx
leaq 0x100(%rsp), %rbx
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x7650
movq 0x30(%rsp), %rdi
callq 0x7390
movq %rax, 0x40(%r14)
movq 0x100(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %edx
leaq 0x100(%rsp), %rbx
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x7650
movq 0x30(%rsp), %rdi
callq 0x7390
movq %rax, 0x48(%r14)
movq 0x100(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %edx
leaq 0x100(%rsp), %rbx
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x7650
movq 0x30(%rsp), %rdi
callq 0x7520
cmpl $0x1, %eax
sete 0xf1(%r14)
movq 0x100(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %edx
leaq 0x100(%rsp), %rbx
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x7650
movq 0x30(%rsp), %rdi
callq 0x7520
cmpl $0x1, %eax
sete 0xf0(%r14)
movq 0x100(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %edx
leaq 0x100(%rsp), %rbx
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x7650
movq 0x30(%rsp), %rdi
callq 0x7520
cmpl $0x1, %eax
sete 0xf8(%r14)
movq 0x100(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %edx
leaq 0x100(%rsp), %r15
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
callq 0x7650
movq 0x30(%rsp), %rdi
callq 0x7520
testl %eax, %eax
jle 0x121ad
movl %eax, %r14d
movq 0x8(%rsp), %rax
leaq 0x18(%rax), %r12
leaq 0x30(%rsp), %r13
leaq 0x718(%rsp), %rbx
movl %r14d, %ebp
movq 0x100(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x7650
movq 0x30(%rsp), %rdi
callq 0x7390
movq %rax, 0x718(%rsp)
movq 0x8(%rsp), %rcx
movq 0x20(%rcx), %rsi
cmpq 0x28(%rcx), %rsi
je 0x12146
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x20(%rcx)
jmp 0x12151
movq %r12, %rdi
movq %rbx, %rdx
callq 0x17184
decl %ebp
jne 0x120f1
testl %r14d, %r14d
leaq 0x70(%rsp), %r12
leaq 0xf0(%rsp), %r13
leaq 0xd0(%rsp), %rbp
jle 0x121ad
leaq 0x30(%rsp), %rbx
movq 0x100(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7650
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x15962
decl %r14d
jne 0x12174
leaq 0x100(%rsp), %rdi
callq 0x70b0
movq 0x80(%rsp), %rsi
leaq 0x718(%rsp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
leaq 0xb0(%rsp), %r14
callq 0x7640
movq 0x718(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movq 0x8(%rsp), %rcx
leaq 0x50(%rcx), %rsi
movsbl %al, %edx
leaq 0x718(%rsp), %rdi
callq 0x7650
leaq 0x718(%rsp), %rdi
callq 0x70b0
movq 0xc0(%rsp), %rsi
leaq 0x920(%rsp), %rdi
movl $0x4, %edx
callq 0x7640
leaq 0x920(%rsp), %rdi
leaq 0x5c(%rsp), %rsi
movl $0x4, %edx
callq 0x73e0
movq 0x8(%rsp), %rax
leaq 0x70(%rax), %rbx
movl 0x5c(%rsp), %esi
movq %rbx, %rdi
callq 0x15a5e
movq (%rbx), %rsi
movl 0x5c(%rsp), %edx
shlq $0x2, %rdx
leaq 0x920(%rsp), %rdi
callq 0x73e0
leaq 0x920(%rsp), %rdi
callq 0x70b0
movq 0xa0(%rsp), %rsi
leaq 0x510(%rsp), %rdi
movl $0x4, %edx
callq 0x7640
leaq 0x510(%rsp), %rdi
leaq 0x58(%rsp), %rsi
movl $0x4, %edx
callq 0x73e0
leaq 0x510(%rsp), %rdi
leaq 0x54(%rsp), %rsi
movl $0x4, %edx
callq 0x73e0
movq 0x8(%rsp), %rax
leaq 0xa0(%rax), %r15
movl 0x58(%rsp), %esi
movq %r15, %rdi
callq 0x15a90
movq 0x8(%rsp), %rax
leaq 0xb8(%rax), %rbx
movl 0x54(%rsp), %esi
movq %rbx, %rdi
callq 0x15abc
movq (%r15), %rsi
movl 0x58(%rsp), %edx
leaq 0x510(%rsp), %rdi
callq 0x73e0
movq (%rbx), %rsi
movl 0x54(%rsp), %edx
shlq $0x4, %rdx
leaq 0x510(%rsp), %rdi
callq 0x73e0
leaq 0x510(%rsp), %rdi
callq 0x70b0
movq 0x8(%rsp), %rax
cmpb $0x1, 0xf1(%rax)
jne 0x12408
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xc1d8
leaq 0x31f65(%rip), %rsi     # 0x442d8
leaq 0x10(%rsp), %rdi
callq 0x7680
movq 0x10(%rsp), %rsi
leaq 0x308(%rsp), %rdi
movl $0x4, %edx
callq 0x7640
leaq 0x308(%rsp), %rdi
movq %rsp, %rsi
movl $0x4, %edx
callq 0x73e0
movq 0x8(%rsp), %rax
leaq 0x88(%rax), %rbx
movl (%rsp), %esi
movq %rbx, %rdi
callq 0x15af0
movq (%rbx), %rsi
movl (%rsp), %edx
shlq $0x2, %rdx
leaq 0x308(%rsp), %rdi
callq 0x73e0
leaq 0x308(%rsp), %rdi
callq 0x70b0
leaq 0x308(%rsp), %rdi
callq 0x70d0
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x12408
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0x8(%rsp), %rax
cmpb $0x1, 0xf0(%rax)
jne 0x124d6
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xc1d8
leaq 0x31e9c(%rip), %rsi     # 0x442dd
leaq 0x10(%rsp), %rdi
callq 0x7680
movq 0x10(%rsp), %rsi
leaq 0x308(%rsp), %rdi
movl $0x4, %edx
callq 0x7640
leaq 0x308(%rsp), %rdi
movq %rsp, %rsi
movl $0x4, %edx
callq 0x73e0
movq 0x8(%rsp), %rax
leaq 0xd0(%rax), %rbx
movl (%rsp), %esi
movq %rbx, %rdi
callq 0x15af0
movq (%rbx), %rsi
movl (%rsp), %edx
shlq $0x2, %rdx
leaq 0x308(%rsp), %rdi
callq 0x73e0
leaq 0x308(%rsp), %rdi
callq 0x70b0
leaq 0x308(%rsp), %rdi
callq 0x70d0
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x124d6
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0x8(%rsp), %rax
cmpb $0x1, 0xf8(%rax)
jne 0x125a4
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xc1d8
leaq 0x31dd5(%rip), %rsi     # 0x442e4
leaq 0x10(%rsp), %rdi
callq 0x7680
movq 0x10(%rsp), %rsi
leaq 0x308(%rsp), %rdi
movl $0x4, %edx
callq 0x7640
leaq 0x308(%rsp), %rdi
movq %rsp, %rsi
movl $0x4, %edx
callq 0x73e0
movq 0x8(%rsp), %rbx
addq $0x100, %rbx            # imm = 0x100
movl (%rsp), %esi
movq %rbx, %rdi
callq 0x15b22
movq (%rbx), %rsi
movl (%rsp), %edx
shlq $0x3, %rdx
leaq 0x308(%rsp), %rdi
callq 0x73e0
leaq 0x308(%rsp), %rdi
callq 0x70b0
leaq 0x308(%rsp), %rdi
callq 0x70d0
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x125a4
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0x41a3d(%rip), %rbx     # 0x53fe8
leaq 0x31d61(%rip), %rsi     # 0x44313
movl $0x16, %edx
movq %rbx, %rdi
callq 0x7340
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq 0x41a0b(%rip), %rdi     # 0x53fe8
callq 0x7040
movq %rax, %rdi
callq 0x71d0
leaq 0x510(%rsp), %rdi
callq 0x70d0
leaq 0x920(%rsp), %rdi
callq 0x70d0
leaq 0x718(%rsp), %rdi
callq 0x70d0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x12684
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x72f0
jmp 0x12684
movq 0x419b2(%rip), %rdi     # 0x53fe8
leaq 0x31cc6(%rip), %rsi     # 0x44303
movl $0xf, %edx
callq 0x7340
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0x41993(%rip), %rdi     # 0x53fe8
callq 0x7340
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x72b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x71d0
leaq 0x100(%rsp), %rdi
callq 0x70d0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x126b6
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x126d3
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0xc0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x126f0
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0xe0(%rsp), %rdi
cmpq %r13, %rdi
je 0x1270d
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x12724
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x72f0
movb 0x7(%rsp), %al
addq $0xb28, %rsp            # imm = 0xB28
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1274e
jmp 0x1274e
jmp 0x12826
jmp 0x1274e
jmp 0x1274e
jmp 0x12826
jmp 0x1274e
movq %rax, %rbx
jmp 0x12780
jmp 0x12826
jmp 0x1281a
jmp 0x12815
jmp 0x12856
jmp 0x12856
jmp 0x12770
jmp 0x12770
movq %rax, %rbx
leaq 0x308(%rsp), %rdi
callq 0x70d0
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x12829
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72f0
jmp 0x12829
jmp 0x127a2
movq %rax, %rbx
jmp 0x12882
movq %rax, %rbx
jmp 0x128a7
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
jne 0x128bc
jmp 0x128cc
movq %rax, %rbx
jmp 0x128cc
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x128e1
jmp 0x128f1
movq %rax, %rbx
jmp 0x128f1
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
cmpq %r13, %rdi
jne 0x12906
jmp 0x12916
movq %rax, %rbx
jmp 0x12916
movq %rax, %rbx
jmp 0x12843
movq %rax, %rbx
jmp 0x12836
movq %rax, %rbx
jmp 0x12875
jmp 0x12856
movq %rax, %rbx
leaq 0x510(%rsp), %rdi
callq 0x70d0
leaq 0x920(%rsp), %rdi
callq 0x70d0
leaq 0x718(%rsp), %rdi
callq 0x70d0
jmp 0x12859
jmp 0x12856
jmp 0x12856
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x12875
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x72f0
leaq 0x100(%rsp), %rdi
callq 0x70d0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x128a7
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x128cc
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x128f1
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x12916
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x72f0
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x12932
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x72f0
movq %rbx, %rdi
callq 0x7600