// File: /workspace/github_cpp_makefile_star2_O2/btbujiangjun[P]abcdl/include/utils/ParallelOperator.h
// Function: abcdl::utils::ParallelOperator<int>::parallel_reduce_boolean(bool*, int const*, unsigned long, std::function<void (bool*, int const&)> const&) const
void parallel_reduce_boolean(bool* result_value,
                                 const T* op1,
                             	 const size_t num_op1,
                         		 const std::function<void(bool*, const T&)> &f) const{
        *result_value = true;
        size_t block_size = get_block_size(num_op1);
        size_t num_thread = get_num_thread(num_op1, block_size);
        std::vector<std::thread> threads(num_thread);
        
        bool* values = new bool[num_thread];
        for(size_t i = 0; i != num_thread; i++){
            bool* value = &values[i];
            *value = true;
            threads[i] = std::thread(
                [&value, &op1, &f](size_t start_idx, size_t end_idx){
					for(size_t ti = start_idx; ti != end_idx && *value; ti++){
    					f(value, op1[ti]);
                    }
                }, i * block_size, std::min(num_op1, (i + 1) * block_size)
            );
        }

        for(auto& thread : threads){
            thread.join();
        }
        bool reduce_result = true;
        for(size_t i = 0; i < num_thread && reduce_result; i++){
           reduce_result = reduce_result && values[i]; 
        }
        *result_value = reduce_result;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r8, 0x18(%rsp)
movq %rcx, %rbx
movq %rdi, %r14
movq %rdx, 0x50(%rsp)
movq %rcx, (%rsp)
movq %rsi, 0x8(%rsp)
movb $0x1, (%rsi)
movq %rcx, %rsi
callq 0xa05a
movq %rax, %rcx
cmpq %rax, 0x8(%r14)
jae 0xb29e
movq (%r14), %r14
jmp 0xb2b1
movq %rbx, %rax
xorl %edx, %edx
divq %rcx
movq %rax, %r14
cmpq $0x1, %rdx
sbbq $-0x1, %r14
movq %rcx, 0x10(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movq %r14, %rsi
callq 0xa09c
movq %r14, %rdi
callq 0x9030
movq %rax, %r12
xorl %ebx, %ebx
leaq 0x70(%rsp), %rbp
xorl %r15d, %r15d
xorl %r13d, %r13d
cmpq %r13, %r14
je 0xb36a
leaq (%r12,%r13), %rax
movq %rax, 0x30(%rsp)
movb $0x1, (%r12,%r13)
leaq 0x30(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x50(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x68(%rsp)
movq %rbx, 0x28(%rsp)
addq 0x10(%rsp), %rbx
cmpq (%rsp), %rbx
movq %rbx, 0x20(%rsp)
movq %rsp, %rcx
leaq 0x20(%rsp), %rax
cmovbq %rax, %rcx
movq %rbp, %rdi
leaq 0x58(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0xb3d8
movq 0x38(%rsp), %rdi
addq %r15, %rdi
movq %rbp, %rsi
callq 0xa174
movq %rbp, %rdi
callq 0xa18e
addq $0x8, %r15
incq %r13
jmp 0xb2e0
movq 0x38(%rsp), %rbx
movq 0x40(%rsp), %r15
cmpq %r15, %rbx
je 0xb387
movq %rbx, %rdi
callq 0x95b0
addq $0x8, %rbx
jmp 0xb374
movb $0x1, %al
xorl %ecx, %ecx
cmpq %r14, %rcx
jae 0xb39d
testb $0x1, %al
je 0xb39d
movb (%r12,%rcx), %al
incq %rcx
jmp 0xb38b
andb $0x1, %al
movq 0x8(%rsp), %rcx
movb %al, (%rcx)
leaq 0x38(%rsp), %rdi
callq 0xa19c
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb3c3
jmp 0xb3c3
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xa19c
movq %rbx, %rdi
callq 0x95e0