#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*/ dgemm_(char *, char *, int *, int *, int *, double *,
                          double *, int *, double *, int *, double *, double *,
                          int *);
void matlib_mmult(int rowsA, int colsB, int k, double *a, double *b,
                  double *c) {
  char trans = 'N';
  double alpha = 1;
  double beta = 0;
  dgemm_(&trans, &trans, &rowsA, &colsB, &k, &alpha, a, &rowsA, b, &k, &beta, c,
         &rowsA);
}


x86 assembly (clang, -O0):
<matlib_mmult>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x78,%rsp
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
movb   $0x4e,-0x41(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x30(%rbp),%r15
mov    -0x38(%rbp),%r14
mov    -0x40(%rbp),%r10
lea    -0x41(%rbp),%rsi
lea    -0x1c(%rbp),%rax
lea    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%rbx
lea    -0x50(%rbp),%r9
lea    -0x58(%rbp),%r11
mov    %rsi,%rdi
mov    %rax,%rdx
mov    %rbx,%r8
mov    %r15,(%rsp)
mov    %rax,0x8(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbx,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1030 <dgemm_@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<matlib_mmult>:
push   %rbx
sub    $0x20,%rsp
mov    %r9,%rax
mov    %r8,%r11
mov    %rcx,%r10
mov    %edi,0xc(%rsp)
mov    %esi,0x8(%rsp)
mov    %edx,0x4(%rsp)
movb   $0x4e,0x3(%rsp)
movabs $0x3ff0000000000000,%rcx
mov    %rcx,0x18(%rsp)
movq   $0x0,0x10(%rsp)
sub    $0x8,%rsp
lea    0x14(%rsp),%rdx
lea    0x18(%rsp),%rbx
lea    0xc(%rsp),%r8
lea    0xb(%rsp),%rdi
lea    0x10(%rsp),%rcx
lea    0x20(%rsp),%r9
mov    %rdi,%rsi
push   %rdx
push   %rax
push   %rbx
push   %r8
push   %r11
push   %rdx
push   %r10
call   1030 <dgemm_@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @matlib_mmult(i32 %0, i32 %1, i32 %2, double* %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i8
%14 = alloca double
%15 = alloca double
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
store i8 78, i8* %13
store double 1.000000e+00, double* %14
store double 0.000000e+00, double* %15
%16 = load double*, double** %10
%17 = load double*, double** %11
%18 = load double*, double** %12
%19 = call i32 @dgemm_(i8* %13, i8* %13, i32* %7, i32* %8, i32* %9, double* %14, double* %16, i32* %7, double* %17, i32* %9, double* %15, double* %18, i32* %7)
ret void
}

LLVM IR (-O2):
define void @matlib_mmult(i32 %0, i32 %1, i32 %2, double* %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
%11 = alloca double
%12 = alloca double
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8 78, i8* %10
%13 = bitcast double* %11 to i8*
store double 1.000000e+00, double* %11
%14 = bitcast double* %12 to i8*
store double 0.000000e+00, double* %12
%15 = call i32 @dgemm_(i8* %10, i8* %10, i32* %7, i32* %8, i32* %9, double* %11, double* %3, i32* %7, double* %4, i32* %9, double* %12, double* %5, i32* %7)
ret void
}