#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[7] = {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7};
  double target1[3], target2[3];
  copy_arr(source + 2, target1, 3);
  copy_ptr(source + 2, target2, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x38,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
add    $0x10,%rdi
lea    -0x60(%rbp),%rsi
mov    $0x3,%edx
call   1050 <copy_arr@plt>
lea    -0x40(%rbp),%rdi
add    $0x10,%rdi
lea    -0x80(%rbp),%rsi
mov    $0x3,%edx
call   1030 <copy_ptr@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
mov    0xf01(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rbx
lea    0x60(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1040 <copy_arr@plt>
lea    0x40(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <copy_ptr@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

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

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