#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(double *, double const *, double *, double, int);
void _dmmat_trid_unb_l_trans(double *Bc, const double *Ac, double alpha,
                             int unit, int ldB, int ldA, int nRE, int nC) {
  register int i, j;
  register double *b0, *b1, *Bcr;
  double xtmp;
  register const double *Ar;
  Bcr = Bc;
  for (i = 0; i < nRE; i++) {
    Ar = Ac + i + unit;
    b0 = Bcr;
    for (j = 0; j < nC; j++) {
      xtmp = unit ? alpha * b0[0] : 0.0;
      _inner_ddot(&xtmp, Ar, b0 + unit, alpha, nRE - unit - i);
      b0[0] = xtmp;
      b0 += ldB;
    }
    Bcr++;
    Ac += ldA;
  }
}


x86 assembly (clang, -O0):
<_dmmat_trid_unb_l_trans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%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    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    124b <_dmmat_trid_unb_l_trans+0x13b>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    121c <_dmmat_trid_unb_l_trans+0x10c>
cmpl   $0x0,-0x1c(%rbp)
je     11ab <_dmmat_trid_unb_l_trans+0x9b>
movsd  -0x18(%rbp),%xmm0
mov    -0x38(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    11b8 <_dmmat_trid_unb_l_trans+0xa8>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    11b8 <_dmmat_trid_unb_l_trans+0xa8>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x58(%rbp),%rsi
mov    -0x38(%rbp),%rdx
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
movsd  -0x18(%rbp),%xmm0
mov    -0x28(%rbp),%ecx
sub    -0x1c(%rbp),%ecx
sub    -0x2c(%rbp),%ecx
lea    -0x50(%rbp),%rdi
call   1030 <_inner_ddot@plt>
movsd  -0x50(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    117e <_dmmat_trid_unb_l_trans+0x6e>
mov    -0x48(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1145 <_dmmat_trid_unb_l_trans+0x35>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dmmat_trid_unb_l_trans>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdx,0x20(%rsp)
mov    %rsi,0x18(%rsp)
mov    %rdi,0x28(%rsp)
mov    %r9d,0xc(%rsp)
test   %r9d,%r9d
jle    124c <_dmmat_trid_unb_l_trans+0x13c>
movslq 0x20(%rsp),%rax
movslq %ecx,%r15
movslq %r8d,%rcx
mov    %rcx,0x48(%rsp)
mov    0xc(%rsp),%ecx
mov    %rcx,0x40(%rsp)
mov    %rax,0x38(%rsp)
lea    0x0(,%rax,8),%r12
shl    $0x3,%r15
xor    %eax,%eax
mov    %rax,0x10(%rsp)
movsd  %xmm0,0x50(%rsp)
jmp    11b5 <_dmmat_trid_unb_l_trans+0xa5>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
addq   $0x8,0x28(%rsp)
mov    0x18(%rsp),%rax
mov    0x48(%rsp),%rcx
lea    (%rax,%rcx,8),%rax
mov    %rax,0x18(%rsp)
mov    0x10(%rsp),%rcx
add    $0x1,%rcx
mov    %rcx,%rax
mov    %rcx,0x10(%rsp)
cmp    0x40(%rsp),%rcx
je     124c <_dmmat_trid_unb_l_trans+0x13c>
cmpl   $0x0,0x90(%rsp)
jle    1180 <_dmmat_trid_unb_l_trans+0x70>
mov    0x18(%rsp),%rax
mov    0x38(%rsp),%rcx
lea    (%rax,%rcx,8),%rax
mov    0x10(%rsp),%rcx
lea    (%rax,%rcx,8),%rbp
mov    0x20(%rsp),%rax
add    %ecx,%eax
mov    0xc(%rsp),%r14d
sub    %eax,%r14d
mov    0x90(%rsp),%r13d
mov    0x28(%rsp),%rbx
jmp    123f <_dmmat_trid_unb_l_trans+0x12f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rbx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
lea    (%rbx,%r12,1),%rdx
lea    0x30(%rsp),%rdi
mov    %rbp,%rsi
mov    %r14d,%ecx
call   1030 <_inner_ddot@plt>
movsd  0x50(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
movsd  %xmm1,(%rbx)
add    %r15,%rbx
add    $0xffffffff,%r13d
je     1180 <_dmmat_trid_unb_l_trans+0x70>
cmpl   $0x0,0x20(%rsp)
jne    1200 <_dmmat_trid_unb_l_trans+0xf0>
xorpd  %xmm1,%xmm1
jmp    1208 <_dmmat_trid_unb_l_trans+0xf8>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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