// File: /workspace/github_cpp_makefile_star2_O3/tetsuok[P]kernel-pa/learner.cc
// Function: kernel::Learner::Read(char const*, std::vector<std::pair<std::vector<std::pair<unsigned int, float>, std::allocator<std::pair<unsigned int, float>>>, short>, std::allocator<std::pair<std::vector<std::pair<unsigned int, float>, std::allocator<std::pair<unsigned int, float>>>, short>>>&, unsigned long*)
bool Learner::Read(const char* train_file,
                   vector<example>& examples,
                   size_t* maxid) {
  ifstream ifs(train_file);
  if (!ifs) {
    LOG(ERROR) << "no such file or directory " << train_file;
    return false;
  }

  string line;
  size_t line_num = 0;
  while (std::getline(ifs, line)) {
    ++line_num;
    if (line[0] == '#' || line.empty()) continue;

    short label = 0;                      // true label
    fv vec;
    if (!Tokenize(line.c_str(), &vec, &label, maxid)) {
      LOG(ERROR) << "Invalid line: " << line_num;
      return false;
    }
    examples.push_back(make_pair(vec, label));
  }
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
leaq 0x80(%rsp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x2280
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xa0(%rsp,%rax)
je 0x3324
movl $0x2, 0x10(%rsp)
movq 0x5d9d(%rip), %rdi      # 0x8ff0
leaq 0x2e15(%rip), %rsi      # 0x606f
movl $0x4, %edx
callq 0x2180
movq 0x5d85(%rip), %rdi      # 0x8ff0
leaq 0x2e02(%rip), %rsi      # 0x6074
movl $0x5, %edx
callq 0x2180
movq 0x5d6d(%rip), %rdi      # 0x8ff0
leaq 0x2df0(%rip), %rsi      # 0x607a
movl $0x3, %edx
callq 0x2180
movq 0x5d55(%rip), %rdi      # 0x8ff0
leaq 0x2ed8(%rip), %rsi      # 0x617a
movl $0xa, %edx
callq 0x2180
movq 0x5d3d(%rip), %rdi      # 0x8ff0
leaq 0x2db8(%rip), %rsi      # 0x6072
movl $0x1, %edx
callq 0x2180
movq 0x5d25(%rip), %rdi      # 0x8ff0
movl $0x16, %esi
callq 0x2260
movq %rax, %rbx
leaq 0x2db5(%rip), %rsi      # 0x6094
movl $0x2, %edx
movq %rax, %rdi
callq 0x2180
leaq 0x2db1(%rip), %rsi      # 0x60a4
movl $0x1a, %edx
movq %rbx, %rdi
callq 0x2180
testq %r14, %r14
je 0x354e
movq %r14, %rdi
callq 0x20d0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2180
jmp 0x3567
movq %rbx, 0x58(%rsp)
movq %r12, 0x50(%rsp)
leaq 0x20(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
movl $0x1, %ebp
leaq 0x80(%rsp), %r12
leaq 0x10(%rsp), %rbx
leaq 0x60(%rsp), %r15
leaq (%rsp,%rax), %rdi
addq $0x80, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2290
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
setne %r14b
jne 0x3530
movq 0x10(%rsp), %rdi
cmpb $0x23, (%rdi)
je 0x351c
cmpq $0x0, 0x18(%rsp)
je 0x351c
movq %r12, %rbx
movw $0x0, 0xe(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x30(%rsp), %rsi
leaq 0xe(%rsp), %rdx
movq 0x58(%rsp), %rcx
callq 0x5114
movl %eax, %r12d
testb %al, %al
je 0x3429
movq %r15, %r13
movq %r15, %rdi
leaq 0x30(%rsp), %rsi
callq 0x4258
movzwl 0xe(%rsp), %eax
movw %ax, 0x78(%rsp)
movq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x476c
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x34f8
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
jmp 0x34f8
movl $0x2, 0x60(%rsp)
movl $0x4, %edx
movq 0x5bb3(%rip), %rdi      # 0x8ff0
leaq 0x2c2b(%rip), %rsi      # 0x606f
callq 0x2180
movl $0x5, %edx
movq 0x5b9b(%rip), %rdi      # 0x8ff0
leaq 0x2c18(%rip), %rsi      # 0x6074
callq 0x2180
movl $0x3, %edx
movq 0x5b83(%rip), %rdi      # 0x8ff0
leaq 0x2c06(%rip), %rsi      # 0x607a
callq 0x2180
movl $0xa, %edx
movq 0x5b6b(%rip), %rdi      # 0x8ff0
leaq 0x2cee(%rip), %rsi      # 0x617a
callq 0x2180
movl $0x1, %edx
movq 0x5b53(%rip), %rdi      # 0x8ff0
leaq 0x2bce(%rip), %rsi      # 0x6072
callq 0x2180
movq 0x5b40(%rip), %rdi      # 0x8ff0
movl $0x23, %esi
callq 0x2260
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
leaq 0x2bc8(%rip), %rsi      # 0x6094
callq 0x2180
movl $0xe, %edx
movq %r13, %rdi
leaq 0x2ca5(%rip), %rsi      # 0x6185
callq 0x2180
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2100
movq %r15, %rdi
callq 0x2ae0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x350f
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
testb %r12b, %r12b
movq %rbx, %r12
leaq 0x10(%rsp), %rbx
je 0x3530
movq 0x80(%rsp), %rax
movq -0x18(%rax), %rax
incq %rbp
jmp 0x3359
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x3574
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x3574
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %rbx, %rdi
addq %rax, %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2240
leaq 0x10(%rsp), %rdi
callq 0x2ae0
xorl %r14d, %r14d
leaq 0x80(%rsp), %rdi
callq 0x2080
movl %r14d, %eax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x35da
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
jmp 0x35da
jmp 0x35b4
movq %rax, %rbx
jmp 0x35da
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2ae0
jmp 0x360d
movq %rax, %rbx
jmp 0x35f1
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2ae0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x35f1
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x360d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2170
leaq 0x80(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2270