// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/LearningUtility.cpp
// Function: OutputBTFMParameter(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<btfm_t, std::allocator<btfm_t>> const&, std::vector<unsigned int, std::allocator<unsigned int>> const&, std::vector<bool, std::allocator<bool>> const&)
void
OutputBTFMParameter( const std::string filename, const std::vector<btfm_t> &data, const std::vector<unsigned int> &index_list, const std::vector<bool> &target )
{
  std::ofstream ofs(filename, std::ios::out);

  if (!ofs) {
    std::cerr << "Cannot open \"" << filename << "\"" << std::endl;
    return;
  }

  const std::size_t data_size = target.size();

  for (std::size_t i = 0; i < data_size; i++) {
    if (target[i]) {
      ofs << index_list[i] << "\t" << std::scientific << data[i].w;
      for (int j = 0; j < FM_DIMENSION; j++) {
        ofs << " " << std::scientific << data[i].v[j];
      }
      ofs << "\n";
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x28(%rsp), %r13
pushq $0x10
popq %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0x6800
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x48(%rsp,%rax)
je 0x2cf9f
movq 0x3409b(%rip), %rdi     # 0x60ff0
leaq 0x19d5c(%rip), %rsi     # 0x46cb8
callq 0x63c0
movq %rax, %rdi
movq %r12, %rsi
callq 0x6350
leaq 0x17b68(%rip), %rsi     # 0x44adb
movq %rax, %rdi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
leaq 0x28(%rsp), %rdi
callq 0x65e0
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, 0x10(%rsp)
movq 0x10(%rbx), %rax
movl 0x18(%rbx), %ecx
movq %rbx, 0x18(%rsp)
subq (%rbx), %rax
leaq (%rcx,%rax,8), %rax
movq %rax, 0x20(%rsp)
xorl %ebx, %ebx
leaq 0x28(%rsp), %r12
movl $0xfffffefb, %r14d      # imm = 0xFFFFFEFB
leaq 0x1747e(%rip), %r13     # 0x4444e
xorl %esi, %esi
cmpq 0x20(%rsp), %rsi
je 0x2cf83
movq 0x18(%rsp), %rdi
movq %rsi, 0x8(%rsp)
callq 0x2d754
testb %al, %al
je 0x2d09b
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
movl (%rax,%rcx,4), %esi
movq %r12, %rdi
callq 0x6270
movq %rax, %rdi
leaq 0x19d74(%rip), %rsi     # 0x46d86
callq 0x63c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl %r14d, %edx
orl $0x100, %edx            # imm = 0x100
movl %edx, 0x18(%rax,%rcx)
movq (%r15), %rcx
imulq $0x218, 0x8(%rsp), %rdx # imm = 0x218
movsd (%rcx,%rdx), %xmm0
movq %rax, %rdi
callq 0x6670
pushq $0x1
popq %rbp
cmpq $0x6, %rbp
je 0x2d08c
movq %r12, %rdi
movq %r13, %rsi
callq 0x63c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl %r14d, %edx
orl $0x100, %edx            # imm = 0x100
movl %edx, 0x18(%rax,%rcx)
movq (%r15), %rcx
addq %rbx, %rcx
movsd (%rcx,%rbp,8), %xmm0
movq %rax, %rdi
callq 0x6670
incq %rbp
jmp 0x2d04b
movq %r12, %rdi
leaq 0x1a53f(%rip), %rsi     # 0x475d5
callq 0x63c0
movq 0x8(%rsp), %rsi
incq %rsi
addq $0x218, %rbx            # imm = 0x218
jmp 0x2cfd2
jmp 0x2d0b3
jmp 0x2d0b3
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x65e0
movq %rbx, %rdi
callq 0x6740