#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*/ copy_arr(double *, double *, int);
int /*<<< orphan*/ copy_ptr(double *, double *, int);
int main(void) {
  double source[5] = {1.1, 2.2, 3.3, 4.4, 5.5};
  double target1[5], target2[5];
  copy_arr(source, target1, 5);
  copy_ptr(source, target2, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe9c(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe87(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe72(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0x5,%edx
call   1050 <copy_arr@plt>
lea    -0x30(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0x5,%edx
call   1030 <copy_ptr@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x4016000000000000,%rax
mov    %rax,0x20(%rsp)
mov    %rsp,%rbx
lea    0x60(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1040 <copy_arr@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1030 <copy_ptr@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x double]
%3 = alloca [5 x double]
%4 = alloca [5 x double]
store i32 0, i32* %1
%5 = bitcast [5 x double]* %2 to i8*
%6 = bitcast i8* %5 to [5 x double]*
%7 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 0
store double 1.100000e+00, double* %7
%8 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 1
store double 2.200000e+00, double* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 2
store double 3.300000e+00, double* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 3
store double 4.400000e+00, double* %10
%11 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 4
store double 5.500000e+00, double* %11
%12 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 0
%13 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 0
%14 = call i32 @copy_arr(double* %12, double* %13, i32 5)
%15 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 0
%16 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 0
%17 = call i32 @copy_ptr(double* %15, double* %16, i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x double]
%2 = alloca [5 x double]
%3 = alloca [5 x double]
%4 = bitcast [5 x double]* %1 to i8*
%5 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 0
%6 = bitcast [5 x double]* %1 to <2 x double>*
store <2 x double> <double 1.100000e+00, double 2.200000e+00>, <2 x double>* %6
%7 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 2
%8 = bitcast double* %7 to <2 x double>*
store <2 x double> <double 3.300000e+00, double 4.400000e+00>, <2 x double>* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 4
store double 5.500000e+00, double* %9
%10 = bitcast [5 x double]* %2 to i8*
%11 = bitcast [5 x double]* %3 to i8*
%12 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 0
%13 = call i32 @copy_arr(double* %5, double* %12, i32 5)
%14 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 0
%15 = call i32 @copy_ptr(double* %5, double* %14, i32 5)
ret i32 0
}