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


x86 assembly (clang, -O0):
<apply_thermal_boundary_conditions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x33,-0x10(%rbp)
jge    1173 <apply_thermal_boundary_conditions+0x73>
mov    -0x8(%rbp),%rax
imul   $0x65,-0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
imul   $0x65,-0x10(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
imul   $0x65,-0x10(%rbp),%ecx
add    $0x63,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
imul   $0x65,-0x10(%rbp),%ecx
add    $0x64,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    110f <apply_thermal_boundary_conditions+0xf>
movl   $0x0,-0xc(%rbp)
cmpl   $0x65,-0xc(%rbp)
jge    11c4 <apply_thermal_boundary_conditions+0xc4>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xe67(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x13ba,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117a <apply_thermal_boundary_conditions+0x7a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_thermal_boundary_conditions>:
mov    $0x648,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movsd  -0x640(%rdi,%rax,1),%xmm0
ff ff
movsd  %xmm0,-0x648(%rdi,%rax,1)
ff ff
movsd  -0x330(%rdi,%rax,1),%xmm0
ff ff
movsd  %xmm0,-0x328(%rdi,%rax,1)
ff ff
cmp    $0xa418,%rax
je     1161 <apply_thermal_boundary_conditions+0x61>
movsd  -0x318(%rdi,%rax,1),%xmm0
ff ff
movsd  %xmm0,-0x320(%rdi,%rax,1)
ff ff
movsd  -0x8(%rdi,%rax,1),%xmm0
movsd  %xmm0,(%rdi,%rax,1)
add    $0x650,%rax
jmp    1110 <apply_thermal_boundary_conditions+0x10>
xor    %eax,%eax
movaps 0xe96(%rip),%xmm0
xorps  %xmm1,%xmm1
nopl   (%rax)
movups %xmm0,(%rdi,%rax,8)
movups %xmm1,0x9dd0(%rdi,%rax,8)
movups %xmm0,0x10(%rdi,%rax,8)
movups %xmm1,0x9de0(%rdi,%rax,8)
movups %xmm0,0x20(%rdi,%rax,8)
movups %xmm1,0x9df0(%rdi,%rax,8)
movups %xmm0,0x30(%rdi,%rax,8)
movups %xmm1,0x9e00(%rdi,%rax,8)
movups %xmm0,0x40(%rdi,%rax,8)
movups %xmm1,0x9e10(%rdi,%rax,8)
add    $0xa,%rax
cmp    $0x64,%rax
jne    1170 <apply_thermal_boundary_conditions+0x70>
movabs $0x408f400000000000,%rax
40 8f 40
mov    %rax,0x320(%rdi)
movq   $0x0,0xa0f0(%rdi)
ret

LLVM IR (-O0):
define void @apply_thermal_boundary_conditions(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca i32
store double* %0, double** %2
store i32 0, i32* %4
br label %5
5: ; preds = %35, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 51
br i1 %7, label %8, label %38
8: ; preds = %5
%9 = load double*, double** %2
%10 = load i32, i32* %4
%11 = mul nsw i32 101, %10
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %9, i64 %13
%15 = load double, double* %14
%16 = load double*, double** %2
%17 = load i32, i32* %4
%18 = mul nsw i32 101, %17
%19 = add nsw i32 %18, 0
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %16, i64 %20
store double %15, double* %21
%22 = load double*, double** %2
%23 = load i32, i32* %4
%24 = mul nsw i32 101, %23
%25 = add nsw i32 %24, 99
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %22, i64 %26
%28 = load double, double* %27
%29 = load double*, double** %2
%30 = load i32, i32* %4
%31 = mul nsw i32 101, %30
%32 = add nsw i32 %31, 100
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %29, i64 %33
store double %28, double* %34
br label %35
35: ; preds = %8
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %5
38: ; preds = %5
store i32 0, i32* %3
br label %39
39: ; preds = %53, %38
%40 = load i32, i32* %3
%41 = icmp slt i32 %40, 101
br i1 %41, label %42, label %56
42: ; preds = %39
%43 = load double*, double** %2
%44 = load i32, i32* %3
%45 = add nsw i32 0, %44
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %43, i64 %46
store double 1.000000e+03, double* %47
%48 = load double*, double** %2
%49 = load i32, i32* %3
%50 = add nsw i32 5050, %49
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %48, i64 %51
store double 0.000000e+00, double* %52
br label %53
53: ; preds = %42
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
store i32 %55, i32* %3
br label %39
56: ; preds = %39
ret void
}

LLVM IR (-O2):
define void @apply_thermal_boundary_conditions(double* nocapture %0) {
br label %2
2: ; preds = %16, %1
%3 = phi i64 [ 0, %1 ], [ %27, %16 ]
%4 = mul nuw nsw i64 %3, 101
%5 = or i64 %4, 1
%6 = getelementptr inbounds double, double* %0, i64 %5
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 %4
store double %7, double* %8
%9 = add nuw nsw i64 %4, 99
%10 = getelementptr inbounds double, double* %0, i64 %9
%11 = load double, double* %10
%12 = add nuw nsw i64 %4, 100
%13 = getelementptr inbounds double, double* %0, i64 %12
store double %11, double* %13
%14 = or i64 %3, 1
%15 = icmp eq i64 %14, 51
br i1 %15, label %28, label %16
16: ; preds = %2
%17 = mul nuw nsw i64 %14, 101
%18 = add nuw nsw i64 %17, 1
%19 = getelementptr inbounds double, double* %0, i64 %18
%20 = load double, double* %19
%21 = getelementptr inbounds double, double* %0, i64 %17
store double %20, double* %21
%22 = add nuw nsw i64 %17, 99
%23 = getelementptr inbounds double, double* %0, i64 %22
%24 = load double, double* %23
%25 = add nuw nsw i64 %17, 100
%26 = getelementptr inbounds double, double* %0, i64 %25
store double %24, double* %26
%27 = add nuw nsw i64 %3, 2
br label %2
28: ; preds = %2, %28
%29 = phi i64 [ %59, %28 ], [ 0, %2 ]
%30 = getelementptr inbounds double, double* %0, i64 %29
%31 = bitcast double* %30 to <2 x double>*
store <2 x double> <double 1.000000e+03, double 1.000000e+03>, <2 x double>* %31
%32 = add nuw nsw i64 %29, 5050
%33 = getelementptr inbounds double, double* %0, i64 %32
%34 = bitcast double* %33 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %34
%35 = add nuw nsw i64 %29, 2
%36 = getelementptr inbounds double, double* %0, i64 %35
%37 = bitcast double* %36 to <2 x double>*
store <2 x double> <double 1.000000e+03, double 1.000000e+03>, <2 x double>* %37
%38 = add nuw nsw i64 %29, 5052
%39 = getelementptr inbounds double, double* %0, i64 %38
%40 = bitcast double* %39 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %40
%41 = add nuw nsw i64 %29, 4
%42 = getelementptr inbounds double, double* %0, i64 %41
%43 = bitcast double* %42 to <2 x double>*
store <2 x double> <double 1.000000e+03, double 1.000000e+03>, <2 x double>* %43
%44 = add nuw nsw i64 %29, 5054
%45 = getelementptr inbounds double, double* %0, i64 %44
%46 = bitcast double* %45 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %46
%47 = add nuw nsw i64 %29, 6
%48 = getelementptr inbounds double, double* %0, i64 %47
%49 = bitcast double* %48 to <2 x double>*
store <2 x double> <double 1.000000e+03, double 1.000000e+03>, <2 x double>* %49
%50 = add nuw nsw i64 %29, 5056
%51 = getelementptr inbounds double, double* %0, i64 %50
%52 = bitcast double* %51 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %52
%53 = add nuw nsw i64 %29, 8
%54 = getelementptr inbounds double, double* %0, i64 %53
%55 = bitcast double* %54 to <2 x double>*
store <2 x double> <double 1.000000e+03, double 1.000000e+03>, <2 x double>* %55
%56 = add nuw nsw i64 %29, 5058
%57 = getelementptr inbounds double, double* %0, i64 %56
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %58
%59 = add nuw nsw i64 %29, 10
%60 = icmp eq i64 %59, 100
br i1 %60, label %61, label %28
61: ; preds = %28
%62 = getelementptr inbounds double, double* %0, i64 100
store double 1.000000e+03, double* %62
%63 = getelementptr inbounds double, double* %0, i64 5150
store double 0.000000e+00, double* %63
ret void
}