void dcopy_codegen_1(double *A, double *C) {
  const int n = 4 + 0 * 40 + 1 * 4;
  const int lda = 4 + 0 * 40 + 1 * 4;
  int ii, jj;
  for (jj = 0; jj < n; jj++) {
    for (ii = jj; ii < n; ii++) {
      C[ii + lda * jj] = A[ii + lda * jj];
    }
  }
}


x86 assembly (clang, -O0):
<dcopy_codegen_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
movl   $0x8,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x8,-0x20(%rbp)
jge    118a <dcopy_codegen_1+0x8a>
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    1177 <dcopy_codegen_1+0x77>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%edx
shl    $0x3,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%edx
shl    $0x3,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1131 <dcopy_codegen_1+0x31>
jmp    117c <dcopy_codegen_1+0x7c>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1121 <dcopy_codegen_1+0x21>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcopy_codegen_1>:
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rsi)
movsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rsi)
movsd  0x18(%rdi),%xmm0
movsd  %xmm0,0x18(%rsi)
movsd  0x20(%rdi),%xmm0
movsd  %xmm0,0x20(%rsi)
movsd  0x28(%rdi),%xmm0
movsd  %xmm0,0x28(%rsi)
movsd  0x30(%rdi),%xmm0
movsd  %xmm0,0x30(%rsi)
movsd  0x38(%rdi),%xmm0
movsd  %xmm0,0x38(%rsi)
movsd  0x48(%rdi),%xmm0
movsd  %xmm0,0x48(%rsi)
movsd  0x50(%rdi),%xmm0
movsd  %xmm0,0x50(%rsi)
movsd  0x58(%rdi),%xmm0
movsd  %xmm0,0x58(%rsi)
movsd  0x60(%rdi),%xmm0
movsd  %xmm0,0x60(%rsi)
movsd  0x68(%rdi),%xmm0
movsd  %xmm0,0x68(%rsi)
movsd  0x70(%rdi),%xmm0
movsd  %xmm0,0x70(%rsi)
movsd  0x78(%rdi),%xmm0
movsd  %xmm0,0x78(%rsi)
movsd  0x90(%rdi),%xmm0
movsd  %xmm0,0x90(%rsi)
movsd  0x98(%rdi),%xmm0
movsd  %xmm0,0x98(%rsi)
movsd  0xa0(%rdi),%xmm0
movsd  %xmm0,0xa0(%rsi)
movsd  0xa8(%rdi),%xmm0
movsd  %xmm0,0xa8(%rsi)
movsd  0xb0(%rdi),%xmm0
movsd  %xmm0,0xb0(%rsi)
movsd  0xb8(%rdi),%xmm0
movsd  %xmm0,0xb8(%rsi)
movsd  0xd8(%rdi),%xmm0
movsd  %xmm0,0xd8(%rsi)
movsd  0xe0(%rdi),%xmm0
movsd  %xmm0,0xe0(%rsi)
movsd  0xe8(%rdi),%xmm0
movsd  %xmm0,0xe8(%rsi)
movsd  0xf0(%rdi),%xmm0
movsd  %xmm0,0xf0(%rsi)
movsd  0xf8(%rdi),%xmm0
movsd  %xmm0,0xf8(%rsi)
movsd  0x120(%rdi),%xmm0
movsd  %xmm0,0x120(%rsi)
movsd  0x128(%rdi),%xmm0
movsd  %xmm0,0x128(%rsi)
movsd  0x130(%rdi),%xmm0
movsd  %xmm0,0x130(%rsi)
movsd  0x138(%rdi),%xmm0
movsd  %xmm0,0x138(%rsi)
movsd  0x168(%rdi),%xmm0
movsd  %xmm0,0x168(%rsi)
movsd  0x170(%rdi),%xmm0
movsd  %xmm0,0x170(%rsi)
movsd  0x178(%rdi),%xmm0
movsd  %xmm0,0x178(%rsi)
movsd  0x1b0(%rdi),%xmm0
movsd  %xmm0,0x1b0(%rsi)
movsd  0x1b8(%rdi),%xmm0
movsd  %xmm0,0x1b8(%rsi)
movsd  0x1f8(%rdi),%xmm0
movsd  %xmm0,0x1f8(%rsi)
ret

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

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