void pencil_daxpy_nn(int n_137_345, double alpha_138_346, int incX_139_347,
                     double X_140_348[restrict const n_137_345][incX_139_347],
                     int incY_141_349,
                     double Y_142_350[restrict const n_137_345][incY_141_349]) {
#pragma scop
  {
#pragma pencil independent
    for (int i_123_110_631_1076 = 0; i_123_110_631_1076 <= (n_137_345 - 1);
         i_123_110_631_1076 += 1) {
      Y_142_350[i_123_110_631_1076][0] =
          (Y_142_350[i_123_110_631_1076][0] +
           (alpha_138_346 * X_140_348[i_123_110_631_1076][0]));
    }
  }
#pragma endscop
}


x86 assembly (clang, -O0):
<pencil_daxpy_nn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x48(%rbp)
mov    -0x24(%rbp),%eax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1196 <pencil_daxpy_nn+0x96>
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rsi
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
imul   %rdx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
imul   %rsi,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
imul   %rdx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    112f <pencil_daxpy_nn+0x2f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pencil_daxpy_nn>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edi,%edi
jle    1301 <pencil_daxpy_nn+0x201>
mov    %esi,%r9d
mov    %ecx,%r10d
mov    %edi,%eax
xor    %r14d,%r14d
cmp    $0x4,%edi
jae    11cb <pencil_daxpy_nn+0xcb>
mov    %r14,%rcx
not    %rcx
test   $0x1,%al
je     1157 <pencil_daxpy_nn+0x57>
mov    %r14,%rsi
imul   %r10,%rsi
mov    %r14,%rdi
imul   %r9,%rdi
movsd  (%rdx,%rdi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r8,%rsi,8),%xmm1
movsd  %xmm1,(%r8,%rsi,8)
or     $0x1,%r14
add    %rax,%rcx
je     1301 <pencil_daxpy_nn+0x201>
sub    %r14,%rax
mov    %r14,%rcx
imul   %r9,%rcx
mov    %r14,%rsi
imul   %r10,%rsi
add    $0x1,%r14
mov    %r14,%rdi
imul   %r9,%rdi
shl    $0x4,%r9
imul   %r10,%r14
shl    $0x4,%r10
nopl   0x0(%rax,%rax,1)
movsd  (%rdx,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r8,%rsi,8),%xmm1
movsd  %xmm1,(%r8,%rsi,8)
movsd  (%rdx,%rdi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r8,%r14,8),%xmm1
movsd  %xmm1,(%r8,%r14,8)
add    %r9,%rdx
add    %r10,%r8
add    $0xfffffffffffffffe,%rax
jne    1190 <pencil_daxpy_nn+0x90>
jmp    1301 <pencil_daxpy_nn+0x201>
cmp    $0x1,%ecx
jne    1126 <pencil_daxpy_nn+0x26>
cmp    $0x1,%esi
jne    1126 <pencil_daxpy_nn+0x26>
mov    %eax,%r14d
and    $0xfffffffc,%r14d
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%r14),%rcx
mov    %rcx,%r11
shr    $0x2,%r11
add    $0x1,%r11
test   %rcx,%rcx
je     130c <pencil_daxpy_nn+0x20c>
mov    %r11,%rcx
and    $0xfffffffffffffffe,%rcx
mov    %r10,%r13
shl    $0x5,%r13
lea    0x10(%r8),%rdi
mov    %r10,%r15
shl    $0x6,%r15
mov    %r9,%r12
shl    $0x5,%r12
lea    0x10(%rdx),%rbx
mov    %r9,%rbp
shl    $0x6,%rbp
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movupd -0x10(%rdi),%xmm2
movupd (%rdi),%xmm3
movupd -0x10(%rbx),%xmm4
movupd (%rbx),%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm3,%xmm5
movupd %xmm4,-0x10(%rdi)
movupd %xmm5,(%rdi)
movupd -0x10(%rdi,%r13,1),%xmm2
movupd (%rdi,%r13,1),%xmm3
movupd -0x10(%rbx,%r12,1),%xmm4
movupd (%rbx,%r12,1),%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm3,%xmm5
movupd %xmm4,-0x10(%rdi,%r13,1)
movupd %xmm5,(%rdi,%r13,1)
add    $0x8,%rsi
add    %r15,%rdi
add    %rbp,%rbx
add    $0xfffffffffffffffe,%rcx
jne    1240 <pencil_daxpy_nn+0x140>
test   $0x1,%r11b
je     12f8 <pencil_daxpy_nn+0x1f8>
mov    %rsi,%rcx
imul   %r10,%rcx
movupd (%r8,%rcx,8),%xmm2
movupd 0x10(%r8,%rcx,8),%xmm3
imul   %r9,%rsi
movupd (%rdx,%rsi,8),%xmm4
movupd 0x10(%rdx,%rsi,8),%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm3,%xmm5
movupd %xmm4,(%r8,%rcx,8)
movupd %xmm5,0x10(%r8,%rcx,8)
cmp    %rax,%r14
jne    1126 <pencil_daxpy_nn+0x26>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %esi,%esi
test   $0x1,%r11b
jne    12b8 <pencil_daxpy_nn+0x1b8>
jmp    12f8 <pencil_daxpy_nn+0x1f8>

LLVM IR (-O0):
define void @pencil_daxpy_nn(i32 %0, double %1, i32 %2, double* noalias %3, i32 %4, double* noalias %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca double*
%11 = alloca i32
%12 = alloca double*
%13 = alloca i32
store i32 %0, i32* %7
store double %1, double* %8
store i32 %2, i32* %9
store double* %3, double** %10
store i32 %4, i32* %11
store double* %5, double** %12
%14 = load i32, i32* %7
%15 = zext i32 %14 to i64
%16 = load i32, i32* %9
%17 = zext i32 %16 to i64
%18 = load i32, i32* %7
%19 = zext i32 %18 to i64
%20 = load i32, i32* %11
%21 = zext i32 %20 to i64
store i32 0, i32* %13
br label %22
22: ; preds = %50, %6
%23 = load i32, i32* %13
%24 = load i32, i32* %7
%25 = sub nsw i32 %24, 1
%26 = icmp sle i32 %23, %25
br i1 %26, label %27, label %53
27: ; preds = %22
%28 = load double*, double** %12
%29 = load i32, i32* %13
%30 = sext i32 %29 to i64
%31 = mul nsw i64 %30, %21
%32 = getelementptr inbounds double, double* %28, i64 %31
%33 = getelementptr inbounds double, double* %32, i64 0
%34 = load double, double* %33
%35 = load double, double* %8
%36 = load double*, double** %10
%37 = load i32, i32* %13
%38 = sext i32 %37 to i64
%39 = mul nsw i64 %38, %17
%40 = getelementptr inbounds double, double* %36, i64 %39
%41 = getelementptr inbounds double, double* %40, i64 0
%42 = load double, double* %41
%43 = call double @llvm.fmuladd.f64(double %35, double %42, double %34)
%44 = load double*, double** %12
%45 = load i32, i32* %13
%46 = sext i32 %45 to i64
%47 = mul nsw i64 %46, %21
%48 = getelementptr inbounds double, double* %44, i64 %47
%49 = getelementptr inbounds double, double* %48, i64 0
store double %43, double* %49
br label %50
50: ; preds = %27
%51 = load i32, i32* %13
%52 = add nsw i32 %51, 1
store i32 %52, i32* %13
br label %22
53: ; preds = %22
ret void
}

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