#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 EXIT_FAILURE;
int EXIT_SUCCESS;
double cos(long);
int /*<<< orphan*/ free(double *);
double *malloc(int);
double sin(long);
int DFT(int dir, int m, double *x1, double *y1) {
  long i, k;
  double arg;
  double cosarg, sinarg;
  double *x2 = NULL, *y2 = NULL;
  x2 = malloc(m * sizeof(double));
  y2 = malloc(m * sizeof(double));
  if (x2 == NULL || y2 == NULL)
    return (EXIT_FAILURE);
  for (i = 0; i < m; i++) {
    x2[i] = 0;
    y2[i] = 0;
    arg = -dir * 2.0 * 3.141592654 * (double)i / (double)m;
    for (k = 0; k < m; k++) {
      cosarg = cos(k * arg);
      sinarg = sin(k * arg);
      x2[i] += (x1[k] * cosarg - y1[k] * sinarg);
      y2[i] += (x1[k] * sinarg + y1[k] * cosarg);
    }
  }
  if (dir == 1) {
    for (i = 0; i < m; i++) {
      x1[i] = x2[i] / (double)m;
      y1[i] = y2[i] / (double)m;
    }
  } else {
    for (i = 0; i < m; i++) {
      x1[i] = x2[i];
      y1[i] = y2[i];
    }
  }
  free(x2);
  free(y2);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<DFT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x50(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     11a2 <DFT+0x62>
cmpq   $0x0,-0x58(%rbp)
jne    11b3 <DFT+0x73>
mov    0x2e37(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    142c <DFT+0x2ec>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmp    %rcx,%rax
jge    132c <DFT+0x1ec>
mov    -0x50(%rbp),%rax
mov    -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x58(%rbp),%rax
mov    -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe0b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdf7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdq -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmp    %rcx,%rax
jge    1316 <DFT+0x1d6>
cvtsi2sdq -0x30(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
cvttsd2si %xmm0,%rdi
call   1060 <cos@plt>
movsd  %xmm0,-0x40(%rbp)
cvtsi2sdq -0x30(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <sin@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
mov    -0x28(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x48(%rbp),%xmm2
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
mov    -0x28(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    122d <DFT+0xed>
jmp    131b <DFT+0x1db>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11bb <DFT+0x7b>
cmpl   $0x1,-0x8(%rbp)
jne    13ab <DFT+0x26b>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmp    %rcx,%rax
jge    13a6 <DFT+0x266>
mov    -0x50(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x58(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    133e <DFT+0x1fe>
jmp    140e <DFT+0x2ce>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmp    %rcx,%rax
jge    1409 <DFT+0x2c9>
mov    -0x50(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x58(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    13b3 <DFT+0x273>
jmp    140e <DFT+0x2ce>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    0x2bb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DFT>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %edi,0xc(%rsp)
lea    0x0(,%r15,8),%r14d
mov    %r14d,%edi
call   1050 <malloc@plt>
mov    %rax,%r13
mov    %r14d,%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
mov    0x2e60(%rip),%rax
test   %r13,%r13
je     15a0 <DFT+0x460>
test   %rbp,%rbp
je     15a0 <DFT+0x460>
test   %r15d,%r15d
jle    1589 <DFT+0x449>
mov    0xc(%rsp),%eax
neg    %eax
cvtsi2sd %eax,%xmm0
movslq %r15d,%r14
addsd  %xmm0,%xmm0
mulsd  0xe4c(%rip),%xmm0
movsd  %xmm0,0x38(%rsp)
mov    %r15,0x18(%rsp)
cvtsi2sd %r15d,%xmm2
xor    %eax,%eax
mov    %rax,0x10(%rsp)
mov    %rbp,0x40(%rsp)
movapd %xmm2,0x50(%rsp)
cs nopw 0x0(%rax,%rax,1)
mov    0x10(%rsp),%rax
movq   $0x0,0x0(%r13,%rax,8)
movq   $0x0,0x0(%rbp,%rax,8)
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0x38(%rsp),%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,0x48(%rsp)
xorpd  %xmm0,%xmm0
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
movapd %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r15,%xmm0
mulsd  0x48(%rsp),%xmm0
cvttsd2si %xmm0,%rbp
mov    %rbp,%rdi
call   1060 <cos@plt>
movapd %xmm0,0x60(%rsp)
mov    %rbp,%rdi
mov    0x40(%rsp),%rbp
call   1040 <sin@plt>
movapd 0xdb4(%rip),%xmm3
movsd  (%r12,%r15,8),%xmm1
movapd %xmm1,%xmm2
xorpd  %xmm3,%xmm2
movapd 0x60(%rsp),%xmm4
movapd %xmm4,%xmm3
unpcklpd %xmm0,%xmm3
unpcklpd %xmm2,%xmm1
mulpd  %xmm3,%xmm1
movsd  (%rbx,%r15,8),%xmm2
unpcklpd %xmm2,%xmm2
unpcklpd %xmm4,%xmm0
mulpd  %xmm2,%xmm0
addpd  %xmm1,%xmm0
movapd 0x20(%rsp),%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,0x20(%rsp)
movapd 0x20(%rsp),%xmm0
mov    0x10(%rsp),%rax
movhpd %xmm0,0x0(%r13,%rax,8)
movlpd %xmm0,0x0(%rbp,%rax,8)
add    $0x1,%r15
cmp    %r15,%r14
jne    1220 <DFT+0xe0>
mov    0x10(%rsp),%rcx
add    $0x1,%rcx
mov    %rcx,%rax
mov    %rcx,0x10(%rsp)
cmp    %r14,%rcx
movapd 0x50(%rsp),%xmm2
jne    11e0 <DFT+0xa0>
cmpl   $0x1,0xc(%rsp)
jne    130f <DFT+0x1cf>
mov    0x18(%rsp),%rax
test   %eax,%eax
jle    1589 <DFT+0x449>
cmp    $0x1,%eax
jne    13b0 <DFT+0x270>
xor    %eax,%eax
jmp    1560 <DFT+0x420>
mov    0x18(%rsp),%rax
test   %eax,%eax
jle    1589 <DFT+0x449>
cmp    $0x4,%eax
jb     133b <DFT+0x1fb>
lea    (%r12,%r14,8),%rax
cmp    %rbx,%rax
jbe    13d1 <DFT+0x291>
lea    (%rbx,%r14,8),%rax
cmp    %r12,%rax
jbe    13d1 <DFT+0x291>
xor    %eax,%eax
mov    %rax,%rcx
not    %rcx
test   $0x1,%r14b
je     1365 <DFT+0x225>
movsd  0x0(%r13,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
movsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%r12,%rax,8)
or     $0x1,%rax
add    %r14,%rcx
je     1589 <DFT+0x449>
xchg   %ax,%ax
movsd  0x0(%r13,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
movsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%r12,%rax,8)
movsd  0x8(%r13,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
movsd  0x8(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x8(%r12,%rax,8)
add    $0x2,%rax
cmp    %rax,%r14
jne    1370 <DFT+0x230>
jmp    1589 <DFT+0x449>
lea    (%r12,%r14,8),%rax
cmp    %rbx,%rax
jbe    1469 <DFT+0x329>
lea    (%rbx,%r14,8),%rax
cmp    %r12,%rax
jbe    1469 <DFT+0x329>
xor    %eax,%eax
jmp    1560 <DFT+0x420>
mov    %r14,%rax
and    $0xfffffffffffffffc,%rax
lea    -0x4(%rax),%rcx
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     14ee <DFT+0x3ae>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
nopl   0x0(%rax)
movups 0x0(%r13,%rcx,8),%xmm0
movups 0x10(%r13,%rcx,8),%xmm1
movups %xmm0,(%rbx,%rcx,8)
movups %xmm1,0x10(%rbx,%rcx,8)
movups 0x0(%rbp,%rcx,8),%xmm0
movups 0x10(%rbp,%rcx,8),%xmm1
movups %xmm0,(%r12,%rcx,8)
movups %xmm1,0x10(%r12,%rcx,8)
movups 0x20(%r13,%rcx,8),%xmm0
movups 0x30(%r13,%rcx,8),%xmm1
movups %xmm0,0x20(%rbx,%rcx,8)
movups %xmm1,0x30(%rbx,%rcx,8)
movupd 0x20(%rbp,%rcx,8),%xmm0
movupd 0x30(%rbp,%rcx,8),%xmm1
movupd %xmm0,0x20(%r12,%rcx,8)
movupd %xmm1,0x30(%r12,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rsi
jne    1400 <DFT+0x2c0>
jmp    14f0 <DFT+0x3b0>
mov    %r14,%rax
and    $0xfffffffffffffffe,%rax
movapd %xmm2,%xmm0
unpcklpd %xmm2,%xmm0
lea    -0x2(%rax),%rcx
mov    %rcx,%rdx
shr    %rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     152d <DFT+0x3ed>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movupd 0x0(%r13,%rcx,8),%xmm1
divpd  %xmm0,%xmm1
movupd %xmm1,(%rbx,%rcx,8)
movupd 0x0(%rbp,%rcx,8),%xmm1
divpd  %xmm0,%xmm1
movupd %xmm1,(%r12,%rcx,8)
movupd 0x10(%r13,%rcx,8),%xmm1
divpd  %xmm0,%xmm1
movupd %xmm1,0x10(%rbx,%rcx,8)
movupd 0x10(%rbp,%rcx,8),%xmm1
divpd  %xmm0,%xmm1
movupd %xmm1,0x10(%r12,%rcx,8)
add    $0x4,%rcx
add    $0xfffffffffffffffe,%rsi
jne    14a0 <DFT+0x360>
jmp    152f <DFT+0x3ef>
xor    %ecx,%ecx
test   $0x1,%dl
je     1523 <DFT+0x3e3>
movups 0x0(%r13,%rcx,8),%xmm0
movups 0x10(%r13,%rcx,8),%xmm1
movups %xmm0,(%rbx,%rcx,8)
movups %xmm1,0x10(%rbx,%rcx,8)
movupd 0x0(%rbp,%rcx,8),%xmm0
movupd 0x10(%rbp,%rcx,8),%xmm1
movupd %xmm0,(%r12,%rcx,8)
movupd %xmm1,0x10(%r12,%rcx,8)
cmp    %r14,%rax
je     1589 <DFT+0x449>
jmp    133d <DFT+0x1fd>
xor    %ecx,%ecx
test   $0x1,%dl
je     1554 <DFT+0x414>
movupd 0x0(%r13,%rcx,8),%xmm1
divpd  %xmm0,%xmm1
movupd %xmm1,(%rbx,%rcx,8)
movupd 0x0(%rbp,%rcx,8),%xmm1
divpd  %xmm0,%xmm1
movupd %xmm1,(%r12,%rcx,8)
cmp    %r14,%rax
je     1589 <DFT+0x449>
nopl   0x0(%rax)
movsd  0x0(%r13,%rax,8),%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,(%rbx,%rax,8)
movsd  0x0(%rbp,%rax,8),%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,(%r12,%rax,8)
add    $0x1,%rax
cmp    %rax,%r14
jne    1560 <DFT+0x420>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x2a38(%rip),%rax
mov    (%rax),%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @DFT(i32 %0, i32 %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca i64
%11 = alloca i64
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double*
%16 = alloca double*
store i32 %0, i32* %6
store i32 %1, i32* %7
store double* %2, double** %8
store double* %3, double** %9
store double* null, double** %15
store double* null, double** %16
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = mul i64 %18, 8
%20 = trunc i64 %19 to i32
%21 = call double* @malloc(i32 %20)
store double* %21, double** %15
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = mul i64 %23, 8
%25 = trunc i64 %24 to i32
%26 = call double* @malloc(i32 %25)
store double* %26, double** %16
%27 = load double*, double** %15
%28 = icmp eq double* %27, null
br i1 %28, label %32, label %29
29: ; preds = %4
%30 = load double*, double** %16
%31 = icmp eq double* %30, null
br i1 %31, label %32, label %34
32: ; preds = %29, %4
%33 = load i32, i32* @EXIT_FAILURE
store i32 %33, i32* %5
br label %183
34: ; preds = %29
store i64 0, i64* %10
br label %35
35: ; preds = %115, %34
%36 = load i64, i64* %10
%37 = load i32, i32* %7
%38 = sext i32 %37 to i64
%39 = icmp slt i64 %36, %38
br i1 %39, label %40, label %118
40: ; preds = %35
%41 = load double*, double** %15
%42 = load i64, i64* %10
%43 = getelementptr inbounds double, double* %41, i64 %42
store double 0.000000e+00, double* %43
%44 = load double*, double** %16
%45 = load i64, i64* %10
%46 = getelementptr inbounds double, double* %44, i64 %45
store double 0.000000e+00, double* %46
%47 = load i32, i32* %6
%48 = sub nsw i32 0, %47
%49 = sitofp i32 %48 to double
%50 = fmul double %49, 2.000000e+00
%51 = fmul double %50, 0x400921FB54524550
%52 = load i64, i64* %10
%53 = sitofp i64 %52 to double
%54 = fmul double %51, %53
%55 = load i32, i32* %7
%56 = sitofp i32 %55 to double
%57 = fdiv double %54, %56
store double %57, double* %12
store i64 0, i64* %11
br label %58
58: ; preds = %111, %40
%59 = load i64, i64* %11
%60 = load i32, i32* %7
%61 = sext i32 %60 to i64
%62 = icmp slt i64 %59, %61
br i1 %62, label %63, label %114
63: ; preds = %58
%64 = load i64, i64* %11
%65 = sitofp i64 %64 to double
%66 = load double, double* %12
%67 = fmul double %65, %66
%68 = fptosi double %67 to i64
%69 = call double @cos(i64 %68)
store double %69, double* %13
%70 = load i64, i64* %11
%71 = sitofp i64 %70 to double
%72 = load double, double* %12
%73 = fmul double %71, %72
%74 = fptosi double %73 to i64
%75 = call double @sin(i64 %74)
store double %75, double* %14
%76 = load double*, double** %8
%77 = load i64, i64* %11
%78 = getelementptr inbounds double, double* %76, i64 %77
%79 = load double, double* %78
%80 = load double, double* %13
%81 = load double*, double** %9
%82 = load i64, i64* %11
%83 = getelementptr inbounds double, double* %81, i64 %82
%84 = load double, double* %83
%85 = load double, double* %14
%86 = fmul double %84, %85
%87 = fneg double %86
%88 = call double @llvm.fmuladd.f64(double %79, double %80, double %87)
%89 = load double*, double** %15
%90 = load i64, i64* %10
%91 = getelementptr inbounds double, double* %89, i64 %90
%92 = load double, double* %91
%93 = fadd double %92, %88
store double %93, double* %91
%94 = load double*, double** %8
%95 = load i64, i64* %11
%96 = getelementptr inbounds double, double* %94, i64 %95
%97 = load double, double* %96
%98 = load double, double* %14
%99 = load double*, double** %9
%100 = load i64, i64* %11
%101 = getelementptr inbounds double, double* %99, i64 %100
%102 = load double, double* %101
%103 = load double, double* %13
%104 = fmul double %102, %103
%105 = call double @llvm.fmuladd.f64(double %97, double %98, double %104)
%106 = load double*, double** %16
%107 = load i64, i64* %10
%108 = getelementptr inbounds double, double* %106, i64 %107
%109 = load double, double* %108
%110 = fadd double %109, %105
store double %110, double* %108
br label %111
111: ; preds = %63
%112 = load i64, i64* %11
%113 = add nsw i64 %112, 1
store i64 %113, i64* %11
br label %58
114: ; preds = %58
br label %115
115: ; preds = %114
%116 = load i64, i64* %10
%117 = add nsw i64 %116, 1
store i64 %117, i64* %10
br label %35
118: ; preds = %35
%119 = load i32, i32* %6
%120 = icmp eq i32 %119, 1
br i1 %120, label %121, label %152
121: ; preds = %118
store i64 0, i64* %10
br label %122
122: ; preds = %148, %121
%123 = load i64, i64* %10
%124 = load i32, i32* %7
%125 = sext i32 %124 to i64
%126 = icmp slt i64 %123, %125
br i1 %126, label %127, label %151
127: ; preds = %122
%128 = load double*, double** %15
%129 = load i64, i64* %10
%130 = getelementptr inbounds double, double* %128, i64 %129
%131 = load double, double* %130
%132 = load i32, i32* %7
%133 = sitofp i32 %132 to double
%134 = fdiv double %131, %133
%135 = load double*, double** %8
%136 = load i64, i64* %10
%137 = getelementptr inbounds double, double* %135, i64 %136
store double %134, double* %137
%138 = load double*, double** %16
%139 = load i64, i64* %10
%140 = getelementptr inbounds double, double* %138, i64 %139
%141 = load double, double* %140
%142 = load i32, i32* %7
%143 = sitofp i32 %142 to double
%144 = fdiv double %141, %143
%145 = load double*, double** %9
%146 = load i64, i64* %10
%147 = getelementptr inbounds double, double* %145, i64 %146
store double %144, double* %147
br label %148
148: ; preds = %127
%149 = load i64, i64* %10
%150 = add nsw i64 %149, 1
store i64 %150, i64* %10
br label %122
151: ; preds = %122
br label %177
152: ; preds = %118
store i64 0, i64* %10
br label %153
153: ; preds = %173, %152
%154 = load i64, i64* %10
%155 = load i32, i32* %7
%156 = sext i32 %155 to i64
%157 = icmp slt i64 %154, %156
br i1 %157, label %158, label %176
158: ; preds = %153
%159 = load double*, double** %15
%160 = load i64, i64* %10
%161 = getelementptr inbounds double, double* %159, i64 %160
%162 = load double, double* %161
%163 = load double*, double** %8
%164 = load i64, i64* %10
%165 = getelementptr inbounds double, double* %163, i64 %164
store double %162, double* %165
%166 = load double*, double** %16
%167 = load i64, i64* %10
%168 = getelementptr inbounds double, double* %166, i64 %167
%169 = load double, double* %168
%170 = load double*, double** %9
%171 = load i64, i64* %10
%172 = getelementptr inbounds double, double* %170, i64 %171
store double %169, double* %172
br label %173
173: ; preds = %158
%174 = load i64, i64* %10
%175 = add nsw i64 %174, 1
store i64 %175, i64* %10
br label %153
176: ; preds = %153
br label %177
177: ; preds = %176, %151
%178 = load double*, double** %15
%179 = call i32 @free(double* %178)
%180 = load double*, double** %16
%181 = call i32 @free(double* %180)
%182 = load i32, i32* @EXIT_SUCCESS
store i32 %182, i32* %5
br label %183
183: ; preds = %177, %32
%184 = load i32, i32* %5
ret i32 %184
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @DFT(i32 %0, i32 %1, double* nocapture %2, double* nocapture %3) {
%5 = sext i32 %1 to i64
%6 = shl i32 %1, 3
%7 = tail call double* @malloc(i32 %6)
%8 = tail call double* @malloc(i32 %6)
%9 = icmp eq double* %7, null
%10 = icmp eq double* %8, null
%11 = or i1 %9, %10
br i1 %11, label %272, label %12
12: ; preds = %4
%13 = icmp sgt i32 %1, 0
br i1 %13, label %14, label %269
14: ; preds = %12
%15 = sub nsw i32 0, %0
%16 = sitofp i32 %15 to double
%17 = fmul double %16, 2.000000e+00
%18 = fmul double %17, 0x400921FB54524550
%19 = sitofp i32 %1 to double
br label %20
20: ; preds = %55, %14
%21 = phi i64 [ 0, %14 ], [ %56, %55 ]
%22 = getelementptr inbounds double, double* %7, i64 %21
store double 0.000000e+00, double* %22
%23 = getelementptr inbounds double, double* %8, i64 %21
store double 0.000000e+00, double* %23
%24 = sitofp i64 %21 to double
%25 = fmul double %18, %24
%26 = fdiv double %25, %19
br label %27
27: ; preds = %20, %27
%28 = phi i64 [ %53, %27 ], [ 0, %20 ]
%29 = phi <2 x double> [ %50, %27 ], [ zeroinitializer, %20 ]
%30 = sitofp i64 %28 to double
%31 = fmul double %26, %30
%32 = fptosi double %31 to i64
%33 = tail call double @cos(i64 %32)
%34 = tail call double @sin(i64 %32)
%35 = getelementptr inbounds double, double* %2, i64 %28
%36 = load double, double* %35
%37 = getelementptr inbounds double, double* %3, i64 %28
%38 = load double, double* %37
%39 = fneg double %38
%40 = insertelement <2 x double> poison, double %33, i64 0
%41 = insertelement <2 x double> %40, double %34, i64 1
%42 = insertelement <2 x double> poison, double %38, i64 0
%43 = insertelement <2 x double> %42, double %39, i64 1
%44 = fmul <2 x double> %41, %43
%45 = insertelement <2 x double> poison, double %36, i64 0
%46 = shufflevector <2 x double> %45, <2 x double> poison, <2 x i32> zeroinitializer
%47 = insertelement <2 x double> poison, double %34, i64 0
%48 = insertelement <2 x double> %47, double %33, i64 1
%49 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %46, <2 x double> %48, <2 x double> %44)
%50 = fadd <2 x double> %49, %29
%51 = extractelement <2 x double> %50, i64 1
store double %51, double* %22
%52 = extractelement <2 x double> %50, i64 0
store double %52, double* %23
%53 = add nuw nsw i64 %28, 1
%54 = icmp eq i64 %53, %5
br i1 %54, label %55, label %27
55: ; preds = %27
%56 = add nuw nsw i64 %21, 1
%57 = icmp eq i64 %56, %5
br i1 %57, label %58, label %20
58: ; preds = %55
%59 = icmp eq i32 %0, 1
br i1 %59, label %168, label %60
60: ; preds = %58
br i1 %13, label %61, label %269
61: ; preds = %60
%62 = icmp ult i32 %1, 4
br i1 %62, label %151, label %63
63: ; preds = %61
%64 = getelementptr double, double* %2, i64 %5
%65 = getelementptr double, double* %3, i64 %5
%66 = icmp ugt double* %65, %2
%67 = icmp ugt double* %64, %3
%68 = and i1 %66, %67
br i1 %68, label %151, label %69
69: ; preds = %63
%70 = and i64 %5, -4
%71 = add nsw i64 %70, -4
%72 = lshr exact i64 %71, 2
%73 = add nuw nsw i64 %72, 1
%74 = and i64 %73, 1
%75 = icmp eq i64 %71, 0
br i1 %75, label %125, label %76
76: ; preds = %69
%77 = and i64 %73, 9223372036854775806
br label %78
78: ; preds = %78, %76
%79 = phi i64 [ 0, %76 ], [ %122, %78 ]
%80 = phi i64 [ 0, %76 ], [ %123, %78 ]
%81 = getelementptr inbounds double, double* %7, i64 %79
%82 = bitcast double* %81 to <2 x double>*
%83 = load <2 x double>, <2 x double>* %82
%84 = getelementptr inbounds double, double* %81, i64 2
%85 = bitcast double* %84 to <2 x double>*
%86 = load <2 x double>, <2 x double>* %85
%87 = getelementptr inbounds double, double* %2, i64 %79
%88 = bitcast double* %87 to <2 x double>*
store <2 x double> %83, <2 x double>* %88
%89 = getelementptr inbounds double, double* %87, i64 2
%90 = bitcast double* %89 to <2 x double>*
store <2 x double> %86, <2 x double>* %90
%91 = getelementptr inbounds double, double* %8, i64 %79
%92 = bitcast double* %91 to <2 x double>*
%93 = load <2 x double>, <2 x double>* %92
%94 = getelementptr inbounds double, double* %91, i64 2
%95 = bitcast double* %94 to <2 x double>*
%96 = load <2 x double>, <2 x double>* %95
%97 = getelementptr inbounds double, double* %3, i64 %79
%98 = bitcast double* %97 to <2 x double>*
store <2 x double> %93, <2 x double>* %98
%99 = getelementptr inbounds double, double* %97, i64 2
%100 = bitcast double* %99 to <2 x double>*
store <2 x double> %96, <2 x double>* %100
%101 = or i64 %79, 4
%102 = getelementptr inbounds double, double* %7, i64 %101
%103 = bitcast double* %102 to <2 x double>*
%104 = load <2 x double>, <2 x double>* %103
%105 = getelementptr inbounds double, double* %102, i64 2
%106 = bitcast double* %105 to <2 x double>*
%107 = load <2 x double>, <2 x double>* %106
%108 = getelementptr inbounds double, double* %2, i64 %101
%109 = bitcast double* %108 to <2 x double>*
store <2 x double> %104, <2 x double>* %109
%110 = getelementptr inbounds double, double* %108, i64 2
%111 = bitcast double* %110 to <2 x double>*
store <2 x double> %107, <2 x double>* %111
%112 = getelementptr inbounds double, double* %8, i64 %101
%113 = bitcast double* %112 to <2 x double>*
%114 = load <2 x double>, <2 x double>* %113
%115 = getelementptr inbounds double, double* %112, i64 2
%116 = bitcast double* %115 to <2 x double>*
%117 = load <2 x double>, <2 x double>* %116
%118 = getelementptr inbounds double, double* %3, i64 %101
%119 = bitcast double* %118 to <2 x double>*
store <2 x double> %114, <2 x double>* %119
%120 = getelementptr inbounds double, double* %118, i64 2
%121 = bitcast double* %120 to <2 x double>*
store <2 x double> %117, <2 x double>* %121
%122 = add nuw i64 %79, 8
%123 = add i64 %80, 2
%124 = icmp eq i64 %123, %77
br i1 %124, label %125, label %78
125: ; preds = %78, %69
%126 = phi i64 [ 0, %69 ], [ %122, %78 ]
%127 = icmp eq i64 %74, 0
br i1 %127, label %149, label %128
128: ; preds = %125
%129 = getelementptr inbounds double, double* %7, i64 %126
%130 = bitcast double* %129 to <2 x double>*
%131 = load <2 x double>, <2 x double>* %130
%132 = getelementptr inbounds double, double* %129, i64 2
%133 = bitcast double* %132 to <2 x double>*
%134 = load <2 x double>, <2 x double>* %133
%135 = getelementptr inbounds double, double* %2, i64 %126
%136 = bitcast double* %135 to <2 x double>*
store <2 x double> %131, <2 x double>* %136
%137 = getelementptr inbounds double, double* %135, i64 2
%138 = bitcast double* %137 to <2 x double>*
store <2 x double> %134, <2 x double>* %138
%139 = getelementptr inbounds double, double* %8, i64 %126
%140 = bitcast double* %139 to <2 x double>*
%141 = load <2 x double>, <2 x double>* %140
%142 = getelementptr inbounds double, double* %139, i64 2
%143 = bitcast double* %142 to <2 x double>*
%144 = load <2 x double>, <2 x double>* %143
%145 = getelementptr inbounds double, double* %3, i64 %126
%146 = bitcast double* %145 to <2 x double>*
store <2 x double> %141, <2 x double>* %146
%147 = getelementptr inbounds double, double* %145, i64 2
%148 = bitcast double* %147 to <2 x double>*
store <2 x double> %144, <2 x double>* %148
br label %149
149: ; preds = %125, %128
%150 = icmp eq i64 %70, %5
br i1 %150, label %269, label %151
151: ; preds = %63, %61, %149
%152 = phi i64 [ 0, %63 ], [ 0, %61 ], [ %70, %149 ]
%153 = xor i64 %152, -1
%154 = and i64 %5, 1
%155 = icmp eq i64 %154, 0
br i1 %155, label %164, label %156
156: ; preds = %151
%157 = getelementptr inbounds double, double* %7, i64 %152
%158 = load double, double* %157
%159 = getelementptr inbounds double, double* %2, i64 %152
store double %158, double* %159
%160 = getelementptr inbounds double, double* %8, i64 %152
%161 = load double, double* %160
%162 = getelementptr inbounds double, double* %3, i64 %152
store double %161, double* %162
%163 = or i64 %152, 1
br label %164
164: ; preds = %156, %151
%165 = phi i64 [ %152, %151 ], [ %163, %156 ]
%166 = sub nsw i64 0, %5
%167 = icmp eq i64 %153, %166
br i1 %167, label %269, label %252
168: ; preds = %58
br i1 %13, label %169, label %269
169: ; preds = %168
%170 = sitofp i32 %1 to double
%171 = icmp eq i32 %1, 1
br i1 %171, label %238, label %172
172: ; preds = %169
%173 = getelementptr double, double* %2, i64 %5
%174 = getelementptr double, double* %3, i64 %5
%175 = icmp ugt double* %174, %2
%176 = icmp ugt double* %173, %3
%177 = and i1 %175, %176
br i1 %177, label %238, label %178
178: ; preds = %172
%179 = and i64 %5, -2
%180 = insertelement <2 x double> poison, double %170, i64 0
%181 = shufflevector <2 x double> %180, <2 x double> poison, <2 x i32> zeroinitializer
%182 = add nsw i64 %179, -2
%183 = lshr exact i64 %182, 1
%184 = add nuw i64 %183, 1
%185 = and i64 %184, 1
%186 = icmp eq i64 %182, 0
br i1 %186, label %220, label %187
187: ; preds = %178
%188 = and i64 %184, -2
br label %189
189: ; preds = %189, %187
%190 = phi i64 [ 0, %187 ], [ %217, %189 ]
%191 = phi i64 [ 0, %187 ], [ %218, %189 ]
%192 = getelementptr inbounds double, double* %7, i64 %190
%193 = bitcast double* %192 to <2 x double>*
%194 = load <2 x double>, <2 x double>* %193
%195 = fdiv <2 x double> %194, %181
%196 = getelementptr inbounds double, double* %2, i64 %190
%197 = bitcast double* %196 to <2 x double>*
store <2 x double> %195, <2 x double>* %197
%198 = getelementptr inbounds double, double* %8, i64 %190
%199 = bitcast double* %198 to <2 x double>*
%200 = load <2 x double>, <2 x double>* %199
%201 = fdiv <2 x double> %200, %181
%202 = getelementptr inbounds double, double* %3, i64 %190
%203 = bitcast double* %202 to <2 x double>*
store <2 x double> %201, <2 x double>* %203
%204 = or i64 %190, 2
%205 = getelementptr inbounds double, double* %7, i64 %204
%206 = bitcast double* %205 to <2 x double>*
%207 = load <2 x double>, <2 x double>* %206
%208 = fdiv <2 x double> %207, %181
%209 = getelementptr inbounds double, double* %2, i64 %204
%210 = bitcast double* %209 to <2 x double>*
store <2 x double> %208, <2 x double>* %210
%211 = getelementptr inbounds double, double* %8, i64 %204
%212 = bitcast double* %211 to <2 x double>*
%213 = load <2 x double>, <2 x double>* %212
%214 = fdiv <2 x double> %213, %181
%215 = getelementptr inbounds double, double* %3, i64 %204
%216 = bitcast double* %215 to <2 x double>*
store <2 x double> %214, <2 x double>* %216
%217 = add nuw i64 %190, 4
%218 = add nuw i64 %191, 2
%219 = icmp eq i64 %218, %188
br i1 %219, label %220, label %189
220: ; preds = %189, %178
%221 = phi i64 [ 0, %178 ], [ %217, %189 ]
%222 = icmp eq i64 %185, 0
br i1 %222, label %236, label %223
223: ; preds = %220
%224 = getelementptr inbounds double, double* %7, i64 %221
%225 = bitcast double* %224 to <2 x double>*
%226 = load <2 x double>, <2 x double>* %225
%227 = fdiv <2 x double> %226, %181
%228 = getelementptr inbounds double, double* %2, i64 %221
%229 = bitcast double* %228 to <2 x double>*
store <2 x double> %227, <2 x double>* %229
%230 = getelementptr inbounds double, double* %8, i64 %221
%231 = bitcast double* %230 to <2 x double>*
%232 = load <2 x double>, <2 x double>* %231
%233 = fdiv <2 x double> %232, %181
%234 = getelementptr inbounds double, double* %3, i64 %221
%235 = bitcast double* %234 to <2 x double>*
store <2 x double> %233, <2 x double>* %235
br label %236
236: ; preds = %220, %223
%237 = icmp eq i64 %179, %5
br i1 %237, label %269, label %238
238: ; preds = %172, %169, %236
%239 = phi i64 [ 0, %172 ], [ 0, %169 ], [ %179, %236 ]
br label %240
240: ; preds = %238, %240
%241 = phi i64 [ %250, %240 ], [ %239, %238 ]
%242 = getelementptr inbounds double, double* %7, i64 %241
%243 = load double, double* %242
%244 = fdiv double %243, %170
%245 = getelementptr inbounds double, double* %2, i64 %241
store double %244, double* %245
%246 = getelementptr inbounds double, double* %8, i64 %241
%247 = load double, double* %246
%248 = fdiv double %247, %170
%249 = getelementptr inbounds double, double* %3, i64 %241
store double %248, double* %249
%250 = add nuw nsw i64 %241, 1
%251 = icmp eq i64 %250, %5
br i1 %251, label %269, label %240
252: ; preds = %164, %252
%253 = phi i64 [ %267, %252 ], [ %165, %164 ]
%254 = getelementptr inbounds double, double* %7, i64 %253
%255 = load double, double* %254
%256 = getelementptr inbounds double, double* %2, i64 %253
store double %255, double* %256
%257 = getelementptr inbounds double, double* %8, i64 %253
%258 = load double, double* %257
%259 = getelementptr inbounds double, double* %3, i64 %253
store double %258, double* %259
%260 = add nuw nsw i64 %253, 1
%261 = getelementptr inbounds double, double* %7, i64 %260
%262 = load double, double* %261
%263 = getelementptr inbounds double, double* %2, i64 %260
store double %262, double* %263
%264 = getelementptr inbounds double, double* %8, i64 %260
%265 = load double, double* %264
%266 = getelementptr inbounds double, double* %3, i64 %260
store double %265, double* %266
%267 = add nuw nsw i64 %253, 2
%268 = icmp eq i64 %267, %5
br i1 %268, label %269, label %252
269: ; preds = %164, %252, %240, %149, %236, %12, %60, %168
%270 = tail call i32 @free(double* %7)
%271 = tail call i32 @free(double* %8)
br label %272
272: ; preds = %4, %269
%273 = phi i32* [ @EXIT_SUCCESS, %269 ], [ @EXIT_FAILURE, %4 ]
%274 = load i32, i32* %273
ret i32 %274
}