#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*/ memmove(float *, float *, int);
void Shift_Inv_Buffer_2D(float *indata, int M, int N) {
  int i;
  for (i = 0; i < M; i++)
    memmove(indata + i * N, indata + i * 2 * (N / 2 + 1), N * sizeof(float));
}


x86 assembly (clang, -O0):
<Shift_Inv_Buffer_2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1192 <Shift_Inv_Buffer_2D+0x82>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    $0x1,%ecx
imul   %ecx,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <Shift_Inv_Buffer_2D+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Shift_Inv_Buffer_2D>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,(%rsp)
test   %esi,%esi
jle    1172 <Shift_Inv_Buffer_2D+0x62>
mov    %edx,%r15d
mov    %edx,%r13d
shr    $0x1f,%r13d
add    %edx,%r13d
and    $0xfffffffe,%r13d
add    $0x2,%r13d
movslq %edx,%r12
shl    $0x2,%r15d
mov    %esi,%ebp
shl    $0x2,%r12
xor    %r14d,%r14d
mov    (%rsp),%rbx
nopl   0x0(%rax)
movslq %r14d,%r14
mov    (%rsp),%rax
lea    (%rax,%r14,4),%rsi
mov    %rbx,%rdi
mov    %r15d,%edx
call   1030 <memmove@plt>
add    %r12,%rbx
add    %r13d,%r14d
add    $0xffffffffffffffff,%rbp
jne    1150 <Shift_Inv_Buffer_2D+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @Shift_Inv_Buffer_2D(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %33, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %36
12: ; preds = %8
%13 = load float*, float** %4
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = mul nsw i32 %14, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* %13, i64 %17
%19 = load float*, float** %4
%20 = load i32, i32* %7
%21 = mul nsw i32 %20, 2
%22 = load i32, i32* %6
%23 = sdiv i32 %22, 2
%24 = add nsw i32 %23, 1
%25 = mul nsw i32 %21, %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds float, float* %19, i64 %26
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = mul i64 %29, 4
%31 = trunc i64 %30 to i32
%32 = call i32 @memmove(float* %18, float* %27, i32 %31)
br label %33
33: ; preds = %12
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %8
36: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @Shift_Inv_Buffer_2D(float* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %23
5: ; preds = %3
%6 = sdiv i32 %2, 2
%7 = shl nsw i32 %6, 1
%8 = add i32 %7, 2
%9 = shl i32 %2, 2
%10 = sext i32 %2 to i64
%11 = zext i32 %1 to i64
br label %12
12: ; preds = %5, %12
%13 = phi i64 [ 0, %5 ], [ %21, %12 ]
%14 = mul nsw i64 %13, %10
%15 = getelementptr inbounds float, float* %0, i64 %14
%16 = trunc i64 %13 to i32
%17 = mul i32 %8, %16
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds float, float* %0, i64 %18
%20 = tail call i32 @memmove(float* %15, float* %19, i32 %9)
%21 = add nuw nsw i64 %13, 1
%22 = icmp eq i64 %21, %11
br i1 %22, label %23, label %12
23: ; preds = %12, %3
ret void
}