#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 */
void NPdcopy(double *out, const double *in, const size_t n) {
  size_t i;
  for (i = 0; i < n; i++) {
    out[i] = in[i];
  }
}


x86 assembly (clang, -O0):
<NPdcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1151 <NPdcopy+0x51>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <NPdcopy+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NPdcopy>:
test   %rdx,%rdx
je     1278 <NPdcopy+0x178>
cmp    $0x4,%rdx
jb     1125 <NPdcopy+0x25>
lea    (%rsi,%rdx,8),%rax
cmp    %rdi,%rax
jbe    119c <NPdcopy+0x9c>
lea    (%rdi,%rdx,8),%rax
cmp    %rsi,%rax
jbe    119c <NPdcopy+0x9c>
xor    %eax,%eax
mov    %rax,%r8
not    %r8
add    %rdx,%r8
mov    %rdx,%rcx
and    $0x3,%rcx
je     1154 <NPdcopy+0x54>
nopl   0x0(%rax)
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rdi,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rcx
jne    1140 <NPdcopy+0x40>
cmp    $0x3,%r8
jb     1278 <NPdcopy+0x178>
xchg   %ax,%ax
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rdi,%rax,8)
movsd  0x8(%rsi,%rax,8),%xmm0
movsd  %xmm0,0x8(%rdi,%rax,8)
movsd  0x10(%rsi,%rax,8),%xmm0
movsd  %xmm0,0x10(%rdi,%rax,8)
movsd  0x18(%rsi,%rax,8),%xmm0
movsd  %xmm0,0x18(%rdi,%rax,8)
add    $0x4,%rax
cmp    %rax,%rdx
jne    1160 <NPdcopy+0x60>
jmp    1278 <NPdcopy+0x178>
mov    %rdx,%rax
and    $0xfffffffffffffffc,%rax
lea    -0x4(%rax),%rcx
mov    %rcx,%r9
shr    $0x2,%r9
add    $0x1,%r9
mov    %r9d,%r8d
and    $0x3,%r8d
cmp    $0xc,%rcx
jae    11c3 <NPdcopy+0xc3>
xor    %ecx,%ecx
jmp    1228 <NPdcopy+0x128>
and    $0xfffffffffffffffc,%r9
xor    %ecx,%ecx
nopl   0x0(%rax)
movups (%rsi,%rcx,8),%xmm0
movups 0x10(%rsi,%rcx,8),%xmm1
movups %xmm0,(%rdi,%rcx,8)
movups %xmm1,0x10(%rdi,%rcx,8)
movups 0x20(%rsi,%rcx,8),%xmm0
movups 0x30(%rsi,%rcx,8),%xmm1
movups %xmm0,0x20(%rdi,%rcx,8)
movups %xmm1,0x30(%rdi,%rcx,8)
movups 0x40(%rsi,%rcx,8),%xmm0
movups 0x50(%rsi,%rcx,8),%xmm1
movups %xmm0,0x40(%rdi,%rcx,8)
movups %xmm1,0x50(%rdi,%rcx,8)
movups 0x60(%rsi,%rcx,8),%xmm0
movups 0x70(%rsi,%rcx,8),%xmm1
movups %xmm0,0x60(%rdi,%rcx,8)
movups %xmm1,0x70(%rdi,%rcx,8)
add    $0x10,%rcx
add    $0xfffffffffffffffc,%r9
jne    11d0 <NPdcopy+0xd0>
test   %r8,%r8
je     126f <NPdcopy+0x16f>
lea    (%rdi,%rcx,8),%r9
add    $0x10,%r9
lea    (%rsi,%rcx,8),%r10
add    $0x10,%r10
shl    $0x5,%r8
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movups -0x10(%r10,%rcx,1),%xmm0
movups (%r10,%rcx,1),%xmm1
movups %xmm0,-0x10(%r9,%rcx,1)
movups %xmm1,(%r9,%rcx,1)
add    $0x20,%rcx
cmp    %rcx,%r8
jne    1250 <NPdcopy+0x150>
cmp    %rdx,%rax
jne    1127 <NPdcopy+0x27>
ret

LLVM IR (-O0):
define void @NPdcopy(double* %0, double* %1, i64 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i64
%7 = alloca i64
store double* %0, double** %4
store double* %1, double** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %20, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load double*, double** %5
%14 = load i64, i64* %7
%15 = getelementptr inbounds double, double* %13, i64 %14
%16 = load double, double* %15
%17 = load double*, double** %4
%18 = load i64, i64* %7
%19 = getelementptr inbounds double, double* %17, i64 %18
store double %16, double* %19
br label %20
20: ; preds = %12
%21 = load i64, i64* %7
%22 = add i64 %21, 1
store i64 %22, i64* %7
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @NPdcopy(double* nocapture writeonly %0, double* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %129, label %5
5: ; preds = %3
%6 = icmp ult i64 %2, 4
br i1 %6, label %92, label %7
7: ; preds = %5
%8 = getelementptr double, double* %0, i64 %2
%9 = getelementptr double, double* %1, i64 %2
%10 = icmp ugt double* %9, %0
%11 = icmp ugt double* %8, %1
%12 = and i1 %10, %11
br i1 %12, label %92, label %13
13: ; preds = %7
%14 = and i64 %2, -4
%15 = add i64 %14, -4
%16 = lshr exact i64 %15, 2
%17 = add nuw nsw i64 %16, 1
%18 = and i64 %17, 3
%19 = icmp ult i64 %15, 12
br i1 %19, label %71, label %20
20: ; preds = %13
%21 = and i64 %17, 9223372036854775804
br label %22
22: ; preds = %22, %20
%23 = phi i64 [ 0, %20 ], [ %68, %22 ]
%24 = phi i64 [ 0, %20 ], [ %69, %22 ]
%25 = getelementptr inbounds double, double* %1, i64 %23
%26 = bitcast double* %25 to <2 x double>*
%27 = load <2 x double>, <2 x double>* %26
%28 = getelementptr inbounds double, double* %25, i64 2
%29 = bitcast double* %28 to <2 x double>*
%30 = load <2 x double>, <2 x double>* %29
%31 = getelementptr inbounds double, double* %0, i64 %23
%32 = bitcast double* %31 to <2 x double>*
store <2 x double> %27, <2 x double>* %32
%33 = getelementptr inbounds double, double* %31, i64 2
%34 = bitcast double* %33 to <2 x double>*
store <2 x double> %30, <2 x double>* %34
%35 = or i64 %23, 4
%36 = getelementptr inbounds double, double* %1, i64 %35
%37 = bitcast double* %36 to <2 x double>*
%38 = load <2 x double>, <2 x double>* %37
%39 = getelementptr inbounds double, double* %36, i64 2
%40 = bitcast double* %39 to <2 x double>*
%41 = load <2 x double>, <2 x double>* %40
%42 = getelementptr inbounds double, double* %0, i64 %35
%43 = bitcast double* %42 to <2 x double>*
store <2 x double> %38, <2 x double>* %43
%44 = getelementptr inbounds double, double* %42, i64 2
%45 = bitcast double* %44 to <2 x double>*
store <2 x double> %41, <2 x double>* %45
%46 = or i64 %23, 8
%47 = getelementptr inbounds double, double* %1, i64 %46
%48 = bitcast double* %47 to <2 x double>*
%49 = load <2 x double>, <2 x double>* %48
%50 = getelementptr inbounds double, double* %47, i64 2
%51 = bitcast double* %50 to <2 x double>*
%52 = load <2 x double>, <2 x double>* %51
%53 = getelementptr inbounds double, double* %0, i64 %46
%54 = bitcast double* %53 to <2 x double>*
store <2 x double> %49, <2 x double>* %54
%55 = getelementptr inbounds double, double* %53, i64 2
%56 = bitcast double* %55 to <2 x double>*
store <2 x double> %52, <2 x double>* %56
%57 = or i64 %23, 12
%58 = getelementptr inbounds double, double* %1, i64 %57
%59 = bitcast double* %58 to <2 x double>*
%60 = load <2 x double>, <2 x double>* %59
%61 = getelementptr inbounds double, double* %58, i64 2
%62 = bitcast double* %61 to <2 x double>*
%63 = load <2 x double>, <2 x double>* %62
%64 = getelementptr inbounds double, double* %0, i64 %57
%65 = bitcast double* %64 to <2 x double>*
store <2 x double> %60, <2 x double>* %65
%66 = getelementptr inbounds double, double* %64, i64 2
%67 = bitcast double* %66 to <2 x double>*
store <2 x double> %63, <2 x double>* %67
%68 = add nuw i64 %23, 16
%69 = add nuw i64 %24, 4
%70 = icmp eq i64 %69, %21
br i1 %70, label %71, label %22
71: ; preds = %22, %13
%72 = phi i64 [ 0, %13 ], [ %68, %22 ]
%73 = icmp eq i64 %18, 0
br i1 %73, label %90, label %74
74: ; preds = %71, %74
%75 = phi i64 [ %87, %74 ], [ %72, %71 ]
%76 = phi i64 [ %88, %74 ], [ 0, %71 ]
%77 = getelementptr inbounds double, double* %1, i64 %75
%78 = bitcast double* %77 to <2 x double>*
%79 = load <2 x double>, <2 x double>* %78
%80 = getelementptr inbounds double, double* %77, i64 2
%81 = bitcast double* %80 to <2 x double>*
%82 = load <2 x double>, <2 x double>* %81
%83 = getelementptr inbounds double, double* %0, i64 %75
%84 = bitcast double* %83 to <2 x double>*
store <2 x double> %79, <2 x double>* %84
%85 = getelementptr inbounds double, double* %83, i64 2
%86 = bitcast double* %85 to <2 x double>*
store <2 x double> %82, <2 x double>* %86
%87 = add nuw i64 %75, 4
%88 = add i64 %76, 1
%89 = icmp eq i64 %88, %18
br i1 %89, label %90, label %74
90: ; preds = %74, %71
%91 = icmp eq i64 %14, %2
br i1 %91, label %129, label %92
92: ; preds = %7, %5, %90
%93 = phi i64 [ 0, %7 ], [ 0, %5 ], [ %14, %90 ]
%94 = xor i64 %93, -1
%95 = add i64 %94, %2
%96 = and i64 %2, 3
%97 = icmp eq i64 %96, 0
br i1 %97, label %107, label %98
98: ; preds = %92, %98
%99 = phi i64 [ %104, %98 ], [ %93, %92 ]
%100 = phi i64 [ %105, %98 ], [ 0, %92 ]
%101 = getelementptr inbounds double, double* %1, i64 %99
%102 = load double, double* %101
%103 = getelementptr inbounds double, double* %0, i64 %99
store double %102, double* %103
%104 = add nuw i64 %99, 1
%105 = add i64 %100, 1
%106 = icmp eq i64 %105, %96
br i1 %106, label %107, label %98
107: ; preds = %98, %92
%108 = phi i64 [ %93, %92 ], [ %104, %98 ]
%109 = icmp ult i64 %95, 3
br i1 %109, label %129, label %110
110: ; preds = %107, %110
%111 = phi i64 [ %127, %110 ], [ %108, %107 ]
%112 = getelementptr inbounds double, double* %1, i64 %111
%113 = load double, double* %112
%114 = getelementptr inbounds double, double* %0, i64 %111
store double %113, double* %114
%115 = add nuw i64 %111, 1
%116 = getelementptr inbounds double, double* %1, i64 %115
%117 = load double, double* %116
%118 = getelementptr inbounds double, double* %0, i64 %115
store double %117, double* %118
%119 = add nuw i64 %111, 2
%120 = getelementptr inbounds double, double* %1, i64 %119
%121 = load double, double* %120
%122 = getelementptr inbounds double, double* %0, i64 %119
store double %121, double* %122
%123 = add nuw i64 %111, 3
%124 = getelementptr inbounds double, double* %1, i64 %123
%125 = load double, double* %124
%126 = getelementptr inbounds double, double* %0, i64 %123
store double %125, double* %126
%127 = add nuw i64 %111, 4
%128 = icmp eq i64 %127, %2
br i1 %128, label %129, label %110
129: ; preds = %107, %110, %90, %3
ret void
}