// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/learn/LearningUtility.cpp
// Function: InputMD2Target(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<int, std::allocator<int>>&, std::vector<unsigned int, std::allocator<unsigned int>>&, std::vector<bool, std::allocator<bool>>&)
void
InputMD2Target( const std::string filename, std::vector<int> &md2_index, std::vector<unsigned int> &md2_list, std::vector<bool> &md2_target )
{
  std::ifstream ifs(filename, std::ios::in);
  int target_index = 1;
  unsigned int index, md2_transpose16[16];

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

  md2_index = std::vector<int>(MD2_MAX, 0);

  // 学習対象でないMD2パターン用のデータ
  md2_list.push_back(0);
  md2_target.push_back(false);

  while (ifs >> index) {
    MD2Transpose16(index, md2_transpose16);
    for (int i = 0; i < 16; i++) {
      md2_index[md2_transpose16[i]] = target_index;
    }
    md2_list.push_back(index);
    md2_target.push_back(true);
    target_index++;
  }
  std::cerr << "MD2 Target : " << md2_target.size() << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x70(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x66b0
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x90(%rsp,%rax)
je 0x432d1
movq 0x31d6d(%rip), %rdi     # 0x74fe8
leaq 0x1c9e6(%rip), %rsi     # 0x5fc68
movl $0xd, %edx
callq 0x64a0
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq 0x31d4c(%rip), %rdi     # 0x74fe8
callq 0x64a0
movq %rax, %rbx
leaq 0x1a9e2(%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
jmp 0x43441
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x4000000, %edi        # imm = 0x4000000
callq 0x6410
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
movq %rax, 0x8(%r12)
movq %rax, %r13
addq $0x4000000, %r13        # imm = 0x4000000
movq %r13, 0x10(%r12)
movl $0x4000000, %edx        # imm = 0x4000000
movq %rax, %rdi
xorl %esi, %esi
callq 0x6210
movq %r13, 0x8(%r12)
movq %r15, %rdi
movq %r12, %rsi
callq 0x3a676
movq (%r12), %rdi
testq %rdi, %rdi
je 0x4333e
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6420
movl $0x0, 0x10(%rsp)
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x43360
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x4336d
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x437f2
movq %rbx, %rdi
xorl %esi, %esi
callq 0x43770
movl $0x1, %ebp
leaq 0x70(%rsp), %r12
leaq 0xc(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x6760
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x433f8
movl 0xc(%rsp), %edi
leaq 0x30(%rsp), %rsi
callq 0x4f162
movq (%r15), %rax
xorl %ecx, %ecx
movl 0x30(%rsp,%rcx,4), %edx
movl %ebp, (%rax,%rdx,4)
incq %rcx
cmpq $0x10, %rcx
jne 0x433b2
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x433dc
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x433e7
movq %r14, %rdi
movq %r13, %rdx
callq 0x43c9e
movq %rbx, %rdi
movl $0x1, %esi
callq 0x43770
incl %ebp
jmp 0x43386
movq 0x31be9(%rip), %rdi     # 0x74fe8
leaq 0x1c932(%rip), %rsi     # 0x5fd38
movl $0xd, %edx
callq 0x64a0
movq 0x10(%rbx), %rax
movl 0x18(%rbx), %ecx
subq (%rbx), %rax
leaq (%rcx,%rax,8), %rsi
movq 0x31bc3(%rip), %rdi     # 0x74fe8
callq 0x6290
movq %rax, %rbx
movq (%rax), %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 0x70(%rsp), %rdi
callq 0x60a0
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x43476
jmp 0x43476
jmp 0x43476
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x60a0
movq %rbx, %rdi
callq 0x6770