// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/include/utils/ParallelOperator.h
// Function: abcdl::utils::ParallelOperator<int>::parallel_mul2mul_cross(int*, int const*, unsigned long, int const*, unsigned long, std::function<void (int*, int const&, int const&)> const&) const
void parallel_mul2mul_cross(T* result_data,
                                const T* op1,
                                const size_t num_op1,
                                const T* op2,
                                const size_t num_op2,
                                const std::function<void(T*, const T&, const T&)> &f) const{
        CHECK(num_op1 > 0 && num_op2 > 0);
        size_t block_size = get_block_size(num_op1 * num_op2);
        size_t num_thread = get_num_thread(num_op1 * num_op2, block_size);
        std::vector<std::thread> threads(num_thread);
        block_size = num_op1 / num_thread;
        if(num_op1 % num_thread != 0){
            block_size += 1;
        }

        for(size_t i = 0; i != num_thread; i++){
            threads[i] = std::thread(
                [&result_data, &op1, &op2, num_op2, &f](size_t start_idx, size_t end_idx){
                    size_t idx = start_idx * num_op2;
                    for(size_t ti = start_idx; ti != end_idx; ti++){
                        for(size_t tj = 0; tj != num_op2; tj++){
                            f(&result_data[idx++], op1[ti], op2[tj]);
                        }
                    }
                }, i * block_size, std::min(num_op1, (i + 1) * block_size)
            );
        }

        for(auto& thread : threads){
            thread.join();
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %r9, %r12
movq %rdi, %r15
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, (%rsp)
movq %r8, 0x38(%rsp)
testq %rcx, %rcx
je 0xb197
testq %r12, %r12
je 0xb197
movq (%rsp), %rcx
imulq %r12, %rcx
movq (%r15), %r14
movq 0x8(%r15), %rdi
movq %rcx, %rax
xorl %edx, %edx
divq %r14
cmpq $0x1, %rdx
sbbq $-0x1, %rax
cmpq %rcx, %rdi
movq %rcx, %rsi
cmovbq %rdi, %rsi
cmpq %rdi, %rax
cmovaeq %rax, %rsi
cmpq %rsi, %rdi
jb 0xb098
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
movq %rax, %r14
cmpq $0x1, %rdx
sbbq $-0x1, %r14
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rdx
movq %r14, %rsi
callq 0xa482
movq %rsp, %rax
movq (%rax), %rax
xorl %edx, %edx
divq %r14
movq %rax, %r15
xorl %ebx, %ebx
cmpq $0x1, %rdx
sbbq $-0x1, %r15
leaq 0x10(%rsp), %rbp
leaq 0x48(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x38(%rsp), %rax
movq %rax, 0x60(%rsp)
movq %r12, %r13
movq %r12, 0x68(%rsp)
movq 0x210(%rsp), %rax
movq %rax, 0x70(%rsp)
movq %rbx, %rax
imulq %r15, %rax
movq %rax, 0x10(%rsp)
leaq 0x1(%rbx), %r12
movq %r12, %rax
imulq %r15, %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %rcx
cmpq (%rsp), %rax
jb 0xb124
movq %rsp, %rcx
leaq 0x18(%rsp), %rdi
leaq 0x50(%rsp), %rsi
movq %rbp, %rdx
callq 0xb208
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax,%rbx,8)
jne 0xb1d8
movq 0x18(%rsp), %rcx
movq %rcx, (%rax,%rbx,8)
movq %r12, %rbx
cmpq %r12, %r14
movq %r13, %r12
jne 0xb0c7
movq 0x20(%rsp), %rbx
movq 0x28(%rsp), %r14
cmpq %r14, %rbx
je 0xb17b
movq %rbx, %rdi
callq 0x95a0
addq $0x8, %rbx
jmp 0xb168
leaq 0x20(%rsp), %rdi
callq 0xa594
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2ee82(%rip), %rsi     # 0x3a020
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movl $0xb6, %edx
movl $0x3, %ecx
callq 0x3894e
leaq 0x2eecb(%rip), %rsi     # 0x3a087
movl $0x28, %edx
movq %r14, %rdi
callq 0x93b0
leaq 0x50(%rsp), %rdi
callq 0x38b76
jmp 0xb050
callq 0x90c0
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x38b76
jmp 0xb200
movq %rax, %rbx
jmp 0xb200
jmp 0xb1f3
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xa594
movq %rbx, %rdi
callq 0x95d0