// File: /workspace/github_cpp_makefile_star2_O2/btbujiangjun[P]abcdl/include/utils/LibsvmHelper.h
// Function: abcdl::utils::LibsvmHelper<float>::read_data_append_mat(abcdl::algebra::Matrix<float>*, abcdl::algebra::Matrix<float>*, std::vector<abcdl::utils::LibsvmHelper<float>::libsvm_sample, std::allocator<abcdl::utils::LibsvmHelper<float>::libsvm_sample>> const&, unsigned long, unsigned long)
void read_data_append_mat(abcdl::algebra::Matrix<T>* out_data_mat,
                              abcdl::algebra::Matrix<T>* out_label_mat,
                              const std::vector<libsvm_sample>& samples,
                              const size_t dim,
                              const size_t label_dim){
        if(samples.size() == 0){
            return;
        }

        abcdl::algebra::Matrix<T> data_mat(samples.size(), dim);
        abcdl::algebra::Matrix<T> label_mat(samples.size(), label_dim);
        for(size_t i = 0; i < samples.size(); i++){
            auto& sample = samples[i];
            label_mat.set_data(1, i, (size_t)sample.label);
            for(auto& pair : sample.data){
                if (pair.first >= dim){
                    continue;
                }
                data_mat.set_data(pair.second, i, pair.first);
            }
        }
        out_data_mat->insert_row(data_mat);
        out_label_mat->insert_row(label_mat);

        LOG(INFO) << "Loading:" << samples.size() << "/" << out_label_mat->rows() << "/" << out_data_mat->rows() ;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rsi, %rax
movq 0x8(%rcx), %rsi
subq (%rcx), %rsi
je 0x2191a
movq %r9, %rbx
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %r14
movq %rax, 0x8(%rsp)
sarq $0x5, %rsi
leaq 0x38(%rsp), %rdi
movq %r8, %rdx
callq 0x261ee
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x5, %rsi
leaq 0x10(%rsp), %rdi
movq %rbx, %rdx
callq 0x261ee
movq %r14, (%rsp)
xorl %r13d, %r13d
leaq 0x38(%rsp), %r14
movq (%r15), %rbp
movq 0x8(%r15), %rax
subq %rbp, %rax
sarq $0x5, %rax
cmpq %rax, %r13
jae 0x21861
movq %r13, %rbx
shlq $0x5, %rbx
movl $0x3f800000, 0x60(%rsp) # imm = 0x3F800000
movss (%rbp,%rbx), %xmm0
cvttss2si %xmm0, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
subss 0x1c845(%rip), %xmm0    # 0x3e054
cvttss2si %xmm0, %rcx
andq %rdx, %rcx
orq %rax, %rcx
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movq %r13, %rdx
callq 0x21dae
addq %rbx, %rbp
movq 0x8(%rbp), %rbx
movq 0x10(%rbp), %rbp
cmpq %rbp, %rbx
je 0x21859
movq (%rbx), %rcx
cmpq %r12, %rcx
jae 0x21853
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
movq %r13, %rdx
callq 0x21dae
addq $0x10, %rbx
jmp 0x21837
incq %r13
jmp 0x217d3
leaq 0x38(%rsp), %rsi
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x26806
movq (%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x26806
leaq 0x1d4b8(%rip), %rsi     # 0x3ed43
leaq 0x60(%rsp), %rdi
pushq $0x46
popq %rdx
xorl %ecx, %ecx
callq 0x3d0e4
leaq 0x1d4d7(%rip), %rsi     # 0x3ed78
leaq 0x60(%rsp), %rdi
callq 0xb480
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x5, %rsi
leaq 0x60(%rsp), %rdi
callq 0xb2e0
leaq 0x1d4ba(%rip), %rsi     # 0x3ed81
leaq 0x60(%rsp), %rdi
callq 0xb480
movq (%r14), %rsi
leaq 0x60(%rsp), %rdi
callq 0xb2e0
leaq 0x1d49c(%rip), %rsi     # 0x3ed81
leaq 0x60(%rsp), %rdi
callq 0xb480
movq (%rbx), %rsi
leaq 0x60(%rsp), %rdi
callq 0xb2e0
leaq 0x60(%rsp), %rdi
callq 0x3d320
leaq 0x10(%rsp), %rdi
callq 0x263fe
leaq 0x38(%rsp), %rdi
callq 0x263fe
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x21939
jmp 0x21939
jmp 0x2194c
movq %rax, %rbx
jmp 0x21959
jmp 0x21939
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3d320
jmp 0x2194f
jmp 0x2194c
jmp 0x2194c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x263fe
leaq 0x38(%rsp), %rdi
callq 0x263fe
movq %rbx, %rdi
callq 0xb7b0
nop