#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef size_t uint64_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int /*<<< orphan*/ __operation(int /*<<< orphan*/, double *);
int sysconf(int /*<<< orphan*/);
int logit_I8(const int64_t *restrict in, uint64_t *nn_in, uint64_t nR,
             void *dummy, double *out, uint64_t *nn_out) {
  int status = 0;
  int nT = sysconf(_SC_NPROCESSORS_ONLN);
  nT = 4;
#pragma omp parallel for schedule(static) num_threads(nT)
  for (uint64_t i = 0; i < nR; i++) {
    int64_t inv;
    double outv;
    inv = in[i];
    __operation(inv, &outv);
    out[i] = outv;
  }
  return status;
}


x86 assembly (clang, -O0):
<logit_I8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,-0x38(%rbp)
movl   $0x4,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    11b2 <logit_I8+0x92>
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x50(%rbp),%rsi
call   1030 <__operation@plt>
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1167 <logit_I8+0x47>
mov    -0x34(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logit_I8>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r8,%r14
mov    %rdx,%r13
mov    %rdi,%r15
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
test   %r13,%r13
je     1171 <logit_I8+0x51>
xor    %ebx,%ebx
lea    0x8(%rsp),%r12
mov    (%r15,%rbx,4),%edi
mov    %r12,%rsi
call   1030 <__operation@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1150 <logit_I8+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @logit_I8(i32* noalias %0, i64* %1, i64 %2, i8* %3, double* %4, i64* %5) {
%7 = alloca i32*
%8 = alloca i64*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca double*
%12 = alloca i64*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i64
%16 = alloca i32
%17 = alloca double
store i32* %0, i32** %7
store i64* %1, i64** %8
store i64 %2, i64* %9
store i8* %3, i8** %10
store double* %4, double** %11
store i64* %5, i64** %12
store i32 0, i32* %13
%18 = load i32, i32* @_SC_NPROCESSORS_ONLN
%19 = call i32 @sysconf(i32 %18)
store i32 %19, i32* %14
store i32 4, i32* %14
store i64 0, i64* %15
br label %20
20: ; preds = %35, %6
%21 = load i64, i64* %15
%22 = load i64, i64* %9
%23 = icmp ult i64 %21, %22
br i1 %23, label %24, label %38
24: ; preds = %20
%25 = load i32*, i32** %7
%26 = load i64, i64* %15
%27 = getelementptr inbounds i32, i32* %25, i64 %26
%28 = load i32, i32* %27
store i32 %28, i32* %16
%29 = load i32, i32* %16
%30 = call i32 @__operation(i32 %29, double* %17)
%31 = load double, double* %17
%32 = load double*, double** %11
%33 = load i64, i64* %15
%34 = getelementptr inbounds double, double* %32, i64 %33
store double %31, double* %34
br label %35
35: ; preds = %24
%36 = load i64, i64* %15
%37 = add i64 %36, 1
store i64 %37, i64* %15
br label %20
38: ; preds = %20
%39 = load i32, i32* %13
ret i32 %39
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @logit_I8(i32* noalias nocapture %0, i64* nocapture readnone %1, i64 %2, i8* nocapture readnone %3, double* nocapture writeonly %4, i64* nocapture readnone %5) {
%7 = alloca double
%8 = load i32, i32* @_SC_NPROCESSORS_ONLN
%9 = tail call i32 @sysconf(i32 %8)
%10 = icmp eq i64 %2, 0
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = bitcast double* %7 to i8*
br label %14
13: ; preds = %14, %6
ret i32 0
14: ; preds = %11, %14
%15 = phi i64 [ 0, %11 ], [ %21, %14 ]
%16 = getelementptr inbounds i32, i32* %0, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @__operation(i32 %17, double* %7)
%19 = load double, double* %7
%20 = getelementptr inbounds double, double* %4, i64 %15
store double %19, double* %20
%21 = add nuw i64 %15, 1
%22 = icmp eq i64 %21, %2
br i1 %22, label %13, label %14
}