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


x86 assembly (clang, -O0):
<_dmmat_trid_unb_u_trans>:
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,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    126f <_dmmat_trid_unb_u_trans+0x15f>
mov    -0x48(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    123b <_dmmat_trid_unb_u_trans+0x12b>
cmpl   $0x0,-0x1c(%rbp)
je     11c0 <_dmmat_trid_unb_u_trans+0xb0>
movsd  -0x18(%rbp),%xmm0
mov    -0x40(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    11cd <_dmmat_trid_unb_u_trans+0xbd>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    11cd <_dmmat_trid_unb_u_trans+0xbd>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x60(%rbp),%rsi
mov    -0x38(%rbp),%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    -0x40(%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    -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    1193 <_dmmat_trid_unb_u_trans+0x83>
mov    -0x48(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x60(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1170 <_dmmat_trid_unb_u_trans+0x60>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dmmat_trid_unb_u_trans>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdx,0x10(%rsp)
mov    %rdi,0x20(%rsp)
mov    %r9,(%rsp)
test   %r9d,%r9d
jle    121e <_dmmat_trid_unb_u_trans+0x10e>
mov    (%rsp),%rdx
mov    %edx,%eax
add    $0xffffffff,%edx
imul   %r8d,%edx
movslq %edx,%rdx
lea    (%rsi,%rdx,8),%rbx
movslq %ecx,%r14
movslq %r8d,%rcx
neg    %rcx
mov    %rcx,0x28(%rsp)
lea    -0x8(,%rax,8),%r13
ff
shl    $0x3,%r14
xor    %eax,%eax
mov    %rax,0x8(%rsp)
movsd  %xmm0,0x30(%rsp)
jmp    119f <_dmmat_trid_unb_u_trans+0x8f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x28(%rsp),%rax
lea    (%rbx,%rax,8),%rbx
mov    0x8(%rsp),%rax
add    $0x1,%eax
add    $0xfffffffffffffff8,%r13
mov    %rax,0x8(%rsp)
cmp    (%rsp),%eax
je     121e <_dmmat_trid_unb_u_trans+0x10e>
cmpl   $0x0,0x70(%rsp)
jle    1180 <_dmmat_trid_unb_u_trans+0x70>
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%rcx
add    %ecx,%eax
mov    (%rsp),%rcx
mov    %ecx,%ebp
sub    %eax,%ebp
mov    0x70(%rsp),%r12d
mov    0x20(%rsp),%r15
jmp    1211 <_dmmat_trid_unb_u_trans+0x101>
cs nopw 0x0(%rax,%rax,1)
movsd  (%r15,%r13,1),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
lea    0x18(%rsp),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %ebp,%ecx
call   1030 <_inner_ddot@plt>
movsd  0x30(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  %xmm1,(%r15,%r13,1)
add    %r14,%r15
add    $0xffffffff,%r12d
je     1180 <_dmmat_trid_unb_u_trans+0x70>
cmpl   $0x0,0x10(%rsp)
jne    11d0 <_dmmat_trid_unb_u_trans+0xc0>
xorpd  %xmm1,%xmm1
jmp    11da <_dmmat_trid_unb_u_trans+0xca>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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