// File: /workspace/github_cpp_makefile_star2_O3/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 $0x258, %rsp            # imm = 0x258
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x50(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x66a0
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x70(%rsp,%rax)
je 0x43596
movq 0x32aa8(%rip), %rdi     # 0x75fe8
leaq 0x1c7a1(%rip), %rsi     # 0x5fce8
movl $0xd, %edx
callq 0x6490
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq 0x32a87(%rip), %rdi     # 0x75fe8
callq 0x6490
movq %rax, %rbx
leaq 0x1a71d(%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
jmp 0x436dd
movl $0x4000000, %edi        # imm = 0x4000000
callq 0x6400
movq %rax, %r12
movl $0x4000000, %edx        # imm = 0x4000000
movq %rax, %rdi
xorl %esi, %esi
callq 0x6200
movq %r12, %rax
addq $0x4000000, %rax        # imm = 0x4000000
movq (%r15), %rdi
movq 0x10(%r15), %rsi
movq %r12, (%r15)
movq %rax, 0x8(%r15)
movq %rax, 0x10(%r15)
testq %rdi, %rdi
je 0x435da
subq %rdi, %rsi
callq 0x6410
movl $0x0, 0xc(%rsp)
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x435fc
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x43609
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
callq 0x43a96
movq %rbx, %rdi
xorl %esi, %esi
callq 0x43a14
movl $0x1, %ebp
leaq 0x50(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x6750
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x43694
movl 0x8(%rsp), %edi
leaq 0x10(%rsp), %rsi
callq 0x4f4d8
movq (%r15), %rax
xorl %ecx, %ecx
movl 0x10(%rsp,%rcx,4), %edx
movl %ebp, (%rax,%rdx,4)
incq %rcx
cmpq $0x10, %rcx
jne 0x4364e
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x43678
movl 0x8(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x43683
movq %r14, %rdi
movq %r13, %rdx
callq 0x43f42
movq %rbx, %rdi
movl $0x1, %esi
callq 0x43a14
incl %ebp
jmp 0x43622
movq 0x3294d(%rip), %rdi     # 0x75fe8
leaq 0x1c716(%rip), %rsi     # 0x5fdb8
movl $0xd, %edx
callq 0x6490
movq 0x10(%rbx), %rax
movl 0x18(%rbx), %ecx
subq (%rbx), %rax
leaq (%rcx,%rax,8), %rsi
movq 0x32927(%rip), %rdi     # 0x75fe8
callq 0x6280
movq %rax, %rbx
movq (%rax), %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 0x50(%rsp), %rdi
callq 0x60a0
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x43712
jmp 0x43712
jmp 0x43712
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x60a0
movq %rbx, %rdi
callq 0x6760