void lb_scpy(double *__restrict__ dst, const double *__restrict__ src, int rank,
             int stride, int count) {
  if (!(dst && src))
    lb_fatal("file %s: line %d (%s): assertion failed: (%s)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/xderhan/LuaLB/refs/heads/master/"
             "code-base/lualb-lua-5.1.x/src/core/lb-memory.c",
             35, __PRETTY_FUNCTION__, "dst && src");
  if (!(rank > 0 && stride != 0))
    lb_fatal("file %s: line %d (%s): assertion failed: (%s)\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/xderhan/LuaLB/refs/heads/master/"
             "code-base/lualb-lua-5.1.x/src/core/lb-memory.c",
             36, __PRETTY_FUNCTION__, "rank > 0 && stride != 0");
  rank *= sizeof(double);
  for (; count > 0; --count) {
    memcpy(dst, src, rank);
    dst += stride;
    src += stride;
  }
}


x86 assembly (clang, -O0):
<lb_scpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <lb_scpy+0x30>
cmpq   $0x0,-0x10(%rbp)
jne    1178 <lb_scpy+0x58>
lea    0xea9(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x23,%edx
lea    0xf6e(%rip),%rcx
lea    0xfad(%rip),%r8
mov    $0x0,%al
call   1040 <lb_fatal@plt>
cmpl   $0x0,-0x14(%rbp)
jle    118c <lb_scpy+0x6c>
cmpl   $0x0,-0x18(%rbp)
jne    11b4 <lb_scpy+0x94>
lea    0xe6d(%rip),%rdi
lea    0xe95(%rip),%rsi
mov    $0x24,%edx
lea    0xf32(%rip),%rcx
lea    0xf7c(%rip),%r8
mov    $0x0,%al
call   1040 <lb_fatal@plt>
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1212 <lb_scpy+0xf2>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    11bf <lb_scpy+0x9f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lb_scpy>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%r13
test   %rdi,%rdi
je     1143 <lb_scpy+0x23>
test   %r15,%r15
jne    1171 <lb_scpy+0x51>
lea    0xeb6(%rip),%rdi
lea    0xede(%rip),%rsi
lea    0xf80(%rip),%rcx
mov    %r8,%rbx
lea    0xfbc(%rip),%r8
mov    $0x23,%edx
xor    %eax,%eax
call   1040 <lb_fatal@plt>
mov    %rbx,%r8
test   %ebp,%ebp
jle    117a <lb_scpy+0x5a>
test   %r14d,%r14d
jne    11a8 <lb_scpy+0x88>
lea    0xe7f(%rip),%rdi
lea    0xea7(%rip),%rsi
lea    0xf49(%rip),%rcx
mov    %r8,%rbx
lea    0xf90(%rip),%r8
mov    $0x24,%edx
xor    %eax,%eax
call   1040 <lb_fatal@plt>
mov    %rbx,%r8
test   %r8d,%r8d
jle    129f <lb_scpy+0x17f>
shl    $0x3,%ebp
movslq %ebp,%rax
mov    %rax,(%rsp)
movslq %r14d,%r14
lea    -0x1(%r8),%eax
mov    %r8d,%ebx
and    $0x3,%ebx
je     1208 <lb_scpy+0xe8>
mov    %eax,0x8(%rsp)
mov    %r8,0x10(%rsp)
lea    0x0(,%r14,8),%r12
xor    %ebp,%ebp
nopl   (%rax)
mov    %r13,%rdi
mov    %r15,%rsi
mov    (%rsp),%rdx
call   1030 <memcpy@plt>
add    $0x1,%ebp
add    %r12,%r13
add    %r12,%r15
cmp    %ebp,%ebx
jne    11e0 <lb_scpy+0xc0>
mov    0x10(%rsp),%r8
sub    %ebp,%r8d
mov    0x8(%rsp),%eax
cmp    $0x3,%eax
jb     129f <lb_scpy+0x17f>
add    $0xffffffff,%r8d
mov    %r14,%rax
shl    $0x5,%rax
mov    %rax,0x8(%rsp)
shl    $0x3,%r14
xor    %r12d,%r12d
nopl   0x0(%rax,%rax,1)
mov    %r8,0x10(%rsp)
lea    (%r12,%r13,1),%rbp
lea    (%r15,%r12,1),%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    (%rsp),%rdx
call   1030 <memcpy@plt>
add    %r14,%rbp
add    %r14,%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    (%rsp),%rdx
call   1030 <memcpy@plt>
add    %r14,%rbp
add    %r14,%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    (%rsp),%rdx
call   1030 <memcpy@plt>
add    %r14,%rbp
add    %r14,%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    (%rsp),%rdx
call   1030 <memcpy@plt>
mov    0x10(%rsp),%r8
add    $0xfffffffc,%r8d
add    0x8(%rsp),%r12
cmp    $0xfffffffe,%r8d
jb     1230 <lb_scpy+0x110>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [47 x i8] c"file %s: line %d (%s): assertion failed: (%s)\0A\00"
@.str.1 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/xderhan/LuaLB/refs/heads/master/code-base/lualb-lua-5.1.x/src/core/lb-memory.c\00"
@__PRETTY_FUNCTION__.lb_scpy = [70 x i8] c"void lb_scpy(double *restrict, const double *restrict, int, int, int)\00"
@.str.2 = [11 x i8] c"dst && src\00"
@.str.3 = [24 x i8] c"rank > 0 && stride != 0\00"
define void @lb_scpy(double* noalias %0, double* noalias %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load double*, double** %6
%12 = icmp ne double* %11, null
br i1 %12, label %13, label %16
13: ; preds = %5
%14 = load double*, double** %7
%15 = icmp ne double* %14, null
br i1 %15, label %18, label %16
16: ; preds = %13, %5
%17 = call i32 (i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @lb_fatal to i32 (i8*, i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @__PRETTY_FUNCTION__.lb_scpy, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %16, %13
%19 = load i32, i32* %8
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %9
%23 = icmp ne i32 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %21, %18
%25 = call i32 (i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @lb_fatal to i32 (i8*, i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 36, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @__PRETTY_FUNCTION__.lb_scpy, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %26
26: ; preds = %24, %21
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = mul i64 %28, 8
%30 = trunc i64 %29 to i32
store i32 %30, i32* %8
br label %31
31: ; preds = %49, %26
%32 = load i32, i32* %10
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %52
34: ; preds = %31
%35 = load double*, double** %6
%36 = bitcast double* %35 to i8*
%37 = load double*, double** %7
%38 = bitcast double* %37 to i8*
%39 = load i32, i32* %8
%40 = sext i32 %39 to i64
%41 = load i32, i32* %9
%42 = load double*, double** %6
%43 = sext i32 %41 to i64
%44 = getelementptr inbounds double, double* %42, i64 %43
store double* %44, double** %6
%45 = load i32, i32* %9
%46 = load double*, double** %7
%47 = sext i32 %45 to i64
%48 = getelementptr inbounds double, double* %46, i64 %47
store double* %48, double** %7
br label %49
49: ; preds = %34
%50 = load i32, i32* %10
%51 = add nsw i32 %50, -1
store i32 %51, i32* %10
br label %31
52: ; preds = %31
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"file %s: line %d (%s): assertion failed: (%s)\0A\00"
@.str.1 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/xderhan/LuaLB/refs/heads/master/code-base/lualb-lua-5.1.x/src/core/lb-memory.c\00"
@__PRETTY_FUNCTION__.lb_scpy = [70 x i8] c"void lb_scpy(double *restrict, const double *restrict, int, int, int)\00"
@.str.2 = [11 x i8] c"dst && src\00"
@.str.3 = [24 x i8] c"rank > 0 && stride != 0\00"
define void @lb_scpy(double* noalias writeonly %0, double* noalias %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp ne double* %0, null
%7 = icmp ne double* %1, null
%8 = and i1 %6, %7
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 (i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @lb_fatal to i32 (i8*, i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @__PRETTY_FUNCTION__.lb_scpy, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %5, %9
%12 = icmp sgt i32 %2, 0
%13 = icmp ne i32 %3, 0
%14 = and i1 %12, %13
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = tail call i32 (i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @lb_fatal to i32 (i8*, i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 36, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @__PRETTY_FUNCTION__.lb_scpy, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %11, %15
%18 = icmp sgt i32 %4, 0
br i1 %18, label %19, label %66
19: ; preds = %17
%20 = shl i32 %2, 3
%21 = sext i32 %20 to i64
%22 = sext i32 %3 to i64
%23 = add i32 %4, -1
%24 = and i32 %4, 3
%25 = icmp eq i32 %24, 0
br i1 %25, label %38, label %26
26: ; preds = %19, %26
%27 = phi i32 [ %35, %26 ], [ %4, %19 ]
%28 = phi double* [ %33, %26 ], [ %0, %19 ]
%29 = phi double* [ %34, %26 ], [ %1, %19 ]
%30 = phi i32 [ %36, %26 ], [ 0, %19 ]
%31 = bitcast double* %28 to i8*
%32 = bitcast double* %29 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %31, i8* align 8 %32, i64 %21, i1 false)
%33 = getelementptr inbounds double, double* %28, i64 %22
%34 = getelementptr inbounds double, double* %29, i64 %22
%35 = add nsw i32 %27, -1
%36 = add i32 %30, 1
%37 = icmp eq i32 %36, %24
br i1 %37, label %38, label %26
38: ; preds = %26, %19
%39 = phi i32 [ %4, %19 ], [ %35, %26 ]
%40 = phi double* [ %0, %19 ], [ %33, %26 ]
%41 = phi double* [ %1, %19 ], [ %34, %26 ]
%42 = icmp ult i32 %23, 3
br i1 %42, label %66, label %43
43: ; preds = %38, %43
%44 = phi i32 [ %63, %43 ], [ %39, %38 ]
%45 = phi double* [ %61, %43 ], [ %40, %38 ]
%46 = phi double* [ %62, %43 ], [ %41, %38 ]
%47 = bitcast double* %45 to i8*
%48 = bitcast double* %46 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %47, i8* align 8 %48, i64 %21, i1 false)
%49 = getelementptr inbounds double, double* %45, i64 %22
%50 = getelementptr inbounds double, double* %46, i64 %22
%51 = bitcast double* %49 to i8*
%52 = bitcast double* %50 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %51, i8* align 8 %52, i64 %21, i1 false)
%53 = getelementptr inbounds double, double* %49, i64 %22
%54 = getelementptr inbounds double, double* %50, i64 %22
%55 = bitcast double* %53 to i8*
%56 = bitcast double* %54 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %55, i8* align 8 %56, i64 %21, i1 false)
%57 = getelementptr inbounds double, double* %53, i64 %22
%58 = getelementptr inbounds double, double* %54, i64 %22
%59 = bitcast double* %57 to i8*
%60 = bitcast double* %58 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %59, i8* align 8 %60, i64 %21, i1 false)
%61 = getelementptr inbounds double, double* %57, i64 %22
%62 = getelementptr inbounds double, double* %58, i64 %22
%63 = add nsw i32 %44, -4
%64 = add i32 %44, -5
%65 = icmp ult i32 %64, -2
br i1 %65, label %43, label %66
66: ; preds = %38, %43, %17
ret void
}