// File: /workspace/github_cpp_makefile_star2_O1/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 0x24618
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 0x29656
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x5, %rsi
leaq 0x10(%rsp), %rdi
movq %r13, %rdx
callq 0x29656
movq (%r15), %rbp
cmpq %rbp, 0x8(%r15)
je 0x2454e
xorl %r13d, %r13d
leaq 0x26972(%rip), %rsi     # 0x4ad83
leaq 0x60(%rsp), %rdi
movq %r13, %rbx
shlq $0x5, %rbx
movss (%rbp,%rbx), %xmm0
cvttss2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subss 0x25c1d(%rip), %xmm0    # 0x4a054
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 0x2450e
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 0x244f2
movq (%rbx), %rax
cmpq %r12, %rax
jae 0x244af
movq 0x40(%rsp), %rcx
movq %rcx, %r14
imulq %r13, %r14
addq %rax, %r14
imulq 0x38(%rsp), %rcx
cmpq %rcx, %r14
jae 0x244b5
movss 0x8(%rbx), %xmm0
movq 0x48(%rsp), %rax
movss %xmm0, (%rax,%r14,4)
addq $0x10, %rbx
jmp 0x24478
movl $0x50, %edx
movl $0x3, %ecx
callq 0x4854e
movl $0x1f, %edx
leaq 0x60(%rsp), %rdi
leaq 0x268c7(%rip), %rsi     # 0x4ad9c
callq 0xb4d0
leaq 0x60(%rsp), %rdi
callq 0x48776
leaq 0x26898(%rip), %rsi     # 0x4ad83
leaq 0x60(%rsp), %rdi
jmp 0x2449f
incq %r13
movq (%r15), %rbp
movq 0x8(%r15), %rax
subq %rbp, %rax
sarq $0x5, %rax
cmpq %rax, %r13
jb 0x24416
jmp 0x2454e
movl $0x50, %edx
movl $0x3, %ecx
callq 0x4854e
movl $0x1f, %edx
leaq 0x60(%rsp), %rdi
leaq 0x2686e(%rip), %rsi     # 0x4ad9c
callq 0xb4d0
leaq 0x60(%rsp), %rdi
callq 0x48776
leaq 0x2683f(%rip), %rsi     # 0x4ad83
leaq 0x60(%rsp), %rdi
jmp 0x24460
leaq 0x38(%rsp), %rsi
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x29e80
movq (%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x29e80
leaq 0x267cb(%rip), %rsi     # 0x4ad43
leaq 0x60(%rsp), %rdi
movl $0x46, %edx
xorl %ecx, %ecx
callq 0x4854e
leaq 0x267e8(%rip), %rsi     # 0x4ad78
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 0x267c6(%rip), %rsi     # 0x4ad81
leaq 0x60(%rsp), %rdi
movl $0x1, %edx
callq 0xb4d0
movq (%r14), %rsi
leaq 0x60(%rsp), %rdi
callq 0xb2b0
leaq 0x267a3(%rip), %rsi     # 0x4ad81
leaq 0x60(%rsp), %rdi
movl $0x1, %edx
callq 0xb4d0
movq (%rbx), %rsi
leaq 0x60(%rsp), %rdi
callq 0xb2b0
leaq 0x60(%rsp), %rdi
callq 0x48776
leaq 0x10(%rsp), %rdi
callq 0x2988e
leaq 0x38(%rsp), %rdi
callq 0x2988e
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2463f
jmp 0x2464e
jmp 0x2463f
jmp 0x2464e
jmp 0x2463f
jmp 0x2463f
jmp 0x2464e
movq %rax, %rbx
jmp 0x2465b
jmp 0x2463f
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x48776
jmp 0x24651
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2988e
leaq 0x38(%rsp), %rdi
callq 0x2988e
movq %rbx, %rdi
callq 0xb770
nop