double dtrsm(char side, char uplo, char transa, char diag, int m, int n,
             double alpha, double *a, int lda, double *b, int ldb) {
  extern double dtrsm_(char *side, char *uplo, char *transa, char *diag, int *m,
                       int *n, double *alpha, double *a, int *lda, double *b,
                       int *ldb);
  return dtrsm_(&side, &uplo, &transa, &diag, &m, &n, &alpha, a, &lda, b, &ldb);
}


x86 assembly (clang, -O0):
<dtrsm>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    0x28(%rbp),%edi
mov    0x20(%rbp),%rdi
mov    0x18(%rbp),%edi
mov    0x10(%rbp),%rdi
mov    %sil,-0x11(%rbp)
mov    %dl,-0x12(%rbp)
mov    %cl,-0x13(%rbp)
mov    %al,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    0x10(%rbp),%rbx
mov    0x20(%rbp),%r10
lea    -0x11(%rbp),%rdi
lea    -0x12(%rbp),%rsi
lea    -0x13(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
lea    -0x1c(%rbp),%r9
lea    -0x28(%rbp),%r14
lea    0x18(%rbp),%r11
lea    0x28(%rbp),%rax
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <dtrsm_@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtrsm>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x30(%rsp),%r10
mov    0x40(%rsp),%r11
mov    %dil,0x7(%rsp)
mov    %sil,0x6(%rsp)
mov    %dl,0x5(%rsp)
mov    %cl,0x4(%rsp)
mov    %r8d,0xc(%rsp)
mov    %r9d,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
sub    $0x8,%rsp
lea    0x50(%rsp),%rax
lea    0x40(%rsp),%rbx
lea    0x18(%rsp),%r14
lea    0xf(%rsp),%rdi
lea    0xe(%rsp),%rsi
lea    0xd(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x14(%rsp),%r8
lea    0x10(%rsp),%r9
push   %rax
push   %r11
push   %rbx
push   %r10
push   %r14
call   1030 <dtrsm_@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @dtrsm(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i32 %4, i32 %5, double %6, double* %7, i32 %8, double* %9, i32 %10) {
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
%15 = alloca i8
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
%19 = alloca double*
%20 = alloca i32
%21 = alloca double*
%22 = alloca i32
store i8 %0, i8* %12
store i8 %1, i8* %13
store i8 %2, i8* %14
store i8 %3, i8* %15
store i32 %4, i32* %16
store i32 %5, i32* %17
store double %6, double* %18
store double* %7, double** %19
store i32 %8, i32* %20
store double* %9, double** %21
store i32 %10, i32* %22
%23 = load double*, double** %19
%24 = load double*, double** %21
%25 = call double @dtrsm_(i8* %12, i8* %13, i8* %14, i8* %15, i32* %16, i32* %17, double* %18, double* %23, i32* %20, double* %24, i32* %22)
ret double %25
}

LLVM IR (-O2):
define double @dtrsm(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i32 %4, i32 %5, double %6, double* %7, i32 %8, double* %9, i32 %10) {
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
%15 = alloca i8
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
%19 = alloca i32
%20 = alloca i32
store i8 %0, i8* %12
store i8 %1, i8* %13
store i8 %2, i8* %14
store i8 %3, i8* %15
store i32 %4, i32* %16
store i32 %5, i32* %17
store double %6, double* %18
store i32 %8, i32* %19
store i32 %10, i32* %20
%21 = call double @dtrsm_(i8* %12, i8* %13, i8* %14, i8* %15, i32* %16, i32* %17, double* %18, double* %7, i32* %19, double* %9, i32* %20)
ret double %21
}