#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*/ xmp3_fdct32(float *, float *);
int /*<<< orphan*/ xmp3_window(float *, int, unsigned char *);
void xmp3_sbt_mono_L3(float *sample, unsigned char *pcm, int ch,
                      float vbuf[][512], int vb_ptr_arg[]) {
  int i;
  int vb_ptr;
  vb_ptr = vb_ptr_arg[0];
  for (i = 0; i < 18; i++) {
    xmp3_fdct32(sample, vbuf[0] + vb_ptr);
    xmp3_window(vbuf[0], vb_ptr, pcm);
    sample += 32;
    vb_ptr = (vb_ptr - 32) & 511;
    pcm += 32 * sizeof(short);
  }
  vb_ptr_arg[0] = vb_ptr;
}


x86 assembly (clang, -O0):
<xmp3_sbt_mono_L3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x12,-0x2c(%rbp)
jge    11b3 <xmp3_sbt_mono_L3+0x93>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movslq -0x30(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
call   1030 <xmp3_fdct32@plt>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <xmp3_window@plt>
mov    -0x8(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x8(%rbp)
mov    -0x30(%rbp),%eax
sub    $0x20,%eax
and    $0x1ff,%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x10(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    114b <xmp3_sbt_mono_L3+0x2b>
mov    -0x30(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmp3_sbt_mono_L3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r12
mov    %rsi,%r15
mov    %rdi,%r13
mov    %r8,(%rsp)
mov    (%r8),%ebx
xor    %r14d,%r14d
xchg   %ax,%ax
lea    (%r15,%r14,1),%rbp
movslq %ebx,%rbx
lea    (%r12,%rbx,4),%rsi
mov    %r13,%rdi
call   1030 <xmp3_fdct32@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    %rbp,%rdx
call   1040 <xmp3_window@plt>
sub    $0xffffffffffffff80,%r13
add    $0x1e0,%ebx
and    $0x1ff,%ebx
add    $0x40,%r14
cmp    $0x480,%r14d
jne    1140 <xmp3_sbt_mono_L3+0x20>
mov    (%rsp),%rax
mov    %ebx,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @xmp3_sbt_mono_L3(float* %0, i8* %1, i32 %2, [512 x float]* %3, i32* nocapture %4) {
%6 = load i32, i32* %4
%7 = getelementptr inbounds [512 x float], [512 x float]* %3, i64 0, i64 0
br label %8
8: ; preds = %5, %8
%9 = phi i32 [ %6, %5 ], [ %19, %8 ]
%10 = phi i32 [ 0, %5 ], [ %21, %8 ]
%11 = phi float* [ %0, %5 ], [ %17, %8 ]
%12 = phi i8* [ %1, %5 ], [ %20, %8 ]
%13 = sext i32 %9 to i64
%14 = getelementptr inbounds [512 x float], [512 x float]* %3, i64 0, i64 %13
%15 = tail call i32 @xmp3_fdct32(float* %11, float* %14)
%16 = tail call i32 @xmp3_window(float* %7, i32 %9, i8* %12)
%17 = getelementptr inbounds float, float* %11, i64 32
%18 = add i32 %9, 480
%19 = and i32 %18, 511
%20 = getelementptr inbounds i8, i8* %12, i64 64
%21 = add nuw nsw i32 %10, 1
%22 = icmp eq i32 %21, 18
br i1 %22, label %23, label %8
23: ; preds = %8
store i32 %19, i32* %4
ret void
}