#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 vec_set(size_t n, double *x, double *y) {
  for (size_t i = 0; i < n; i++) {
    x[i] = y[i];
  }
}


x86 assembly (clang, -O0):
<vec_set>:
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    -0x8(%rbp),%rax
jae    1151 <vec_set+0x51>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <vec_set+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vec_set(i64 %0, double* %1, double* %2) {
%4 = alloca i64
%5 = alloca double*
%6 = alloca double*
%7 = alloca i64
store i64 %0, i64* %4
store double* %1, double** %5
store double* %2, double** %6
store i64 0, i64* %7
br label %8
8: ; preds = %20, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load double*, double** %6
%14 = load i64, i64* %7
%15 = getelementptr inbounds double, double* %13, i64 %14
%16 = load double, double* %15
%17 = load double*, double** %5
%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 @vec_set(i64 %0, double* nocapture writeonly %1, double* nocapture %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %110, label %5
5: ; preds = %3
%6 = icmp ult i64 %0, 4
br i1 %6, label %92, label %7
7: ; preds = %5
%8 = getelementptr double, double* %1, i64 %0
%9 = getelementptr double, double* %2, i64 %0
%10 = icmp ugt double* %9, %1
%11 = icmp ugt double* %8, %2
%12 = and i1 %10, %11
br i1 %12, label %92, label %13
13: ; preds = %7
%14 = and i64 %0, -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* %2, 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* %1, 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* %2, 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* %1, 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* %2, 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* %1, 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* %2, 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* %1, 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* %2, 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* %1, 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, %0
br i1 %91, label %110, 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, %0
%96 = and i64 %0, 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* %2, i64 %99
%102 = load double, double* %101
%103 = getelementptr inbounds double, double* %1, 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 %110, label %111
110: ; preds = %107, %111, %90, %3
ret void
111: ; preds = %107, %111
%112 = phi i64 [ %128, %111 ], [ %108, %107 ]
%113 = getelementptr inbounds double, double* %2, i64 %112
%114 = load double, double* %113
%115 = getelementptr inbounds double, double* %1, i64 %112
store double %114, double* %115
%116 = add nuw i64 %112, 1
%117 = getelementptr inbounds double, double* %2, i64 %116
%118 = load double, double* %117
%119 = getelementptr inbounds double, double* %1, i64 %116
store double %118, double* %119
%120 = add nuw i64 %112, 2
%121 = getelementptr inbounds double, double* %2, i64 %120
%122 = load double, double* %121
%123 = getelementptr inbounds double, double* %1, i64 %120
store double %122, double* %123
%124 = add nuw i64 %112, 3
%125 = getelementptr inbounds double, double* %2, i64 %124
%126 = load double, double* %125
%127 = getelementptr inbounds double, double* %1, i64 %124
store double %126, double* %127
%128 = add nuw i64 %112, 4
%129 = icmp eq i64 %128, %0
br i1 %129, label %110, label %111
}