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


x86 assembly (clang, -O0):
<_dmmat_trid_unb_ru_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    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    124e <_dmmat_trid_unb_ru_trans+0x13e>
mov    -0x48(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    1234 <_dmmat_trid_unb_ru_trans+0x124>
mov    -0x58(%rbp),%rax
movslq -0x30(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x38(%rbp),%rdx
movsd  -0x18(%rbp),%xmm0
mov    -0x30(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1030 <_inner_axpy_trans@plt>
cmpl   $0x0,-0x1c(%rbp)
je     11d5 <_dmmat_trid_unb_ru_trans+0xc5>
movsd  -0x18(%rbp),%xmm0
mov    -0x38(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    11ef <_dmmat_trid_unb_ru_trans+0xdf>
movsd  -0x18(%rbp),%xmm0
mov    -0x50(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%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    -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    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1178 <_dmmat_trid_unb_ru_trans+0x68>
mov    -0x48(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    114d <_dmmat_trid_unb_ru_trans+0x3d>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dmmat_trid_unb_ru_trans>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %ecx,0x4(%rsp)
mov    %edx,0xc(%rsp)
mov    %rsi,0x18(%rsp)
mov    %r9d,0x8(%rsp)
test   %r9d,%r9d
jle    1216 <_dmmat_trid_unb_ru_trans+0x106>
mov    %rdi,%rbx
movslq 0x4(%rsp),%r13
movslq %r8d,%rax
lea    0x8(,%rax,8),%rcx
mov    %rcx,0x28(%rsp)
shl    $0x3,%rax
mov    %rax,0x30(%rsp)
shl    $0x3,%r13
xor    %eax,%eax
movsd  %xmm0,0x10(%rsp)
jmp    1186 <_dmmat_trid_unb_ru_trans+0x76>
nopl   0x0(%rax,%rax,1)
add    $0x8,%rbx
mov    0x20(%rsp),%rax
add    $0x1,%eax
cmp    0x8(%rsp),%eax
je     1216 <_dmmat_trid_unb_ru_trans+0x106>
mov    %rax,0x20(%rsp)
cmpl   $0x0,0x70(%rsp)
jle    1170 <_dmmat_trid_unb_ru_trans+0x60>
mov    %rbx,%rbp
mov    0x18(%rsp),%r12
mov    %r12,%r15
xor    %r14d,%r14d
jmp    11e8 <_dmmat_trid_unb_ru_trans+0xd8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%r12),%xmm2
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm2
movsd  0x0(%rbp),%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x0(%rbp)
add    $0x1,%r14
add    0x28(%rsp),%r12
add    0x30(%rsp),%r15
add    %r13,%rbp
mov    0x70(%rsp),%eax
cmp    %r14,%rax
je     1170 <_dmmat_trid_unb_ru_trans+0x60>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
mov    %r14d,%ecx
mov    0x4(%rsp),%r8d
call   1030 <_inner_axpy_trans@plt>
cmpl   $0x0,0xc(%rsp)
je     11b0 <_dmmat_trid_unb_ru_trans+0xa0>
movsd  0x0(%rbp),%xmm2
movsd  0x10(%rsp),%xmm0
movapd %xmm0,%xmm1
jmp    11c5 <_dmmat_trid_unb_ru_trans+0xb5>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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