#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 */
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ dgemm(char, char, scalar_t__, scalar_t__, scalar_t__, double,
                         double *, scalar_t__, double *, scalar_t__, double,
                         double *, scalar_t__);
void dgemm_crc(double *A, double *B, double *C, int32_t m, int32_t n, int32_t k,
               double beta) {
  dgemm('N', 'T', m, n, k, 1.0, A, (m > 0) ? m : 1, B, (n > 0) ? n : 1, beta, C,
        (m > 0) ? m : 1);
}


x86 assembly (clang, -O0):
<dgemm_crc>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0xc0,%rsp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
movsd  %xmm0,-0x48(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x30(%rbp)
jle    1173 <dgemm_crc+0x63>
mov    -0x30(%rbp),%rax
mov    %rax,-0x70(%rbp)
jmp    1181 <dgemm_crc+0x71>
mov    $0x1,%eax
mov    %rax,-0x70(%rbp)
jmp    1181 <dgemm_crc+0x71>
mov    -0x70(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x38(%rbp)
jle    11ac <dgemm_crc+0x9c>
mov    -0x38(%rbp),%rax
mov    %rax,-0x88(%rbp)
jmp    11bd <dgemm_crc+0xad>
mov    $0x1,%eax
mov    %rax,-0x88(%rbp)
jmp    11bd <dgemm_crc+0xad>
mov    -0x88(%rbp),%rax
mov    %rax,-0xa0(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x28(%rbp),%rax
mov    %rax,-0x90(%rbp)
cmpq   $0x0,-0x30(%rbp)
jle    11fe <dgemm_crc+0xee>
mov    -0x30(%rbp),%rax
mov    %rax,-0xa8(%rbp)
jmp    120f <dgemm_crc+0xff>
mov    $0x1,%eax
mov    %rax,-0xa8(%rbp)
jmp    120f <dgemm_crc+0xff>
mov    -0x90(%rbp),%r10
movsd  -0x98(%rbp),%xmm1
ff
mov    -0xa0(%rbp),%r11
mov    -0x78(%rbp),%rbx
mov    -0x80(%rbp),%r14
mov    -0x50(%rbp),%r9
mov    -0x58(%rbp),%r8
mov    -0x60(%rbp),%rcx
mov    -0x68(%rbp),%rdx
mov    -0xa8(%rbp),%rax
mov    $0x4e,%edi
mov    $0x54,%esi
movsd  0xdaa(%rip),%xmm0
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <dgemm@plt>
add    $0xc0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgemm_crc>:
push   %r14
push   %rbx
push   %rax
movaps %xmm0,%xmm1
mov    %rdx,%r11
mov    %rsi,%r10
mov    %rdi,%r14
test   %rcx,%rcx
mov    $0x1,%ebx
cmovg  %rcx,%rbx
mov    $0x1,%eax
test   %r8,%r8
cmovg  %r8,%rax
sub    $0x8,%rsp
movsd  0xebc(%rip),%xmm0
mov    $0x4e,%edi
mov    $0x54,%esi
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r9,%r8
mov    %r14,%r9
push   %rbx
push   %r11
push   %rax
push   %r10
push   %rbx
call   1030 <dgemm@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @dgemm_crc(double* %0, double* %1, double* %2, i64 %3, i64 %4, i64 %5, double %6) {
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca double
store double* %0, double** %8
store double* %1, double** %9
store double* %2, double** %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store double %6, double* %14
%15 = load i64, i64* %11
%16 = load i64, i64* %12
%17 = load i64, i64* %13
%18 = load double*, double** %8
%19 = load i64, i64* %11
%20 = icmp sgt i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %7
%22 = load i64, i64* %11
br label %24
23: ; preds = %7
br label %24
24: ; preds = %23, %21
%25 = phi i64 [ %22, %21 ], [ 1, %23 ]
%26 = load double*, double** %9
%27 = load i64, i64* %12
%28 = icmp sgt i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = load i64, i64* %12
br label %32
31: ; preds = %24
br label %32
32: ; preds = %31, %29
%33 = phi i64 [ %30, %29 ], [ 1, %31 ]
%34 = load double, double* %14
%35 = load double*, double** %10
%36 = load i64, i64* %11
%37 = icmp sgt i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %32
%39 = load i64, i64* %11
br label %41
40: ; preds = %32
br label %41
41: ; preds = %40, %38
%42 = phi i64 [ %39, %38 ], [ 1, %40 ]
%43 = call i32 @dgemm(i8 signext 78, i8 signext 84, i64 %15, i64 %16, i64 %17, double 1.000000e+00, double* %18, i64 %25, double* %26, i64 %33, double %34, double* %35, i64 %42)
ret void
}

LLVM IR (-O2):
define void @dgemm_crc(double* %0, double* %1, double* %2, i64 %3, i64 %4, i64 %5, double %6) {
%8 = icmp sgt i64 %3, 1
%9 = select i1 %8, i64 %3, i64 1
%10 = icmp sgt i64 %4, 1
%11 = select i1 %10, i64 %4, i64 1
%12 = tail call i32 @dgemm(i8 signext 78, i8 signext 84, i64 %3, i64 %4, i64 %5, double 1.000000e+00, double* %0, i64 %9, double* %1, i64 %11, double %6, double* %2, i64 %9)
ret void
}