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

/* Variables and functions */
scalar_t__ stdlib_strided_sapxsum(scalar_t__ const, float const, float const *,
                                  scalar_t__ const);
float stdlib_strided_smeanli(const int64_t N, const float *X,
                             const int64_t stride) {
  int64_t ix;
  if (N <= 0) {
    return 0.0f / 0.0f;
  }
  if (N == 1 || stride == 0) {
    return X[0];
  }
  if (stride < 0) {
    ix = (1 - N) * stride;
  } else {
    ix = 0;
  }
  return X[ix] +
         (float)((double)stdlib_strided_sapxsum(
                     N - 1, -X[ix], X + ((stride > 0) ? stride : 0), stride) /
                 (double)N);
}


x86 assembly (clang, -O0):
<stdlib_strided_smeanli>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     1141 <stdlib_strided_smeanli+0x31>
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    123d <stdlib_strided_smeanli+0x12d>
cmpq   $0x1,-0x10(%rbp)
je     1157 <stdlib_strided_smeanli+0x47>
cmpq   $0x0,-0x20(%rbp)
jne    1169 <stdlib_strided_smeanli+0x59>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    123d <stdlib_strided_smeanli+0x12d>
cmpq   $0x0,-0x20(%rbp)
jge    118b <stdlib_strided_smeanli+0x7b>
mov    $0x1,%eax
sub    -0x10(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1193 <stdlib_strided_smeanli+0x83>
movq   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x20(%rbp)
jle    11f0 <stdlib_strided_smeanli+0xe0>
mov    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
jmp    11fb <stdlib_strided_smeanli+0xeb>
xor    %eax,%eax
mov    %rax,-0x50(%rbp)
jmp    11fb <stdlib_strided_smeanli+0xeb>
movss  -0x34(%rbp),%xmm0
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x50(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x20(%rbp),%rdx
call   1030 <stdlib_strided_sapxsum@plt>
movss  -0x44(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
cvtsi2sdq -0x10(%rbp),%xmm2
divsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_smeanli>:
push   %rbx
sub    $0x10,%rsp
test   %rdi,%rdi
jle    1186 <stdlib_strided_smeanli+0x76>
mov    %rdi,%rbx
cmp    $0x1,%rdi
je     1190 <stdlib_strided_smeanli+0x80>
test   %rdx,%rdx
je     1190 <stdlib_strided_smeanli+0x80>
mov    $0x1,%eax
sub    %rbx,%rax
imul   %rdx,%rax
mov    %rdx,%rcx
sar    $0x3f,%rcx
and    %rax,%rcx
movss  (%rsi,%rcx,4),%xmm1
movaps %xmm1,(%rsp)
lea    -0x1(%rbx),%rdi
movaps 0xebe(%rip),%xmm0
xorps  %xmm1,%xmm0
xor    %eax,%eax
test   %rdx,%rdx
cmovns %rdx,%rax
lea    (%rsi,%rax,4),%rsi
call   1030 <stdlib_strided_sapxsum@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %rbx,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
addss  (%rsp),%xmm0
jmp    1194 <stdlib_strided_smeanli+0x84>
movss  0xe72(%rip),%xmm0
jmp    1194 <stdlib_strided_smeanli+0x84>
movss  (%rsi),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @stdlib_strided_smeanli(i64 %0, float* %1, i64 %2) {
%4 = alloca float
%5 = alloca i64
%6 = alloca float*
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store float* %1, float** %6
store i64 %2, i64* %7
%9 = load i64, i64* %5
%10 = icmp sle i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store float 0x7FF8000000000000, float* %4
br label %60
12: ; preds = %3
%13 = load i64, i64* %5
%14 = icmp eq i64 %13, 1
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i64, i64* %7
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %15, %12
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 0
%21 = load float, float* %20
store float %21, float* %4
br label %60
22: ; preds = %15
%23 = load i64, i64* %7
%24 = icmp slt i64 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %22
%26 = load i64, i64* %5
%27 = sub nsw i64 1, %26
%28 = load i64, i64* %7
%29 = mul nsw i64 %27, %28
store i64 %29, i64* %8
br label %31
30: ; preds = %22
store i64 0, i64* %8
br label %31
31: ; preds = %30, %25
%32 = load float*, float** %6
%33 = load i64, i64* %8
%34 = getelementptr inbounds float, float* %32, i64 %33
%35 = load float, float* %34
%36 = load i64, i64* %5
%37 = sub nsw i64 %36, 1
%38 = load float*, float** %6
%39 = load i64, i64* %8
%40 = getelementptr inbounds float, float* %38, i64 %39
%41 = load float, float* %40
%42 = fneg float %41
%43 = load float*, float** %6
%44 = load i64, i64* %7
%45 = icmp sgt i64 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %31
%47 = load i64, i64* %7
br label %49
48: ; preds = %31
br label %49
49: ; preds = %48, %46
%50 = phi i64 [ %47, %46 ], [ 0, %48 ]
%51 = getelementptr inbounds float, float* %43, i64 %50
%52 = load i64, i64* %7
%53 = call i64 @stdlib_strided_sapxsum(i64 %37, float %42, float* %51, i64 %52)
%54 = sitofp i64 %53 to double
%55 = load i64, i64* %5
%56 = sitofp i64 %55 to double
%57 = fdiv double %54, %56
%58 = fptrunc double %57 to float
%59 = fadd float %35, %58
store float %59, float* %4
br label %60
60: ; preds = %49, %18, %11
%61 = load float, float* %4
ret float %61
}

LLVM IR (-O2):
define float @stdlib_strided_smeanli(i64 %0, float* %1, i64 %2) {
%4 = icmp slt i64 %0, 1
br i1 %4, label %29, label %5
5: ; preds = %3
%6 = icmp eq i64 %0, 1
%7 = icmp eq i64 %2, 0
%8 = or i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = load float, float* %1
br label %29
11: ; preds = %5
%12 = icmp slt i64 %2, 0
%13 = sub nsw i64 1, %0
%14 = mul nsw i64 %13, %2
%15 = select i1 %12, i64 %14, i64 0
%16 = getelementptr inbounds float, float* %1, i64 %15
%17 = load float, float* %16
%18 = add nsw i64 %0, -1
%19 = fneg float %17
%20 = icmp sgt i64 %2, 0
%21 = select i1 %20, i64 %2, i64 0
%22 = getelementptr inbounds float, float* %1, i64 %21
%23 = tail call i64 @stdlib_strided_sapxsum(i64 %18, float %19, float* %22, i64 %2)
%24 = sitofp i64 %23 to double
%25 = sitofp i64 %0 to double
%26 = fdiv double %24, %25
%27 = fptrunc double %26 to float
%28 = fadd float %17, %27
br label %29
29: ; preds = %3, %11, %9
%30 = phi float [ %10, %9 ], [ %28, %11 ], [ 0x7FF8000000000000, %3 ]
ret float %30
}