#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_ddot_sse(double *, int, double const *,
                                        double const *, double const *, double,
                                        int, int);
int /*<<< orphan*/ _inner_vec_ddot_sse(double *, int, double const *,
                                       double const *, double, int, int);
void _dmvec_ddot_sse(double *Yc, const double *Aroot, const double *Xc,
                     double alpha, int incY, int ldA, int incX, int nRE, int nC,
                     int oddstart) {
  register int j, k;
  register double *y0;
  register const double *x0, *a0, *a1, *a2, *a3;
  const double *Ac;
  Ac = Aroot;
  x0 = Xc;
  for (j = 0; j < nRE - 3; j += 4) {
    y0 = Yc;
    a0 = Ac;
    a1 = a0 + ldA;
    a2 = a1 + ldA;
    a3 = a2 + ldA;
    _inner_vec2_ddot_sse(y0, incY, a0, a1, Xc, alpha, nC, oddstart);
    y0 += 2 * incY;
    _inner_vec2_ddot_sse(y0, incY, a2, a3, Xc, alpha, nC, oddstart);
    Ac += 4 * ldA;
    Yc += 4 * incY;
  }
  if (j == nRE)
    return;
  if (j < nRE - 1) {
    y0 = Yc;
    a0 = Ac;
    a1 = a0 + ldA;
    _inner_vec2_ddot_sse(y0, incY, a0, a1, Xc, alpha, nC, oddstart);
    y0 += incY;
    Yc += 2 * incY;
    Ac += 2 * ldA;
    j += 2;
  }
  if (j < nRE) {
    y0 = Yc;
    a0 = Ac;
    _inner_vec_ddot_sse(y0, incY, a0, Xc, alpha, nC, oddstart);
    Yc += incY;
    Ac += ldA;
    j++;
  }
}


x86 assembly (clang, -O0):
<_dmvec_ddot_sse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x20(%rbp),%eax
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,-0x70(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    0x10(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jge    1265 <_dmvec_ddot_sse+0x145>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x18(%rbp),%r8
movsd  -0x20(%rbp),%xmm0
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <_inner_vec2_ddot_sse@plt>
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x40(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x60(%rbp),%rdx
mov    -0x68(%rbp),%rcx
mov    -0x18(%rbp),%r8
movsd  -0x20(%rbp),%xmm0
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <_inner_vec2_ddot_sse@plt>
mov    -0x28(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x70(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x24(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x30(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x30(%rbp)
jmp    1167 <_dmvec_ddot_sse+0x47>
mov    -0x30(%rbp),%eax
cmp    0x10(%rbp),%eax
jne    1276 <_dmvec_ddot_sse+0x156>
jmp    138f <_dmvec_ddot_sse+0x26f>
mov    -0x30(%rbp),%eax
mov    0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    131f <_dmvec_ddot_sse+0x1ff>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x18(%rbp),%r8
movsd  -0x20(%rbp),%xmm0
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <_inner_vec2_ddot_sse@plt>
mov    -0x24(%rbp),%ecx
mov    -0x40(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x28(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x70(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x30(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    138f <_dmvec_ddot_sse+0x26f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x50(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movsd  -0x20(%rbp),%xmm0
mov    0x18(%rbp),%r8d
mov    0x20(%rbp),%r9d
call   1040 <_inner_vec_ddot_sse@plt>
mov    -0x24(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x28(%rbp),%ecx
mov    -0x70(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dmvec_ddot_sse>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r12
mov    0xc0(%rsp),%r10d
mov    0xb8(%rsp),%r15d
mov    0xb0(%rsp),%eax
xor    %ebp,%ebp
cmp    $0x4,%eax
mov    %rcx,0x18(%rsp)
mov    %rax,0x28(%rsp)
mov    %r8d,0x20(%rsp)
mov    %r10d,0xc(%rsp)
jl     127a <_dmvec_ddot_sse+0x15a>
add    $0xfffffffd,%eax
mov    %eax,0x24(%rsp)
movslq %r8d,%rsi
lea    (%rcx,%rcx,1),%eax
movslq %eax,%r8
lea    0x0(,%rsi,4),%eax
movslq %eax,%rdx
lea    0x0(,%rcx,4),%eax
cltq
lea    0x0(,%rsi,8),%rdi
shl    $0x3,%rdx
mov    %rdx,0x50(%rsp)
mov    %rdi,0x40(%rsp)
lea    (%rdi,%rdi,2),%rdx
mov    %rdx,0x38(%rsp)
shl    $0x4,%rsi
mov    %rsi,0x60(%rsp)
shl    $0x3,%rax
mov    %rax,0x48(%rsp)
shl    $0x3,%r8
mov    %r8,0x58(%rsp)
xor    %ebp,%ebp
movsd  %xmm0,0x10(%rsp)
mov    %r14,0x30(%rsp)
mov    0xc(%rsp),%r13d
nopl   0x0(%rax)
mov    0x40(%rsp),%rax
lea    (%rbx,%rax,1),%rcx
mov    0x60(%rsp),%rax
add    %rbx,%rax
mov    %rax,0x70(%rsp)
mov    0x38(%rsp),%rax
lea    (%rbx,%rax,1),%rax
mov    %rax,0x68(%rsp)
mov    %r13d,(%rsp)
mov    %r12,%rdi
mov    %rbx,%r14
mov    0x18(%rsp),%rbx
mov    %ebx,%esi
mov    %r14,%rdx
mov    0x30(%rsp),%r8
movsd  0x10(%rsp),%xmm0
mov    %r15d,%r9d
call   1030 <_inner_vec2_ddot_sse@plt>
mov    0x58(%rsp),%rax
lea    (%r12,%rax,1),%rdi
mov    %r13d,(%rsp)
mov    %ebx,%esi
mov    %r14,%rbx
mov    0x70(%rsp),%rdx
mov    0x30(%rsp),%r14
mov    0x68(%rsp),%rcx
mov    %r14,%r8
movsd  0x10(%rsp),%xmm0
mov    %r15d,%r9d
call   1030 <_inner_vec2_ddot_sse@plt>
movsd  0x10(%rsp),%xmm0
add    $0x4,%ebp
add    0x50(%rsp),%rbx
add    0x48(%rsp),%r12
cmp    0x24(%rsp),%ebp
jl     11e0 <_dmvec_ddot_sse+0xc0>
mov    0x28(%rsp),%rdx
cmp    %edx,%ebp
mov    0xc(%rsp),%r9d
je     1317 <_dmvec_ddot_sse+0x1f7>
lea    -0x1(%rdx),%eax
cmp    %eax,%ebp
jge    12ef <_dmvec_ddot_sse+0x1cf>
mov    0x20(%rsp),%r13d
movslq %r13d,%rax
lea    (%rbx,%rax,8),%rcx
mov    %r9d,(%rsp)
mov    %r12,%rdi
mov    0x18(%rsp),%rsi
mov    %rbx,%rdx
mov    %r14,%r8
movsd  %xmm0,0x10(%rsp)
movsd  0x10(%rsp),%xmm0
mov    %r15d,%r9d
call   1030 <_inner_vec2_ddot_sse@plt>
mov    0xc(%rsp),%r9d
mov    0x28(%rsp),%rdx
movsd  0x10(%rsp),%xmm0
mov    0x18(%rsp),%rax
add    %eax,%eax
cltq
lea    (%r12,%rax,8),%r12
add    %r13d,%r13d
movslq %r13d,%rax
lea    (%rbx,%rax,8),%rbx
or     $0x2,%ebp
cmp    %edx,%ebp
jge    1317 <_dmvec_ddot_sse+0x1f7>
mov    %r12,%rdi
mov    0x18(%rsp),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r15d,%r8d
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <_inner_vec_ddot_sse@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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