#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 *, long *, long *, long *, double *,
                          double *, long *, double *, long *, double *,
                          double *, long *);
void dmat_mul_brow(double **ax1, double **ax2, double **b11, double **b12,
                   double **b21, double **b22, long n, double **cx1,
                   double **cx2) {
  double alpha = 1.;
  double beta = 0.;
  beta = 0.;
  dgemm_("n", "n", &n, &n, &n, &alpha, *b11, &n, *ax1, &n, &beta, *cx1, &n);
  beta = 1.;
  dgemm_("n", "n", &n, &n, &n, &alpha, *b21, &n, *ax2, &n, &beta, *cx1, &n);
  beta = 0.;
  dgemm_("n", "n", &n, &n, &n, &alpha, *b12, &n, *ax1, &n, &beta, *cx2, &n);
  beta = 1.;
  dgemm_("n", "n", &n, &n, &n, &alpha, *b22, &n, *ax2, &n, &beta, *cx2, &n);
}


x86 assembly (clang, -O0):
<dmat_mul_brow>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
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  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%r14
mov    -0x18(%rbp),%rax
mov    (%rax),%rbx
mov    0x18(%rbp),%rax
mov    (%rax),%r10
lea    0xe8d(%rip),%rsi
lea    0x10(%rbp),%rax
lea    -0x48(%rbp),%r9
lea    -0x50(%rbp),%r11
mov    %rsi,%rdi
mov    %rax,%rdx
mov    %rax,%rcx
mov    %rax,%r8
mov    %r14,(%rsp)
mov    %rax,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1030 <dgemm_@plt>
movsd  0xe3e(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%r14
mov    -0x20(%rbp),%rax
mov    (%rax),%rbx
mov    0x18(%rbp),%rax
mov    (%rax),%r10
lea    0xe25(%rip),%rsi
lea    0x10(%rbp),%rax
lea    -0x48(%rbp),%r9
lea    -0x50(%rbp),%r11
mov    %rsi,%rdi
mov    %rax,%rdx
mov    %rax,%rcx
mov    %rax,%r8
mov    %r14,(%rsp)
mov    %rax,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1030 <dgemm_@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%r14
mov    -0x18(%rbp),%rax
mov    (%rax),%rbx
mov    0x20(%rbp),%rax
mov    (%rax),%r10
lea    0xdc2(%rip),%rsi
lea    0x10(%rbp),%rax
lea    -0x48(%rbp),%r9
lea    -0x50(%rbp),%r11
mov    %rsi,%rdi
mov    %rax,%rdx
mov    %rax,%rcx
mov    %rax,%r8
mov    %r14,(%rsp)
mov    %rax,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1030 <dgemm_@plt>
movsd  0xd73(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x40(%rbp),%rax
mov    (%rax),%r14
mov    -0x20(%rbp),%rax
mov    (%rax),%rbx
mov    0x20(%rbp),%rax
mov    (%rax),%r10
lea    0xd5a(%rip),%rsi
lea    0x10(%rbp),%rax
lea    -0x48(%rbp),%r9
lea    -0x50(%rbp),%r11
mov    %rsi,%rdi
mov    %rax,%rdx
mov    %rax,%rcx
mov    %rax,%r8
mov    %r14,(%rsp)
mov    %rax,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1030 <dgemm_@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmat_mul_brow>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9,0x28(%rsp)
mov    %r8,0x18(%rsp)
mov    %rcx,0x20(%rsp)
mov    %rdx,%r10
mov    %rsi,%r12
mov    %rsi,0x10(%rsp)
mov    %rdi,%r14
mov    0x78(%rsp),%r11
movabs $0x3ff0000000000000,%rax
mov    %rax,0x30(%rsp)
movq   $0x0,0x8(%rsp)
sub    $0x8,%rsp
lea    0x78(%rsp),%rbx
lea    0x10(%rsp),%r15
lea    0xe93(%rip),%rbp
lea    0x38(%rsp),%r13
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %rbx,%rcx
mov    %rbx,%r8
mov    %r13,%r9
push   %rbx
push   (%r11)
push   %r15
push   %rbx
push   (%r14)
push   %rbx
push   (%r10)
call   1030 <dgemm_@plt>
add    $0x40,%rsp
movabs $0x3ff0000000000000,%rax
mov    %rax,0x8(%rsp)
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %rbx,%rcx
mov    %rbx,%r8
mov    %r13,%r9
push   %rbx
mov    0x88(%rsp),%rax
push   (%rax)
push   %r15
push   %rbx
push   (%r12)
push   %rbx
mov    0x50(%rsp),%rax
push   (%rax)
call   1030 <dgemm_@plt>
add    $0x40,%rsp
movq   $0x0,0x8(%rsp)
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %rbx,%rcx
mov    %rbx,%r8
mov    %r13,%r9
push   %rbx
mov    0x90(%rsp),%r12
push   (%r12)
push   %r15
push   %rbx
push   (%r14)
push   %rbx
mov    0x58(%rsp),%rax
push   (%rax)
call   1030 <dgemm_@plt>
add    $0x40,%rsp
movabs $0x3ff0000000000000,%rax
mov    %rax,0x8(%rsp)
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %rbx,%rcx
mov    %rbx,%r8
mov    %r13,%r9
push   %rbx
push   (%r12)
push   %r15
push   %rbx
mov    0x38(%rsp),%rax
push   (%rax)
push   %rbx
mov    0x60(%rsp),%rax
push   (%rax)
call   1030 <dgemm_@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"n\00"
define void @dmat_mul_brow(double** %0, double** %1, double** %2, double** %3, double** %4, double** %5, i64 %6, double** %7, double** %8) {
%10 = alloca double**
%11 = alloca double**
%12 = alloca double**
%13 = alloca double**
%14 = alloca double**
%15 = alloca double**
%16 = alloca i64
%17 = alloca double**
%18 = alloca double**
%19 = alloca double
%20 = alloca double
store double** %0, double*** %10
store double** %1, double*** %11
store double** %2, double*** %12
store double** %3, double*** %13
store double** %4, double*** %14
store double** %5, double*** %15
store i64 %6, i64* %16
store double** %7, double*** %17
store double** %8, double*** %18
store double 1.000000e+00, double* %19
store double 0.000000e+00, double* %20
store double 0.000000e+00, double* %20
%21 = load double**, double*** %12
%22 = load double*, double** %21
%23 = load double**, double*** %10
%24 = load double*, double** %23
%25 = load double**, double*** %17
%26 = load double*, double** %25
%27 = call i32 @dgemm_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64* %16, i64* %16, i64* %16, double* %19, double* %22, i64* %16, double* %24, i64* %16, double* %20, double* %26, i64* %16)
store double 1.000000e+00, double* %20
%28 = load double**, double*** %14
%29 = load double*, double** %28
%30 = load double**, double*** %11
%31 = load double*, double** %30
%32 = load double**, double*** %17
%33 = load double*, double** %32
%34 = call i32 @dgemm_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64* %16, i64* %16, i64* %16, double* %19, double* %29, i64* %16, double* %31, i64* %16, double* %20, double* %33, i64* %16)
store double 0.000000e+00, double* %20
%35 = load double**, double*** %13
%36 = load double*, double** %35
%37 = load double**, double*** %10
%38 = load double*, double** %37
%39 = load double**, double*** %18
%40 = load double*, double** %39
%41 = call i32 @dgemm_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64* %16, i64* %16, i64* %16, double* %19, double* %36, i64* %16, double* %38, i64* %16, double* %20, double* %40, i64* %16)
store double 1.000000e+00, double* %20
%42 = load double**, double*** %15
%43 = load double*, double** %42
%44 = load double**, double*** %11
%45 = load double*, double** %44
%46 = load double**, double*** %18
%47 = load double*, double** %46
%48 = call i32 @dgemm_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64* %16, i64* %16, i64* %16, double* %19, double* %43, i64* %16, double* %45, i64* %16, double* %20, double* %47, i64* %16)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"n\00"
define void @dmat_mul_brow(double** nocapture %0, double** nocapture %1, double** nocapture %2, double** nocapture %3, double** nocapture %4, double** nocapture %5, i64 %6, double** nocapture %7, double** nocapture %8) {
%10 = alloca i64
%11 = alloca double
%12 = alloca double
store i64 %6, i64* %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 = load double*, double** %2
%16 = load double*, double** %0
%17 = load double*, double** %7
%18 = call i32 @dgemm_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64* %10, i64* %10, i64* %10, double* %11, double* %15, i64* %10, double* %16, i64* %10, double* %12, double* %17, i64* %10)
store double 1.000000e+00, double* %12
%19 = load double*, double** %4
%20 = load double*, double** %1
%21 = load double*, double** %7
%22 = call i32 @dgemm_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64* %10, i64* %10, i64* %10, double* %11, double* %19, i64* %10, double* %20, i64* %10, double* %12, double* %21, i64* %10)
store double 0.000000e+00, double* %12
%23 = load double*, double** %3
%24 = load double*, double** %0
%25 = load double*, double** %8
%26 = call i32 @dgemm_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64* %10, i64* %10, i64* %10, double* %11, double* %23, i64* %10, double* %24, i64* %10, double* %12, double* %25, i64* %10)
store double 1.000000e+00, double* %12
%27 = load double*, double** %5
%28 = load double*, double** %1
%29 = load double*, double** %8
%30 = call i32 @dgemm_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64* %10, i64* %10, i64* %10, double* %11, double* %27, i64* %10, double* %28, i64* %10, double* %12, double* %29, i64* %10)
ret void
}