#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 */

/* Variables and functions */
int /*<<< orphan*/ vec_lmsf(float const *, float *, int, float);
void vec_circular_lmsf(const float x[], float y[], int n, int pos,
                       float error) {
  vec_lmsf(&x[pos], &y[0], n - pos, error);
  vec_lmsf(&x[0], &y[n - pos], pos, error);
}


x86 assembly (clang, -O0):
<vec_circular_lmsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    -0x18(%rbp),%edx
movss  -0x1c(%rbp),%xmm0
call   1030 <vec_lmsf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%edx
movss  -0x1c(%rbp),%xmm0
call   1030 <vec_lmsf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_circular_lmsf>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
movslq %ecx,%r12
lea    (%rdi,%r12,4),%rdi
sub    %r12d,%ebx
mov    %ebx,%edx
call   1030 <vec_lmsf@plt>
movslq %ebx,%rax
lea    (%r14,%rax,4),%rsi
mov    %r15,%rdi
mov    %r12d,%edx
movss  0x4(%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <vec_lmsf@plt>

LLVM IR (-O0):
define void @vec_circular_lmsf(float* %0, float* %1, i32 %2, i32 %3, float %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
store float* %0, float** %6
store float* %1, float** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store float %4, float* %10
%11 = load float*, float** %6
%12 = load i32, i32* %9
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds float, float* %11, i64 %13
%15 = load float*, float** %7
%16 = getelementptr inbounds float, float* %15, i64 0
%17 = load i32, i32* %8
%18 = load i32, i32* %9
%19 = sub nsw i32 %17, %18
%20 = load float, float* %10
%21 = call i32 @vec_lmsf(float* %14, float* %16, i32 %19, float %20)
%22 = load float*, float** %6
%23 = getelementptr inbounds float, float* %22, i64 0
%24 = load float*, float** %7
%25 = load i32, i32* %8
%26 = load i32, i32* %9
%27 = sub nsw i32 %25, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds float, float* %24, i64 %28
%30 = load i32, i32* %9
%31 = load float, float* %10
%32 = call i32 @vec_lmsf(float* %23, float* %29, i32 %30, float %31)
ret void
}

LLVM IR (-O2):
define void @vec_circular_lmsf(float* %0, float* %1, i32 %2, i32 %3, float %4) {
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds float, float* %0, i64 %6
%8 = sub nsw i32 %2, %3
%9 = tail call i32 @vec_lmsf(float* %7, float* %1, i32 %8, float %4)
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds float, float* %1, i64 %10
%12 = tail call i32 @vec_lmsf(float* %0, float* %11, i32 %3, float %4)
ret void
}