#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*/ pe(double **, double **, double **, double **, int);
void compute(int flag, double real[][((64 + 4 - 1) / 4)][128],
             double img[][((64 + 4 - 1) / 4)][128],
             double real_twid[][((64 + 4 - 1) / 4)][128 / 2],
             double img_twid[][((64 + 4 - 1) / 4)][128 / 2], int num_strides) {
#pragma HLS inline off
  if (flag) {
    for (int i = 0; i < 4; i++) {
#pragma HLS unroll
      int pe_strides = num_strides - i * ((64 + 4 - 1) / 4);
      if (pe_strides > ((64 + 4 - 1) / 4))
        pe_strides = ((64 + 4 - 1) / 4);
      if (pe_strides > 0)
        pe(real[i], img[i], real_twid[i], img_twid[i], pe_strides);
    }
  }
}


x86 assembly (clang, -O0):
<compute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11d0 <compute+0xc0>
movl   $0x0,-0x30(%rbp)
cmpl   $0x4,-0x30(%rbp)
jge    11cb <compute+0xbb>
mov    -0x2c(%rbp),%eax
mov    -0x30(%rbp),%ecx
shl    $0x4,%ecx
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x10,-0x34(%rbp)
jle    1169 <compute+0x59>
movl   $0x10,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jle    11b8 <compute+0xa8>
mov    -0x10(%rbp),%rdi
movslq -0x30(%rbp),%rax
shl    $0xe,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x30(%rbp),%rax
shl    $0xe,%rax
add    %rax,%rsi
mov    -0x20(%rbp),%rdx
movslq -0x30(%rbp),%rax
shl    $0xd,%rax
add    %rax,%rdx
mov    -0x28(%rbp),%rcx
movslq -0x30(%rbp),%rax
shl    $0xd,%rax
add    %rax,%rcx
mov    -0x34(%rbp),%r8d
call   1030 <pe@plt>
jmp    11bd <compute+0xad>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1140 <compute+0x30>
jmp    11d0 <compute+0xc0>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edi,%edi
je     1209 <compute+0xf9>
mov    %r9d,%ebx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
test   %r9d,%r9d
jle    1153 <compute+0x43>
cmp    $0x10,%ebx
mov    $0x10,%r8d
cmovb  %ebx,%r8d
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <pe@plt>
lea    -0x10(%rbx),%eax
test   %eax,%eax
jle    1189 <compute+0x79>
cmp    $0x10,%eax
mov    $0x10,%r8d
cmovb  %eax,%r8d
lea    0x4000(%r13),%rdi
lea    0x4000(%r12),%rsi
lea    0x2000(%r15),%rdx
lea    0x2000(%r14),%rcx
call   1030 <pe@plt>
lea    -0x20(%rbx),%eax
test   %eax,%eax
jle    11bf <compute+0xaf>
cmp    $0x10,%eax
mov    $0x10,%r8d
cmovb  %eax,%r8d
lea    0x8000(%r13),%rdi
lea    0x8000(%r12),%rsi
lea    0x4000(%r15),%rdx
lea    0x4000(%r14),%rcx
call   1030 <pe@plt>
add    $0xffffffd0,%ebx
test   %ebx,%ebx
jle    1209 <compute+0xf9>
cmp    $0x10,%ebx
mov    $0x10,%r8d
cmovb  %ebx,%r8d
add    $0xc000,%r13
add    $0xc000,%r12
add    $0x6000,%r15
add    $0x6000,%r14
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <pe@plt>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @compute(i32 %0, [16 x [128 x double]]* %1, [16 x [128 x double]]* %2, [16 x [64 x double]]* %3, [16 x [64 x double]]* %4, i32 %5) {
%7 = alloca i32
%8 = alloca [16 x [128 x double]]*
%9 = alloca [16 x [128 x double]]*
%10 = alloca [16 x [64 x double]]*
%11 = alloca [16 x [64 x double]]*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %7
store [16 x [128 x double]]* %1, [16 x [128 x double]]** %8
store [16 x [128 x double]]* %2, [16 x [128 x double]]** %9
store [16 x [64 x double]]* %3, [16 x [64 x double]]** %10
store [16 x [64 x double]]* %4, [16 x [64 x double]]** %11
store i32 %5, i32* %12
%15 = load i32, i32* %7
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %64
17: ; preds = %6
store i32 0, i32* %13
br label %18
18: ; preds = %60, %17
%19 = load i32, i32* %13
%20 = icmp slt i32 %19, 4
br i1 %20, label %21, label %63
21: ; preds = %18
%22 = load i32, i32* %12
%23 = load i32, i32* %13
%24 = mul nsw i32 %23, 16
%25 = sub nsw i32 %22, %24
store i32 %25, i32* %14
%26 = load i32, i32* %14
%27 = icmp sgt i32 %26, 16
br i1 %27, label %28, label %29
28: ; preds = %21
store i32 16, i32* %14
br label %29
29: ; preds = %28, %21
%30 = load i32, i32* %14
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %59
32: ; preds = %29
%33 = load [16 x [128 x double]]*, [16 x [128 x double]]** %8
%34 = load i32, i32* %13
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [16 x [128 x double]], [16 x [128 x double]]* %33, i64 %35
%37 = getelementptr inbounds [16 x [128 x double]], [16 x [128 x double]]* %36, i64 0, i64 0
%38 = bitcast [128 x double]* %37 to double**
%39 = load [16 x [128 x double]]*, [16 x [128 x double]]** %9
%40 = load i32, i32* %13
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [16 x [128 x double]], [16 x [128 x double]]* %39, i64 %41
%43 = getelementptr inbounds [16 x [128 x double]], [16 x [128 x double]]* %42, i64 0, i64 0
%44 = bitcast [128 x double]* %43 to double**
%45 = load [16 x [64 x double]]*, [16 x [64 x double]]** %10
%46 = load i32, i32* %13
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [16 x [64 x double]], [16 x [64 x double]]* %45, i64 %47
%49 = getelementptr inbounds [16 x [64 x double]], [16 x [64 x double]]* %48, i64 0, i64 0
%50 = bitcast [64 x double]* %49 to double**
%51 = load [16 x [64 x double]]*, [16 x [64 x double]]** %11
%52 = load i32, i32* %13
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [16 x [64 x double]], [16 x [64 x double]]* %51, i64 %53
%55 = getelementptr inbounds [16 x [64 x double]], [16 x [64 x double]]* %54, i64 0, i64 0
%56 = bitcast [64 x double]* %55 to double**
%57 = load i32, i32* %14
%58 = call i32 @pe(double** %38, double** %44, double** %50, double** %56, i32 %57)
br label %59
59: ; preds = %32, %29
br label %60
60: ; preds = %59
%61 = load i32, i32* %13
%62 = add nsw i32 %61, 1
store i32 %62, i32* %13
br label %18
63: ; preds = %18
br label %64
64: ; preds = %63, %6
ret void
}

LLVM IR (-O2):
define void @compute(i32 %0, [16 x [128 x double]]* %1, [16 x [128 x double]]* %2, [16 x [64 x double]]* %3, [16 x [64 x double]]* %4, i32 %5) {
%7 = icmp eq i32 %0, 0
br i1 %7, label %63, label %8
8: ; preds = %6
%9 = icmp sgt i32 %5, 0
br i1 %9, label %10, label %18
10: ; preds = %8
%11 = icmp ult i32 %5, 16
%12 = select i1 %11, i32 %5, i32 16
%13 = bitcast [16 x [128 x double]]* %1 to double**
%14 = bitcast [16 x [128 x double]]* %2 to double**
%15 = bitcast [16 x [64 x double]]* %3 to double**
%16 = bitcast [16 x [64 x double]]* %4 to double**
%17 = tail call i32 @pe(double** %13, double** %14, double** %15, double** %16, i32 %12)
br label %18
18: ; preds = %10, %8
%19 = add i32 %5, -16
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %33
21: ; preds = %18
%22 = icmp ult i32 %19, 16
%23 = select i1 %22, i32 %19, i32 16
%24 = getelementptr inbounds [16 x [128 x double]], [16 x [128 x double]]* %1, i64 1, i64 0
%25 = bitcast [128 x double]* %24 to double**
%26 = getelementptr inbounds [16 x [128 x double]], [16 x [128 x double]]* %2, i64 1, i64 0
%27 = bitcast [128 x double]* %26 to double**
%28 = getelementptr inbounds [16 x [64 x double]], [16 x [64 x double]]* %3, i64 1, i64 0
%29 = bitcast [64 x double]* %28 to double**
%30 = getelementptr inbounds [16 x [64 x double]], [16 x [64 x double]]* %4, i64 1, i64 0
%31 = bitcast [64 x double]* %30 to double**
%32 = tail call i32 @pe(double** %25, double** %27, double** %29, double** %31, i32 %23)
br label %33
33: ; preds = %21, %18
%34 = add i32 %5, -32
%35 = icmp sgt i32 %34, 0
br i1 %35, label %36, label %48
36: ; preds = %33
%37 = icmp ult i32 %34, 16
%38 = select i1 %37, i32 %34, i32 16
%39 = getelementptr inbounds [16 x [128 x double]], [16 x [128 x double]]* %1, i64 2, i64 0
%40 = bitcast [128 x double]* %39 to double**
%41 = getelementptr inbounds [16 x [128 x double]], [16 x [128 x double]]* %2, i64 2, i64 0
%42 = bitcast [128 x double]* %41 to double**
%43 = getelementptr inbounds [16 x [64 x double]], [16 x [64 x double]]* %3, i64 2, i64 0
%44 = bitcast [64 x double]* %43 to double**
%45 = getelementptr inbounds [16 x [64 x double]], [16 x [64 x double]]* %4, i64 2, i64 0
%46 = bitcast [64 x double]* %45 to double**
%47 = tail call i32 @pe(double** %40, double** %42, double** %44, double** %46, i32 %38)
br label %48
48: ; preds = %36, %33
%49 = add i32 %5, -48
%50 = icmp sgt i32 %49, 0
br i1 %50, label %51, label %63
51: ; preds = %48
%52 = icmp ult i32 %49, 16
%53 = select i1 %52, i32 %49, i32 16
%54 = getelementptr inbounds [16 x [128 x double]], [16 x [128 x double]]* %1, i64 3, i64 0
%55 = bitcast [128 x double]* %54 to double**
%56 = getelementptr inbounds [16 x [128 x double]], [16 x [128 x double]]* %2, i64 3, i64 0
%57 = bitcast [128 x double]* %56 to double**
%58 = getelementptr inbounds [16 x [64 x double]], [16 x [64 x double]]* %3, i64 3, i64 0
%59 = bitcast [64 x double]* %58 to double**
%60 = getelementptr inbounds [16 x [64 x double]], [16 x [64 x double]]* %4, i64 3, i64 0
%61 = bitcast [64 x double]* %60 to double**
%62 = tail call i32 @pe(double** %55, double** %57, double** %59, double** %61, i32 %53)
br label %63
63: ; preds = %48, %51, %6
ret void
}