#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 */
struct mp3_decoder_state {
  int dummy;
};

/* Variables and functions */
int mp3internal_synth_1to1(struct mp3_decoder_state *, double *,
                           int /*<<< orphan*/, unsigned char *, int *);
int mp3internal_synth_1to1_mono(struct mp3_decoder_state *state,
                                double *bandPtr, unsigned char *samples,
                                int *pnt) {
  unsigned char ptr_samples_tmp[64 * 2];
  unsigned char *ptr_tmp1 = ptr_samples_tmp;
  unsigned i;
  int ret;
  int pnt1 = 0;
  ret = mp3internal_synth_1to1(state, bandPtr, 0, ptr_samples_tmp, &pnt1);
  samples += *pnt;
  for (i = 0; i < 32; i++) {
    samples[0] = ptr_tmp1[0];
    samples[1] = ptr_tmp1[1];
    samples += 2;
    ptr_tmp1 += 4;
  }
  *pnt += 64;
  return ret;
}


x86 assembly (clang, -O0):
<mp3internal_synth_1to1_mono>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0xa0(%rbp),%rax
mov    %rax,-0xa8(%rbp)
movl   $0x0,-0xb4(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0xa0(%rbp),%rcx
xor    %edx,%edx
lea    -0xb4(%rbp),%r8
call   1030 <mp3internal_synth_1to1@plt>
mov    %eax,-0xb0(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xac(%rbp)
cmpl   $0x20,-0xac(%rbp)
jae    11e3 <mp3internal_synth_1to1_mono+0xd3>
mov    -0xa8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xa8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    -0xa8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0xa8(%rbp)
mov    -0xac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
jmp    1184 <mp3internal_synth_1to1_mono+0x74>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x40,%ecx
mov    %ecx,(%rax)
mov    -0xb0(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp3internal_synth_1to1_mono>:
push   %r15
push   %r14
push   %rbx
sub    $0x90,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
movl   $0x0,0xc(%rsp)
xor    %ebx,%ebx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
xor    %edx,%edx
call   1030 <mp3internal_synth_1to1@plt>
movslq (%r14),%rcx
add    %r15,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl 0x10(%rsp,%rbx,4),%edx
mov    %dl,(%rcx,%rbx,2)
movzbl 0x11(%rsp,%rbx,4),%edx
mov    %dl,0x1(%rcx,%rbx,2)
movzbl 0x14(%rsp,%rbx,4),%edx
mov    %dl,0x2(%rcx,%rbx,2)
movzbl 0x15(%rsp,%rbx,4),%edx
mov    %dl,0x3(%rcx,%rbx,2)
movzbl 0x18(%rsp,%rbx,4),%edx
mov    %dl,0x4(%rcx,%rbx,2)
movzbl 0x19(%rsp,%rbx,4),%edx
mov    %dl,0x5(%rcx,%rbx,2)
movzbl 0x1c(%rsp,%rbx,4),%edx
mov    %dl,0x6(%rcx,%rbx,2)
movzbl 0x1d(%rsp,%rbx,4),%edx
mov    %dl,0x7(%rcx,%rbx,2)
add    $0x4,%rbx
cmp    $0x20,%ebx
jne    1150 <mp3internal_synth_1to1_mono+0x40>
addl   $0x40,(%r14)
add    $0x90,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.mp3_decoder_state = type { i32 }
define i32 @mp3internal_synth_1to1_mono(%struct.mp3_decoder_state* %0, double* %1, i8* nocapture writeonly %2, i32* nocapture %3) {
%5 = alloca [128 x i8]
%6 = alloca i32
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%8 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%9 = call i32 @mp3internal_synth_1to1(%struct.mp3_decoder_state* %0, double* %1, i32 0, i8* %7, i32* %6)
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %2, i64 %11
br label %13
13: ; preds = %13, %4
%14 = phi i8* [ %12, %4 ], [ %39, %13 ]
%15 = phi i32 [ 0, %4 ], [ %41, %13 ]
%16 = phi i8* [ %7, %4 ], [ %40, %13 ]
%17 = load i8, i8* %16
store i8 %17, i8* %14
%18 = getelementptr inbounds i8, i8* %16, i64 1
%19 = load i8, i8* %18
%20 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %19, i8* %20
%21 = getelementptr inbounds i8, i8* %14, i64 2
%22 = getelementptr inbounds i8, i8* %16, i64 4
%23 = load i8, i8* %22
store i8 %23, i8* %21
%24 = getelementptr inbounds i8, i8* %16, i64 5
%25 = load i8, i8* %24
%26 = getelementptr inbounds i8, i8* %14, i64 3
store i8 %25, i8* %26
%27 = getelementptr inbounds i8, i8* %14, i64 4
%28 = getelementptr inbounds i8, i8* %16, i64 8
%29 = load i8, i8* %28
store i8 %29, i8* %27
%30 = getelementptr inbounds i8, i8* %16, i64 9
%31 = load i8, i8* %30
%32 = getelementptr inbounds i8, i8* %14, i64 5
store i8 %31, i8* %32
%33 = getelementptr inbounds i8, i8* %14, i64 6
%34 = getelementptr inbounds i8, i8* %16, i64 12
%35 = load i8, i8* %34
store i8 %35, i8* %33
%36 = getelementptr inbounds i8, i8* %16, i64 13
%37 = load i8, i8* %36
%38 = getelementptr inbounds i8, i8* %14, i64 7
store i8 %37, i8* %38
%39 = getelementptr inbounds i8, i8* %14, i64 8
%40 = getelementptr inbounds i8, i8* %16, i64 16
%41 = add nuw nsw i32 %15, 4
%42 = icmp eq i32 %41, 32
br i1 %42, label %43, label %13
43: ; preds = %13
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 64
store i32 %45, i32* %3
ret i32 %9
}