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

/* Variables and functions */
int /*<<< orphan*/ drmp3_L3_imdct12(float *, float *, float *);
int /*<<< orphan*/ memcpy(float *, float *, int);
void drmp3_L3_imdct_short(float *grbuf, float *overlap, int nbands) {
  for (; nbands > 0; nbands--, overlap += 9, grbuf += 18) {
    float tmp[18];
    memcpy(tmp, grbuf, sizeof(tmp));
    memcpy(grbuf, overlap, 6 * sizeof(float));
    drmp3_L3_imdct12(tmp, grbuf + 6, overlap + 6);
    drmp3_L3_imdct12(tmp + 1, grbuf + 12, overlap + 6);
    drmp3_L3_imdct12(tmp + 2, overlap, overlap + 6);
  }
}


x86 assembly (clang, -O0):
<drmp3_L3_imdct_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11d6 <drmp3_L3_imdct_short+0xb6>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x48,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x18,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x18,%rsi
mov    -0x10(%rbp),%rdx
add    $0x18,%rdx
call   1030 <drmp3_L3_imdct12@plt>
lea    -0x60(%rbp),%rdi
add    $0x4,%rdi
mov    -0x8(%rbp),%rsi
add    $0x30,%rsi
mov    -0x10(%rbp),%rdx
add    $0x18,%rdx
call   1030 <drmp3_L3_imdct12@plt>
lea    -0x60(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x18,%rdx
call   1030 <drmp3_L3_imdct12@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x24,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x48,%rax
mov    %rax,-0x8(%rbp)
jmp    1133 <drmp3_L3_imdct_short+0x13>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drmp3_L3_imdct_short>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
test   %edx,%edx
jle    11b4 <drmp3_L3_imdct_short+0x94>
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0x8(%rsp),%r12
add    $0x1,%r14d
mov    %rsp,%r13
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %rbp,%rsi
mov    $0x48,%edx
call   1040 <memcpy@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x18,%edx
call   1040 <memcpy@plt>
lea    0x18(%rbp),%rsi
lea    0x18(%rbx),%r15
mov    %r13,%rdi
mov    %r15,%rdx
call   1030 <drmp3_L3_imdct12@plt>
lea    0x30(%rbp),%rsi
lea    0x4(%rsp),%rdi
mov    %r15,%rdx
call   1030 <drmp3_L3_imdct12@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <drmp3_L3_imdct12@plt>
add    $0xffffffff,%r14d
add    $0x48,%rbp
add    $0x24,%rbx
cmp    $0x1,%r14d
ja     1150 <drmp3_L3_imdct_short+0x30>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @drmp3_L3_imdct_short(float* %0, float* %1, i32 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32
%7 = alloca [18 x float]
store float* %0, float** %4
store float* %1, float** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %37, %3
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %44
11: ; preds = %8
%12 = getelementptr inbounds [18 x float], [18 x float]* %7, i64 0, i64 0
%13 = load float*, float** %4
%14 = call i32 @memcpy(float* %12, float* %13, i32 72)
%15 = load float*, float** %4
%16 = load float*, float** %5
%17 = call i32 @memcpy(float* %15, float* %16, i32 24)
%18 = getelementptr inbounds [18 x float], [18 x float]* %7, i64 0, i64 0
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 6
%21 = load float*, float** %5
%22 = getelementptr inbounds float, float* %21, i64 6
%23 = call i32 @drmp3_L3_imdct12(float* %18, float* %20, float* %22)
%24 = getelementptr inbounds [18 x float], [18 x float]* %7, i64 0, i64 0
%25 = getelementptr inbounds float, float* %24, i64 1
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 12
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 6
%30 = call i32 @drmp3_L3_imdct12(float* %25, float* %27, float* %29)
%31 = getelementptr inbounds [18 x float], [18 x float]* %7, i64 0, i64 0
%32 = getelementptr inbounds float, float* %31, i64 2
%33 = load float*, float** %5
%34 = load float*, float** %5
%35 = getelementptr inbounds float, float* %34, i64 6
%36 = call i32 @drmp3_L3_imdct12(float* %32, float* %33, float* %35)
br label %37
37: ; preds = %11
%38 = load i32, i32* %6
%39 = add nsw i32 %38, -1
store i32 %39, i32* %6
%40 = load float*, float** %5
%41 = getelementptr inbounds float, float* %40, i64 9
store float* %41, float** %5
%42 = load float*, float** %4
%43 = getelementptr inbounds float, float* %42, i64 18
store float* %43, float** %4
br label %8
44: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @drmp3_L3_imdct_short(float* %0, float* %1, i32 %2) {
%4 = alloca [18 x float]
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %27
6: ; preds = %3
%7 = bitcast [18 x float]* %4 to i8*
%8 = getelementptr inbounds [18 x float], [18 x float]* %4, i64 0, i64 0
%9 = getelementptr inbounds [18 x float], [18 x float]* %4, i64 0, i64 1
%10 = getelementptr inbounds [18 x float], [18 x float]* %4, i64 0, i64 2
br label %11
11: ; preds = %6, %11
%12 = phi i32 [ %2, %6 ], [ %23, %11 ]
%13 = phi float* [ %1, %6 ], [ %24, %11 ]
%14 = phi float* [ %0, %6 ], [ %25, %11 ]
%15 = call i32 @memcpy(float* %8, float* %14, i32 72)
%16 = call i32 @memcpy(float* %14, float* %13, i32 24)
%17 = getelementptr inbounds float, float* %14, i64 6
%18 = getelementptr inbounds float, float* %13, i64 6
%19 = call i32 @drmp3_L3_imdct12(float* %8, float* %17, float* %18)
%20 = getelementptr inbounds float, float* %14, i64 12
%21 = call i32 @drmp3_L3_imdct12(float* %9, float* %20, float* %18)
%22 = call i32 @drmp3_L3_imdct12(float* %10, float* %13, float* %18)
%23 = add nsw i32 %12, -1
%24 = getelementptr inbounds float, float* %13, i64 9
%25 = getelementptr inbounds float, float* %14, i64 18
%26 = icmp ugt i32 %12, 1
br i1 %26, label %11, label %27
27: ; preds = %11, %3
ret void
}