// File: /workspace/github_c_makefile_star2_O3/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 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0x479e
leaq 0x15c6f(%rip), %rsi     # 0x1c94d
movq %r12, %rdi
callq 0x3420
movq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movl $0x14, %edx
callq 0x3250
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x6d11
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3230
movq 0x8(%r15), %rax
subq (%r15), %rax
shrq $0x2, %rax
leaq 0x8(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x28(%rsp), %rdi
movl $0x4, %edx
callq 0x32f0
movq (%r15), %r12
cmpq 0x8(%r15), %r12
je 0x6d5a
leaq 0x28(%rsp), %r13
movl $0x4, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x32f0
addq $0x4, %r12
cmpq 0x8(%r15), %r12
jne 0x6d40
movq (%r14), %rax
movq 0x8(%r14), %rcx
cmpq %rax, %rcx
je 0x6dc5
xorl %ebp, %ebp
leaq 0x28(%rsp), %r15
leaq (,%rbp,2), %r13
addq %rbp, %r13
movq (%rax,%r13,8), %r12
cmpq 0x8(%rax,%r13,8), %r12
je 0x6da5
movl $0x4, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x32f0
addq $0x4, %r12
movq (%r14), %rax
cmpq 0x8(%rax,%r13,8), %r12
jne 0x6d83
movq 0x8(%r14), %rcx
incq %rbp
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
cmpq %rbp, %rdx
ja 0x6d6d
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq %rax, %rcx
je 0x6e2a
xorl %r12d, %r12d
leaq 0x28(%rsp), %r14
leaq (%r12,%r12,2), %r13
movq (%rax,%r13,8), %r15
cmpq 0x8(%rax,%r13,8), %r15
je 0x6e0a
movl $0x4, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x32f0
addq $0x4, %r15
movq (%rbx), %rax
cmpq 0x8(%rax,%r13,8), %r15
jne 0x6de8
movq 0x8(%rbx), %rcx
incq %r12
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
cmpq %r12, %rdx
ja 0x6dd9
leaq 0x28(%rsp), %rdi
callq 0x3320
movq 0xe0185(%rip), %rax     # 0xe6fc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x30(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x28(%rsp,%rcx)
callq 0x31d0
leaq 0x120(%rsp), %rdi
callq 0x30d0
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6e7a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x6ea9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3230
jmp 0x6ea9
jmp 0x6e9c
jmp 0x6e9c
jmp 0x6e9c
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3340
movq %rbx, %rdi
callq 0x33e0
nop