#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*/ c_ccopy(int, void *, int, void *, int);
int /*<<< orphan*/ printf(char *, int, float, float);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  float y[] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
  int N = 4;
  int strideX = 1;
  int strideY = -1;
  c_ccopy(N, (void *)x, strideX, (void *)y, strideY);
  for (int i = 0; i < N; i++) {
    printf("y[ %i ] = %f + %fj\n", i, y[i * 2], y[(i * 2) + 1]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1050 <memset@plt>
movl   $0x4,-0x54(%rbp)
movl   $0x1,-0x58(%rbp)
movl   $0xffffffff,-0x5c(%rbp)
mov    -0x54(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x58(%rbp),%edx
lea    -0x50(%rbp),%rcx
mov    -0x5c(%rbp),%r8d
call   1040 <c_ccopy@plt>
movl   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    11f6 <main+0xc6>
mov    -0x60(%rbp),%esi
mov    -0x60(%rbp),%eax
shl    $0x1,%eax
cltq
movss  -0x50(%rbp,%rax,4),%xmm0
mov    -0x60(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
movss  -0x50(%rbp,%rax,4),%xmm1
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    11ae <main+0x7e>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rsi
mov    %rsp,%rcx
mov    $0x4,%edi
mov    $0x1,%edx
mov    $0xffffffff,%r8d
call   1040 <c_ccopy@plt>
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
lea    0xea8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
movss  0x18(%rsp),%xmm0
movss  0x1c(%rsp),%xmm1
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [20 x i8] c"y[ %i ] = %f + %fj\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x float]
%3 = alloca [8 x float]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [8 x float]* %2 to i8*
%9 = bitcast [8 x float]* %3 to i8*
store i32 4, i32* %4
store i32 1, i32* %5
store i32 -1, i32* %6
%10 = load i32, i32* %4
%11 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 0
%12 = bitcast float* %11 to i8*
%13 = load i32, i32* %5
%14 = getelementptr inbounds [8 x float], [8 x float]* %3, i64 0, i64 0
%15 = bitcast float* %14 to i8*
%16 = load i32, i32* %6
%17 = call i32 @c_ccopy(i32 %10, i8* %12, i32 %13, i8* %15, i32 %16)
store i32 0, i32* %7
br label %18
18: ; preds = %36, %0
%19 = load i32, i32* %7
%20 = load i32, i32* %4
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %39
22: ; preds = %18
%23 = load i32, i32* %7
%24 = load i32, i32* %7
%25 = mul nsw i32 %24, 2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [8 x float], [8 x float]* %3, i64 0, i64 %26
%28 = load float, float* %27
%29 = load i32, i32* %7
%30 = mul nsw i32 %29, 2
%31 = add nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [8 x float], [8 x float]* %3, i64 0, i64 %32
%34 = load float, float* %33
%35 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %23, float %28, float %34)
br label %36
36: ; preds = %22
%37 = load i32, i32* %7
%38 = add nsw i32 %37, 1
store i32 %38, i32* %7
br label %18
39: ; preds = %18
%40 = load i32, i32* %1
ret i32 %40
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [20 x i8] c"y[ %i ] = %f + %fj\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca [8 x float]
%3 = bitcast [8 x float]* %1 to i8*
%4 = bitcast [8 x float]* %2 to i8*
%5 = call i32 @c_ccopy(i32 4, i8* %3, i32 1, i8* %4, i32 -1)
%6 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 0
%7 = load float, float* %6
%8 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 1
%9 = load float, float* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 0, float %7, float %9)
%11 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 3
%14 = load float, float* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1, float %12, float %14)
%16 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 4
%17 = load float, float* %16
%18 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 5
%19 = load float, float* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 2, float %17, float %19)
%21 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 6
%22 = load float, float* %21
%23 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 7
%24 = load float, float* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 3, float %22, float %24)
ret i32 0
}