// File: /workspace/github_c_makefile_star2_O1/arq5x[P]grabix/grabix.cpp
// Function: load_index(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, index_info&)
void load_index(string bgzf_file, index_info &index)
{
    string index_file_name = bgzf_file + ".gbi";
    // open the index file for reading
    ifstream index_file(index_file_name.c_str(), ios::in);

    if ( !index_file ) {
        cerr << "[grabix] could not find index file: " << index_file_name << ". Exiting!" << endl;
        exit (1);
    }
    else {
        string line;
        getline (index_file, line);
        index.header_end = atol(line.c_str());

        getline (index_file, line);
        index.num_lines = atol(line.c_str());

        while (index_file >> line)
        {
            index.chunk_offsets.push_back(atol(line.c_str()));
        }
    }
    index_file.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movq %rsi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x29ca
leaq 0x1e63(%rip), %rsi      # 0x5383
movq %r14, %rdi
callq 0x2430
movq 0x8(%rsp), %rsi
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x2410
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rcx
testb $0x5, 0x70(%rsp,%rcx)
jne 0x3687
leaq 0x38(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
movb $0x0, (%rbp)
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %edx
leaq 0x50(%rsp), %r14
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x2420
movq 0x28(%rsp), %rdi
callq 0x22e0
movq %rax, (%rbx)
movq 0x50(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2220
movsbl %al, %edx
leaq 0x50(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x2420
leaq 0x28(%rsp), %r14
movq (%r14), %rdi
callq 0x22e0
movq %rax, 0x20(%rbx)
leaq 0x8(%rbx), %r15
leaq 0x50(%rsp), %r12
leaq 0x48(%rsp), %r13
movq %r12, %rdi
movq %r14, %rsi
callq 0x2310
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x362e
movq 0x28(%rsp), %rdi
callq 0x22e0
movq %rax, 0x48(%rsp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x3621
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x10(%rbx)
jmp 0x35e2
movq %r15, %rdi
movq %r13, %rdx
callq 0x3fe6
jmp 0x35e2
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3645
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2260
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rbx
callq 0x2050
leaq 0x50(%rsp), %rdi
callq 0x2060
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3675
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2260
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4962(%rip), %rdi      # 0x7ff0
leaq 0x1cf3(%rip), %rsi      # 0x5388
movl $0x24, %edx
callq 0x22a0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x4940(%rip), %rdi      # 0x7ff0
callq 0x22a0
movq %rax, %rbx
leaq 0x1cee(%rip), %rsi      # 0x53ad
movl $0xa, %edx
movq %rax, %rdi
callq 0x22a0
movq %rbx, %rdi
callq 0x20e0
movl $0x1, %edi
callq 0x22f0
movq %rax, %rbx
jmp 0x371f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x372e
jmp 0x373b
movq %rax, %rbx
jmp 0x3715
jmp 0x36fb
jmp 0x36fb
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3715
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2260
leaq 0x50(%rsp), %rdi
callq 0x2060
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x373b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2260
movq %rbx, %rdi
callq 0x23f0