// File: /workspace/github_cpp_makefile_star2_O3/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 0x24336
movq %r9, %r13
movq %r8, %r12
movq %rcx, %r15
movq %rdx, (%rsp)
movq %rax, 0x8(%rsp)
sarq $0x5, %rsi
leaq 0x38(%rsp), %rdi
movq %r8, %rdx
callq 0x293e6
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x5, %rsi
leaq 0x10(%rsp), %rdi
movq %r13, %rdx
callq 0x293e6
movq (%r15), %rbp
cmpq %rbp, 0x8(%r15)
je 0x2426c
xorl %r13d, %r13d
leaq 0x25c54(%rip), %rsi     # 0x49d83
leaq 0x60(%rsp), %rdi
movq %r13, %rbx
shlq $0x5, %rbx
movss (%rbp,%rbx), %xmm0
cvttss2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subss 0x24eff(%rip), %xmm0    # 0x49054
cvttss2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
movq 0x18(%rsp), %rax
movq %rax, %r14
imulq %r13, %r14
addq %rdx, %r14
imulq 0x10(%rsp), %rax
cmpq %rax, %r14
jae 0x2422c
addq %rbx, %rbp
movq 0x20(%rsp), %rax
movl $0x3f800000, (%rax,%r14,4) # imm = 0x3F800000
movq 0x8(%rbp), %rbx
movq 0x10(%rbp), %rbp
cmpq %rbp, %rbx
je 0x24210
movq (%rbx), %rax
cmpq %r12, %rax
jae 0x241cd
movq 0x40(%rsp), %rcx
movq %rcx, %r14
imulq %r13, %r14
addq %rax, %r14
imulq 0x38(%rsp), %rcx
cmpq %rcx, %r14
jae 0x241d3
movss 0x8(%rbx), %xmm0
movq 0x48(%rsp), %rax
movss %xmm0, (%rax,%r14,4)
addq $0x10, %rbx
jmp 0x24196
movl $0x50, %edx
movl $0x3, %ecx
callq 0x4839e
movl $0x1f, %edx
leaq 0x60(%rsp), %rdi
leaq 0x25ba9(%rip), %rsi     # 0x49d9c
callq 0xb4d0
leaq 0x60(%rsp), %rdi
callq 0x485c6
leaq 0x25b7a(%rip), %rsi     # 0x49d83
leaq 0x60(%rsp), %rdi
jmp 0x241bd
incq %r13
movq (%r15), %rbp
movq 0x8(%r15), %rax
subq %rbp, %rax
sarq $0x5, %rax
cmpq %rax, %r13
jb 0x24134
jmp 0x2426c
movl $0x50, %edx
movl $0x3, %ecx
callq 0x4839e
movl $0x1f, %edx
leaq 0x60(%rsp), %rdi
leaq 0x25b50(%rip), %rsi     # 0x49d9c
callq 0xb4d0
leaq 0x60(%rsp), %rdi
callq 0x485c6
leaq 0x25b21(%rip), %rsi     # 0x49d83
leaq 0x60(%rsp), %rdi
jmp 0x2417e
leaq 0x38(%rsp), %rsi
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x29c12
movq (%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x29c12
leaq 0x25aad(%rip), %rsi     # 0x49d43
leaq 0x60(%rsp), %rdi
movl $0x46, %edx
xorl %ecx, %ecx
callq 0x4839e
leaq 0x25aca(%rip), %rsi     # 0x49d78
leaq 0x60(%rsp), %rdi
movl $0x8, %edx
callq 0xb4d0
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x5, %rsi
leaq 0x60(%rsp), %rdi
callq 0xb2b0
leaq 0x25aa8(%rip), %rsi     # 0x49d81
leaq 0x60(%rsp), %rdi
movl $0x1, %edx
callq 0xb4d0
movq (%r14), %rsi
leaq 0x60(%rsp), %rdi
callq 0xb2b0
leaq 0x25a85(%rip), %rsi     # 0x49d81
leaq 0x60(%rsp), %rdi
movl $0x1, %edx
callq 0xb4d0
movq (%rbx), %rsi
leaq 0x60(%rsp), %rdi
callq 0xb2b0
leaq 0x60(%rsp), %rdi
callq 0x485c6
leaq 0x10(%rsp), %rdi
callq 0x2961e
leaq 0x38(%rsp), %rdi
callq 0x2961e
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2435d
jmp 0x2436c
jmp 0x2435d
jmp 0x2436c
jmp 0x2435d
jmp 0x2435d
jmp 0x2436c
movq %rax, %rbx
jmp 0x24379
jmp 0x2435d
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x485c6
jmp 0x2436f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2961e
leaq 0x38(%rsp), %rdi
callq 0x2961e
movq %rbx, %rdi
callq 0xb770
nop