void copybuffers(double *_a[7], double *_b[7], int N3) {
  for (int i = 0; i < N3; i++) {
    _b[0][i] = _a[0][i];
    _b[1][i] = _a[1][i];
    _b[2][i] = _a[2][i];
    _b[3][i] = _a[3][i];
    _b[4][i] = _a[4][i];
    _b[5][i] = _a[5][i];
    _b[6][i] = _a[6][i];
  }
}


x86 assembly (clang, -O0):
<copybuffers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    121c <copybuffers+0x11c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <copybuffers+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copybuffers>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    11d9 <copybuffers+0xd9>
mov    (%rdi),%rax
mov    %rax,-0x8(%rsp)
mov    0x8(%rdi),%rax
mov    %rax,-0x10(%rsp)
mov    (%rsi),%rax
mov    %rax,-0x18(%rsp)
mov    0x8(%rsi),%r11
mov    0x10(%rdi),%r14
mov    0x10(%rsi),%r15
mov    0x18(%rdi),%r12
mov    0x18(%rsi),%r13
mov    0x20(%rdi),%r10
mov    0x20(%rsi),%rbx
mov    0x28(%rdi),%rax
mov    0x28(%rsi),%rbp
mov    0x30(%rdi),%rdi
mov    0x30(%rsi),%rsi
mov    %edx,%edx
shl    $0x3,%rdx
xor    %r8d,%r8d
mov    -0x8(%rsp),%r9
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%r9,%r8,1),%xmm0
mov    -0x18(%rsp),%rcx
movsd  %xmm0,(%rcx,%r8,1)
mov    -0x10(%rsp),%rcx
movsd  (%rcx,%r8,1),%xmm0
movsd  %xmm0,(%r11,%r8,1)
movsd  (%r14,%r8,1),%xmm0
movsd  %xmm0,(%r15,%r8,1)
movsd  (%r12,%r8,1),%xmm0
movsd  %xmm0,0x0(%r13,%r8,1)
movsd  (%r10,%r8,1),%xmm0
movsd  %xmm0,(%rbx,%r8,1)
movsd  (%rax,%r8,1),%xmm0
movsd  %xmm0,0x0(%rbp,%r8,1)
movsd  (%rdi,%r8,1),%xmm0
movsd  %xmm0,(%rsi,%r8,1)
add    $0x8,%r8
cmp    %r8,%rdx
jne    1170 <copybuffers+0x70>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @copybuffers(double** %0, double** %1, i32 %2) {
%4 = alloca double**
%5 = alloca double**
%6 = alloca i32
%7 = alloca i32
store double** %0, double*** %4
store double** %1, double*** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %104, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %107
12: ; preds = %8
%13 = load double**, double*** %4
%14 = getelementptr inbounds double*, double** %13, i64 0
%15 = load double*, double** %14
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = load double**, double*** %5
%21 = getelementptr inbounds double*, double** %20, i64 0
%22 = load double*, double** %21
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %22, i64 %24
store double %19, double* %25
%26 = load double**, double*** %4
%27 = getelementptr inbounds double*, double** %26, i64 1
%28 = load double*, double** %27
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %28, i64 %30
%32 = load double, double* %31
%33 = load double**, double*** %5
%34 = getelementptr inbounds double*, double** %33, i64 1
%35 = load double*, double** %34
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
store double %32, double* %38
%39 = load double**, double*** %4
%40 = getelementptr inbounds double*, double** %39, i64 2
%41 = load double*, double** %40
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
%45 = load double, double* %44
%46 = load double**, double*** %5
%47 = getelementptr inbounds double*, double** %46, i64 2
%48 = load double*, double** %47
%49 = load i32, i32* %7
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %48, i64 %50
store double %45, double* %51
%52 = load double**, double*** %4
%53 = getelementptr inbounds double*, double** %52, i64 3
%54 = load double*, double** %53
%55 = load i32, i32* %7
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
%58 = load double, double* %57
%59 = load double**, double*** %5
%60 = getelementptr inbounds double*, double** %59, i64 3
%61 = load double*, double** %60
%62 = load i32, i32* %7
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %61, i64 %63
store double %58, double* %64
%65 = load double**, double*** %4
%66 = getelementptr inbounds double*, double** %65, i64 4
%67 = load double*, double** %66
%68 = load i32, i32* %7
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %67, i64 %69
%71 = load double, double* %70
%72 = load double**, double*** %5
%73 = getelementptr inbounds double*, double** %72, i64 4
%74 = load double*, double** %73
%75 = load i32, i32* %7
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %74, i64 %76
store double %71, double* %77
%78 = load double**, double*** %4
%79 = getelementptr inbounds double*, double** %78, i64 5
%80 = load double*, double** %79
%81 = load i32, i32* %7
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %80, i64 %82
%84 = load double, double* %83
%85 = load double**, double*** %5
%86 = getelementptr inbounds double*, double** %85, i64 5
%87 = load double*, double** %86
%88 = load i32, i32* %7
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %87, i64 %89
store double %84, double* %90
%91 = load double**, double*** %4
%92 = getelementptr inbounds double*, double** %91, i64 6
%93 = load double*, double** %92
%94 = load i32, i32* %7
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double, double* %93, i64 %95
%97 = load double, double* %96
%98 = load double**, double*** %5
%99 = getelementptr inbounds double*, double** %98, i64 6
%100 = load double*, double** %99
%101 = load i32, i32* %7
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds double, double* %100, i64 %102
store double %97, double* %103
br label %104
104: ; preds = %12
%105 = load i32, i32* %7
%106 = add nsw i32 %105, 1
store i32 %106, i32* %7
br label %8
107: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @copybuffers(double** nocapture %0, double** nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %33
5: ; preds = %3
%6 = load double*, double** %0
%7 = load double*, double** %1
%8 = getelementptr inbounds double*, double** %0, i64 1
%9 = load double*, double** %8
%10 = getelementptr inbounds double*, double** %1, i64 1
%11 = load double*, double** %10
%12 = getelementptr inbounds double*, double** %0, i64 2
%13 = load double*, double** %12
%14 = getelementptr inbounds double*, double** %1, i64 2
%15 = load double*, double** %14
%16 = getelementptr inbounds double*, double** %0, i64 3
%17 = load double*, double** %16
%18 = getelementptr inbounds double*, double** %1, i64 3
%19 = load double*, double** %18
%20 = getelementptr inbounds double*, double** %0, i64 4
%21 = load double*, double** %20
%22 = getelementptr inbounds double*, double** %1, i64 4
%23 = load double*, double** %22
%24 = getelementptr inbounds double*, double** %0, i64 5
%25 = load double*, double** %24
%26 = getelementptr inbounds double*, double** %1, i64 5
%27 = load double*, double** %26
%28 = getelementptr inbounds double*, double** %0, i64 6
%29 = load double*, double** %28
%30 = getelementptr inbounds double*, double** %1, i64 6
%31 = load double*, double** %30
%32 = zext i32 %2 to i64
br label %34
33: ; preds = %34, %3
ret void
34: ; preds = %5, %34
%35 = phi i64 [ 0, %5 ], [ %57, %34 ]
%36 = getelementptr inbounds double, double* %6, i64 %35
%37 = load double, double* %36
%38 = getelementptr inbounds double, double* %7, i64 %35
store double %37, double* %38
%39 = getelementptr inbounds double, double* %9, i64 %35
%40 = load double, double* %39
%41 = getelementptr inbounds double, double* %11, i64 %35
store double %40, double* %41
%42 = getelementptr inbounds double, double* %13, i64 %35
%43 = load double, double* %42
%44 = getelementptr inbounds double, double* %15, i64 %35
store double %43, double* %44
%45 = getelementptr inbounds double, double* %17, i64 %35
%46 = load double, double* %45
%47 = getelementptr inbounds double, double* %19, i64 %35
store double %46, double* %47
%48 = getelementptr inbounds double, double* %21, i64 %35
%49 = load double, double* %48
%50 = getelementptr inbounds double, double* %23, i64 %35
store double %49, double* %50
%51 = getelementptr inbounds double, double* %25, i64 %35
%52 = load double, double* %51
%53 = getelementptr inbounds double, double* %27, i64 %35
store double %52, double* %53
%54 = getelementptr inbounds double, double* %29, i64 %35
%55 = load double, double* %54
%56 = getelementptr inbounds double, double* %31, i64 %35
store double %55, double* %56
%57 = add nuw nsw i64 %35, 1
%58 = icmp eq i64 %57, %32
br i1 %58, label %33, label %34
}