#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 /*<<< orphan*/ int16_t;

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


x86 assembly (clang, -O0):
<vec_circular_lmsi16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-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
mov    -0x1c(%rbp),%ecx
call   1030 <vec_lmsi16@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
mov    -0x1c(%rbp),%ecx
call   1030 <vec_lmsi16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_circular_lmsi16>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %edx,%ebp
mov    %rsi,%r12
mov    %rdi,%r15
movslq %ecx,%rbx
lea    (%rdi,%rbx,4),%rdi
sub    %ebx,%ebp
mov    %ebp,%edx
mov    %r8d,%ecx
call   1030 <vec_lmsi16@plt>
movslq %ebp,%rax
lea    (%r12,%rax,4),%rsi
mov    %r15,%rdi
mov    %ebx,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <vec_lmsi16@plt>

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

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