#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*/ pdgemm_(char *, char *, int *, int *, int *, double *,
                           double *, int *, int *, int *, double *, int *,
                           int *, int *, double *, double *, int *, int *,
                           int *);
void p_matprod(double *a, int *desca, double *b, int *descb, double *c,
               int *descc) {
  char trans = 'N';
  int ij = 1;
  double one = 1.0, zero = 0.0;
  int m, n, k;
  m = desca[2];
  n = descb[3];
  k = desca[3];
  pdgemm_(&trans, &trans, &m, &n, &k, &one, a, &ij, &ij, desca, b, &ij, &ij,
          descb, &zero, c, &ij, &ij, descc);
}


x86 assembly (clang, -O0):
<p_matprod>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x48(%rbp)
mov    %r8,-0x50(%rbp)
mov    %r9,-0x58(%rbp)
movb   $0x4e,-0x59(%rbp)
movl   $0x1,-0x60(%rbp)
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x74(%rbp)
mov    -0x48(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x78(%rbp)
mov    -0x38(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x30(%rbp),%r13
mov    -0x38(%rbp),%r12
mov    -0x40(%rbp),%r15
mov    -0x48(%rbp),%r14
mov    -0x50(%rbp),%r11
mov    -0x58(%rbp),%rax
lea    -0x59(%rbp),%rsi
lea    -0x74(%rbp),%rdx
lea    -0x78(%rbp),%rcx
lea    -0x7c(%rbp),%r8
lea    -0x68(%rbp),%r9
lea    -0x60(%rbp),%r10
lea    -0x70(%rbp),%rbx
mov    %rsi,%rdi
mov    %r13,(%rsp)
mov    %r10,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %r12,0x18(%rsp)
mov    %r15,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %r10,0x30(%rsp)
mov    %r14,0x38(%rsp)
mov    %rbx,0x40(%rsp)
mov    %r11,0x48(%rsp)
mov    %r10,0x50(%rsp)
mov    %r10,0x58(%rsp)
mov    %rax,0x60(%rsp)
call   1030 <pdgemm_@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_matprod>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
mov    %r9,%r15
mov    %r8,%r14
mov    %rcx,%r12
mov    %rdx,%r11
mov    %rsi,%rax
mov    %rdi,%r10
movb   $0x4e,0xf(%rsp)
movl   $0x1,0x1c(%rsp)
movabs $0x3ff0000000000000,%rcx
mov    %rcx,0x28(%rsp)
movq   $0x0,0x20(%rsp)
mov    0x8(%rsi),%ecx
mov    %ecx,0x18(%rsp)
mov    0xc(%r12),%ecx
mov    %ecx,0x14(%rsp)
mov    0xc(%rsi),%ecx
mov    %ecx,0x10(%rsp)
sub    $0x8,%rsp
lea    0x24(%rsp),%rbx
lea    0x28(%rsp),%r13
lea    0x17(%rsp),%rdi
lea    0x20(%rsp),%rdx
lea    0x1c(%rsp),%rcx
lea    0x18(%rsp),%r8
lea    0x30(%rsp),%r9
mov    %rdi,%rsi
push   %r15
push   %rbx
push   %rbx
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rbx
push   %r11
push   %rax
push   %rbx
push   %rbx
push   %r10
call   1030 <pdgemm_@plt>
add    $0xa0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @p_matprod(double* %0, i32* %1, double* %2, i32* %3, double* %4, i32* %5) {
%7 = alloca double*
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32*
%11 = alloca double*
%12 = alloca i32*
%13 = alloca i8
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store double* %0, double** %7
store i32* %1, i32** %8
store double* %2, double** %9
store i32* %3, i32** %10
store double* %4, double** %11
store i32* %5, i32** %12
store i8 78, i8* %13
store i32 1, i32* %14
store double 1.000000e+00, double* %15
store double 0.000000e+00, double* %16
%20 = load i32*, i32** %8
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = load i32, i32* %21
store i32 %22, i32* %17
%23 = load i32*, i32** %10
%24 = getelementptr inbounds i32, i32* %23, i64 3
%25 = load i32, i32* %24
store i32 %25, i32* %18
%26 = load i32*, i32** %8
%27 = getelementptr inbounds i32, i32* %26, i64 3
%28 = load i32, i32* %27
store i32 %28, i32* %19
%29 = load double*, double** %7
%30 = load i32*, i32** %8
%31 = load double*, double** %9
%32 = load i32*, i32** %10
%33 = load double*, double** %11
%34 = load i32*, i32** %12
%35 = call i32 @pdgemm_(i8* %13, i8* %13, i32* %17, i32* %18, i32* %19, double* %15, double* %29, i32* %14, i32* %14, i32* %30, double* %31, i32* %14, i32* %14, i32* %32, double* %16, double* %33, i32* %14, i32* %14, i32* %34)
ret void
}

LLVM IR (-O2):
define void @p_matprod(double* %0, i32* %1, double* %2, i32* %3, double* %4, i32* %5) {
%7 = alloca i8
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8 78, i8* %7
%14 = bitcast i32* %8 to i8*
store i32 1, i32* %8
%15 = bitcast double* %9 to i8*
store double 1.000000e+00, double* %9
%16 = bitcast double* %10 to i8*
store double 0.000000e+00, double* %10
%17 = bitcast i32* %11 to i8*
%18 = bitcast i32* %12 to i8*
%19 = bitcast i32* %13 to i8*
%20 = getelementptr inbounds i32, i32* %1, i64 2
%21 = load i32, i32* %20
store i32 %21, i32* %11
%22 = getelementptr inbounds i32, i32* %3, i64 3
%23 = load i32, i32* %22
store i32 %23, i32* %12
%24 = getelementptr inbounds i32, i32* %1, i64 3
%25 = load i32, i32* %24
store i32 %25, i32* %13
%26 = call i32 @pdgemm_(i8* %7, i8* %7, i32* %11, i32* %12, i32* %13, double* %9, double* %0, i32* %8, i32* %8, i32* %1, double* %2, i32* %8, i32* %8, i32* %3, double* %10, double* %4, i32* %8, i32* %8, i32* %5)
ret void
}