void CopyRow(int start_row, int stop_row, double **percent_full_sand,
             double **percent_full_rock, char **all_beach, char **all_rock,
             double **topography) {
  int start = (200) / 2;
  int row;
  for (row = start_row + 1; row < stop_row; row++) {
    memcpy(percent_full_rock[row] + start, percent_full_rock[start_row] + start,
           (200) * sizeof(double));
    memcpy(percent_full_sand[row] + start, percent_full_sand[start_row] + start,
           (200) * sizeof(double));
    memcpy(all_rock[row] + start, all_rock[start_row] + start,
           (200) * sizeof(char));
    memcpy(all_beach[row] + start, all_beach[start_row] + start,
           (200) * sizeof(char));
    memcpy(topography[row] + start, topography[start_row] + start,
           (200) * sizeof(double));
  }
}


x86 assembly (clang, -O0):
<CopyRow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movl   $0x64,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1264 <CopyRow+0x154>
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    $0x640,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    $0x640,%edx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
mov    -0x28(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
movslq -0x2c(%rbp),%rax
add    %rax,%rsi
mov    $0xc8,%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x2c(%rbp),%rax
add    %rax,%rdi
mov    -0x20(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
movslq -0x2c(%rbp),%rax
add    %rax,%rsi
mov    $0xc8,%edx
call   1030 <memcpy@plt>
mov    0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    $0x640,%edx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1142 <CopyRow+0x32>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyRow>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9,0x18(%rsp)
mov    %r8,0x10(%rsp)
mov    %rcx,0x8(%rsp)
mov    %rdx,(%rsp)
mov    %edi,%ebx
lea    0x1(%rbx),%eax
cmp    %esi,%eax
jge    1241 <CopyRow+0x131>
mov    0x70(%rsp),%rdx
movslq %ebx,%rbp
cltq
mov    0x8(%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
mov    %rcx,0x30(%rsp)
mov    (%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
mov    %rcx,0x28(%rsp)
mov    0x18(%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
mov    %rcx,0x20(%rsp)
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,8),%r13
lea    (%rdx,%rax,8),%r14
not    %ebx
add    %esi,%ebx
xor    %r15d,%r15d
mov    $0x320,%r12d
nopl   0x0(%rax,%rax,1)
mov    0x30(%rsp),%rax
mov    (%rax,%r15,8),%rdi
add    %r12,%rdi
mov    0x8(%rsp),%rax
mov    (%rax,%rbp,8),%rsi
add    %r12,%rsi
mov    $0x640,%edx
call   1030 <memcpy@plt>
mov    0x28(%rsp),%rax
mov    (%rax,%r15,8),%rdi
add    %r12,%rdi
mov    (%rsp),%rax
mov    (%rax,%rbp,8),%rsi
add    %r12,%rsi
mov    $0x640,%edx
call   1030 <memcpy@plt>
mov    0x20(%rsp),%rax
mov    (%rax,%r15,8),%rdi
add    $0x64,%rdi
mov    0x18(%rsp),%rax
mov    (%rax,%rbp,8),%rsi
add    $0x64,%rsi
mov    $0xc8,%edx
call   1030 <memcpy@plt>
mov    0x0(%r13,%r15,8),%rdi
add    $0x64,%rdi
mov    0x10(%rsp),%rax
mov    (%rax,%rbp,8),%rsi
add    $0x64,%rsi
mov    $0xc8,%edx
call   1030 <memcpy@plt>
mov    (%r14,%r15,8),%rdi
add    %r12,%rdi
mov    0x70(%rsp),%rax
mov    (%rax,%rbp,8),%rsi
add    %r12,%rsi
mov    $0x640,%edx
call   1030 <memcpy@plt>
add    $0x1,%r15
cmp    %r15d,%ebx
jne    1190 <CopyRow+0x80>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @CopyRow(i32 %0, i32 %1, double** nocapture %2, double** nocapture %3, i8** nocapture %4, i8** nocapture %5, double** nocapture %6) {
%8 = add i32 %0, 1
%9 = icmp slt i32 %8, %1
br i1 %9, label %10, label %54
10: ; preds = %7
%11 = sext i32 %0 to i64
%12 = getelementptr inbounds double*, double** %3, i64 %11
%13 = getelementptr inbounds double*, double** %2, i64 %11
%14 = getelementptr inbounds i8*, i8** %5, i64 %11
%15 = getelementptr inbounds i8*, i8** %4, i64 %11
%16 = getelementptr inbounds double*, double** %6, i64 %11
%17 = sext i32 %8 to i64
br label %18
18: ; preds = %10, %18
%19 = phi i64 [ %17, %10 ], [ %51, %18 ]
%20 = getelementptr inbounds double*, double** %3, i64 %19
%21 = load double*, double** %20
%22 = getelementptr inbounds double, double* %21, i64 100
%23 = bitcast double* %22 to i8*
%24 = load double*, double** %12
%25 = getelementptr inbounds double, double* %24, i64 100
%26 = bitcast double* %25 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 dereferenceable(1600) %23, i8* align 8 dereferenceable(1600) %26, i64 1600, i1 false)
%27 = getelementptr inbounds double*, double** %2, i64 %19
%28 = load double*, double** %27
%29 = getelementptr inbounds double, double* %28, i64 100
%30 = bitcast double* %29 to i8*
%31 = load double*, double** %13
%32 = getelementptr inbounds double, double* %31, i64 100
%33 = bitcast double* %32 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 dereferenceable(1600) %30, i8* align 8 dereferenceable(1600) %33, i64 1600, i1 false)
%34 = getelementptr inbounds i8*, i8** %5, i64 %19
%35 = load i8*, i8** %34
%36 = getelementptr inbounds i8, i8* %35, i64 100
%37 = load i8*, i8** %14
%38 = getelementptr inbounds i8, i8* %37, i64 100
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(200) %36, i8* align 1 dereferenceable(200) %38, i64 200, i1 false)
%39 = getelementptr inbounds i8*, i8** %4, i64 %19
%40 = load i8*, i8** %39
%41 = getelementptr inbounds i8, i8* %40, i64 100
%42 = load i8*, i8** %15
%43 = getelementptr inbounds i8, i8* %42, i64 100
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(200) %41, i8* align 1 dereferenceable(200) %43, i64 200, i1 false)
%44 = getelementptr inbounds double*, double** %6, i64 %19
%45 = load double*, double** %44
%46 = getelementptr inbounds double, double* %45, i64 100
%47 = bitcast double* %46 to i8*
%48 = load double*, double** %16
%49 = getelementptr inbounds double, double* %48, i64 100
%50 = bitcast double* %49 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 dereferenceable(1600) %47, i8* align 8 dereferenceable(1600) %50, i64 1600, i1 false)
%51 = add nsw i64 %19, 1
%52 = trunc i64 %51 to i32
%53 = icmp eq i32 %52, %1
br i1 %53, label %54, label %18
54: ; preds = %18, %7
ret void
}