#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*/ memcpy(double *, double *, int);
void load(int flag, double *local_real, double *real, double *local_img,
          double *img, double *local_real_twid, double *real_twid,
          double *local_img_twid, double *img_twid, int num_strides) {
#pragma HLS inline off
  if (flag) {
    memcpy(local_real, real, num_strides * 128 * sizeof(double));
    memcpy(local_img, img, num_strides * 128 * sizeof(double));
    memcpy(local_real_twid, real_twid, num_strides * 128 / 2 * sizeof(double));
    memcpy(local_img_twid, img_twid, num_strides * 128 / 2 * sizeof(double));
  }
}


x86 assembly (clang, -O0):
<load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11c4 <load+0xb4>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x28(%rbp),%eax
shl    $0x7,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    0x28(%rbp),%eax
shl    $0x7,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rdi
mov    0x10(%rbp),%rsi
mov    0x28(%rbp),%eax
shl    $0x7,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    0x18(%rbp),%rdi
mov    0x20(%rbp),%rsi
mov    0x28(%rbp),%eax
shl    $0x7,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load>:
test   %edi,%edi
je     119f <load+0x8f>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%rbx
mov    0x68(%rsp),%r13d
mov    0x60(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    0x58(%rsp),%rax
mov    %rax,0x8(%rsp)
mov    0x50(%rsp),%r12
mov    %r13d,%ebp
shl    $0xa,%ebp
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
shl    $0x9,%r13d
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r13d,%edx
call   1030 <memcpy@plt>
mov    0x8(%rsp),%rdi
mov    0x10(%rsp),%rsi
mov    %r13d,%edx
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <memcpy@plt>
ret

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

LLVM IR (-O2):
define void @load(i32 %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* %8, i32 %9) {
%11 = icmp eq i32 %0, 0
br i1 %11, label %19, label %12
12: ; preds = %10
%13 = shl i32 %9, 10
%14 = tail call i32 @memcpy(double* %1, double* %2, i32 %13)
%15 = tail call i32 @memcpy(double* %3, double* %4, i32 %13)
%16 = shl i32 %9, 9
%17 = tail call i32 @memcpy(double* %5, double* %6, i32 %16)
%18 = tail call i32 @memcpy(double* %7, double* %8, i32 %16)
br label %19
19: ; preds = %12, %10
ret void
}