// File: /workspace/github_c_makefile_star2_O2/fukunagatsu[P]RIblast/db_construction.cpp
// Function: DbConstruction::SaveIndexData(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<int, std::allocator<int>>&, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&)
void  DbConstruction::SaveIndexData(string file_name, vector<int> &suffix_array, vector<vector <int> > &start_hash, vector<vector <int> > &end_hash){
  ofstream of((file_name+".ind").c_str(), ios::out | ios::binary);
  int count = suffix_array.size();
  vector<int>::iterator it;
  of.write(reinterpret_cast<const char*>(&count), sizeof(int));
  for(it = suffix_array.begin(); it != suffix_array.end(); it++){
    of.write(reinterpret_cast<const char*>(&*it), sizeof(int));
  }
  for(int i = 0; i< start_hash.size();i++){
    for(it = start_hash[i].begin(); it != start_hash[i].end(); it++){
      of.write(reinterpret_cast<const char*>(&*it), sizeof(int));
    }
  }
  for(int i = 0; i< end_hash.size();i++){
    for(it = end_hash[i].begin(); it != end_hash[i].end(); it++){
      of.write(reinterpret_cast<const char*>(&*it), sizeof(int));
    }
  }
  of.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
leaq 0x10e6c(%rip), %rdx     # 0x1686d
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x653c
movq (%r12), %rsi
leaq 0x28(%rsp), %rdi
pushq $0x14
popq %rdx
callq 0x3220
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x3100
movq 0x8(%r15), %rax
subq (%r15), %rax
shrq $0x2, %rax
movl %eax, (%r12)
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x32b0
movq (%r15), %r12
leaq 0x28(%rsp), %r13
pushq $0x4
popq %rbp
cmpq 0x8(%r15), %r12
je 0x5a72
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x32b0
addq $0x4, %r12
jmp 0x5a58
movq (%r14), %rcx
xorl %edi, %edi
leaq 0x28(%rsp), %r15
pushq $0x4
popq %r12
movq 0x8(%r14), %rax
subq %rcx, %rax
cqto
pushq $0x18
popq %rsi
idivq %rsi
cmpq %rdi, %rax
jbe 0x5ac7
movq %rdi, (%rsp)
imulq $0x18, %rdi, %rbp
movq (%rcx,%rbp), %r13
cmpq 0x8(%rcx,%rbp), %r13
je 0x5abe
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x32b0
addq $0x4, %r13
movq (%r14), %rcx
jmp 0x5aa0
movq (%rsp), %rdi
incq %rdi
jmp 0x5a80
movq (%rbx), %rcx
xorl %r13d, %r13d
leaq 0x28(%rsp), %r14
pushq $0x4
popq %r15
movq 0x8(%rbx), %rax
subq %rcx, %rax
cqto
pushq $0x18
popq %rsi
idivq %rsi
cmpq %r13, %rax
jbe 0x5b15
imulq $0x18, %r13, %rbp
movq (%rcx,%rbp), %r12
cmpq 0x8(%rcx,%rbp), %r12
je 0x5b10
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x32b0
addq $0x4, %r12
movq (%rbx), %rcx
jmp 0x5af2
incq %r13
jmp 0x5ad6
leaq 0x28(%rsp), %rdi
callq 0x32f0
leaq 0x28(%rsp), %rdi
callq 0x3310
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3100
jmp 0x5b5d
jmp 0x5b50
jmp 0x5b50
jmp 0x5b50
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3310
movq %rbx, %rdi
callq 0x33a0
nop