#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_ddot_trans(double *, double const *, double *, double,
                                     int, int);
void _dmmat_trid_unb_r_lower(double *Bc, const double *Ac, double alpha,
                             int unit, int ldB, int ldA, int nRE, int nC) {
  register int i, j;
  register double *b0, *Br, *Bcl;
  register const double *Ar, *Acl;
  double btmp;
  Acl = Ac;
  Bcl = Bc;
  for (j = nC; j > 0; j--) {
    Br = Bcl;
    b0 = Bcl;
    for (i = 0; i < nRE; i++) {
      Ar = Acl + nC - j;
      btmp = 0.0;
      _inner_ddot_trans(&btmp, Ar + unit, Br + unit * ldB, alpha, j - unit,
                        ldB);
      b0[0] = unit ? btmp + alpha * b0[0] : btmp;
      b0++;
      Br++;
    }
    Bcl += ldB;
    Acl += ldA;
  }
}


x86 assembly (clang, -O0):
<_dmmat_trid_unb_r_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    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    0x10(%rbp),%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jle    1282 <_dmmat_trid_unb_r_lower+0x172>
mov    -0x48(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    124a <_dmmat_trid_unb_r_lower+0x13a>
mov    -0x58(%rbp),%rax
movslq 0x10(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x30(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x50(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x40(%rbp),%rdx
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
movsd  -0x18(%rbp),%xmm0
mov    -0x30(%rbp),%ecx
sub    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    -0x60(%rbp),%rdi
call   1030 <_inner_ddot_trans@plt>
cmpl   $0x0,-0x1c(%rbp)
je     120d <_dmmat_trid_unb_r_lower+0xfd>
movsd  -0x60(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1217 <_dmmat_trid_unb_r_lower+0x107>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    116d <_dmmat_trid_unb_r_lower+0x5d>
mov    -0x20(%rbp),%ecx
mov    -0x48(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x30(%rbp)
jmp    114c <_dmmat_trid_unb_r_lower+0x3c>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dmmat_trid_unb_r_lower>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9d,0x8(%rsp)
mov    %ecx,0xc(%rsp)
mov    %rsi,0x20(%rsp)
mov    %rdi,0x18(%rsp)
mov    0x90(%rsp),%eax
test   %eax,%eax
jle    126a <_dmmat_trid_unb_r_lower+0x15a>
mov    %edx,%ebx
mov    %eax,%edx
movslq %ebx,%rax
mov    %rax,0x38(%rsp)
mov    0xc(%rsp),%ecx
mov    %ecx,%eax
imul   %ebx,%eax
movslq %eax,%r12
movslq %ecx,%rax
mov    %rax,0x50(%rsp)
movslq %r8d,%rax
mov    %rax,0x48(%rsp)
shl    $0x3,%r12
mov    %rdx,%rax
mov    %rdx,0x40(%rsp)
mov    %rdx,0x10(%rsp)
movsd  %xmm0,0x28(%rsp)
jmp    11ce <_dmmat_trid_unb_r_lower+0xbe>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x18(%rsp),%rax
mov    0x50(%rsp),%rcx
lea    (%rax,%rcx,8),%rax
mov    %rax,0x18(%rsp)
mov    0x20(%rsp),%rax
mov    0x48(%rsp),%rcx
lea    (%rax,%rcx,8),%rax
mov    %rax,0x20(%rsp)
mov    0x10(%rsp),%rcx
lea    -0x1(%rcx),%rax
cmp    $0x1,%rcx
mov    %rax,0x10(%rsp)
jle    126a <_dmmat_trid_unb_r_lower+0x15a>
cmpl   $0x0,0x8(%rsp)
jle    1190 <_dmmat_trid_unb_r_lower+0x80>
mov    0x20(%rsp),%rax
mov    0x40(%rsp),%rcx
lea    (%rax,%rcx,8),%rax
mov    0x38(%rsp),%rcx
lea    (%rax,%rcx,8),%r14
mov    0x10(%rsp),%rdx
lea    0x0(,%rdx,8),%rax
sub    %rax,%r14
mov    %edx,%r15d
sub    %ecx,%r15d
mov    0x8(%rsp),%r13d
mov    0x18(%rsp),%rbp
jmp    1236 <_dmmat_trid_unb_r_lower+0x126>
xchg   %ax,%ax
movsd  0x0(%rbp),%xmm1
movsd  0x28(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
movsd  %xmm2,0x0(%rbp)
add    $0x8,%rbp
add    $0xffffffff,%r13d
je     1190 <_dmmat_trid_unb_r_lower+0x80>
movq   $0x0,0x30(%rsp)
lea    (%r12,%rbp,1),%rdx
lea    0x30(%rsp),%rdi
mov    %r14,%rsi
mov    %r15d,%ecx
mov    0xc(%rsp),%r8d
call   1030 <_inner_ddot_trans@plt>
movsd  0x30(%rsp),%xmm2
test   %ebx,%ebx
jne    1210 <_dmmat_trid_unb_r_lower+0x100>
movsd  0x28(%rsp),%xmm0
jmp    1223 <_dmmat_trid_unb_r_lower+0x113>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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