// File: /workspace/github_cpp_makefile_star2_O3/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 0x3a26
movl $0x2, 0x8(%rsp)
movq 0x569b(%rip), %rdi      # 0x8ff0
leaq 0x2713(%rip), %rsi      # 0x606f
movl $0x4, %edx
callq 0x2180
movq 0x5683(%rip), %rdi      # 0x8ff0
leaq 0x2700(%rip), %rsi      # 0x6074
movl $0x5, %edx
callq 0x2180
movq 0x566b(%rip), %rdi      # 0x8ff0
leaq 0x26ee(%rip), %rsi      # 0x607a
movl $0x3, %edx
callq 0x2180
movq 0x5653(%rip), %rdi      # 0x8ff0
leaq 0x27d6(%rip), %rsi      # 0x617a
movl $0xa, %edx
callq 0x2180
movq 0x563b(%rip), %rdi      # 0x8ff0
leaq 0x26b6(%rip), %rsi      # 0x6072
movl $0x1, %edx
callq 0x2180
movq 0x5623(%rip), %rdi      # 0x8ff0
movl $0x4a, %esi
callq 0x2260
movq %rax, %rbx
leaq 0x26b3(%rip), %rsi      # 0x6094
movl $0x2, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x27f0(%rip), %rsi      # 0x61e5
movl $0xf, %edx
movq %rbx, %rdi
callq 0x2180
testq %r14, %r14
je 0x3b56
movq %r14, %rdi
callq 0x20d0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2180
jmp 0x3b6f
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 0x4184
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 0x41b6
movl %ebp, 0x14(%rsp)
movq 0x28(%rbx), %r14
movq %rbx, 0x20(%rsp)
movq 0x30(%rbx), %rbp
cmpq %rbp, %r14
je 0x3b21
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 0x41f2
movq (%r14), %r13
movq 0x8(%r14), %rbx
cmpq %rbx, %r13
je 0x3b18
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 0x3ae9
addq $0x18, %r14
cmpq %rbp, %r14
jne 0x3ac5
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 0x4224
leaq 0x30(%rsp), %rdi
callq 0x2070
movl 0x14(%rsp), %ebp
jmp 0x3b79
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 0x2ae0
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 0x3bb7
jmp 0x3bb7
jmp 0x3bb7
jmp 0x3bb7
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2ae0
jmp 0x3bba
jmp 0x3bb7
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2270