#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*/ stack_var_adrs_min_update();
void fft_real_n4(double din_re[], int d, double out_re[], double out_im[]) {
  const double x0 = din_re[0 * d];
  const double x1 = din_re[1 * d];
  const double x2 = din_re[2 * d];
  const double x3 = din_re[3 * d];
  const double x0_p_x2 = x0 + x2;
  const double x1_p_x3 = x1 + x3;
  out_re[0] = x0_p_x2 + x1_p_x3;
  out_im[0] = 0.0;
  out_re[1] = x0 - x2;
  out_im[1] = x3 - x1;
  out_re[2] = x0_p_x2 - x1_p_x3;
  out_im[2] = 0.0;
  stack_var_adrs_min_update();
}


x86 assembly (clang, -O0):
<fft_real_n4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x0,-0xc(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3,-0xc(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x40(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x48(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
mov    $0x0,%al
call   1030 <stack_var_adrs_min_update@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fft_real_n4>:
movsd  (%rdi),%xmm0
movslq %esi,%rax
movsd  (%rdi,%rax,8),%xmm1
lea    (%rax,%rax,1),%esi
movslq %esi,%rsi
movsd  (%rdi,%rsi,8),%xmm2
lea    (%rax,%rax,2),%eax
cltq
movsd  (%rdi,%rax,8),%xmm3
movapd %xmm0,%xmm4
addsd  %xmm2,%xmm4
movapd %xmm1,%xmm5
addsd  %xmm3,%xmm5
movapd %xmm4,%xmm6
addsd  %xmm5,%xmm6
movsd  %xmm6,(%rdx)
movq   $0x0,(%rcx)
subsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rdx)
subsd  %xmm1,%xmm3
movsd  %xmm3,0x8(%rcx)
subsd  %xmm5,%xmm4
movsd  %xmm4,0x10(%rdx)
movq   $0x0,0x10(%rcx)
xor    %eax,%eax
jmp    1030 <stack_var_adrs_min_update@plt>

LLVM IR (-O0):
define void @fft_real_n4(double* %0, i32 %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double* %0, double** %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
%15 = load double*, double** %5
%16 = load i32, i32* %6
%17 = mul nsw i32 0, %16
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %15, i64 %18
%20 = load double, double* %19
store double %20, double* %9
%21 = load double*, double** %5
%22 = load i32, i32* %6
%23 = mul nsw i32 1, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %21, i64 %24
%26 = load double, double* %25
store double %26, double* %10
%27 = load double*, double** %5
%28 = load i32, i32* %6
%29 = mul nsw i32 2, %28
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %27, i64 %30
%32 = load double, double* %31
store double %32, double* %11
%33 = load double*, double** %5
%34 = load i32, i32* %6
%35 = mul nsw i32 3, %34
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %33, i64 %36
%38 = load double, double* %37
store double %38, double* %12
%39 = load double, double* %9
%40 = load double, double* %11
%41 = fadd double %39, %40
store double %41, double* %13
%42 = load double, double* %10
%43 = load double, double* %12
%44 = fadd double %42, %43
store double %44, double* %14
%45 = load double, double* %13
%46 = load double, double* %14
%47 = fadd double %45, %46
%48 = load double*, double** %7
%49 = getelementptr inbounds double, double* %48, i64 0
store double %47, double* %49
%50 = load double*, double** %8
%51 = getelementptr inbounds double, double* %50, i64 0
store double 0.000000e+00, double* %51
%52 = load double, double* %9
%53 = load double, double* %11
%54 = fsub double %52, %53
%55 = load double*, double** %7
%56 = getelementptr inbounds double, double* %55, i64 1
store double %54, double* %56
%57 = load double, double* %12
%58 = load double, double* %10
%59 = fsub double %57, %58
%60 = load double*, double** %8
%61 = getelementptr inbounds double, double* %60, i64 1
store double %59, double* %61
%62 = load double, double* %13
%63 = load double, double* %14
%64 = fsub double %62, %63
%65 = load double*, double** %7
%66 = getelementptr inbounds double, double* %65, i64 2
store double %64, double* %66
%67 = load double*, double** %8
%68 = getelementptr inbounds double, double* %67, i64 2
store double 0.000000e+00, double* %68
%69 = call i32 (...) @stack_var_adrs_min_update()
ret void
}

LLVM IR (-O2):
define void @fft_real_n4(double* nocapture %0, i32 %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = load double, double* %0
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double, double* %0, i64 %6
%8 = load double, double* %7
%9 = shl nsw i32 %1, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %0, i64 %10
%12 = load double, double* %11
%13 = mul nsw i32 %1, 3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %0, i64 %14
%16 = load double, double* %15
%17 = fadd double %5, %12
%18 = fadd double %8, %16
%19 = fadd double %17, %18
store double %19, double* %2
store double 0.000000e+00, double* %3
%20 = fsub double %5, %12
%21 = getelementptr inbounds double, double* %2, i64 1
store double %20, double* %21
%22 = fsub double %16, %8
%23 = getelementptr inbounds double, double* %3, i64 1
store double %22, double* %23
%24 = fsub double %17, %18
%25 = getelementptr inbounds double, double* %2, i64 2
store double %24, double* %25
%26 = getelementptr inbounds double, double* %3, i64 2
store double 0.000000e+00, double* %26
%27 = tail call i32 (...) @stack_var_adrs_min_update()
ret void
}