// File: /workspace/github_cpp_makefile_star2_O1/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
movq %r13, %rdi
movq %r12, %rsi
movl $0x10, %edx
callq 0x6820
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x48(%rsp,%rax)
je 0x42ca1
movq 0x323b0(%rip), %rdi     # 0x74fe8
leaq 0x1d029(%rip), %rsi     # 0x5fc68
movl $0xd, %edx
callq 0x64a0
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq 0x3238f(%rip), %rdi     # 0x74fe8
callq 0x64a0
movq %rax, %rbx
leaq 0x1b025(%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
jmp 0x42e03
movq %r14, 0x8(%rsp)
movq 0x10(%rbx), %rcx
movl 0x18(%rbx), %eax
movq %rbx, 0x20(%rsp)
subq (%rbx), %rcx
shlq $0x3, %rcx
addq %rax, %rcx
movq %rcx, 0x18(%rsp)
je 0x42e03
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
xorl %ebx, %ebx
addq $0x3f, %rax
movq %rax, 0x10(%rsp)
leaq 0x28(%rsp), %r12
movl $0xfffffefb, %r14d      # imm = 0xFFFFFEFB
xorl %ebp, %ebp
leaq 0x3f(%rbp), %rax
testq %rbp, %rbp
cmovnsq %rbp, %rax
sarq $0x6, %rax
shlq $0x3, %rax
movq 0x20(%rsp), %rcx
addq (%rcx), %rax
movq %rbp, %rcx
andq 0x10(%rsp), %rcx
xorl %edx, %edx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
cmpq %rsi, %rcx
setbe %dl
movq -0x8(%rax,%rdx,8), %rax
btq %rbp, %rax
jae 0x42dee
movq 0x8(%rsp), %rax
movq (%rax), %rax
movl (%rax,%rbp,4), %esi
movq %r12, %rdi
callq 0x6290
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1cfe4(%rip), %rsi     # 0x5fd36
callq 0x64a0
movq (%r13), %rax
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
andl %r14d, %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x18(%r13,%rax)
movq (%r15), %rax
imulq $0x218, %rbp, %rcx      # imm = 0x218
movsd (%rax,%rcx), %xmm0
movq %r13, %rdi
callq 0x66a0
movl $0x1, %r13d
movl $0x1, %edx
movq %r12, %rdi
leaq 0x1a862(%rip), %rsi     # 0x5d600
callq 0x64a0
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x40(%rsp,%rax), %ecx
andl %r14d, %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x40(%rsp,%rax)
movq (%r15), %rax
addq %rbx, %rax
movsd (%rax,%r13,8), %xmm0
movq %r12, %rdi
callq 0x66a0
incq %r13
cmpq $0x6, %r13
jne 0x42d8f
movl $0x1, %edx
movq %r12, %rdi
leaq 0x1d75c(%rip), %rsi     # 0x60545
callq 0x64a0
incq %rbp
addq $0x218, %rbx            # imm = 0x218
cmpq 0x18(%rsp), %rbp
jb 0x42ce9
movq 0x3215e(%rip), %rax     # 0x74f68
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x30(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x28(%rsp,%rcx)
callq 0x6340
leaq 0x120(%rsp), %rdi
callq 0x60f0
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x42e4b
jmp 0x42e4b
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x6610
movq %rbx, %rdi
callq 0x6770