// File: /workspace/github_c_makefile_star2_O1/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 0x46f2
leaq 0x14fd7(%rip), %rsi     # 0x1b865
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 0x68c1
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 0x690a
leaq 0x28(%rsp), %r13
movl $0x4, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x32f0
addq $0x4, %r12
cmpq 0x8(%r15), %r12
jne 0x68f0
movq (%r14), %rax
cmpq %rax, 0x8(%r14)
je 0x6981
xorl %ebp, %ebp
leaq 0x28(%rsp), %r15
leaq (,%rbp,8), %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx), %r12
movq (%r14), %rax
cmpq 0x8(%rax,%rcx), %r12
je 0x695d
leaq (,%rbp,2), %r13
addq %rbp, %r13
movl $0x4, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x32f0
addq $0x4, %r12
movq (%r14), %rax
cmpq 0x8(%rax,%r13,8), %r12
jne 0x693f
incq %rbp
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
cmpq %rbp, %rcx
ja 0x691a
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x69f2
xorl %r12d, %r12d
leaq 0x28(%rsp), %r14
leaq (,%r12,8), %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx), %r15
movq (%rbx), %rax
cmpq 0x8(%rax,%rcx), %r15
je 0x69ce
leaq (%r12,%r12,2), %r13
movl $0x4, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x32f0
addq $0x4, %r15
movq (%rbx), %rax
cmpq 0x8(%rax,%r13,8), %r15
jne 0x69b0
incq %r12
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
cmpq %r12, %rcx
ja 0x6992
leaq 0x28(%rsp), %rdi
callq 0x3320
movq 0xdf5bd(%rip), %rax     # 0xe5fc0
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 0x6a42
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x6a71
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3230
jmp 0x6a71
jmp 0x6a64
jmp 0x6a64
jmp 0x6a64
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3340
movq %rbx, %rdi
callq 0x33e0
nop