// File: /workspace/github_cpp_makefile_star2_O3/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 0x66a0
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x30(%rsp,%rax)
je 0x437f3
movq 0x32875(%rip), %rdi     # 0x75fe8
leaq 0x1c56e(%rip), %rsi     # 0x5fce8
movl $0xd, %edx
callq 0x6490
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq 0x32854(%rip), %rdi     # 0x75fe8
callq 0x6490
movq %rax, %rbx
leaq 0x1a4ea(%rip), %rsi     # 0x5dc8d
movl $0x1, %edx
movq %rax, %rdi
callq 0x6490
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x63c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x6290
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 0x43a62
movq (%r15), %rax
movq 0x8(%r15), %rcx
cmpq %rcx, %rax
je 0x43820
movq $0x0, (%rax)
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
addq $0x10, %rax
jmp 0x43807
movl $0x0, 0x4(%rsp)
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x43842
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x4384f
leaq 0x4(%rsp), %rdx
movq %r14, %rdi
callq 0x43a96
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x43a14
movl $0x1, %r12d
leaq 0x8(%rsp), %r13
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x6530
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x437d7
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 0x438d1
incl %esi
cmpl $0x100000, %esi         # imm = 0x100000
cmovael %ebp, %esi
movl %esi, 0x4(%rsp)
cmpl %edi, %esi
jne 0x438a5
andl $0xfffff, %edx          # imm = 0xFFFFF
movq %rdx, %rsi
shlq $0x4, %rsi
movq %rax, (%rcx,%rsi)
movl %r12d, 0x8(%rcx,%rsi)
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x438f8
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x43905
movq %r14, %rdi
leaq 0x4(%rsp), %rdx
callq 0x43f42
movq %rbx, %rdi
movl $0x1, %esi
callq 0x43a14
incl %r12d
jmp 0x43866
jmp 0x43920
jmp 0x43920
jmp 0x43920
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x60a0
movq %rbx, %rdi
callq 0x6760