// File: /workspace/github_cpp_makefile_star2_O1/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 %rdx, 0x58(%rsp)
movq %rcx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movb $0x1, (%rsi)
movq (%rdi), %r14
movq 0x8(%rdi), %rsi
movq %rcx, %rax
xorl %edx, %edx
divq %r14
cmpq $0x1, %rdx
sbbq $-0x1, %rax
cmpq %rcx, %rsi
movq %rcx, %r13
cmovbq %rsi, %r13
cmpq %rsi, %rax
cmovaeq %rax, %r13
cmpq %r13, %rsi
jb 0xb7ff
movq %rcx, %rax
xorl %edx, %edx
divq %r13
movq %rax, %r14
cmpq $0x1, %rdx
sbbq $-0x1, %r14
leaq 0x40(%rsp), %rdi
leaq 0x60(%rsp), %rdx
movq %r14, %rsi
callq 0xa482
movq %r14, %rdi
callq 0x9030
movq %rax, %r12
testq %r14, %r14
je 0xb8a8
xorl %r15d, %r15d
leaq 0x28(%rsp), %rbx
xorl %ebp, %ebp
leaq (%r12,%rbp), %rax
movq %rax, 0x38(%rsp)
movb $0x1, (%r12,%rbp)
leaq 0x38(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x58(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x70(%rsp)
movq %r15, 0x28(%rsp)
addq %r13, %r15
movq %r15, 0x20(%rsp)
leaq 0x20(%rsp), %rcx
cmpq 0x8(%rsp), %r15
jb 0xb879
leaq 0x8(%rsp), %rcx
leaq 0x30(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movq %rbx, %rdx
callq 0xb922
movq 0x40(%rsp), %rax
cmpq $0x0, (%rax,%rbp,8)
jne 0xb904
movq 0x30(%rsp), %rcx
movq %rcx, (%rax,%rbp,8)
incq %rbp
cmpq %rbp, %r14
jne 0xb82f
movq 0x40(%rsp), %rbx
movq 0x48(%rsp), %r15
cmpq %r15, %rbx
je 0xb8c5
movq %rbx, %rdi
callq 0x95a0
addq $0x8, %rbx
jmp 0xb8b2
testq %r14, %r14
je 0xb8e2
movl $0x1, %ecx
movb -0x1(%r12,%rcx), %al
cmpq %r14, %rcx
jae 0xb8e4
incq %rcx
testb %al, %al
jne 0xb8cf
jmp 0xb8e4
movb $0x1, %al
movq 0x10(%rsp), %rcx
movb %al, (%rcx)
leaq 0x40(%rsp), %rdi
callq 0xa594
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x90c0
jmp 0xb90d
jmp 0xb90d
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xa594
movq %rbx, %rdi
callq 0x95d0