// File: /workspace/github_cpp_makefile_star2_O1/tetsuok[P]kernel-pa/learner.cc
// Function: kernel::Learner::Load(char const*)
bool Learner::Load(const char* filename) {
  std::ifstream bifs(filename, std::ios::in | std::ios::binary);
  if (!bifs) {
    LOG(ERROR) << "Failed to load " << filename;
    return false;
  }

  bifs.read(reinterpret_cast<char *>(&C_), sizeof(C_));
  bifs.read(reinterpret_cast<char *>(&d_), sizeof(d_));

  std::size_t alpha_size;
  bifs.read(reinterpret_cast<char *>(&alpha_size), sizeof(alpha_size));
  alpha_.resize(alpha_size);
  bifs.read(reinterpret_cast<char *>(&alpha_[0]), alpha_.size() * sizeof(float));

  std::size_t sv_size;
  bifs.read(reinterpret_cast<char *>(&sv_size), sizeof(sv_size));
  sv_index_.resize(sv_size);

  for (fv& x : sv_index_) {
    std::size_t x_size;
    bifs.read(reinterpret_cast<char *>(&x_size), sizeof(x_size));
    x.resize(x_size);
    for (auto& p : x) {
      bifs.read(reinterpret_cast<char *>(&p.first), sizeof(p.first));
      bifs.read(reinterpret_cast<char *>(&p.second), sizeof(p.second));
    }
  }

  margin_.resize(alpha_.size(), 0.0f);

  bifs.close();
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movl $0xc, %edx
callq 0x2280
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x50(%rsp,%rax), %ebp
testb $0x5, %bpl
je 0x3612
movl $0x2, 0x8(%rsp)
movq 0x4aaf(%rip), %rdi      # 0x7ff0
leaq 0x1af3(%rip), %rsi      # 0x503b
movl $0x4, %edx
callq 0x2180
movq 0x4a97(%rip), %rdi      # 0x7ff0
leaq 0x1ae0(%rip), %rsi      # 0x5040
movl $0x5, %edx
callq 0x2180
movq 0x4a7f(%rip), %rdi      # 0x7ff0
leaq 0x1ace(%rip), %rsi      # 0x5046
movl $0x3, %edx
callq 0x2180
movq 0x4a67(%rip), %rdi      # 0x7ff0
leaq 0x1bba(%rip), %rsi      # 0x514a
movl $0xa, %edx
callq 0x2180
movq 0x4a4f(%rip), %rdi      # 0x7ff0
leaq 0x1a96(%rip), %rsi      # 0x503e
movl $0x1, %edx
callq 0x2180
movq 0x4a37(%rip), %rdi      # 0x7ff0
movl $0x4a, %esi
callq 0x2260
movq %rax, %rbx
leaq 0x1a93(%rip), %rsi      # 0x5060
movl $0x2, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x1bd4(%rip), %rsi      # 0x51b5
movl $0xf, %edx
movq %rbx, %rdi
callq 0x2180
testq %r14, %r14
je 0x3742
movq %r14, %rdi
callq 0x20d0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2180
jmp 0x375b
leaq 0x8(%rbx), %rsi
leaq 0x30(%rsp), %rdi
movl $0x4, %edx
callq 0x21c0
leaq 0xc(%rbx), %rsi
leaq 0x30(%rsp), %rdi
movl $0x4, %edx
callq 0x21c0
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x8, %edx
callq 0x21c0
leaq 0x10(%rbx), %rdi
movq 0x8(%rsp), %rsi
callq 0x3d60
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
subq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x21c0
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0x8, %edx
callq 0x21c0
leaq 0x28(%rbx), %rdi
movq 0x28(%rsp), %rsi
callq 0x3d92
movl %ebp, 0x14(%rsp)
movq 0x28(%rbx), %r14
movq %rbx, 0x20(%rsp)
movq 0x30(%rbx), %rbp
cmpq %rbp, %r14
je 0x370d
leaq 0x30(%rsp), %r15
leaq 0x18(%rsp), %r12
movl $0x8, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21c0
movq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x3dce
movq (%r14), %r13
movq 0x8(%r14), %rbx
cmpq %rbx, %r13
je 0x3704
movl $0x4, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x21c0
addq $0x4, %r13
movl $0x4, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x21c0
addq $0x4, %r13
jmp 0x36d5
addq $0x18, %r14
cmpq %rbp, %r14
jne 0x36b1
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rsi
subq 0x10(%rax), %rsi
leaq 0x40(%rax), %rdi
sarq $0x2, %rsi
leaq 0x18(%rsp), %rdx
movl $0x0, (%rdx)
callq 0x3e00
leaq 0x30(%rsp), %rdi
callq 0x2070
movl 0x14(%rsp), %ebp
jmp 0x3765
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %rbx, %rdi
addq %rax, %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
leaq 0x8(%rsp), %rdi
callq 0x2ad8
testb $0x5, %bpl
sete %bl
leaq 0x30(%rsp), %rdi
callq 0x2080
movl %ebx, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x37a3
jmp 0x37a3
jmp 0x37a3
jmp 0x37a3
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2ad8
jmp 0x37a6
jmp 0x37a3
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2270