// File: /workspace/github_cpp_makefile_star2_O1/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
movq %r13, %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x66b0
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x30(%rsp,%rax)
je 0x43557
movq 0x31b11(%rip), %rdi     # 0x74fe8
leaq 0x1c78a(%rip), %rsi     # 0x5fc68
movl $0xd, %edx
callq 0x64a0
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq 0x31af0(%rip), %rdi     # 0x74fe8
callq 0x64a0
movq %rax, %rbx
leaq 0x1a786(%rip), %rsi     # 0x5dc8d
movl $0x1, %edx
movq %rax, %rdi
callq 0x64a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x63d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
leaq 0x10(%rsp), %rdi
callq 0x60a0
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 0x437be
movq (%r15), %rax
movq 0x8(%r15), %rcx
cmpq %rcx, %rax
je 0x43584
movq $0x0, (%rax)
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
addq $0x10, %rax
jmp 0x4356b
movl $0x0, 0x4(%rsp)
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x435a6
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x435b3
leaq 0x4(%rsp), %rdx
movq %r14, %rdi
callq 0x437f2
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x43770
movl $0x1, %r12d
leaq 0x8(%rsp), %r13
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x6540
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4353b
movq 0x8(%rsp), %rax
movq %rax, %rcx
shrq $0x20, %rcx
xorl %eax, %ecx
andl $0xfffff, %ecx          # imm = 0xFFFFF
movl %ecx, 0x4(%rsp)
movq (%r15), %rdx
movl %ecx, %esi
movl %esi, %edi
shlq $0x4, %rdi
cmpq $0x0, (%rdx,%rdi)
je 0x43626
incl %esi
cmpl $0x100000, %esi         # imm = 0x100000
cmovael %ebp, %esi
movl %esi, 0x4(%rsp)
cmpl %ecx, %esi
jne 0x43606
movl 0x4(%rsp), %ecx
shlq $0x4, %rcx
movq %rax, (%rdx,%rcx)
movl %r12d, 0x8(%rdx,%rcx)
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x43651
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x4365e
movq %r14, %rdi
leaq 0x4(%rsp), %rdx
callq 0x43c9e
movq %rbx, %rdi
movl $0x1, %esi
callq 0x43770
incl %r12d
jmp 0x435ca
jmp 0x43679
jmp 0x43679
jmp 0x43679
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x60a0
movq %rbx, %rdi
callq 0x6770