void apply_vel_boundary_conditions(double *restrict u, double *restrict v) {
  int i, j;
#pragma omp parallel for
  for (j = 0; j < 51; j++) {
    u[101 * j + 0] = 0.;
    v[101 * j + 0] = v[101 * j + 1];
    u[101 * j + (101 - 1)] = 0.;
    v[101 * j + (101 - 1)] = v[101 * j + (101 - 2)];
  }
#pragma omp parallel for
  for (i = 0; i < 101; i++) {
    u[0 + i] = 0.;
    v[0 + i] = 0.;
    u[101 * (51 - 1) + i] = 0.;
    v[101 * (51 - 1) + i] = 0.;
  }
}


x86 assembly (clang, -O0):
<apply_vel_boundary_conditions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x33,-0x18(%rbp)
jge    11a3 <apply_vel_boundary_conditions+0xa3>
mov    -0x8(%rbp),%rax
imul   $0x65,-0x18(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
imul   $0x65,-0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x65,-0x18(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
imul   $0x65,-0x18(%rbp),%ecx
add    $0x64,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
imul   $0x65,-0x18(%rbp),%ecx
add    $0x63,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x65,-0x18(%rbp),%ecx
add    $0x64,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1113 <apply_vel_boundary_conditions+0x13>
movl   $0x0,-0x14(%rbp)
cmpl   $0x65,-0x14(%rbp)
jge    121c <apply_vel_boundary_conditions+0x11c>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x13ba,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x13ba,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11aa <apply_vel_boundary_conditions+0xaa>
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_vel_boundary_conditions>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x320,%eax
nop
movq   $0x0,-0x320(%r14,%rax,1)
movsd  -0x318(%rbx,%rax,1),%xmm0
ff ff
movsd  %xmm0,-0x320(%rbx,%rax,1)
ff ff
movq   $0x0,(%r14,%rax,1)
movsd  -0x8(%rbx,%rax,1),%xmm0
movsd  %xmm0,(%rbx,%rax,1)
add    $0x328,%rax
cmp    $0xa418,%rax
jne    1120 <apply_vel_boundary_conditions+0x10>
mov    $0x328,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x9dd0,%r14
mov    $0x328,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    $0x328,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x9dd0,%rbx
mov    $0x328,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @apply_vel_boundary_conditions(double* noalias %0, double* noalias %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store i32 0, i32* %6
br label %7
7: ; preds = %49, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 51
br i1 %9, label %10, label %52
10: ; preds = %7
%11 = load double*, double** %3
%12 = load i32, i32* %6
%13 = mul nsw i32 101, %12
%14 = add nsw i32 %13, 0
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* %11, i64 %15
store double 0.000000e+00, double* %16
%17 = load double*, double** %4
%18 = load i32, i32* %6
%19 = mul nsw i32 101, %18
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %17, i64 %21
%23 = load double, double* %22
%24 = load double*, double** %4
%25 = load i32, i32* %6
%26 = mul nsw i32 101, %25
%27 = add nsw i32 %26, 0
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %24, i64 %28
store double %23, double* %29
%30 = load double*, double** %3
%31 = load i32, i32* %6
%32 = mul nsw i32 101, %31
%33 = add nsw i32 %32, 100
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %30, i64 %34
store double 0.000000e+00, double* %35
%36 = load double*, double** %4
%37 = load i32, i32* %6
%38 = mul nsw i32 101, %37
%39 = add nsw i32 %38, 99
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %36, i64 %40
%42 = load double, double* %41
%43 = load double*, double** %4
%44 = load i32, i32* %6
%45 = mul nsw i32 101, %44
%46 = add nsw i32 %45, 100
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %43, i64 %47
store double %42, double* %48
br label %49
49: ; preds = %10
%50 = load i32, i32* %6
%51 = add nsw i32 %50, 1
store i32 %51, i32* %6
br label %7
52: ; preds = %7
store i32 0, i32* %5
br label %53
53: ; preds = %77, %52
%54 = load i32, i32* %5
%55 = icmp slt i32 %54, 101
br i1 %55, label %56, label %80
56: ; preds = %53
%57 = load double*, double** %3
%58 = load i32, i32* %5
%59 = add nsw i32 0, %58
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %57, i64 %60
store double 0.000000e+00, double* %61
%62 = load double*, double** %4
%63 = load i32, i32* %5
%64 = add nsw i32 0, %63
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %62, i64 %65
store double 0.000000e+00, double* %66
%67 = load double*, double** %3
%68 = load i32, i32* %5
%69 = add nsw i32 5050, %68
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %67, i64 %70
store double 0.000000e+00, double* %71
%72 = load double*, double** %4
%73 = load i32, i32* %5
%74 = add nsw i32 5050, %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %72, i64 %75
store double 0.000000e+00, double* %76
br label %77
77: ; preds = %56
%78 = load i32, i32* %5
%79 = add nsw i32 %78, 1
store i32 %79, i32* %5
br label %53
80: ; preds = %53
ret void
}

LLVM IR (-O2):
define void @apply_vel_boundary_conditions(double* noalias nocapture writeonly %0, double* noalias nocapture %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %17, %3 ]
%5 = mul nuw nsw i64 %4, 101
%6 = getelementptr inbounds double, double* %0, i64 %5
store double 0.000000e+00, double* %6
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds double, double* %1, i64 %7
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %1, i64 %5
store double %9, double* %10
%11 = add nuw nsw i64 %5, 100
%12 = getelementptr inbounds double, double* %0, i64 %11
store double 0.000000e+00, double* %12
%13 = add nuw nsw i64 %5, 99
%14 = getelementptr inbounds double, double* %1, i64 %13
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %1, i64 %11
store double %15, double* %16
%17 = add nuw nsw i64 %4, 1
%18 = icmp eq i64 %17, 51
br i1 %18, label %19, label %3
19: ; preds = %3
%20 = bitcast double* %1 to i8*
%21 = bitcast double* %0 to i8*
%22 = getelementptr double, double* %0, i64 5050
%23 = bitcast double* %22 to i8*
%24 = getelementptr double, double* %1, i64 5050
%25 = bitcast double* %24 to i8*
ret void
}