#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_rl_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;
  Bcl = Bc + (nC - 1) * ldB;
  for (i = 0; i < nRE; i++) {
    Acl = Ac + (nC - 1) * ldA;
    b0 = Bcl;
    for (j = nC; j > 0; j--) {
      Ar = Acl + j - 1;
      _inner_axpy_trans(b0 + ldB, Ar + 1, b0, alpha, nC - 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_rl_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    0x10(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x20(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1283 <_dmmat_trid_unb_rl_trans+0x173>
mov    -0x10(%rbp),%rax
mov    0x10(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x24(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    0x10(%rbp),%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jle    1269 <_dmmat_trid_unb_rl_trans+0x159>
mov    -0x58(%rbp),%rax
movslq -0x30(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x50(%rbp)
mov    -0x38(%rbp),%rdi
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x50(%rbp),%rsi
add    $0x8,%rsi
mov    -0x38(%rbp),%rdx
movsd  -0x18(%rbp),%xmm0
mov    0x10(%rbp),%ecx
sub    -0x30(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1030 <_inner_axpy_trans@plt>
cmpl   $0x0,-0x1c(%rbp)
je     1200 <_dmmat_trid_unb_rl_trans+0xf0>
movsd  -0x18(%rbp),%xmm0
mov    -0x38(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    121a <_dmmat_trid_unb_rl_trans+0x10a>
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,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%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    -0x30(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x30(%rbp)
jmp    118f <_dmmat_trid_unb_rl_trans+0x7f>
mov    -0x48(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1159 <_dmmat_trid_unb_rl_trans+0x49>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dmmat_trid_unb_rl_trans>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %ecx,(%rsp)
mov    %edx,0xc(%rsp)
mov    %r9d,0x4(%rsp)
test   %r9d,%r9d
jle    123e <_dmmat_trid_unb_rl_trans+0x12e>
mov    0x70(%rsp),%ebp
lea    -0x1(%rbp),%eax
mov    %eax,%ecx
mov    (%rsp),%edx
imul   %edx,%ecx
movslq %ecx,%rcx
lea    (%rdi,%rcx,8),%rcx
mov    %rcx,0x10(%rsp)
imul   %r8d,%eax
cltq
movslq %edx,%r14
movslq %r8d,%rcx
mov    %ebp,%edx
add    %rdx,%rax
lea    (%rsi,%rax,8),%rax
mov    %rax,0x20(%rsp)
shl    $0x3,%rcx
xor    $0xfffffffffffffff8,%rcx
mov    %rcx,0x30(%rsp)
add    $0x1,%rdx
mov    %rdx,0x28(%rsp)
shl    $0x3,%r14
mov    %r14,%r15
neg    %r14
xor    %eax,%eax
movsd  %xmm0,0x18(%rsp)
jmp    11b7 <_dmmat_trid_unb_rl_trans+0xa7>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addq   $0x8,0x10(%rsp)
mov    0x8(%rsp),%eax
add    $0x1,%eax
cmp    0x4(%rsp),%eax
je     123e <_dmmat_trid_unb_rl_trans+0x12e>
mov    %eax,0x8(%rsp)
mov    0x70(%rsp),%eax
test   %eax,%eax
jle    11a0 <_dmmat_trid_unb_rl_trans+0x90>
xor    %r13d,%r13d
mov    0x10(%rsp),%rbx
mov    0x28(%rsp),%r12
mov    0x20(%rsp),%rbp
jmp    1211 <_dmmat_trid_unb_rl_trans+0x101>
nopw   0x0(%rax,%rax,1)
movsd  -0x8(%rbp),%xmm2
movsd  0x18(%rsp),%xmm0
mulsd  %xmm0,%xmm2
movsd  (%rbx),%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx)
add    $0x1,%r13d
add    0x30(%rsp),%rbp
add    $0xffffffffffffffff,%r12
add    %r14,%rbx
cmp    $0x1,%r12
jle    11a0 <_dmmat_trid_unb_rl_trans+0x90>
lea    (%rbx,%r15,1),%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r13d,%ecx
mov    (%rsp),%r8d
call   1030 <_inner_axpy_trans@plt>
cmpl   $0x0,0xc(%rsp)
je     11e0 <_dmmat_trid_unb_rl_trans+0xd0>
movsd  (%rbx),%xmm2
movsd  0x18(%rsp),%xmm0
movapd %xmm0,%xmm1
jmp    11f3 <_dmmat_trid_unb_rl_trans+0xe3>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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