#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*/ L3_idct3(float, float, float, float *);
void L3_imdct12(float *x, float *dst, float *overlap) {
  static const float g_twid3[6] = {0.79335334f, 0.92387953f, 0.99144486f,
                                   0.60876143f, 0.38268343f, 0.13052619f};
  float co[3], si[3];
  int i;
  L3_idct3(-x[0], x[6] + x[3], x[12] + x[9], co);
  L3_idct3(x[15], x[12] - x[9], x[6] - x[3], si);
  si[1] = -si[1];
  for (i = 0; i < 3; i++) {
    float ovl = overlap[i];
    float sum = co[i] * g_twid3[3 + i] + si[i] * g_twid3[0 + i];
    overlap[i] = co[i] * g_twid3[0 + i] - si[i] * g_twid3[3 + i];
    dst[i] = ovl * g_twid3[2 - i] - sum * g_twid3[5 - i];
    dst[5 - i] = ovl * g_twid3[5 - i] + sum * g_twid3[2 - i];
  }
}


x86 assembly (clang, -O0):
<L3_imdct12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  0x18(%rax),%xmm1
mov    -0x8(%rbp),%rax
addss  0xc(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x30(%rax),%xmm2
mov    -0x8(%rbp),%rax
addss  0x24(%rax),%xmm2
lea    -0x24(%rbp),%rdi
call   1030 <L3_idct3@plt>
mov    -0x8(%rbp),%rax
movss  0x3c(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x30(%rax),%xmm1
mov    -0x8(%rbp),%rax
subss  0x24(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x18(%rax),%xmm2
mov    -0x8(%rbp),%rax
subss  0xc(%rax),%xmm2
lea    -0x30(%rbp),%rdi
call   1030 <L3_idct3@plt>
movss  -0x2c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x2c(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    133d <L3_imdct12+0x22d>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x38(%rbp)
movslq -0x34(%rbp),%rax
movss  -0x24(%rbp,%rax,4),%xmm0
mov    -0x34(%rbp),%eax
add    $0x3,%eax
movslq %eax,%rcx
lea    0xe10(%rip),%rax
movss  (%rax,%rcx,4),%xmm2
movslq -0x34(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm1
mov    -0x34(%rbp),%eax
add    $0x0,%eax
movslq %eax,%rcx
lea    0xdf1(%rip),%rax
mulss  (%rax,%rcx,4),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x3c(%rbp)
movslq -0x34(%rbp),%rax
movss  -0x24(%rbp,%rax,4),%xmm0
mov    -0x34(%rbp),%eax
add    $0x0,%eax
movslq %eax,%rcx
lea    0xdc5(%rip),%rax
movss  (%rax,%rcx,4),%xmm2
movslq -0x34(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm1
mov    -0x34(%rbp),%eax
add    $0x3,%eax
movslq %eax,%rcx
lea    0xda6(%rip),%rax
mulss  (%rax,%rcx,4),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x38(%rbp),%xmm0
mov    $0x2,%eax
sub    -0x34(%rbp),%eax
movslq %eax,%rcx
lea    0xd68(%rip),%rax
movss  (%rax,%rcx,4),%xmm2
movss  -0x3c(%rbp),%xmm1
mov    $0x5,%eax
sub    -0x34(%rbp),%eax
movslq %eax,%rcx
lea    0xd4c(%rip),%rax
mulss  (%rax,%rcx,4),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x38(%rbp),%xmm0
mov    $0x5,%eax
sub    -0x34(%rbp),%eax
movslq %eax,%rcx
lea    0xd0e(%rip),%rax
movss  (%rax,%rcx,4),%xmm2
movss  -0x3c(%rbp),%xmm1
mov    $0x2,%eax
sub    -0x34(%rbp),%eax
movslq %eax,%rcx
lea    0xcf2(%rip),%rax
mulss  (%rax,%rcx,4),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    $0x5,%ecx
sub    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11ba <L3_imdct12+0xaa>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<L3_imdct12>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
movss  (%rdi),%xmm0
xorps  0xed9(%rip),%xmm0
movss  0x18(%rdi),%xmm1
addss  0xc(%rdi),%xmm1
mov    %rdx,%r15
mov    %rsi,%r14
movss  0x30(%rdi),%xmm2
addss  0x24(%rdi),%xmm2
lea    0x14(%rsp),%rdi
call   1030 <L3_idct3@plt>
movss  0x3c(%rbx),%xmm0
movss  0x18(%rbx),%xmm2
movss  0x30(%rbx),%xmm1
subss  0x24(%rbx),%xmm1
subss  0xc(%rbx),%xmm2
lea    0x8(%rsp),%rdi
call   1030 <L3_idct3@plt>
movss  0x8(%rsp),%xmm3
movss  0xc(%rsp),%xmm6
movss  (%r15),%xmm1
movss  0x14(%rsp),%xmm5
movss  0xe82(%rip),%xmm10
movaps %xmm3,%xmm2
mulss  %xmm10,%xmm2
movss  0xe75(%rip),%xmm8
movaps %xmm5,%xmm4
mulss  %xmm8,%xmm4
addss  %xmm2,%xmm4
movss  0xe65(%rip),%xmm2
mulss  %xmm2,%xmm3
mulss  %xmm10,%xmm5
addss  %xmm3,%xmm5
movss  %xmm5,(%r15)
movss  0xe4e(%rip),%xmm9
movaps %xmm4,%xmm3
mulss  %xmm9,%xmm3
movss  0xe41(%rip),%xmm11
movaps %xmm1,%xmm7
mulss  %xmm11,%xmm7
addss  %xmm3,%xmm7
movss  %xmm7,(%r14)
mulss  %xmm11,%xmm4
movss  0xe27(%rip),%xmm3
mulss  %xmm3,%xmm1
addss  %xmm4,%xmm1
movss  %xmm1,0x14(%r14)
movss  0x4(%r15),%xmm1
movss  0x18(%rsp),%xmm5
movss  0xe09(%rip),%xmm7
mulss  %xmm6,%xmm7
movss  0xe01(%rip),%xmm0
movaps %xmm5,%xmm4
mulss  %xmm0,%xmm4
addss  %xmm7,%xmm4
mulss  %xmm0,%xmm6
movss  0xdee(%rip),%xmm7
mulss  %xmm7,%xmm5
addss  %xmm6,%xmm5
movss  %xmm5,0x4(%r15)
movss  0xddc(%rip),%xmm5
mulss  %xmm4,%xmm5
movaps %xmm1,%xmm6
mulss  %xmm7,%xmm6
addss  %xmm5,%xmm6
movss  %xmm6,0x4(%r14)
mulss  %xmm7,%xmm4
mulss  %xmm0,%xmm1
addss  %xmm4,%xmm1
movss  %xmm1,0x10(%r14)
movss  0x8(%r15),%xmm0
movss  0x1c(%rsp),%xmm1
movss  0x10(%rsp),%xmm4
movaps %xmm4,%xmm5
mulss  %xmm11,%xmm5
mulss  %xmm1,%xmm3
addss  %xmm5,%xmm3
mulss  %xmm9,%xmm4
mulss  %xmm11,%xmm1
addss  %xmm4,%xmm1
movss  %xmm1,0x8(%r15)
mulss  %xmm3,%xmm2
movaps %xmm0,%xmm1
mulss  %xmm10,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,0x8(%r14)
mulss  %xmm10,%xmm3
mulss  %xmm8,%xmm0
addss  %xmm3,%xmm0
movss  %xmm0,0xc(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@L3_imdct12.g_twid3 = internal constant [6 x float] [float 0x3FE9632680000000, float 0x3FED906BC0000000, float 0x3FEFB9EAA0000000, float 0x3FE37AF940000000, float 0x3FD87DE2A0000000, float 0x3FC0B51500000000]
define void @L3_imdct12(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
%7 = alloca [3 x float]
%8 = alloca [3 x float]
%9 = alloca i32
%10 = alloca float
%11 = alloca float
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 0
%14 = load float, float* %13
%15 = fneg float %14
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 6
%18 = load float, float* %17
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 3
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 12
%25 = load float, float* %24
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 9
%28 = load float, float* %27
%29 = fadd float %25, %28
%30 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
%31 = call i32 @L3_idct3(float %15, float %22, float %29, float* %30)
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 15
%34 = load float, float* %33
%35 = load float*, float** %4
%36 = getelementptr inbounds float, float* %35, i64 12
%37 = load float, float* %36
%38 = load float*, float** %4
%39 = getelementptr inbounds float, float* %38, i64 9
%40 = load float, float* %39
%41 = fsub float %37, %40
%42 = load float*, float** %4
%43 = getelementptr inbounds float, float* %42, i64 6
%44 = load float, float* %43
%45 = load float*, float** %4
%46 = getelementptr inbounds float, float* %45, i64 3
%47 = load float, float* %46
%48 = fsub float %44, %47
%49 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 0
%50 = call i32 @L3_idct3(float %34, float %41, float %48, float* %49)
%51 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 1
%52 = load float, float* %51
%53 = fneg float %52
%54 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 1
store float %53, float* %54
store i32 0, i32* %9
br label %55
55: ; preds = %147, %3
%56 = load i32, i32* %9
%57 = icmp slt i32 %56, 3
br i1 %57, label %58, label %150
58: ; preds = %55
%59 = load float*, float** %6
%60 = load i32, i32* %9
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds float, float* %59, i64 %61
%63 = load float, float* %62
store float %63, float* %10
%64 = load i32, i32* %9
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 %65
%67 = load float, float* %66
%68 = load i32, i32* %9
%69 = add nsw i32 3, %68
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [6 x float], [6 x float]* @L3_imdct12.g_twid3, i64 0, i64 %70
%72 = load float, float* %71
%73 = load i32, i32* %9
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 %74
%76 = load float, float* %75
%77 = load i32, i32* %9
%78 = add nsw i32 0, %77
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [6 x float], [6 x float]* @L3_imdct12.g_twid3, i64 0, i64 %79
%81 = load float, float* %80
%82 = fmul float %76, %81
%83 = call float @llvm.fmuladd.f32(float %67, float %72, float %82)
store float %83, float* %11
%84 = load i32, i32* %9
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 %85
%87 = load float, float* %86
%88 = load i32, i32* %9
%89 = add nsw i32 0, %88
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [6 x float], [6 x float]* @L3_imdct12.g_twid3, i64 0, i64 %90
%92 = load float, float* %91
%93 = load i32, i32* %9
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 %94
%96 = load float, float* %95
%97 = load i32, i32* %9
%98 = add nsw i32 3, %97
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [6 x float], [6 x float]* @L3_imdct12.g_twid3, i64 0, i64 %99
%101 = load float, float* %100
%102 = fmul float %96, %101
%103 = fneg float %102
%104 = call float @llvm.fmuladd.f32(float %87, float %92, float %103)
%105 = load float*, float** %6
%106 = load i32, i32* %9
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds float, float* %105, i64 %107
store float %104, float* %108
%109 = load float, float* %10
%110 = load i32, i32* %9
%111 = sub nsw i32 2, %110
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [6 x float], [6 x float]* @L3_imdct12.g_twid3, i64 0, i64 %112
%114 = load float, float* %113
%115 = load float, float* %11
%116 = load i32, i32* %9
%117 = sub nsw i32 5, %116
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [6 x float], [6 x float]* @L3_imdct12.g_twid3, i64 0, i64 %118
%120 = load float, float* %119
%121 = fmul float %115, %120
%122 = fneg float %121
%123 = call float @llvm.fmuladd.f32(float %109, float %114, float %122)
%124 = load float*, float** %5
%125 = load i32, i32* %9
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds float, float* %124, i64 %126
store float %123, float* %127
%128 = load float, float* %10
%129 = load i32, i32* %9
%130 = sub nsw i32 5, %129
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds [6 x float], [6 x float]* @L3_imdct12.g_twid3, i64 0, i64 %131
%133 = load float, float* %132
%134 = load float, float* %11
%135 = load i32, i32* %9
%136 = sub nsw i32 2, %135
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds [6 x float], [6 x float]* @L3_imdct12.g_twid3, i64 0, i64 %137
%139 = load float, float* %138
%140 = fmul float %134, %139
%141 = call float @llvm.fmuladd.f32(float %128, float %133, float %140)
%142 = load float*, float** %5
%143 = load i32, i32* %9
%144 = sub nsw i32 5, %143
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds float, float* %142, i64 %145
store float %141, float* %146
br label %147
147: ; preds = %58
%148 = load i32, i32* %9
%149 = add nsw i32 %148, 1
store i32 %149, i32* %9
br label %55
150: ; preds = %55
ret void
}

LLVM IR (-O2):
define void @L3_imdct12(float* nocapture %0, float* nocapture writeonly %1, float* nocapture %2) {
%4 = alloca [3 x float]
%5 = alloca [3 x float]
%6 = bitcast [3 x float]* %4 to i8*
%7 = bitcast [3 x float]* %5 to i8*
%8 = load float, float* %0
%9 = fneg float %8
%10 = getelementptr inbounds float, float* %0, i64 6
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %0, i64 3
%13 = load float, float* %12
%14 = fadd float %11, %13
%15 = getelementptr inbounds float, float* %0, i64 12
%16 = load float, float* %15
%17 = getelementptr inbounds float, float* %0, i64 9
%18 = load float, float* %17
%19 = fadd float %16, %18
%20 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 0
%21 = call i32 @L3_idct3(float %9, float %14, float %19, float* %20)
%22 = getelementptr inbounds float, float* %0, i64 15
%23 = load float, float* %22
%24 = load float, float* %15
%25 = load float, float* %17
%26 = fsub float %24, %25
%27 = load float, float* %10
%28 = load float, float* %12
%29 = fsub float %27, %28
%30 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%31 = call i32 @L3_idct3(float %23, float %26, float %29, float* %30)
%32 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 1
%33 = load float, float* %32
%34 = load float, float* %2
%35 = load float, float* %20
%36 = load float, float* %30
%37 = fmul float %36, 0x3FE9632680000000
%38 = call float @llvm.fmuladd.f32(float %35, float 0x3FE37AF940000000, float %37)
%39 = fmul float %36, 0xBFE37AF940000000
%40 = call float @llvm.fmuladd.f32(float %35, float 0x3FE9632680000000, float %39)
store float %40, float* %2
%41 = fmul float %38, 0xBFC0B51500000000
%42 = call float @llvm.fmuladd.f32(float %34, float 0x3FEFB9EAA0000000, float %41)
store float %42, float* %1
%43 = fmul float %38, 0x3FEFB9EAA0000000
%44 = call float @llvm.fmuladd.f32(float %34, float 0x3FC0B51500000000, float %43)
%45 = getelementptr inbounds float, float* %1, i64 5
store float %44, float* %45
%46 = getelementptr inbounds float, float* %2, i64 1
%47 = load float, float* %46
%48 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 1
%49 = load float, float* %48
%50 = fmul float %33, 0xBFED906BC0000000
%51 = call float @llvm.fmuladd.f32(float %49, float 0x3FD87DE2A0000000, float %50)
%52 = fmul float %33, 0x3FD87DE2A0000000
%53 = call float @llvm.fmuladd.f32(float %49, float 0x3FED906BC0000000, float %52)
store float %53, float* %46
%54 = fmul float %51, 0xBFD87DE2A0000000
%55 = call float @llvm.fmuladd.f32(float %47, float 0x3FED906BC0000000, float %54)
%56 = getelementptr inbounds float, float* %1, i64 1
store float %55, float* %56
%57 = fmul float %51, 0x3FED906BC0000000
%58 = call float @llvm.fmuladd.f32(float %47, float 0x3FD87DE2A0000000, float %57)
%59 = getelementptr inbounds float, float* %1, i64 4
store float %58, float* %59
%60 = getelementptr inbounds float, float* %2, i64 2
%61 = load float, float* %60
%62 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 2
%63 = load float, float* %62
%64 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 2
%65 = load float, float* %64
%66 = fmul float %65, 0x3FEFB9EAA0000000
%67 = call float @llvm.fmuladd.f32(float %63, float 0x3FC0B51500000000, float %66)
%68 = fmul float %65, 0xBFC0B51500000000
%69 = call float @llvm.fmuladd.f32(float %63, float 0x3FEFB9EAA0000000, float %68)
store float %69, float* %60
%70 = fmul float %67, 0xBFE37AF940000000
%71 = call float @llvm.fmuladd.f32(float %61, float 0x3FE9632680000000, float %70)
%72 = getelementptr inbounds float, float* %1, i64 2
store float %71, float* %72
%73 = fmul float %67, 0x3FE9632680000000
%74 = call float @llvm.fmuladd.f32(float %61, float 0x3FE37AF940000000, float %73)
%75 = getelementptr inbounds float, float* %1, i64 3
store float %74, float* %75
ret void
}