#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ _inner_vec2_daxpy(double *, int, double const *,
                                     double const *, double const *, int,
                                     double, int);
int /*<<< orphan*/ _inner_vec_daxpy(double *, int, double const *,
                                    double const *, int, double, int);
void _dmvec_daxpy(double *Yc, const double *Aroot, const double *Xc,
                  double alpha, int incY, int ldA, int incX, int nRE, int nC) {
  register int j, k;
  register const double *a0, *a1, *a2, *a3;
  const double *Ac;
  Ac = Aroot;
  for (j = 0; j < nC - 3; j += 4) {
    a0 = Ac;
    a1 = a0 + ldA;
    a2 = a1 + ldA;
    a3 = a2 + ldA;
    _inner_vec2_daxpy(Yc, incY, a0, a1, Xc, incX, alpha, nRE);
    Xc += 2 * incX;
    _inner_vec2_daxpy(Yc, incY, a2, a3, Xc, incX, alpha, nRE);
    Xc += 2 * incX;
    Ac += 4 * ldA;
  }
  if (j == nC)
    return;
  if (j < nC - 1) {
    a0 = Ac;
    a1 = a0 + ldA;
    _inner_vec2_daxpy(Yc, incY, a0, a1, Xc, incX, alpha, nRE);
    Xc += 2 * incX;
    Ac += 2 * ldA;
    j += 2;
  }
  if (j < nC) {
    a0 = Ac;
    _inner_vec_daxpy(Yc, incY, a0, Xc, incX, alpha, nRE);
    Xc += incX;
    Ac += ldA;
    j++;
  }
}


x86 assembly (clang, -O0):
<_dmvec_daxpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    0x18(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    124f <_dmvec_daxpy+0x12f>
mov    -0x60(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x2c(%rbp),%r9d
movsd  -0x20(%rbp),%xmm0
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <_inner_vec2_daxpy@plt>
mov    -0x2c(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x2c(%rbp),%r9d
movsd  -0x20(%rbp),%xmm0
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <_inner_vec2_daxpy@plt>
mov    -0x2c(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x60(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x30(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x30(%rbp)
jmp    1159 <_dmvec_daxpy+0x39>
mov    -0x30(%rbp),%eax
cmp    0x18(%rbp),%eax
jne    1260 <_dmvec_daxpy+0x140>
jmp    1354 <_dmvec_daxpy+0x234>
mov    -0x30(%rbp),%eax
mov    0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12ec <_dmvec_daxpy+0x1cc>
mov    -0x60(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x2c(%rbp),%r9d
movsd  -0x20(%rbp),%xmm0
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <_inner_vec2_daxpy@plt>
mov    -0x2c(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x60(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x30(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    1354 <_dmvec_daxpy+0x234>
mov    -0x60(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x40(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
movsd  -0x20(%rbp),%xmm0
mov    0x10(%rbp),%r9d
call   1040 <_inner_vec_daxpy@plt>
mov    -0x2c(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%ecx
mov    -0x60(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dmvec_daxpy>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rdx,%rbp
mov    %rsi,%r12
mov    %rdi,%r14
mov    0xc8(%rsp),%eax
mov    0xc0(%rsp),%r13d
xor    %ebx,%ebx
cmp    $0x4,%eax
mov    %rax,0x38(%rsp)
mov    %r8d,0x30(%rsp)
mov    %r9,0x40(%rsp)
mov    %r13d,0x14(%rsp)
mov    %ecx,0x24(%rsp)
jl     127a <_dmvec_daxpy+0x15a>
add    $0xfffffffd,%eax
mov    %eax,0x34(%rsp)
movslq %r8d,%rdx
lea    (%r9,%r9,1),%eax
movslq %eax,%rsi
lea    0x0(,%rdx,4),%eax
cltq
lea    0x0(,%rdx,8),%r8
shl    $0x3,%rax
mov    %rax,0x60(%rsp)
mov    %r8,0x58(%rsp)
lea    (%r8,%r8,2),%rax
mov    %rax,0x50(%rsp)
shl    $0x4,%rdx
mov    %rdx,0x70(%rsp)
mov    %rsi,%rax
shl    $0x4,%rax
mov    %rax,0x48(%rsp)
shl    $0x3,%rsi
mov    %rsi,0x68(%rsp)
xor    %ebx,%ebx
movsd  %xmm0,0x18(%rsp)
mov    0x24(%rsp),%r13d
mov    0x40(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,0x28(%rsp)
mov    0x58(%rsp),%rax
lea    (%r12,%rax,1),%rcx
mov    0x70(%rsp),%rax
add    %r12,%rax
mov    %rax,0x80(%rsp)
mov    0x50(%rsp),%rax
lea    (%r12,%rax,1),%rax
mov    %rax,0x78(%rsp)
mov    0x14(%rsp),%ebx
mov    %ebx,(%rsp)
mov    %r14,%rdi
mov    %r13d,%esi
mov    %r12,%rdx
mov    %rbp,%r8
mov    %r15d,%r9d
movsd  0x18(%rsp),%xmm0
call   1030 <_inner_vec2_daxpy@plt>
mov    0x68(%rsp),%rax
lea    (%rax,%rbp,1),%r8
mov    %ebx,(%rsp)
mov    0x28(%rsp),%ebx
mov    %r14,%rdi
mov    %r13d,%esi
mov    0x80(%rsp),%rdx
mov    0x78(%rsp),%rcx
mov    %r15d,%r9d
movsd  0x18(%rsp),%xmm0
call   1030 <_inner_vec2_daxpy@plt>
movsd  0x18(%rsp),%xmm0
add    $0x4,%ebx
add    0x60(%rsp),%r12
add    0x48(%rsp),%rbp
cmp    0x34(%rsp),%ebx
jl     11e0 <_dmvec_daxpy+0xc0>
mov    0x38(%rsp),%rdx
cmp    %edx,%ebx
mov    0x40(%rsp),%r10
mov    0x24(%rsp),%esi
mov    0x14(%rsp),%r9d
je     1333 <_dmvec_daxpy+0x213>
lea    -0x1(%rdx),%eax
cmp    %eax,%ebx
jge    130d <_dmvec_daxpy+0x1ed>
mov    0x30(%rsp),%r15d
movslq %r15d,%rax
lea    (%r12,%rax,8),%rcx
mov    %r9d,(%rsp)
mov    %r14,%r13
mov    %r14,%rdi
mov    %esi,%r14d
mov    %r12,%rdx
mov    %rbp,%r8
mov    %r10d,%r9d
movsd  %xmm0,0x18(%rsp)
movsd  0x18(%rsp),%xmm0
mov    %rbp,0x28(%rsp)
mov    %r10,%rbp
call   1030 <_inner_vec2_daxpy@plt>
mov    %rbp,%r10
mov    %r14d,%esi
mov    0x28(%rsp),%rbp
mov    0x14(%rsp),%r9d
mov    0x38(%rsp),%rdx
mov    %r13,%r14
movsd  0x18(%rsp),%xmm0
lea    (%r10,%r10,1),%eax
cltq
lea    0x0(%rbp,%rax,8),%rbp
add    %r15d,%r15d
movslq %r15d,%rax
lea    (%r12,%rax,8),%r12
or     $0x2,%ebx
cmp    %edx,%ebx
jge    1333 <_dmvec_daxpy+0x213>
mov    %r14,%rdi
mov    %r12,%rdx
mov    %rbp,%rcx
mov    %r10d,%r8d
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <_inner_vec_daxpy@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @_dmvec_daxpy(double* %0, double* %1, double* %2, double %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca double*
%22 = alloca double*
%23 = alloca double*
%24 = alloca double*
%25 = alloca double*
store double* %0, double** %10
store double* %1, double** %11
store double* %2, double** %12
store double %3, double* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%26 = load double*, double** %11
store double* %26, double** %25
store i32 0, i32* %19
br label %27
27: ; preds = %79, %9
%28 = load i32, i32* %19
%29 = load i32, i32* %18
%30 = sub nsw i32 %29, 3
%31 = icmp slt i32 %28, %30
br i1 %31, label %32, label %82
32: ; preds = %27
%33 = load double*, double** %25
store double* %33, double** %21
%34 = load double*, double** %21
%35 = load i32, i32* %15
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %34, i64 %36
store double* %37, double** %22
%38 = load double*, double** %22
%39 = load i32, i32* %15
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %38, i64 %40
store double* %41, double** %23
%42 = load double*, double** %23
%43 = load i32, i32* %15
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %42, i64 %44
store double* %45, double** %24
%46 = load double*, double** %10
%47 = load i32, i32* %14
%48 = load double*, double** %21
%49 = load double*, double** %22
%50 = load double*, double** %12
%51 = load i32, i32* %16
%52 = load double, double* %13
%53 = load i32, i32* %17
%54 = call i32 @_inner_vec2_daxpy(double* %46, i32 %47, double* %48, double* %49, double* %50, i32 %51, double %52, i32 %53)
%55 = load i32, i32* %16
%56 = mul nsw i32 2, %55
%57 = load double*, double** %12
%58 = sext i32 %56 to i64
%59 = getelementptr inbounds double, double* %57, i64 %58
store double* %59, double** %12
%60 = load double*, double** %10
%61 = load i32, i32* %14
%62 = load double*, double** %23
%63 = load double*, double** %24
%64 = load double*, double** %12
%65 = load i32, i32* %16
%66 = load double, double* %13
%67 = load i32, i32* %17
%68 = call i32 @_inner_vec2_daxpy(double* %60, i32 %61, double* %62, double* %63, double* %64, i32 %65, double %66, i32 %67)
%69 = load i32, i32* %16
%70 = mul nsw i32 2, %69
%71 = load double*, double** %12
%72 = sext i32 %70 to i64
%73 = getelementptr inbounds double, double* %71, i64 %72
store double* %73, double** %12
%74 = load i32, i32* %15
%75 = mul nsw i32 4, %74
%76 = load double*, double** %25
%77 = sext i32 %75 to i64
%78 = getelementptr inbounds double, double* %76, i64 %77
store double* %78, double** %25
br label %79
79: ; preds = %32
%80 = load i32, i32* %19
%81 = add nsw i32 %80, 4
store i32 %81, i32* %19
br label %27
82: ; preds = %27
%83 = load i32, i32* %19
%84 = load i32, i32* %18
%85 = icmp eq i32 %83, %84
br i1 %85, label %86, label %87
86: ; preds = %82
br label %143
87: ; preds = %82
%88 = load i32, i32* %19
%89 = load i32, i32* %18
%90 = sub nsw i32 %89, 1
%91 = icmp slt i32 %88, %90
br i1 %91, label %92, label %119
92: ; preds = %87
%93 = load double*, double** %25
store double* %93, double** %21
%94 = load double*, double** %21
%95 = load i32, i32* %15
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %94, i64 %96
store double* %97, double** %22
%98 = load double*, double** %10
%99 = load i32, i32* %14
%100 = load double*, double** %21
%101 = load double*, double** %22
%102 = load double*, double** %12
%103 = load i32, i32* %16
%104 = load double, double* %13
%105 = load i32, i32* %17
%106 = call i32 @_inner_vec2_daxpy(double* %98, i32 %99, double* %100, double* %101, double* %102, i32 %103, double %104, i32 %105)
%107 = load i32, i32* %16
%108 = mul nsw i32 2, %107
%109 = load double*, double** %12
%110 = sext i32 %108 to i64
%111 = getelementptr inbounds double, double* %109, i64 %110
store double* %111, double** %12
%112 = load i32, i32* %15
%113 = mul nsw i32 2, %112
%114 = load double*, double** %25
%115 = sext i32 %113 to i64
%116 = getelementptr inbounds double, double* %114, i64 %115
store double* %116, double** %25
%117 = load i32, i32* %19
%118 = add nsw i32 %117, 2
store i32 %118, i32* %19
br label %119
119: ; preds = %92, %87
%120 = load i32, i32* %19
%121 = load i32, i32* %18
%122 = icmp slt i32 %120, %121
br i1 %122, label %123, label %143
123: ; preds = %119
%124 = load double*, double** %25
store double* %124, double** %21
%125 = load double*, double** %10
%126 = load i32, i32* %14
%127 = load double*, double** %21
%128 = load double*, double** %12
%129 = load i32, i32* %16
%130 = load double, double* %13
%131 = load i32, i32* %17
%132 = call i32 @_inner_vec_daxpy(double* %125, i32 %126, double* %127, double* %128, i32 %129, double %130, i32 %131)
%133 = load i32, i32* %16
%134 = load double*, double** %12
%135 = sext i32 %133 to i64
%136 = getelementptr inbounds double, double* %134, i64 %135
store double* %136, double** %12
%137 = load i32, i32* %15
%138 = load double*, double** %25
%139 = sext i32 %137 to i64
%140 = getelementptr inbounds double, double* %138, i64 %139
store double* %140, double** %25
%141 = load i32, i32* %19
%142 = add nsw i32 %141, 1
store i32 %142, i32* %19
br label %143
143: ; preds = %86, %123, %119
ret void
}

LLVM IR (-O2):
define void @_dmvec_daxpy(double* %0, double* %1, double* %2, double %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = add nsw i32 %8, -3
%11 = icmp sgt i32 %8, 3
br i1 %11, label %12, label %32
12: ; preds = %9
%13 = sext i32 %5 to i64
%14 = shl nsw i32 %6, 1
%15 = sext i32 %14 to i64
%16 = shl nsw i32 %5, 2
%17 = sext i32 %16 to i64
br label %18
18: ; preds = %12, %18
%19 = phi double* [ %1, %12 ], [ %29, %18 ]
%20 = phi double* [ %2, %12 ], [ %28, %18 ]
%21 = phi i32 [ 0, %12 ], [ %30, %18 ]
%22 = getelementptr inbounds double, double* %19, i64 %13
%23 = getelementptr inbounds double, double* %22, i64 %13
%24 = getelementptr inbounds double, double* %23, i64 %13
%25 = tail call i32 @_inner_vec2_daxpy(double* %0, i32 %4, double* %19, double* %22, double* %20, i32 %6, double %3, i32 %7)
%26 = getelementptr inbounds double, double* %20, i64 %15
%27 = tail call i32 @_inner_vec2_daxpy(double* %0, i32 %4, double* %23, double* %24, double* %26, i32 %6, double %3, i32 %7)
%28 = getelementptr inbounds double, double* %26, i64 %15
%29 = getelementptr inbounds double, double* %19, i64 %17
%30 = add nuw nsw i32 %21, 4
%31 = icmp slt i32 %30, %10
br i1 %31, label %18, label %32
32: ; preds = %18, %9
%33 = phi i32 [ 0, %9 ], [ %30, %18 ]
%34 = phi double* [ %2, %9 ], [ %28, %18 ]
%35 = phi double* [ %1, %9 ], [ %29, %18 ]
%36 = icmp eq i32 %33, %8
br i1 %36, label %58, label %37
37: ; preds = %32
%38 = add nsw i32 %8, -1
%39 = icmp slt i32 %33, %38
br i1 %39, label %40, label %51
40: ; preds = %37
%41 = sext i32 %5 to i64
%42 = getelementptr inbounds double, double* %35, i64 %41
%43 = tail call i32 @_inner_vec2_daxpy(double* %0, i32 %4, double* %35, double* %42, double* %34, i32 %6, double %3, i32 %7)
%44 = shl nsw i32 %6, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %34, i64 %45
%47 = shl nsw i32 %5, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %35, i64 %48
%50 = or i32 %33, 2
br label %51
51: ; preds = %40, %37
%52 = phi i32 [ %50, %40 ], [ %33, %37 ]
%53 = phi double* [ %46, %40 ], [ %34, %37 ]
%54 = phi double* [ %49, %40 ], [ %35, %37 ]
%55 = icmp slt i32 %52, %8
br i1 %55, label %56, label %58
56: ; preds = %51
%57 = tail call i32 @_inner_vec_daxpy(double* %0, i32 %4, double* %54, double* %53, i32 %6, double %3, i32 %7)
br label %58
58: ; preds = %51, %56, %32
ret void
}