#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_daxpy(double *, double const *, double *, double,
                                int);
void _dmmat_trid_unb_lower(double *Bc, const double *Ac, double alpha, int unit,
                           int ldB, int ldA, int nRE, int nC) {
  register int i, j;
  register double *Bcl, *b0, *b1;
  register const double *Ar, *Acl;
  Acl = Ac + (nRE - 1) * ldA;
  Bcl = Bc + nRE - 1;
  for (i = nRE; i > 0; i--) {
    Ar = Acl + i - 1;
    b0 = Bcl;
    for (j = 0; j < nC; j++) {
      _inner_daxpy(b0 + 1, Ar + 1, b0, alpha, nRE - i);
      b0[0] = alpha * (unit ? b0[0] : b0[0] * Ar[0]);
      b0 += ldB;
    }
    Bcl--;
    Acl -= ldA;
  }
}


x86 assembly (clang, -O0):
<_dmmat_trid_unb_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%eax
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    %r9d,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x24(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jle    1277 <_dmmat_trid_unb_lower+0x167>
mov    -0x58(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x50(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    1243 <_dmmat_trid_unb_lower+0x133>
mov    -0x40(%rbp),%rdi
add    $0x8,%rdi
mov    -0x50(%rbp),%rsi
add    $0x8,%rsi
mov    -0x40(%rbp),%rdx
movsd  -0x18(%rbp),%xmm0
mov    -0x28(%rbp),%ecx
sub    -0x2c(%rbp),%ecx
call   1030 <_inner_daxpy@plt>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11f5 <_dmmat_trid_unb_lower+0xe5>
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    120a <_dmmat_trid_unb_lower+0xfa>
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x50(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x40(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    119f <_dmmat_trid_unb_lower+0x8f>
mov    -0x38(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x38(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    116f <_dmmat_trid_unb_lower+0x5f>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dmmat_trid_unb_lower>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9,0x10(%rsp)
test   %r9d,%r9d
jle    1230 <_dmmat_trid_unb_lower+0x120>
mov    %edx,%r15d
mov    0x10(%rsp),%rax
mov    %eax,%edx
add    $0xffffffff,%eax
imul   %r8d,%eax
cltq
lea    (%rsi,%rax,8),%rax
mov    %rax,(%rsp)
movslq %ecx,%r14
movslq %r8d,%rax
neg    %rax
mov    %rax,0x28(%rsp)
mov    %rdx,0x8(%rsp)
lea    (%rdi,%rdx,8),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,0x18(%rsp)
shl    $0x3,%r14
movsd  %xmm0,0x20(%rsp)
jmp    11af <_dmmat_trid_unb_lower+0x9f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rsp),%rax
mov    0x28(%rsp),%rcx
lea    (%rax,%rcx,8),%rax
mov    %rax,(%rsp)
mov    0x8(%rsp),%rcx
lea    -0x1(%rcx),%rax
addq   $0xfffffffffffffff8,0x18(%rsp)
cmp    $0x1,%rcx
mov    %rax,0x8(%rsp)
jle    1230 <_dmmat_trid_unb_lower+0x120>
cmpl   $0x0,0x70(%rsp)
jle    1180 <_dmmat_trid_unb_lower+0x70>
mov    0x8(%rsp),%rcx
mov    (%rsp),%rax
lea    (%rax,%rcx,8),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,0x30(%rsp)
lea    0x8(%rax),%r12
mov    0x10(%rsp),%rax
mov    %eax,%ebp
sub    %ecx,%ebp
mov    0x18(%rsp),%rbx
mov    0x70(%rsp),%r13d
jmp    120b <_dmmat_trid_unb_lower+0xfb>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  0x20(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
add    %r14,%rbx
add    $0xffffffff,%r13d
je     1180 <_dmmat_trid_unb_lower+0x70>
lea    0x8(%rbx),%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1030 <_inner_daxpy@plt>
movsd  (%rbx),%xmm1
test   %r15d,%r15d
jne    11f0 <_dmmat_trid_unb_lower+0xe0>
mov    0x30(%rsp),%rax
mulsd  (%rax),%xmm1
jmp    11f0 <_dmmat_trid_unb_lower+0xe0>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @_dmmat_trid_unb_lower(double* %0, double* %1, double %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca double*
%23 = alloca double*
store double* %0, double** %9
store double* %1, double** %10
store double %2, double* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%24 = load double*, double** %10
%25 = load i32, i32* %15
%26 = sub nsw i32 %25, 1
%27 = load i32, i32* %14
%28 = mul nsw i32 %26, %27
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %24, i64 %29
store double* %30, double** %23
%31 = load double*, double** %9
%32 = load i32, i32* %15
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = getelementptr inbounds double, double* %34, i64 -1
store double* %35, double** %19
%36 = load i32, i32* %15
store i32 %36, i32* %17
br label %37
37: ; preds = %97, %8
%38 = load i32, i32* %17
%39 = icmp sgt i32 %38, 0
br i1 %39, label %40, label %100
40: ; preds = %37
%41 = load double*, double** %23
%42 = load i32, i32* %17
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
%45 = getelementptr inbounds double, double* %44, i64 -1
store double* %45, double** %22
%46 = load double*, double** %19
store double* %46, double** %20
store i32 0, i32* %18
br label %47
47: ; preds = %86, %40
%48 = load i32, i32* %18
%49 = load i32, i32* %16
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %89
51: ; preds = %47
%52 = load double*, double** %20
%53 = getelementptr inbounds double, double* %52, i64 1
%54 = load double*, double** %22
%55 = getelementptr inbounds double, double* %54, i64 1
%56 = load double*, double** %20
%57 = load double, double* %11
%58 = load i32, i32* %15
%59 = load i32, i32* %17
%60 = sub nsw i32 %58, %59
%61 = call i32 @_inner_daxpy(double* %53, double* %55, double* %56, double %57, i32 %60)
%62 = load double, double* %11
%63 = load i32, i32* %12
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %69
65: ; preds = %51
%66 = load double*, double** %20
%67 = getelementptr inbounds double, double* %66, i64 0
%68 = load double, double* %67
br label %77
69: ; preds = %51
%70 = load double*, double** %20
%71 = getelementptr inbounds double, double* %70, i64 0
%72 = load double, double* %71
%73 = load double*, double** %22
%74 = getelementptr inbounds double, double* %73, i64 0
%75 = load double, double* %74
%76 = fmul double %72, %75
br label %77
77: ; preds = %69, %65
%78 = phi double [ %68, %65 ], [ %76, %69 ]
%79 = fmul double %62, %78
%80 = load double*, double** %20
%81 = getelementptr inbounds double, double* %80, i64 0
store double %79, double* %81
%82 = load i32, i32* %13
%83 = load double*, double** %20
%84 = sext i32 %82 to i64
%85 = getelementptr inbounds double, double* %83, i64 %84
store double* %85, double** %20
br label %86
86: ; preds = %77
%87 = load i32, i32* %18
%88 = add nsw i32 %87, 1
store i32 %88, i32* %18
br label %47
89: ; preds = %47
%90 = load double*, double** %19
%91 = getelementptr inbounds double, double* %90, i32 -1
store double* %91, double** %19
%92 = load i32, i32* %14
%93 = load double*, double** %23
%94 = sext i32 %92 to i64
%95 = sub i64 0, %94
%96 = getelementptr inbounds double, double* %93, i64 %95
store double* %96, double** %23
br label %97
97: ; preds = %89
%98 = load i32, i32* %17
%99 = add nsw i32 %98, -1
store i32 %99, i32* %17
br label %37
100: ; preds = %37
ret void
}

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