#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_vec_daxpy(double *, int, double const *, double *,
                                    int, double, int);
void _dmvec_trid_axpy_forward(double *Xc, const double *Ac, double unit,
                              int incX, int ldA, int nRE) {
  register int i;
  register double *X0, *x1;
  register const double *a11;
  X0 = Xc;
  x1 = Xc;
  for (i = 0; i < nRE; i++) {
    _inner_vec_daxpy(X0, incX, Ac, x1, incX, 1.0, i);
    a11 = Ac + i;
    x1[0] *= unit ? 1.0 : a11[0];
    x1 += incX;
    Ac += ldA;
  }
}


x86 assembly (clang, -O0):
<_dmvec_trid_axpy_forward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    120e <_dmvec_trid_axpy_forward+0xfe>
mov    -0x30(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9d
movsd  0xe8f(%rip),%xmm0
call   1030 <_inner_vec_daxpy@plt>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11a6 <_dmvec_trid_axpy_forward+0x96>
jp     11a6 <_dmvec_trid_axpy_forward+0x96>
jmp    11b8 <_dmvec_trid_axpy_forward+0xa8>
movsd  0xe52(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    11c5 <_dmvec_trid_axpy_forward+0xb5>
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    -0x38(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1146 <_dmvec_trid_axpy_forward+0x36>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dmvec_trid_axpy_forward>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movsd  %xmm0,0x20(%rsp)
mov    %rdi,(%rsp)
test   %r8d,%r8d
jle    11d2 <_dmvec_trid_axpy_forward+0xc2>
mov    %edx,%r15d
mov    %rsi,%r13
movslq %edx,%r14
movslq %ecx,%rax
mov    %r8d,%ecx
mov    %rcx,0x10(%rsp)
lea    0x8(,%rax,8),%rcx
mov    %rcx,0x8(%rsp)
shl    $0x3,%rax
mov    %rax,0x18(%rsp)
shl    $0x3,%r14
xor    %ebp,%ebp
mov    (%rsp),%rbx
mov    %rsi,%r12
jmp    1190 <_dmvec_trid_axpy_forward+0x80>
nopw   0x0(%rax,%rax,1)
mulsd  (%rbx),%xmm0
movsd  %xmm0,(%rbx)
add    $0x1,%rbp
add    0x8(%rsp),%r12
add    0x18(%rsp),%r13
add    %r14,%rbx
cmp    %rbp,0x10(%rsp)
je     11d2 <_dmvec_trid_axpy_forward+0xc2>
mov    (%rsp),%rdi
mov    %r15d,%esi
mov    %r13,%rdx
mov    %rbx,%rcx
mov    %r15d,%r8d
movsd  0xe58(%rip),%xmm0
mov    %ebp,%r9d
call   1030 <_inner_vec_daxpy@plt>
movsd  0x20(%rsp),%xmm0
ucomisd 0xe4a(%rip),%xmm0
movsd  0xe3a(%rip),%xmm0
jne    1170 <_dmvec_trid_axpy_forward+0x60>
jp     1170 <_dmvec_trid_axpy_forward+0x60>
movsd  (%r12),%xmm0
jmp    1170 <_dmvec_trid_axpy_forward+0x60>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @_dmvec_trid_axpy_forward(double* %0, double* %1, double %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp sgt i32 %5, 0
br i1 %7, label %8, label %30
8: ; preds = %6
%9 = fcmp une double %2, 0.000000e+00
%10 = sext i32 %3 to i64
%11 = sext i32 %4 to i64
%12 = zext i32 %5 to i64
br label %13
13: ; preds = %8, %22
%14 = phi i64 [ 0, %8 ], [ %28, %22 ]
%15 = phi double* [ %1, %8 ], [ %27, %22 ]
%16 = phi double* [ %0, %8 ], [ %26, %22 ]
%17 = trunc i64 %14 to i32
%18 = tail call i32 @_inner_vec_daxpy(double* %0, i32 %3, double* %15, double* %16, i32 %3, double 1.000000e+00, i32 %17)
br i1 %9, label %22, label %19
19: ; preds = %13
%20 = getelementptr inbounds double, double* %15, i64 %14
%21 = load double, double* %20
br label %22
22: ; preds = %13, %19
%23 = phi double [ %21, %19 ], [ 1.000000e+00, %13 ]
%24 = load double, double* %16
%25 = fmul double %23, %24
store double %25, double* %16
%26 = getelementptr inbounds double, double* %16, i64 %10
%27 = getelementptr inbounds double, double* %15, i64 %11
%28 = add nuw nsw i64 %14, 1
%29 = icmp eq i64 %28, %12
br i1 %29, label %30, label %13
30: ; preds = %22, %6
ret void
}