// File: /workspace/github_cpp_makefile_star2_O3/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 0x6810
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x48(%rsp,%rax)
je 0x42f69
movq 0x330e8(%rip), %rdi     # 0x75fe8
leaq 0x1cde1(%rip), %rsi     # 0x5fce8
movl $0xd, %edx
callq 0x6490
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq 0x330c7(%rip), %rdi     # 0x75fe8
callq 0x6490
movq %rax, %rbx
leaq 0x1ad5d(%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
jmp 0x430cb
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 0x430cb
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 0x430b6
movq 0x8(%rsp), %rax
movq (%rax), %rax
movl (%rax,%rbp,4), %esi
movq %r12, %rdi
callq 0x6280
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1cd9c(%rip), %rsi     # 0x5fdb6
callq 0x6490
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 0x6690
movl $0x1, %r13d
movl $0x1, %edx
movq %r12, %rdi
leaq 0x1a59a(%rip), %rsi     # 0x5d600
callq 0x6490
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 0x6690
incq %r13
cmpq $0x6, %r13
jne 0x43057
movl $0x1, %edx
movq %r12, %rdi
leaq 0x1d604(%rip), %rsi     # 0x606b5
callq 0x6490
incq %rbp
addq $0x218, %rbx            # imm = 0x218
cmpq 0x18(%rsp), %rbp
jb 0x42fb1
movq 0x32e96(%rip), %rax     # 0x75f68
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 0x6330
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 0x43113
jmp 0x43113
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x6600
movq %rbx, %rdi
callq 0x6760