void MxCopy(double **from, double **to, long vc, long vlen) {
  long i, j;
  for (j = 0; j < vc; j++)
    for (i = 0; i < vlen; i++)
      *(*(to + j) + i) = *(*(from + j) + i);
}


x86 assembly (clang, -O0):
<MxCopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1191 <MxCopy+0x91>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    117b <MxCopy+0x7b>
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1132 <MxCopy+0x32>
jmp    1180 <MxCopy+0x80>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    111c <MxCopy+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MxCopy>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rdx,%rdx
jle    12ce <MxCopy+0x1ce>
lea    -0x4(%rcx),%r9
mov    %r9,-0x8(%rsp)
shr    $0x2,%r9
add    $0x1,%r9
mov    %rcx,%r11
and    $0xfffffffffffffffc,%r11
mov    %r9d,%r10d
and    $0x3,%r10d
and    $0xfffffffffffffffc,%r9
mov    %ecx,%r8d
and    $0x3,%r8d
mov    %r10,%r15
shl    $0x5,%r15
xor    %r12d,%r12d
jmp    115d <MxCopy+0x5d>
nopl   0x0(%rax)
add    $0x1,%r12
cmp    %rdx,%r12
je     12ce <MxCopy+0x1ce>
test   %rcx,%rcx
jle    1150 <MxCopy+0x50>
mov    (%rdi,%r12,8),%r13
mov    (%rsi,%r12,8),%rax
cmp    $0x4,%rcx
jb     118d <MxCopy+0x8d>
lea    0x0(,%rcx,8),%rbx
add    %r13,%rbx
cmp    %rbx,%rax
jae    1201 <MxCopy+0x101>
lea    (%rax,%rcx,8),%rbx
cmp    %rbx,%r13
jae    1201 <MxCopy+0x101>
xor    %ebx,%ebx
mov    %rbx,%rbp
not    %rbp
add    %rcx,%rbp
test   %r8,%r8
je     11b6 <MxCopy+0xb6>
mov    %r8,%r14
movsd  0x0(%r13,%rbx,8),%xmm0
movsd  %xmm0,(%rax,%rbx,8)
add    $0x1,%rbx
add    $0xffffffffffffffff,%r14
jne    11a0 <MxCopy+0xa0>
cmp    $0x3,%rbp
jb     1150 <MxCopy+0x50>
nopl   0x0(%rax)
movsd  0x0(%r13,%rbx,8),%xmm0
movsd  %xmm0,(%rax,%rbx,8)
movsd  0x8(%r13,%rbx,8),%xmm0
movsd  %xmm0,0x8(%rax,%rbx,8)
movsd  0x10(%r13,%rbx,8),%xmm0
movsd  %xmm0,0x10(%rax,%rbx,8)
movsd  0x18(%r13,%rbx,8),%xmm0
movsd  %xmm0,0x18(%rax,%rbx,8)
add    $0x4,%rbx
cmp    %rbx,%rcx
jne    11c0 <MxCopy+0xc0>
jmp    1150 <MxCopy+0x50>
cmpq   $0xc,-0x8(%rsp)
jae    120d <MxCopy+0x10d>
xor    %ebx,%ebx
jmp    1281 <MxCopy+0x181>
mov    %r9,%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movups 0x0(%r13,%rbx,8),%xmm0
movups 0x10(%r13,%rbx,8),%xmm1
movups %xmm0,(%rax,%rbx,8)
movups %xmm1,0x10(%rax,%rbx,8)
movups 0x20(%r13,%rbx,8),%xmm0
movups 0x30(%r13,%rbx,8),%xmm1
movups %xmm0,0x20(%rax,%rbx,8)
movups %xmm1,0x30(%rax,%rbx,8)
movups 0x40(%r13,%rbx,8),%xmm0
movups 0x50(%r13,%rbx,8),%xmm1
movups %xmm0,0x40(%rax,%rbx,8)
movups %xmm1,0x50(%rax,%rbx,8)
movups 0x60(%r13,%rbx,8),%xmm0
movups 0x70(%r13,%rbx,8),%xmm1
movups %xmm0,0x60(%rax,%rbx,8)
movups %xmm1,0x70(%rax,%rbx,8)
add    $0x10,%rbx
add    $0xfffffffffffffffc,%rbp
jne    1220 <MxCopy+0x120>
test   %r10,%r10
je     12bd <MxCopy+0x1bd>
lea    (%rax,%rbx,8),%r14
add    $0x10,%r14
lea    0x10(,%rbx,8),%rbx
add    %r13,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movups -0x10(%rbx,%rbp,1),%xmm0
movups (%rbx,%rbp,1),%xmm1
movups %xmm0,-0x10(%r14,%rbp,1)
movups %xmm1,(%r14,%rbp,1)
add    $0x20,%rbp
cmp    %rbp,%r15
jne    12a0 <MxCopy+0x1a0>
mov    %r11,%rbx
cmp    %rcx,%r11
je     1150 <MxCopy+0x50>
jmp    118f <MxCopy+0x8f>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @MxCopy(double** %0, double** %1, i64 %2, i64 %3) {
%5 = alloca double**
%6 = alloca double**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store double** %0, double*** %5
store double** %1, double*** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
store i64 0, i64* %10
br label %11
11: ; preds = %38, %4
%12 = load i64, i64* %10
%13 = load i64, i64* %7
%14 = icmp slt i64 %12, %13
br i1 %14, label %15, label %41
15: ; preds = %11
store i64 0, i64* %9
br label %16
16: ; preds = %34, %15
%17 = load i64, i64* %9
%18 = load i64, i64* %8
%19 = icmp slt i64 %17, %18
br i1 %19, label %20, label %37
20: ; preds = %16
%21 = load double**, double*** %5
%22 = load i64, i64* %10
%23 = getelementptr inbounds double*, double** %21, i64 %22
%24 = load double*, double** %23
%25 = load i64, i64* %9
%26 = getelementptr inbounds double, double* %24, i64 %25
%27 = load double, double* %26
%28 = load double**, double*** %6
%29 = load i64, i64* %10
%30 = getelementptr inbounds double*, double** %28, i64 %29
%31 = load double*, double** %30
%32 = load i64, i64* %9
%33 = getelementptr inbounds double, double* %31, i64 %32
store double %27, double* %33
br label %34
34: ; preds = %20
%35 = load i64, i64* %9
%36 = add nsw i64 %35, 1
store i64 %36, i64* %9
br label %16
37: ; preds = %16
br label %38
38: ; preds = %37
%39 = load i64, i64* %10
%40 = add nsw i64 %39, 1
store i64 %40, i64* %10
br label %11
41: ; preds = %11
ret void
}

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