#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 int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dsnanmean(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 0.0 / 0.0, 3.0, 0.0 / 0.0, 4.0,
               5.0, 6.0, 0.0 / 0.0, 7.0, 8.0,       0.0 / 0.0};
  int64_t N = 6;
  int64_t stride = 2;
  double v = stdlib_strided_dsnanmean(N, x, stride);
  printf("mean: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x30,%edx
call   1050 <memcpy@plt>
movl   $0x6,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1030 <stdlib_strided_dsnanmean@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x6,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_dsnanmean@plt>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [12 x float] [float 1.000000e+00, float 2.000000e+00, float 0x7FF8000000000000, float 3.000000e+00, float 0x7FF8000000000000, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 0x7FF8000000000000, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [12 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [12 x float]* %1 to i8*
store i32 6, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [12 x float], [12 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dsnanmean(i32 %6, float* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [12 x float] [float 1.000000e+00, float 2.000000e+00, float 0x7FF8000000000000, float 3.000000e+00, float 0x7FF8000000000000, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 0x7FF8000000000000, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [12 x float]
%2 = bitcast [12 x float]* %1 to i8*
%3 = getelementptr inbounds [12 x float], [12 x float]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dsnanmean(i32 6, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}