// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/LearningUtility.cpp
// Function: InputLargePatternTarget(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<index_hash_t, std::allocator<index_hash_t>>&, std::vector<unsigned int, std::allocator<unsigned int>>&, std::vector<bool, std::allocator<bool>>&)
void
InputLargePatternTarget( const std::string filename, std::vector<index_hash_t> &index, std::vector<unsigned int> &list, std::vector<bool> &target )
{
  std::ifstream ifs(filename, std::ios::in);
  int target_index = 1;
  unsigned long long hash;


  if (ifs.fail()) {
    std::cerr << "Cannot open \"" << filename << "\"" << std::endl;
    return;
  }

  index.resize(HASH_MAX);

  for (index_hash_t &datum : index) {
    datum.hash = 0;
    datum.index = -1;
  }

  // 学習対称でないパターン用のデータ
  list.push_back(0);
  target.push_back(false);

  while (ifs >> hash) {
    const unsigned int trans = TransHash20(hash);
    unsigned int idx = trans;
    do {
      if (index[idx].hash == 0) break;
      idx++;
      if (idx >= HASH_MAX) idx = 0;
    } while (idx != trans);

    index[idx].hash = hash;
    index[idx].index = target_index++;
    list.push_back(idx);
    target.push_back(true);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x10(%rsp), %r13
pushq $0x8
popq %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0x6680
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x30(%rsp,%rax)
je 0x2d59e
movq 0x33a9c(%rip), %rdi     # 0x60ff0
leaq 0x1975d(%rip), %rsi     # 0x46cb8
callq 0x63c0
movq %rax, %rdi
movq %r12, %rsi
callq 0x6350
leaq 0x17569(%rip), %rsi     # 0x44adb
movq %rax, %rdi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
leaq 0x10(%rsp), %rdi
callq 0x60b0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x100000, %esi         # imm = 0x100000
movq %r15, %rdi
callq 0x2d7ce
movq (%r15), %rax
movq 0x8(%r15), %rcx
cmpq %rcx, %rax
je 0x2d5c5
andq $0x0, (%rax)
orl $-0x1, 0x8(%rax)
addq $0x10, %rax
jmp 0x2d5b2
leaq 0x4(%rsp), %rsi
andl $0x0, (%rsi)
movq %r14, %rdi
callq 0x2d854
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2d772
pushq $0x1
popq %r12
leaq 0x8(%rsp), %r13
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x6500
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2d582
movq 0x8(%rsp), %rax
movq %rax, %rdx
shrq $0x20, %rdx
xorq %rax, %rdx
movl %edx, %edi
andl $0xfffff, %edi          # imm = 0xFFFFF
movl %edi, 0x4(%rsp)
movq (%r15), %rcx
movl %edi, %esi
movl %esi, %esi
movq %rsi, %r8
shlq $0x4, %r8
cmpq $0x0, (%rcx,%r8)
je 0x2d655
incl %esi
cmpl $0x100000, %esi         # imm = 0x100000
cmovael %ebp, %esi
movl %esi, 0x4(%rsp)
cmpl %edi, %esi
jne 0x2d629
andl $0xfffff, %edx          # imm = 0xFFFFF
movq %rdx, %rsi
shlq $0x4, %rsi
movq %rax, (%rcx,%rsi)
movl %r12d, 0x8(%rcx,%rsi)
movq %r14, %rdi
leaq 0x4(%rsp), %rsi
callq 0x2d7b0
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0x2d772
incl %r12d
jmp 0x2d5ea
jmp 0x2d688
jmp 0x2d688
jmp 0x2d688
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x60b0
movq %rbx, %rdi
callq 0x6740