#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 denseCopy(double **const a, double **const b, const size_t m,
               const size_t n) {
  long int i, j;
  double *a_col_j, *b_col_j;
  for (j = 0; j < n; j++) {
    a_col_j = a[j];
    b_col_j = b[j];
    for (i = 0; i < m; i++)
      b_col_j[i] = a_col_j[i];
  }
}


x86 assembly (clang, -O0):
<denseCopy>:
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    -0x20(%rbp),%rax
jae    11a1 <denseCopy+0xa1>
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    118b <denseCopy+0x8b>
mov    -0x38(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1152 <denseCopy+0x52>
jmp    1190 <denseCopy+0x90>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    111c <denseCopy+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<denseCopy>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rcx,%rcx
je     12ce <denseCopy+0x1ce>
lea    -0x4(%rdx),%r9
mov    %r9,-0x8(%rsp)
shr    $0x2,%r9
add    $0x1,%r9
mov    %rdx,%r11
and    $0xfffffffffffffffc,%r11
mov    %r9d,%r10d
and    $0x3,%r10d
and    $0xfffffffffffffffc,%r9
mov    %edx,%r8d
and    $0x3,%r8d
mov    %r10,%r15
shl    $0x5,%r15
xor    %r12d,%r12d
jmp    115d <denseCopy+0x5d>
nopl   0x0(%rax)
add    $0x1,%r12
cmp    %rcx,%r12
je     12ce <denseCopy+0x1ce>
test   %rdx,%rdx
je     1150 <denseCopy+0x50>
mov    (%rdi,%r12,8),%r13
mov    (%rsi,%r12,8),%rax
cmp    $0x4,%rdx
jb     118d <denseCopy+0x8d>
lea    0x0(,%rdx,8),%rbx
add    %r13,%rbx
cmp    %rbx,%rax
jae    1201 <denseCopy+0x101>
lea    (%rax,%rdx,8),%rbx
cmp    %rbx,%r13
jae    1201 <denseCopy+0x101>
xor    %ebx,%ebx
mov    %rbx,%rbp
not    %rbp
add    %rdx,%rbp
test   %r8,%r8
je     11b6 <denseCopy+0xb6>
mov    %r8,%r14
movsd  0x0(%r13,%rbx,8),%xmm0
movsd  %xmm0,(%rax,%rbx,8)
add    $0x1,%rbx
add    $0xffffffffffffffff,%r14
jne    11a0 <denseCopy+0xa0>
cmp    $0x3,%rbp
jb     1150 <denseCopy+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,%rdx
jne    11c0 <denseCopy+0xc0>
jmp    1150 <denseCopy+0x50>
cmpq   $0xc,-0x8(%rsp)
jae    120d <denseCopy+0x10d>
xor    %ebx,%ebx
jmp    1281 <denseCopy+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 <denseCopy+0x120>
test   %r10,%r10
je     12bd <denseCopy+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 <denseCopy+0x1a0>
mov    %r11,%rbx
cmp    %rdx,%r11
je     1150 <denseCopy+0x50>
jmp    118f <denseCopy+0x8f>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @denseCopy(double** nocapture %0, double** nocapture %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %3, 0
br i1 %5, label %140, label %6
6: ; preds = %4
%7 = icmp eq i64 %2, 0
%8 = add i64 %2, -4
%9 = lshr i64 %8, 2
%10 = add nuw nsw i64 %9, 1
%11 = icmp ult i64 %2, 4
%12 = and i64 %2, -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, %2
%18 = and i64 %2, 3
%19 = icmp eq i64 %18, 0
br label %20
20: ; preds = %6, %137
%21 = phi i64 [ 0, %6 ], [ %138, %137 ]
%22 = getelementptr inbounds double*, double** %0, i64 %21
%23 = load double*, double** %22
%24 = getelementptr inbounds double*, double** %1, i64 %21
%25 = load double*, double** %24
br i1 %7, label %137, label %26
26: ; preds = %20
br i1 %11, label %102, label %27
27: ; preds = %26
%28 = getelementptr double, double* %25, i64 %2
%29 = getelementptr double, double* %23, i64 %2
%30 = icmp ult double* %25, %29
%31 = icmp ult double* %23, %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* %23, 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* %25, 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* %23, 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* %25, 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* %23, 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* %25, 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* %23, 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* %25, 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* %23, 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* %25, 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, %26, %101
%103 = phi i64 [ 0, %27 ], [ 0, %26 ], [ %12, %101 ]
%104 = xor i64 %103, -1
%105 = add i64 %104, %2
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* %23, i64 %107
%110 = load double, double* %109
%111 = getelementptr inbounds double, double* %25, 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* %23, i64 %119
%121 = load double, double* %120
%122 = getelementptr inbounds double, double* %25, i64 %119
store double %121, double* %122
%123 = add nuw nsw i64 %119, 1
%124 = getelementptr inbounds double, double* %23, i64 %123
%125 = load double, double* %124
%126 = getelementptr inbounds double, double* %25, i64 %123
store double %125, double* %126
%127 = add nuw nsw i64 %119, 2
%128 = getelementptr inbounds double, double* %23, i64 %127
%129 = load double, double* %128
%130 = getelementptr inbounds double, double* %25, i64 %127
store double %129, double* %130
%131 = add nuw nsw i64 %119, 3
%132 = getelementptr inbounds double, double* %23, i64 %131
%133 = load double, double* %132
%134 = getelementptr inbounds double, double* %25, i64 %131
store double %133, double* %134
%135 = add nuw nsw i64 %119, 4
%136 = icmp eq i64 %135, %2
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, %3
br i1 %139, label %140, label %20
140: ; preds = %137, %4
ret void
}