// File: /workspace/github_c_makefile_star2_O3/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 0x1e73(%rip), %rsi      # 0x5383
movq %r14, %rdi
callq 0x2430
movq 0x8(%rsp), %rsi
leaq 0x50(%rsp), %rdi
movl $0x8, %edx
callq 0x2410
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x70(%rsp,%rax)
jne 0x3675
leaq (%rsp,%rax), %rdi
addq $0x50, %rdi
leaq 0x38(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
movb $0x0, (%rbp)
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 0x361c
movq 0x28(%rsp), %rdi
callq 0x22e0
movq %rax, 0x48(%rsp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x360f
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x10(%rbx)
jmp 0x35d0
movq %r15, %rdi
movq %r13, %rdx
callq 0x3fd6
jmp 0x35d0
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3633
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 0x3663
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 0x4974(%rip), %rdi      # 0x7ff0
leaq 0x1d05(%rip), %rsi      # 0x5388
movl $0x24, %edx
callq 0x22a0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x4952(%rip), %rdi      # 0x7ff0
callq 0x22a0
movq %rax, %rbx
leaq 0x1d00(%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 0x370d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x371c
jmp 0x3729
movq %rax, %rbx
jmp 0x3703
jmp 0x36e9
jmp 0x36e9
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3703
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 0x3729
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2260
movq %rbx, %rdi
callq 0x23f0