#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*/ dlaswp_3l(int, double *, int, int /*<<< orphan*/, int,
                             int *);
int /*<<< orphan*/ dtrsm_l_l_n_u_3l(int, int, double *, int, double *, int);
int /*<<< orphan*/ dtrsm_l_u_n_n_3l(int, int, double *, int, double *, int);
void dgetrs_3l(int n, int nrhs, double *A, int lda, int *ipiv, double *B,
               int ldb, int *info) {
  if (n == 0 || nrhs == 0)
    return;
  dlaswp_3l(nrhs, B, ldb, 0, n, ipiv);
  dtrsm_l_l_n_u_3l(n, nrhs, A, lda, B, ldb);
  dtrsm_l_u_n_n_3l(n, nrhs, A, lda, B, ldb);
  return;
}


x86 assembly (clang, -O0):
<dgetrs_3l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1168 <dgetrs_3l+0x38>
cmpl   $0x0,-0x8(%rbp)
jne    116d <dgetrs_3l+0x3d>
jmp    11ba <dgetrs_3l+0x8a>
mov    -0x8(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    0x10(%rbp),%edx
mov    -0x4(%rbp),%r8d
mov    -0x20(%rbp),%r9
xor    %ecx,%ecx
call   1040 <dlaswp_3l@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    0x10(%rbp),%r9d
call   1050 <dtrsm_l_l_n_u_3l@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    0x10(%rbp),%r9d
call   1030 <dtrsm_l_u_n_n_3l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgetrs_3l>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
je     11a2 <dgetrs_3l+0x72>
mov    %esi,%ebp
test   %esi,%esi
je     11a2 <dgetrs_3l+0x72>
mov    %r9,%r12
mov    %r8,%r9
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %edi,%ebx
mov    0x40(%rsp),%r13d
mov    %ebp,%edi
mov    %r12,%rsi
mov    %r13d,%edx
xor    %ecx,%ecx
mov    %ebx,%r8d
call   1040 <dlaswp_3l@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    %r12,%r8
mov    %r13d,%r9d
call   1050 <dtrsm_l_l_n_u_3l@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    %r12,%r8
mov    %r13d,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <dtrsm_l_u_n_n_3l@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @dgetrs_3l(i32 %0, i32 %1, double* %2, i32 %3, i32* %4, double* %5, i32 %6, i32* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca double*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca double*
%15 = alloca i32
%16 = alloca i32*
store i32 %0, i32* %9
store i32 %1, i32* %10
store double* %2, double** %11
store i32 %3, i32* %12
store i32* %4, i32** %13
store double* %5, double** %14
store i32 %6, i32* %15
store i32* %7, i32** %16
%17 = load i32, i32* %9
%18 = icmp eq i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %8
%20 = load i32, i32* %10
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %19, %8
br label %44
23: ; preds = %19
%24 = load i32, i32* %10
%25 = load double*, double** %14
%26 = load i32, i32* %15
%27 = load i32, i32* %9
%28 = load i32*, i32** %13
%29 = call i32 @dlaswp_3l(i32 %24, double* %25, i32 %26, i32 0, i32 %27, i32* %28)
%30 = load i32, i32* %9
%31 = load i32, i32* %10
%32 = load double*, double** %11
%33 = load i32, i32* %12
%34 = load double*, double** %14
%35 = load i32, i32* %15
%36 = call i32 @dtrsm_l_l_n_u_3l(i32 %30, i32 %31, double* %32, i32 %33, double* %34, i32 %35)
%37 = load i32, i32* %9
%38 = load i32, i32* %10
%39 = load double*, double** %11
%40 = load i32, i32* %12
%41 = load double*, double** %14
%42 = load i32, i32* %15
%43 = call i32 @dtrsm_l_u_n_n_3l(i32 %37, i32 %38, double* %39, i32 %40, double* %41, i32 %42)
br label %44
44: ; preds = %23, %22
ret void
}

LLVM IR (-O2):
define void @dgetrs_3l(i32 %0, i32 %1, double* %2, i32 %3, i32* %4, double* %5, i32 %6, i32* nocapture readnone %7) {
%9 = icmp eq i32 %0, 0
%10 = icmp eq i32 %1, 0
%11 = or i1 %9, %10
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = tail call i32 @dlaswp_3l(i32 %1, double* %5, i32 %6, i32 0, i32 %0, i32* %4)
%14 = tail call i32 @dtrsm_l_l_n_u_3l(i32 %0, i32 %1, double* %2, i32 %3, double* %5, i32 %6)
%15 = tail call i32 @dtrsm_l_u_n_n_3l(i32 %0, i32 %1, double* %2, i32 %3, double* %5, i32 %6)
br label %16
16: ; preds = %8, %12
ret void
}