void vct2plev(const double *vct, double *plevs, long nlevs) {
  long k;
  for (k = 0; k < nlevs; k++)
    plevs[k] = vct[k] + vct[k + nlevs] * (101325.0);
}


x86 assembly (clang, -O0):
<vct2plev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1172 <vct2plev+0x72>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
add    -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xeb4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <vct2plev+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vct2plev>:
test   %rdx,%rdx
jle    12e5 <vct2plev+0x1e5>
cmp    $0x4,%rdx
jae    1197 <vct2plev+0x97>
xor    %eax,%eax
mov    %rax,%r8
not    %r8
test   $0x1,%dl
je     113f <vct2plev+0x3f>
lea    (%rax,%rdx,1),%rcx
movsd  (%rdi,%rcx,8),%xmm0
mulsd  0xedf(%rip),%xmm0
addsd  (%rdi,%rax,8),%xmm0
movsd  %xmm0,(%rsi,%rax,8)
or     $0x1,%rax
add    %rdx,%r8
je     12e5 <vct2plev+0x1e5>
lea    (%rdi,%rdx,8),%rcx
add    $0x8,%rcx
movsd  0xeb8(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movsd  -0x8(%rcx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rdi,%rax,8),%xmm1
movsd  %xmm1,(%rsi,%rax,8)
movsd  (%rcx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rdi,%rax,8),%xmm1
movsd  %xmm1,0x8(%rsi,%rax,8)
add    $0x2,%rax
cmp    %rax,%rdx
jne    1160 <vct2plev+0x60>
jmp    12e5 <vct2plev+0x1e5>
lea    (%rsi,%rdx,8),%r8
lea    (%rdi,%rdx,8),%rcx
mov    %rdx,%rax
shl    $0x4,%rax
add    %rdi,%rax
cmp    %rsi,%rax
seta   %r9b
cmp    %rsi,%rdi
setb   %r10b
cmp    %rsi,%rcx
seta   %cl
cmp    %rdi,%r8
seta   %r8b
xor    %eax,%eax
test   %r10b,%r9b
jne    1115 <vct2plev+0x15>
and    %r8b,%cl
jne    1115 <vct2plev+0x15>
mov    %rdx,%rax
and    $0xfffffffffffffffc,%rax
lea    -0x4(%rax),%rcx
mov    %rcx,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rcx,%rcx
je     12e6 <vct2plev+0x1e6>
mov    %r8,%r9
and    $0xfffffffffffffffe,%r9
lea    0x30(%rdi),%r10
lea    (%rdi,%rdx,8),%r11
add    $0x30,%r11
xor    %ecx,%ecx
movapd 0xdec(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd -0x30(%r10,%rcx,8),%xmm1
movupd -0x20(%r10,%rcx,8),%xmm2
movupd -0x30(%r11,%rcx,8),%xmm3
movupd -0x20(%r11,%rcx,8),%xmm4
mulpd  %xmm0,%xmm3
addpd  %xmm1,%xmm3
mulpd  %xmm0,%xmm4
addpd  %xmm2,%xmm4
movupd %xmm3,(%rsi,%rcx,8)
movupd %xmm4,0x10(%rsi,%rcx,8)
movupd -0x10(%r10,%rcx,8),%xmm1
movupd (%r10,%rcx,8),%xmm2
movupd -0x10(%r11,%rcx,8),%xmm3
movupd (%r11,%rcx,8),%xmm4
mulpd  %xmm0,%xmm3
addpd  %xmm1,%xmm3
mulpd  %xmm0,%xmm4
addpd  %xmm2,%xmm4
movupd %xmm3,0x20(%rsi,%rcx,8)
movupd %xmm4,0x30(%rsi,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%r9
jne    1220 <vct2plev+0x120>
test   $0x1,%r8b
je     12dc <vct2plev+0x1dc>
movupd (%rdi,%rcx,8),%xmm0
movupd 0x10(%rdi,%rcx,8),%xmm1
lea    (%rcx,%rdx,1),%r8
movupd (%rdi,%r8,8),%xmm2
movupd 0x10(%rdi,%r8,8),%xmm3
movapd 0xd3f(%rip),%xmm4
mulpd  %xmm4,%xmm2
addpd  %xmm0,%xmm2
mulpd  %xmm4,%xmm3
addpd  %xmm1,%xmm3
movupd %xmm2,(%rsi,%rcx,8)
movupd %xmm3,0x10(%rsi,%rcx,8)
cmp    %rdx,%rax
jne    1115 <vct2plev+0x15>
ret
xor    %ecx,%ecx
test   $0x1,%r8b
jne    129d <vct2plev+0x19d>
jmp    12dc <vct2plev+0x1dc>

LLVM IR (-O0):
define void @vct2plev(double* %0, double* %1, i64 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i64
%7 = alloca i64
store double* %0, double** %4
store double* %1, double** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %27, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = icmp slt i64 %9, %10
br i1 %11, label %12, label %30
12: ; preds = %8
%13 = load double*, double** %4
%14 = load i64, i64* %7
%15 = getelementptr inbounds double, double* %13, i64 %14
%16 = load double, double* %15
%17 = load double*, double** %4
%18 = load i64, i64* %7
%19 = load i64, i64* %6
%20 = add nsw i64 %18, %19
%21 = getelementptr inbounds double, double* %17, i64 %20
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %22, double 1.013250e+05, double %16)
%24 = load double*, double** %5
%25 = load i64, i64* %7
%26 = getelementptr inbounds double, double* %24, i64 %25
store double %23, double* %26
br label %27
27: ; preds = %12
%28 = load i64, i64* %7
%29 = add nsw i64 %28, 1
store i64 %29, i64* %7
br label %8
30: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @vct2plev(double* nocapture %0, double* nocapture writeonly %1, i64 %2) {
%4 = icmp sgt i64 %2, 0
br i1 %4, label %5, label %135
5: ; preds = %3
%6 = icmp ult i64 %2, 4
br i1 %6, label %98, label %7
7: ; preds = %5
%8 = getelementptr double, double* %1, i64 %2
%9 = getelementptr double, double* %0, i64 %2
%10 = shl i64 %2, 1
%11 = getelementptr double, double* %0, i64 %10
%12 = icmp ugt double* %11, %1
%13 = icmp ult double* %0, %1
%14 = and i1 %12, %13
%15 = icmp ugt double* %9, %1
%16 = icmp ugt double* %8, %0
%17 = and i1 %15, %16
%18 = or i1 %14, %17
br i1 %18, label %98, label %19
19: ; preds = %7
%20 = and i64 %2, -4
%21 = add i64 %20, -4
%22 = lshr exact i64 %21, 2
%23 = add nuw nsw i64 %22, 1
%24 = and i64 %23, 1
%25 = icmp eq i64 %21, 0
br i1 %25, label %73, label %26
26: ; preds = %19
%27 = and i64 %23, 9223372036854775806
br label %28
28: ; preds = %28, %26
%29 = phi i64 [ 0, %26 ], [ %70, %28 ]
%30 = phi i64 [ 0, %26 ], [ %71, %28 ]
%31 = getelementptr inbounds double, double* %0, i64 %29
%32 = bitcast double* %31 to <2 x double>*
%33 = load <2 x double>, <2 x double>* %32
%34 = getelementptr inbounds double, double* %31, i64 2
%35 = bitcast double* %34 to <2 x double>*
%36 = load <2 x double>, <2 x double>* %35
%37 = add nsw i64 %29, %2
%38 = getelementptr inbounds double, double* %0, i64 %37
%39 = bitcast double* %38 to <2 x double>*
%40 = load <2 x double>, <2 x double>* %39
%41 = getelementptr inbounds double, double* %38, i64 2
%42 = bitcast double* %41 to <2 x double>*
%43 = load <2 x double>, <2 x double>* %42
%44 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %40, <2 x double> <double 1.013250e+05, double 1.013250e+05>, <2 x double> %33)
%45 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %43, <2 x double> <double 1.013250e+05, double 1.013250e+05>, <2 x double> %36)
%46 = getelementptr inbounds double, double* %1, i64 %29
%47 = bitcast double* %46 to <2 x double>*
store <2 x double> %44, <2 x double>* %47
%48 = getelementptr inbounds double, double* %46, i64 2
%49 = bitcast double* %48 to <2 x double>*
store <2 x double> %45, <2 x double>* %49
%50 = or i64 %29, 4
%51 = getelementptr inbounds double, double* %0, i64 %50
%52 = bitcast double* %51 to <2 x double>*
%53 = load <2 x double>, <2 x double>* %52
%54 = getelementptr inbounds double, double* %51, i64 2
%55 = bitcast double* %54 to <2 x double>*
%56 = load <2 x double>, <2 x double>* %55
%57 = add nsw i64 %50, %2
%58 = getelementptr inbounds double, double* %0, i64 %57
%59 = bitcast double* %58 to <2 x double>*
%60 = load <2 x double>, <2 x double>* %59
%61 = getelementptr inbounds double, double* %58, i64 2
%62 = bitcast double* %61 to <2 x double>*
%63 = load <2 x double>, <2 x double>* %62
%64 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %60, <2 x double> <double 1.013250e+05, double 1.013250e+05>, <2 x double> %53)
%65 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %63, <2 x double> <double 1.013250e+05, double 1.013250e+05>, <2 x double> %56)
%66 = getelementptr inbounds double, double* %1, i64 %50
%67 = bitcast double* %66 to <2 x double>*
store <2 x double> %64, <2 x double>* %67
%68 = getelementptr inbounds double, double* %66, i64 2
%69 = bitcast double* %68 to <2 x double>*
store <2 x double> %65, <2 x double>* %69
%70 = add nuw i64 %29, 8
%71 = add i64 %30, 2
%72 = icmp eq i64 %71, %27
br i1 %72, label %73, label %28
73: ; preds = %28, %19
%74 = phi i64 [ 0, %19 ], [ %70, %28 ]
%75 = icmp eq i64 %24, 0
br i1 %75, label %96, label %76
76: ; preds = %73
%77 = getelementptr inbounds double, double* %0, i64 %74
%78 = bitcast double* %77 to <2 x double>*
%79 = load <2 x double>, <2 x double>* %78
%80 = getelementptr inbounds double, double* %77, i64 2
%81 = bitcast double* %80 to <2 x double>*
%82 = load <2 x double>, <2 x double>* %81
%83 = add nsw i64 %74, %2
%84 = getelementptr inbounds double, double* %0, i64 %83
%85 = bitcast double* %84 to <2 x double>*
%86 = load <2 x double>, <2 x double>* %85
%87 = getelementptr inbounds double, double* %84, i64 2
%88 = bitcast double* %87 to <2 x double>*
%89 = load <2 x double>, <2 x double>* %88
%90 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %86, <2 x double> <double 1.013250e+05, double 1.013250e+05>, <2 x double> %79)
%91 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %89, <2 x double> <double 1.013250e+05, double 1.013250e+05>, <2 x double> %82)
%92 = getelementptr inbounds double, double* %1, i64 %74
%93 = bitcast double* %92 to <2 x double>*
store <2 x double> %90, <2 x double>* %93
%94 = getelementptr inbounds double, double* %92, i64 2
%95 = bitcast double* %94 to <2 x double>*
store <2 x double> %91, <2 x double>* %95
br label %96
96: ; preds = %73, %76
%97 = icmp eq i64 %20, %2
br i1 %97, label %135, label %98
98: ; preds = %7, %5, %96
%99 = phi i64 [ 0, %7 ], [ 0, %5 ], [ %20, %96 ]
%100 = xor i64 %99, -1
%101 = and i64 %2, 1
%102 = icmp eq i64 %101, 0
br i1 %102, label %112, label %103
103: ; preds = %98
%104 = getelementptr inbounds double, double* %0, i64 %99
%105 = load double, double* %104
%106 = add nsw i64 %99, %2
%107 = getelementptr inbounds double, double* %0, i64 %106
%108 = load double, double* %107
%109 = tail call double @llvm.fmuladd.f64(double %108, double 1.013250e+05, double %105)
%110 = getelementptr inbounds double, double* %1, i64 %99
store double %109, double* %110
%111 = or i64 %99, 1
br label %112
112: ; preds = %103, %98
%113 = phi i64 [ %99, %98 ], [ %111, %103 ]
%114 = sub i64 0, %2
%115 = icmp eq i64 %100, %114
br i1 %115, label %135, label %116
116: ; preds = %112, %116
%117 = phi i64 [ %133, %116 ], [ %113, %112 ]
%118 = getelementptr inbounds double, double* %0, i64 %117
%119 = load double, double* %118
%120 = add nsw i64 %117, %2
%121 = getelementptr inbounds double, double* %0, i64 %120
%122 = load double, double* %121
%123 = tail call double @llvm.fmuladd.f64(double %122, double 1.013250e+05, double %119)
%124 = getelementptr inbounds double, double* %1, i64 %117
store double %123, double* %124
%125 = add nuw nsw i64 %117, 1
%126 = getelementptr inbounds double, double* %0, i64 %125
%127 = load double, double* %126
%128 = add nsw i64 %125, %2
%129 = getelementptr inbounds double, double* %0, i64 %128
%130 = load double, double* %129
%131 = tail call double @llvm.fmuladd.f64(double %130, double 1.013250e+05, double %127)
%132 = getelementptr inbounds double, double* %1, i64 %125
store double %131, double* %132
%133 = add nuw nsw i64 %117, 2
%134 = icmp eq i64 %133, %2
br i1 %134, label %135, label %116
135: ; preds = %112, %116, %96, %3
ret void
}